The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Accessing the Infraction Table
Hello again,
I'm doing more work on my forums and I'm looking to do something related to the infraction table. I have already created a new column in my user table, and I plan to have the value as either 0 or 1. A 0 would mean that the user has not received a permanent infraction (never expiring) in the past year, and a 1 would mean the opposite. I am unsure how I would go about tackling this task. Help is appreciated! Thank you! |
#2
|
||||
|
||||
Let's assume you have the userid stored in $userid (and the name of your new column is "new_column), then you could use the queries:
PHP Code:
|
#3
|
|||
|
|||
Thank you so much for your quick reply.
I was hoping to implement this as a cron job, which I can then use whatever the cron job returns in my plugin. As far as I know, you can't use userid's in a cron job? Edit: I was doing some thinking, and would it be able to actually count the number of permanent infractions a user has that were issued within the past year and set it in the new column? |
#4
|
||||
|
||||
Quote:
If that sounds good, I will see if I can construct the correct code for that. |
#5
|
|||
|
|||
Quote:
I came up with this, but I don't know if it is correct for starters, nor how to use the comma-delimited output with the second query. I also want to now count the number of permanent infractions the user has had in the past year and set it in the new column in the user table. PHP Code:
|
#6
|
||||
|
||||
Okay, this is what I had in mind:
PHP Code:
edit 2: I corrected a small typo in the code. |
#7
|
|||
|
|||
Quote:
Is it possible to write the count rather than the 1 and 0? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|