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


PHP Topic::getTopic方法代码示例

本文整理汇总了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&amp;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);
}
开发者ID:eruedin,项目名称:cats,代码行数:13,代码来源:getTopic.php

示例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;
开发者ID:GuptaAkshay,项目名称:DiscussionSpace,代码行数:31,代码来源:topic.php

示例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"]);
     }
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:topic.php

示例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&amp;error=exists' />";
 } elseif ($check == 0) {
     echo "<meta http-equiv='refresh' content='0; url=index.php?site=collect_question&amp;error=missing' />";
 } elseif ($check == 3) {
     echo " <meta http-equiv='refresh' content='0; url=index.php?site=collect_question&amp;error=blank' />";
 }
 break;
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:collect_question.php


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