예제 #1
0
 function throwError($name, $details = false)
 {
     // Globalize
     global $nextitem;
     // Set Status
     eval("\$this->STATUS = \"" . $this->MESSAGES[$name] . "\";");
     // Console Output
     echo $this->STATUS;
     // Return to Log
     log_cron_action($this->STATUS, $nextitem);
     // Exit
     exit;
 }
예제 #2
0
function kbank_log_cron_action($message = false)
{
    global $nextitem, $cron_logs;
    $onelog = false;
    if ($onelog) {
        if ($message === false) {
            if (is_array($cron_logs)) {
                log_cron_action(implode('<br/>', $cron_logs), $nextitem);
            }
        } else {
            $cron_logs[] = $message;
        }
    } else {
        if ($message !== false) {
            log_cron_action($message, $nextitem);
        }
    }
}
예제 #3
0
파일: cleanup.php 프로젝트: 0hyeah/yurivn
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "session\n\tWHERE lastactivity < " . intval(TIMENOW - $vbulletin->options['cookietimeout']) . "\n");
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "cpsession\n\tWHERE dateline < " . ($vbulletin->options['timeoutcontrolpanel'] ? intval(TIMENOW - $vbulletin->options['cookietimeout']) : TIMENOW - 3600) . "\n");
require_once DIR . '/vb/search/results.php';
vB_Search_Results::clean();
// expired lost passwords and email confirmations after 4 days
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "useractivation\n\tWHERE dateline < " . (TIMENOW - 345600) . " AND\n\t(type = 1 OR (type = 0 and usergroupid = 2))\n");
// old forum/thread read marking data
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "threadread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "forumread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "groupread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "discussionread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
// delete expired thread redirects
$threads = $vbulletin->db->query_read("\n\tSELECT threadid\n\tFROM " . TABLE_PREFIX . "threadredirect\n\tWHERE expires < " . TIMENOW . "\n");
while ($thread = $vbulletin->db->fetch_array($threads)) {
    $thread['open'] = 10;
    $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    $threadman->set_existing($thread);
    $threadman->delete(false, true, NULL, false);
    unset($threadman);
}
vB_Cache::instance()->clean();
($hook = vBulletinHook::fetch_hook('cron_script_cleanup_hourly')) ? eval($hook) : false;
log_cron_action('', $nextitem, 1);
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 62098 $
|| ####################################################################
\*======================================================================*/
예제 #4
0
                $ids[] = $vbulletin->db->escape_string($options[3]);
            }
        }
        if (!empty($ids)) {
            $insert = array();
            $updatetrans = array();
            $subs = $vbulletin->db->query_read("\n\t\t\t\tSELECT paymentinfo.subscriptionsubid, subscription.subscriptionid, subscription.cost,\n\t\t\t\t\tpaymentinfo.userid, paymentinfo.paymentinfoid, paymenttransaction.amount, paymenttransaction.transactionid,\n\t\t\t\t\tpaymenttransaction.paymenttransactionid\n\t\t\t\tFROM " . TABLE_PREFIX . "paymenttransaction AS paymenttransaction\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "paymentinfo AS paymentinfo ON (paymentinfo.paymentinfoid = paymenttransaction.paymentinfoid)\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "subscription AS subscription ON (paymentinfo.subscriptionid = subscription.subscriptionid)\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "subscriptionlog AS subscriptionlog ON (subscriptionlog.subscriptionid = subscription.subscriptionid AND subscriptionlog.userid = paymentinfo.userid)\n\t\t\t\tWHERE transactionid IN ('" . implode("','", $ids) . "')\n\t\t\t\t\tAND subscriptionlog.status = 1\n\t\t\t\t\tAND paymenttransaction.reversed = 0\n\t\t\t");
            while ($sub = $vbulletin->db->fetch_array($subs)) {
                $subobj->delete_user_subscription($sub['subscriptionid'], $sub['userid'], $sub['subscriptionsubid']);
                $insert[] = "2, " . TIMENOW . ", 'usd', {$sub['amount']}, '" . $vbulletin->db->escape_string($sub['transactionid'] . 'R') . "', {$sub['paymentinfoid']}, {$api['paymentapiid']}";
                $updatetrans[] = $sub['paymenttransactionid'];
                $count++;
            }
            if (!empty($insert)) {
                $vbulletin->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "paymenttransaction\n\t\t\t\t\t(state, dateline, currency, amount, transactionid, paymentinfoid, paymentapiid)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(" . implode('),(', $insert) . ")\n\t\t\t\t");
                $vbulletin->db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "paymenttransaction\n\t\t\t\t\tSET reversed = 1\n\t\t\t\t\tWHERE paymenttransactionid IN (" . implode(', ', $updatetrans) . ")\n\t\t\t\t");
            }
        }
        $log = $count;
    } else {
        // Error
        $log = htmlspecialchars_uni($result);
    }
}
log_cron_action($log, $nextitem, 1);
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
\*======================================================================*/
예제 #5
0
        $xmldata .= "<zointstags>\n";
        foreach ($threads as $threadid => $thread) {
            #$thread['url'] = $vbulletin->options['bburl'] . '/showthread.php?t=' . $threadid;
            $thread['url'] = 'showthread.php?t=' . $threadid;
            ($hook = vBulletinHook::fetch_hook('zointstags_threadurl')) ? eval($hook) : false;
            if (!preg_match("#^[a-z]+://#i", $thread['url'])) {
                $thread['url'] = $vbulletin->options['bburl'] . '/' . $thread['url'];
            }
            $xmldata .= "<thread id=\"{$threadid}\">\n";
            $xmldata .= "\t<title><![CDATA[{$thread['title']}]]></title>\n";
            $xmldata .= "\t<description><![CDATA[{$posts[$thread['firstpostid']]}]]></description>\n";
            $xmldata .= "\t<url><![CDATA[{$thread['url']}]]></url>\n";
            $xmldata .= "\t<tags>\n";
            if (count($tags[$threadid])) {
                foreach ($tags[$threadid] as $tag) {
                    $xmldata .= "\t\t<tag><![CDATA[{$tag}]]></tag>\n";
                }
            }
            $xmldata .= "\t</tags>\n";
            $xmldata .= "</thread>\n";
        }
        $xmldata .= "</zointstags>";
        # clean up existing data, mark as 'unmodified'
        $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "zoints_tag_update WHERE threadid IN(" . implode(',', $threadids) . ")");
        require_once DIR . '/includes/class_zointstags.php';
        $snoopy =& new ZointsTagsSnoopy();
        $snoopy->submit($vbulletin->options['zointstags_tagurl'], array('cmd' => 'forum-submission', 'auth-key' => $vbulletin->options['zointstags_authkey'], 'token' => $vbulletin->options['zointstags_token'], 'xmldata' => $xmldata));
        $log_entry = $snoopy->results;
        log_cron_action($log_entry, $nextitem, 1);
    }
}
예제 #6
0
파일: reminder.php 프로젝트: holandacz/nb4
foreach ($eventlist as $userid => $event) {
    $usernames .= iif($usernames, ', ');
    $usernames .= $userinfo["{$userid}"]['username'];
    $reminderbits = '';
    foreach ($event as $eventid => $hour) {
        $eventinfo =& $eventcache["{$eventid}"];
        eval(fetch_email_phrases('reminderbit', $userinfo["{$userid}"]['languageid']));
        $reminderbits .= $message;
    }
    $username = unhtmlspecialchars($userinfo["{$userid}"]['username']);
    eval(fetch_email_phrases('reminder', $userinfo["{$userid}"]['languageid']));
    vbmail($userinfo["{$userid}"]['email'], $subject, $message, true);
    if ($vbulletin->debug and VB_AREA == 'AdminCP') {
        "<pre>";
        echo $subject;
        echo "</pre>";
        echo "<pre>";
        echo $message;
        echo "</pre><br />";
    }
}
vbmail_end();
if (!empty($usernames)) {
    log_cron_action($usernames, $nextitem, 1);
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 22:41, Fri Oct 10th 2008
|| # CVS: $RCSfile$ - $Revision: 15604 $
|| ####################################################################
\*======================================================================*/
예제 #7
0
파일: activate.php 프로젝트: holandacz/nb4
vbmail_start();
$emails = '';
while ($user = $vbulletin->db->fetch_array($users)) {
    // make random number
    if (empty($user['activationid'])) {
        //none exists so create one
        $user['activationid'] = vbrand(0, 100000000);
        /*insert query*/
        $vbulletin->db->query_write("\n\t\t\tREPLACE INTO " . TABLE_PREFIX . "useractivation\n\t\t\t\t(userid, dateline, activationid, type, usergroupid)\n\t\t\tVALUES\n\t\t\t\t({$user['userid']}, " . TIMENOW . ", {$user['activationid']}, 0, 2)\n\t\t");
    } else {
        $user['activationid'] = vbrand(0, 100000000);
        $vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "useractivation SET\n\t\t\tdateline = " . TIMENOW . ",\n\t\t\tactivationid = {$user['activationid']}\n\t\t\tWHERE userid = {$user['userid']} AND type = 0\n\t\t");
    }
    $userid = $user['userid'];
    $username = $user['username'];
    $activateid = $user['activationid'];
    eval(fetch_email_phrases('activateaccount', $user['languageid']));
    vbmail($user['email'], $subject, $message);
    $emails .= iif($emails, ', ');
    $emails .= $user['username'];
}
if ($emails) {
    log_cron_action($emails, $nextitem, 1);
}
vbmail_end();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 09:39, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 15476 $
|| ####################################################################
\*======================================================================*/
예제 #8
0
$warningarray = array();
$infractionarray = array();
$ipointsarray = array();
$userids = array();
$usernames = array();
while ($infraction = $vbulletin->db->fetch_array($infractions)) {
    $vbulletin->db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "infraction\n\t\tSET action = 1, actiondateline = " . TIMENOW . "\n\t\tWHERE infractionid = {$infraction['infractionid']}\n\t\t\tAND action = 0\n\t");
    // enforce atomic update so that related records are only updated at most one time, in the event this task is executed more than one time
    if ($vbulletin->db->affected_rows()) {
        $userids["{$infraction['userid']}"] = $infraction['username'];
        if ($infraction['points']) {
            $infractionarray["{$infraction['userid']}"]++;
            $ipointsarray["{$infraction['userid']}"] += $infraction['points'];
        } else {
            $warningarray["{$infraction['userid']}"]++;
        }
    }
}
// ############################ MAGIC ###################################
if (!empty($userids) and build_user_infractions($ipointsarray, $infractionarray, $warningarray)) {
    build_infractiongroupids(array_keys($userids));
}
if (!empty($userids)) {
    log_cron_action(implode(', ', $userids), $nextitem, 1);
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/
예제 #9
0
파일: promotion.php 프로젝트: holandacz/nb4
}
foreach ($primaryupdates as $joinusergroupid => $ids) {
    $vbulletin->db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "user\n\t\tSET displaygroupid = IF(displaygroupid = usergroupid, {$joinusergroupid}, displaygroupid),\n\t\tusergroupid = {$joinusergroupid},\n\n\t\tinfractiongroupid =\n\t\t" . (!empty($sql_id["{$joinusergroupid}"]) ? "\n\t\tCASE\n\t\t\t" . implode(" \r\n", $sql_id["{$joinusergroupid}"]) . "\n\t\tELSE 0\n\t\tEND" : "0") . "\n\n\t\t,infractiongroupids =\n\t\t" . (!empty($sql["{$joinusergroupid}"]) ? "\n\t\tCASE\n\t\t\t" . implode(" \r\n", $sql["{$joinusergroupid}"]) . "\n\t\tELSE ''\n\t\tEND" : "''") . "\n\n\t\tWHERE userid IN (0{$ids})\n\t");
    $log = array($titles["{$joinusergroupid}"], '*', $primarynames["{$joinusergroupid}"]);
    // the "1" indicates to use the second line of the phrase specified for this task
    log_cron_action(serialize($log), $nextitem, 1);
}
foreach ($userupdates as $userid => $info) {
    $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
    $user = array('userid' => $userid);
    $userdm->set_existing($user);
    if ($info['title']) {
        $userdm->set('usertitle', $info['title']);
    }
    if ($info['rank']) {
        $userdm->setr('rank', $info['rank']);
    }
    $userdm->save();
    unset($userdm);
}
foreach ($secondaryupdates as $joinusergroupid => $ids) {
    $vbulletin->db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "user\n\t\tSET membergroupids = IF(membergroupids= '', '{$joinusergroupid}', CONCAT(membergroupids, ',{$joinusergroupid}'))\n\t\tWHERE userid IN (0{$ids})\n\t");
    $log = array($titles["{$joinusergroupid}"], '%', $secondarynames["{$joinusergroupid}"]);
    log_cron_action(serialize($log), $nextitem, 1);
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:56, Sat Oct 11th 2008
|| # CVS: $RCSfile$ - $Revision: 17247 $
|| ####################################################################
\*======================================================================*/
예제 #10
0
    $vbseo_stat['a'] += vbseo_sitemap_albums();
}
if ($vboptions['vbseo_sm_group']) {
    $vbseo_stat['g'] += vbseo_sitemap_groups();
}
if ($vboptions['vbseo_sm_tag']) {
    $vbseo_stat['tag'] += vbseo_sitemap_tags();
}
if ($vboptions['vbseo_sm_rss']) {
    vbseo_sitemap_rss();
}
$addons = preg_split('#[\\r\\n]+#', $vboptions['vbseo_sm_addons']);
foreach ($addons as $addon) {
    if ($addon && file_exists(VBSEO_DAT_FOLDER_ADDON . $addon)) {
        vbseo_log_entry("[addon module] {$addon}", true);
        include VBSEO_DAT_FOLDER_ADDON . $addon;
    }
}
vbseo_flush_index();
vbseo_clean_progress();
if ($vboptions['vbseo_sm_ping']) {
    vbseo_sitemap_ping();
}
vbseo_log_entry('Sitemap has been created. <a href="index.php">Click here to return</a>', true);
$vbseo_stat['end'] = array_sum(explode(' ', microtime()));
$vbseo_stat['files'] = $vbseo_vars['sitemap_files'];
vbseo_sitemap_stat($vbseo_stat, $vboptions['vbseo_sm_email']);
vbseo_sm_prune(VBSEO_DAT_FOLDER);
vbseo_sm_prune(VBSEO_DAT_FOLDER_BOT);
log_cron_action('Google Sitemap Created', $nextitem);
예제 #11
0
            $uheaders .= "To: {$username} <{$email}>" . "\r\n";
            $uheaders .= "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n";
            eval('$subject = "' . addslashes($vbulletin->options['subject']) . '";');
            $subject = stripslashes($subject);
            if ($vbulletin->options['reminder_emailfooter']) {
                $message = $message . "Email Reminder System Provided By Mished.co.uk";
            }
            /*if(@mail($email, $subject, $message, $headers)){
            			print("mailing $email (done)<br/>");
            			
            		} else {
            			print("mailing $email (failed)<br/>");
            		}*/
            if (is_valid_email($toemail)) {
                $sentlist .= "{$username} ";
                vbmail($toemail, $subject, $message, $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = '', $username = '');
            } else {
                $failedlist .= "{$username} ";
            }
        }
    }
    if ($sentlist == "") {
        log_cron_action("No Emails to send", $nextitem);
        vbmail($vbulletin->options['webmasteremail'], "Inactive User Reminder Email Report", "This email shows that the product is installed and working as it should be.\n\n\nThere were no inactive users at this time.", $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n", $username = '');
    } else {
        log_cron_action("Emails sent to:{$sentlist}. We tried to email the following users, but their email address was invalid:{$failedlist}", $nextitem);
        vbmail($vbulletin->options['webmasteremail'], "Inactive User Reminder Email Report", "This email shows that the product is installed and working as it should be.\n\n\nEmails sent to:" . $sentlist . ". We tried to email the following users, but their email address was invalid:" . $failedlist . "", $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n", $username = '');
    }
} else {
    print "Product is inactive at this time!";
}
예제 #12
0
//###########################################
global $db, $vbulletin;
$bburl = $vbulletin->options['bburl'];
$xml_file = DIR . "/markers.xml";
$id_file = @fopen($xml_file, "w+") or die("Cannot open XML File");
$text_file = "<" . "?" . "xml version=\"1.0\" encoding=\"UTF-8\"" . "?" . "><markers>\n";
$text_file = $text_file . "<!-- (c) 2006 StonyArc -->\n";
//build the SELECT string
$select_xml = TABLE_PREFIX . "googlemapme.mapid as mapid," . TABLE_PREFIX . "googlemapme.username as username," . TABLE_PREFIX . "googlemapme.userid as userid," . TABLE_PREFIX . "googlemapme.usergroupid as usergroupid," . TABLE_PREFIX . "googlemapme.lng_map as lng, " . TABLE_PREFIX . "googlemapme.lat_map as lat, " . TABLE_PREFIX . "googlemapme.text_map as text_map," . TABLE_PREFIX . "googlemapme.pimage as pimage," . TABLE_PREFIX . "googlemapme.title_map as title_map";
//get the values
$vbulletin->db->query_first("SET NAMES 'utf8'");
$get_xml_markers = $vbulletin->db->query_read("SELECT " . $select_xml . " FROM " . TABLE_PREFIX . "googlemapme WHERE approve='1' AND lng_map<>'' AND lat_map<>''");
while ($get_xml_marker = $vbulletin->db->fetch_array($get_xml_markers)) {
    $userid = $get_xml_marker[userid];
    $usergroupid = $get_xml_marker['usergroupid'];
    $gettype = $vbulletin->db->query_first("SELECT googlemapmetype FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = {$usergroupid}");
    if ($get_xml_marker["pimage"] != '') {
        $pimage = $get_xml_marker["pimage"];
    } else {
        $pimage = $bburl . "/images/googlemapme/noimage.png";
    }
    $text_file .= "<marker mapid=\"" . $get_xml_marker["mapid"] . "\"  title_map=\"" . $get_xml_marker["title_map"] . "\" lng=\"" . $get_xml_marker["lng"] . "\" lat=\"" . $get_xml_marker["lat"] . "\" userid=\"" . $get_xml_marker["userid"] . "\" username=\"" . preg_replace("/\n|\r\n|\r/", "", nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["username"]))))) . "\" text_map=\"" . preg_replace("/\n|\r\n|\r/", "", nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["text_map"]))))) . "\" type=\"" . $gettype['googlemapmetype'] . "\" pimage=\"" . $pimage . "\" />\n";
}
$text_file .= "\n</markers>";
$verif = @fwrite($id_file, $text_file) or die("Cannot write to XML File");
$verif = @fclose($id_file) or die("Cannot close XML file");
//###########################################
// END Function for writing the xml file
//###########################################
log_cron_action('Cron Vbgooglemap ME Ran', $nextitem);
예제 #13
0
<?php

if (!defined('VB_ENTRY')) {
    die('Access denied.');
}
/*========================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.1.9 - Licence Number LD18132D6F
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2015 vBulletin Solutions Inc. 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   # ||
|| ###################################################################### ||
\*========================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (vB::getDatastore()->getOption('mailqueue')) {
    $mailqueue = vB_Mail_Queue::fetchInstance();
    $mailqueue->execQueue();
    log_cron_action('execMailQueue', array(), false);
}
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 83435 $
|| #######################################################################
\*=========================================================================*/
예제 #14
0
<?php

/*======================================================================*\
|| #################################################################### ||
|| # Automatic Thread Tagger                                          # ||
|| # ---------------------------------------------------------------- # ||
|| # Originally created by MrEyes (1.0 Beta 3)                        # ||
|| # Copyright ©2008 Marius Czyz. All Rights Reserved.                # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db)) {
    exit;
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if ($vbulletin->options['autotag_enabled_all']) {
    require_once DIR . '/includes/functions_autotagger.php';
    require_once DIR . '/includes/functions_newpost.php';
    $threads = $vbulletin->db->query_read("SELECT\n\t\tt.taglist,\n\t\tt.dateline,\n\t\tt.forumid,\n\t\tt.postuserid,\n\t\tt.title,\n\t\tt.threadid,\n\t\tt.prefixid\n\t\tFROM " . TABLE_PREFIX . "thread as t\n\t\tWHERE t.taglist='' AND autoskip=0\n\t");
    $processed = 0;
    while ($thread = $vbulletin->db->fetch_array($threads) and $processed < $vbulletin->options['autotag_cron_count']) {
        if (intval($thread['tagid']) == 0) {
            ProcessThread($thread);
            $processed++;
        }
    }
    log_cron_action('Auto Thread Tagger processed ' . $processed . ' threads.', $nextitem);
}
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db)) {
    exit;
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if ($vbulletin->options['3dg_autoclose_onoff'] == 1) {
    $excluded_forum_ids = unserialize($vbulletin->options['3dg_autoclose_forums']);
    $threads_filter = "";
    $thread_ids = unserialize($vbulletin->options['3dg_autoclose_threads']);
    if (count($thread_ids) > 0) {
        $threads_filter = "threadid NOT IN (" . implode(",", $thread_ids) . ") AND ";
    }
    $forums = $vbulletin->db->query_read("SELECT forumid, 3dg_autoclose_perforum FROM " . TABLE_PREFIX . "forum");
    while ($forum = $vbulletin->db->fetch_array($forums)) {
        if (in_array($forum['forumid'], $excluded_forum_ids)) {
            continue;
        }
        if ($forum['3dg_autoclose_perforum'] != 0) {
            $age_3dg = $forum['3dg_autoclose_perforum'];
        } else {
            $age_3dg = $vbulletin->options['3dg_autoclose_postage'];
        }
        $vbulletin->db->query_write("\n      UPDATE " . TABLE_PREFIX . "thread SET open = 0\n      WHERE forumid = " . $forum['forumid'] . " AND open = 1 AND sticky = 0 AND {$threads_filter} lastpost < " . intval(TIMENOW - 86400 * $age_3dg));
    }
    $vbulletin->db->free_result($forums);
}
log_cron_action('Autoclose Completed', $nextitem, 1);
예제 #16
0
Auto-Backup (Lite) for vBulletin 3.7 - Paul M - v 3.7.001
This lite version is adapted from the original 3.0 version by Trigunflame.
*/
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db)) {
    exit;
}
@ignore_user_abort(1);
@set_magic_quotes_runtime(0);
@set_time_limit(3600);
// 1 Hour Timeout
require_once DIR . '/includes/adminfunctions.php';
require_once DIR . '/includes/mysqlbackupconfig.php';
require_once DIR . '/includes/mysqlbackup.php';
if (method_exists($vbulletin->datastore, 'do_fetch')) {
    // Datastore extension exists, use it
    $vbulletin->datastore->do_fetch('options', $errors);
    if ($errors[0]) {
        // Fetch failed, use original datastore
        $vbulletin->datastore->do_db_fetch("'options'");
    }
} else {
    // No extension, use original datastore
    $vbulletin->datastore->do_db_fetch("'options'");
}
$mysqlBackup =& new mysqlBackup($backup, $vbulletin->db, $vbulletin->options);
$mysqlBackup->cronBackup();
echo $mysqlBackup->STATUS;
log_cron_action($mysqlBackup->STATUS, $nextitem);