Back to vBulletin 3.0 Add-Ons

Chooseable External Output
Mod Version: 1.00, by Slynderdale

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 2
Released: 28 Aug 2004 Last Update: Never Downloads: 0
Not Supported  

If you have External data enabled in the options, you can have xml and rss feeds for your forums. By default, the ost previews strip all bbcodes and only show portions of the text. This hack lets you choose how you want the output to be like.

The bbcode, smiles, and html output depends on the forum settings of that post.

The choices are:
Default: Short preview with no BBcodes.
1: Full text with no bbcodes
2: Full text with bbcodes

These can be selected via the browser query string.
Example:
http://www.yourforum.com/external.php?type=RSS2&format=2

In forum/root/external.php find:
PHP Code:
  $permissions cache_permissions($bbuserinfo); 
under it add:
PHP Code:
  $format iif($_GET['format'],intval($_GET['format']),0); 
then find:
PHP Code:
 echo "\t\t<content:encoded><![CDATA["htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], falsetrue), $vboptions['thread'])) ."]]></content:encoded.\r\n"
and replace it with:
PHP Code:
          if (function_exists('format_external_text'))
          {
          
$thread['preview'] = format_external_text($thread['preview'],$format,$thread['forumid']);
          }
          else
          {
          
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], falsetrue)));
          }
              echo 
"\t\t<content:encoded><![CDATA["$thread['preview'] ."]]></content:encoded>\r\n"
If you have the PHP external feed hack installed;
Found here: Additional external.php feed format

Find:
PHP Code:
  else if ($_REQUEST['type'] == 'PHP')
  { 
// PHP output 
and under it add:
PHP Code:
    foreach ($threadcache AS $key => $thread)
    {
      if (
function_exists('format_external_text'))
      {
        
$thread['preview'] = format_external_text($thread['preview'],$format,$thread['forumid']);
      }
      else
      {
      
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], falsetrue)));
      }
      
$threadcache[$key]['preview'] = $thread['preview'];
    } 
close and save external.php

Now in file forum/root/includes/functions_external.php find:
PHP Code:
  ?> 
and above it add:
PHP Code:
  function format_external_text($text,$format,$forumid=0) {
    
$format intval($format);
    
$forumid intval($forumid);
    if (
$format<=0)
    {
      
$text htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($textfalsetrue)));
    }
    else if (
$format == 1)
    {
      
$text htmlspecialchars_uni(strip_bbcode($textfalsetrue));
    }
    else
    {
      require_once(
'./includes/functions_bbcodeparse.php');
      
$text parse_bbcode($text,$forumid);
    }
    return 
$text;
  } 
Thats all.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024