Topic: List all titles
hello,
list all categories:
include("core/init.php");
$categoryes = cn_get_categories();
how can i list all titles of an category?
greetings john
Dear CuteNews Users! Please feel free to contact us via our new Feedback Form and please send information about bugs to our bug tracker.
You are not logged in. Please login or register.
CutePHP Forums → Problem Solving / Help & Support → List all titles
hello,
list all categories:
include("core/init.php");
$categoryes = cn_get_categories();
how can i list all titles of an category?
greetings john
hello,
list all categories:
include("core/init.php"); $categoryes = cn_get_categories();
how can i list all titles of an category?
greetings john
Nobody now how list all titles?
I need it to create an dynamic navigation:
Category0--Category1
title0--------title0
title1--------title1
title2--------title2
Do you want to display the news titles within categories?
Do you want to display the news titles within categories?
Yes, to create the page navigation: Category -> News title / page_alias
Yes, to create the page navigation: Category -> News title / page_alias
Nobody now how to list the categories / page_alias ?
Nobody now how to list the categories / page_alias ?
include ('cutenews/cn/trunk/core/init.php');
$categoryes=cn_get_categories();
foreach($categoryes as $id=>$cat)
{
echo $cat['name'].'<br/>';
print_r(cn_get_news(array('cfilter' => array($id))));
echo '<br/>';
}
You can see more options for filtering news in includes/active_news.php
Hello Support_Team,
To create a navigation i use this code:
<?php
include ('cutenews/core/init.php');
$categoryes=cn_get_categories();
foreach($categoryes as $id=>$cat) {echo " * [url=?cat=$cat[name]]".$cat[name]."[/url]
";
$news = cn_get_news( array( 'cfilter' => array( $id ) ) );
foreach( $news[0] as $nid => $n ) {echo " * [url=https://cutephp.com/forum/index.php?cat=$cat[name]&page=$n[pg]]".$n['pg']."[/url]
";}
}
?>
But the news cant be showed,
maybe the code produces a conflict?What must i change?
Hello Support_Team,
To create a navigation i use this code:
But the news cant be showed,
maybe the code produces a conflict?What must i change?
You have some syntax errors in code.
Use this correct code:
echo ' * [url=https://cutephp.com/forum/index.php?cat=]".$n['pg']."[/url]
';
You have some syntax errors in code.
Use this correct code:echo ' * [url=https://cutephp.com/forum/index.php?cat=]".$n['pg']."[/url] ';
The categories are listed :-)
but a new error message: Cannot find an article with ID: 9
Is there an article with ID 9 in the list of your articles?
For a better understanding of the process of correcting errors in PHP-code, please read about the process of code debugging on the Internet.
Is there an article with ID 9 in the list of your articles?
For a better understanding of the process of correcting errors in PHP-code, please read about the process of code debugging on the Internet.
No i can`t found a news with id=9, there have now other error output.
<?php
include ('cutenews/core/init.php');
$categoryes=cn_get_categories();
foreach($categoryes as $id=>$cat) {
echo " * [url=?category=$cat[name]]".$cat[name]."[/url]
";
}
?>
#Navigation and subnavigation
with this code all categories and titles are listed:
<?php
include ('cutenews/core/init.php');
$categoryes=cn_get_categories();
foreach($categoryes as $id=>$cat) {
echo " * [url=?kategorie=$cat[name]]".$cat[name]."[/url]
";
$news = cn_get_news( array( 'cfilter' => array( $id ) ) );
foreach( $news[0] as $nid => $n ) {
echo " * [url=https://cutephp.com/forum/index.php?kategorie=$cat[name]&seite=$n[pg]]".$n['pg']."[/url]
";
}
}
?>
How create an navigation and subnavigation with nested categories?
CutePHP Forums → Problem Solving / Help & Support → List all titles
Powered by PunBB, supported by Informer Technologies, Inc.
The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.