Topic: News in Multiple Locations?

I am migrating over to CuteNews from FusionNews, now that it is no longer being updated or supported. One of my absolute favorite features from FN is that I could do a PHP Include of the news into multiple sections of the same HTML page (obviously ending in .PHP and not .html).

This was great as I use a php include for my website footer and inside of that like to have a small "latest press" box that contains only the latest article. Then when they navigate to the main press page, they find the rest of the news and articles.


Is this something that I can also do with CuteNews?

Re: News in Multiple Locations?

I suppose to help put into perspective what I'm needing to do... This is what I have set up currently for the main news page.

The code located at the top of the page (above HTML):

<?php

    require_once("core/init.php");

    // Play with settings --------------------------------------------------
    $pw = REQ('pw');

    if ($pw['PHP_SELF']) $PHP_SELF = $pw['PHP_SELF'];
    if ($pw['template']) $template = $pw['template'];

    if ($pw['start_from']) $start_from = $pw['start_from'];
    if ($pw['number']) $number = $pw['number'];
    if ($pw['archive']) $archive = $pw['archive'];
    if ($pw['category']) $category = $pw['category'];
    if ($pw['ucat']) $ucat = $pw['ucat'];
    if ($pw['sortby']) $sortby = $pw['sortby'];
    if ($pw['dir']) $dir = $pw['dir'];
    if ($pw['page_alias']) $page_alias = $pw['page_alias'];
    if ($pw['tag']) $page_alias = $pw['tag'];
    if ($pw['user_by']) $user_by = $pw['user_by'];

    if ($pw['static']) $static = $pw['static'];
    if ($pw['reverse']) $reverse = $pw['reverse'];
    if ($pw['only_active']) $only_active = $pw['only_active'];
    if ($pw['no_prev']) $no_prev = $pw['no_prev'];
    if ($pw['no_next']) $no_next = $pw['no_next'];
    // ---------------------------------------------------------------------

    if ($_GET['do'] == "rss") include("rss.php");
?>

The script located inside of the HEAD:

<script type="text/javascript" src="../pc/js/jqueryslidemenu.js"></script>
<script>
        window.onload=function()
        {
            var edt_comm_mode=document.getElementById('edt_comm_mode');
            if(edt_comm_mode!=null)
            {
                window.scrollTo(0,9999);
            }
        }
</script>

The code located inside the body of the page:

<?php
                
                /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Here we decide what page to include
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
                if ($_GET['search'])
                {
                    include ("search.php");
                }
                elseif ($_GET['do'] == 'archives')
                {
                    include ("show_archives.php");
                }
                elseif ($_GET['do'] == "stats")
                {
                    echo "You can download the stats addon and include it here to show how many news, comments ... you have"; // include("../pc/$path/stats.php");
                }
                else
                {
                    include ("show_news.php");
                }

                ?>


That's the primary news feed. Now at the footer of all pages is an additional include for my footer. Within the footer is the code for the secondary feed. This should only contain the first article (the newest one posted), and will use a different template from CuteNews.

Here is what I have inside of the footer:

<?php

    $number = 1;
    $template = "footer";
    $static = TRUE;
    include("/home/rfcomply/public_html/cutenews/show_news.php");

?>


The problem that I'm running into, is that when I add in the include for the footer. The script suddenly starts to mass duplicate itself. In the end freezing the page. It also shows the same number of articles as the default template (5) instead of the 1 that I set.

The first two bits of code are not included in the footer page. But since this is set as an include for the main news page, will it read the script at the start when the page loads? Or will I have to include the script into the footer page as well??

Does anyone know how I can fix this??

Re: News in Multiple Locations?

... Well I think I just answered my own question.

I placed the first two bits of code into the head of my footer page and tried it out. It now works exactly as it should.

I hope that helps anyone else who might have had the same problem!