Revision 543
Added by thorn almost 18 years ago
| index.php | ||
|---|---|---|
| 53 | 53 |
// also, set some aliases for backward compatibility |
| 54 | 54 |
require(WB_PATH.'/framework/frontend.functions.php'); |
| 55 | 55 |
|
| 56 |
// redirect menu-link |
|
| 57 |
$this_page_id = PAGE_ID; |
|
| 58 |
$query_this_module = $database->query("SELECT module, block FROM ".TABLE_PREFIX."sections WHERE page_id = '$this_page_id' AND module = 'menu_link'");
|
|
| 59 |
if($query_this_module->numRows() == 1) { // This is a menu_link. Get link of target-page and redirect
|
|
| 60 |
// get target_page_id |
|
| 61 |
$table = TABLE_PREFIX.'mod_menu_link'; |
|
| 62 |
$query_tpid = $database->query("SELECT target_page_id FROM $table WHERE page_id = '$this_page_id'");
|
|
| 63 |
if($query_tpid->numRows() == 1) {
|
|
| 64 |
$res=$query_tpid->fetchRow(); |
|
| 65 |
$target_page_id = $res['target_page_id']; |
|
| 66 |
// get link of target-page |
|
| 67 |
$table = TABLE_PREFIX.'pages'; |
|
| 68 |
$query_link = $database->query("SELECT link FROM $table WHERE page_id = '$target_page_id'");
|
|
| 69 |
if($query_link->numRows() == 1) {
|
|
| 70 |
$res=$query_link->fetchRow(); |
|
| 71 |
$target_page_link = $res['link']; |
|
| 72 |
// redirect |
|
| 73 |
header('Location: '.WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION);
|
|
| 74 |
exit; |
|
| 75 |
} |
|
| 76 |
} |
|
| 77 |
} |
|
| 78 |
|
|
| 56 | 79 |
// Display the template |
| 57 | 80 |
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php'); |
| 58 | 81 |
|
Also available in: Unified diff
module menu_link: fixed page-deleteing-bug and some odd behavior, added table mod_menu_link