The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Greentext
Thought it would be pretty cool after hearing out a couple requests, but I have no real idea how to go about doing it. Cutting to the chase, greentext *chan style.
Text after a ">" at the beginning of a line would turn all the text after it until a line break green. >exactly like this I understand BBCode could do a job like this pretty simply, but we were looking for something automatic. Would appreciate any help on this. |
#2
|
||||
|
||||
Do you mean in each post?
|
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
I'm no expert but i think you'll need to create a plugin maybe using the hook postdata_save and use some kind of replace function or maybe regex to match any line that starts with >
So the replace function COULD look like this PHP Code:
Or maybe in PCRE format PHP Code:
|
#5
|
|||
|
|||
I managed to get this, stemming somewhat off of yours and hitting up regex and using the hook location postbit_display_complete.
PHP Code:
It seems I can perfectly call the text, but I cannot change its color. If I try to input "<span style=\"color:green\">$pattern</span>"; or any such thing in, it simply returns />.*/ instead of the actual text that regex defines. This occurs even when I place the regex itself in the span tags. |
#6
|
||||
|
||||
Thats beacue in your REGEX (and im no expert!) you are replacing > with '<span style="color:green">text</span>' and not '<span style="color:green">/>*/</span>'
What i mean to say you need to replace >* (so > and wildcard) with >* but wrapped in the span, as it is your replacing it with the word "text" in green Have you tried: PHP Code:
|
#7
|
|||
|
|||
Yeah, I've actually tried that. It wasn't returning the text in the regex. I went a different route and got a working code. Thanks for you help, though, it gave me my starting point.
PHP Code:
|
#8
|
||||
|
||||
Ah yes, i remember that now "$1", glad i got you started
|
#9
|
|||
|
|||
This works great, except it shows up as regular plain text when quoted.
Any way to make it appear as green text in quotes? Never mind; it shows up fine in quotes. It just doesn't show up in reply previews. |
#10
|
|||
|
|||
sorry for the bump, but this does not seem to be working when I added a plugin to postbit_display_complete. is there something that needs to be changed to make it applicable to vb5?
it just doesn't modify the post at all PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|