The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help: Time Var (Edit - Reputation Modify Not Working)
I would like to add a variable to the $userinfo array within $vbulletin. For reference, the variable would probably be called $lastmodify (i.e. $vbulletin->userinfo['lastmodify']).
This variable would be just like $lastvisit or $lastactivity (an integer that holds a time). I know that I would put this in the physical files. What I don't know is how I would go about setting and checking it. See, I want vBulletin to add something to a user every 24 hours if they are logged in (or if they login 24 hours after the last time something was added). So that's why I need to add this additional variable - to define the last time that their account was modified. Refer to next post for problem vvv Thanks in advance --------------- Added [DATE]1223915141[/DATE] at [TIME]1223915141[/TIME] --------------- I've gotten the time thing worked out, I believe. I added the new variable to the $userinfo array, but it's not working. I'm thinking that this might be because it's in the PHP files but it's not in the user table in the SQL database. I'm not quite sure how to create another row in the MySQL database that is similar to lastvisit. I've checked out the Insert option in phpMyAdmin, but that's just becoming confusing. Can anyone give me some basic instruction? |
#2
|
|||
|
|||
I'm not sure exactly what you are trying to do, but you need to add another column to the usertable to store this new variable. Then you need to work out how to update the value and when.
|
#3
|
|||
|
|||
Thanks for the response!
I've worked out how to update the variable, but it hasn't been updating because it wasn't in the database. I thought that what I needed was a new row, not a new column. Aren't lastvisit and lastactivity rows? If so, then I need a new row, because I need to store a time like those values. I wouldn't know how to add a row - if it is a row. Hopefully, I've just got the two terms confused. --------------- Added [DATE]1223918858[/DATE] at [TIME]1223918858[/TIME] --------------- Well, I managed to figure out how to just add a row. I added the row lastrepadd to the user table. It has the properties of the other time variables, like lastvisit. This is the PHP code that I've got planted in the index.php file. I can't figure out why it's not working. PHP Code:
|
#4
|
|||
|
|||
Column = a field in a table
Row = is a record (row) in a table. |
#5
|
|||
|
|||
Yeah, that's what I thought, but now I have a new problem. I made the new row and everything, but it's not really saving... Here's the PHP code I put in the index.php.
PHP Code:
|
#6
|
|||
|
|||
Have you added the lastrepadd to the datamanager? It won't allow you to save unless you do so.
|
#7
|
|||
|
|||
Yes, here's the little bit that I added it in:
PHP Code:
PHP Code:
|
#8
|
|||
|
|||
Okay, do a pre_save() check with the manager and see if there are errors popping up.
|
#9
|
|||
|
|||
You should not edit any files to add a field to the allowed fields list.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|