PDA

View Full Version : Run Query to Reset Count to *



Jose Amaral Rego
Thu 3rd May '07, 6:16am
FAQ: What you need to know about running queries (http://www.vbulletin.org/forum/showthread.php?t=78284)

Create at least two working database backups before attemping to Executing Queries.


Backing-up your MySQL Database Manually (http://www.vbulletin.com/docs/html/maintenance_ssh_backup)
Upload and place your vBulletin version behind .htaccess and play with it, test hacks and add your template modification.
Test all your Catagories, Forums, Threads, Posts, User Cp, Adminastrative / Moderator board functions.
List all your hacks on a piece of paper, then visit www.vbulletin.org and find those edit and make sure they are working.



Backup tools if you do not have SHH access from your host.

http://www.ozerov.de/bigdump.php
http://www.mysqldumper.de/en/index.php


What is .htacces (http://www.vbulletin.com/docs/html/securing_vbulletin_restrict)

.htaccess (http://www.javascriptkit.com/howto/htaccess.shtml) .htaccess (http://www.webmastersguide.com/htaccess-cgi/htaccess.htm) .htaccess (http://www.freewebmasterhelp.com/tutorials/htaccess/3)


Use the Update Counters (http://www.vbulletin.com/docs/html/maintenance_counters) if ask to after Execute SQL Query is completed.


So please ask lots and lot of question before executing these queries on your forum's database.

Queries posted here are from members, vBulletin.com and vBulletin.org Staff that posted in these forums and are not to be taken likely, as these can have irreversible affects to your forums database.


vBulletn version 3.5Updating Options En Masse with Queries (http://www.vbulletin.com/forum/showthread.php?t=164379)
vBulletn version 3.6Updating Options En Masse with Queries (http://www.vbulletin.com/forum/showthread.php?t=213135)

Jose Amaral Rego
Thu 3rd May '07, 6:20am
These have only been tested on vbulletin version 3.6.5 non-live forum. No, adverse effects has shown as on yet.

Run Query to Reset Count to *
Members private message unread of user(s) / usergroup to X amount for all or selected user / usergroup identification number
# replace vbb_ with your vB table prefix Example: [vbb_user] if non leave blank
# replace X with new total
# replace X with the new user / usergroup id

UPDATE user SET pmunread = 'X'
UPDATE user SET pmunread = 'X' WHERE userid = 'X';
UPDATE user SET pmunread = 'X' WHERE usergroupid = 'X';

Run Query to Reset Count to *
Online total users to any X amount
# replace vbb_ with your vB table prefix Example: [vbb_datastore] if non leave blank
# replace X with new total

UPDATE datastore SET data = 'X' WHERE title = 'maxloggedin';

Run Query to Reset Count to *
Online total users to any X amount at certain date
# replace vbb_ with your vB table prefix Example: [vbb_datastore] if non leave blank
# replace X with new total
# replace date with Unix timestamp Example: 1167991932 = 01-05-2007 10:12:12

UPDATE datastore SET data = 'a:2:{s:9:\"maxonline\";s:2:\"X\";s:13:\"maxonlinedate\";s10::\"date\";}' WHERE title = 'maxloggedin';
http://www.onlineconversion.com/unix_time.htm
http://www.4webhelp.net/us/timestamp.php

Run Query to Reset Count to *
Members reputation to X amount
# replace vbb_ with your vB table prefix Example: [vbb_user] if non leave blank
# replace X with new total

UPDATE user SET reputation ='X';

Run Query to Reset Count to *
Members reputation of usergroup to X amount for selected usergroup identification number
# replace vbb_ with your vB table prefix Example: [vbb_user] if non leave blank
# replace X with new total
# replace X with the new usergroup id

UPDATE user SET reputation = 'X' WHERE usergroupid = 'X';

Run Query to Reset Count to *
Forum thread count to X amount for selected forum identification number
# replace vbb_ with your vB table prefix Example: [vbb_forum] if non leave blank
# replace X with new total
# replace X with the forum id(s)

UPDATE forum SET threadcount = 'X' WHERE forumid = 'X'

Run Query to Reset Count to *
Forum post replycount to X amount for selected forum identification number
# replace vbb_ with your vB table prefix Example: [vbb_forum] if non leave blank
# replace X with new total
# replace X with the new forum id

UPDATE forum SET replycount = 'X' WHERE forumid = 'X';

Run Query to Reset Count to *
Thread views to X amount for selected thread identification number
# replace vbb_ with your vB table prefix Example: [vbb_thread] if non leave blank
# replace X with new total
# replace X with the new thread id

UPDATE thread SET views = 'X' WHERE threadid = 'X';
Admin CP -> Import & Maintenance -> Update Counters -> Rebuild Thread Information

Run Query to Reset Count to *
All Thread views to X amount
# replace vbb_ with your vB table prefix Example: [vbb_thread] if non leave blank
# replace X with new total

UPDATE thread SET views = 'X';
Admin CP -> Import & Maintenance -> Update Counters -> Rebuild Thread Information