Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Feb 2010, 23:04
xash xash is offline
 
Join Date: Dec 2009
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 01 Mar 2010, 09:59
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Do any of your Scheduled Tasks run?
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #3  
Old 01 Mar 2010, 10:15
xash xash is offline
 
Join Date: Dec 2009
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 01 Mar 2010 at 10:18 ---------------

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.

Last edited by xash; 01 Mar 2010 at 10:18. Reason: Auto-Merged DoublePost
Reply With Quote
  #4  
Old 01 Mar 2010, 10:18
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
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.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #5  
Old 01 Mar 2010, 10:21
xash xash is offline
 
Join Date: Dec 2009
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 01 Mar 2010, 10:32
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
promotion.php for sure does update ranks.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #7  
Old 01 Mar 2010, 11:08
xash xash is offline
 
Join Date: Dec 2009
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 01 Mar 2010, 11:37
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
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.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #9  
Old 01 Mar 2010, 12:22
xash xash is offline
 
Join Date: Dec 2009
Originally Posted by Marco van Herwaarden View Post
You're doing it wrong, you should be using User Titles for this.


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 01 Mar 2010, 12:45
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
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?
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #11  
Old 01 Mar 2010, 23:57
xash xash is offline
 
Join Date: Dec 2009
Originally Posted by Marco van Herwaarden View Post
How do you edit/disable a paid subscription from the user profile in the AdminCP, there is no option for that.
In the user profile, on the right side, it shows "Paid Subscriptions" below the "Usergroup Options" widget and above the "Reputation" widget. You can Edit and set subscriptions Active: No (to disable) or Active: Yes (to enable). I'm using vB 3.7.3.

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.
I'm using an additional (not primary) usergroup to set ranks. On subscription, the user gets added to an additional usergroup which gives them the rank (as set in Rank Manager). On subscription end, they get removed from the additional usergroup (note that they remain in the same primary usergroup).

What's probably happening in your case is that a move to a different primary usergroup is causing the refresh. Try it with an additonal usergroup instead and see if it updates.

PS Did you set these ranks to act only on a specific usergroup or did you leave it to all usergroups?
Only on a specific usergroup, and within that only users from that usergroup who purchase a "Paid Rank" subscription. I know, it's complicated. But that's why I'm posting here to get help

Thanks a lot for your efforts, Marco. Appreciate you testing it out.

See Post #4 in this thread:

http://www.vbulletin.org/forum/showthread.php?t=130545

I'm looking for a .php script like that that I could run as a scheduled task. Preferably with options to limit the updates to a specific usergroup, rather than all members.
Reply With Quote
  #12  
Old 02 Mar 2010, 10:52
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Originally Posted by xash View Post
In the user profile, on the right side, it shows "Paid Subscriptions" below the "Usergroup Options" widget and above the "Reputation" widget. You can Edit and set subscriptions Active: No (to disable) or Active: Yes (to enable). I'm using vB 3.7.3.
I forget that there was also this option on the User page in the AdminCP, but that is the same as from the Subscription Manager.

I have tested it again now on a clean 3.7.3 testboard, and it is still working as expected. I also tested it now with a secondary usergroup in teh subscription and still working as expected. So my guess is that 1 of your modifications is causing the problem.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #13  
Old 02 Mar 2010, 11:45
xash xash is offline
 
Join Date: Dec 2009
Originally Posted by Marco van Herwaarden View Post
I have tested it again now on a clean 3.7.3 testboard, and it is still working as expected. I also tested it now with a secondary usergroup in teh subscription and still working as expected.
Thanks for the excellent support, Marco. It's great to know that it works as expected on your 3.7.3 test server.

So my guess is that 1 of your modifications is causing the problem.
I have only one plugin (no other hacks, template edits or anything else) installed. I disabled plugins/hooks, but I still see the same behavior on my board.

I just tested it with Primary vs. Secondary Usergroups. In the case of the Primary Usergroup, it works fine and updates the rank even at the end of the subscription (when the user is moved back to the original primary usergroup). In the case of the Secondary Usergroup, it doesn't update the rank on the user's profile page (regular forum view). I have to manually Save the user profile (in Admin CP) to refresh the rank display on the user's profile page (regular forum view).

I guess there's nothing more you can do to help at this point. You've already tested it out for me, and it works on your test server. It must be something else conflicting on my server, but I guess I'll just use the manual route or try to use a Primary group move to refresh the rank.

Thanks a lot again for all your help!
Reply With Quote
  #14  
Old 02 Mar 2010, 12:07
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
If you have a test installation on your server, then you may PM me the details and amdin login and i will have a look for you.

If you are sure that this is not caused by a modification, then you can also choose to open a support ticket.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #15  
Old 15 Oct 2010, 21:51
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Real name: Doug
Originally Posted by xash View Post
I have to manually Save the user profile (in Admin CP) to refresh the rank display on the user's profile page (regular forum view).
Sorry for bumping an OLD thread, but I've had the same problem running v4.04pl1. This problem has existed since at least v3.6 that I can remember.

I either have to SAVE the user record in AdminCP or run the "update user titles and ranks" manually to get the rank graphic for the member to begin appearing in any of his posts (postbit_legacy).

It's also messed up in reverse. If a user's subscription expires, vBulletin correctly changes the usergroup, but the rank graphic associated with the expired usergroup continues to appear in postbit etc, until I manually SAVE the user record in AdminCP or run the "update user titles and ranks" manually to get the now expired rank graphic for the member to disappear.

I came here and searched the forum for a simple way of having the "update user titles and ranks" job run nightly as a maintenance function, as I'm really getting tired of having to go in and SAVE every user record after they get a new usergroup checked off, or their subscription expires.

Can anyone tell me how to add this job as an overnight run, or provide me a fix for this long standing bug?

Thanks in advance ...

Regards,
Doug
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


New To Site? Need Help?

All times are GMT. The time now is 11:54.

Layout Options | Width: Wide Color: