+ Reply to Thread
Results 1 to 12 of 12

Thread: move members

  1. #1
    Senior Member ArAb4NoKiA is on a distinguished road
    Join Date
    Jun 2004
    Location
    KSA - Jeddah. USA - Fairfax.
    Age
    18
    Posts
    115

    move members

    Hello,

    i want an SQL Querie to move the members that has not entered the forum for one year (365Days) to Banned group and i want to put ban reason if i can

    i know that i can do it via :
    admincp/user.php?do=prune

    but it's about 40,000 Member !!

  2. #2
    Senior Member Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego's Avatar
    Join Date
    Feb 2005
    Location
    Edmonton, Alberta, Canada
    Age
    40
    Posts
    10,957
    You are better off use functions that are present, as you get support if errors occur. This on the other hand you better have a working backup of your database.
    I not 100% sure I did this right as I have not test this on my test forum.
    Code:
    UPDATE user
    SET usergroupid = 8
    WHERE usergroupid = (1, 2, 3, 4)
    AND lastactivity > UNIX_TIMESTAMP('2006-06-16 00:00:00')
    AND lastactivity < UNIX_TIMESTAMP('2007-06-16 00:00:00')
    Last edited by Jose Amaral Rego; Sat 16th Jun '07 at 8:19pm.

  3. #3
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1
    Woah! Don't use the "joindate" filed on the table or else you're gonna ban a lot of old (perhaps even regular) members! Instead, use the "lastactivity" or "lastvisit" field so that it actually gets people who didn't login/do stuff for a long time.

    Additionally, I don't know if just updating the table alone will do the trick... there might be something that you must do w/ the userban table... which its what's keeping me puzzled on this issue as I have no place/method to actually test this without affecting any real user.

    To insert a reason, you'd definetly need to touch the userban table though. So might want to get a custom script to achieve this effect for you, and get it to automatcially grab all the necessairy informations...

    Be sure to update your counters by the time you're done w/ all these querie, because I'm sure there's some level of cacheing going on which those users are related to (IE: postbits, caches, etc).
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  4. #4
    Senior Member Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego's Avatar
    Join Date
    Feb 2005
    Location
    Edmonton, Alberta, Canada
    Age
    40
    Posts
    10,957
    My bad, that would of been just a bad day on my part not seeing that.

    Thanks for pointing it out.. I guess I should test to see, before adding to post. I still think what is on standard vBulletin is still the best way of doing this and also you need to have better control of what is going on with members on your forum. You just end up doing the same by having user register and not coming back.

  5. #5
    Senior Member ArAb4NoKiA is on a distinguished road
    Join Date
    Jun 2004
    Location
    KSA - Jeddah. USA - Fairfax.
    Age
    18
    Posts
    115
    Hello,

    thanks guys

    but can i have another SQL Query

    i want to delete the members not to move them

    is that posibale ?

  6. #6
    Senior Member Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego's Avatar
    Join Date
    Feb 2005
    Location
    Edmonton, Alberta, Canada
    Age
    40
    Posts
    10,957
    Admin CP > Users > Prune / Move Users

  7. #7
    Senior Member ArAb4NoKiA is on a distinguished road
    Join Date
    Jun 2004
    Location
    KSA - Jeddah. USA - Fairfax.
    Age
    18
    Posts
    115
    Hello,

    i couldn't do it because it's about 40,000 Member !

    that's way i need it SQL Quire

  8. #8
    Senior Member Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego is a jewel in the rough Jose Amaral Rego's Avatar
    Join Date
    Feb 2005
    Location
    Edmonton, Alberta, Canada
    Age
    40
    Posts
    10,957
    Wait till you see Staff answer, I would hate to see this inadvertaly delete more than it is suppose or not enough.
    01 DAY=86400
    30 DAY(s)=2592000
    60 DAY(s)=5184000
    90 DAY(s)=7776000
    Code:
    DELETE * FROM user WHERE usergroupid = (1, 2, 3, 4, 8)
    AND lastvisit > unix_timestamp(now()) - 5184000
    AND lastvisit < unix_timestamp(now()) - 2592000

  9. #9
    Senior Member ArAb4NoKiA is on a distinguished road
    Join Date
    Jun 2004
    Location
    KSA - Jeddah. USA - Fairfax.
    Age
    18
    Posts
    115
    Ok thanks

    waiting for the staff respond

  10. #10
    vBulletin Team Colin F will become famous soon enough Colin F will become famous soon enough Colin F's Avatar
    Join Date
    May 2004
    Location
    Switzerland
    Posts
    17,575
    Deleting members isn't easily possible with a single SQL query. Seeing as the move/prune users function is paginated you should use that.
    Best Regards
    Colin Frei

    The closer something gets to perfection, the more minute flaws become visible.
    Please don't contact me per PM.

  11. #11
    Senior Member ArAb4NoKiA is on a distinguished road
    Join Date
    Jun 2004
    Location
    KSA - Jeddah. USA - Fairfax.
    Age
    18
    Posts
    115
    Hello,

    i couldn't do it with move/prune function

    after i give the delete order it redirect me to page it take 2Min for loading then i have an error message

    this is the error message :
    No Users Matched Your Query

    !!!

  12. #12
    vBulletin Team Colin F will become famous soon enough Colin F will become famous soon enough Colin F's Avatar
    Join Date
    May 2004
    Location
    Switzerland
    Posts
    17,575
    I'm afraid it's not easily possible with just a query. You might be able to make a shell script or something. I recommend you ask for help on www.vbulletin.org
    Best Regards
    Colin Frei

    The closer something gets to perfection, the more minute flaws become visible.
    Please don't contact me per PM.

+ Reply to Thread

Similar Threads

  1. move only members from 3.5 to 3.6
    By PuntoPower in forum vBulletin 3.6 Installation and Upgrades
    Replies: 4
    Last Post: Tue 13th Feb '07, 3:32pm
  2. Usergroup Members Mass Move to another Group
    By Mehdi.K in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 1
    Last Post: Sun 28th Aug '05, 5:15am
  3. How to move members from one forum to another?
    By AshAbed in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 5
    Last Post: Tue 13th Apr '04, 8:09pm
  4. Move / Prune Members
    By Ice Man_00 in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 0
    Last Post: Sun 10th Nov '02, 3:03pm

Bookmarks

Posting Permissions

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