The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
use vb phrases in php file
hi,
I added a page to my vb and used a php file in it. and now I need use vb phrases such as Code:
<vb:if condition="$show['member']"> |
#2
|
||||
|
||||
You can't those types of code are used exclusively in templates. You can use templates that have that code in them in your php files, but that code, since it isn't php can't be used directly in your php files.
|
#3
|
|||
|
|||
Quote:
this code works in php file: Code:
$vbulletin->userinfo['username'] |
#4
|
||||
|
||||
Why would you need a phrase in the php file? All output should be done in the template, so that's where a phrase would typically be called.
Regarding database manipulation: https://vborg.vbsupport.ru/showthread.php?t=119350 |
Благодарность от: | ||
aminp30 |
#5
|
|||
|
|||
Quote:
I have an excel forum. I need to know my user grade in excel. so I decided to create some questions and let them to solve and use their score in postbit. I created a php page. I need access database to use random from questions and I need modify database to change the custom field that I want show in postbit |
#6
|
||||
|
||||
I don't know why anyone didn't tell you, the code you linked is:
1. Not a phrase 2. template code, and specifically a vbulletin defined variable. $show['member'] checks to see if a user has a valid userid. Assuming you've included the vBulletin global.php to get you into the vBulletin environment, the same can be done in php: PHP Code:
|
Благодарность от: | ||
aminp30 |
#7
|
|||
|
|||
Quote:
thank you so much but your code doesn't worked.would you please give me an example? and also in else part, I need system message page that says you don't have permissions. is that possible? |
#8
|
|||
|
|||
You would need to include the vbulletin global.php in your custom script for that to work. The vbulletin scripts do this:
PHP Code:
You can call the vbulletin function print_no_permission() to get the standard no permission message. |
#9
|
|||
|
|||
Quote:
I created a php page with tutorial in this page https://vborg.vbsupport.ru/showthread.php?t=228112 in this tutorial we use require_once('./global.php'); is that OK or we need it directly in my php codes? as you know I created a php page and in template I called another php page. I need this codes for second php page |
#10
|
|||
|
|||
How did you call the second php page?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|