The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
writing an sql query
2.3.x version
What this script is supposed to do is allow a member of the view only usergroup the right to post on the forums after this script is run. When a user registers they are placed in a view only usergroup (9.) Once a user decides they want to post, they click on a link that runs this script. This script was written to check that users ipaddress against those in the registered usergroup, post. ipaddress and the banned usergroup.(The banned usergroup(8) check isnt in place as I'm not sure how to add that to this query) This script doesnt cause any mqsql errors, but also doesnt work. Anyone know what I'm doing wrong? PHP Code:
|
#2
|
||||
|
||||
There can be more problems but change this:
user.id = post.userid to: user.userid = post.userid |
#3
|
||||
|
||||
I'm not sure this looks right ...
PHP Code:
|
#4
|
|||
|
|||
Maybe something like this would work better? Also includes checking the banned usergroup, hopefully it helps or gives you some ideas.
PHP Code:
g-force2k2 |
#5
|
||||
|
||||
Quote:
thanks |
#6
|
||||
|
||||
I had to add an else to the final check because the registered template wouldnt show up when it was placed under the registered users check
PHP Code:
Thanks again. Now to add the post check, which will be harder since it cant be checked by the usergroupid |
#7
|
|||
|
|||
Quote:
PHP Code:
Cheers, g-force2k2 |
#8
|
||||
|
||||
it was late, I didnt notice the usergroupid was spelled wrong
Right now all these checks are done manually, which takes quite a bit of time on certain days. I'm trying to figure out a way to make it automatic so the other admins can spend the time on something else. I figure, a user presses a button which links to this script, runs it, the account is approved or not. Since the forum this will run on isn't going to be updated to vb3, a cron job probably wouldnt work, or be hard to set up with 2.x.x. So I thought this would be the best way. There are about 20-25,000 members in the view only group right now. Some people can wait a year or more before deciding they want to post. |
#9
|
||||
|
||||
I'm running into an error running the first query
PHP Code:
using user.userid gave a 1064 error |
#10
|
|||
|
|||
Quote:
PHP Code:
PHP Code:
g-force2k2 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|