Shoutbox: The last should be first

My Shoutbox shows the oldest posts at the top  and the newest post at the bottom. Anyway to reverse that? I'd like the newest post to be at the top. If it's in the module settings, it's escaping me.

Quote · 7 Feb 2010

It's not.

That would require a code change.

modules\boonex\shoutbox\classes\BxShoutBoxDb.php

function getMessages($iLastId)
{
$sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID`";
return $this -> getAll($sQuery);
}


You can try changing that to this.

function getMessages($iLastId)
{
$sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID` DESC";
return $this -> getAll($sQuery);
}


NOTE: I have not actually tested this.




https://www.deanbassett.com
Quote · 7 Feb 2010

It's not.

That would require a code change.

modules\boonex\shoutbox\classes\BxShoutBoxDb.php

function getMessages($iLastId)
{
$sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID`";
return $this -> getAll($sQuery);
}


You can try changing that to this.

function getMessages($iLastId)
{
$sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID` DESC";
return $this -> getAll($sQuery);
}


NOTE: I have not actually tested this.

Yes thats how its done it puts your last member first without any problems

Well said Deano!

Derrick

Back to pulling my hair out! (ouch, ouch,ouch)
Quote · 7 Feb 2010

Looks like that's got it -- thanks so much.

 

 

Quote · 7 Feb 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.