Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by patvdv patvdv is offline
Developer Last Online: Sep 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-27-2002 Last Update: Never Installs: 0
 
No support by the author.

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:
        if ($forum['forumimg'] && $forum['cancontainthreads']==&& $depth==2) {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level2_post_image")."\";");
        } else {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
        } 
However with this code, all my forums show up twice, so I assume somewhere the forumhome_forumbit_level2_post template is evaluated twice. The forumhome_forumbit_level2_post_image is the customized template that would show the icon.

I can't figure out how to undo the double-up on my forums. Any help much appreciated!

Download Now

File Type: (21.4 KB, 18 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-27-2002, 12:52 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where are you placing that code?
Reply With Quote
  #3  
Old 01-27-2002, 12:57 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi FireFly,

I put the code right under the code from your sponsoring hack.
Reply With Quote
  #4  
Old 01-27-2002, 12:59 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please post the whole block of that code, plus 5-10 lines above and below?
Reply With Quote
  #5  
Old 01-27-2002, 01:01 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There you go:

PHP Code:
        if ( !isset($forum['moderators']) ) {
          
$forum['moderators'] = ' ';
        }

        if (
$forum['cancontainthreads']==1) {
          
$tempext '_post';
        } else {
          
$tempext '_nopost';
        }

        
// Category sponsoring hack
        
if ($forum['sponsorimg'] && $forum['cancontainthreads']==&& $depth==1) {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level1_nopost_sponsor")."\";");
        } else {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
        }
        
// Category sponsoring hack

        
if ($forum['forumimg'] && $forum['cancontainthreads']==&& $depth==2) {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level2_post_image")."\";");
        } else {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
        }

        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"]); 
Reply With Quote
  #6  
Old 01-27-2002, 01:19 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
        if ( !isset($forum['moderators']) ) {
          $forum['moderators'] = '&nbsp;';
        }

        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"]);
Reply With Quote
  #7  
Old 01-27-2002, 01:30 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 01-27-2002, 01:53 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Up to you.
Reply With Quote
  #9  
Old 01-27-2002, 02:05 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07904 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete