![]() |
|
Thread Tools |
#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
how can I use them in my custom php page? No members have liked this post.
|
#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.
__________________
Yet Another Awards System - Version 4.0.9 No members have liked this post.
|
#3
|
||||
|
||||
Originally Posted by squidsk
thank you for reply. i know . that was an example to show you what I need.![]()
this code works in php file:
I need some code like this one. and I need a code to set data to database too. No members have liked this post.
|
#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: http://www.vbulletin.org/forum/showthread.php?t=119350
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again. http://www.roma-antiqua.de The following members like this post: aminp30
|
#5
|
|||
|
|||
Originally Posted by cellarius
thanks for reply dear cellarius. your link was great![]()
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 No members have liked this post.
|
#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:
__________________
Looking for ImpEx?
The following members like this post: aminp30
|
#7
|
||||
|
||||
Originally Posted by Zachery
![]()
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? No members have liked this post.
Last edited by aminp30; 11 Sep 2015 at 14:27. |
#8
|
||||
|
||||
You would need to include the vbulletin global.php in your custom script for that to work. The vbulletin scripts do this:
Your custom script would need to be in the vbulletin 'root' directory (the same one as forum.php, showthread.php, etc). If it isn't, then you'd need to cwd() to the vbulletin root before including global.php (then cwd back to the original directory if needed). You can call the vbulletin function print_no_permission() to get the standard no permission message. No members have liked this post.
|
#9
|
||||
|
||||
Originally Posted by kh99
thank you dear k99![]()
I created a php page with tutorial in this page http://www.vbulletin.org/forum/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 No members have liked this post.
|
#10
|
|||
|
|||
How did you call the second php page?
No members have liked this post.
|
#11
|
||||||||
|
||||||||
I created a plugin with this code:
and in my template I added this code:
No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 03:04.