Parašė Progress· 2008 Geg. 4 23:05:06
#1
sveiki gal galite padeti kaip padaryti kad forum_threads_list_panel paneleje rodytu tik 5 temas cia name forum_threads_list_panel:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2007 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
/*---------------------------------------------------+
| Advanced Forum Threads List Panel - (AFTLP)
+----------------------------------------------------+
| Modder: Shedrock / Xandra - Fuzed Themes
| Special Credit: Xandra - Thank you for all your help
| Support: http://phpfusion-themes.com
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
if (file_exists(INFUSIONS."forum_threads_list_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."forum_threads_list_panel/locale/".$settings['locale'].".php";
} else { include INFUSIONS."forum_threads_list_panel/locale/English.php"; }
$min = 10; // minimum visible posts in first level.
$max = 10; // maximum number of posts in second level (hidden).
echo "<script type='text/javascript' language='JavaScript' src='".INFUSIONS."forum_threads_list_panel/ft_boxover.js'></script>";
$imageold = THEME."forum/folder.gif";
$imagenew = THEME."forum/foldernew.gif";
$imagelocked = THEME."forum/folderlock.gif";
$imagehot = THEME."forum/folderhot.gif";
/*******************************************************************
* Start use with the BlueIce Theme for cellpic image
********************************************************************/
if (isset($userdata['user_theme']) && $userdata['user_theme'] != "Default" && file_exists(THEMES.$userdata['user_theme']."/theme.php")) {
$theme = $userdata['user_theme'];
} else { $theme = $settings['theme']; }
$class = $theme == "BlueIce" ? "td" : "tbl2";
/*******************************************************************
* End use with the BlueIce Theme for cellpic image
********************************************************************/
$result = dbquery(
"SELECT tf.*, tt.*, tu.user_id, user_name, MAX(tp.post_id) as last_id,
COUNT(tp.post_id) as count_posts FROM ".$db_prefix."forums tf
INNER JOIN ".$db_prefix."threads tt USING(forum_id)
INNER JOIN ".$db_prefix."posts tp USING(thread_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE ".groupaccess('forum_access')." GROUP BY thread_id
ORDER BY thread_lastpost DESC LIMIT ".($min + $max)
);
if (dbrows($result) != 5) {
$i = 0;
opentable($locale['ftl100']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>
<tr>
<td align='center' class='$class' width='10%' height='24'> </td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl120']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl124']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl123']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl107']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl108']."</b></span></td>
</tr>\n";
while ($data = dbarray($result)) {
if ($i == $min) {
echo "</table><br>
<div align='left'>
<img src='".INFUSIONS."forum_threads_list_panel/images/icon_displaymore.gif' alt=''> <a href=\"javascript:show_hide(display_more_threads)\"><b>".$locale['ftl113']."</b></a>
</div>
<div id='display_more_threads'><br>
<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>
<tr>
<td align='center' class='$class' width='10%' height='24'> </td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl120']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl124']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl123']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl107']."</b></span></td>
<td align='center' class='$class'><span class='small'><b>".$locale['ftl108']."</b></span></td>
</tr>\n";
}
if ($i % 2 == 5) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
$thread_author = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$data['thread_author']."'"));
if (iMEMBER) {
$new_posts = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."' and post_datestamp>'$lastvisited'");
} else { $new_posts = 5; }
$data2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1"));
$post_message = $data2['post_smileys'] == 1 ? parsesmileys($data2['post_message']) : $data2['post_message'];
$post_message = phpentities(nl2br(parseubb($post_message)));
if ($data['thread_locked']) { $folder_image = $imagelocked; }
else {
if ($new_posts > 5){
/*******************************************************************
* Start Threads Marked As Read Mod
********************************************************************
$viewed_result = dbquery("SELECT threads FROM ".$db_prefix."viewed_threads WHERE user_id = '".$userdata['user_id']."'");
if (dbrows($viewed_result) != 0) {
$viewed_data = dbarray($viewed_result);
$viewed_data2 = explode(".", $viewed_data['threads']);
$viewed = array();
for($x = 0; $x < count($viewed_data2); $x ++) {
$viewed_data = explode("-", $viewed_data2[$x]);
$viewed[$viewed_data[0]] = $viewed_data[1];
}
if (!isset($viewed[$data['thread_id']]) || $viewed[$data['thread_id']] < $data['thread_lastpost']) {
$folder_image = $imagenew;
} else { $folder_image = $imageold; }
} else
*******************************************************************
* End Threads Marked As Read Mod
********************************************************************/
$folder_image = $imagenew;
} elseif ($data['count_posts'] > 5) { $folder_image = $imagehot; }
else { $folder_image = $imageold; }
}
echo "<tr>
<td align='center' class='$row_color'><img src='$folder_image' alt=''></td>
<td width='35%' class='$row_color'>
<span class='small'><strong>".$data['forum_name']."</strong></span><br>
<span class='small'><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['last_id']."#post_".$data['last_id']."' title=\"header=[ ".str_replace("]", "]]", str_replace("[", "[[", trimlink($data['thread_subject'], 30)))."] body=[".str_replace("]", "]]", str_replace("[", "[[", trimlink($post_message, 5)))."] delay=[0] fade=[on]\">".trimlink($data['thread_subject'], 30)."</a></span>
</td>
<td align='center' class='$row_color'><a href='".BASEDIR."profile.php?lookup=".$data['thread_author']."'>".$thread_author['user_name']."</a></td>
<td align='center' width='40' class='$row_color'><span class='small'>".$data['thread_views']."</span></td>
<td align='center' width='45' class='$row_color'><span class='small'>".($data['count_posts']-1)."</span></td>
<td align='center' width='25%' class='$row_color'>
<span class='small'>".showdate("forumdate", $data['thread_lastpost'])."</span><br>
<span class='small'><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a></span><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['last_id']."#post_".$data['last_id']."' title='".$locale['ftl125']."'><img src='".INFUSIONS."forum_threads_list_panel/images/icon_minipost_new.gif' alt='' border='0'></a>
</td>
</tr>\n";
$i ++;
}
if ($i > $min) { echo "</table><br><script language='javascript' type='text/javascript'>show_hide(display_more_threads)</script></div>\n"; }
else { echo "</table><br>\n"; }
}
/*******************************************************************
* Start search - added for ease by Shedrock
********************************************************************/
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td align='left' valign='bottom' class='small'>";
if (iMEMBER) {
echo"<img src='".INFUSIONS."forum_threads_list_panel/images/icon_unanswered.gif' alt=''> <a href='".INFUSIONS."forum_threads_list_panel/ua_threads.php'>".$locale['ftl102']."</a><br>
<img src='".INFUSIONS."forum_threads_list_panel/images/icon_allthreads.gif' alt=''> <a href='".INFUSIONS."forum_threads_list_panel/allthreads.php'>".$locale['ftl103']."</a>";
}
echo "</td>
<td align='right' valign='bottom' class='forum'>
<form name='search' method='post' action='".BASEDIR."search.php?stype=f'><span class='small'>".$locale['ftl104']." </span>
<input type='text' name='stext' class='textbox' style='width:150px' size='20'>
<input type='submit' name='search' value='".$locale['ftl105']."' class='button'>
</form>
</td>
</tr>";
/*******************************************************************
* Start Threads Marked As Read Mod
********************************************************************/
/*
$viewed_result = dbquery("SELECT threads FROM ".$db_prefix."viewed_threads WHERE user_id = '".$userdata['user_id']."'");
if (dbrows($viewed_result) != 0) {
$viewed_data = dbarray($viewed_result);
$viewed_data2 = explode(".", $viewed_data['threads']);
$viewed = array();
for($i = 0; $i < count($viewed_data2); $i ++) {
$viewed_data = explode("-", $viewed_data2[$i]);
$viewed[$viewed_data[0]] = $viewed_data[1];
}
if (!isset($viewed[$data['thread_id']]) || $viewed[$data['thread_id']] < $data['thread_lastpost']) {
$folder_image = $imagenew;
} else { $folder_image = $imageold; }
} else
*/
/*******************************************************************
* End Threads Marked As Read Mod
********************************************************************/
/*******************************************************************
* End search
********************************************************************/
if (iMEMBER) {
echo "<tr>
<td style='padding-bottom:0px;' align='center' colspan='5' class='tbl'><hr>
<img src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif' alt='' border='0'> <span class='small'><a href='".INFUSIONS."forum_threads_list_panel/my_threads.php'>".$locale['ftl110']."</a></span>
<img src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif' alt='' border='0'> <span class='small'><a href='".INFUSIONS."forum_threads_list_panel/my_posts.php'>".$locale['ftl111']."</a></span>
<img src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif' alt='' border='0'> <span class='small'><a href='".INFUSIONS."forum_threads_list_panel/newposts.php'>".$locale['ftl112']."</a></span>
</td>
</tr>\n";
}
echo "</table>\n";
closetable();
?>
Aciu is anksto
Redagavo Enzo· 2008 Geg. 5 11:05:54