Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
prekill
Worker
Worker



Joined: Oct 22, 2005
Posts: 201

PostPosted: Sun Mar 06, 2011 3:45 pm Reply with quote

any idea why those RSS files fail?
[ Only registered users can see links on this board! Get registered or login! ]
[ Only registered users can see links on this board! Get registered or login! ]
[ Only registered users can see links on this board! Get registered or login! ]

its show that it has problem with the "?" sing.. but I have no idea why...

Thanks! Razz
 
View user's profile Send private message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Mon Mar 07, 2011 3:22 pm Reply with quote

When you say it fails what do you mean?

When I click on the link it seems to work, apart from it is in a foreign, but it looks like it is working.
 
View user's profile Send private message
prekill







PostPosted: Tue Mar 08, 2011 12:41 pm Reply with quote

[ Only registered users can see links on this board! Get registered or login! ]


here you go.. try to use IE...

Thanks
 
jakec







PostPosted: Tue Mar 08, 2011 4:08 pm Reply with quote

Are you using RavenNuke 2.4?
 
prekill







PostPosted: Wed Mar 09, 2011 2:27 am Reply with quote

I think 2.30

This is the backend_f.php file:

Code:
<?php 


/************************************************************************/
/* RSS Feed for PHP-Nuke phpBB2 Forums                                  */
/* ===================================                                  */
/* This file is created by Truden (www.truden.com)                      */
/* by combyning rdf_nuke.php from Chris with backend_818.php from Truden*/
/* See http://www.karakas-online.de/forum/viewtopic.php?t=899           */
/* for more details.                                                    */
/*                                                                      */
/* Enjoy!                                                               */
/*                                                                      */
/* Truden                                                               */
/*                                                                      */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

include("mainfile.php");
global $prefix, $db, $nukeurl, $sitename;
header ('Expires: ' . gmdate('d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('d M Y H:i:s') . ' GMT');
header ('Content-Type: text/xml; charset=UTF-8');

// Taken from rdf_nuke.php, created by Chris (http://www.karakas-online.de/forum/viewtopic.php?t=899):

$module_name = "Forums";
$nuke_root_path = "modules.php?name=" . $module_name;
$nuke_file_path = $nuke_root_path . "&amp;file=";

define('IN_PHPBB', true);
$phpbb_root_path = './modules/' . $module_name . '/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// include('includes/bbcode.'.$phpEx);

// If not set, set the output count to 10
$count = ( !isset($HTTP_GET_VARS['count']) ) ? 10 : intval($HTTP_GET_VARS['count']);
$count = ( $count == 0 ) ? 10 : $count;

// Characters
$chars = ( isset($HTTP_GET_VARS['chars']) ) ? intval($HTTP_GET_VARS['chars']) : 200;
if($chars<0 || $chars>500) $chars=500; //Maximum
$type = ( isset($HTTP_GET_VARS['type']) ) ? $HTTP_GET_VARS['type'] : 'latest';
$news = ( $type == 'news' );
   
// Create main board url (some code borrowed from functions_post.php)
// viewtopic and index adapted by Chris
$viewtopic = $nuke_file_path . 'viewtopic';

// We don't need these three, but I include them anyway,
// just in case you need them...
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

$viewtopic_url = $nukeurl . '/' . $viewtopic;


$fid = ( isset($HTTP_GET_VARS['fid']) ) ? $HTTP_GET_VARS['fid'] : array();
if(!is_array($fid)) $fid = array($fid);

$fid_new = array();
for($i=0; $i<sizeof($fid); $i++)
{
    if(intval($fid[$i]) > 0)
    {
        if(!in_array($fid[$i], $fid_new))
        {
            $fid_new[] = $fid[$i];
        }
    }
}
$fid = $fid_new;
$sql_where = ( sizeof($fid)>0 ) ? " AND topic_status='0' AND f.forum_id IN (" . implode($fid, ", ") . ")" : " ";

$sql_orderby = $news ? 't.topic_time DESC' : 'p.post_time DESC';
$sql_post_id_field = $news ? 't.topic_first_post_id' : 't.topic_last_post_id';



echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-stylesheet title=\"XSL_formatting\" type=\"text/xsl\" href=\"backend_f.xsl\" ?>\n";
echo "<rss version=\"2.0\" \n";
echo "  xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n";
echo "  xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n";
echo "  xmlns:admin=\"http://webns.net/mvcb/\"\n";
echo "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n\n";
echo "<channel>\n";
echo "<language>he-il</language>\n";
echo "<title>".htmlspecialchars($sitename)."</title>\n";
echo "<link>".htmlspecialchars($nukeurl)."</link>\n";
echo "<description>".$slogan."</description>\n";
echo "<dc:creator>headmin@preflight.us</dc:creator>\n";
echo "<sy:updatePeriod>hourly</sy:updatePeriod>\n";
echo "<sy:updateFrequency>1</sy:updateFrequency>\n";

// Added by Chris:
define('TOPICS_TABLE', $prefix.'_bbtopics');
define('POSTS_TABLE', $prefix.'_bbposts');
define('POSTS_TEXT_TABLE', $prefix.'_bbposts_text');
define('FORUMS_TABLE', $prefix.'_bbforums');
define('AUTH_ALL', 0);
define('POST_TOPIC_URL', 't');
define('POST_POST_URL', 'p');


$sql = "SELECT t.topic_id, t.topic_status, t.topic_title, p.post_id, p.post_time, pt.post_text, pt.bbcode_uid, f.forum_name, f.forum_status, f.auth_read FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . POSTS_TEXT_TABLE . " AS pt, " . FORUMS_TABLE . " AS f WHERE f.forum_id = t.forum_id AND f.auth_read = '0' AND p.topic_id = t.topic_id AND p.post_id = $sql_post_id_field AND pt.post_id = p.post_id AND t.topic_status='0' AND f.forum_status='0' $sql_where ORDER BY $sql_orderby LIMIT $count";

$topics_query = $db->sql_query($sql);

if ( !$topics_query )
{
   
    $topics_query = "";
}
else
{
    $topics = $db->sql_fetchrowset($topics_query);
}

if ( count($topics) == 0 )
{
    $topics = "";
}
else
{
    // $topics contains all interesting data
    for ($i = 0; $i < count($topics); $i++)
    {
        if(isset($HTTP_GET_VARS['titlepattern']))
        {
            $title = $HTTP_GET_VARS['titlepattern'];
            $title = str_replace('__DATE__', gmdate("d.m.Y H:i", $topics[$i]['post_time']), $title);
            $title = str_replace('__TITLE__', $topics[$i]['topic_title'], $title);
            $title = str_replace('__FORUM__', $topics[$i]['forum_name'], $title);
               
           
        }
        else
        {
            $title = $topics[$i]['topic_title'];
        }

        $url = ($news) ? $viewtopic_url . "&amp;" . POST_TOPIC_URL . "=" . $topics[$i]['topic_id'] : $viewtopic_url . "&amp;" . POST_POST_URL . "=" . $topics[$i]['post_id'] . "#" . $topics[$i]['post_id'];
        $message = $topics[$i]['post_text'];
        $bbcode_uid = $topics[$i]['bbcode_uid'];
        $message = preg_replace("/\[.*?:$bbcode_uid:?.*?\]/si", '', $message);
        $message = preg_replace('/\[url=([^\]]*)\]([^[]*)\[\/url\]/si', '<a href="\1">\2</a>', $message);
        $message = preg_replace('/\[url\]|\[\/url\]/si', '', $message);
        $message = str_replace("\n", "\n<br />\n", $message);
//            $message = smilies_pass($message);
//            $message = preg_replace("/$smilies_path/", $smilies_url, $message);
       
        if($chars > 0) {
                $message = ( strlen($message) > $chars ) ? substr($message, 0, ($chars - 4)) . ' ...' : $message;
        }
 
       
    echo "<item>\n";
    echo "<title>".$title."</title>\n";
    echo "<link>".$url."</link>\n";
       echo "<description><![CDATA[$message]]></description>\n";
    echo "<dc:subject>".$title."</dc:subject>\n";
    echo "<pubDate>" . gmdate('d M Y H:i:s', $topics[$i]['post_time']) . " GMT</pubDate>\n";
    echo "<guid>".$url."</guid>\n";
    echo "</item>\n\n";
     }
}
echo "</channel>\n";
echo "</rss>\n";



?>


Theres soemthing better maybe?
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Wed Mar 09, 2011 3:06 am Reply with quote

Then if you are using 2.3 this post should move right away.
 
View user's profile Send private message
jakec







PostPosted: Wed Mar 09, 2011 6:05 am Reply with quote

I believe when 2.4 was released the backend.php was replaced with a better system for providing feeds.

Therefore I would recommend upgrading if possible.
 
jakec







PostPosted: Wed Mar 09, 2011 6:07 am Reply with quote

BTW I've now moved this to RN 2.3 forum.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Mar 12, 2011 8:05 am Reply with quote

I could have sworn that nukeFEED was introduced in either 2.20. or 2.30 (more likely), so why not use that instead? I have not seen this particular backend script before. I'd go with nukeFEED if I were you as it should handle properly UTF-8 as well.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue Mar 15, 2011 7:05 am Reply with quote

I used that script myself for a long time. I used it to put RSS icons with links to individual feeds within each forum description.
Since your sites header response indicates a utf-8 encoding and the feed itself forces utf-8, the only thing I can think of, due to the feed validation indicating a none utf-8 character is to ask what encoding the table is that stores the actual data?
The error seems to indicated that the raw stored data may not be within the utf-8 range.

I know in *SOME* cases you can export table data using latin_1 then re-import the data using utf_general_ci to fix issues like this with Hebrew characters where something has double utf-8 encoded the data causing some characters to go very high-endian and outside of the utf-8 range BUT that isn't something you want to try without copious back-ups of table and data.
I'm no expert in this field so I'm merely just raising the point that the table itself might not have the correct encoding type to deal with the characters.
 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©