本文整理汇总了PHP中Thread::getThreadID方法的典型用法代码示例。如果您正苦于以下问题:PHP Thread::getThreadID方法的具体用法?PHP Thread::getThreadID怎么用?PHP Thread::getThreadID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thread
的用法示例。
在下文中一共展示了Thread::getThreadID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Thread
// H?mta poster
$oThread = new Thread($_GET['ID']);
if ($sErr = $oThread->getErrorMsg()) {
trigger_error("8: " . $sErr, E_USER_WARNING);
}
if ($bInlogged) {
$_SESSION['a_iOldThreads'][$_GET['ID']] = $oThread->getNumberPosts();
}
// Markera tr?den som l?st
$oThread->read();
if (FALSE === ($a_oPosts = $oThread->getPosts($iNumberPosts * ($_GET['Page'] - 1), $iNumberPosts))) {
trigger_error("23. " . $oThread->getErrorMsg(), E_USER_WARNING);
}
// Bygg upp sidan
$oTemplate->set("title", $oConfiguration->getCustomValue("Title"));
$oTemplate->set("id", $oThread->getThreadID());
if ($bInlogged) {
$oTemplate->set("User_ID", $_SESSION['oUser']->getID());
$oTemplate->set("User_Name", htmlspecialchars($_SESSION['oUser']->getName()));
$oTemplate->replace("Login_Outside", "Login_Inside");
$oTemplate->replace("CantPost", "NewPost");
}
// Kolla om det finns fler sidor
if ($oThread->getNumberPosts() > $iNumberPosts) {
$oTemplate->replace("Empty", "MultiPages");
$oTemplate->replace("Empty2", "MultiPages");
$iPages = (int) (@$oThread->getNumberPosts() / $iNumberPosts);
if (!((double) $iPages == @$oThread->getNumberPosts() / $iNumberPosts)) {
$iPages++;
}
for ($n = 1; $n <= $iPages; $n++) {
示例2: Thread
$oConfiguration =& Configuration::createInstance();
// Kolla så vi fått rätt grejer
if (!(strlen($_POST['subject']) > 0)) {
trigger_error("36", E_USER_ERROR);
}
if (!(strlen($_POST['body']) > 0)) {
trigger_error("36", E_USER_ERROR);
}
// Session
session_start();
// Kolla om vi är inloggade
if (!($bInlogged = validUser())) {
// Det är vi inte, fixa variabler och stäng sessionen igen
session_destroy();
trigger_error("43", E_USER_ERROR);
die;
}
// Skapa ny tråd
$oThread = new Thread(htmlspecialchars($_POST['subject']), $_SESSION['oUser']->getUser());
if ($sErr = $oThread->getErrorMsg()) {
trigger_error("45: " . $sErr, E_USER_ERROR);
}
// Skapa ny post
$oPost = new Post($_SESSION['oUser']->getUser(), wordwrap(nl2br(htmlspecialchars($_POST['body'])), $oConfiguration->getCustomValue("LineBreak"), "<br>"), $oThread->getThreadID());
if (!$oPost->saveData()) {
trigger_error("44: " . $oPost->getErrorMsg(), E_USER_ERROR);
}
// Gör inte den nya tråden ploppad
$_SESSION['a_iOldThreads'][$oThread->getThreadID()] = 1;
// Redirekta
header("Location: " . $oConfiguration->getCustomValue("GoWhereAfterNewThread"));