View Full Version : VB templates +username var + php
picamajstori
04-17-2009, 09:49 PM
Hey,
I want to load stuff from database depending on username and still have the same forum layout. I thought templates were an option...there i can get layout and print username but i cant include php code to run my db queries etc. What is the best solution to my problem?
BBR-APBT
04-17-2009, 11:53 PM
Make your own vbulletin powered page.
https://vborg.vbsupport.ru/showthread.php?t=62164
Then enter this conditional on that page.
I suggest using the user id rather then name. Here is the conditional.
<if condition="$bbuserinfo['userid'] == 1"> your information shown here</if>
But if you want user name here is that conditional.
<if condition="$bbuserinfo['username'] == usersname"> your information shown here</if>
To add your own php code make a vbulletin plugin put your php code in the plugin. Find a hook that your page calls which would probably be global since its a custom page. Read about plugins here http://www.vbulletin.com/docs/html/plugin_manager
Dismounted
04-18-2009, 05:05 AM
The username conditional is actually (note quoted name):
<if condition="$bbuserinfo['username'] == 'username'">
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.