当前位置: 首页>>代码示例>>PHP>>正文


PHP auto_prune函数代码示例

本文整理汇总了PHP中auto_prune函数的典型用法代码示例。如果您正苦于以下问题:PHP auto_prune函数的具体用法?PHP auto_prune怎么用?PHP auto_prune使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了auto_prune函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Runs this cron task.
  *
  * @return null
  */
 public function run()
 {
     if (!function_exists('auto_prune')) {
         include $this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext;
     }
     if ($this->forum_data['prune_days']) {
         auto_prune($this->forum_data['forum_id'], 'posted', $this->forum_data['forum_flags'], $this->forum_data['prune_days'], $this->forum_data['prune_freq']);
     }
     if ($this->forum_data['prune_viewed']) {
         auto_prune($this->forum_data['forum_id'], 'viewed', $this->forum_data['forum_flags'], $this->forum_data['prune_viewed'], $this->forum_data['prune_freq']);
     }
 }
开发者ID:MrAdder,项目名称:phpbb,代码行数:17,代码来源:prune_forum.php

示例2: register_shutdown_function

        }
        // Do the forum Prune thang
        if ($row['prune_next'] < time() && $row['enable_prune']) {
            include_once $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
            if ($row['prune_days']) {
                if ($use_shutdown_function) {
                    register_shutdown_function('auto_prune', $row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
                } else {
                    auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
                }
            }
            if ($row['prune_viewed']) {
                if ($use_shutdown_function) {
                    register_shutdown_function('auto_prune', $row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
                } else {
                    auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
                }
            }
        }
        break;
}
// Unloading cache and closing db after having done the dirty work.
if ($use_shutdown_function) {
    register_shutdown_function('unlock_cron');
    register_shutdown_function('garbage_collection');
} else {
    unlock_cron();
    garbage_collection();
}
exit;
/**
开发者ID:ubick,项目名称:lorekeepers.org,代码行数:31,代码来源:cron.php

示例3: sprintf

    $message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}") . '">', '</a> ');
    message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
$tracking_topics = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : '';
$tracking_forums = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : '';
//
// Do the forum Prune
//
if ($is_auth['auth_mod'] && $board_config['prune_enable']) {
    if ($forum_row['prune_next'] < time() && $forum_row['prune_enable']) {
        include $phpbb_root_path . 'includes/prune.' . $phpEx;
        require $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
        auto_prune($forum_id);
    }
}
//
// End of forum prune
//
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//
$sql = "SELECT u.user_id, u.username \n\tFROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u\n\tWHERE aa.forum_id = {$forum_id} \n\t\tAND aa.auth_mod = " . TRUE . " \n\t\tAND g.group_single_user = 1\n\t\tAND ug.group_id = aa.group_id \n\t\tAND g.group_id = aa.group_id \n\t\tAND u.user_id = ug.user_id \n\tGROUP BY u.user_id, u.username  \n\tORDER BY u.user_id";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
$moderators = array();
while ($row = $db->sql_fetchrow($result)) {
开发者ID:pujariinc,项目名称:pujari.org,代码行数:31,代码来源:viewforum.php

示例4: generate_link

     $_CLASS['core_display']->meta_refresh(3, generate_link('Forums&amp;file=viewforum&amp;f=' . $forum_id));
     $message = $_CLASS['core_user']->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_FORUM'], '<a href="' . generate_link('Forums&amp;file=viewforum&amp;f=' . $forum_id) . '">', '</a> ');
     trigger_error($message);
 }
 // Is a forum specific topic count required?
 if ($forum_data['forum_topics_per_page']) {
     $config['topics_per_page'] = $forum_data['forum_topics_per_page'];
 }
 // Do the forum Prune thang - cron type job ...
 if ($forum_data['prune_next'] < time() && $forum_data['enable_prune']) {
     require_once $site_file_root . 'includes/forums/functions_admin.php';
     if ($forum_data['prune_days']) {
         auto_prune($forum_id, 'posted', $forum_data['forum_flags'], $forum_data['prune_days'], $forum_data['prune_freq']);
     }
     if ($forum_data['prune_viewed']) {
         auto_prune($forum_id, 'viewed', $forum_data['forum_flags'], $forum_data['prune_viewed'], $forum_data['prune_freq']);
     }
 }
 if ($_CLASS['auth']->acl_get('f_subscribe', $forum_id)) {
     $notify_status = isset($forum_data['notify_status']) ? $forum_data['notify_status'] : NULL;
     $s_watching_forum = watch_topic_forum('forum', $_CLASS['core_user']->data['user_id'], $forum_id, 0, $notify_status);
 } else {
     $s_watching_forum['link'] = $s_watching_forum['title'] = '';
 }
 gen_forum_auth_level('forum', $forum_id);
 // Topic ordering options
 $limit_days = array(0 => $_CLASS['core_user']->lang['ALL_TOPICS'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 364 => $_CLASS['core_user']->lang['1_YEAR']);
 $sort_by_text = array('a' => $_CLASS['core_user']->lang['AUTHOR'], 't' => $_CLASS['core_user']->lang['POST_TIME'], 'r' => $_CLASS['core_user']->lang['REPLIES'], 's' => $_CLASS['core_user']->lang['SUBJECT'], 'v' => $_CLASS['core_user']->lang['VIEWS']);
 $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
 $sort_key = !in_array($sort_key, array('a', 't', 'r', 's', 'v')) ? 't' : $sort_key;
 $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:viewforum.php


注:本文中的auto_prune函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。