The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to decrease count in database automatically?
Hi all,
Currently i have two plug-ins to count "Top Tips" that are submitted by a form to a specific forum, every member of my forums has a "My Top Tips" count in their info bar along with a button to submit more if they wish. My problem is they can submit a tip and the count increases fine, so mine shows 5, joe bloggs will show 3....etc however if the post is deleted the figure doesn't decrease and i have to go to the database and change the count manually, can anyone tweak my plugins to do this automatic please? Quote:
Quote:
PHP Code:
|
#2
|
||||
|
||||
You'll need to add a plugin that is called when the post is deleted and then change the count there. When in debug mode, go to delete a post and all the hook locations that are available on that page will be listed on the bottom of the page.
|
#3
|
||||
|
||||
Lynne how do i set vbulletin in debug mode?
|
#4
|
||||
|
||||
Add this at the top of your config.php file right under <?php :
HTML Code:
$config['Misc']['debug'] = true; |
#5
|
||||
|
||||
Quote:
--------------- Added [DATE]1244483578[/DATE] at [TIME]1244483578[/TIME] --------------- Lynne, could you tell me which hook i should use for the plugin? Hooks Called: init_startup fetch_userinfo_query style_fetch cache_templates global_start parse_templates notifications_list global_setup_complete I have this line to remove from the count: PHP Code:
The above were the hooks called prior to me choosing soft or permanent delete! |
#6
|
||||
|
||||
Lynne any thoughts with this?
|
#7
|
||||
|
||||
What script is it you are calling to delete the post? Are you talking about a user deleting it or a mod deleting it? Both of those are different scripts. You'll have different hooks called for each. If a user is doing it in the post, perhaps an editpost_ hook. Go see where those are and if one of them makes sense to use (do a search through your files for "editpost_"). If it's the Moderator dropdown box (so a moderator), then that takes you to the inlinemoderation.php page. Take a look at that page for which hooks are used.
|
#8
|
||||
|
||||
Quote:
Thanks! --------------- Added [DATE]1244572968[/DATE] at [TIME]1244572968[/TIME] --------------- im going to try this hook: inlinemod_deletethread --------------- Added [DATE]1244573206[/DATE] at [TIME]1244573206[/TIME] --------------- It didnt work with the plugin code but didn't cause an error |
#9
|
||||
|
||||
What did you put in the inlinemod_deletethread plugin? Did you find that hook location in the code and verify the variables you are using are correct? (And I thought you were deleting a post, not a thread.)
|
#10
|
||||
|
||||
Hi Lynne, the post/thread will be un answerable the thread is created by a form, users do not have permission to reply or post, so in effect im deleting the thread, im using this in the plugin
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|