vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Widget:Forums Category names/links in cms for version 4.0.1 - omardealo (https://vborg.vbsupport.ru/showthread.php?t=235827)

omardealo 02-13-2010 10:00 PM

Widget:Forums Category names/links in cms for version 4.0.1 - omardealo
 
1 Attachment(s)
Peace and mercy of God be upon you

Code:
Widget:Forums Category names/links in cms for version 4.0.1

by:
omardealo
http://www.7-secret.org/style.php?language=en

photo:
https://vborg.vbsupport.ru/external/2010/02/51.jpg

Example: in footer
www.7-secret.org

Code:

PHP Code:

ob_start();
  
$forum_get vB::$db->query_read("
    SELECT * FROM "
.TABLE_PREFIX."forum
   ORDER by forumid"
);
  
$output_bits '';
  while(
$forum vB::$db->fetch_array($forum_get))
  {
        
$output_bits .= '<a href="forumdisplay.php?'.$forum[forumid].'-'.$forum[title].'" style="text-decoration: none">'.$forum[title].'</a> 
<font color="#FF6600"><b>@</b></font> '
;
  }
  
$output $output_bits;
  
ob_end_clean(); 

Composition:
  • Goto Admincp->vBullietin CMS->Widgets->Create New Widget
  • Choose PHP Direct Execution as Widget's Type
  • Place a Title. eg Forums Category. Keep it short as this is what will appear as title on your pages.
  • Click Save
  • Click Configure on the right of the new created widget.
  • Remove the default code that appears. Be sure to not leave behind even a single letter.
  • Copy and Paste the code that you can find below.
  • Leave the template name as is (vbcms_widget_execphp_page)
  • Click Save
  • Goto Admincp->vBullietin CMS->Layout Manager
  • Click Go on the Default Layout
  • Add the Widget to your Layout
  • Click Save

Note:
Those who want to exclude specific Forums Category
use this code

PHP Code:

ob_start();
$excluded "1,2,3";
  
$forum_get vB::$db->query_read("
    SELECT * FROM "
.TABLE_PREFIX."forum
   WHERE forumid NOT IN (
$excluded) ORDER by forumid");
  
$output_bits '';
  while(
$forum vB::$db->fetch_array($forum_get))
  {
        
$output_bits .= '<a href="forumdisplay.php?'.$forum[forumid].'-'.$forum[title].'" style="text-decoration: none">'.$forum[title].'</a> 
<font color="#FF6600"><b>@</b></font> '
;
  }
  
$output $output_bits;
  
ob_end_clean(); 

In this line

PHP Code:

$excluded "1,2,3"

Replace 1,2,3 Forums Category number that you want to exclude

hack in arabic - الهاك باللغة العربية:
http://www.7-secret.org/showthread.php?t=213

Source in english :
http://www.7-secret.org/showthread.php?t=228

May God help you do not forget to pray for me and my parents back of the unseen

nomoreturn 02-14-2010 12:50 PM

Installed and working perfect thanks
http://www.mastdunya.com

Front Range 4x4 02-14-2010 01:32 PM

Interesting omardealo, I'll be tagging this.

omardealo 02-14-2010 04:05 PM

Quote:

Originally Posted by nomoreturn@hotm (Post 1982101)
Installed and working perfect thanks
http://www.mastdunya.com

very good , But delete the html codes of Forums Category names

omardealo 02-14-2010 07:28 PM

Quote:

Originally Posted by Front Range 4x4 (Post 1982123)
Interesting omardealo, I'll be tagging this.

thnx man

mikeinjersey 08-07-2011 04:28 PM

very nicely done, but i'd like a break <br> after each forum category...so their not all bunched together.

Maybe there's a newer version of this somewhere ?

also, i'd like my forum categories to be displayed in vbSEO format...clean URLs.. (like the rest of my forums are) not the default .php way.

any quick fix on this is much appreciated.

mikeinjersey 08-07-2011 07:43 PM

nevermind, fixed with the following -


Quote:

ob_start();
$excluded = "1,2,3";
$forum_get = vB::$db->query_read("
SELECT * FROM ".TABLE_PREFIX."forum
WHERE forumid NOT IN ($excluded) ORDER by forumid");
$output_bits = '';
while($forum = vB::$db->fetch_array($forum_get))
{
$output_bits .= '<a href="http://www.mydomain.com/forum'.$forum[forumid].'" style="text-decoration: none">'.$forum[title].'</a>
<br /> ';
}
$output = $output_bits;
ob_end_clean();
replace mydomain.com with your domain name. This will make it so that you're URL's are seo'd as long as u have vbSEO installed.

Toorak Times 07-03-2014 03:19 PM

This still seems to work great on 4.2.2pl1 too.

I have been looking for something like this to add to my Contributors page BUT I reckon I can use the whole listing in a Social page I'm building.

What I love about it is that I can disclude all but the news input forums that have my rss feeds and current news Blocks in the CMS.

A bit of css and this would be cool, love to have top categories stand out some how and maybe be able to choose usergroups that can use it or it appears for.

Great way to get your forums up front if a publisher.:up:

tbworld 07-03-2014 04:30 PM

Thanks for sharing. :)


All times are GMT. The time now is 04:32 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.01074 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete