Skip to content

Instantly share code, notes, and snippets.

@dbu
Created May 20, 2011 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbu/982774 to your computer and use it in GitHub Desktop.
Save dbu/982774 to your computer and use it in GitHub Desktop.
last news
$de_index = 0;
$lastFrench = null;
foreach ($db->query('SELECT * from fluxcms_blogposts order by post_date desc') as $row) {
...
if ($row['post_lang'] == 'de') {
if ($lastFrench == null) {
$lastFrench = $de_index;
}
$de_index++;
} elseif ($row['post_lang'] == 'fr') {
$lastFrench = null;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment