Comments (4)
The later option of checking necessary things at the layout is more desirable as it is CjBlog specific check. API applies to every other component.
from cjblog.
Okay agree :), that would mean changes to all views / layouts on the cjblog side. I will first come up with a change in code that we can agree upon and then (if agreed) do a PR for all the changes.
from cjblog.
Okay, just found out that core.pro ACL is not implemented at all, so my first observation that it was only working for the about text was NOT correct (it turned out that I tested with a user who didn't have about text :)
I propose to change it with the following logic (for the article view)
in ./plugins/content/cjblog/cjblog.php (where the about text is filled)
// Check if author has pro-capabilities
$proUser = JFactory::getUser($article->created_by)->authorise('core.pro', 'com_cjblog');
if (!$proUser)
{
$profile['about'] = '';
}
elseif($aboutTextApp == 'easyprofile')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->qn($db->escape($appParams->get('easyprofile_about_field', 'author_info'))).' AS about')
->from('#__jsn_users')
->where('id = '. $article->created_by);
$db->setQuery($query);
$profile['about'] = $db->loadResult();
}
and in ./components/com_cjblog/layouts/default/author_info.php where the link on the avatar is placed
$profileApp = $params->get('profile_component', 'cjblog');
$avatarSize = $params->get('article_avatar_size', 96);
// Check if author has pro-capabilities
$proUser = JFactory::getUser($article->created_by)->authorise('core.pro', 'com_cjblog');
$userProfileUrl = ($proUser ? $api->getUserProfileUrl($profileApp, $article->created_by) : '#');
and then for the actual generation of the avatar:
<a href="<?php echo $userProfileUrl;?>" class="thumbnail">
from cjblog.
Looks good. Please send me the PR.
from cjblog.
Related Issues (7)
- Avatar size in Author_info not respecting configured size HOT 2
- Add Easy Profile as avatar and profile provider HOT 2
- Custom tag for Social Media buttons HOT 4
- Missing Article / author info on top of article HOT 4
- Article images handled by cblog content plugin corrupting template HOT 2
- An error has occurred. 0 Call to undefined method Joomla\CMS\Form\Field\EditorField::save() - CjBlog Component on Joomla 4 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cjblog.