Well having figured out my column was wrong.. I still need help so maybe a SQL/PHP guru could help me...
Im attempting to achieve this (but Vbulletin loves to eat my formatting.. so imagine a two column layout under each newswatch)...
--------- Newswatch2----------Date
News title 1 Newstitle 2
content content
link... link
--------- Newswatch1----------Date
News title 1 Newstitle 2
content content
link... link
A two column display of all entries in that watch... (like the inquirer.net/register.co.uk style)...
then it just repeats Newswatch then news. until end...
Here's the query.. and the code to generate the watchs per day.. however many that may be..
$news=$frontend->query("SELECT newspost.newswatch AS watchtwo, newspost.newstitle, newspost.newswatch, newspost.newsintro, newspost.newstimestamp, newspost.newsthreadid, newspost.newspostername, thread.replycount
FROM vbulletin.thread, frontend.newspost
WHERE newspost.newsthreadid = thread.threadid
ORDER BY newspost.newstimestamp DESC, newspost.newswatch DESC");
$watch='';
$finaldate='';
//Lets start the column Decider Var
$columndecider ='1';
while ($results = mysql_fetch_array($news))
{
//Lets sort the VARS to send to the makequicknews function...
$newstitle = $results['newstitle'];
$newsbody = $results['newsintro'];
$newsposter = $results['newspostername'];
$newsreplycount = $results['replycount'];
$date = $results['newstimestamp'];
$leftcolumn ='';
$rightcolumn ='';
//Calculate the the timestamp stuff
epochtotime ($date, &$year, &$month, &$day, &$hour, &$minutes, &$seconds);
//Check which watch we are on
if($results['watchtwo'] != $watch)
{
$title = "Newswatch";
$watchtitle = newssmallgreenbar ($title);
$watch=$results['watchtwo'];
echo $watchtitle;
}
}
That does my watches in date order from newest to oldest.. listing the watches from newest to oldest.. in those days...
Then I have this code that produces the twin columns..
if ($columndecider==1)
{
$leftcolumn .= makequicknews($newstitle, $newsbody, $newsreplycount, $newsposter);
$columndecider='2';
}
else
//and now the right one
{
$rightcolumn .= makequicknews($newstitle, $newsbody, $newsreplycount, $newsposter);
$columndecider='1';
}
//Lets output the columns in a nice neat table
echo "<table width ='100%' cellspacing='5'><tr>
<td valign='top' width='50%'>{$leftcolumn}</td>
<td valign='top' width='50%'>{$rightcolumn}</td>
</tr></table>";
But I can't get those to combine so that under each watch is the twin columns...
Can anyone give me any pointers? 🙂