Caching templates if they exists.
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #13
RE: Caching templates if they exists.
Because if for example I'm part of the "admin (4)" group as primary, and "Boys (11)" group, and the "Jerks (8)" group as additional groups, in profile MyBB by default will display my displaygroup image (Admin for this example) using {$memprofile['groupimage']}.

Admins will be able to show all additional image gorups using {$memprofile['agi']}.

But if they want to show the "Jerks" groupimage using another template that or far apart from the "Boys" one, they can just paste {$memprofile['agis']['8']} inside the member_profile template.

Then  the plugin just evals the {$memprofile['agis']['8']} variable using the member_profile_groupimage_8 template.

That template may be an exact copy of the member_profile_groupimage one, or a custom code, it doesn't matter.

The thing is that if member_profile_groupimage_8 doesnt exists, I don't want to try to eval the variable, so just return null or ''.

Maybe just attaching my file may be better to understand what I mean.


Please note that {$memprofile['agis']['8']} is suppose to print the group image of GID 8 in profiles, if X user is part of that group in his additional usergroup list, or usegroup (if he has a displaygroup) it will return the image as normal.

But is Y user doesn't have GID 8 as additional the the variable will return null, like empty or whatever.

... Yes, don't even I understand what I write, will try to attach my plugin tomorrow...

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
05-23-2012 05:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Caching templates if they exists. - Sama34 - 05-07-2012, 01:50 PM
RE: Caching templates if they exists. - Sama34 - 05-23-2012 05:57 PM

 Standard Tools
Forum Jump: