Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2002, 02:13 AM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default custom on/off for a forum ID

Little help here

this is the code in index.php for the on/off buttons

Code:
        if ($bbuserinfo['lastvisitdate']=='Never') {
          $forum['onoff']='on';
        } else {
                                        if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['
lastvisit']) {
                                                $userlastvisit=$bbforumview[$forum['forumid']];
                                        } else {
                                                $userlastvisit=$bbuserinfo['lastvisit'];
                                        }
          if ($userlastvisit<$forum['lastpost']) {
            $forum['onoff']='on';
          } else {
            $forum['onoff']='off';
          }
        }

        if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
          $forum['onoff'].='lock';
        }
now my question is this .. is there a way I can add an IF that says

if forumid equals number 20 (using 20 as an example) then $forum['onoff']='20on'; ... $forum['onoff']='20off';

The idea is to have custom on/off buttons to certain forums .. is this possible ?

Carlos
Reply With Quote
  #2  
Old 07-30-2002, 08:26 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

add

PHP Code:
if ($forum['forumid']==X) {$forum['onoff']='20on';} 
After:
PHP Code:
$forum['onoff']='off'
and

PHP Code:
$forum['onoff']='on'
(There are 2 occurences, add it after BOTH of them)

Replace X with the forumid.

Enjoy..
Reply With Quote
  #3  
Old 08-22-2002, 07:50 PM
Demonslayer's Avatar
Demonslayer Demonslayer is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been trying to get this to work to no avial. Can you please post the part of the code already modified (i.e. replace this with this)

Thanks in advance
Reply With Quote
  #4  
Old 08-22-2002, 08:16 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit index.php, find:

PHP Code:
 } else {
            
$forum['onoff']='off';
          }
        } 
After that add:
PHP Code:
if ($forum['forumid']==AND $forum['onoff']='off') {$forum['onoff']='20off';}
if (
$forum['forumid']==AND $forum['onoff']='on') {$forum['onoff']='20on';} 
Dont forget to upload your image files named 20off.gif and 20on.gif to the directory where on.gif and off.gif resides..
Reply With Quote
  #5  
Old 08-22-2002, 10:28 PM
Demonslayer's Avatar
Demonslayer Demonslayer is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for your quick reply, but i still get the same error....

Quote:
Parse error: parse error in /home/virtual/site16/fst/var/www/html/forums/index.php on line 301
(line 301 is the first of the 2 lines you said)
Reply With Quote
  #6  
Old 08-22-2002, 11:12 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try to use that:
PHP Code:
if ($forum['forumid']==AND $forum['onoff']=='off') {$forum['onoff']='20off';}
if (
$forum['forumid']==AND $forum['onoff']=='on') {$forum['onoff']='20on';} 
pal forgot one =

if the error occurs again, look at one line before...
Reply With Quote
  #7  
Old 08-23-2002, 12:42 PM
Demonslayer's Avatar
Demonslayer Demonslayer is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

same error....
Reply With Quote
  #8  
Old 08-23-2002, 02:06 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is no error (at least no parse errors) in this code (after Xenon's correction). Try to reapply carefully..

BTW Are you using Opera as your browser? Then dont copy/paste from here, just type the code manually.
Reply With Quote
  #9  
Old 08-23-2002, 08:32 PM
Demonslayer's Avatar
Demonslayer Demonslayer is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I'm not home atm, and yes, I was using Opera. When I get home I'll copy & paste with IE. Thanks Logician.
Reply With Quote
  #10  
Old 08-23-2002, 10:38 PM
Demonslayer's Avatar
Demonslayer Demonslayer is offline
 
Join Date: Nov 2001
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it works now, thanks Logician & Xenon
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 07:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04398 seconds
  • Memory Usage 2,270KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete