當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Topic::getUrl方法代碼示例

本文整理匯總了PHP中Topic::getUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Topic::getUrl方法的具體用法?PHP Topic::getUrl怎麽用?PHP Topic::getUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Topic的用法示例。


在下文中一共展示了Topic::getUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: exequery

$pagSection = "Home";
require_once "__inc__.php";
require_once ROOT_PATH . "header.php";
?>

<h3>Ultimi topics</h3>
<ul class="nav-list" style="margin: 1em 0;">
<?php 
// Ultimi topics nel forum
$q = exequery(Topic::SELECT_SQL . "WHERE a.private = 0 AND type = " . Forum::TYPE_TOPIC . " \n\t\t\t\tORDER BY last_post_date DESC LIMIT 0,15");
while ($values = mysqli_fetch_array($q)) {
    $topic = new Topic($values);
    ?>
		<li>
			<a class="nowrap" href="<?php 
    echo $topic->getUrl();
    ?>
">
			<span class="tag pull-right" style="margin-left: 0.5em;"><?php 
    echo $topic['argument_title'];
    ?>
</span>
			<span class="bubble red pull-right"><?php 
    echo $topic['replies'];
    ?>
</span>
			<?php 
    echo $topic->getName();
    ?>
			<span class="hide-phone hide-tablet"> - <?php 
    echo $topic->getFormattedDate();
開發者ID:pierotofy,項目名稱:pierotofy.it,代碼行數:31,代碼來源:index.php

示例2: isset

        $message = db_escape(Charset::Utf8ToDB($_POST['message']));
        $is_poll = isset($_POST['poll']);
        // Le domande del sondaggio vengono memorizzate nel campo
        // "poll" come array serializzato. Se "poll" e' null, allora
        // vuol dire che il topic non e' un sondaggio
        if ($is_poll) {
            $poll_questions = explode("\n", trim(purify(Charset::Utf8ToDB($_POST['poll']))));
            if (count($poll_questions) >= 2) {
                $poll_data = db_escape(serialize($poll_questions));
            } else {
                // Numero di domande nel sondaggio non valido (< 2)
                $poll_data = null;
            }
        }
        if (!Forum::IsUserFlooding($currentUser)) {
            exequery(sprintf("INSERT INTO forum_posts (user_id, argument, subject, message, type, post_date, last_post_date, ip, poll, replies) \n                        VALUES(%d, %d, '%s', '%s', %d, %d, %d, '%s', \"%s\", 0)", $currentUser['id'], $_POST['forum_id'], $subject, $message, Forum::TYPE_TOPIC, time(), time(), get_ip(), $poll_data));
            $id = DB::LastId();
            $topic = new Topic($id);
            Forum::IncPostCountForUser($currentUser);
            $response->set("topic_url", $topic->getUrl());
            $response->setSuccess(true);
        } else {
            $response->setError("Attendi almeno " . Forum::FLOOD_SECONDS_LIMIT . " secondi tra un post e l'altro.");
        }
    } else {
        $response->setError("Non sei loggato.");
    }
} else {
    $response->setError($av->getLastError());
}
$response->send();
開發者ID:pierotofy,項目名稱:pierotofy.it,代碼行數:31,代碼來源:newtopic.php

示例3: function

	},

	ShowReplyForm: function(){
		$("#frm-forum-reply").show();	
		$("#btn-forum-reply").hide();

		FormBuilder.GetField("frm-forum-reply", "message").focusToEnd();

		$("body").scrollTo("#frm-forum-reply", {duration: 500});
	}
};	

$(function(){
<?php 
if ($topic['locked']) {
    ?>
	// Se il topic e' bloccato, non permettere agli utenti di rispondere e quotare
	$(".btn-quote, #btn-forum-reply").addClass("disabled");
<?php 
}
?>
});
</script>

<?php 
$pag = new Pagination($posts_count, Forum::POSTS_PER_PAGE, $_GET['p']);
echo $pag->getNavigator("default.html", $topic->getUrl("#PAGE#"));
?>

<?php 
require_once ROOT_PATH . "footer.php";
開發者ID:pierotofy,項目名稱:pierotofy.it,代碼行數:31,代碼來源:viewtopic.php


注:本文中的Topic::getUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。