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


PHP update_subscriptions函数代码示例

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


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

示例1: sizeof

    $userdm->set_existing($user);
    $userdm->set_bitfield('options', 'hasaccessmask', sizeof($insert_mask_sql) ? true : false);
    $userdm->save();
    unset($userdm);
    cache_permissions($user);
    $noforums = array();
    foreach ($user['forumpermissions'] as $forumid => $perm) {
        if ($perm == 0) {
            $noforums[] = $forumid;
        }
    }
    if (!empty($noforums)) {
        $db->query_write("\n\t\t\tDELETE FROM " . TABLE_PREFIX . "subscribeforum\n\t\t\tWHERE userid = " . $vbulletin->GPC['userid'] . " AND\n\t\t\t\tforumid IN(" . implode(',', $noforums) . ")\n\t\t");
    }
    require_once DIR . '/includes/functions_databuild.php';
    update_subscriptions(array('userids' => array($user['userid'])));
    define('CP_REDIRECT', "user.php?do=edit&u=" . $vbulletin->GPC['userid']);
    print_stop_message('saved_access_masks_successfully');
}
// ###################### Start modify #######################
if ($_REQUEST['do'] == 'modify') {
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_INT, 'insertedadmin' => TYPE_INT));
    if ($vbulletin->GPC['userid']) {
        $userinfo = fetch_userinfo($vbulletin->GPC['userid']);
        if (!$userinfo) {
            print_stop_message('invalid_user_specified');
        }
        print_form_header('user', 'edit', 0, 1, 'reviewform');
        print_table_header($userinfo['username'], 2, 0, '', 'center', 0);
        construct_hidden_code('userid', $vbulletin->GPC['userid']);
        print_description_row(construct_link_code($vbphrase['view_profile'], "user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u=" . $vbulletin->GPC['userid']) . iif($vbulletin->GPC['insertedadmin'], '<br />' . construct_link_code('<span style="color:red;"><strong>' . $vbphrase['update_or_add_administration_permissions'] . '</strong></span>', "adminpermissions.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u=" . $vbulletin->GPC['userid'])));
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:user.php

示例2: foreach

    }
}
$t->assign('paysystems', $pp);
$pp1 = $pp;
//remove free paysystem from select
if (count($pp1) > 1) {
    foreach ($pp1 as $k => $p) {
        if ($k == 'free') {
            unset($pp1[$k]);
        }
    }
}
$t->assign('paysystems_select', $pp1);
// newsletters form
if ($vars['action'] == 'newsletters_update') {
    update_subscriptions();
}
$m = $db->get_user($_amember_id);
$unsubscribed = $m['unsubscribed'];
//$threads_count = $db->get_threads_list_c($_amember_id);
//$threads_list = $db->get_threads_list(0, $db->get_threads_list_c(), $_amember_id);
$threads_list = array();
$threads_list2 = $db->get_threads_list(0, $db->get_threads_list_c());
foreach ($threads_list2 as $k => $v) {
    if ($db->is_subscription_possible($m['member_id'], $m['status'], $v['thread_id'])) {
        $threads_list[] = $v;
    }
}
$threads_count = count($threads_list);
$threads = $db->get_member_threads($_amember_id);
while (list($thread_id, ) = each($threads)) {
开发者ID:subashemphasize,项目名称:test_site,代码行数:31,代码来源:member.php

示例3: COUNT

                }
            }
        }
        $userinfo = $db->query_first("\n\t\t\tSELECT user.*, COUNT(*) AS masks\n\t\t\tFROM " . TABLE_PREFIX . "access AS access, " . TABLE_PREFIX . "user AS user\n\t\t\tWHERE access.userid = {$userid}\n\t\t\t\tAND user.userid = access.userid\n\t\t\tGROUP BY access.userid\n\t\t");
        if (!$userinfo) {
            $userinfo = array('userid' => $userid, 'masks' => 0);
        }
        $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_CP);
        $userdm->set_existing($userinfo);
        $userdm->set_bitfield('options', 'hasaccessmask', $userinfo['masks'] ? true : false);
        $userdm->save();
        unset($userdm);
    }
    if (!empty($userlist)) {
        require_once DIR . '/includes/functions_databuild.php';
        update_subscriptions($userlist);
    }
    define('CP_REDIRECT', 'accessmask.php?do=modify');
    print_stop_message('saved_user_forum_access_successfully');
}
// ###################### Start reset all access masks for forum #######################
if ($_REQUEST['do'] == 'resetforum') {
    $vbulletin->input->clean_array_gpc('r', array('forumid' => TYPE_INT));
    verify_cp_sessionhash();
    if (!$vbulletin->GPC['forumid']) {
        print_stop_message('invalid_forum_specified');
    }
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "access WHERE forumid = " . $vbulletin->GPC['forumid']);
    define('CP_REDIRECT', 'accessmask.php?do=modify');
    print_stop_message('deleted_access_masks_successfully');
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:accessmask.php

示例4: array

        // If you aren't subscribed to a thread by default OR aren't subscribed to this thread,
        // you won't be subscribed to the new thread. If you subscribe by default and are subscribed
        // to this thread, you will be subscribed with the default option. (See 3.6 bug 1342.)
        $insert_subscriptions = array();
        foreach ($unique_thread_user as $threadid => $users) {
            foreach ($users as $userid => $subscriptioninfo) {
                if ($subscriptioninfo['issubscribed'] and $subscriptioninfo['autosubscribe'] != -1) {
                    $insert_subscriptions[] = "({$userid}, {$destthreadinfo['threadid']}, {$subscriptioninfo['autosubscribe']}, 0, 1)";
                }
            }
        }
        if ($insert_subscriptions) {
            $db->query_write("\n\t\t\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "subscribethread\n\t\t\t\t\t(userid, threadid, emailupdate, folderid, canview)\n\t\t\t\tVALUES\n\t\t\t\t\t" . implode(', ', $insert_subscriptions));
        }
        // need to check permissions on these threads
        update_subscriptions(array('threadids' => array($destthreadinfo['threadid'])));
    }
    build_thread_counters($destthreadinfo['threadid']);
    build_forum_counters($destforuminfo['forumid']);
    log_moderator_action($destthreadinfo, 'posts_copied_to_x', $destthreadinfo['threadid']);
    // empty cookie
    setcookie('vbulletin_inlinepost', '', TIMENOW - 3600, '/');
    ($hook = vBulletinHook::fetch_hook('inlinemod_docopyposts')) ? eval($hook) : false;
    $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$destthreadinfo['threadid']}";
    eval(print_standard_redirect('redirect_inline_copiedposts', true, $forceredirect));
}
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
($hook = vBulletinHook::fetch_hook('inlinemod_complete')) ? eval($hook) : false;
$url =& $vbulletin->url;
// spit out the final HTML if we have got this far
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:inlinemod.php

示例5: update_subscriptions

         if ($insertsql) {
             $insertsql .= ',';
         }
         $insertsql .= "({$destinfo['userid']}, 0, {$threads['threadid']}, {$threads['emailupdate']})";
     } else {
         if ($status["{$threads['threadid']}"] != $threads['emailupdate']) {
             $db->query_write("\r\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "subscribethread\r\n\t\t\t\t\tSET emailupdate = {$threads['emailupdate']}\r\n\t\t\t\t\tWHERE userid = {$destinfo['userid']}\r\n\t\t\t\t\t\tAND threadid = {$threads['threadid']}\r\n\t\t\t\t");
         }
     }
 }
 if ($insertsql) {
     /*insert query*/
     $db->query_write("\r\n\t\t\tINSERT " . TABLE_PREFIX . "subscribethread\r\n\t\t\t\t(userid, folderid, threadid, emailupdate)\r\n\t\t\tVALUES\r\n\t\t\t\t{$insertsql}\r\n\t\t");
 }
 require_once DIR . '/includes/functions_databuild.php';
 update_subscriptions(array('userids' => array($destinfo['userid'])));
 // Update Subscribed Events
 $insertsql = '';
 $events = $db->query_read("\r\n\t\tSELECT eventid, reminder\r\n\t\tFROM " . TABLE_PREFIX . "subscribeevent\r\n\t\tWHERE userid = {$sourceinfo['userid']}\r\n\t");
 while ($event = $db->fetch_array($event)) {
     if (!empty($insertsql)) {
         $insertsql .= ',';
     }
     $insertsql .= "({$destinfo['userid']}, {$event['eventid']}, {$event['reminder']})";
 }
 if (!empty($insertsql)) {
     $db->query_write("\r\n\t\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "subscribeevent\r\n\t\t\t\t(userid, eventid, reminder)\r\n\t\t\tVALUES\r\n\t\t\t\t{$insertsql}\r\n\t\t");
 }
 // Update subscribed discussions
 $discussions = $db->query_read("\r\n\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "subscribediscussion\r\n\t\t\t(userid, discussionid, emailupdate)\r\n\t\tSELECT {$destinfo['userid']}, discussionid, emailupdate\r\n\t\tFROM " . TABLE_PREFIX . "subscribediscussion AS src\r\n\t\tWHERE src.userid = {$sourceinfo['userid']}\r\n\t");
 // Update subscribed groups
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:usertools.php

示例6: do_moderation


//.........这里部分代码省略.........
        // Source Dest  Visible Thread    Hidden Thread
        // Yes    Yes   ~           	  ~
        // Yes    No    -visible          ~
        // No     Yes   +visible          ~
        // No     No    ~                 ~
        if ($threadinfo['visible'] and ($method == 'move' or $method == 'movered') and ($foruminfo['countposts'] and !$destforuminfo['countposts'] or !$foruminfo['countposts'] and $destforuminfo['countposts'])) {
            $posts = $db->query_read_slave("\n\t\t\tSELECT userid\n\t\t\tFROM " . TABLE_PREFIX . "post\n\t\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\t\t\tAND\tuserid > 0\n\t\t\t\tAND visible = 1\n\t\t");
            $userbyuserid = array();
            while ($post = $db->fetch_array($posts)) {
                if (!isset($userbyuserid["{$post['userid']}"])) {
                    $userbyuserid["{$post['userid']}"] = 1;
                } else {
                    $userbyuserid["{$post['userid']}"]++;
                }
            }
            if (!empty($userbyuserid)) {
                $userbypostcount = array();
                foreach ($userbyuserid as $postuserid => $postcount) {
                    $alluserids .= ",{$postuserid}";
                    $userbypostcount["{$postcount}"] .= ",{$postuserid}";
                }
                foreach ($userbypostcount as $postcount => $userids) {
                    $casesql .= " WHEN userid IN (0{$userids}) THEN {$postcount}";
                }
                $operator = $destforuminfo['countposts'] ? '+' : '-';
                $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\t\tSET posts = CAST(posts AS SIGNED) {$operator}\n\t\t\t\t\tCASE\n\t\t\t\t\t\t{$casesql}\n\t\t\t\t\t\tELSE 0\n\t\t\t\t\tEND\n\t\t\t\tWHERE userid IN (0{$alluserids})\n\t\t\t");
            }
        }
        build_forum_counters($threadinfo['forumid']);
        if ($threadinfo['forumid'] != $destforuminfo['forumid']) {
            build_forum_counters($destforuminfo['forumid']);
        }
        // Update canview status of thread subscriptions
        update_subscriptions(array('threadids' => array($threadid)));
    }
    // Undelete Posts
    if ($_POST['do'] == 'undeleteposts') {
        $vbulletin->input->clean_array_gpc('p', array('postids' => TYPE_STR));
        $postids = explode(',', $vbulletin->GPC['postids']);
        foreach ($postids as $index => $postid) {
            if (intval($postid) == 0) {
                unset($postids["{$index}"]);
            } else {
                $postids["{$index}"] = intval($postid);
            }
        }
        if (empty($postids)) {
            standard_error(fetch_error('no_applicable_posts_selected'));
        }
        if (count($postids) > 400) {
            standard_error(fetch_error('you_are_limited_to_working_with_x_posts', $postlimit));
        }
        $postids = implode(',', $postids);
        // Validate posts
        $posts = $db->query_read_slave("\n\t\tSELECT post.postid, post.threadid, post.parentid, post.visible, post.title, post.userid,\n\t\t\tthread.forumid, thread.title AS thread_title, thread.postuserid, thread.firstpostid, thread.visible AS thread_visible,\n\t\t\tforum.options AS forum_options\n\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "forum AS forum USING (forumid)\n\t\tWHERE postid IN ({$postids})\n\t\t\tAND (post.visible = 2 OR (post.visible = 1 AND thread.visible = 2 AND post.postid = thread.firstpostid))\n\t\tORDER BY postid\n\t");
        $deletethreads = array();
        while ($post = $db->fetch_array($posts)) {
            $forumperms = fetch_permissions($post['forumid']);
            if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and $post['postuserid'] != $vbulletin->userinfo['userid']) {
                json_error(ERR_NO_PERMISSION);
            }
            if ((!$post['visible'] or !$post['thread_visible']) and !can_moderate($post['forumid'], 'canmoderateposts')) {
                standard_error(fetch_error('you_do_not_have_permission_to_manage_moderated_threads_and_posts'));
            } else {
                if (($post['visible'] == 2 or $post['thread_visible'] == 2) and !can_moderate($post['forumid'], 'candeleteposts')) {
                    standard_error(fetch_error('you_do_not_have_permission_to_manage_deleted_threads_and_posts', $post['title'], $post['thread_title'], $vbulletin->forumcache["{$post['forumid']}"]['title']));
开发者ID:0hyeah,项目名称:yurivn,代码行数:67,代码来源:moderation.php


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