Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: display the latest news in the content of any page 'menu_articles.."  (Read 1151 times)

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .

I want to display the latest news in the content of any page under the article
Means that we must use this code

Code: [Select]
<?php menu_articles(); ?>
We have placed over the word "Add Comment" in snews.php file.
To explain more/

in // LANGUAGE VARIABLES.

$l['addcomment'] = '<br><?php menu_articles(); ?></br>  add comment ';


I know what did not work the way ..Because everything what we included among this tag('...') only codes html. not php codes.

Therefore tried . func .Is also to no avail.

So. Is there someone that can help us to solve this problem.. & thanks
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #1 on: October 18, 2010, 07:57:11 PM »

The first step would be to develop a static HTML menu - just for testing - and style it with a division class (defined in the .css file) so it goes looks the way you want it to look in your template Index,php) file. Then you would replace the HTML within the division with the function-tag - <?php menu_articles(0,3); ?>.

It is important to have the numbers in the brackets. This tells the function what to display. The first number - 0 - tells the function to start the menu with the first article available from the articles table. The second number - 3 - tells the function to show only three articles. You can change the second number to any number - 12 for example - and it would display links to 12 articles instead of three.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #2 on: October 19, 2010, 11:38:11 PM »

 ??? ???
« Last Edit: April 15, 2012, 04:33:09 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #3 on: October 20, 2010, 02:44:00 PM »

To do that, you must go to the bottom of function articles().
Search for this function in snews.php with // ARTICLES then scroll to the bottom.
Here is the bottom of the function with the menu_articles(0,3,1); function-tag inserted where it must go.
Code: [Select]
<?php # do not copy this

} else if (_ADMIN) {
echo '<p>'.$edit_link.'</p>';
}
# INSERT menu_articles HERE
menu_articles(0,3,1);
}
}
if (!empty($currentPage) && ($num$article_limit) && $on) {
paginator$currentPage$totalPagesl('paginator'));
}
if (!empty($_POS) && empty($currentPage) && $infoline == true) {
if ($commentable == 'YES') {
comment('unfreezed');
} else if ($commentable == 'FREEZ') {
comment('freezed');
}
}
}
}

# Do not copy this ?>

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #4 on: October 21, 2010, 01:21:25 AM »

 ??? ???
« Last Edit: April 15, 2012, 04:34:06 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #5 on: October 22, 2010, 01:41:07 PM »

up please...
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: display the latest news in the content of any page 'menu_articles.."
« Reply #6 on: October 22, 2010, 03:16:31 PM »

I am confused, but why not:

if ($commentable == 'YES') {
   comment('unfreezed');
   echo '-----some word here----';
   menu_articles(0,10);
}
Logged