Welcome to Geeklog Monday, December 11 2017 @ 10:14 am EST


Status: offline

mst3kroqs

Forum User
Regular Poster
Registered: 18/10/2005
Posts: 78
Location:Cary, NC USA
Finally got around to doing this ...

This block will create a list of links to your currently active feeds as defined in your syndication table. This block is being used on a 1.4.1 site, I can't for the life of me imagine why you'd be running an earlier version at this point.

Note that the feed title is used for the link, and therefore it is necessary to keep them short at the risk of expanding the width of your left/right blocks.

The function also utilizes the feed icon as specified in the syndication table, but if none is specified, expects a default icon as /images/feed.png. If you want to modify this, the edit location is pretty evident.

FYI - nice feed icons can be downloaded from this link.

This code goes in lib-custom.php, and you use it as a phpblock, of course ...

You might also enjoy the AIM presence block that I submitted here, and both of these blocks can be seen in action here.

Enjoy!

PHP Formatted Code

function phpblock_feeds( ){

global $_CONF, $_TABLES;

    $retval = "";

    $result = DB_query("SELECT * FROM {$_TABLES['syndication']} WHERE is_enabled = 1 ORDER BY format, title",1);
    $rows = DB_numRows($result);

    for ($i=0; $i< $rows; $i++) {
        $row = DB_fetchArray($result) ;

        $flogo = $row['feedlogo'];
        if ( $flogo == "" ) {
            $flogo = "/images/feed.png";
        }

        $ftitle = htmlspecialchars( $row['title'] );

        $fdesc = ( $row['description'] );
        if ( $fdesc == "" ) {
            $fdesc = $ftitle;
        }

        $fspec = $_CONF['site_url'] . '/backend/' . $row['filename'];

        $retval .= '
        <img src="'
. $_CONF['site_url'] . $flogo .'" alt="'. $fdesc .'">&nbsp;&nbsp;<a href="'. $fspec .'" type="application/rss+xml" title="Click to Subscribe">'. $ftitle .'</a><br>';

    }
    return $retval;
}
 


Status: offline

Tech_Z

Forum User
Junior
Registered: 14/01/2008
Posts: 30
Location:Soquel, California
curious
This code goes in lib-custom.php, and you use it as a phpblock, of course ...


Of course but I tried using this code in lib_custom and I cannot seem to find the right position re: I get errors.So maybe someone with more experience could help a Noob figure out how to apply this code to the file. Here is my lib_custom. Where to place and how to start and end the script.

Any help would be much appreciated Thanks,
Dennis

Status: offline

mst3kroqs

Forum User
Regular Poster
Registered: 18/10/2005
Posts: 78
Location:Cary, NC USA
Actually, someone asked the same question about my AIM block as well:

Here is my reply.

Status: offline

Tech_Z

Forum User
Junior
Registered: 14/01/2008
Posts: 30
Location:Soquel, California
:banana: Thanks i'm starting to catch on with the code in PHP your post on http://www.geeklog.net/forum/viewtopic.php?showtopic=70150&amp;mode=&amp;show=5&amp;page=2 was quite helpful in learning how custom code works in lib_custom as well as a PHP block configuration.

Thanks, Dennis

Tor

Anonymous
angelic
I had a look at your site http://www.the-howards.net/ and saw your live clock I have the Chameleon theme I had trouble finding the right place to put the onload event.

Status: offline

mst3kroqs

Forum User
Regular Poster
Registered: 18/10/2005
Posts: 78
Location:Cary, NC USA
Quote by: Tor

I had a look at your site http://www.the-howards.net/ and saw your live clock I have the Chameleon theme I had trouble finding the right place to put the onload event.



The instructions are roughly the same as nouveau, but I did add the detail for chameleon in the live clock story here. Note that the article had a typo in it, eg: 'scr=' should be 'src='.

Have fun!


All times are EST. The time is now 10:14 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content