Dodatek Forum Thread List Panel dodawany na stronie głównej oferuje w kolumnie Ostatni post ikonkę z odnośnikiem do ostatniego postu w danym temacie.
Czy ktoś może już podjął się zadania dodania takiej ikonki i odnośnika w plikach: index.php i viewforum.php w folderze forum? Nie jest to takie łatwe, przynajmniej dla mnie, bo nie wystarczy skopiować kodu ze wspomnianego panelu, ale trzeba okreslić co ma pobrać z bazy. Dla mnie to trochę za wysoko jeszcze.
Moje próby spełzły więc na niczym.
W pliku forum_thread_list_panel.php za wyświetlanie ikonki odpowiada fragment zaznaczony na zielono:
<?php
/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
//include LOCALE.LOCALESET."forum/main.php";
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";
}
$imageold = THEME."forum/folder.gif";
$imagenew = THEME."forum/foldernew.gif";
$imagelocked = THEME."forum/folderlock.gif";
if (empty($lastvisited)) { $lastvisited = time(); }
//Added for use with the BlueIce Theme for cellpic image
if ($userdata['user_theme'] != "Default" && file_exists(THEMES.$userdata['user_theme']."/theme.php")) {
$theme = $userdata['user_theme'];
} else {
$theme = $settings['theme'];
}
if ($theme == 'BlueIce') {
$class = "td";
} else {
$class = "tbl2";
}
//////////////
if (iADMIN) {
$usr_grps = "WHERE forum_access=0 OR forum_access=101 OR forum_access=102".(iUSER_GROUPS!="" ? " OR forum_access=".str_replace(".", " OR forum_access=", iUSER_GROUPS) : "");
} elseif (iMEMBER) {
$usr_grps = "WHERE forum_access=0 OR forum_access=101".(iUSER_GROUPS!="" ? " OR forum_access=".str_replace(".", " OR forum_access=", iUSER_GROUPS) : "");
} elseif (iGUEST) {
$usr_grps = "WHERE forum_access=0";
}
$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_lastpost DESC LIMIT 0,".$settings['numofthreads']
);
if (dbrows($result) != 0) {
$i=0;
opentable($locale['ftl100']);
echo "<div id='sc1' class='switchcontent'><table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>\n<tr>\n";
echo "<td class='$class' height='24' align='center'> </td>\n";
echo "<td class='$class' ' align='center'><span class='side-small'><b>".$locale['ftl120']."</b></span></td>\n";
echo "<td align='center' class='$class'><span class='side-small'><b>".$locale['ftl124']."</b></span></td>
<td align='center' class='$class'><span class='side-small'><b>".$locale['ftl123']."</b></span></td>
<td align='center' class='$class'><span class='side-small'><b>".$locale['ftl107']."</b></span></td>
<td align='center' class='$class'><span class='side-small'><b>".$locale['ftl108']."</b></span></td>
</tr>\n";
while ($data = dbarray($result)) {
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
$reply_count = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'");
$data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1"));
$thread_author = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$data['thread_author']."'"),0);
$new_posts = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."' and post_datestamp>'$lastvisited'");
$rstart = ($reply_count > 20 ? "rowstart=".((ceil($reply_count / 20)-1)*20)."&" : "");
echo "<tr>\n";
if (".") {
if ($data['thread_locked']) {
echo "<td class='$row_color'><center><img src='$imagelocked'></td>"; }
else {
if ($new_posts > 0){
echo "<td class='$row_color'><center><img src='$imagenew'></td>"; }
else {
echo "<td class='$row_color'><center><img src='$imageold'></td>"; }
}
echo "<td width='35%' class='$row_color'><span class='side-small'><strong>".$data['forum_name']."</strong></span><br>
<span class='side-small'><a href='forum/viewthread.php?".$rstart."forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."#post_".$data2['post_id']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
} else {
echo "<td width='35%' class='$row_color'><span class='side-small'><a href='forum/viewthread.php?".$rstart."forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."#post_".$data2['post_id']."' title='".$data['thread_subject']." (".$data['forum_name'].")'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
}
echo" <td align='center' class='$row_color'><span class='side-small'><a href='".BASEDIR."profile.php?lookup=".$data['thread_author']."'>".$thread_author['user_name']."</a></span><br>";
echo "<td align='center' width='40' class='$row_color'><span class='side-small'>".$data['thread_views']."</span></td>
<td align='center' width='45' class='$row_color'><span class='side-small'>".($reply_count - 1)."</span></td>
<td align='center' width='25%' class='$row_color'><span class='side-small1'>".showdate("forumdate", $data['thread_lastpost'])."</span><br>
<span class='side-small'><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a></span>[color=green]<a href='forum/viewthread.php?".$rstart."forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."#post_".$data2['post_id']."' title='".$locale['ftl125']."'><img border='0' src='".INFUSIONS."forum_threads_list_panel/images/icon_minipost_new.gif'></a>[/color]</td>
</tr>\n";
$i++;
}
echo "</table><br>\n";
// 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'> <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'> <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='textbox' name='stext' class='textbox' style='width:150px' size='20'>
<input type='submit' name='search' value='".$locale['ftl105']."' class='button'>
</form>
</td>";
//
if (iMEMBER) {
echo "<tr>\n<td style='padding-bottom:0px;' align='center' colspan='5' class='tbl'><hr>
<img border='0' src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif'> <span class='small'><a href='".INFUSIONS."forum_threads_list_panel/my_threads.php'>".$locale['ftl110']."</a>
<img border='0' src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif'> <a href='".INFUSIONS."forum_threads_list_panel/my_posts.php'>".$locale['ftl111']."</a>
<img border='0' src='".BASEDIR."infusions/forum_threads_list_panel/images/icon_threads.gif'> <a href='".INFUSIONS."forum_threads_list_panel/newposts.php'>".$locale['ftl112']."</a></span></td>\n</tr>\n";
}
echo "</table>\n";
closetable();
}
unset($usr_grps);
?>
Może ktoś może pochwalić się taką modyfikacją forum? A może, ktoś spróbowałby mi pomóc. Ostatnio intensywnie pomagała mi Shaolin i wlodekp, za co serdeczne dzięki.
Pozdrawiam.
Co możesz zrobić dziś, zrób jutro.
|