Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Senior Member/Coder kevin4uguys's Avatar
    Joined
    Mar 2009
    Posts
    219
    Thanks
    Received:0
    Given: 0
    any one found the solution

  2. #12
    Senior Member/Coder kevin4uguys's Avatar
    Joined
    Mar 2009
    Posts
    219
    Thanks
    Received:0
    Given: 0
    any news?????

  3. #13
    Pligg Developer/Coder/Designer ChuckRoast's Avatar
    Joined
    Dec 2005
    Location
    Pliggville USA
    Posts
    9,118
    Thanks
    Received:395
    Given: 73
    Version
    SVN Build
    Site
    http://Pligg.com/chuckroast
    It's an older thread but might prove to be useful.
    http://forums.pligg.com/questions-co...-rss-feed.html
    Help Keep ChuckRoast Home
    Today's Pligg Blog Post


  4. #14
    Casual Pligger Dionysus's Avatar
    Joined
    Jun 2007
    Posts
    73
    Thanks
    Received:0
    Given: 0
    In my RSS.php, I don't have these codes:

    Open your rss.php. Look for these lines (around lines 118-119):

    Code:
    $description = strip_tags($description);
    $description = htmlspecialchars($description);
    comment them out as such:

    Code:
    ## $description = strip_tags($description);
    ## $description = htmlspecialchars($description);

    Here is my RSS.php

    <?php
    // The source code packaged with this file is Free Software, Copyright (C) 2005 by
    // Ricardo Galli <gallir at uib dot es>.
    // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
    // You can get copies of the licenses here:
    // http://www.affero.org/oagpl.html
    // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

    include_once('Smarty.class.php');
    $main_smarty = new Smarty;

    include('config.php');
    include(mnminclude.'link.php');
    include(mnminclude.'html1.php');
    include(mnminclude.'search.php');
    include_once(mnminclude.'smartyvariables.php');

    $rows = isset($_GET['rows']) && is_numeric($_GET['rows']) ? $_GET['rows'] : 20;
    $status = isset($_GET['status']) && sanitize($_GET['status'], 3) != '' ? sanitize($_GET['status'], 3) : 'published';
    $time = isset($_GET['time']) && is_numeric($_GET['time']) ? $_GET['time'] : 0;

    if($time > 0) {
    // Prepare for times
    $sql = "SELECT link_id, count(*) as votes FROM " . table_votes . ", " . table_links . " WHERE ";
    if ($time > 0) {
    $from = time()-$time;
    $sql .= "vote_date > FROM_UNIXTIME($from) AND ";
    }
    $sql .= "vote_link_id=link_id AND (link_status='published' OR link_status='queued') GROUP BY vote_link_id ORDER BY votes DESC LIMIT $rows";

    $last_modified = time();
    $title = $main_smarty->get_config_vars('PLIGG_Visual_RSS_Recent') . ' ' . txt_time_diff($from);
    $link_date = "";

    } else {
    // All the others
    $tmpsearch = new Search;
    $tmpsearch->searchTerm = isset($_GET['search']) && sanitize($_GET['search'], 3) != '' ? sanitize($_GET['search'], 3) : '';
    $search = $tmpsearch->get_search_clause();

    switch ($status) {
    case 'published':
    $order_field = 'link_date';
    $link_date = 'date';
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Published_News");
    break;
    case 'queued':
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Pligg_Queued");
    $order_field = 'link_date';
    $link_date = "date";
    break;
    case 'shared':
    $order_field = 'link_date';
    $link_date = 'date';
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Group_Shared");
    break;
    case 'all':
    $title = "";
    $order_field = 'link_date';
    $link_date = "date";
    break;
    default:
    header("Location: $my_pligg_base/404error.php");
    // $main_smarty->assign('tpl_center', '404error');
    // $main_smarty->display($the_template . '/pligg.tpl');
    die();
    break;
    }

    $from = "FROM " . table_links .
    " LEFT JOIN " . table_groups . " ON group_id=link_group_id ";
    # " LEFT JOIN " . table_categories . " ON category_id=link_category ".
    # " LEFT JOIN " . table_users . " ON link_author=user_id ";
    if($status == 'shared') {
    $from .= " LEFT JOIN " . table_group_shared . " ON share_link_id=link_id ";
    }
    $where = " WHERE (ISNULL(group_privacy) OR group_privacy!='private') ";
    if($status == 'all') {
    $where .= " AND (link_status='published' OR link_status='queued') ";
    } elseif($status == 'shared') {
    $where .= " AND !ISNULL(share_link_id) AND (link_status='published' OR link_status='queued') ";
    } else {
    $where .= " AND link_status='$status' ";
    }
    if(($cat=check_integer('category'))) {
    $where .= " AND link_category IN (SELECT category_ID from ". table_categories ." where category_id=$cat OR category_parent=$cat )";
    $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = $cat AND category_lang='$dblang'");
    $title .= " | " . htmlspecialchars($category_name);
    }

    if(($group=check_integer('group')))
    {
    $group_name = $db->get_var("SELECT group_name FROM " . table_groups . " WHERE group_id = '$group'");
    if ($group_name)
    {
    $title .= " | " . $group_name;
    $where .= " AND link_group_id = '$group' ";
    }
    }

    // This doesn't seem to work -kb
    if($search) {
    $where .= $search;
    $title = htmlspecialchars(sanitize($_GET['search'], 3));
    }

    $order_by = " ORDER BY $order_field DESC ";
    $last_modified = $db->get_var($sql="SELECT UNIX_TIMESTAMP(max($order_field)) $from $where");
    $sql = "SELECT * $from $where $order_by LIMIT $rows";
    }

    do_rss_header($title);
    $link = new Link;
    $links = $db->get_results($sql);
    if ($links) {
    foreach($links as $dblink) {
    $link->id=$dblink->link_id;
    $cached_links[$dblink->link_id] = $dblink;
    $link->read();
    // $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = $link->category AND category_lang='$dblang'");

    $link->link_summary = str_replace("\n", "<br />", $link->link_summary);
    $link->link_summary = str_replace("’", "'", $link->link_summary);
    $link->link_summary = str_replace("–", "-", $link->link_summary);
    $link->link_summary = str_replace("—", "-", $link->link_summary);
    $link->link_summary = str_replace("“", "\"", $link->link_summary);
    $link->link_summary = str_replace("”", "\"", $link->link_summary);

    echo "<item>\n";
    echo "<title><![CDATA[". $link->title . "]]></title>\n";
    echo "<link>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</link>\n";
    echo "<comments>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</comments>\n";
    if (!empty($link_date))
    echo "<pubDate>".date('D, d M Y H:i:s T', $link->$link_date-misc_timezone*3600)."</pubDate>\n";
    else
    echo "<pubDate>".date('D, d M Y H:i:s T', time()-misc_timezone*3600)."</pubDate>\n";
    echo "<dc:creator>" . $dblink->user_login . "</dc:creator>\n";
    echo "<category>" . htmlspecialchars($dblink->category_name) . "</category>\n";
    echo "<guid>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</guid>\n";
    echo "<description><![CDATA[" . $link->link_summary . "<br/><br/>".$link->votes." ".$main_smarty->get_config_vars('PLIGG_Visual_RSS_Votes')." ]]></description>\n";
    echo "</item>\n\n";
    }
    }

    do_rss_footer();

    function do_rss_header($title) {
    global $last_modified, $dblang, $main_smarty;
    header('Content-type: text/xml; charset=utf-8', true);
    echo '<?phpxml version="1.0" encoding="utf-8"?'.'>' . "\n";
    echo '<rss version="2.0" '."\n";
    echo 'xmlns:content="http://purl.org/rss/1.0/modules/content/"'."\n";
    echo 'xmlns:wfw="http://wellformedweb.org/CommentAPI/"'."\n";
    echo 'xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
    echo '>'. "\n";
    echo '<channel>'."\n";
    echo '<title>'.htmlspecialchars($main_smarty->get_config_vars("PLIGG_Visual_Name")).$title.'</title>'."\n";
    echo '<link>'.my_base_url.my_pligg_base.'</link>'."\n";
    echo '<description>'.$main_smarty->get_config_vars("PLIGG_Visual_RSS_Description").' </description>'."\n";
    echo '<pubDate>'.date('D, d M Y H:i:s T', $last_modified-misc_timezone*3600).'</pubDate>'."\n";
    echo '<language>'.$dblang.'</language>'."\n";
    }

    function do_rss_footer() {
    echo "</channel>\n</rss>\n";
    }

    function onlyreadables($string) {
    for ($i=0;$i<strlen($string);$i++) {
    $chr = $string{$i};
    $ord = ord($chr);
    if ($ord<32 or $ord>126) {
    $chr = "~";
    $string{$i} = $chr;
    }
    }
    return str_replace("~", "", $string);
    }
    ?>

  5. #15
    Member wolfheart's Avatar
    Joined
    Dec 2010
    Posts
    38
    Thanks
    Received:0
    Given: 0
    Hi Dionysus,
    were you able to fix this issue and show images in your RSS feed, if yes i would appreciate if you can tell me what did you do to solve this issue.
    Thanks


    Quote Originally Posted by Dionysus View Post
    In my RSS.php, I don't have these codes:

    Open your rss.php. Look for these lines (around lines 118-119):

    Code:
    $description = strip_tags($description);
    $description = htmlspecialchars($description);
    comment them out as such:

    Code:
    ## $description = strip_tags($description);
    ## $description = htmlspecialchars($description);

    Here is my RSS.php

    <?php
    // The source code packaged with this file is Free Software, Copyright (C) 2005 by
    // Ricardo Galli <gallir at uib dot es>.
    // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
    // You can get copies of the licenses here:
    // http://www.affero.org/oagpl.html
    // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

    include_once('Smarty.class.php');
    $main_smarty = new Smarty;

    include('config.php');
    include(mnminclude.'link.php');
    include(mnminclude.'html1.php');
    include(mnminclude.'search.php');
    include_once(mnminclude.'smartyvariables.php');

    $rows = isset($_GET['rows']) && is_numeric($_GET['rows']) ? $_GET['rows'] : 20;
    $status = isset($_GET['status']) && sanitize($_GET['status'], 3) != '' ? sanitize($_GET['status'], 3) : 'published';
    $time = isset($_GET['time']) && is_numeric($_GET['time']) ? $_GET['time'] : 0;

    if($time > 0) {
    // Prepare for times
    $sql = "SELECT link_id, count(*) as votes FROM " . table_votes . ", " . table_links . " WHERE ";
    if ($time > 0) {
    $from = time()-$time;
    $sql .= "vote_date > FROM_UNIXTIME($from) AND ";
    }
    $sql .= "vote_link_id=link_id AND (link_status='published' OR link_status='queued') GROUP BY vote_link_id ORDER BY votes DESC LIMIT $rows";

    $last_modified = time();
    $title = $main_smarty->get_config_vars('PLIGG_Visual_RSS_Recent') . ' ' . txt_time_diff($from);
    $link_date = "";

    } else {
    // All the others
    $tmpsearch = new Search;
    $tmpsearch->searchTerm = isset($_GET['search']) && sanitize($_GET['search'], 3) != '' ? sanitize($_GET['search'], 3) : '';
    $search = $tmpsearch->get_search_clause();

    switch ($status) {
    case 'published':
    $order_field = 'link_date';
    $link_date = 'date';
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Published_News");
    break;
    case 'queued':
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Pligg_Queued");
    $order_field = 'link_date';
    $link_date = "date";
    break;
    case 'shared':
    $order_field = 'link_date';
    $link_date = 'date';
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Group_Shared");
    break;
    case 'all':
    $title = "";
    $order_field = 'link_date';
    $link_date = "date";
    break;
    default:
    header("Location: $my_pligg_base/404error.php");
    // $main_smarty->assign('tpl_center', '404error');
    // $main_smarty->display($the_template . '/pligg.tpl');
    die();
    break;
    }

    $from = "FROM " . table_links .
    " LEFT JOIN " . table_groups . " ON group_id=link_group_id ";
    # " LEFT JOIN " . table_categories . " ON category_id=link_category ".
    # " LEFT JOIN " . table_users . " ON link_author=user_id ";
    if($status == 'shared') {
    $from .= " LEFT JOIN " . table_group_shared . " ON share_link_id=link_id ";
    }
    $where = " WHERE (ISNULL(group_privacy) OR group_privacy!='private') ";
    if($status == 'all') {
    $where .= " AND (link_status='published' OR link_status='queued') ";
    } elseif($status == 'shared') {
    $where .= " AND !ISNULL(share_link_id) AND (link_status='published' OR link_status='queued') ";
    } else {
    $where .= " AND link_status='$status' ";
    }
    if(($cat=check_integer('category'))) {
    $where .= " AND link_category IN (SELECT category_ID from ". table_categories ." where category_id=$cat OR category_parent=$cat )";
    $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = $cat AND category_lang='$dblang'");
    $title .= " | " . htmlspecialchars($category_name);
    }

    if(($group=check_integer('group')))
    {
    $group_name = $db->get_var("SELECT group_name FROM " . table_groups . " WHERE group_id = '$group'");
    if ($group_name)
    {
    $title .= " | " . $group_name;
    $where .= " AND link_group_id = '$group' ";
    }
    }

    // This doesn't seem to work -kb
    if($search) {
    $where .= $search;
    $title = htmlspecialchars(sanitize($_GET['search'], 3));
    }

    $order_by = " ORDER BY $order_field DESC ";
    $last_modified = $db->get_var($sql="SELECT UNIX_TIMESTAMP(max($order_field)) $from $where");
    $sql = "SELECT * $from $where $order_by LIMIT $rows";
    }

    do_rss_header($title);
    $link = new Link;
    $links = $db->get_results($sql);
    if ($links) {
    foreach($links as $dblink) {
    $link->id=$dblink->link_id;
    $cached_links[$dblink->link_id] = $dblink;
    $link->read();
    // $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = $link->category AND category_lang='$dblang'");

    $link->link_summary = str_replace("\n", "<br />", $link->link_summary);
    $link->link_summary = str_replace("’", "'", $link->link_summary);
    $link->link_summary = str_replace("–", "-", $link->link_summary);
    $link->link_summary = str_replace("—", "-", $link->link_summary);
    $link->link_summary = str_replace("“", "\"", $link->link_summary);
    $link->link_summary = str_replace("”", "\"", $link->link_summary);

    echo "<item>\n";
    echo "<title><![CDATA[". $link->title . "]]></title>\n";
    echo "<link>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</link>\n";
    echo "<comments>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</comments>\n";
    if (!empty($link_date))
    echo "<pubDate>".date('D, d M Y H:i:s T', $link->$link_date-misc_timezone*3600)."</pubDate>\n";
    else
    echo "<pubDate>".date('D, d M Y H:i:s T', time()-misc_timezone*3600)."</pubDate>\n";
    echo "<dc:creator>" . $dblink->user_login . "</dc:creator>\n";
    echo "<category>" . htmlspecialchars($dblink->category_name) . "</category>\n";
    echo "<guid>".getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id)."</guid>\n";
    echo "<description><![CDATA[" . $link->link_summary . "<br/><br/>".$link->votes." ".$main_smarty->get_config_vars('PLIGG_Visual_RSS_Votes')." ]]></description>\n";
    echo "</item>\n\n";
    }
    }

    do_rss_footer();

    function do_rss_header($title) {
    global $last_modified, $dblang, $main_smarty;
    header('Content-type: text/xml; charset=utf-8', true);
    echo '<?phpxml version="1.0" encoding="utf-8"?'.'>' . "\n";
    echo '<rss version="2.0" '."\n";
    echo 'xmlns:content="http://purl.org/rss/1.0/modules/content/"'."\n";
    echo 'xmlns:wfw="http://wellformedweb.org/CommentAPI/"'."\n";
    echo 'xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
    echo '>'. "\n";
    echo '<channel>'."\n";
    echo '<title>'.htmlspecialchars($main_smarty->get_config_vars("PLIGG_Visual_Name")).$title.'</title>'."\n";
    echo '<link>'.my_base_url.my_pligg_base.'</link>'."\n";
    echo '<description>'.$main_smarty->get_config_vars("PLIGG_Visual_RSS_Description").' </description>'."\n";
    echo '<pubDate>'.date('D, d M Y H:i:s T', $last_modified-misc_timezone*3600).'</pubDate>'."\n";
    echo '<language>'.$dblang.'</language>'."\n";
    }

    function do_rss_footer() {
    echo "</channel>\n</rss>\n";
    }

    function onlyreadables($string) {
    for ($i=0;$i<strlen($string);$i++) {
    $chr = $string{$i};
    $ord = ord($chr);
    if ($ord<32 or $ord>126) {
    $chr = "~";
    $string{$i} = $chr;
    }
    }
    return str_replace("~", "", $string);
    }
    ?>

  6. #16
    Senior Member foofoo's Avatar
    Joined
    Aug 2010
    Posts
    130
    Thanks
    Received:0
    Given: 0
    So pligg is 6 years old.

    Annybody has this pligg to rss with images working ?

    Just a matter of copy and pasting the code that injects the images in the rss.

    We know now its in the rss.php.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. RSS Import and display images in Frontpage
    By xxx333xxx in forum Questions & Comments
    Replies: 14
    Last Post: 02-23-2013, 03:13 AM
  2. Can't get images to show up on posts
    By razbregrll in forum Questions & Comments
    Replies: 0
    Last Post: 05-17-2008, 07:43 AM
  3. RSS importer - display images and remove <br />
    By engelson in forum Questions & Comments
    Replies: 3
    Last Post: 03-07-2007, 01:05 AM
  4. Display number of posts submitted today
    By gragland in forum Questions & Comments
    Replies: 0
    Last Post: 12-11-2006, 07:34 AM
  5. Get both tags and categories to display under posts.
    By gragland in forum Questions & Comments
    Replies: 2
    Last Post: 07-11-2006, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg