The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
problem - BBcode (with php)
Hello,
I have downloaded the plugin https://vborg.vbsupport.ru/showthread.php?t=264896 , which gave me an ability to use PHP in BBcode. For example: PHP Code:
But why do i need PHP in BBcode is to make an additional profile field in which the user will decide how the BBcode will look like to him. So i wanted to insert variables in the replacement field in BBcode section, and put if`s and var values in the Module. BUT the variables are still don`t have values - i used almost all module locations which my mind thought (bbcode_create, global_start, showthread_start and etc.. ) I thought that "okay, i will put the whole thing in the BBcode replacement section, BUT at that point the field57 is not determined >_< . Now i just don`t know how to do this. If someone know - could you please tell me how to "fix" this method. Or maybe there is other method like to make a module/template which will replace the BBcode looking depending on which options the user has selected in field57 . For example what i want: I have a BBcode, which will make the text <b></b>, but if the user has selected the second option in field57 then he will see the text with this BBcode as <i></i> while the users with first option will still see the text as <b></b> . Thank you in advance, people! :* |
#2
|
|||
|
|||
When you say field57 wasn't defined in some places, how did you access it, through $vbulletin->userinfo['field57']? You may need to add a global $vbulletin before that.
Also, I haven't tried the "use PHP in BBcode", but it could be that if you have post caching turned on, it will not work like you'd expect. |
#3
|
||||
|
||||
Quote:
Code:
$vbulletin->userinfo['field57'] userinfo['field57'] $vbulletin->post['field57'] post['field57'] |
#5
|
||||
|
||||
Quote:
Oh my god......it worked! Now i will try to do what i wanted, thank you very much! --------------- Added [DATE]1312026186[/DATE] at [TIME]1312026186[/TIME] --------------- Now, i think the last, what i want to solve is how to define the variable in module, so the php bbcode can access it. --------------- Added [DATE]1312034173[/DATE] at [TIME]1312034173[/TIME] --------------- Quote:
Maybe there is a way to make it working with it on, like changing/creating some templates? --------------- Added [DATE]1312036317[/DATE] at [TIME]1312036317[/TIME] --------------- Or maybe there is a way to re-cache messages when user updates his Options? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|