Helpful Information
 
 
Category: vBulletin 3.0 Template Modifications
Latest News on FORUMHOME

This is a modification of this (http://www.vbulletintemplates.com/mods/showthread.php?t=1787&highlight=latest) mod for vB3. This is the first time I've ever done this and all the necessary variables are correct, I just left what I didn't need alone. Soo, to all you real hackers, this will seem very infantile but it's a huge step for me :)

I kept looking for it and asking if someone could make it and nobody ever did so I did it myself :) I have mine attached to my welcome panel but that isn't necessary :) I explain how to have it separated in the instructions and how to have it like mine should you have that welcome panel mod :)

Edit the mod description you say VB2 when its VB3

Installed :)

Oh and btw don't need to do step 1 adding phpinclude_start

// begin last news event on forumhome
if (strpos($_SERVER['PHP_SELF'], 'index.php') != false)
{
$newsforumid = 4; // change to the id of your news forum
$result = mysql_query("SELECT threadid,title,postusername,postuserid,replycount
FROM thread
WHERE forumid=$newsforumid
AND visible=1
ORDER BY dateline DESC LIMIT 1");
if (!$result)
{
$lastnews = "Couldn't get last news event";
}
else
{
$s = mysql_fetch_row($result);
$threadid = $s[0];
$title = $s[1];
$postusername = $s[2];
$postuserid = $s[3];
$replycount = $s[4];
$shash = $session[sessionhash];

if ($replycount == 0)
{
$replycount = 'no replies';
}
else if ($replycount == 1)
{
$replycount = 'one reply';
}
else
{
$replycount = "$replycount replies";
}
$lastnews = "Latest news: <a href=\"showthread.php?s=$shash&threadid=$threadid\">$title</a> by <a href=\"member.php?s=$shash&action=getinfo&userid=$postuserid\">$postusername</a> with $replycount.";
}
}
// end last news event on forumhome

Just do stage 2!!!


Will work fine, ive tweaked the text which is shown :)

Sure you need step one because thats what does all the querys etc, bleh

Nice little mod thank you i will be using, one question, why rub out all the parts on your screenshot to hide your forums name etc when theres a link in your profile to your site so people will still see it :p

Actually if you look at the template mentioned in step one you will see that the script is already there to run the script and queries..

Whats the point in loopin the same querie?

See mine, Stage ones missed out..

www.frozentoast.co.uk/index.php

HUH??? Step one on thefile is the phpinclude_start stuff, which is assigning the querys to the variables, Step 2 is the template which outputs everything and displays them.

Bleh,

I just looked in another template i have and it seems that the current template already has that peice of code in for some reason? i don't know why :S because i never entered it :(

Sorry for the confusion :S

<--is totally confused.

Anyhow, glad you're liking it, I was doing cartwheels that I could actually contribute to all the great people that have helped me so much :) I'm glad it's working out for everyone :)

can it just show the latest news of one forum or can I change it to $newsforumid = 1,2,3,4,5,6; so it shows the news from my other forums, too?

Hey Kru - sorry, I haven't worked on my boards in a while so I haven't checked this board. I'm sure you could tweak it to do that, though I haven't a need for it so I haven't done it :) I'm sorry I'm not more helpful!

Worked like a charm. ;) Thanks Ash.

FIXED!










privacy (GDPR)