Log in

View Full Version : How to make my own php script and access vbulletin database?


geckoz
03-10-2009, 09:26 PM
Hi all,

currently I'm using this addon: http://www.vbulletin-germany.org/showthread.php?t=4869
With this addon I can set up custom pages and access them through my forum. I can use vbulletin variables in there but I can not have PHP code to work with these variables...

I want to be able to have a page using my forum layout and be able to put PHP code in there and make use of the vbulletin variable like userid etc. so that I can updated account information etc. with my PHP script.

Are there any tutorials on how to do that? What would you recommend me to do??

Thank you for your help! :)

Lynne
03-10-2009, 09:34 PM
Take a look at this article for creating your own php page. You may put your queries in the code here - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

geckoz
03-11-2009, 05:14 PM
Thanks for your help. But I don't understand how and where to place the PHP code. I can not place it in the template, or can I? Because in order to do a mysql query I need to know the corresponding userid of the user currently logged in. But any vbulletin variables can only be used in the template and not in the test.php

Lynne
03-11-2009, 05:34 PM
You would place the php code in the php page - right under where it says Start Main Script (and above the $navbits stuff).

bamfonk
03-11-2009, 05:46 PM
Take a look at this article for creating your own php page. You may put your queries in the code here - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

interesting! :)