vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   custom on/off for a forum ID (https://vborg.vbsupport.ru/showthread.php?t=41679)

CRego3D 07-30-2002 02:13 AM

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

Logician 07-30-2002 08:26 AM

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..

Demonslayer 08-22-2002 07:50 PM

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 :)

Logician 08-22-2002 08:16 PM

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..

Demonslayer 08-22-2002 10:28 PM

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)

Xenon 08-22-2002 11:12 PM

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...

Demonslayer 08-23-2002 12:42 PM

same error....:(

Logician 08-23-2002 02:06 PM

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.

Demonslayer 08-23-2002 08:32 PM

ok, I'm not home atm, and yes, I was using Opera. When I get home I'll copy & paste with IE. Thanks Logician. :D

Demonslayer 08-23-2002 10:38 PM

it works now, thanks Logician & Xenon :D


All times are GMT. The time now is 01:42 AM.

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.01000 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete