PDA

View Full Version : $allowvbcode problems...


Boofo
07-18-2002, 04:04 AM
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):

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

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

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.

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 error_reporting(7); 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 <?php. 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?

Originally posted by FireFly
Make sure there is a error_reporting(7); 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
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:

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.

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.

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

And here is the original code again:

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?