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


PHP Forum::getTotalTopics方法代碼示例

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


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

示例1:

require LANGS . 'ACPDashboardT.php';
ACPDashboardT::init();
require LIB . 'forum/Forum.php';
if (!$userManager->loggedIn() || !$user->isAdmin()) {
    echo ErrorMessage::setText('You are not allowed to view this page.', true);
}
include 'template/header.php';
echo '
		<h1>
			Dashboard
		</h1>

		<section class="statistics">
			<div class="row">
				<div class="item">
					<span>' . Forum::getTotalTopics() . '</span>
					' . ACPDashboardT::get('topics') . '
				</div>

				<div class="item">
					<span>' . Forum::getTotalPosts() . '</span>
					' . ACPDashboardT::get('posts') . '
				</div>

				<div class="item">
					<span>' . User::getTotalUsers() . '</span>
					' . ACPDashboardT::get('members') . '
				</div>
			</div>

			<div class="row">
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:index.php

示例2: file

//*********************
$fileC = file("db/Users/" . $_SESSION['user']->getUserId() . ".dat", FILE_IGNORE_NEW_LINES);
$fileC[3] = trim($fileC[3]) + 1;
$fileC[4] = trim($fileC[4]) + 1;
$str = "";
foreach ($fileC as $line) {
    $str .= $line . "\n";
}
file_put_contents("db/Users/" . $_SESSION['user']->getUserId() . ".dat", $str);
//********************
$fileC = file("db/forumList.dat", FILE_IGNORE_NEW_LINES);
$str = "";
foreach ($fileC as $statistic) {
    $temp = new Forum($statistic);
    if ($temp->getForumId() == $_SESSION['forum']->getForumId()) {
        $str .= $temp->getForumId() . "~" . $temp->getForumName() . "~" . $temp->getDescription() . "~" . ($temp->getTotalTopics() + 1) . "~" . ($temp->getTotalPosts() + 1) . "\n";
    } else {
        $str .= $statistic . "\n";
    }
}
file_put_contents("db/forumList.dat", $str);
//*********************
$fhTemp = fopen("db/Topics/" . $_GET['forumId'] . "temp.dat", "w");
$fh = fopen("db/Topics/" . $_GET['forumId'] . ".dat", "r");
fwrite($fhTemp, $total . "\n" . time() . "\n");
while (!feof($fh)) {
    $a = trim(fgets($fh));
    $b = trim(fgets($fh));
    if ($a != "" && $b != "") {
        fwrite($fhTemp, $a . "\n" . $b . "\n");
    }
開發者ID:rosslagerwall,項目名稱:floobb,代碼行數:31,代碼來源:addPollExecute.php

示例3: stripslashes

$name = stripslashes($_POST['name']);
$name = str_replace("\n", "", $name);
$name = str_replace("\r\n", "", $name);
$name = str_replace("\r", "", $name);
$name = str_replace("~", "", $name);
$description = stripslashes($_POST['description']);
$description = str_replace("\n", "", $description);
$description = str_replace("\r\n", "", $description);
$description = str_replace("\r", "", $description);
$description = str_replace("~", "", $description);
$description = substr($description, 3, strlen($description) - 7);
if (trim($name) == "") {
    header("Location: forumListEdit.php?forumId=" . $_GET['forumId'] . "&error=1");
    exit;
}
if (trim($description) == "") {
    header("Location: forumListEdit.php?forumId=" . $_GET['forumId'] . "&error=2");
    exit;
}
$fileC = file("db/forumList.dat", FILE_IGNORE_NEW_LINES);
$str = "";
foreach ($fileC as $statistic) {
    $temp = new Forum($statistic);
    if ($temp->getForumId() == $_GET['forumId']) {
        $str .= $temp->getForumId() . "~" . $name . "~" . $description . "~" . $temp->getTotalTopics() . "~" . $temp->getTotalPosts() . "\n";
    } else {
        $str .= $statistic . "\n";
    }
}
file_put_contents("db/forumList.dat", $str);
header("Location: index.php");
開發者ID:rosslagerwall,項目名稱:floobb,代碼行數:31,代碼來源:forumListEditExecute.php


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