Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Adding subforums option for external.php Details »»
Adding subforums option for external.php
Version: 3.8.0.0, by DarkSoroush DarkSoroush is offline
Developer Last Online: Aug 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.2 Rating:
Released: 11-11-2010 Last Update: 11-11-2010 Installs: 3
Uses Plugins
Re-useable Code  
No support by the author.

Very quick and easy modification to add an option for including sub-forums in external.php
It is very odd why there isn't any trick in internet about this and no Mod.

Automatic Install:
Using xml file and try to Install Product.

Manual Install:
Go to plug-ins section. Click to add new plug-in. Then Select "external_start" as hook location, enter a name like "External Subforums Addon" or something, Then copy below code to "PHP Plug-in Code" and select Yes from "Enable Plug-In" then click Save.

PHP Code:
function GetSubs($fid){
    global 
$db;
    
$fidsq $db->query_read_slave("SELECT childlist
                                        FROM  " 
TABLE_PREFIX "forum
                                        WHERE forumid = "
.$db->escape_string($fid)."
    "
);
    if (
$fids $db->fetch_array($fidsq)){
        
$fids str_replace(',-1','',$fids['childlist']);
        return 
$fids;
    }else{
        return 
$fid;
    }
}

if (
$_REQUEST['subforums'] && $_REQUEST['subforums']==1){
    if (
$_REQUEST['forumids']){
        foreach (
explode(',',$_REQUEST['forumids']) as $fid){
            
$_REQUEST['forumids'] = trim(GetSubs($fid).','.$_REQUEST['forumids'],',');
        }
    }elseif(
$_REQUEST['forumid']){
        
$_REQUEST['forumids'] = GetSubs($_REQUEST['forumid']);
    }
}

if (
$_REQUEST['forumids']){
    
// quick way of getting the first value
    
$_REQUEST['forumid'] = intval($_REQUEST['forumids']);

How to use?
Only add subforums=1 at end of external.php address. For example:

mysite.com/forum/external.php?type=RSS2&forumids=115,67&subforums=1
Or:
mysite.com/forum/external.php?type=RSS2&forumid=16&lastpost=1&subfo rums=1
Or:
mysite.com/forum/external.php?type=RSS&forumid=67&subforums=1
Or:
mysite.com/forum/external.php?type=XML&forumids=115&lastpost=1&subf orums=1
etc ...

Advantages:
1. Comparing to manual adding of forum ids to address, It help users from missing new topics or posts when you make an other sub-forum but bookmarks of users are old.
2. And make better address for rss of course.
3. Also, You don't need any change of forums code to add updated rss links to your forum list. You can use a simple mod like "https://vborg.vbsupport.ru/showthread.php?t=211957". No need to install complete solution like this one: "https://vborg.vbsupport.ru/showthread.php?t=203358".

Download Now

File Type: xml External Sub-forums addon.xml (2.1 KB, 22 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
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 10:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03587 seconds
  • Memory Usage 2,225KB
  • Queries Executed 17 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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_attachment
  • (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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete