Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Latest News problems

$
0
0

Hello,

I have to get the latest post from ALL holders and show them on the homepage.
The posts have a checkbox that defines if it will be on the news or not.

Tought it was easy, but I don't know how to get the latest 'unchecked' post from all different holders and show them on the same page.

Home
Holder 1
---Post 01 (checked)
---Post 02
Holder 2
---Post 01
---Post 02
---Post 03 (checked)

the Home page have to show the Post 02 (Holder 1) and Post 02 (holder 2) sorted by date.

Used the following code:

function ultimos() {
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
$SQL_start = (int)$_GET['start'];
$doSet = DataObject::get("Post", "CheckboxValue = 0", "ID DESC", "", "{$SQL_start}" );
   
return $doSet ? $doSet : false;
}

How do i get only the latest one of each holder?


Posted to: Latest News problems | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles