Page 1 of 1
Articles sorting by Entry Date?
Posted: Thu 27. May 2004, 12:00
by DrubusCulubus
Hi Guys and Galls,
I have tried until I dropped

to sort articles by entrydate and I failed to do so.
What can I do to change the order in the NEWSCATID - replacement tag? I want to sort the articles by entry date and NOT the update - date...
Cheers!
Posted: Thu 27. May 2004, 12:17
by DeXXus
You are probably gonna have to mod the "hack" yourself or maybe someone else has ideas. The OP hasn't posted here for a couple months

Posted: Fri 28. May 2004, 06:54
by DrubusCulubus
Well like I said, 'I've tried everything (I think

)' But since I am a nopenuts

I can't seem to find the right file(s). Well I'll try again and again and again.......
Will let you know if I found the right file(s)...
Cheers!
Posted: Mon 31. May 2004, 10:04
by DrubusCulubus
Finally I found it... For those who are interested in sorting news by entry date open /include/inc_front/front.func.inc.php
and go to the function:
// find all articles
change the last line into:
"ORDER BY article_begin DESC".$limit.";";
and voila all articles will be listed by article date nomather if you chnge something in the article.
Cheers!
Posted: Tue 1. Jun 2004, 20:38
by Igor
Are you sure, this is the ONLY modification? It doesn't work on my site!

Posted: Wed 2. Jun 2004, 13:11
by DrubusCulubus
Yes Igor,
That is only thing that I changed on my files/ However it DOES ONT work on the NEW:X replacement tage. But is DOES work on the NEWCATID replacement tage.
Cheers
Posted: Wed 2. Jun 2004, 23:32
by Igor
Thanks DrubusCulubus,
I didn't know about this tag. I'll try!!
P.S. Mooie site!
Posted: Fri 7. Oct 2005, 01:04
by Jakim José
DrubusCulubus wrote:and go to the function:
// find all
new articles
change the last line into:
Code: Select all
"ORDER BY article_begin DESC".$limit.";";
I have the version 1.2.3
Last line:
Code: Select all
$sql .= "FROM ".DB_PREPEND."phpwcms_article WHERE ".$cat;
or (complete)...
Code: Select all
function get_new_articles($template_default, $max_cnt_links=0, $cat, $dbcon) {
// find all new articles
$cat = intval($cat);
$max_cnt_links = intval($max_cnt_links);
$limit = ($max_cnt_links) ? " LIMIT ".$max_cnt_links : "";
$cat = ($cat) ? 'article_cid='.intval($cat).' AND ' : '';
$sql = "SELECT article_id, article_title, article_cid, UNIX_TIMESTAMP(article_tstamp) AS article_date ";
$sql .= "FROM ".DB_PREPEND."phpwcms_article WHERE ".$cat;
IS THIS THE FINAL RESULT?
Code: Select all
function get_new_articles($template_default, $max_cnt_links=0, $cat, $dbcon) {
// find all new articles
$cat = intval($cat);
$max_cnt_links = intval($max_cnt_links);
$limit = ($max_cnt_links) ? " LIMIT ".$max_cnt_links : "";
$cat = ($cat) ? 'article_cid='.intval($cat).' AND ' : '';
$sql = "SELECT article_id, article_title, article_cid, UNIX_TIMESTAMP(article_tstamp) AS article_date ";
"ORDER BY article_begin DESC".$limit.";";
It is not work!
openning /phpwcms_template/inc_script/frontend_init/noticias_init.php
appear...
Code: Select all
function get_new_articles_from_catid($template_default, $max_cnt_links=0, $cid=0, $dbcon) {
// find all new articles
$max_cnt_links = intval($max_cnt_links);
$limit = ($max_cnt_links) ? " LIMIT ".$max_cnt_links : "";
$sql = "SELECT article_id, article_title, article_cid, UNIX_TIMESTAMP(article_tstamp) AS article_date ".
"FROM ".DB_PREPEND."phpwcms_article WHERE ".
"article_cid='$cid' AND article_public=1 AND article_aktiv=1 AND article_deleted=0 AND ".
"article_begin < NOW() AND article_end > NOW() ".
"ORDER BY article_tstamp DESC".$limit.";";
Is it here?
Code: Select all
function get_new_articles_from_catid($template_default, $max_cnt_links=0, $cid=0, $dbcon) {
// find all new articles
$max_cnt_links = intval($max_cnt_links);
$limit = ($max_cnt_links) ? " LIMIT ".$max_cnt_links : "";
$sql = "SELECT article_id, article_title, article_cid, UNIX_TIMESTAMP(article_tstamp) AS article_date ".
"FROM ".DB_PREPEND."phpwcms_article WHERE ".
"article_cid='$cid' AND article_public=1 AND article_aktiv=1 AND article_deleted=0 AND ".
"article_begin < NOW() AND article_end > NOW() ".
"ORDER BY article_begin DESC".$limit.";";
It is not work!
"x" letters on links
Posted: Sat 3. Dec 2005, 11:34
by Jakim José
How to do to appear only "x" letters in article links?
Example:
Only 30 caracters
The original titles are:
- "Michael Jordan is on fire, but chicago bulls loose".
- "Chicago Bulls loose the championship on the last minute".
The desired result is:
2005/02/23 - Michael Jordan is on fire, but ...
2005/02/24 - Chicago Bulls loose the cham ...