Ejemplo n.º 1
0
} elseif ($lm == 5) {
    //零回答
    $wheresql .= ' and replies=0 and status=0';
    $orderby .= ' disorder desc, dateline desc';
    $multistr .= "&lm={$lm}";
    $nav .= ' ' . $symbols . ' 零回答问题';
    $all[5] = ' class="thisclass"';
} elseif ($lm == 6) {
    //快到期
    $wheresql .= ' and status=0';
    $orderby .= ' expiredtime asc, dateline desc';
    $multistr .= "&lm={$lm}";
    $nav .= ' ' . $symbols . ' 快到期问题';
    $all[6] = ' class="thisclass"';
} else {
    showmsgs('browser_notexists', 'index.php');
    exit;
}
$navtitle = $navtitle == '' ? $sitename : $navtitle . ' ' . $sitename;
$nav = "<a href=\"{$indexname}\">{$sitename}</a>" . $nav;
$wheresql = trim($wheresql);
if (eregi("^and", $wheresql)) {
    $wheresql = substr($wheresql, 3);
}
$wheresql = 'where ' . trim($wheresql);
if (eregi("^&amp;", $multistr)) {
    $multistr = substr($multistr, 5);
}
$row = $dsql->getone("select count(*) as dd from `#@__ask` {$wheresql}");
$askcount = $row['dd'];
$realpages = @ceil($askcount / $tpp);
Ejemplo n.º 2
0
                         if (strlen($content) > 10000) {
                             showmsgs('post_answer_toolong');
                         }
                         if (strlen($brief) > 200) {
                             showmsgs('post_brief_toolong', '-1');
                         }
                         if ($cfg_ask_ifcheck == 'Y') {
                             $dsql->ExecuteNoneQuery("insert into `#@__askanswer` (askid, ifanswer, tid, tid2, uid, username, anonymous, userip, brief, dateline, content, ifcheck)\r\n\t\t\tvalues('{$askid}', '1', '{$tid}', '{$tid2}', '{$uid}', '{$username}', '{$anonymous}', '{$userip}', '{$brief}', '{$timestamp}', '{$content}', '0')");
                         } else {
                             $dsql->ExecuteNoneQuery("insert into `#@__askanswer` (askid, ifanswer, tid, tid2, uid, username, anonymous, userip, brief, dateline, content)\r\n\t\t\tvalues('{$askid}', '1', '{$tid}', '{$tid2}', '{$uid}', '{$username}', '{$anonymous}', '{$userip}', '{$brief}', '{$timestamp}', '{$content}')");
                         }
                         $dsql->ExecuteNoneQuery("update `#@__ask` set replies=replies+1 where id='{$askid}' ");
                         $cfg_ask_answerscore = intval($cfg_ask_answerscore);
                         $dsql->ExecuteNoneQuery("update `#@__member` set scores=scores+{$cfg_ask_answerscore} where mid='{$uid}' ");
                         //回答者先加分
                         showmsgs('post_answer_succeed', "question.php?id={$askid}");
                     } else {
                         if ($action == 'toend') {
                             $dsql->ExecuteNoneQuery("update `#@__ask` set solvetime='{$timestamp}', status='1' where uid='{$uid}' and id='{$id}' ");
                             @iheader("Expires: 0");
                             @iheader("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE);
                             @iheader("Pragma: no-cache");
                             echo "<script language='javascript'> window.opener.location.reload(); self.close(); </script>";
                             exit;
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
        $question['dbstatus'] = 0;
        $question['status'] = 'qa_ico_3.gif';
    }
    $question['content'] = nl2br(ihtmlspecialchars($question['content']));
    $question['extra'] = nl2br(ihtmlspecialchars($question['extra']));
    $question['toendsec'] = $question['expiredtime'] - $timestamp;
    $question['toendday'] = floor($question['toendsec'] / 86400);
    $question['toendhour'] = floor($question['toendsec'] % 86400 / 3600);
    $question['dateline'] = gmdate('m-d', $question['dateline'] + $timeoffset * 3600);
    $question['solvetime'] = gmdate('Y-m-d h:i', $question['solvetime'] + $timeoffset * 3600);
    $publisher = 0;
    if ($question['uid'] == $uid) {
        $publisher = 1;
    }
} else {
    showmsgs('question_nonexistence', '-1');
}
//等级
$honors = array();
$dsql->setquery("Select id, titles, icon, integral From `#@__scores` order by integral desc");
$dsql->execute();
while ($row = $dsql->getarray()) {
    $honors[] = $row;
}
$question['honor'] = gethonor($question['scores'], $honors);
$nav = '<a href="' . $indexname . '">' . $sitename . '</a> ' . $symbols . ' <a href="browser.php?tid=' . $question['tid'] . '">' . $question['tidname'] . '</a>';
$navtitle = $question['title'];
if ($question['tid2']) {
    $nav .= ' ' . $symbols . ' <a href="browser.php?tid2=' . $question['tid2'] . '">' . $question['tid2name'] . '</a>';
    $navtitle .= ' ' . $question['tid2name'];
}