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


PHP can_moderate_calendar函数代码示例

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


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

示例1: empty

 $eventdata->setr_info('totime', $totime);
 $eventdata->setr_info('fromdate', $fromdate);
 $eventdata->setr_info('todate', $todate);
 $eventdata->setr_info('type', $vbulletin->GPC['type']);
 $eventdata->setr_info('recur', $vbulletin->GPC['recur']);
 $eventdata->set('title', $vbulletin->GPC['title']);
 $eventdata->set('event', $message);
 $eventdata->set('allowsmilies', empty($vbulletin->GPC['disablesmilies']) ? true : false);
 $eventdata->set('utc', $timezoneoffset);
 $eventdata->set('recurring', $type == 'recur' ? $vbulletin->GPC['recur']['pattern'] : 0);
 $eventdata->set('calendarid', $calendarinfo['calendarid']);
 $eventdata->set('dst', $dst);
 $eventdata->set_userfields($vbulletin->GPC['userfield']);
 if (!$eventinfo['eventid']) {
     // No Eventid == Insert Event
     if (can_moderate_calendar($calendarinfo['calendarid'], 'canmoderateevents')) {
         $eventdata->set('visible', 1);
         $visible = 1;
     } else {
         if (!($vbulletin->userinfo['calendarpermissions']["{$calendarinfo['calendarid']}"] & $vbulletin->bf_ugp_calendarpermissions['isnotmoderated']) or $calendarinfo['moderatenew']) {
             $eventdata->set('visible', 0);
             $visible = 0;
         } else {
             $eventdata->set('visible', 1);
             $visible = 1;
         }
     }
     $eventdata->set('userid', $vbulletin->userinfo['userid']);
     $eventdata->set('calendarid', $calendarinfo['calendarid']);
     $eventid = $eventdata->save();
     clear_autosave_text('vBForum_Calendar', 0, 0, $vbulletin->userinfo['userid']);
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:calendar.php

示例2: iif

			AND dateline > " . iif($vbulletin->options['timeoutcontrolpanel'], intval(TIMENOW - $vbulletin->options['cookietimeout']), intval(TIMENOW - 3600))
	);

	if (!empty($cpsession))
	{
		$db->shutdown_query("
			UPDATE LOW_PRIORITY " . TABLE_PREFIX . "cpsession
			SET dateline = " . TIMENOW . "
			WHERE userid = " . $vbulletin->userinfo['userid'] . "
				AND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'
		");
	}
}

define('CP_SESSIONHASH', $cpsession['hash']);

if ((!can_moderate() AND !can_moderate_calendar()) OR ($vbulletin->options['timeoutcontrolpanel'] AND !$vbulletin->session->vars['loggedin']) OR empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) OR $vbulletin->GPC[COOKIE_PREFIX . 'cpsession'] != $cpsession['hash'] OR empty($cpsession))
{
	print_cp_login();
}

($hook = vBulletinHook::fetch_hook('mod_global')) ? eval($hook) : false;

/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 33812 $
|| ####################################################################
\*======================================================================*/
?>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:global.php

示例3: fetch_options_overrides

}
// ###################### Get date / time info #######################
// override date/time settings if specified
fetch_options_overrides($vbulletin->userinfo);
fetch_time_data();
// ############################################ LANGUAGE STUFF ####################################
// initialize $vbphrase and set language constants
$vbphrase = init_language();
$_tmp = NULL;
$stylevar = fetch_stylevars($_tmp, $vbulletin->userinfo);
$permissions = cache_permissions($vbulletin->userinfo, true);
$vbulletin->userinfo['permissions'] =& $permissions;
$cpsession = array();
$vbulletin->input->clean_array_gpc('c', array(COOKIE_PREFIX . 'cpsession' => TYPE_STR));
if (!empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession'])) {
    $cpsession = $db->query_first("\n\t\tSELECT * FROM " . TABLE_PREFIX . "cpsession\n\t\tWHERE userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\tAND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'\n\t\t\tAND dateline > " . iif($vbulletin->options['timeoutcontrolpanel'], intval(TIMENOW - $vbulletin->options['cookietimeout']), intval(TIMENOW - 3600)));
    if (!empty($cpsession)) {
        $db->shutdown_query("\n\t\t\tUPDATE LOW_PRIORITY " . TABLE_PREFIX . "cpsession\n\t\t\tSET dateline = " . TIMENOW . "\n\t\t\tWHERE userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\tAND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'\n\t\t");
    }
}
define('CP_SESSIONHASH', $cpsession['hash']);
if (!can_moderate() and !can_moderate_calendar() or $vbulletin->options['timeoutcontrolpanel'] and !$vbulletin->session->vars['loggedin'] or empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) or $vbulletin->GPC[COOKIE_PREFIX . 'cpsession'] != $cpsession['hash'] or empty($cpsession)) {
    print_cp_login();
}
($hook = vBulletinHook::fetch_hook('mod_global')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:19, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 26608 $
|| ####################################################################
\*======================================================================*/
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:global.php

示例4: process_new_login

function process_new_login($logintype, $cookieuser, $cssprefs)
{
	global $vbulletin;

	$lang_info = array(
		'lang_locale' => $vbulletin->userinfo['lang_locale'],
		'lang_charset' => $vbulletin->userinfo['lang_charset']
	);

	$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");

	if ($vbulletin->session->created == true AND $vbulletin->session->vars['userid'] == 0)
	{
		// if we just created a session on this page, there's no reason not to use it
		$newsession =& $vbulletin->session;
	}
	else
	{
		$newsession = new vB_Session($vbulletin, '', $vbulletin->userinfo['userid'], '', $vbulletin->session->vars['styleid'], $vbulletin->session->vars['languageid']);
	}
	$newsession->set('userid', $vbulletin->userinfo['userid']);
	$newsession->set('loggedin', 1);
	if ($logintype == 'cplogin')
	{
		$newsession->set('bypass', 1);
	}
	else
	{
		$newsession->set('bypass', 0);
	}
	$newsession->set_session_visibility(($vbulletin->superglobal_size['_COOKIE'] > 0));
	$newsession->fetch_userinfo();
	$vbulletin->session =& $newsession;
	$vbulletin->userinfo = $newsession->userinfo;
	$vbulletin->userinfo['lang_locale'] = $lang_info['lang_locale'];
	$vbulletin->userinfo['lang_charset'] = $lang_info['lang_charset'];

	// admin control panel or upgrade script login
	if ($logintype === 'cplogin')
	{
		$permissions = cache_permissions($vbulletin->userinfo, false);
		$vbulletin->userinfo['permissions'] =& $permissions;
		if ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
		{
			if ($cssprefs != '')
			{
				$admininfo = $vbulletin->db->query_first_slave("SELECT * FROM " . TABLE_PREFIX . "administrator WHERE userid = " . $vbulletin->userinfo['userid']);
				if ($admininfo)
				{
					$admindm =& datamanager_init('Admin', $vbulletin, ERRTYPE_SILENT);
					$admindm->set_existing($admininfo);
					$admindm->set('cssprefs', $vbulletin->GPC['cssprefs']);
					$admindm->save();
				}
			}

			$cpsession = $vbulletin->session->fetch_sessionhash();
			/*insert query*/
			$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
			vbsetcookie('cpsession', $cpsession, false, true, true);

			if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
			{
				vbsetcookie('userid', $vbulletin->userinfo['userid'], false, true, true);
				vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), false, true, true);
			}
		}
	}

	// moderator control panel login
	if ($logintype === 'modcplogin')
	{
		$permissions = cache_permissions($vbulletin->userinfo, false);
		$vbulletin->userinfo['permissions'] =& $permissions;

		require_once(DIR . '/includes/functions_calendar.php');
		if (can_moderate() OR can_moderate_calendar())
		{
			$cpsession = $vbulletin->session->fetch_sessionhash();
			/*insert query*/
			$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
			vbsetcookie('cpsession', $cpsession, false, true, true);

			if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
			{
				vbsetcookie('userid', $vbulletin->userinfo['userid'], false, true, true);
				vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), false, true, true);
			}
		}
	}

	($hook = vBulletinHook::fetch_hook('login_process')) ? eval($hook) : false;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:93,代码来源:functions_login.php

示例5: construct_nav_option

     construct_nav_option($vbphrase['forum_manager'], 'forum.php?do=modify');
     construct_nav_group($vbphrase['announcements']);
     construct_nav_spacer();
 }
 // *************************************************
 $canmoderate = false;
 if (can_moderate(0, 'canmoderateposts')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_threads'], 'moderate.php?do=posts');
     construct_nav_option($vbphrase['moderate_posts'], 'moderate.php?do=posts#posts');
 }
 if (can_moderate(0, 'canmoderateattachments')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_attachments'], 'moderate.php?do=attachments');
 }
 if (can_moderate_calendar()) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_events'], 'moderate.php?do=events');
 }
 if (can_moderate(0, 'canmoderatevisitormessages')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_visitor_messages'], 'moderate.php?do=messages');
 }
 if ($canmoderate) {
     construct_nav_group($vbphrase['moderation']);
     construct_nav_spacer();
 }
 // *************************************************
 $canuser = false;
 if (can_moderate(0, 'canunbanusers') or can_moderate(0, 'canbanusers') or can_moderate(0, 'canviewprofile') or can_moderate(0, 'caneditsigs') or can_moderate(0, 'caneditavatar')) {
     $canuser = true;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:index.php

示例6: array

        $eventinfo = array('eventid' => $eventid);
        // init event datamanager class
        $eventdata =& datamanager_init('Event', $vbulletin, ERRTYPE_SILENT);
        $eventdata->set_existing($eventinfo);
        if ($action == 1) {
            // validate
            $eventdata->verify_datetime = false;
            $eventdata->set('utc', $vbulletin->GPC['eventtimezone']["{$eventid}"]);
            if (can_moderate_calendar($getcalendarid['calendarid'], 'caneditevents')) {
                $eventdata->set('title', $vbulletin->GPC['eventsubject']["{$eventid}"]);
                $eventdata->set('event', $vbulletin->GPC['eventtext']["{$eventid}"]);
            }
            $eventdata->set('visible', 1);
            $eventdata->save();
        } else {
            if ($action == -1 and can_moderate_calendar($getcalendarid['calendarid'], 'candeleteevents')) {
                // delete
                $eventdata->delete();
            }
        }
    }
    define('CP_REDIRECT', 'moderate.php?do=events');
    print_stop_message('moderated_events_successfully');
}
// ###################### Start thread/post moderation #######################
if ($_REQUEST['do'] == 'posts') {
    // fetch threads and posts to be moderated from the moderation table
    // this saves a index on visible and a query with about 3 inner joins
    $threadids = array();
    $postids = array();
    $hasdelperm = array();
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:moderate.php

示例7: can_edit

 public function can_edit($user)
 {
     if (can_moderate_calendar($calendarinfo['calendarid'], 'caneditevents')) {
         return true;
     }
     if ($this->get_field('userid') != $user->get_field('userid')) {
         return true;
     }
     if ($user->hasCalendarPermission($this->get_field('calendarid'), 'caneditevent')) {
         return true;
     }
     return false;
 }
开发者ID:Kheros,项目名称:MMOver,代码行数:13,代码来源:event.php


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