vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $allowvbcode problems... (https://vborg.vbsupport.ru/showthread.php?t=41220)

Boofo 07-18-2002 04:04 AM

$allowvbcode problems...
 
I am having problems with the smilies and vbcode buttons showing up all the time in the sig editor hack when I use the second code below. If I use the first code, I get an undefined variable error.

Here is the original code (this code is from the sig editor hack):

PHP Code:

 if ($bbuserinfo[showvbcode])
    
$vbcode_smilies getclickysmilies();
  if (
$bbuserinfo[showvbcode])
    
$vbcode_buttons getcodebuttons(); 

I kept getting an undefined variable error until I added $cbutton in the code below (I have the custom button hack installed):

PHP Code:

 if ($bbuserinfo[showvbcode])
    
$vbcode_smilies getclickysmilies();
  if (
$bbuserinfo[showvbcode])
    
$vbcode_buttons getcodebuttons($cbutton); 

And here is my clumsy (but really trying) attempt at straightening it out (with this I get no smiles OR vbcode in the sig editor):

PHP Code:

if ($bbuserinfo[showvbcode] && $allowvbcodebuttons) {
    
$vbcode_smilies getclickysmilies();
  if (
$bbuserinfo[showvbcode] && $allowvbcodebuttons) {
    
$cbutton $bbuserinfo[cbutton];
 
$vbcode_buttons getcodebuttons($cbutton);
  }
  } 

These things happen no matter what I have it set to in the vBulletrin options for smiles or vbcode in the sig editor settings. Can anyone please tell me what I can do to fix this or help me figure it out?

Hwulex 07-18-2002 02:16 PM

What happens when you add the $cbutton variable? What's the error?

Hwulex

Boofo 07-18-2002 04:57 PM

No error happens, but the vbcode buttons and the smilies can not be turned off or on in the Admin CP.

Quote:

Originally posted by Hwulex
What happens when you add the $cbutton variable? What's the error?

Hwulex


Admin 07-18-2002 07:08 PM

Make sure there is a [minicode]error_reporting(7);[/minicode] line in the hack's file.

Boofo 07-18-2002 07:37 PM

That code wasn't there, so I put it in right after the [minicode]<?php[/minicode]. It still doesn't show the vbcode buttons or the smilies whether they are on or off in the Admin CP. Is the code I added correct for the if statements?

Quote:

Originally posted by FireFly
Make sure there is a [minicode]error_reporting(7);[/minicode] line in the hack's file.

Admin 07-18-2002 07:52 PM

Now undo the changes you did.

Boofo 07-18-2002 09:28 PM

1 Attachment(s)
I put in the "error reporting line" like you told me. The sedit file gave me the same errors I had in the beginning. I had to add back the $cbutton part to stop the errors:

PHP Code:

 if ($bbuserinfo[showvbcode])
$vbcode_smilies getclickysmilies();
if (
$bbuserinfo[showvbcode])
$vbcode_buttons getcodebuttons($cbutton); 

And here is a screenshot of the sig editor (attached) with the smilies and vbcode disabled. They still show up and are functional.

Quote:

Originally posted by FireFly
Now undo the changes you did.

Boofo 07-21-2002 12:41 AM

I think I found a solution to my problem with the smilies and bbcode either not showing up when they should or showing up when they shouldn't with the sig-editor hack installed. Here is the code I used to make it work right. I also took out the custom button hack ($cbutton) since it seemed to be messing with a few things concerning bbcode.

PHP Code:

 if ($bbuserinfo[showvbcode]  && $allowsmilies)
    
$vbcode_smilies getclickysmilies();
   if (
$bbuserinfo[showvbcode] && $allowbbcode)
    
$vbcode_buttons getcodebuttons(); 

And here is the original code again:

PHP Code:

 if ($bbuserinfo[showvbcode])
    
$vbcode_smilies getclickysmilies();
   if (
$bbuserinfo[showvbcode])
    
$vbcode_buttons getcodebuttons(); 

Is there an easier or more right way to do this?

And, also, what does the erorr_reporting 7 thing do at the top of the files? Should it be in all php files we use on our forums or is there something else that has to be in the files to make it work with that?


All times are GMT. The time now is 07:43 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.01385 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
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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