Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 06-01-2007, 05:30 PM
Coldhands's Avatar
Coldhands Coldhands is offline
 
Join Date: Oct 2005
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Add Avatar, Poster ID & Postbit Info in RSS Feed for new threads

I'm working on getting this to work and wondered if anyone else out there has already tackled this.


I think I've found the code that handles the rss feed, but I'm not sure of the syntax I should use to display the avatars in the xml feed.

Any help would be awesome!

Here's the area that we'll need to add some code to, to make it work:

PHP Code:
case 'RSS':
                    
$xml->add_group('item');
                        
$xml->add_tag('title'unhtmlspecialchars($thread['title']));
                        
$xml->add_tag('link'$vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), falsetrue);
                        
$xml->add_tag('description'"$vbphrase[forum]: " unhtmlspecialchars($vbulletin->forumcache["$thread[forumid]"]['title_clean']) . "\r\n$vbphrase[posted_by]: " unhtmlspecialchars($thread['postusername']) . "\r\n" .
                            
construct_phrase($vbphrase['post_time_x_at_y'], vbdate($vbulletin->options['dateformat'], $thread['dateline']), vbdate($vbulletin->options['timeformat'], $thread['dateline'])));
                    
$xml->close_group('item');
                    break;
                case 
'RSS1':
                    
$xml->add_group('item', array('rdf:about' => $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]"));
                        
$xml->add_tag('title'unhtmlspecialchars($thread['title']));
                        
$xml->add_tag('link'$vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), falsetrue);

                    
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletinfetch_tag_list());
                    
$plainmessage $plaintext_parser->parse($thread['message'], $thread['forumid']);
                    unset(
$plaintext_parser);

                    if (
$vbulletin->GPC['fulldesc'])
                    {
                        
$xml->add_tag('description'$plainmessage);
                    }
                    else
                    {
                        
$xml->add_tag('description'fetch_trimmed_title($plainmessage$vbulletin->options['threadpreview']));
                    }

                    if (!
$vbulletin->GPC['nohtml'])
                    {
                        
$thread['attachments'] =& $attachmentcache["$thread[threadid]"];
                        
$forumperms fetch_permissions($thread['forumid']);
                        
$postbit_factory->thread =& $thread;
                        
$postbit_factory->cache = array();
                        if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['cangetattachment']))
                        {
                            
$vbulletin->options['viewattachedimages'] = 0;
                            
$vbulletin->options['attachthumbs'] = 0;
                        }
                        else
                        {
                            
$vbulletin->options['viewattachedimages'] = $viewattachedimages;
                            
$vbulletin->options['attachthumbs'] = $attachthumbs;
                        }
                        
$postbit_obj =& $postbit_factory->fetch_postbit('external');
                        
$message $postbit_obj->construct_postbit($thread);
                        
$xml->add_tag('content:encoded'$message);
                    }

                        
$xml->add_tag('dc:date'gmdate('Y-m-d\TH:i:s'$thread['dateline']) . 'Z');
                        
$xml->add_tag('dc:creator'unhtmlspecialchars($thread['postusername']));
                        
$xml->add_tag('dc:subject'unhtmlspecialchars($vbulletin->forumcache["$thread[forumid]"]['title_clean']));
                    
$xml->close_group('item');
                    break;
                case 
'RSS2':
                    
$xml->add_group('item');
                        
$xml->add_tag('title'unhtmlspecialchars($thread['title']));
                        
$xml->add_tag('link'$vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), falsetrue);
                        
$xml->add_tag('pubDate'gmdate('D, d M Y H:i:s'$thread['dateline']) . ' GMT');

                    
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletinfetch_tag_list());
                    
$plainmessage $plaintext_parser->parse($thread['message'], $thread['forumid']);
                    unset(
$plaintext_parser);

                    if (
$vbulletin->GPC['fulldesc'])
                    {
                        
$xml->add_tag('description'$plainmessage);
                    }
                    else
                    {
                        
$xml->add_tag('description'fetch_trimmed_title($plainmessage$vbulletin->options['threadpreview']));
                    }

                    if (!
$vbulletin->GPC['nohtml'])
                    {
                        
$thread['attachments'] =& $attachmentcache["$thread[threadid]"];
                        
$forumperms fetch_permissions($thread['forumid']);
                        
$postbit_factory->thread =& $thread;
                        
$postbit_factory->cache = array();
                        if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['cangetattachment']))
                        {
                            
$vbulletin->options['viewattachedimages'] = 0;
                            
$vbulletin->options['attachthumbs'] = 0;
                        }
                        else
                        {
                            
$vbulletin->options['viewattachedimages'] = $viewattachedimages;
                            
$vbulletin->options['attachthumbs'] = $attachthumbs;
                        }
                        
$postbit_obj =& $postbit_factory->fetch_postbit('external');
                        
$message $postbit_obj->construct_postbit($thread);
                        
$xml->add_tag('content:encoded'$message);
                        unset(
$message);
                    }

                    
$xml->add_tag('category'unhtmlspecialchars($vbulletin->forumcache["$thread[forumid]"]['title_clean']), array('domain' => $vbulletin->options['bburl'] . "/forumdisplay.php?f=$thread[forumid]"));
                    
$xml->add_tag('dc:creator'unhtmlspecialchars($thread['postusername']));
                    
$xml->add_tag('guid'$vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]", array('isPermaLink' => 'true'));

                    if (
$vbulletin->options['rsspodcast'] AND $podcastinfo)
                    {
                        
$xml->add_tag('itunes:explicit'$thread['explicit'] == 'yes' 'no');
                        if (
$thread['keywords'])
                        {
                            
$xml->add_tag('itunes:keywords'$thread['keywords']);
                        }
                        if (
$thread['subtitle'])
                        {
                            
$xml->add_tag('itunes:subtitle'$thread['subtitle']);
                        }
                        if (
$thread['author'])
                        {
                            
$xml->add_tag('itunes:author'$thread['author']);
                        }
                        if (
$thread['url'])
                        {
                            switch(
file_extension($thread['url']))
                            {
                                case 
'mp3':
                                    
$type 'audio/mpg';
                                    break;
                                case 
'm4a':
                                    
$type 'audio/x-m4a';
                                    break;
                                case 
'mp4':
                                    
$type 'video/mp4';
                                    break;
                                case 
'm4v':
                                    
$type 'video/x-m4v';
                                    break;
                                case 
'mov':
                                    
$type 'video/quicktime';
                                    break;
                                case 
'pdf':
                                    
$type 'application/pdf';
                                    break;
                                default:
                                    
$type 'unknown/unknown';
                            }

                            
$xml->add_tag('enclosure''', array(
                                
'url'    => $thread['url'],
                                
'length' => $thread['length'],
                                
'type'   => $type
                            
));
                        }
                        else if (
$attachmentcache["$thread[threadid]"])
                        {
                            
$type 'unknown/unknown';
                            
$attach array_shift($attachmentcache["$thread[threadid]"]);
                            
$mimetype unserialize($attach['mimetype']);
                            foreach (
$mimetype AS $header)
                            {
                                if (
preg_match('#Content-type:(.*)$#si'$header$matches))
                                {
                                    
$type trim($matches[1]);
                                    break;
                                }
                            }
                            if ((
strtoupper(substr(PHP_OS03)) == 'WIN' AND stristr($_SERVER['SERVER_SOFTWARE'], 'apache') === false) OR (strpos(SAPI_NAME'cgi') !== false AND @!ini_get('cgi.fix_pathinfo')))
                            {
                                
$filename $vbulletin->options['bburl'] . "/attachment.php?attachmentid=$attach[attachmentid]&dateline=$attach[dateline]&filename=" urlencode($attach['filename']);
                            }
                            else
                            {
                                
$filename $vbulletin->options['bburl'] . "/attachment.php/$attach[attachmentid]/" urlencode($attach['filename']);
                            }
                            
$xml->add_tag('enclosure''', array(
                                
'url'    => $filename,
                                
'length' => $attach['filesize'],
                                
'type'   => $type
                            
));
                        }
                    }

                    
$xml->close_group('item');
                    break;
            }
        }
    } 
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:13 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.07202 seconds
  • Memory Usage 2,294KB
  • Queries Executed 11 (?)
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
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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_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