Revision 1313
Added by Dietmar about 14 years ago
include.php | ||
---|---|---|
365 | 365 |
$this->output($this->itemClose); |
366 | 366 |
} |
367 | 367 |
} |
368 |
|
|
368 |
|
|
369 | 369 |
// finish the current menu |
370 | 370 |
function finishList() { |
371 | 371 |
$this->prettyLevel -= 3; |
... | ... | |
449 | 449 |
$CURR_PAGE_ID = defined('REFERRER_ID') ? REFERRER_ID : PAGE_ID; |
450 | 450 |
if (count($wb->page) == 0 && defined('REFERRER_ID') && REFERRER_ID > 0) { |
451 | 451 |
global $database; |
452 |
$sql = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '".REFERRER_ID."'";
|
|
452 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.REFERRER_ID.'';
|
|
453 | 453 |
$result = $database->query($sql); |
454 | 454 |
if ($result->numRows() == 1) { |
455 | 455 |
$wb->page = $result->fetchRow(); |
... | ... | |
520 | 520 |
if ($flags & SM2_ALLINFO) { |
521 | 521 |
$fields = '*'; |
522 | 522 |
} |
523 |
|
|
524 |
// get this once for performance. We really should be calling only need to |
|
525 |
// call $wb->get_group_id() but that outputs a warning notice if the |
|
526 |
// groupid isn't set in the session, so we check it first here. |
|
527 |
$currGroup = array_key_exists('GROUP_ID', $_SESSION) ? |
|
528 |
','.$wb->get_group_id().',' : 'NOGROUP'; |
|
529 |
|
|
530 |
// we request all matching rows from the database for the menu that we |
|
531 |
// are about to create it is cheaper for us to get everything we need |
|
523 |
|
|
524 |
// we request all matching rows from the database for the menu that we |
|
525 |
// are about to create it is cheaper for us to get everything we need |
|
532 | 526 |
// from the database once and create the menu from memory then make |
533 | 527 |
// multiple calls to the database. |
534 | 528 |
$sql = "SELECT $fields FROM ".TABLE_PREFIX. |
... | ... | |
557 | 551 |
continue; |
558 | 552 |
} |
559 | 553 |
} |
560 |
else { // WB < 2.7 |
|
561 |
// We can't do this in SQL as the viewing_groups column contains multiple |
|
562 |
// values which are hard to process correctly in SQL. Essentially we add the |
|
563 |
// following limit to the SQL query above: |
|
564 |
// (visibility <> "private" OR $wb->get_group_id() IN viewing_groups) |
|
565 |
if ($page['visibility'] == 'private' |
|
566 |
&& false === strstr(",{$page['viewing_groups']},", $currGroup)) |
|
567 |
{ |
|
568 |
continue; |
|
569 |
} |
|
570 |
} |
|
571 | 554 |
|
572 | 555 |
// ensure that we have an array entry in the table to add this to |
573 | 556 |
$idx = $page['parent']; |
Also available in: Unified diff
show_menu2 remove unneeded code for WB < 2.7
class.wb.php, recoding backend preference
add a language variable $MESSAGE['PREFERENCES']['INVALID_CHARS']
update theme.css & preference.htt in argos_theme & wb_theme
remove classic_theme