Announcement

Collapse
No announcement yet.

End of Subscriptions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    www.minimotoclub.co.uk
    For all your minimoto needs : www.minimotoclub.com

  • #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


    • #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 29th May '06, 4:23am.
      For all your minimoto needs : www.minimotoclub.com

      Comment


      • #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


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

          Code:
          <?php
          /*======================================================================*\
          || #################################################################### ||
          || # vBulletin 3.5.4 - Licence Number EDITED!!!
          || # ---------------------------------------------------------------- # ||
          || # 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('http://www.YOURDOMAIN.co.uk/vb/global.php');
          
          // USERGROUPID OF USERGROUP WHOSE MEMBERS' SIGNATURES WILL BE DELETED
             $groupid = 2; // EDIT THIS BIT FOR USERGROUP ID
             
             // 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 28th 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...
          X