Fix for replacement code problem in vB Code
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:
|
isn't this corrected in 2.2.3?
|
No, this is caused by v2.2.3.
|
oh, ok. Thanks then, I'm installing
|
Excellent. The quote looks great now, however Im still confused as to how do do this with PHP and list code.
|
I do not understand this!? :confused:
|
Quote:
|
so it only works on vb.org?
|
I think that line of code is part of the cross-site scripting issue that was plugged in 2.2.3. While I don't think it will expose you to the entire problem it does present a weakness.
|
this is not changed in 223b grrrr...
lol i got it now.. damn i'm slow sometimes.. this line must be removed only if you installed firefly's hack |
It just stops things like {firstaltcolor} from being converted when you type them into a post.
|
Quote:
|
You should be able to move the line we told you to delete a bit up, before the parsing of vB codes, and then it'll also solve the problem. I don't have the code in front of me right now though
|
Please post that when you have a change FireFly.
|
Nah, if you do this it'll screw PHP code, because every left bracket will be replaced with its HTML entity and the code will be unreadable.
|
Quote:
|
Quote:
What are replacement variables? Do you need to install this hack, or just comment that line out? I'm a bit confused. Please explain (?) |
You cvan find out what replacement variable are by looking at the Replacement sets in your Admin CP. And what I meant was if someone uses a replacement variable in a post (like {firstaltcolor} ) this will automatically translate into the color in question if you remove this line.
I'm not sure if it's fixed here or not. If not, then this will show the hex code: {firstaltcolor} |
I'm still confused....I'm tryin to understand...My mind is going crazy....
|
Is this fixed in v2.2.4?
|
No it's not 'fixed'. Read Wayne Luke's response above.
|
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.
|
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.
|
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. |
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?
|
Yes.
|
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. |
Yes, there's a character limit in the vB Code box.
|
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. |
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.
|
I have no idea why you'd get a parse error unless to entered something wrong in the file. Commenting this line out worked fine for me.
|
hrmm...Well it works normally without commenting it out...So I guess I can leave it like this?
|
As I said in my first post you only need to do this if you want to use replacement variables in vB Code. If you don't need that function, then you don't need to bother with this.
|
Ah ok, then I'm straight I guess...Nice, thanks! :)
|
No probs! :)
|
Quote:
Code:
ALTER TABLE bbcode CHANGE bbcodereplacement bbcodereplacement TEXT; |
I got almost confused when saw in admin/functions.php of VB 2.2.4, within the
function bbcodeparse2() two lines (with some other between) like these: PHP Code:
- Has the problem been solved in 2.2.4 with the above splitting or no ? - Is cutting out the second line still necessary ? - How could I generate the problem to see if that bugfix is actually needed by my board ? Thanks a lot, Steve. Bye |
The line was moved to the end of the function to stop (I think) problems when posting PHP code. But you still need to comment the second line if you want to be able to use replacement variables in your vB Codes.
|
Absolutelly exaustive. Thanks a lot.
|
Hi,
this hack has a disadvantage: text attachments are also parsed. If you have eg. the following description in it (without spaces) Code:
change in template xxx change in template xxx #DFDFDFFireFly to #DFDFDFChen |
All times are GMT. The time now is 10:44 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|