The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Reset Notices
Does anyone know of a php file, that when you go to it, any notices that you dismissed reappears, then drops you back at the forum index.
I have the file from another site, PHP Code:
Any help? |
#2
|
|||
|
|||
It looks like you might be able to put that code in it's own php file, like maybe reset_notices.php, then enter the url (or make a link somewhere) that goes to http://toontowners.com/forums/reset_notices.php.
However...I'm not a security expert or anything, but I think the way $_COOKIE['bbuserid'] is used directly in the SQL is a security risk, so you probably don't want to do that unless you add some other access control for that file. (Or add code to make sure $_COOKIE['bbuserid'] contains only digits). |
#3
|
||||
|
||||
Yes, but how do I change that code, so when users on my site go to the link, http://mysite.com/forums/resetnotices.php, it would re-put the dismissed notices, then drop the users back at the forum index?
|
#4
|
|||
|
|||
Oh..well, if your database server is not 'localhost' then I think you'd want to use the server and port from the config file in place of "localhost", like:
Code:
$servername = $config['MasterServer']['servername']; $port = $config['MasterServer']['port'] ? $config['MasterServer']['port'] : 3306; $con = mysql_connect("$servername:$port",$config['MasterServer']['username'],$config['MasterServer']['password']); ETA: and while we're at it, change the query line like this: Code:
mysql_query("DELETE FROM tta_noticedismissed WHERE userid=" . intval($_COOKIE['bbuserid'])); Hope that helps. |
#5
|
||||
|
||||
So, I put that, in the place of
PHP Code:
|
#6
|
|||
|
|||
Yes.
I haven't tried any of it, so there may be a typo I missed. |
#7
|
||||
|
||||
This is my resetdismiss.php file so far
PHP Code:
Did I code something wrong? |
#8
|
|||
|
|||
I actually don't know if that's the right code to un-dismiss notices. But there is one more thing I missed - that query has a table prefix (tta_) hard-coded and I guess that's not yours. So one more change:
PHP Code:
|
#9
|
||||
|
||||
YES! Thank you! Yes!
It worked! thank you so much! |
#10
|
|||
|
|||
Thank you for this little script. I know this is old but others may find it useful.
One note- if you changed the cookie prefix then that has to be added to the cookie name. In the example above, the prefix is "bb" added to 'userid' and yours may be different. Otherwise, it works well. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|