本文整理匯總了PHP中Topic::getTopic方法的典型用法代碼示例。如果您正苦於以下問題:PHP Topic::getTopic方法的具體用法?PHP Topic::getTopic怎麽用?PHP Topic::getTopic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Topic
的用法示例。
在下文中一共展示了Topic::getTopic方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTopicStatistic
function getTopicStatistic($t_id)
{
// Wertprüfung
$t_id = abs(intval($t_id));
echo '<form action="index.php?site=statistic&action=getStatisticQuestions" method="post">';
$button = Function_getTopic_02;
$topic = new Topic();
$topic->getTopic();
$arrayTopic = $topic->getTopicArray();
echo "<div>\n";
// In der Mitte der Inhalt
showForm($t_id, $button, $arrayTopic);
}
示例2: Topic
require 'core/init.php';
?>
<?php
$topic = new Topic();
$topic_id = $_GET['id'];
if (isset($_POST['do_reply'])) {
$validate = new Validator();
$data = array();
$data['topic_id'] = $_GET['id'];
$data['user_id'] = getUser()['user_id'];
$data['body'] = $_POST['body'];
$field_array = array('body');
if ($validate->isRequired($field_array)) {
if ($topic->reply($data)) {
redirect('topic.php?id=' . $topic_id, 'Your reply has been posted', 'success');
} else {
redirect('topic.php?id=' . $topic_id, 'Something went wrong with your reply', 'error');
}
} else {
redirect('topic.php?id=' . $topic_id, 'Your reply from is empty', 'error');
}
}
//get template & assign vars
$template = new Template('templates/topic.php');
//Assign vars
$template->topic = $topic->getTopic($topic_id);
$template->replies = $topic->getReplies($topic_id);
$template->title = $topic->getTopic($topic_id)->title;
//display templates
echo $template;
示例3: htmlspecialchars
$question->setID($q_id);
$question->setActive();
echo " <meta http-equiv='refresh' content='0; url=?{$site}'>";
break;
case 'showDetails':
// Anzeigen der Fragedetails
if ($q_id != 0) {
$_SESSION['values']['question']['q_id'] = $q_id;
}
if ($error == 'conflict') {
echo "<h5>" . Topic_01 . " <br /></h5>";
}
$question->setID($_SESSION['values']['question']['q_id']);
$question->loadQuestion();
$type = $question->getType();
$topics->getTopic();
$topicArray = $topics->getTopicArray();
$question->setAllTopics($topicArray);
$question->showQuestionDetails();
$answer->setQuestionID($_SESSION['values']['question']['q_id']);
$answer->setAnswerType($_SESSION['values']['question']['qt']);
$answer->getAnswers();
$answer->showAnswers();
break;
case 'updateQuestion':
// Question updaten
// Wertzuweisung
$questionText = "";
if (isset($_REQUEST["question"])) {
$questionText = htmlspecialchars($_REQUEST["question"]);
}
示例4: htmlspecialchars
$_SESSION['values']['question']['descriptionText'] = htmlspecialchars($_POST["descriptionText"]);
}
// Session Variable setzen
$_SESSION['values']['question']['new'] = 1;
}
$question->setType($_SESSION['values']['question']['qt']);
$question->setTopic($_SESSION['values']['question']['t_id']);
if ($_SESSION['values']['question']['descriptionText'] == '') {
$_SESSION['values']['question']['description'] = 0;
}
if ($_SESSION['values']['question']['description'] == 0 && $_SESSION['values']['question']['descriptionText'] != '') {
$_SESSION['values']['question']['descriptionText'] = '';
}
$check = $question->checkQuestion();
if ($check == 1 && $_SESSION['values']['question']['t_id'] != '') {
$topic->getTopic();
$topicArray = $topic->getTopicArray();
$question->setAllTopics($topicArray);
$question->showQuestionInfos();
$answer->setQuestionType($_SESSION['values']['question']['qt']);
$answer->addAnswer();
$answer->addAnswer();
$answer->setType();
} elseif ($check == 2) {
echo "<meta http-equiv='refresh' content='0; url=index.php?site=collect_question&error=exists' />";
} elseif ($check == 0) {
echo "<meta http-equiv='refresh' content='0; url=index.php?site=collect_question&error=missing' />";
} elseif ($check == 3) {
echo " <meta http-equiv='refresh' content='0; url=index.php?site=collect_question&error=blank' />";
}
break;