The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
sql query coding question to select and/or update userfield
Need some help with writing a query to check the condition of two userfields in vbulletin after a user has uploaded photos in photopost. This query will be in a photopost php file (the file used just after a user has finished uploading). The photopost tables and the vbulletin tables are in the same database (makes it a little easier).
The scenario: I have two userfields in vbulletin that if true (value = 1). field#x will display a link to that users photo gallery in the postbit and the member profile. field#xx will dispay the last photo uploaded as a thumbnail in the users' postbit with a link to that users' photo. Both of these are now user sectable in the user options (UserCP), and in the Admin user menu, but I would like this to be set automatically when the user uploads. If this is the first time a user has uploaded photos, then the two values of these fields will be ' ' (null). But if the user has previously uploaded then most likely these values will be '1' (true). Most likely already set by me or the user. So the first step is to check for the values of both fields. Then, based on their conditions, set or don't set the new value The varible for the uploading user in the photopost script is $upuserid. $userid is the variable (PRIMARY KEY) used by vbulletin in the userfield table. This is what I have so far, but I'm stuck on the the two 'if' conditionals. And should I use UPDATE or INSERT INTO Also, in the pohotopost scripting, they use - ppmysql_query - instead of mysql_query. Should I use the same syntax to query the vbulletin table. PHP Code:
John |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|