vBulletin Modifications

[How To] Create forum counters

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support > vBulletin Modification Tutorials

Reply
 
LinkBack Thread Tools
Old 05-17-2006, 03:23 AM   #1
Niels
Support Staff
Niels's Avatar
Join Date: Jun 2004
Real Name: Niels
Location: NL
Niels is on a distinguished road

Default [How To] Create forum counters

As requested by lasto. In this example I'll show you how to add a new counter, that you can enable for forums, to count new threads started in there by a member. Everywhere where I use the word Jokes you can replace it with what you want to call it!
Run these query's:
You must first be a registered member to view any code.
Add a new plugin (hook: forumadmin_edit_form):
You must first be a registered member to view any code.
Add a new plugin (hook: forumdata_start):
You must first be a registered member to view any code.
Add a new plugin (hook: newthread_post_complete):
You must first be a registered member to view any code.
Add a new plugin (hook: useradmin_edit_column1):
You must first be a registered member to view any code.
Add a new plugin (hook:userdata_start):
You must first be a registered member to view any code.
Edit template postbit and postbit_legacy.
Find:
You must first be a registered member to view any code.
Add under:
You must first be a registered member to view any code.
That's it Hope it worked for you, if not? Feel free to ask




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 05-17-2006, 03:59 AM   #2
Michael Biddle
Administrator
Michael Biddle's Avatar
Join Date: Feb 2005
Real Name: Michael Biddle
Location: Anaheim
Michael Biddle is on a distinguished road

Default

works great, keep up the good work
__________________
Support will ONLY be offered through forums


Michael Biddle / vBHackers.com
vBSEO 3.1 GOLD Released vB Blogs Compatible | Non-Encrypted | Branding Removal Option | Sitemaps 2.1 | Language Packs

Crawlability Network: vBulletin SEO | vBulletin Hackers
Affiliates: vBulletinSetup
Are you interested in a Recipe mod for vBulletin
Free Modifications: Latest X Posts on Forumhome | Default Signature | Default Signature Per Usergroup




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 04:42 AM   #3
Coder
Join Date: Apr 2004
lasto is on a distinguished road

Default

what can i say m9 Thank you.

Believe me i really needed this and what with being on the new vbull throught it would`nt happen.Really appreciate your time on this Niels.

Last edited by lasto; 05-17-2006 at 05:07 AM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 05:07 AM   #4
Coder
Join Date: Apr 2004
lasto is on a distinguished road

Default

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (jok

Going though phpmyadmin gives me this error

ERROR: Unknown Punctuation String @ 4
STR: ->
SQL: $db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (jokes VARCHAR(250) NOT NULL DEFAULT '')")

Last edited by lasto; 05-17-2006 at 05:10 AM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 08:37 AM   #5
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

You're supposed to run the queries in a PHP script, not in phpmyadmin :p




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 10:16 AM   #6
Coder
Join Date: Apr 2004
lasto is on a distinguished road

Default

run the queries in a script ??? How

anytime i have to run queries i run em through the admin option of Run Query - but cause it failed i ran em directly though PHPmyadmin.

So basically i just add the queires above to Index.php and they will be called when the main index page is called is that correct or showthread.php cause thats where they will be seen ??




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 11:52 AM   #7
Junior Member
Join Date: May 2006
Tycoon is on a distinguished road

Default

This is EXACTLY what I have been looking for but I am stuck on the query bit just like Lasto. How do you run a PHP script with query?

Thank you for your contribution and help.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 11:58 AM   #8
Coder
Join Date: Apr 2004
lasto is on a distinguished road

Default

ok suzzed it and it works nice one m8

These plugins are really new to me - ive done it and it all works but i was used to actually hacking the php files - well easier this way


is there anyway i cna set it to auto update for the threads that are already made in that section as its only counting any new ones that are made.
Also i would really like an updater cause any threads i delete still leave the counter adding one.
I dont mind running the script to update the stats manually say once per week so if u can help id be well happy with this hack.

Last edited by lasto; 05-17-2006 at 12:03 PM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 11:59 AM   #9
Coder
Join Date: Apr 2004
lasto is on a distinguished road

Default

Quote:
Originally Posted by Tycoon
This is EXACTLY what I have been looking for but I am stuck on the query bit just like Lasto. How do you run a PHP script with query?

Thank you for your contribution and help.
lo m8

all i did was copy the query to a txt file and saved it in the exstension .php

test.php

then i uploaded it to the forums and ran it - so the tables where added then i deleted the test.php so the tables were not re-added (safe purpose)

then just do the rest in admincp




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-17-2006, 12:00 PM   #10
Junior Member
Join Date: May 2006
Tycoon is on a distinguished road

Default

Lasto: Can you tell me how you achieved it? I am still. Thanks.

[EDIT:OOP, you were quicker . Thanks Lasto!]




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[How To] Run vBulletin On your P.C. Ken Iovino vBulletin Modification Tutorials 81 12-15-2007 02:50 AM
[How To] Run a Query Ken Iovino vBulletin Modification Tutorials 6 08-29-2007 02:23 PM
[How to] Add navigation groups to your admincp left panel Ken Iovino vBulletin Modification Tutorials 11 07-15-2007 11:59 PM
[How To] Add Options per forum Ken Iovino vBulletin Modification Tutorials 10 03-03-2007 03:25 PM
[How To] Run a vb page outside of the forum directory Junior vBulletin Modification Tutorials 7 01-10-2007 07:05 PM


All times are GMT -3. The time now is 10:07 PM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)