Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-18-2002, 04:04 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default $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?
Reply With Quote
  #2  
Old 07-18-2002, 02:16 PM
Hwulex's Avatar
Hwulex Hwulex is offline
 
Join Date: Mar 2002
Location: Manchester, UK
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Hwulex
Reply With Quote
  #3  
Old 07-18-2002, 04:57 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Make sure there is a [minicode]error_reporting(7);[/minicode] line in the hack's file.
Reply With Quote
  #5  
Old 07-18-2002, 07:37 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Now undo the changes you did.
Reply With Quote
  #7  
Old 07-18-2002, 09:28 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: gif sig.gif (16.9 KB, 0 views)
Reply With Quote
  #8  
Old 07-21-2002, 12:41 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

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:33 AM.


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.05302 seconds
  • Memory Usage 2,266KB
  • Queries Executed 14 (?)
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
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete