
01-10-2003, 04:33 PM
|
 |
|
|
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally posted by TECK
it's fixed now. make sure when you download the file, at the top it says version 1.1, not 1.0.
if it says 1.0, clear your browser temp files.
for those of you who want to have a link the the thread itself, instead of going to the last post do this:
open showthread.php and find:
Code:
if ($goto=="nextnewest") {
replace it with:
Code:
// goto newest thread
if ($goto=="newthread") {
if (isset($forumid) and $forumid!=0) {
$foruminfo=verifyid("forum",$forumid,1,1);
$forumid=$foruminfo['forumid'];
$forumslist = "";
$getchildforums=$DB_site->query("SELECT forumid,parentlist FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',$forumid,')>0");
while ($getchildforum=$DB_site->fetch_array($getchildforums)) {
if ($getchildforum[forumid]==$forumid) {
$parentlist=$getchildforum[parentlist];
}
$forumslist.=",$getchildforum[forumid]";
}
$thread=$DB_site->query_first("SELECT threadid FROM thread WHERE forumid IN (0$forumslist) AND visible=1 AND (sticky=1 OR sticky=0) AND lastpost>='".($foruminfo[lastpost]-30)."' AND open<>10 ORDER BY lastpost DESC LIMIT 1");
header("Location: showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]");
exit;
}
}
if ($goto=="nextnewest") {
your link to the latest thread will become:
Code:
<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]">$forum[lastthread]</a>
scott, let me know if you found the code acceptable on the .txt file. thanks you.
update: i'm gonna look also in postings.php file, it needs to be also modified. for example if you edit a thread title, it wont update the thread... i will look into it and post the mod here...
floren.
|
Floren, will the following code do the same thing or do I need to change it to your code above?
Code:
open showthread.php and above:
if ($goto=="nextnewest") {
$thread = verifyid("thread",$threadid,1,1);
add:
// goto newest thread
if ($goto=="newthread") {
if (isset($forumid) and $forumid!=0) {
$foruminfo=verifyid("forum",$forumid,1,1);
$forumid=$foruminfo['forumid'];
$lastthread=$DB_site->fetch_array($DB_site->query("SELECT threadid FROM post WHERE username='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'"));
header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
exit;
}
}
In the "forumhome_lastpostby" template:
change:
<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lastthread]</a>
to:
<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]" title="Go to first post">$forum[lastthread]</a>
|