PHP in Templates and Template Conditionals - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Support (https://community.mybb.com/forum-72.html) +---- Thread: PHP in Templates and Template Conditionals (/thread-31860.html) |
RE: PHP in Templates and Template Conditionals - gokufg - 2010-03-24 Hi Yumi, thanks a lot!!! And if I wanna check the specific forum also? For example I want show "some staff1" in a forum fid=1 and "some staff2" in a forum fid=2. Is it possible? Thanks a lot!! RE: PHP in Templates and Template Conditionals - Yumi - 2010-03-24 <if $GLOBALS['forum']['fid'] == 1 then> blah </if> Won't necessarily work everywhere. RE: PHP in Templates and Template Conditionals - FBI - 2010-03-24 I remember SMF did perfectly. When a moderator post on forum they moderated, their mod usergroup will display. But if his/her post on another forum, usergroup back to normal (general member is displayed). Any idea Yumi? RE: PHP in Templates and Template Conditionals - Yumi - 2010-03-24 <if is_moderator($post['fid'], '', $post['uid']) then> I am a moderator of this forum </if> RE: PHP in Templates and Template Conditionals - FBI - 2010-03-24 Damn nice Yumi Work like a charm Adding link for direct PM existing Moderator.. On postbit_author_user
RE: PHP in Templates and Template Conditionals - gokufg - 2010-03-24 (2010-03-23, 11:10 PM)Yumi Wrote: Maybe try something like this in the postbit template: This code put 'Stuff in first post' in all posts.... (2010-03-24, 08:56 AM)Yumi Wrote: <if $GLOBALS['forum']['fid'] == 1 then> It doesn't work RE: PHP in Templates and Template Conditionals - FBI - 2010-03-24 Hi GokuFG, Try this, and place it on postbit templates
display some stuff like banner or something, right after first post. but, this is only first page for all pages, should be add other conditional base on MyBB "posts per page" setting. Maybe Yumi can help for additional codes RE: PHP in Templates and Template Conditionals - Yumi - 2010-03-25
RE: PHP in Templates and Template Conditionals - gokufg - 2010-03-25 the code
It's ok and works EDIT I tried to insert in forum template and the "first post in forum id 36" showed in that forum... But I'd like show "first post in forum id 36" in all threads of forum 36 and i all subforums. Do you understand? RE: PHP in Templates and Template Conditionals - Yumi - 2010-03-26 (2010-03-25, 10:31 AM)gokufg Wrote: and the "first post in forum id 36" showed in that forum... But I'd like show "first post in forum id 36" in all threads of forum 36 and i all subforums. Do you understand?Read up on PHP and how it evaluates conditionals. I'm only going to help with simple requirements, but for more complex things, you really should spend the few minutes to learn how it really works under the hood. |