Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 07-20-2001
Last Update: Never
Installs: 0
No support by the author.
Deutsch
Diese Hack zeigt auf der index.php unter dem username der das letzte posting gemacht hat auch den titel des threads auf dem dieser das reply geschrieben hat!
English
This hack showes the thread title in the "Last Post" col.
Information [Version nummer] maybe 1.0 beta [Files to change] index.php and forumhome_lastpostby template
Installation
== in index.php ==
find:
PHP Code:
// prepare template vars
if (!$showforumdescription) {
$forum['description']='';
}
below that add:
PHP Code:
$lastposttitle = $DB_site->query("SELECT title FROM thread WHERE forumid='$forum[forumid]' ORDER BY lastpost DESC");
$lastposttitle = $DB_site->fetch_array($lastposttitle);
$lastposttitle = $lastposttitle[title];
if (strlen($lastposttitle) > 20) {
$lastposttitle = substr($lastposttitle,0,18);
$lastposttitle .= "..";
}
Works well,but....
BUG~
If i have two sub-forum like b and c in main forum.
Use this hack,If I post a new thread in forum b ,but the lastitle in forum home page is remain the title of the newest thread title in main forum
I changed the Code a little bit.
The Thread titles now are only displayed to users who can view the forum the last post is in.
PHP Code:
//start get last thread title from forums
$lastposttitle = $DB_site->query("SELECT title FROM thread WHERE forumid='$forum[forumid]' ORDER BY lastpost DESC");
$lastposttitle = $DB_site->fetch_array($lastposttitle);
$lastposttitle = $lastposttitle[title];
$has_access=getpermissions($forum[forumid]);
if (!$has_access['canview']) {
$lastposttitle='';
}
else
{
if (strlen($lastposttitle) > 20) {
$lastposttitle = substr($lastposttitle,0,18);
$lastposttitle .= "..";
}
}
//end get last thread title from forums
Another thing.
There is a Problem when moving a thread and leave a link in another forum.
So here is another fix:
PHP Code:
//start get last thread title from forums
$lastposttitle = $DB_site->query("SELECT iconid,title FROM thread WHERE forumid='$forum[forumid]' AND open!='10' ORDER BY lastpost DESC");
$lastposttitle = $DB_site->fetch_array($lastposttitle);
$threadicon = $lastposttitle[iconid];
$lastposttitle = $lastposttitle[title];
$has_access=getpermissions($forum[forumid]);
if (!$has_access['canview']) {
$lastposttitle='';
}
else
{
if ($threadicon > 0) {
$icon="<img src=\"images/icons/icon$threadicon.gif\">";
}
else {
$threadicon=1;
$icon="<img src=\"images/icons/icon$threadicon.gif\">";
}
if (strlen($lastposttitle) > 20) {
$lastposttitle = substr($lastposttitle,0,18);
$lastposttitle .= "..";
}
}
//end get last thread title from forums
I also included the Thread icons, so change forumhome_lastpostby template to this: