Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2009, 08:05 PM
HFB HFB is offline
 
Join Date: Mar 2008
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Filter RSS Feed by Thread Tag?

I'm looking for a way to filter vbulletin's RSS feed by thread tag. I know it can be done by forum (i.e. /external.php?type=rss&forumids=2,8,11), but that still leaves a lot of junk. If anyone can help it would be much appreciated. Thanks!
Reply With Quote
  #2  
Old 07-01-2012, 07:48 PM
adbox adbox is offline
 
Join Date: Dec 2010
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking for this too. Cheers

--------------- Added [DATE]1341182211[/DATE] at [TIME]1341182211[/TIME] ---------------

Here's an attempt at a custom solution. It could use some work though.

Add this into a php file in your forum directory and access it by typing the following into your browser:

file.php?tid=thread-id-here

PHP Code:
<?php
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once('./cbparser.php');
require_once('./includes/class_bbcode.php');
require_once('./includes/class_bbcode_alt.php');
header("Content-Type: application/rss+xml; charset=UTF-8");
echo "<?xml version='1.0' encoding='UTF-8'?>";
?>
<rss version="2.0">
    <channel>
        <title>Thread Specific Feed</title>
        <link>http://www.hatnohat.com/</link>
        <description>Marketers &amp; Developers Membership Community</description>
        <language>en-us</language>
        <copyright>Copyright (C) 2012 hatnohat.com</copyright>
<?php

// Convert BBCodes to their HTML equivalent
FUNCTION do_bbcode($text){
     GLOBAL $lang_common, $FORUM_user;
 
     IF (STRPOS($text, 'quote') !== FALSE){
          $text = STR_REPLACE('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
          $text = PREG_REPLACE('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
          $text = PREG_REPLACE('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
     }
 
     $pattern = ARRAY('#\[b\](.*?)\[/b\]#s',
                          '#\[i\](.*?)\[/i\]#s',
                          '#\[u\](.*?)\[/u\]#s',
                          '#\[url\]([^\[]*?)\[/url\]#e',
                          '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
                          '#\[email\]([^\[]*?)\[/email\]#',
                          '#\[email=([^\[]*?)\](.*?)\[/email\]#',
                          '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
 
     $replace = ARRAY('<strong>$1</strong>',
                          '<em>$1</em>',
                          '<span class="bbu">$1</span>',
                          'handle_url_tag(\'$1\')',
                          'handle_url_tag(\'$1\', \'$2\')',
                          '<a href="mailto:$1">$1</a>',
                          '<a href="mailto:$1">$2</a>',
                          '<span style="color: $1">$2</span>');
 
     $text = PREG_REPLACE($pattern, $replace, $text);
 
     RETURN $text;
}
 
 
/////////////////////////////////////
 
     // If the message contains a code tag we have to split it 
        // up (text within [code][/code] shouldn't be touched)
     IF (STRPOS($text, '[code]') !== FALSE && STRPOS($text, '[/code]') !== FALSE){
          LIST($inside, $outside) = split_text($text, '[code]', '[/code]');
          $outside = ARRAY_MAP('ltrim', $outside);
          $text = IMPLODE('<">', $outside);
     }
 

$tid = $_GET['tid'];

if ($tid)
{
    
    $query = "select * from hnh_post WHERE threadid='$tid' ORDER BY dateline DESC";
    $result = mysql_query($query);
    //echo mysql_num_rows($result); exit;
    while ($array = mysql_fetch_array($result))
    {
        //echo 1;
        $pid = $array['postid'];
        $title = $array['title'];
        $author = $array['username'];
        $author_id = $array['userid'];
        $author_link = "http://www.hatnohat.com/forum/member.php?u=2367";
        $thread_link = "http://www.hatnohat.com/forum/showthread.php?threadid=$tid&amp;p=$pid";
        $date =  $array['dateline'];
        $date =  date('D, d M y H:i:s O', strtotime($date));
        $text = bb2html($array['pagetext']);
        $text = strip_tags($text,'<b><i>');
        
        if (!$title)
        {
            $title = $text;
        }
        ?>
            <item>
                <title><?php echo $title ?></title>
                <description><![CDATA[<?php echo $text ?>]]></description>
                <link><?php echo $thread_link; ?></link>
                <pubDate><?php echo $date ?></pubDate>
            </item>
        <?php
    }
}

?>
</channel>
</rss>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:24 AM.


Powered by vBulletin® Version 3.9.0 Beta 2
Copyright ©2000 - 2017, vBulletin Solutions Inc.