Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Sep 2015, 15:01
aminp30 aminp30 is offline
 
Join Date: Jul 2013
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

how can I use them in my custom php page?
Reply With Quote
  #2  
Old 09 Sep 2015, 21:14
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
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.
Reply With Quote
  #3  
Old 09 Sep 2015, 21:23
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by squidsk View Post
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.
thank you for reply. i know . that was an example to show you what I need.
this code works in php file:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I need some code like this one. and I need a code to set data to database too.
Reply With Quote
  #4  
Old 10 Sep 2015, 08:38
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
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
Reply With Quote
  #5  
Old 10 Sep 2015, 12:53
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by cellarius View Post
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
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
Reply With Quote
  #6  
Old 11 Sep 2015, 12:56
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Looking for ImpEx?
Reply With Quote
  #7  
Old 11 Sep 2015, 14:18
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by Zachery View Post
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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?

Last edited by aminp30; 11 Sep 2015 at 14:27.
Reply With Quote
  #8  
Old 11 Sep 2015, 15:04
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You would need to include the vbulletin global.php in your custom script for that to work. The vbulletin scripts do this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.
Reply With Quote
  #9  
Old 11 Sep 2015, 15:15
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by kh99 View Post
You would need to include the vbulletin global.php in your custom script for that to work. The vbulletin scripts do this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.
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
Reply With Quote
  #10  
Old 11 Sep 2015, 15:18
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
How did you call the second php page?
Reply With Quote
  #11  
Old 11 Sep 2015, 15:41
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by kh99 View Post
How did you call the second php page?
I created a plugin with this code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and in my template I added this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:48.

Layout Options | Width: Wide Color: