Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2010, 09:04 PM
xash xash is offline
 
Join Date: Dec 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to update User Titles and Ranks automatically?

Ranks are not updating automatically for my users. Is there a way to automatically update user titles and ranks? I don't want to manually run Admin CP > Maintenance > Update Counters > Update User Titles and Ranks each time.

Does anyone know if this can be run as a cron job or any mod that does this?

I'm currently using vB 3.7.3. Do other versions of vBulletin have the capability to run this automatically? How about vB 3.8.4 or vB 4.0.2?

I searched both vBulletin.com and vBulletin.org, but the only responses to "ranks are not updating" seem to be "then run Admin CP > Maintenance > Update Counters > Update User Titles and Ranks". I'm looking for a way to do this automatically.

Thanks.
Reply With Quote
  #2  
Old 03-01-2010, 07:59 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do any of your Scheduled Tasks run?
Reply With Quote
  #3  
Old 03-01-2010, 08:15 AM
xash xash is offline
 
Join Date: Dec 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Marco, thanks for your response.

Yes, schedule tasks do run, but I don't believe any of them updates counters. The schedule tasks that currently run include promotions.php, threadviews.php, subscriptions.php, etc.

What did you have in mind?

--------------- Added [DATE]1267438686[/DATE] at [TIME]1267438686[/TIME] ---------------

ETA: If you know of a PHP script that can do this (update titles and ranks), please let me know and I'll add a new scheduled task using the script.
Reply With Quote
  #4  
Old 03-01-2010, 08:18 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then they should be updated automatically.

To troubleshoot this, please remove any hacks and disable your plugins, then see if you still have this problem.
Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

define('DISABLE_HOOKS', true);

If so, reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server.
Reply With Quote
  #5  
Old 03-01-2010, 08:21 AM
xash xash is offline
 
Join Date: Dec 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Then they should be updated automatically.
None of the scheduled task scripts updates counters. Do you know which .php script updates User Titles and Ranks?
Reply With Quote
  #6  
Old 03-01-2010, 08:32 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

promotion.php for sure does update ranks.
Reply With Quote
  #7  
Old 03-01-2010, 09:08 AM
xash xash is offline
 
Join Date: Dec 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aah, I see what you mean now. It makes sense that promotion.php should update ranks. Here's the thing though, I'm using Ranks differently.

Users subscribe to a Rank, by purchasing a Paid Subscription.
The subscription script adds them to a new rank (through the use of an additional user group), e.g. Paid Rank
When they purchase the Paid Rank subscription, they are automatically given the rank of Paid Rank and their new Rank is displayed correctly.
However - and here's where I'm facing the issue - when their subscription period ends, the rank is not removed. Their profile and posts still show Paid Rank. promotions.php does not update (remove) users from Paid Rank after expiry of their Paid Rank subscription.

What works for now is either:

a. Manually go to Admin CP, user's profile, and just hit save, or
b. Manually run "Update user titles and ranks"

I'm looking for a script that can essentially automatically do what "Update User Titles and Ranks" does, and run it every night, instead of running it manually.

The obvious response is: "You're doing it wrong, you should be using User Titles for this". But I need to use Ranks for this, because users are essentially purchasing Custom Titles using a Paid Subscription, and their original User Title is becoming their new Rank, so basically someone who is:

Username
Premium Member

can buy a Paid Subscription for Custom Title and become:

Username
Custom Title
Premium Member

(where Premium Member is the Rank)

So, my question is: Is there a script that does what "Update User Titles and Ranks" does? Or is there another approach that can solve this issue?

Thanks.
Reply With Quote
  #8  
Old 03-01-2010, 09:37 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're doing it wrong, you should be using User Titles for this.

But i have just tested the following:
- Created 2 ranks.
-- 1 active for the 'Registered users' usergroup, minimum posts set to 1. ("Reg Rank")
-- 1 active only for the 'Moderators' usergroup (only do this on a test forum ), minimum posts =1 ("Mod Rank")
- Created test user with 2 threads
- While test user still in Registered Users usergroup, he is showing the "Reg Rank"
- Created a subscription that will change the usergroup of the user to Moderator (again, only do this on a test board).
- Added the user manually to the subscription from the AdminCP.
- His userrank now changed to "Mod Rank". No need to update counters or anything.

So most likely you have a modification installed that is interfering with the normal behaviour.
Reply With Quote
  #9  
Old 03-01-2010, 10:22 AM
xash xash is offline
 
Join Date: Dec 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
You're doing it wrong, you should be using User Titles for this.


Quote:
Added the user manually to the subscription from the AdminCP.
- His userrank now changed to "Mod Rank". No need to update counters or anything.
Great. You're close, but you've only done the first half.

Now, go to the user profile (in Admin CP) of the test user that moved from rank "Reg Rank" to "Mod Rank", and edit the active Paid Subscription for this user. Set it to Active: No and click Save. (Edited To Add: This simulates expiry of Paid Subscription)

This should make the user go back from Mod Rank to Reg Rank, correct? But this doesn't get updated. You can confirm this by doing the above with your test user and looking at the user's profile (regular view from forum). Note that you will still see Mod Rank displayed for your test user.

But if you go back to the test user's profile in Admin CP and just click Save, the test user's rank will now show as Reg Rank (you can again confirm by looking at the regular forum view of the user's profile). This is a manual update to the rank. I want to automate this.

You can repeat the test by:

Setting the subscription back to Active: Yes (check rank, it should be Mod Rank)
Then setting the subscription to Active: No (check rank, it should be Reg Rank but it is still Mod Rank)
Now just go back to the user's profile (Admin CP view) and click Save (check rank, it now correctly updates to Reg Rank)
Repeat if necessary to check again. Same thing happens each time.

Thanks for your efforts. Let me know if you get any ideas after you test the above.
Reply With Quote
  #10  
Old 03-01-2010, 10:45 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Now, go to the user profile (in Admin CP) of the test user that moved from rank "Reg Rank" to "Mod Rank", and edit the active Paid Subscription for this user. Set it to Active: No and click Save. (Edited To Add: This simulates expiry of Paid Subscription)
How do you edit/disable a paid subscription from the user profile in the AdminCP, there is no option for that.

I have just again tested this, and when i enable the subscription the usergroup and rank are updated, if i disable the paid subscription, both the usergroup and rank revert back.

PS Did you set these ranks to act only on a specific usergroup or did you leave it to all usergroups?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 06:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05402 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete