SimplePortal

Support => English Support => Topic started by: akshtsaklani7 on September 25, 2014, 08:46:43 AM

Title: Custom Sort in portal
Post by: akshtsaklani7 on September 25, 2014, 08:46:43 AM
Hey,

I have a few boards where on going news is posted. The boards themselves are sorted according to the first post (topic) and irrespective of the replies so that the latest news stays on top. Can such sorting be implemented in the recent topic/post block at the portal? 
Title: Re: Custom Sort in portal
Post by: Chen Zhen on September 25, 2014, 09:50:10 PM

akshtsaklani7,

  It currently lists the topics in descending order. Are you asking to have it display this block in ascending order?
You can simply reverse the array (as opposed to editing the mysql query)

file: ../Sources/PortalBlocks.php

find:
Code: [Select]
else
$items[count($items) - 1]['is_last'] = true;

replace with:

Code: [Select]
else
{
$items = array_reverse($items);
$items[count($items) - 1]['is_last'] = true;
}

You will find that line twice in the file as one is for rss feeds whereas you can replace both conditions with the above edit.

Regards.
Title: Re: Custom Sort in portal
Post by: akshtsaklani7 on September 26, 2014, 07:16:37 AM
I don't want them to be in ascending order. They should be in the descending order only, but they should be according to the date when the topic was started and not according to the date when the topic was last replied. Basically I need a block that looks like a recent post/topic block and sorts like a board news block.

Is there any way by which I could make news board look like recent posts block (Just subject of the topic should appear, not the body)?
Title: Re: Custom Sort in portal
Post by: [SiNaN] on October 11, 2014, 06:29:00 AM
Here's what you are looking for:

http://simpleportal.net/index.php?topic=13031.msg64783#msg64783
SimplePortal 2.3.8 © 2008-2024, SimplePortal