"; echo "
".$locale['XXX_002']."\n"; $result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_lastvisit DESC LIMIT 0,8"); if(dbrows($result)!=0){ while($data=dbarray($result)){ $lastseen=time()-$data['user_lastvisit']; $iW=sprintf("%2d",floor($lastseen/604800)); $iD=sprintf("%2d",floor($lastseen/(60*60*24))); $iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600)); $iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60)); $iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60))); if($lastseen<60){ $lastseen="OnLine"; }elseif($lastseen<360){ $lastseen="OffLine"; }elseif($iW>0){ if($iW==1) $Text="".$locale['XXX_007'].""; elseif($iW==2 || $iW==3 || $iW==4) $Text="".$locale['XXX_011'].""; else $Text="".$locale['XXX_008'].""; $lastseen="$iW $Text"; }elseif($iD>0){ if($iD==1) $Text="".$locale['XXX_009'].""; else $Text="".$locale['XXX_010'].""; $lastseen="$iD $Text"; }else{ $lastseen="$iH:$iM:$iS"; } if (!isset($start)) $start=""; echo "
° ".$locale['XXX_017']." °
".$locale['XXX_003'].": ".$data['user_prefix'].$data['user_name']."
".$locale['XXX_004'].": ".$data['user_location']."
".$locale['XXX_005'].": ".$data['user_msn']."
".$locale['XXX_006'].": ".$data['user_posts']."$end')\" style='color:#".$data['user_color']."' onMouseout=\"hideddrivetip()\">"; echo $data['user_prefix'].$data['user_name']."
".$lastseen."
"; } } echo "
".$locale['XXX_015']."\n"; if (!isset($usr_grps) || !isNum($usr_grps)) $usr_grps=""; $result = dbquery( "SELECT tf.*, tt.*, tu.user_id,user_name,user_color,user_prefix FROM ".$db_prefix."forums tf INNER JOIN ".$db_prefix."threads tt USING(forum_id) INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id ".$usr_grps." ORDER BY thread_lastpost DESC LIMIT 0,8"); if (dbrows($result) != 0) { $i=0; if ($theme_width == "100%") echo "\n"; while ($data = dbarray($result)) { if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl1"; } $new_posts = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."' and post_datestamp>'".(isset($lastvisited) ? $lastvisited : 0)."'"); //$thread_replies = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'") - 1; $thread_replies = $data['thread_replies']; $forum_id = $data['forum_id']; if ($new_posts > 0) { $folder123 = ""; } else if ($new_posts > 19) { $folder123 = ""; } else { if ($data['thread_locked'] == 1) { $folder123 = ""; } else if ($data['thread_locked'] == 0) { $folder123 = ""; } } //$reply_count = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'"); $reply_count = $data['thread_replies']+1; $data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1")); $threads_message = $data['thread_subject']; $threads_message = str_replace("'", "", $threads_message); $rstart = ($reply_count > 20 ? "rowstart=".((ceil($reply_count / 20)-1)*20)."&" : ""); echo "\n"; echo ""; } else { echo "$folder123 ° ".$locale['XXX_017']." °
".$locale['XXX_019']." ".trimlink(str_replace("'", "", $data['thread_subject']), 45)."
".$locale['XXX_020'].": ".($reply_count - 1)."/".$data['thread_views']."
".$locale['XXX_021'].": ".$data['user_prefix'].$data['user_name']."
".$locale['XXX_022'].": ".showdate("forumdate", $data['thread_lastpost'])."$end')\"' onMouseout=\"hideddrivetip()\">".trimlink($data['thread_subject'], 16)."

\n"; echo ""; } echo "
"; if ($theme_width == "100%") { echo "$folder123 ° ".$locale['XXX_017']." °
".$locale['XXX_019'].": ".$threads_message."
".$locale['XXX_020'].": ".($reply_count - 1)."/".$data['thread_views']."
".$locale['XXX_021'].": ".$data['user_prefix'].$data['user_name']."
".$locale['XXX_022'].": ".showdate("forumdate", $data['thread_lastpost'])."$end')\"' onMouseout=\"hideddrivetip()\" >".trimlink($data['thread_subject'], 16)."

[".($reply_count - 1)." / ".$data['thread_views']."][".($reply_count - 1)." / ".$data['thread_views']."]
"; $i++; } } else { echo "
".$locale['004']."
\n"; } echo "
".$locale['022']."\n"; $result = dbquery( "SELECT tf.*, tt.*, tu.user_id,user_name FROM ".$db_prefix."forums tf INNER JOIN ".$db_prefix."threads tt USING(forum_id) INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id ".$usr_grps." ORDER BY thread_views DESC LIMIT 0,8"); if (dbrows($result) != 0) { $i=0; if ($theme_width == "100%") echo "\n"; while ($data = dbarray($result)) { if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl1"; } $new_posts = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."' and post_datestamp>'".(isset($lastvisited) ? $lastvisited : 0)."'"); //$thread_replies = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'") - 1; $thread_replies = $data['thread_replies']; $forum_id = $data['forum_id']; if ($new_posts > 0) { $folder123 = ""; } else if ($new_posts > 19) { $folder123 = ""; } else { if ($data['thread_locked'] == 1) { $folder123 = ""; } else if ($data['thread_locked'] == 0) { $folder123 = ""; } } //$reply_count = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'"); $reply_count = $data['thread_replies']+1; $data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1")); $rstart = ($reply_count > 20 ? "rowstart=".((ceil($reply_count / 20)-1)*20)."&" : ""); echo "\n"; echo ""; } else { echo "$folder123 ° ".$locale['XXX_017']." °
".$locale['XXX_019']." ".trimlink(str_replace("'", "", $data['thread_subject']), 45)."
".$locale['XXX_020'].": ".($reply_count - 1)."/".$data['thread_views']."
".$locale['XXX_021'].": ".$data['user_name']."
".$locale['XXX_022'].": ".showdate("forumdate", $data['thread_lastpost'])."$end')\" (".$data['forum_name'].")' onMouseout=\"hideddrivetip()\">".trimlink($data['thread_subject'], 16)."

\n"; echo ""; } echo "
"; if ($theme_width == "100%") { echo "$folder123 ° ".$locale['XXX_017']." °
".$locale['XXX_019'].": ".trimlink(str_replace("'", "", $data['thread_subject']), 45)."
".$locale['XXX_020'].": ".($reply_count - 1)."/".$data['thread_views']."
".$locale['XXX_021'].": ".$data['user_name']."
".$locale['XXX_022'].": ".showdate("forumdate", $data['thread_lastpost'])."$end')\"' onMouseout=\"hideddrivetip()\" >".trimlink($data['thread_subject'], 16)."

[".$data['thread_views']."][".$data['thread_views']."]
"; $i++; } } else { echo "
".$locale['004']."
\n"; } echo "
"; [color=orange]// phpbb include("forum/config.php"); @mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Nie moglem polaczyc sie z baza danych, sprobuj pozniej "); @mysql_select_db($dbname) or die("Mam problemy z wyborem bazy danych"); $zapytanie = "SELECT mystery_topics.topic_id, mystery_topics.topic_title, mystery_topics.topic_replies, mystery_topics.topic_last_post_id, mystery_posts.poster_id, mystery_posts.post_time, mystery_users.username, mystery_users.user_id FROM mystery_topics, mystery_posts, mystery_users WHERE mystery_topics.forum_id != 7 AND mystery_topics.forum_id != 11 AND mystery_topics.forum_id != 12 AND mystery_posts.post_id = mystery_topics.topic_last_post_id AND mystery_users.user_id = mystery_posts.poster_id ORDER BY mystery_topics.topic_id DESC LIMIT 6"; $wykonanie = mysql_query($zapytanie); print(""); print("\n\n\n"); $i = 3; while($w = mysql_fetch_array($wykonanie)) { // usuwamy uko¶niki $w[1] = stripslashes($w[1]); $w[4] = stripslashes($w[6]); // ucinamy przydługie tematy strlen($w[1]) > 26 ? $topic = substr($w[1], 0, 23) . "..." : $topic = $w[1]; // dobieramy kolor wiersza $i % 2 == 1 ? $r = "" : $r = " bgcolor=\"#530080\""; // ustawiamy format daty $data = date("d-m-Y H:i", $w[5]); // ostatni post if( $w[2] == 0 ) { $ostatni_post = "Brak odpowiedzi"; } else { $ostatni_post = "" . $data . "
" . $w[6] . "
"; } print("\n\n\n\n\n\n\n"); $i++; } print("
Najnowsze tematy: Odpowiedzi:Ostatnia odpowiedź:
". $topic ."" . $w[2] . " \n\n\n\n\n\n
" . $ostatni_post . "
");[/color] closetable(); ?>