MyBB Hacks

Full Version: PHP in Templates / Complex Templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hmm, noob question I know, but I was wondering if there was a direct link to the board url that should be used in templates rather than me putting the "real" url in? Something like

Code:
<img src={mybburl/images/default.avatar.jpg}

Code:
{$mybb->settings['bburl']}

:/ i need recice the avatar only for the gid 4 in postbit

any idea???

i try this but dont work
<if $post['gid'] == 4 then>
<img src blah blah with="">
<elseif $post['fid6'] and $mybb->user['cancp'] then>
<img src blah blah> (the casual code)
<else /></if>
You need $post['usergroup'] to get the user group id.
i try this but dont work Frown
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4)) then>
<a href="{$post['profilelink_plain']}"><img class="post_avatar" src="{$post['avatar']}" alt="" width="80px" height="80px" /></a>
<else>
<a href="{$post['profilelink_plain']}"><img class="post_avatar" src="{$post['avatar']}" alt="" {$avatar_width_height} /></a>
</if>

this recice the avatar of all users
(06-25-2010 04:04 AM)Walkman 5.0 Wrote: [ -> ]<if in_array($GLOBALS['mybb']->user['usergroup'], array(4)) then>

(06-25-2010 03:48 AM)RateU Wrote: [ -> ]You need $post['usergroup'] to get the user group id.
<if in_array($GLOBALS['mybb']->post['usergroup'], array(4)) then>
<a href="{$post['profilelink_plain']}"><img class="post_avatar" src="{$post['avatar']}" alt="" width="80px" height="80px" /></a>
<else>
<a href="{$post['profilelink_plain']}"><img class="post_avatar" src="{$post['avatar']}" alt="" {$avatar_width_height} /></a>
</if>

this dont recice nothing Frown

Code:
<if in_array($post['usergroup'], array(4)) then>
<a href="{$post['profilelink_plain']}"><img src="{$post['avatar']}" alt="" width="80px" height="80px" /></a>
<else>
<a href="{$post['profilelink_plain']}"><img src="{$post['avatar']}" alt="" {$avatar_width_height} /></a>
</if>

=D this is perfect man thanks
Updated to v1.6 to fix issues with MyNetwork: http://resources.xekko.co.uk/thread-66.html
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Reference URL's