Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 08:33 am EDT

Geeklog Forums

Putting the "Select a Forum" Drop Down in the sidebar or centerblock


Status: offline

kilerb

Forum User
Regular Poster
Registered: 03/19/08
Posts: 119
I noticed when you go into the forum area, as you can see right now on this page... On the top right there is a "Select a Forum" drop down box. Can I put that all by itself on the sidebar or centerblock?

If so, how?

Thanks!
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello Kilerb,

Nice feature Smile

Ad this code in your lib-custom.php and make a block with this phpblock_forumjump function.

Text Formatted Code

function phpblock_forumjump($action='',$selected=0) {
    global $CONF_FORUM, $_CONF,$_TABLES,$LANG_GF01,$LANG_GF02;

    $selecthtml = "";
    $asql = DB_query("SELECT * FROM {$_TABLES['gf_categories']} ORDER BY cat_order ASC");
    while($A = DB_fetchArray($asql)) {
        $firstforum=true;
        $bsql = DB_query("SELECT * FROM {$_TABLES['gf_forums']} WHERE forum_cat='$A[id]' ORDER BY forum_order ASC");
        while($B = DB_fetchArray($bsql)) {
            $groupname = DB_getItem($_TABLES['groups'],'grp_name',"grp_id='{$B['grp_id']}'");
            if (SEC_inGroup($B['grp_id'])) {
                if ($firstforum) {
                    $selecthtml .= '</optgroup>';
                    $selecthtml .= '<optgroup label="' .$A['cat_name']. '">';
                 }
                $firstforum=false;
                if ($selected > 0 AND $selected == $B['forum_id']) {
                    $selecthtml .= LB .'<OPTION value="' .$B['forum_id']. '" SELECTED>&#187;&nbsp;' .$B['forum_name']. '';
                } else {
                    $selecthtml .= LB .'<OPTION value="' .$B['forum_id']. '">&#187;&nbsp;' .$B['forum_name']. '';
                }
            }
        }
    }
    $forum_jump = new Template($_CONF['path_layout'] . 'forum/layout');
    $forum_jump->set_file (array ('forum_jump'=>'forum_jump.thtml'));
    $forum_jump->set_var ('LANG_msg103', $LANG_GF02['msg103']);
    $forum_jump->set_var ('LANG_msg106', $LANG_GF02['msg106']);
    $forum_jump->set_var ('jumpheading', $LANG_GF02['msg103']);
    $forum_jump->set_var ('imgset', $CONF_FORUM['imgset']);
    if ($action == '') {
        $forum_jump->set_var ('action', $_CONF['site_url'] . '/forum/index.php');
    } else {
        $forum_jump->set_var ('action', $action);
    }
    $forum_jump->set_var ('selecthtml', $selecthtml);
    $forum_jump->set_var ('LANG_GO', $LANG_GF01['GO']);
    $forum_jump->parse ('output', 'forum_jump');
    return $forum_jump->finish($forum_jump->get_var('output'));
}


The code is from Blaine's plugin.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
And to show the block in a static page see this tip page.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

kilerb

Forum User
Regular Poster
Registered: 03/19/08
Posts: 119
Quote by: cordiste

And to show the block in a static page see this tip page.

::Ben



Thanks! Worked perfectly...

:banana:
 Quote

All times are EDT. The time is now 08:33 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content