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


PHP construct_errors函数代码示例

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


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

示例1: fetch_error

     }
 }
 // check for message flooding
 if ($vbulletin->options['pmfloodtime'] > 0 and !$vbulletin->GPC['preview']) {
     if (!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) and !can_moderate()) {
         $floodcheck = $db->query_first("\n\t\t\t\tSELECT pmtextid, title, dateline\n\t\t\t\tFROM " . TABLE_PREFIX . "pmtext AS pmtext\n\t\t\t\tWHERE fromuserid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\tORDER BY dateline DESC\n\t\t\t");
         if (($timepassed = TIMENOW - $floodcheck['dateline']) < $vbulletin->options['pmfloodtime']) {
             $errors[] = fetch_error('pmfloodcheck', $vbulletin->options['pmfloodtime'], $vbulletin->options['pmfloodtime'] - $timepassed);
         }
     }
 }
 // process errors if there are any
 $errors = array_merge($errors, $pmdm->errors);
 if (!empty($errors)) {
     define('PMPREVIEW', 1);
     $preview = construct_errors($errors);
     // this will take the preview's place
     $_REQUEST['do'] = 'newpm';
 } else {
     if ($vbulletin->GPC['preview'] != '') {
         define('PMPREVIEW', 1);
         $foruminfo = array('forumid' => 'privatemessage', 'allowicons' => $vbulletin->options['privallowicons']);
         $preview = process_post_preview($pm);
         $_REQUEST['do'] = 'newpm';
     } else {
         // everything's good!
         $pmdm->save();
         // force pm counters to be rebuilt
         $vbulletin->userinfo['pmunread'] = -1;
         build_pm_counters();
         ($hook = vBulletinHook::fetch_hook('private_insertpm_complete')) ? eval($hook) : false;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:private.php

示例2: vB_AJAX_XML_Builder

			{
				require_once(DIR . '/includes/class_xml.php');
				$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
				$xml->add_group('errors');
				foreach ($dataman->errors AS $error)
				{
					$xml->add_tag('error', $error);
				}
				$xml->close_group();
				$xml->print_xml();
			}
			else
			{
				define('MESSAGEPREVIEW', true);
				require_once(DIR . '/includes/functions_newpost.php');
				$preview = construct_errors($dataman->errors);
				$_GET['do'] = 'message';
			}
		}
		else if ($vbulletin->GPC['preview'] OR $vbulletin->GPC['advanced'])
		{
			define('MESSAGEPREVIEW', true);

			if ($vbulletin->GPC['preview'])
			{
				$preview = process_visitor_message_preview($message);
			}

			$_GET['do'] = 'message';
		}
		else
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:visitormessage.php

示例3: fetch_userinfo

    // if changing an album to a profile album, be sure we actually have perm to change it
    if ($vbulletin->GPC['albumtype'] == 'profile' and $albuminfo['state'] != 'profile') {
        $creator = fetch_userinfo($albumdata->fetch_field('userid'));
        cache_permissions($creator);
        $can_profile_album = ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_profile_styling'] and $creator['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditbgimage']);
        if (!$can_profile_album) {
            $vbulletin->GPC['albumtype'] = 'public';
        }
    }
    $albumdata->set('state', $vbulletin->GPC['albumtype']);
    $albumdata->pre_save();
    ($hook = vBulletinHook::fetch_hook('album_album_update')) ? eval($hook) : false;
    if ($albumdata->errors) {
        $formdata = array_merge($albumdata->existing, $albumdata->album);
        require_once DIR . '/includes/functions_newpost.php';
        $errortable = construct_errors($albumdata->errors);
        $_REQUEST['do'] = 'addalbum';
        define('PREVIEW_ERRORS', true);
    } else {
        $albumdata->save();
        if (!empty($albuminfo['albumid']) and $albuminfo['userid'] != $vbulletin->userinfo['userid'] and can_moderate(0, 'caneditalbumpicture')) {
            require_once DIR . '/includes/functions_log_error.php';
            log_moderator_action($albuminfo, 'album_x_by_y_edited', array($albuminfo['title'], $userinfo['username']));
        }
        $vbulletin->url = 'album.php?' . $vbulletin->session->vars['sessionurl'] . 'albumid=' . $albumdata->fetch_field('albumid');
        eval(print_standard_redirect('album_added_edited'));
    }
}
// #######################################################################
if ($_REQUEST['do'] == 'addalbum' or $_REQUEST['do'] == 'editalbum') {
    // $formdata will fall through on preview
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:album.php

示例4: eval

                 $infraction['post'] = $vbulletin->options['bburl'] . "/showthread.php?p={$postinfo['postid']}#post{$postinfo['postid']}";
                 $infraction['pagetext'] =& $postinfo['pagetext'];
                 $emailphrase = $emailsubphrase . '_post';
             } else {
                 $infraction['post'] = '';
                 $emailphrase = $emailsubphrase . '_profile';
             }
             eval(fetch_email_phrases($emailphrase, $userinfo['languageid'], $emailsubphrase));
             $message = $plaintext_parser->parse($message, 'privatemessage');
             vbmail($userinfo['email'], $subject, $message);
         }
     } else {
         if (!empty($errors)) {
             // include useful functions
             require_once DIR . '/includes/functions_newpost.php';
             $postpreview = construct_errors(array_map('fetch_error', $errors));
             define('PMPREVIEW', 1);
         }
     }
 }
 if (!defined('PMPREVIEW')) {
     // trim the message so it's not too long
     if ($vbulletin->options['postmaxchars'] > 0) {
         $trimmed_postmessage = substr($vbulletin->GPC['message'], 0, $vbulletin->options['postmaxchars']);
     } else {
         $trimmed_postmessage =& $vbulletin->GPC['message'];
     }
     $infdata->set_info('message', $trimmed_postmessage);
     ($hook = vBulletinHook::fetch_hook('infraction_update_process')) ? eval($hook) : false;
     $infdata->save();
     // Ban
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:infraction.php

示例5: array

	if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
	{
		$newpost['emailupdate'] = 0;
	}

	if (!$vbulletin->GPC['subscribe'])
	{
		$newpost['emailupdate'] = 9999;
	}

	build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

	if (sizeof($errors) > 0)
	{
		// ### POST HAS ERRORS ###
		$postpreview = construct_errors($errors); // this will take the preview's place
		construct_checkboxes($newpost);
		$_REQUEST['do'] = 'newthread';
		$newpost['message'] = htmlspecialchars_uni($newpost['message']);
		$podcasturl = htmlspecialchars_uni($newpost['podcasturl']);
		$podcastsize = ($newpost['podcastsize']) ? $newpost['podcastsize'] : '';
		$podcastkeywords = htmlspecialchars_uni($newpost['podcastkeywords']);
		$podcastsubtitle = htmlspecialchars_uni($newpost['podcastsubtitle']);
		$podcastauthor = htmlspecialchars_uni($newpost['podcastauthor']);
		$explicitchecked = $newpost['podcastexplicit'] ? 'checked="checked"' : '';
	}
	else if ($newpost['preview'])
	{
		if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] AND $vbulletin->userinfo['userid'] AND !empty($vbulletin->userinfo['attachmentextensions']))
		{
			require_once(DIR . '/packages/vbattach/attach.php');
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:newthread.php

示例6: datamanager_init

     $pm['message'] =& $vbulletin->GPC['message'];
     $pm['title'] =& $vbulletin->GPC['title'];
     $pm['recipients'] =& $vbulletin->GPC['recipients'];
     // create the DM to do error checking and insert the new PM
     $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
     $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
     $pmdm->set('fromusername', $vbulletin->userinfo['username']);
     $pmdm->setr('title', $pm['title']);
     $pmdm->setr('message', $pm['message']);
     $pmdm->set_recipients($pm['recipients'], $permissions);
     $pmdm->set('dateline', TIMENOW);
     $pmdm->pre_save();
     // process errors if there are any
     $errors = $pmdm->errors;
     if (!empty($errors)) {
         $error = construct_errors($errors);
         // this will take the preview's place
         eval(standard_error($error));
     } else {
         // everything's good!
         $pmdm->save();
         unset($pmdm);
         $award_send += 4;
     }
 }
 if (!empty($vbulletin->options['award_request_formemailaddress'])) {
     vbmail($vbulletin->options['award_request_formemailaddress'], $posttitle, $formsend);
     $award_send += 8;
 }
 if ($award_send > 0) {
     $errormessage = $vbphrase['award_request_completed'];
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:request_award.php

示例7: prepare_pt_note_preview

/**
* Prepares the preview of note text or the error box.
*
* @param	array	Input data (GPC)
* @param	object	Issue note data manager
* @param	array	(Output) Array of info about this note, in the same form that would come from the DB
* @param	array	(In/Out) Info about this issue, as it would come from the DB
*
* @return	string	Preview/error HTML
*/
function prepare_pt_note_preview($input, &$notedata, &$issuenote, &$issue)
{
    global $vbulletin, $db, $show, $stylevar, $vbphrase, $template_hook;
    if ($notedata->errors) {
        require_once DIR . '/includes/functions_newpost.php';
        $preview = construct_errors($notedata->errors);
    } else {
        require_once DIR . '/includes/class_bbcode.php';
        $bbcode =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
        $preview_text = $bbcode->parse($input['message'], 'pt');
        eval('$preview = "' . fetch_template('pt_preview') . '";');
    }
    $input_map = array('pagetext' => $input['message'], 'private' => $input['private'], 'petitionstatusid' => $input['petitionstatusid'], 'reason' => $input['reason']);
    $issuenote = $notedata->pt_issuenote + $notedata->existing + $input_map;
    $issue['subscribetype'] = $input['subscribetype'];
    return $preview;
}
开发者ID:holandacz,项目名称:nb4,代码行数:27,代码来源:functions_pt_posting.php

示例8: vB_AJAX_XML_Builder

		if ($vbulletin->GPC['ajax'])
		{
			require_once(DIR . '/includes/class_xml.php');
			$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
			$xml->add_group('errors');
			foreach ($blogman->errors AS $error)
			{
				$xml->add_tag('error', $error);
			}
			$xml->close_group();
			$xml->print_xml();
		}
		else
		{
			define('COMMENTPREVIEW', true);
			$preview = construct_errors($blogman->errors); // this will take the preview's place
			$previewpost = true;
			$_REQUEST['do'] = 'comment';
		}
	}
	else if ($vbulletin->GPC['preview'])
	{
		define('COMMENTPREVIEW', true);
		$preview = process_blog_preview($blog, 'comment');
		$previewpost = true;
		$_REQUEST['do'] = 'comment';
	}
	else if ($vbulletin->GPC['advanced'])
	{
		$_REQUEST['do'] = 'editcomment';
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:blog_post.php

示例9: array

 if ($vbulletin->GPC['fromquickcomment'] and $vbulletin->GPC['preview']) {
     $blogman->errors = array();
 }
 if (!empty($blogman->errors)) {
     if ($vbulletin->GPC['ajax']) {
         require_once DIR . '/includes/class_xml.php';
         $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
         $xml->add_group('errors');
         foreach ($blogman->errors as $error) {
             $xml->add_tag('error', $error);
         }
         $xml->close_group();
         $xml->print_xml();
     } else {
         define('COMMENTPREVIEW', true);
         $preview = construct_errors($blogman->errors);
         // this will take the preview's place
         $previewpost = true;
         $_REQUEST['do'] = 'comment';
     }
 } else {
     if ($vbulletin->GPC['preview']) {
         define('COMMENTPREVIEW', true);
         $preview = process_blog_preview($blog, 'comment');
         $previewpost = true;
         $_REQUEST['do'] = 'comment';
     } else {
         if ($vbulletin->GPC['advanced']) {
             $_REQUEST['do'] = 'editcomment';
         } else {
             $blogcommentid = $blogman->save();
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:blog_post.php


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