TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 270
  • Total: 270

Change the order of posts in Shoutbox?

Started by sanax, June 03, 2006, 05:12:48 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

sanax

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?

G6Cad

 :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 ?  ???

sanax

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?

IchBin

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.

tiochus

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:

sanax


ZarPrime

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

JPDeni


juggler

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?

knat


This website is proudly hosted on Crocweb Cloud Website Hosting.