Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 04:32 am EST
Geeklog Forums
staticpage labels only in one topic
Status: offline
artur
Forum User
Junior
Registered: 08/18/06
Posts: 16
if show plugins links on main menu is set and You check for a staticpage
show label,
don't show as centerblock
and specify a topic for this staticpage, then Geeklog shows label for this staticpage on every page and not in specified topic.
additionally if current user don't has rights to open particular topic, this user can read staticpages from this topic (if label is shown on every page)
With this hack:
Geeklog can show labels on all pages, on homepage (first page) or in specified topic.
the label is visible only for those user, who can open topic with this label
Note: If show in centerblock is checked then Geeklog showws label on every page.
// plugin Staticpages, file functions.inc, function plugin_getmenuitems_staticpages(), line 67 and line 82
/* line 67
add $_SERVER to globals ... */
global $_CONF, $_TABLES, $_SP_CONF, $_SERVER
// line 82: add following lines
if (strpos($_CONF['site_url'].'/index.php', $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']) > 4){
if (empty($_GET['topic'])){
$topic = ' AND ((sp_tid = "none") OR (sp_tid = "all") OR (sp_centerblock = 1))';
} else {
$topic = ' AND (sp_tid = "'.COM_applyFilter ($_GET['topic']).'" OR sp_tid ="all" OR sp_centerblock = 1)';
}
} else {
$topic = ' AND (sp_tid = "all" OR sp_centerblock = 1)';
}
// Modify sql query, Add variable $topic to SQL query: (next line)
... sp_onmenu = 1' . $topic . $order);
// ... not modified code ...
$nrows = DB_numRows ($result);
...
...
show label,
don't show as centerblock
and specify a topic for this staticpage, then Geeklog shows label for this staticpage on every page and not in specified topic.
additionally if current user don't has rights to open particular topic, this user can read staticpages from this topic (if label is shown on every page)
With this hack:
Geeklog can show labels on all pages, on homepage (first page) or in specified topic.
the label is visible only for those user, who can open topic with this label
Note: If show in centerblock is checked then Geeklog showws label on every page.
// plugin Staticpages, file functions.inc, function plugin_getmenuitems_staticpages(), line 67 and line 82
/* line 67
add $_SERVER to globals ... */
global $_CONF, $_TABLES, $_SP_CONF, $_SERVER
// line 82: add following lines
if (strpos($_CONF['site_url'].'/index.php', $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']) > 4){
if (empty($_GET['topic'])){
$topic = ' AND ((sp_tid = "none") OR (sp_tid = "all") OR (sp_centerblock = 1))';
} else {
$topic = ' AND (sp_tid = "'.COM_applyFilter ($_GET['topic']).'" OR sp_tid ="all" OR sp_centerblock = 1)';
}
} else {
$topic = ' AND (sp_tid = "all" OR sp_centerblock = 1)';
}
// Modify sql query, Add variable $topic to SQL query: (next line)
... sp_onmenu = 1' . $topic . $order);
// ... not modified code ...
$nrows = DB_numRows ($result);
...
...
10
7
Quote
All times are EST. The time is now 04:32 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