The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi everyone,
I would like users of my site to be able to add comments or rate products in a part of my site that is external to VBulletin. To make this simple and prevent abuse/spam etc I would like to allow this only for forum members who are also logged in. I am using 3.7.1 but shortly updating to 3.8.1 I've had a look over the mods and bits and bobs and there's a fair few scripts that should allow login/logout in external pages. But I want to keep it simpler than that, sending the user off to the actual forum to log in first (logic behind this, let VBulletin worry about login/paswords, cookies etc, seems more secure than me trying to do it). All I need to do then is check in my script, which for simplicity will be in the same folder as the forum, whether someone is logged in to VBulletin. I have seen this sort of code: PHP Code:
If so is this the right code: PHP Code:
Finally, what would be the code to check if the user (assuming already checked they are logged in) is of a particular usergroup. Is it this: PHP Code:
Quote:
Finally, is there a list somewhere of other user info I can get similar to $vbulletin->userinfo['usergroupid'] ie. what other info userinfo['parameter'] can be used to retrieve? Regards, Ingenious |
#2
|
||||
|
||||
![]()
Here's an article on writing external pages - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. And you'll see that they include global.php and then can use the user variables and templates and such.
The condition for a usergroup would be (using usergroup 6 here): PHP Code:
PHP Code:
|
#3
|
|||
|
|||
![]()
Thanks for your reply and that link. This has given me the confidence to try a quick PHP script, and this works a treat (I know this is basic stuff, but I am still a beginner!):
PHP Code:
This is great as I can now restrict options and content on my site to only valid (and logged in) forum members. JOB DONE ![]() |
#4
|
||||
|
||||
![]()
Good to see it worked!
Good idea to start with something basic and work from there. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|