vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I get a jumpbox on forumhome? (https://vborg.vbsupport.ru/showthread.php?t=121413)

Canis Firebrand 07-17-2006 01:27 PM

How do I get a jumpbox on forumhome?
 
I'd like to have the jumpbox show up on the forumhome page. I think that is the template when you go to your main forum page.

www.forum.com/index.php

I have the $jumpbox code there, and it does show a jumpbox. However, the jumpbox only contains items under the Site Areas(User Control Panel, etc) and nothing under Forums.

How can I have it show the forums as well?

I did a search here and on vbulletin.org as well and did not find an answer.

Simon2323 03-27-2012 12:49 AM

been searching for this answer for quite some time today, anyone can please help

Pandemikk 03-27-2012 03:55 AM

As far as I know, there's no reliable code in vB that allows for a forumjump list. Because of this, I had to create my own in a recent modification I have created.

Simon2323 03-27-2012 12:27 PM

thank you for your answer, is there a place to get your mod? are you willing to share it?

I got part of the code, but i need to find the function that will list all the forums in a tree structure.

Do you know any documentation from vbulletin on how the Quick Navigation function is called?
I am new to vbulletin and I am having a hard time getting documentation on the functions to do my own customizations. To list all the forums in a tree structure like the quick navigation window should not be so difficult, yet I find all questions about it go unanswered on this board, anyone from vbulletin can help?

vbenhancer 03-27-2012 01:48 PM

something like this ?!

https://vborg.vbsupport.ru/showthread.php?t=230562

Simon2323 03-27-2012 02:13 PM

Thank you for your reply, it is exactly what I am looking for. I installed it and had to remove it because of tons of errors.

Seems like it is not compatible with 4.1.10, and the last post there is from 2009, so I do not expect to get much support.

Unfortunately every time I search for a fix or customization on this forum, I only find old mods, not working and not supported, it makes me wonder what is supported nowadays in Vbulletin.org?

--------------- Added [DATE]1332861595[/DATE] at [TIME]1332861595[/TIME] ---------------

@vbenhancer, I see you are a coder, not sure if it is against the rules of this board, can you help me with it? you can pm me if there is any charge.

So far I have been able to create a simple block (using html) with the fixed links to the forum functions such as usercp.php, private.php, subscription.php, online.php, search.php, forum.php, but I can not find the function or file to list the forums in a tree structure.

Sorry for the double post.

Thanks

Pandemikk 03-27-2012 02:35 PM

Quote:

Originally Posted by Simon2323 (Post 2313803)
thank you for your answer, is there a place to get your mod? are you willing to share it?

It's in vBAnalytics. It offers more than a forumjump constructor but the below code extracted should work if you follow the steps below.

Code:

function createSelectOptions($array, $selectedid = '', $htmlise = false)
        {
                if (!is_array($array))
                {
                        return '';
                }
               
                $options = '';
                foreach ($array as $key => $val)
                {
                        if (is_array($val))
                        {
                                // Create the template
                                $templater = vB_Template::create('optgroup');
                                        $templater->register('optgroup_label',        ($htmlise ? htmlspecialchars_uni($key) : $key));
                                        $templater->register('optgroup_options', createSelectOptions($val, $selectedid, $tabindex, $htmlise));
                                $options .= $templater->render();
                        }
                        else
                        {
                                if (is_array($selectedid))
                                {
                                        $selected = iif(in_array($key, $selectedid), ' selected="selected"', '');
                                }
                                else
                                {
                                        $selected = iif($key == $selectedid, ' selected="selected"', '');
                                }
                               
                                $templater = vB_Template::create('option');
                                        $templater->register('optionvalue',        ($key !== 'no_value' ? $key : ''));
                                        $templater->register('optionselected',        $selected);
                                        $templater->register('optiontitle',        ($htmlise ? htmlspecialchars_uni($val) : $val));
                                $options .= $templater->render();
                        }
                }

                return $options;
        }

       
        function construct_forums()
        {
                global $vbulletin, $vbphrase;
               
                if (empty($vbulletin->iforumcache))
                {
                        cache_ordered_forums(0, 1);
                }

                $forums = array(0 => $vbphrase['total']);
                foreach ($vbulletin->iforumcache AS $parentid => $forums_arr)
                {
                        $forumperms = $vbulletin->userinfo['forumpermissions']["$parentid"];
                        if ($parentid == -1
                                        OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
                                                AND ($vbulletin->forumcache["$parentid"]['showprivate'] == 1
                                                        OR (!$vbulletin->forumcache["$parentid"]['showprivate'] AND !$vbulletin->options['showprivateforums'])))
                                        OR !($vbulletin->forumcache["$parentid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump'])
                                        OR !$vbulletin->forumcache["$parentid"]['displayorder']
                                        OR !($vbulletin->forumcache["$parentid"]['options'] & $vbulletin->bf_misc_forumoptions['active'])
                                )
                        {
                                continue;
                        }
                        $forum = $vbulletin->forumcache["$parentid"];
                        $forums[$parentid] = $forum['title'];

                        foreach ($forums_arr AS $forumid)
                        {
                                $forumperms = $vbulletin->userinfo['forumpermissions']["$forumid"];
                                if ((!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$forumid"]['showprivate'] == 1 OR (!$vbulletin->forumcache["$forumid"]['showprivate'] AND !$vbulletin->options['showprivateforums']))) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
                                {
                                        continue;
                                }
                                else
                                {
                                        $forum = $vbulletin->forumcache["$forumid"];
                                        $forums[$forumid] = $forum['title'];
                                }
                        }
                }
                return $forums;
        }

Add the above code to a hook, such as global_start.

Then you can create the the forumjump with:

Code:

$forumjump = createSelectOptions(construct_forums());
This should result in $forumjump having a list of forums available based on forum permissions for the logged-in user. This is for vB4 not vB3 btw.

Untested.

vbenhancer 03-27-2012 03:27 PM

Quote:

Originally Posted by Simon2323 (Post 2313847)
Seems like it is not compatible with 4.1.10, and the last post there is from 2009, so I do not expect to get much support.

actually, you are in the vB3 forum... so i'm in the right place, you are not... ;)

but yes i could help you... i'm updating all my 3.x hacks to be compatible with vB 4.x these days, so in the next hours i will update this one as it is in the row.

Simon2323 03-27-2012 05:09 PM

thanks, i am running vb4, i found this question to be very similar to what I have been looking for and bumped it to see if i could get the answer, sorry about that, i am still kind of new and trying to find my way around. As a newbie I was under the assumption that all the mods should work for the latest version, what a mistake and waste of time.
Thank you for your help
simon

vbenhancer 03-27-2012 07:13 PM

Quote:

Originally Posted by Simon2323 (Post 2313922)
As a newbie I was under the assumption that all the mods should work for the latest version, what a mistake and waste of time.

that's actually why the Mods section you can visit by the tab on top of this page is seperate in sections containing versions of the scripts that are for each legacy... 3.8.x codes MAY work with 4.x generation, but as there are template changes and some code variations, they need their own version... that's what i'm updating myself right now, after a 2 years absence...


All times are GMT. The time now is 08:13 PM.

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.01256 seconds
  • Memory Usage 1,764KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete