End of Subscriptions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manguish
    Senior Member
    • Jan 2004
    • 361

    End of Subscriptions

    Lo all again.

    Using subscriptions to GREAT use. BUT i have only one problem.

    I allow avas, signatures etc for my subscribing members. Upon the subscription running out, the software moves the member to the unsubcribing group fine, but leaves avas and sigs.

    Can i set this to delete them when the subscription runs out?

    Thanks in advance

    Chris.

    For all your minimoto needs : www.minimotoclub.com
  • Colin F
    Senior Member
    • May 2004
    • 17689

    #2
    You'd have to modify the code to do that, there's currently no such function.
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment

    • manguish
      Senior Member
      • Jan 2004
      • 361

      #3
      If i ran a cron job, do i simply make a php file and point the cron to run it?

      FINAL CODE BELOW

      Thanks for your swift response
      Last edited by manguish; Mon 29 May '06, 4:23am.
      For all your minimoto needs : www.minimotoclub.com

      Comment

      • Colin F
        Senior Member
        • May 2004
        • 17689

        #4
        More or less. I recommend you have a look at the existing cron scripts, and take over that format.
        For further help you'll have to ask on www.vbulletin.org
        Best Regards
        Colin Frei

        Please don't contact me per PM.

        Comment

        • manguish
          Senior Member
          • Jan 2004
          • 361

          #5
          Just incase anyone else wants this, here's the final working file

          Code:
          <?php
          /*======================================================================*\
          || #################################################################### ||
          || # vBulletin 3.5.4 - Licence Number [COLOR=Red]EDITED!!![/COLOR]
          || # ---------------------------------------------------------------- # ||
          || # Copyright ©2000-2006 Jelsoft Enterprises Ltd. All Rights Reserved. ||
          || # This file may not be redistributed in whole or significant part. # ||
          || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
          || # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
          || SCRIPT BY MANGUISH - www.minimotoclub.co.uk ######################## ||
          \*======================================================================*/
          
          // ######################## SET PHP ENVIRONMENT ###########################
          error_reporting(E_ALL & ~E_NOTICE);
          if (!is_object($vbulletin->db))
          {
              exit;
          }
          
          // ########################################################################
          // ######################### START MAIN SCRIPT ############################
          // ########################################################################
          
          require_once('[COLOR=Red]http://www.YOURDOMAIN.co.uk/vb/global.php[/COLOR]');
          
          // USERGROUPID OF USERGROUP WHOSE MEMBERS' SIGNATURES WILL BE DELETED
             $groupid = 2; [COLOR=Red]// EDIT THIS BIT FOR USERGROUP ID[/COLOR]
             
             // SELECT ALL USERS
           $users = $vbulletin->db->query_read("SELECT user.userid, user.usergroupid, user.membergroupids    FROM " . TABLE_PREFIX . "user");
             
             // PARSE THROUGH SELECTED USERS
             while ($user = $vbulletin->db->fetch_array($users))
             {
                 // IF USER IS A MEMBER OF $groupid, THEN ADD THEM TO LIST OF USERS
                 if (is_member_of($user, $groupid))
                 {
                     $list .= $user[userid] . ",";
                     $count++;
                 }
             }
             
             // REMOVE TRAILING COMMA ON LIST OF USERS
             $list = substr($list, 0, strlen($list) - 1);
             
             // IF THERE ARE USERS IN THE LIST
             if ($list)
             {
                 // DELETE SIGNATURES FOR LIST OF USERS
               $vbulletin->db->query("UPDATE " . TABLE_PREFIX . "usertextfield SET signature='' WHERE userid IN($list)");
                // DELETE CUSTOM AVATARS FOR LIST OF USERS
               $vbulletin->db->query("DELETE FROM " . TABLE_PREFIX . "customavatar WHERE userid IN($list)");  
          
                 echo("Avas removed for " . $count . " users.");
                 echo("Sigs removed for " . $count . " users.");
             }
             else
             {
                 echo("No matching users with sigs.");
                 echo("No matching users with avas.");
             }
          
          /*======================================================================*\
          || ####################################################################
          || # 
          || # CVS: $RCSfile: avaremoval.php,v $ - $Revision: 1.00 $
          || ####################################################################
          \*======================================================================*/
          ?>
          Last edited by Colin F; Sun 28 May '06, 3:25am.
          For all your minimoto needs : www.minimotoclub.com

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...