Project

General

Profile

« Previous | Next » 

Revision 565

Added by thorn almost 17 years ago

Module menu_link: added dropdown-listbox to select anchor

View differences:

index.php
59 59
if($query_this_module->numRows() == 1) { // This is a menu_link. Get link of target-page and redirect
60 60
	// get target_page_id
61 61
	$table = TABLE_PREFIX.'mod_menu_link';
62
	$query_tpid = $database->query("SELECT target_page_id FROM $table WHERE page_id = '$this_page_id'");
62
	$query_tpid = $database->query("SELECT target_page_id, anchor FROM $table WHERE page_id = '$this_page_id'");
63 63
	if($query_tpid->numRows() == 1) {
64 64
		$res=$query_tpid->fetchRow();
65 65
		$target_page_id = $res['target_page_id'];
66
		$anchor = $res['anchor'];
67
		if($anchor != '0') $anchor = ''.$anchor;
68
		else $anchor = FALSE;
66 69
		// get link of target-page
67 70
		$table = TABLE_PREFIX.'pages';
68 71
		$query_link = $database->query("SELECT link FROM $table WHERE page_id = '$target_page_id'");
......
70 73
			$res=$query_link->fetchRow();
71 74
			$target_page_link = $res['link'];
72 75
			// redirect
73
			header('Location: '.WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION);
76
			header('Location: '.WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION.($anchor?'#'.$anchor:''));
74 77
			exit;
75 78
		}
76 79
	}

Also available in: Unified diff