PDA

View Full Version : Latest Threads Block


DavidLara
09-28-2004, 02:11 PM
ATTN: Administration Elite,

I would like to ask you something about the Latest Threads block. Maybe I have not understood your idea clearly, but for me it seems confusing, some posts are duplicated loosing some space for other posts to be seen. :roll:

Maybe you did it that way in order to make us browse thru the actual forum index and not the latest threads block, if that's the idea it's ok.

But, hey I was used to the old JO Latest Threads block when they had the PHPNuke running.

Ok if my opinion is shared, I modified the code myself, since PHP Nuke 7.2 has a weird Latest Thread Block as well by default (it only shows your topic title, not the latest poster, the number of posts, views etc.)

Ok the following code will show the latest n number of posts, lead by the topic title, latest poster and number of posts so far (just simple, as you can notice anything could be added, but it looks simple IMO).

<code start>
if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $prefix, $db, $sitename;

$result = $db->sql_query("SELECT forum_id, topic_id, topic_title, topic_replies FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10");
$content = "
";
while ($row = $db->sql_fetchrow($result)) {
$forum_id = intval($row['forum_id']);
$topic_id = intval($row['topic_id']);
$result2 = $db->sql_query("SELECT poster_id FROM ".$prefix."_bbposts WHERE (forum_id = '$forum_id' AND topic_id = '$topic_id')");
while ($row3 = $db->sql_fetchrow($result2)) {
$poster_id = intval($row3['poster_id']);}
$result3 = $db->sql_query("SELECT username FROM ".$prefix."_users WHERE user_id = '$poster_id'");
$fetch = mysql_fetch_object($result3);
$nombre = $fetch->username;
$topic_replies = intval($row['topic_replies']);
$topic_title = $row['topic_title'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
$auth_view = intval($row2['auth_view']);
$auth_read = intval($row2['auth_read']);
if (($auth_view < 2) OR ($auth_read < 2))
{
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"><a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;t=$topic_id \">$topic_title</a>
";
$content .= "<font size=\"1\">Replies::</font> $topic_replies
";
$content .= "<font size=\"1\">Last reply by:</font> $nombre
";
}
}

$content .= "
<center><a href=\"modules.php?name=Forums\">$sitename Forums</a>

</center>";
<code end>

Maybe I am wrong because I have not got your idea, but it's just an idea, my 0.2 cents (CHF) 8)

WishingForSpeed
09-28-2004, 02:58 PM
hmm, PHP I might want to learn that one day! I know some html thats it, but im sure I could figure PHP out! 8)

DavidLara
09-28-2004, 03:08 PM
hmm, PHP I might want to learn that one day! I know some html thats it, but im sure I could figure PHP out! 8)

Programming is like speaking computer language, all you have to do is understand the flow and mechanics of programming. Switching from languages is not so complicated.

If you can handle C or Assembler you are done, you will at least understand every other computer language, just need some translation from function to function.

WishingForSpeed
09-28-2004, 03:27 PM
niice! 8)

GoodDayForADrive
09-28-2004, 03:28 PM
Yea, I'm a Computer Science major at Georgia Tech right now, and I find that once you learn something in a language, you can apply it to most others.

WishingForSpeed
09-28-2004, 03:31 PM
Nice what exactly do you learn in that?

GoodDayForADrive
09-28-2004, 03:34 PM
Computer Science? It's all programming. Right now we are programming on Python, some guy named it after Monty Python, but it's a great language, really simple. But as far as what we learn to do... That's kinda more complicated... heh

WishingForSpeed
09-28-2004, 03:41 PM
nice, I was wanting to go to college in the computer area..but im thinking towards a lawyer now. Defense attorny... 8)

DavidLara
09-28-2004, 03:53 PM
Phyton is sick, back to the topic what's your opinion guys about the left Latest Threads Block, maybe I am just retarded and could not understand its arrangement??? :roll:

WishingForSpeed
09-28-2004, 03:59 PM
You are right, I have already addressed this, Mr.Diesel is going to get to it im sure. He is in the process of a server transfer. So he is going to recode a lot of the site! Correct me if i'm wrong Cody! He has a lot to worry about, he will get to it all, in time!

GoodDayForADrive
09-28-2004, 04:03 PM
Diesel is the man, he'll do something :D

Gotturbo
09-28-2004, 04:07 PM
right now he's working on getting a better server.

WishingForSpeed
09-28-2004, 04:11 PM
Yeah, something to that extent!

Mr_Diesel
09-28-2004, 07:54 PM
ATTN: Administration Elite,

I would like to ask you something about the Latest Threads block. Maybe I have not understood your idea clearly, but for me it seems confusing, some posts are duplicated loosing some space for other posts to be seen. :roll:

Maybe you did it that way in order to make us browse thru the actual forum index and not the latest threads block, if that's the idea it's ok.

But, hey I was used to the old JO Latest Threads block when they had the PHPNuke running.

Ok if my opinion is shared, I modified the code myself, since PHP Nuke 7.2 has a weird Latest Thread Block as well by default (it only shows your topic title, not the latest poster, the number of posts, views etc.)

Ok the following code will show the latest n number of posts, lead by the topic title, latest poster and number of posts so far (just simple, as you can notice anything could be added, but it looks simple IMO).

<code start>
if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $prefix, $db, $sitename;

$result = $db->sql_query("SELECT forum_id, topic_id, topic_title, topic_replies FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10");
$content = "
";
while ($row = $db->sql_fetchrow($result)) {
$forum_id = intval($row['forum_id']);
$topic_id = intval($row['topic_id']);
$result2 = $db->sql_query("SELECT poster_id FROM ".$prefix."_bbposts WHERE (forum_id = '$forum_id' AND topic_id = '$topic_id')");
while ($row3 = $db->sql_fetchrow($result2)) {
$poster_id = intval($row3['poster_id']);}
$result3 = $db->sql_query("SELECT username FROM ".$prefix."_users WHERE user_id = '$poster_id'");
$fetch = mysql_fetch_object($result3);
$nombre = $fetch->username;
$topic_replies = intval($row['topic_replies']);
$topic_title = $row['topic_title'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
$auth_view = intval($row2['auth_view']);
$auth_read = intval($row2['auth_read']);
if (($auth_view < 2) OR ($auth_read < 2))
{
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"><a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;t=$topic_id \">$topic_title</a>
";
$content .= "<font size=\"1\">Replies::</font> $topic_replies
";
$content .= "<font size=\"1\">Last reply by:</font> $nombre
";
}
}

$content .= "
<center><a href=\"modules.php?name=Forums\">$sitename Forums</a>

</center>";
<code end>

Maybe I am wrong because I have not got your idea, but it's just an idea, my 0.2 cents (CHF) 8)

Holy crap.... Mabey you should be the one running the backend of this site... Email me, and we can talk business.

DavidLara
09-29-2004, 11:38 AM
Holy crap.... Mabey you should be the one running the backend of this site... Email me, and we can talk business.

I have noticed you have not done the changes, sure I could contribute to make this site greater than actually it is. I'll get across to you.

In the meanwhile you could simply overwrite the file \siteroot\html\blocks\block-Forums.php and test if it works I prepared this file for you: www.lebasi.com.mx/imagery/file.zip (Right click and save as, then simple overwrite).