• Rss Setup and Integration
  • Integrate News into your site
  • HTMLWIZARDS; msg("wizard", "Choose Wizard", "$wizard_options"); } // ******************************************************************************** // Initiate the News Integration Wizard // ******************************************************************************** if($action == "news"){ //Gather the Templates $templates_list = array(); if(!$handle = opendir("./data")){ /*die("
    Can not open directory $cutepath/data ");*/ } while (false !== ($file = readdir($handle))){ if(eregi(".tpl", $file)){ $file_arr = explode(".", $file); $templates_list[]= $file_arr[0]; } } closedir($handle); $templates_html = ""; //Gather the Categories $cat_lines = file("./data/category.db.php"); if($cat_lines){ $cat_html = "
    "; }else{ $cat_html = "You have no categories"; } echoheader("wizard", "News Integration Wizard"); echo<<
    Welcome to the News Integration Wizard. This tool will help you to integrate the news that you have published using CuteNews, into your existing Webpage.
     
    Quick Customization...

    Number of Active News to Display:

    if the active news are less then the specified number to show, the rest of the news will be fetched from the archives (if any)


    Template to Use When Displaying News:

    $templates_html

    using different templates you can customize the look of your news, comments etc.


    Categories to Show News From:

    $cat_html

    you can specify only from which categories news will be displayed, hold CTRL to select multiple categories (if any)
     

    Advanced Settings...

    Start 'Displaying' From...

    if Set, the displaying of the news will be started from the specified number (eg. if set to 2 - the first 2 news will be skipped and the rest shown)

    Reverse News Order:

     
    if Yes, the order of which the news are shown will be reversed

    Show Only Active News:

    if Yes, even if the number of news you requested to be shown is bigger than all active news, no news from the archives will be shown

    Static Include:

    if Yes, the news will be displayed but will not show the full story and comment pages when requested. useful for multiple includes.
     
     
    WIZARDHTML; echofooter(); } // ******************************************************************************** // Show The News Integration Code // ******************************************************************************** if($action == "news_step2"){ echoheader("wizard", "News Integration"); $the_code = '<?PHP'."\n"; // Try to determine include path $include_path = dirname(dirname(__FILE__)) .'/show_news.php'; if($w_number and $w_number != ''){ $the_code .= '$number='.$w_number.";\n"; } if($w_template != 'Default'){ $the_code .= '$template="'.$w_template."\";\n"; } // Get ready with Categories (if any) if($w_allcategory != 'yes' and isset($w_category) and $w_category != ''){ $i=0; foreach($w_category as $category){ $i++; $my_category .= "$category"; if(count($w_category) != $i){ $my_category .= ','; } } if(count($w_category) > 1){ $the_code .= '$category="'.$my_category."\";\n"; } else{ $the_code .= '$category='.$my_category.";\n"; } } if($w_reverse == 'yes'){ $the_code .= "\$reverse=TRUE;\n"; } if($w_only_active == 'yes'){ $the_code .= "\$only_active=TRUE;\n"; } if($w_static == 'yes'){ $the_code .= "\$static=TRUE;\n"; } if($w_start_from and $w_start_from != ''){ $the_code .= "\$start_from=$w_start_from;\n"; } $the_code .= "include(\"$include_path\");\n?>"; echo"CuteNews determined your full path to show_news.php to be: '$include_path'
    If for some reasons the include path is incorrect or does not work, please determine
    the relative path for including show_news.php yourself or consult your administrator.

    To show your news, insert (copy & paste) the code into some of your pages (*.php) :


    "; echofooter(); } // ******************************************************************************** // Initiate the RSS Wizard // ******************************************************************************** if($action == "rss"){ echoheader("wizard", "RSS Set-Up Wizard"); echo"Rich Site Summary (sometimes referred to as Really Simple Syndication);
    RSS allows a web developer to share the content on his/her site. RSS repackages the web content
    as a list of data items, to which you can subscribe from a directory of RSS publishers.
    RSS 'feeds' can be read with a web browser or special RSS reader called a content aggregator.



    "; echofooter(); } // ******************************************************************************** // Show the RSS config // ******************************************************************************** if($action == "rss_step2"){ include("./data/rss_config.php"); if($rss_language == '' or !$rss_language){ $rss_language = 'en-us'; } if($rss_encoding == '' or !$rss_encoding){ $rss_encoding = 'UTF-8'; } echoheader("wizard", "RSS Configuration"); echo<<
     URL of the page where you include your news
     example: http://mysite.com/news.php
     or: $config_http_script_dir/example2.php
     Title of the RSS feed

     Character Encoding (default: UTF-8)

     Language (default: en-us)


     
    HTML; echofooter(); } // ******************************************************************************** // Save the RSS Configuration // ******************************************************************************** if($action == "dosaverss"){ if(!eregi("http://", "$rss_news_include_url")){ msg("error","Error", "The URL where you include your news must start with http:// "); } $handler = fopen("./data/rss_config.php", "w") or msg("error", "Error", "Can not open file ./data/rss_config.php"); fwrite($handler, ""); fclose($handler); msg("wizard", "RSS Configuration Saved", "The configurations were saved successfuly.

    "); } // ******************************************************************************** // Save the RSS Configuration // ******************************************************************************** if($action == "customizerss"){ echoheader("wizard", "RSS Customization"); // // Detect the categories (if any) // $cat_lines = file("./data/category.db.php"); if(count($cat_lines) > 0){ $cat_options .= "
    "; }else{ $cat_options = "You do not have any categories. "; } // // Show the HTML // echo<< function generateCode(){ sbox = document.getElementById('categories'); var categoryString = ''; var firstDone = 0; for (var i=0; i\\n\\n'; document.getElementById('result').value = htmlcode; }
    After You have configured your RSS options, the RSS feed is ready to be used.

    URL Address of your RSS: $config_http_script_dir/rss.php
     
     Customizing your RSS feed:
     
     Number of articles to be shown in the RSS (default:10):
     Show articles only from these categories: $cat_options
    After you have selected your preferred settings, click the 'Generate HTML Code' button and you are ready to insert this code into your page. The generated code will be of a linked RSS image that will be pointing to your RSS feed (rss.php).



     
    HTMLECHO; echofooter(); } ?>