Welcome to Geeklog, Anonymous Wednesday, December 25 2024 @ 08:22 pm EST
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!
If so, how?
Thanks!
11
11
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello Kilerb,
Nice feature
Ad this code in your lib-custom.php and make a block with this phpblock_forumjump function.
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>» ' .$B['forum_name']. '';
} else {
$selecthtml .= LB .'<OPTION value="' .$B['forum_id']. '">» ' .$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
Nice feature
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>» ' .$B['forum_name']. '';
} else {
$selecthtml .= LB .'<OPTION value="' .$B['forum_id']. '">» ' .$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
11
8
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
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
9
13
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:
11
9
Quote
All times are EST. The time is now 08:22 pm.
- 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