The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi guys,
I tried to do simple thing in vb 3.8 I created a plugin: Product: vbulletin hook_location: parse_template title: test Plugin PHP Code: $supertest = "works"; Then i tried to use that $supertest in the navbar template, however that variable doesn't display anything. Any idea? |
#2
|
|||
|
|||
![]()
I don't see anything wrong with that. Are you sure you clicked the 'Yes' radio button to make the plugin active? Are you sure you're looking at a style that corresponds to the template you edited? Try putting something like Supertest: $supertest in the template and see if you at least see the Supertest: part.
|
#3
|
|||
|
|||
![]()
Somehow i cannot use that code
$supertest = "works"; It must be: $supertest = 'works'; So i can know use $supertest but what about php global? If i have a global MY_GLOBAL how i can use it later in the template? If i put MY_GLOBAL then it displays "MY_GLOBAL" instead of value ? |
#4
|
|||
|
|||
![]() Quote:
Quote:
But I looked at the code and the parse_templates hook and the place where the navbar template is evaled are both outside any function, so you should be able to use any variable name you want. |
#5
|
|||
|
|||
![]() Quote:
$sql='SELECT * from user WHERE userid='50'' what will happen is, the php script will only register: $sql='SELECT * from user WHERE userid=' as the start and end of the SQL query. the 50'' part will cut off. So to work around, you need to do something like; $sql="SELECT * from user WHERE userid='50'" same thing with plugins hooked to global_start (not sure if it affects over hooks) instead of echo "Hello!"; you need echo 'Hello!'; sounds like i'm teaching you basic stuff lol but for some reason this is what I have noticed. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|