The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||||
Hi,
I am trying to setup a hack that would display an icon in front of each forum title/description (see attachment). The hack is a modification from Firefly's Category sponsoring hack and I managed to do the template and MySQL part of things. However I am having problems with modifying the code in index.php. This is what I have now: PHP Code:
I can't figure out how to undo the double-up on my forums. Any help much appreciated! Download Now
Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Where are you placing that code?
|
|
#3
|
||||
|
||||
|
Hi FireFly,
I put the code right under the code from your sponsoring hack. |
|
#4
|
||||
|
||||
|
Can you please post the whole block of that code, plus 5-10 lines above and below?
|
|
#5
|
||||
|
||||
|
There you go:
PHP Code:
|
|
#6
|
||||
|
||||
|
Code:
if ( !isset($forum['moderators']) ) {
$forum['moderators'] = ' ';
}
if ($forum['cancontainthreads']==1) {
$tempext = '_post';
} else {
$tempext = '_nopost';
}
// Category sponsoring hack
if ($forum['sponsorimg'] && $forum['cancontainthreads']==0 && $depth==1) {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level1_nopost_sponsor")."\";");
} else[high]if ($forum['forumimg'] && $forum['cancontainthreads']==1 && $depth==2) {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level2_post_image")."\";");
} else[/high] {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
}
// Category sponsoring hack
if ($depth<$forumhomedepth) {
$forumbits.=makeforumbit($forum['forumid'],$depth+1,$forumperms);
}
} // END if can view
} // END while ( list($key2,$forum)=each($val1) ) {
} // END while ( list($key1,$val1)=each($iforumcache["$forumid"]) ) {
unset($iforumcache["$forumid"]);
|
|
#7
|
||||
|
||||
|
Bingo! That works like a charm. I now also understand where the double evaluation comes from
Thanks Firefly!Do you reckon this is worth putting up as an official hack? |
|
#8
|
||||
|
||||
|
Up to you.
|
|
#9
|
||||
|
||||
|
Might do. Just trying to elaborate on the hack: would it be possible to have the icon also show up on the 2nd level forum display? I assume this would mean to make a custom template for forumdisplay_forumbit_level2_post but I don't know what PHP code to put in?
|
![]() |
|
|