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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2010, 05:33 PM
tribedude tribedude is offline
 
Join Date: Feb 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Is there a way make an RSS feed from a single thread?

Is there a way to make an RSS feed from a single thread on my board? Or is there a mod for 3.8x available to do this? (I have searched to no avail BTW)

I know you can create RSS feeds from an entire board (which seems like the default), but what I really want to do is create a RSS feed from a specific thread on our board (which I hope to feed into a wordpress blog at some point).

Thanks,
Reply With Quote
  #2  
Old 07-01-2012, 08:45 PM
adbox adbox is offline
 
Join Date: Dec 2010
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also am looking for this. Anyone?

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 05:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09843 seconds
  • Memory Usage 2,215KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete