Exemple #1
0
</a>&nbsp;&nbsp;<span><?php 
echo date("Y年m月d日 h:m", $ques['created']);
?>
</span>
                     </div>
                 </div>
                 <div class="ency-content">
                     <div class="ans-title">
                         回答<span><?php 
echo getQuesAnsNum($postid);
?>
</span>个
                     </div>
                     
                     <?php 
$answers = getQuesAns($postid);
foreach ($answers as $key => $answer) {
    $html_ans = '<div class=" ans-content"><div class="cust"><b>';
    $html_ans .= getUsername($answer['userid']) . '</b></div><div class="c-time">';
    $html_ans .= date('Y年m月d日 h:m', strtotime($answer['created'])) . '</div><p>';
    $html_ans .= $answer['content'] . '</p>';
    echo $html_ans;
}
?>
                 </div>
                 <script>
                 var b=document.getElementsByTagName('body')[0];
                 b.className=b.className.replace('qa-body-js-off', 'qa-body-js-on');
                 </script>

Exemple #2
0
 } else {
     $htmlcontent .= '<td><input type="radio" name="istop" value="0" checked="checked" />非置顶<br /><input type="radio" name="istop" value="1" />设为置顶';
 }
 // $htmlcontent.= '<td>'.$value['ishot'].'</td>';
 if ($value['ishot']) {
     $htmlcontent .= '<td><input type="radio" name="ishot" value="0" />取消热门<br /><input type="radio" name="ishot" value="1" checked="checked" />为热门贴';
 } else {
     $htmlcontent .= '<td><input type="radio" name="ishot" value="0" checked="checked" />非热门<br /><input type="radio" name="ishot" value="1" />设为热门';
 }
 $htmlcontent .= '<td><input type="submit" value="更改" /><br /><br /><button type="submit" formaction="delete-qa.php">删除</button></td>';
 $htmlcontent .= '<input type="hidden" name="postid" value="' . $value['postid'] . '">';
 $htmlcontent .= '<input type="hidden" name="from" value="console">';
 $htmlcontent .= '<input type="hidden" name="doask" value="1">';
 $htmlcontent .= '</form></tr>';
 //该问题的回答
 $answers = getQuesAns($value['postid']);
 foreach ($answers as $key => $answer) {
     $htmlcontent .= '<tr><form action="create-update.php" method="post">';
     $htmlcontent .= '<td>answer:<a href="/questiondetail/' . $value['postid'] . '.html">' . $answer['postid'] . '</a></td>';
     $htmlcontent .= '<td>这是问题ID为' . $value['postid'] . '的回答</td>';
     $htmlcontent .= '<td>&nbsp' . $value['content'] . '</td>';
     $htmlcontent .= '<td>&nbsp' . $value['created'] . '</td>';
     $htmlcontent .= '<td>&nbsp</td>';
     $htmlcontent .= '<td>&nbsp</td>';
     if ($value['istop']) {
         $htmlcontent .= '<td><input type="radio" name="istop" value="0" />取消置顶<br /><input type="radio" name="istop" value="1" checked="checked" />为置顶贴';
     } else {
         $htmlcontent .= '<td><input type="radio" name="istop" value="0" checked="checked" />非置顶<br /><input type="radio" name="istop" value="1" />设为置顶';
     }
     // $htmlcontent.= '<td>'.$value['ishot'].'</td>';
     if ($value['ishot']) {