This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Two questions


avatar
mishima 144
From: -
Two questions

Hello

1.

I would like to order news inside each archived month by making the most recent date at the top rather than it read:

1st January
2nd January

Then the date we are on at the very bottom. It would be better to have it the other way around. How do I do this?

2.

When I click 'contentteller/articles/' link it takes me to the most recent 26 articles. It doesn't show any of the other articles in my database etc.

How would I make it so that on the page it displays the 5 most recent articles and then the articles categories underneath?

Thank you!

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Two questions
avatar
Editor
0
From: -
Hello

1.

I would like to order news inside each archived month by making the most recent date at the top rather than it read:

1st January
2nd January

Then the date we are on at the very bottom. It would be better to have it the other way around. How do I do this?

Open /modules/news/newsarchivemonth.php in an editor and replace:

$query = $database -> dbquery( "SELECT newsstory_id, newsstory_author, newsstory_title, newsstory_seo, newsstory_description, newsstory_link, newsstory_channels, newsstory_status, newsstory_teaser, newsstory_date, newsstory_rating, newsstory_votes, newsstory_comments, newsstory_thread FROM " . DB_PREFIX . "esselbach_ct_newsstories WHERE (newsstory_date LIKE '%" . $archive_year . "-" . $archive_month . "%') AND " . $newsstory_status . " AND (newsstory_website = '0' OR newsstory_website = '" . $preferences[ 'current_website' ] . "')" . $news_expire_sql . " ORDER BY newsstory_date" );


with:

$query = $database -> dbquery( "SELECT newsstory_id, newsstory_author, newsstory_title, newsstory_seo, newsstory_description, newsstory_link, newsstory_channels, newsstory_status, newsstory_teaser, newsstory_date, newsstory_rating, newsstory_votes, newsstory_comments, newsstory_thread FROM " . DB_PREFIX . "esselbach_ct_newsstories WHERE (newsstory_date LIKE '%" . $archive_year . "-" . $archive_month . "%') AND " . $newsstory_status . " AND (newsstory_website = '0' OR newsstory_website = '" . $preferences[ 'current_website' ] . "')" . $news_expire_sql . " ORDER BY newsstory_date DESC" );




2.

When I click 'contentteller/articles/' link it takes me to the most recent 26 articles. It doesn't show any of the other articles in my database etc.

How would I make it so that on the page it displays the 5 most recent articles and then the articles categories underneath?

Thank you!

You can adjust the number of recent articles with the setting "Maximum entries on articles overview page" under Articles Preferences

To add the categories to the page, open the template articles_layout_main in the template editor and add the following PHP part:

$categories = "";

$result = $database -> dbquery( "SELECT articlecat_name, articlecat_seo, articlecat_description FROM " . DB_PREFIX . "esselbach_ct_articlescats WHERE articlecat_parentid = '1'" );
while(list($articlecat_name,$articlecat_seo,$articlecat_description) = $database -> dbrow($result))
{
$categories .= "<a href=\"contentteller/articles_categories/" . $articlecat_seo . "html\">" . $articlecat_name . "</a><br />" . $articlecat_description . "<br /><br />";
}


Then add the following in the HTML part:

<!-- Template: articles_layout_main -->

{$insert['articles_header']}
{$insert['articles_featured']}
{$insert['articles_summary']}
<br /><br />
<h1>Categories</h1>
<div class="content">
{$categories}
</div>

{$insert['articles_footer']}

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.