Results 1 to 1 of 1

Thread: Love Quotes Of The Day (RSS)

  1. #1
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default Love Quotes Of The Day (RSS)

    Example of using RSS to display different love quotes of the day (v4.1.0)

    Code:
    <?
    /*
    Love Quotes Of The Day
    http://www.modmysite.com
    support@modmysite.com
    
    Instructions
    ------------
    
    1) Install Magpie RSS reader ( http://magpierss.sourceforge.net/ ).
    2) Setup the cache directory as explained in the Magpie instructions.
    3) Save this page as lovequotesoftheday.php
    4) Add these entries to your language file:
    
        // Love Quotes Of The Day
        case "_LQUOTESOFTHEDAY_H": return "Love Quotes Of The Day";
        case "_LQUOTESOFTHEDAY_H1": return "Love Quotes Of The Day";
    
    5) Give it a try.   http://www.yoursite.com/lovequotesoftheday.php
    6) First time, load will be slow, but after that, it will come from the RSS cache
    7) Add a link from someplace on your site to this page, lovequotesoftheday.php
    
    */
    
    require_once( "inc/header.inc.php" );
    require_once( "$dir[inc]db.inc.php" );
    require_once( "$dir[inc]design.inc.php" );
    require_once( "$dir[inc]profiles.inc.php" );
    require_once( "magpierss/rss_fetch.inc" );
    
    // --------------- page variables and login
    
    // No special template needed, uses the default template as 16 does not exist
    $_page[name_index] = 16;
    
    $_page[header] = _t( "_LQUOTESOFTHEDAY_H" );
    $_page[header_text] = _t( "_LQUOTESOFTHEDAY_H1" );
    
    
    // --------------- page components
    
    $_ni = $_page['name_index'];
    $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
    
    // --------------- [END] page components
    
    PageCode();
    
    // --------------- page components functions
    
    /**
     * page code function
     */
    function PageCompPageMainCode()
    {
    	global $content_w;
    	
    	$out = "";
    	$out .= "<table width=".($content_w-20)." cellpadding=4 cellspacing=4><td align=center class=text2>";
    	
    	$url = "http://www.brainyquote.com/link/quotelo.rss";
        $rss = fetch_rss($url);
        	foreach ($rss->items as $item) {
    		$href = $item['link'];
    		$title = $item['title'];
    		$description = $item['description'];
    		$out .=  "<b>$title</b><br>$description<br><br>";
    	}
    	
        $out .= "</td></table>";
        $out .= "Quotes Updated Daily";
    
        return $out;
    }
    ?>
    Attached Images Attached Images
    Last edited by Smoge; 01-08-2006 at 12:50 AM.
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Love it...
    By Smoge in forum Negative Karma
    Replies: 0
    Last Post: 02-09-2008, 08:22 AM
  2. What are quotes for?
    By 1dell in forum General Issues, Comments, Questions
    Replies: 4
    Last Post: 10-01-2007, 07:42 AM
  3. Quotes...
    By BAVARAC in forum Dolphin General Discussion v6.00 and above
    Replies: 4
    Last Post: 09-06-2007, 06:08 AM
  4. Quotes Of The Day (RSS)
    By Smoge in forum Free Mod Exchange
    Replies: 0
    Last Post: 01-08-2006, 12:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •