1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | | PHP-Quelltext if(!defined('pkFRONTEND') || pkFRONTEND!='public')
die('Direct access to this location is not permitted.');
// Anzahl der Threads die angezeigt werden sollen
define('FORUMINFO_LIMIT',15);
// Thread Finish Status in den Threads angezeigt werden soll. FALSE ist aus und TRUE ist an geht aber nur wer Thread Finish installiert hat.
define('THREADFINISH',TRUE);
// Ab hier nichts mehr ändern !!!
$site_refresh .= '<link href="images/lastthread/lastthread.css" rel="stylesheet" type="text/css" />';
$site_refresh .= '<script type="text/javascript" src="images/lastthread/jquery.toogle.js"></script>';
$foruminfo_threads = FORUMINFO_LIMIT;
pkLoadClass($FORUM,'forum');
$query = $SQL->query("SELECT forumthread_id,forumthread_catid,forumthread_lastreply_time FROM ".pkSQLTAB_FORUM_THREAD."
WHERE forumthread_status IN(1,2) AND forumthread_catid IN(0".implode(',',$FORUM->getCategories()).") AND forumthread_lastreply_time>'".pkGetUservalue('lastlog')."'");
while(list($threadid,$catid,$time)=$SQL->fetch_row($query))
{
$pkFORUMNEWTHREADS[$catid][$threadid] = $time;
}
$query = $SQL->query("SELECT threadid,rtime FROM ".pkSQLTAB_FORUM_THREAD_READED." WHERE sid='".$SQL->f($SESSION->getid())."'");
while(list($threadid,$rtime)=$SQL->fetch_row($query))
{
$pkFORUMREADEDTHREADS[$threadid] = $rtime;
}
$lastthread_row = '';
$getforuminfo=$SQL->query("SELECT forumthread_id,forumthread_catid,forumthread_status,forumthread_replycount,forumthread_viewcount,forumthread_lastreply_time,forumthread_lastreply_autor,forumthread_lastreply_autorid,forumthread_title,forumthread_icon,forumthread_autor,forumthread_autorid,forumthread_finish
FROM ".pkSQLTAB_FORUM_THREAD."
LEFT JOIN ".pkSQLTAB_FORUM_CATEGORY." ON forumcat_id=".pkSQLTAB_FORUM_THREAD.".forumthread_catid
WHERE(".sqlrights(pkSQLTAB_FORUM_CATEGORY.".forumcat_rrights")." OR ".pkSQLTAB_FORUM_CATEGORY.".forumcat_mods LIKE '%-".pkGetUservalue('id')."-%' OR ".pkSQLTAB_FORUM_CATEGORY.".forumcat_user LIKE '%-".pkGetUservalue('id')."-%')
ORDER by ".pkSQLTAB_FORUM_THREAD.".forumthread_lastreply_time
DESC LIMIT ".FORUMINFO_LIMIT."");
while($foruminfo=$SQL->fetch_array($getforuminfo))
{
$getforumcatinfo = $SQL->query("SELECT forumcat_id,forumcat_subcat,forumcat_name,forumcat_replys,forumcat_views,forumcat_posts FROM ".pkSQLTAB_FORUM_CATEGORY." WHERE forumcat_id='".$SQL->i($foruminfo['forumthread_catid'])."'");
$forumcatinfo = $SQL->fetch_array($getforumcatinfo);
$forumcatinfo['result'] = '<a class="small" href="?path=forumscategory&catid='.$forumcatinfo['forumcat_id'].'">'.$forumcatinfo['forumcat_name'].'</a>';
$forumsubcatinfo['result'] = '';
$forumsubcatinfo['forumcat_subcat'] = $forumcatinfo['forumcat_subcat'];
while($forumsubcatinfo['forumcat_subcat'] > 0)
{
$getforumsubcatinfo = $SQL->query("SELECT forumcat_id,forumcat_subcat,forumcat_name FROM ".pkSQLTAB_FORUM_CATEGORY." WHERE forumcat_id=".$SQL->i($forumsubcatinfo['forumcat_subcat'])."");
$forumsubcatinfo=$SQL->fetch_array($getforumsubcatinfo);
$forumsubcatinfo['result'] = '<a class="small" href="?path=forumscategory&catid='.$forumsubcatinfo['forumcat_id'].'">'.$forumsubcatinfo['forumcat_name'].'</a> - '.$forumsubcatinfo['result'];
}
$forumthread_icon = empty($foruminfo['forumthread_icon']) ? '' : ' <img src="images/icons/'.basename($foruminfo['forumthread_icon']).'" alt="Threadstatus Icon" title="Threadstatus Icon" />';
$threadstatus = $foruminfo['forumthread_status']==0 || $foruminfo['forumthread_status']==3 ? 'close' : 'open';
$threadstatus .= ($foruminfo['forumthread_status']==2 || $foruminfo['forumthread_status']==3) ? 'fixed' : '';
$countforumposts = $SQL->fetch_array($SQL->query("SELECT COUNT(forumpost_autorid) FROM ".pkSQLTAB_FORUM_POST." WHERE forumpost_autorid = '".$SQL->f(pkGetUservalue('id'))."' AND forumpost_threadid = '".$SQL->i($foruminfo['forumthread_id'])."'"));
// Eigenpost by PimpYourKiT.de
$mypost = ($countforumposts[0] > 0) ? '<img src="images/lastthread/mypost.png" alt="Du hast in diesem Forenthread selbst schon '.$countforumposts[0].' mal etwas geschrieben." title="Du hast in diesem Forenthread selbst schon '.$countforumposts[0].' mal etwas geschrieben." style="width:18px;height:18px;border-style:none" />' : '';
// Eigenpost by PimpYourKiT.de
// Anhang by PimpYourKiT.de
$attachment = '';
$anhangforumatts = $SQL->fetch_array($SQL->query("SELECT COUNT(forumpost_forumatt_file) FROM ".pkSQLTAB_FORUM_POST." WHERE forumpost_threadid = '".intval($foruminfo['forumthread_id'])."' AND forumpost_forumatt_file != ''"));
$anhangforumatts = $anhangforumatts[0];
if ($anhangforumatts==1)
$attachment = '<img src="images/lastthread/attachment.png" alt="In diesem Forenthread gibt es '.$anhangforumatts.' Anhang." title="In diesem Forenthread gibt es '.$anhangforumatts.' Anhang." style="width:18px;height:18px;border-style:none" />';
elseif ($anhangforumatts>1)
$attachment = '<img src="images/lastthread/attachment.png" alt="In diesem Forenthread gibt es '.$anhangforumatts.' Anhänge." title="In diesem Forenthread gibt es '.$anhangforumatts.' Anhänge." style="width:18px;height:18px;border-style:none" />';
// Anhang by PimpYourKiT.de
// Forumsumfrage by PimpYourKiT.de
$forumumfrage = '';
if ($foruminfo['forumthread_votestatus'] > 0 && $foruminfo['forumthread_votetitle'] != "")
$forumumfrage = '<img src="images/lastthread/poll.png" alt="Umfrage" title="Umfrage" style="width:20px;height:20px;border-style:none" />';
elseif ($foruminfo['forumthread_votestatus'] == 0 && $foruminfo['forumthread_votetitle'] != "")
$forumumfrage = '<img src="images/lastthread/poll_close.png" alt="Umfrage Geschlossen" title="Umfrage Geschlossen" style="width:20px;height:20px;border-style:none" />';
// Forumsumfrage by PimpYourKiT.de
// Bedankomat in der Übersicht
$bedankomat = '';
$ThankInfosLoad=$SQL->fetch_array($SQL->query("SELECT COUNT(thank_revive) FROM ".pkSQLPREFIX."_forumthanks WHERE thank_foruser='".pkgetuservalue('id')."' && thank_threadid='".$foruminfo['forumthread_id']."' LIMIT 1 "));
if ($ThankInfosLoad[0]>0)
$bedankomat = '<a class="small" href="?path=forumsthread&threadid='.$foruminfo['forumthread_id'].'"><img src="images/lastthread/thumb.png" alt="Du hast in diesem Forenthread '.$ThankInfosLoad[0].' Danke Klick(s) erhalten." title="Du hast in diesem Forenthread '.$ThankInfosLoad[0].' Danke Klick(s) erhalten." style="width:18px;height:18px;border-style:none" /></a>';
// Bedankomat in der Übersicht
// Forum Präfix by PimpYourKiT.de
$praefix_name = '';
$getpraefix=$SQL->fetch_array($SQL->query("SELECT forumthread_praefix FROM ".pkSQLTAB_FORUM_THREAD." WHERE forumthread_id = '".$foruminfo['forumthread_id']."'"));
if (!empty($getpraefix['forumthread_praefix']))
{
$showpraefix=$SQL->fetch_array($SQL->query("SELECT * FROM ".pkSQLPREFIX."_forumpraefix WHERE id = '".$SQL->i($getpraefix['forumthread_praefix'])."'"));
$praefix_farbe = stripslashes($showpraefix['color']);
$praefix_name = '<font style="color:#'.$praefix_farbe.';" class="left"><b>['.stripslashes($showpraefix['praefix']).']</b></font><br />';
}
// Forum Präfix by PimpYourKiT.de
// Thread Finish by PimpYourKiT.de
if(THREADFINISH == true)
{
$thread_finish = '';
if($foruminfo['forumthread_finish'] == 2)
$thread_finish = '<img src="images/lastthread/atwork.png" alt="Beitrag ist in Arbeit" title="Beitrag ist in Arbeit" style="width:18px;height:18px;border-style:none" />';
if($foruminfo['forumthread_finish'] == 2)
$thread_finish = '<img src="images/lastthread/finish.png" alt="Beitrag ist Erledigt" title="Beitrag ist Erledigt" style="width:18px;height:18px;border-style:none" />';
}
// Thread Finish by PimpYourKiT.de
$newpostlink = '';
if($FORUM->isUnreadedThread($foruminfo['forumthread_catid'],$foruminfo['forumthread_id'],$foruminfo['forumthread_lastreply_time']))
{
$threadstatus.='new';
$newpostlink = '<img src="images/lastthread/new.png" alt="Threadstatus" title="Threadstatus" style="width:20px;height:9px;border-style:none" />';
}
if($foruminfo['forumthread_replycount']>=$forumcatinfo['forumcat_replys'] || $foruminfo['forumthread_viewcount']>=$forumcatinfo['forumcat_views'])
$threadstatus.='hot';
$getforumpostinfo=$SQL->query("SELECT forumpost_time FROM ".pkSQLTAB_FORUM_POST." WHERE forumpost_threadid='".$SQL->i($foruminfo['forumthread_id'])."' ORDER BY forumpost_id LIMIT 1");
$forumpostinfo=$SQL->fetch_array($getforumpostinfo);
$forumpost_firstpost_time=formattime($forumpostinfo['forumpost_time']);
$gotoseite = 0;
if($foruminfo['forumthread_replycount'] > $forumcatinfo['forumcat_posts'])
{
$threadseite = ' [Seite:';
$count = 0;
$countto = $foruminfo['forumthread_replycount'] / $forumcatinfo['forumcat_posts'];
while($count < $countto)
{
$viewseite = $count + 1;
$gotoseite = $count * $forumcatinfo['forumcat_posts'];
$threadseite .= '<a class="small" href="?path=forumsthread&threadid='.$foruminfo['forumthread_id'].'&entries='.$gotoseite.'">'.$viewseite.'</a>';
$count++;
}
$threadseite .= ']';
}
else
{
$threadseite = '';
}
$getforumpostinfo=$SQL->query("SELECT forumpost_id FROM ".pkSQLTAB_FORUM_POST." WHERE forumpost_threadid='".$SQL->i($foruminfo['forumthread_id'])."' ORDER BY forumpost_id DESC LIMIT 1");
$forumpostinfo=$SQL->fetch_array($getforumpostinfo);
$foruminfo_icon['icon_last_link'] = '<a href="?path=forumsthread&threadid='.$foruminfo['forumthread_id'].'&entries='.$gotoseite.'#post'.$forumpostinfo['forumpost_id'].'"><img src="images/lastthread/newpost.png" alt="Zum letzten Beitrag" title="Zum letzten Beitrag" style="width:18px;height:18px;border-style:none" /></a>';
$foruminfo_lastreply_time = formattime($foruminfo['forumthread_lastreply_time']);
eval ("\$lastthread_row.= \"".pktpl("forum/lastthread_row")."\";");
}
eval ("\$site_body.= \"".pktpl("forum/lastthread")."\";");
?> |