1 (edited by 2014-12-05 19:05:28)

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

2 (edited by 2014-12-08 17:41:33)

Re: 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

Nobody now how list all titles?
I need it to create an dynamic navigation:

Category0--Category1
title0--------title0
title1--------title1
title2--------title2

Re: List all titles

Do you want to display the news titles within categories?

Best regards,
CN Support team

Re: List all titles

Do you want to display the news titles within categories?


Yes, to create the page navigation:  Category -> News title / page_alias

Re: List all titles

Yes, to create the page navigation:  Category -> News title / page_alias


Nobody now how to list the categories / page_alias ?

Re: List all titles

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

Best regards,
CN Support team

7 (edited by 2015-01-28 12:59:02)

Re: List all titles

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?

8 (edited by 2015-01-29 14:53:34)

Re: List all titles

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]
';
Best regards,
CN Support team

Re: List all titles

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

Re: List all titles

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.

Best regards,
CN Support team

Re: List all titles

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]
";

     }
    ?>

Re: List all titles

#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?

Posts: 12

Pages 1

You must login or register to post a reply