type=='sybase') {
$limit="";
$q->query($DB, 'set rowcount $ForumDisplay');
}
elseif($DB->type=='postgresql'){
$limit="";
$q->query($DB, 'set QUERY_LIMIT TO 1');
}
else{
$limit=' limit 1';
}
if ($ForumMultiLevel==2){
$SQL = "Select modifystamp from $ForumTableName where thread=$thread $limitApproved $limit";
$q->query($DB,$SQL);
$thms=$q->field('modifystamp', 0);
}
switch($action){
case 2:
$cutoff_thread=$thread-$cutoff;
if ($ForumMultiLevel==2){
$sSQL="Select thread, id from $ForumTableName where modifystamp < $thms $limitApproved order by modifystamp desc $limit";
} else {
$sSQL="Select thread, id from $ForumTableName where thread<$thread and thread>$cutoff_thread and id=thread $limitApproved order by thread desc $limit";
}
break;
case 1:
$cutoff_thread=$thread+$cutoff;
if ($ForumMultiLevel==2){
$sSQL="select thread, id from $ForumTableName where modifystamp>$thms $limitApproved order by modifystamp $limit";
} else {
$sSQL="Select thread, id from $ForumTableName where thread<$cutoff_thread and thread>$thread and id=thread $limitApproved order by thread asc $limit";
}
break;
}
$msg = new query($DB, $sSQL);
if($DB->type=='postgresql'){
$q->query($DB, 'set QUERY_LIMIT TO \'0\'');
}
if($msg->numrows()==0){
Header("Location: $list_page.$ext?f=$num$GetVars");
exit;
}
$tres=$msg->getrow();
Header("Location: $read_page.$ext?f=$num&i=$tres[id]&t=$tres[thread]$GetVars");
exit();
}
$sSQL = "Select * from $ForumTableName where thread=$thread $limitApproved order by id";
$msg_list = new query($DB, $sSQL);
$rec=$msg_list->getrow();
if ( ($rec["userid"] == $phorum_user["id"]) &&
(($author_moderation_phorum == 0)||($f == $author_moderation_phorum)) ) {
$thread_author = $rec["userid"];
} else {
$thread_author = 0;
}
$x=0;
$closed=0;
While(is_array($rec)){
$headers[]=$rec;
if($rec['id']==$id) $loc=$x;
if($rec['thread']==$rec['id']) {
$closed=$rec['closed'];
$closevar=$rec['closed']==1 ? 0 : 1;
$closetxt=$rec['closed']==1 ? $lModOpenThread : $lModCloseThread;
}
if($ForumSecurity!=SEC_NONE && $rec['userid']>0) $ids[]=$rec['userid'];
$rec=$msg_list->getrow();
$x++;
}
// Get the user info. I curse PG for not having Left Joins.
if(@is_array($ids)){
$users=phorum_get_users($ids);
$moderators=phorum_get_modstatus($ids);
}
if ($$phflat) {
$sSQL = "SELECT $ForumTableName.id AS id, $ForumTableName.thread AS thread, body from $ForumTableName, ".$ForumTableName."_bodies WHERE $ForumTableName.approved = 'Y' AND $ForumTableName.thread = ".$thread." AND $ForumTableName.id = ".$ForumTableName."_bodies.id ORDER BY id";
} else {
$sSQL = "Select * from $ForumTableName"."_bodies where id=$id";
}
$msg_body = new query($DB, $sSQL);
$rec=$msg_body->getrow();
While(is_array($rec)){
$bodies[]=$rec;
$rec=$msg_body->getrow();
}
$msg_body->free();
$header_rows=count($headers);
$body_rows=count($bodies);
$next_thread = "f=$num&t=$thread&a=2$GetVars";
$prev_thread = "f=$num&t=$thread&a=1$GetVars";
if(!$$phflat && $header_rows > 0){
if($loc+1==$header_rows){
$next_link = $next_thread;
}
else{
$next_loc = $loc+1;
$next_id = $headers[$next_loc]['id'];
$next_link = "f=$num&i=$next_id&t=$thread$GetVars";
}
if($loc==0){
$prev_link = $prev_thread;
}
else{
$prev_loc = $loc-1;
$prev_id = $headers[$prev_loc]['id'];
$prev_link = "f=$num&i=$prev_id&t=$thread$GetVars";
}
if(!isset($haveread[$id]) && $UseCookies && $id > $old_message){
if(empty($$haveread_cookie)){
$haveread[$$new_cookie] = 1;
$$haveread_cookie=$$new_cookie;
}
if (!isset($haveread[$id])) { // don't append id to cookie if it is already there
$$haveread_cookie.=".$id";
$haveread[$id] = 1;
SetCookie("phorum-haveread-$ForumTableName",$$haveread_cookie,0);
}
}
$max_id=$id;
}
elseif($header_rows > 0) {
$prev_link=$prev_thread;
$next_link=$next_thread;
$lNextMessage=$lNextTopic;
$lPreviousMessage=$lPreviousTopic;
if($UseCookies){
$madechange=false;
@reset($headers);
$row=@current($headers);
while(!empty($row['id'])){
if(!isset($haveread[$row['id']]) && $row['id'] > $old_message){
$madechange=true;
if(empty($$haveread_cookie)){
$haveread[$$new_cookie] = 1;
$$haveread_cookie=$$new_cookie;
}
$$haveread_cookie.='.';
$$haveread_cookie.=$row['id'];
}
$haveread[$row['id']] = 1;
$max_id=$row['id'];
$row=next($headers);
}
if ($madechange) {
SetCookie($haveread_cookie,$$haveread_cookie,0);
}
}
}
if($UseCookies){
if($$new_cookie<$max_id){
$$new_cookie=$max_id;
SetCookie($new_cookie,$$new_cookie,time()+ 31536000);
}
}
if($header_rows > 0) {
$subject = chop($headers[$loc]['subject']);
$rawsub=preg_replace("/<\/*b>/", '', $subject);
$title = "".$rawsub;
} else {
$title = '';
}
include phorum_get_file_name('header');
$toThread = $thread + 1;
//////////////////////////
// START NAVIGATION //
//////////////////////////
$menu=array();
if(!$$phflat){
if(!$closed){
if($ReplyLocation==1){
addnav($menu2, $lReplyMessage, "$post_page.$ext?f=$f&r=$id$GetVars");
} else {
addnav($menu2, $lReplyMessage, "$read_page.$ext?f=$f&i=$id&t=$t$GetVars#REPLY");
}
}
}
if($ActiveForums>1){
// Forum List
addnav($menu1, $lForumList, "$forum_page.$ext?f=$ForumParent$GetVars");
addnav($menu2, $lForumList, "$forum_page.$ext?f=$ForumParent$GetVars");
}
// New Topic
addnav($menu1, $lStartTopic, "$post_page.$ext?f=$num$GetVars");
// Go To Top
addnav($menu1, $lGoToTop, "$list_page.$ext?f=$num$GetVars");
// Go To Topic
if ($ForumMultiLevel==2) {
// Float to Top
addnav($menu1, $lGoToTopic, "$list_page.$ext?f=$num&t=".$headers[0]['modifystamp']."&a=3$GetVars");
} else {
addnav($menu1, $lGoToTopic, "$list_page.$ext?f=$num&t=$toThread&a=3$GetVars");
}
if($$phflat==0){
// Flat View
addnav($menu2, $lReadFlat, "$read_page.$ext?f=$num&i=$id&t=$thread&v=f$GetVars");
} else {
// Threaded View
addnav($menu2, $lReadThreads, "$read_page.$ext?f=$num&i=$id&t=$thread&v=t$GetVars");
}
// Search
addnav($menu1, $lSearch, "$search_page.$ext?f=$num$GetVars");
// Log Out/Log In
if($ForumSecurity){
if(isset($phorum_user['id'])){
addnav($menu2, $lLogOut, "login.$ext?logout=1$GetVars");
addnav($menu2, $lMyProfile, "profile.$ext?f=$f&id=$phorum_user[id]$GetVars");
} else{
addnav($menu1, $lLogIn, "login.$ext?f=$num$GetVars");
}
}
$TopLeftNav=getnav($menu1);
$LowLeftNav=getnav($menu2);
$menu=array();
// Prev Thread
addnav($menu, $lPreviousTopic, "$read_page.$ext?$prev_thread$GetVars");
// Next Thread
addnav($menu, $lNextTopic, "$read_page.$ext?$next_thread$GetVars");
$ThreadNav=getnav($menu);
$menu=array();
// Previous Message
addnav($menu, $lPreviousMessage, "$read_page.$ext?$prev_link$GetVars");
// Next Message
addnav($menu, $lNextMessage, "$read_page.$ext?$next_link$GetVars");
$MessageNav=getnav($menu);
//////////////////////////
// END NAVIGATION //
//////////////////////////
?>
> |
valign="TOP">
width="100%" valign="top"> |
|
0 && isset($users[$head_row['userid']])){
$user=$users[$head_row['userid']];
$author=htmlspecialchars($user['username']);
$email=htmlspecialchars($user['email']);
$author = "$author";
// replace sig
$sig=$user['signature'];
}
else{
$author=htmlspecialchars(chop($head_row['author']));
$email = htmlspecialchars(chop($head_row['email']));
if($email!=''){
$author = "$author";
}
}
$real_host=chop($head_row['host']);
if($ForumShowIP==1 || ($ForumShowIP==2 && $head_row['userid']==0) || !empty($phorum_user['moderator'])){
$host_arr=explode('.', $real_host);
$count=count($host_arr);
if(empty($phorum_user['moderator']) && $count > 1){
if(intval($host_arr[$count-1])!=0){
$host=substr($real_host,0,strrpos($real_host,'.')).'.---';
}
else{
$host = "---".strstr($real_host, '.');
}
}
else{
$host=$real_host;
}
$host="($host)";
}
if($head_row['id']==$i){
$qauthor=strip_tags($author);
$qsubject=strip_tags(chop($head_row['subject']));
$qbody=$body;
}
?>
> |
valign="TOP">
width="100%" valign="top">
:
Подписка на журнал
:
query($DB, $SQL);
while($rec=$q->getrow()){
$filename="$AttachmentDir/$ForumTableName/$rec[id]".strtolower(strrchr($rec['filename'], '.'));
if(file_exists($filename)){
$size=filesize($filename);
if($size<1024) $size=1024;
$size=round($size/1024).'k';
$delim = (function_exists("apache_note")) ? "/" : "?";
if($ShowAttachments){
$attachment_html.=" \n";
} else {
echo "$lFormAttachment: $rec[filename] ($size) \n";
}
}
}
}
echo ' ';
// gong 15-jan-2004
$body=str_replace(PHORUM_SIG_MARKER, " подпись: ".$sig."", $body);
$body=format_body($body);
?>
Подписка на журнал
|
|
>
";?>
|
>
|
0){
?>
>
0)
?>
|
>
|
>
";?>
|
>
|
0){
require "$include_path/form.php";
} elseif($closed) {
echo '';
}
include phorum_get_file_name('footer');
?>