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


PHP Output::Assign方法代码示例

本文整理汇总了PHP中Output::Assign方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::Assign方法的具体用法?PHP Output::Assign怎么用?PHP Output::Assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Output的用法示例。


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

示例1: Check4Ban

function Check4Ban($posting = false)
{
    global $User;
    $uid = Input::ToString($User->ID);
    $ip = $_SERVER['REMOTE_ADDR'];
    $res = DB::Execute("SELECT flags,reason,expiry,appeal FROM {P}Bans WHERE ip='{$ip}' OR uid='{$uid}'");
    if ($res->RecordCount() == 0) {
        return;
    }
    // NO BAN
    list($flags, $reason, $expiry, $appeal) = $res->FetchRow();
    $td = $expiry - $_SERVER['REQUEST_TIME'];
    //	echo "TD: $td";
    if ($td < 0) {
        remove_id_ban($uid);
        remove_ip_ban($ip);
        return;
    }
    if (!empty($_POST['A_PEEL']) && !($flags & BANF_APPEAL_DENIED)) {
        $appeal = $_POST['A_PEEL'];
        DB::Execute("UPDATE {P}Bans SET appeal=" . DB::Q($appeal) . " WHERE uid='{$id}' OR ip='{$ip}'");
        redirect('Appeal updated.', '/');
    }
    if ($flags & BANF_NO_READ || $posting) {
        if ($flags & BANF_STEALTH) {
            die('');
        }
        // WSoD
        Output::Assign('flags', $flags);
        Output::Assign('reason', $reason);
        Output::Assign('expiry', $expiry);
        Output::Assign('appeal', $appeal);
        Output::$tpl->display('banned.tpl.php');
        exit;
        $derp = 1 / 0;
        // Just in case.
    }
}
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:38,代码来源:functions.php

示例2: update_activity

$topic->Parse();
$topic->GetReplies();
Output::Assign('topic', $topic);
update_activity('topic', $_GET['id']);
$page_title = 'Topic: ' . htmlspecialchars($topic->Headline);
// Increment visit count.
if (!isset($_SESSION['visited_topics'][$_GET['id']]) && isset($_COOKIE['SID'])) {
    $_SESSION['visited_topics'][$_GET['id']] = 1;
    DB::Execute('UPDATE {P}Topics SET visits = visits + 1 WHERE id = ' . $_GET['id']);
}
// Set visited cookie...
$last_read_post = $User->Visited[$_GET['id']];
if ($last_read_post !== $topic->Replies) {
    // Build cookie.
    // Add the current topic:
    $User->Visited = array($_GET['id'] => $topic_replies) + $User->Visited;
    // Readd old topics.
    foreach ($User->Visited as $cur_topic_id => $num_replies) {
        // If the cookie is getting too long (4kb), stop.
        if (strlen($cookie_string) > 3900) {
            break;
        }
        $cookie_string .= 't' . $cur_topic_id . 'n' . $num_replies;
    }
    CreateCookie('topic_visits', $cookie_string);
}
Output::Assign('LastReadPost', $last_read_post);
// Output dummy form. (This is for JavaScript submissions to action.php.)
dummy_form();
echo Output::$tpl->Fetch('topic.tpl.php');
require 'includes/footer.php';
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:31,代码来源:topic.php

示例3: force_id

<?php

require 'includes/header.php';
force_id();
Output::Assign('sidebar', $sidebar);
Output::$tpl->display('dashhead.tpl.php');
$page_title = 'Your trash can';
if ($_POST['empty_trash']) {
    $delete_topic = $link->prepare('DELETE FROM trash WHERE uid = ?');
    $delete_topic->bind_param('s', $_SESSION['UID']);
    $delete_topic->execute();
    $delete_topic->close();
    $_SESSION['notice'] = 'Trash emptied.';
}
echo '<p>Your deleted topics and replies are archived here.</p>';
if ($trash = show_trash($_SESSION['UID'])) {
    echo $trash;
    ?>

	<form action="" method="post">
		<div class="row">
			<input type="submit" name="empty_trash" value="Empty trash can" onclick="return confirm('Really?');" />
		</div>
	</form>

	<?php 
}
Output::$tpl->display('dashfooter.tpl.php');
require 'includes/footer.php';
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:29,代码来源:trash_can.php

示例4: array

					$puntxt='<b>Ban user for '.calculate_age($expiry+time(),time()).'.</b>';
					break;
				case PUNISH_ERROR:
					$puntxt='<b>Display a 403 and stop posting.</b>';
					break;
				default:
					$puntxt="<b>Unknown: \$punish=$punish; \$expiry=$expiry; \$replacement=$replacement;</b>";
					break;
			}
			$r = array('<input type="checkbox" name="del_filter[]" value="'.$id.'" />',$id,"<code>$txt</code",$reason,$puntxt);
			$tbl->Row($r);
		}
		Output::Assign('tbl',$tbl);
		Output::Assign('Options',array(
				PUNISH_REPLACE	=> 'Replace',
				PUNISH_BAN	=> 'Ban',
				PUNISH_ERROR	=> 'Display Error')
		);
		Output::$tpl->display('controlpanel/list_filters.tpl.php');

		break;
	case 'add_filters':
		$page_title="Process Filters";

/*		
			filter[]	Text to filter
			type[]		filter_type
			replace[]	Replace with
			duration[]	Ban Duration
			reason[]	Ban Reason
			del_filter[]	Delete Filter
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:31,代码来源:controlpanel.php

示例5: ob_get_contents

* 
* Copyright (c) 2009-2010 ATBBS Contributors
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
$buffered_content = ob_get_contents();
ob_end_clean();
// require 'template.php';
Output::Assign('title', $page_title);
Output::Assign('onload', $onload_javascript);
Output::Assign('body', $buffered_content);
Output::Assign('head', $header);
Output::Assign('menu', $main_menu);
Output::Assign('User', $User);
Output::Flush();
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:31,代码来源:footer.php


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