TinyPortal

Development => Support => Topic started by: sanax on June 03, 2006, 05:12:48 PM

Title: Change the order of posts in Shoutbox?
Post by: sanax on June 03, 2006, 05:12:48 PM
Is it possible to change the posting order in the Shoutbox? I need the oldest message on top and the latest message at the bottom... otherwise you are reading a conversation backwards..

Any suggestions?
Title: Re: Change the order of posts in Shoutbox?
Post by: G6Cad on June 03, 2006, 08:15:14 PM
 :o   Im not following you here.
When some one shout, the last post is on top as the latest one, is that the wrong way ?  ???
Title: Re: Change the order of posts in Shoutbox?
Post by: sanax on June 04, 2006, 02:53:09 AM
Is it possible to change the last shout to the bottom and not the top? lol... yeah, it's the wrong way... you can't follow a conversation that way because the box scrolling from the bottom to the top.

Well, that's the way my users use the shoutbox most of the time... have a quick chat... I know it's prolly not a chatbox but will it possible to change the order?
Title: Re: Change the order of posts in Shoutbox?
Post by: IchBin on June 04, 2006, 05:07:17 AM
Yes but if you do it that way, the latest shout will be on the botton and you will have to scroll down everytime you want to view the latest shout. I'm not sure how to do it, it would involve changing the shoutbox function for TP, and I'm not quite sure how it all works.
Title: Re: Change the order of posts in Shoutbox?
Post by: tiochus on June 06, 2006, 08:39:18 AM
In the file "../sources/TPortal.php" you have to find this
// get x number of shouts
if(isset($using_shoutbox)){
   $limit=$context['TPortal']['shoutbox_limit'];
   if($limit>300) $limit=300;
   $request = db_query("SELECT * FROM {$tp_prefix}variables WHERE type='shoutbox'  ORDER BY value2 DESC LIMIT $limit", __FILE__, __LINE__);

and you have to erase the word DESC in the order, It's a Sql query wich ask for all the shouts ordered by date descending.
I'm not 100% sure, because I have not tested it, so You should better make a backup first.
:coolsmiley:
Title: Re: Change the order of posts in Shoutbox?
Post by: sanax on June 06, 2006, 01:59:48 PM
Thanks.. I'll try it!
Title: Re: Change the order of posts in Shoutbox?
Post by: ZarPrime on August 17, 2006, 11:42:25 AM
Quote from: tiochus on June 06, 2006, 08:39:18 AM
In the file "../sources/TPortal.php" you have to find this
// get x number of shouts
if(isset($using_shoutbox)){
   $limit=$context['TPortal']['shoutbox_limit'];
   if($limit>300) $limit=300;
   $request = db_query("SELECT * FROM {$tp_prefix}variables WHERE type='shoutbox'  ORDER BY value2 DESC LIMIT $limit", __FILE__, __LINE__);

and you have to erase the word DESC in the order, It's a Sql query wich ask for all the shouts ordered by date descending.
I'm not 100% sure, because I have not tested it, so You should better make a backup first.
:coolsmiley:

Hi All,

Tiochus, thanks for this little tidbit.  Sanax, did you ever try this, and did it work?

Now a question for the experts ...
If I want to remove "DESC" in the file TPortal.php, can I just make the change on my local machine and then upload just that file, or do I need to make the change and then zip the entire TP Mod Package and upload and reinstall TP again?

Thankss in advance,
ZarPtiime
Title: Re: Change the order of posts in Shoutbox?
Post by: JPDeni on August 17, 2006, 01:17:40 PM
Just change it and upload the file.
Title: Re: Change the order of posts in Shoutbox?
Post by: juggler on August 23, 2006, 11:41:09 AM
That's all well and good but if I make the change as above and I have it set to show just the last 8 shouts I end up with the Shouts the wrong way round. So although it now scrolls the correct way it shows the first 8 shouts not the last 8. Anyone have an idea how to change that round?
Title: Re: Change the order of posts in Shoutbox?
Post by: knat on September 10, 2006, 08:43:54 AM
I could also use a solution for this..  ::)