Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fix for replacement code problem in vB Code
Steve Machol's Avatar
Steve Machol
Join Date: Nov 2001
Posts: 1,896

 

Show Printable Version Email this Page Subscription
Steve Machol Steve Machol is offline 03-08-2002, 10:00 PM

I'm almost embarrassed to call this a 'hack', particularly sincve it's not even mine! :stupid: Actually the code came from FireFly who PM'd me with the answer to this problem I posted on vb.com:

http://www.vbulletin.com/forum/showt...threadid=41430

The problem arises if you try to use replacement variables in vB Code. Beginning with 2.2.3, this no longer works. However the fix (thanks to Chen!) is simple. Just remove or comment out this line from admin/functions.php:

PHP Code:
$bbcode=str_replace("{""{"$bbcode); // stop people posting replacements in their posts 
Of course remving this line will cause the problem of people using replacement variables in posts. However in my case it's a good trade-off.
Reply With Quote
  #22  
Old 03-11-2002, 01:38 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No it's not 'fixed'. Read Wayne Luke's response above.
Reply With Quote
  #23  
Old 03-12-2002, 11:59 AM
Mr. X's Avatar
Mr. X Mr. X is offline
 
Join Date: Oct 2001
Location: Iowa
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can it be cleared whethor or not this hack can be used for the other codes? Im still confused here. All I get is a great quote effect, but just that, and I would like it for the other codes too.
Reply With Quote
  #24  
Old 03-12-2002, 02:26 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure what you're asking or what your are confused about. All this does is allow people replacement variables to be used in posts. In my case I needed this for the quote box. In fact, that's my only use for it.
Reply With Quote
  #25  
Old 03-12-2002, 11:11 PM
Mr. X's Avatar
Mr. X Mr. X is offline
 
Join Date: Oct 2001
Location: Iowa
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok. The hack is called New code, PHP and quote boxes. Well the only thing that changes is the Quote. I would like the same effect for PHP and other codes.

I had a problem when adding the variables, because the color would not change. This thread fixed it. But Im still wondering how to do the rest of the codes. on Vb.org, php code has the same effect, thats what I want to achieve, to have all codes look like the Quote code.
Reply With Quote
  #26  
Old 03-23-2002, 03:02 AM
Radon3k's Avatar
Radon3k Radon3k is offline
 
Join Date: Nov 2001
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok so again, cuz I'm smart like that, you install the original hack by FireFly, then you do the update from this page, correct?
Reply With Quote
  #27  
Old 03-23-2002, 07:19 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.
Reply With Quote
  #28  
Old 03-23-2002, 08:19 AM
feldon23's Avatar
feldon23 feldon23 is offline
 
Join Date: Oct 2001
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, but this is not working for me AT ALL.

Just installed 2.2.4, all my Admin templates are factory.

I go into admin/functions.php and comment out (even tried removing) the line:

$bbcode=str_replace <http://www.php.net/str_replace>("{", "{", $bbcode); // stop people posting replacements in their posts

and reupload it.


then I go into Custom vBCodes >Modify and try either of these:

<blockquote><font face="verdana,arial,helvetica" size="1" >quote:</font><hr><br><table cellpadding="4"cellspacing="0" border=1 bordercolor="#0A293E" bgcolor="#0E3652"
width="90%" align="center"><tr><td><font size="2">{param}</font></tr></td></table><br><hr></blockquote>

<blockquote><font face="verdana,arial,helvetica" size="1" >quote:</font><hr><br><table cellpadding="4" cellspacing="0" border=1 bordercolor="#5F9EA0" bgcolor="#1C5780" width="90%" align="center"><tr><td><font size="2">{param}</font></tr></td></table><br><hr></blockquote>

it goes absolutely apes*** with shredded table pieces all over the place.

and if I do:

<table cellpadding="4"cellspacing="0" border=1 bordercolor="#0A293E" bgcolor="#0E3652"
width="90%" align="center"><tr><td><font size="2">{param}</font></tr></td></table>

I get a green box.

The only thing that works is this:
<table cellpadding="4" cellspacing="0" border=1 bordercolor="#5F9EA0" bgcolor="#1C5780" width="90%" align="center"><tr><td><font size="2" color=FFFFFF>{param}</font></tr></td></table>

It's like there's a limit on how much HTML I can put in.
Reply With Quote
  #29  
Old 03-23-2002, 02:45 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, there's a character limit in the vB Code box.
Reply With Quote
  #30  
Old 03-23-2002, 05:49 PM
feldon23's Avatar
feldon23 feldon23 is offline
 
Join Date: Oct 2001
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there an easy way to change max characters?

I looked in admin/bbcode.php but changing the numbers to 60 didn't seem enough of a solution.
Reply With Quote
  #31  
Old 03-23-2002, 08:23 PM
Radon3k's Avatar
Radon3k Radon3k is offline
 
Join Date: Nov 2001
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I comment out that line, it gives me a parse error on like #1348. have no clue as to why it does, but it seems to work fine if I just do the normal hack.
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 01:14 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.05382 seconds
  • Memory Usage 2,301KB
  • Queries Executed 25 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete