1
|
<?php
|
2
|
|
3
|
// $Id: compatibility.php 18 2005-09-04 16:11:53Z stefan $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2005, Ryan Djurovich
|
9
|
|
10
|
Website Baker is free software; you can redistribute it and/or modify
|
11
|
it under the terms of the GNU General Public License as published by
|
12
|
the Free Software Foundation; either version 2 of the License, or
|
13
|
(at your option) any later version.
|
14
|
|
15
|
Website Baker is distributed in the hope that it will be useful,
|
16
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
GNU General Public License for more details.
|
19
|
|
20
|
You should have received a copy of the GNU General Public License
|
21
|
along with Website Baker; if not, write to the Free Software
|
22
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23
|
|
24
|
*/
|
25
|
|
26
|
/*
|
27
|
This file is purely for ensuring compatibility with 3rd party
|
28
|
contributions made for WB version 2.5.2 or below
|
29
|
*/
|
30
|
if(!defined('WB_URL')) {
|
31
|
header('Location: ../index.php');
|
32
|
}
|
33
|
|
34
|
function page_link($link) {
|
35
|
global $wb;
|
36
|
$wb->page_link($link);
|
37
|
}
|
38
|
|
39
|
|
40
|
function page_content($block=1) {
|
41
|
global $wb;
|
42
|
$wb->page_content($block);
|
43
|
}
|
44
|
|
45
|
// Old menu call invokes new menu function
|
46
|
function page_menu($parent = 0, $menu_number = 1, $item_template = '<li><span[class]>[a][menu_title][/a]</span>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
|
47
|
global $wb;
|
48
|
$wb->menu($menu_number, 0, -1, true, $item_template, '</li>', $menu_header, $menu_footer, $default_class, $current_class, $parent);
|
49
|
// $wb->page_menu($parent, $menu_number, $item_template.'</li>', $menu_header, $menu_footer, $default_class, $current_class, $recurse);
|
50
|
}
|
51
|
|
52
|
// Function for page title
|
53
|
function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
|
54
|
global $wb;
|
55
|
$wb->page_title($spacer,$template);
|
56
|
}
|
57
|
|
58
|
// Function for page description
|
59
|
function page_description() {
|
60
|
global $wb;
|
61
|
$wb->page_description();
|
62
|
}
|
63
|
// Function for page keywords
|
64
|
function page_keywords() {
|
65
|
global $wb;
|
66
|
$wb->page_keywords();
|
67
|
}
|
68
|
// Function for page header
|
69
|
function page_header($date_format = 'Y') {
|
70
|
global $wb;
|
71
|
$wb->page_header($date_format);
|
72
|
}
|
73
|
// Function for page footer
|
74
|
function page_footer($date_format = 'Y') {
|
75
|
global $wb;
|
76
|
$wb->page_footer($date_format);
|
77
|
}
|
78
|
|
79
|
// references to objects and variables that changed their names
|
80
|
|
81
|
$admin = &$wb;
|
82
|
|
83
|
$default_link=&$wb->default_link;
|
84
|
|
85
|
$page_trail=&$wb->page_trail;
|
86
|
$page_description=&$wb->page_description;
|
87
|
$page_keywords=&$wb->page_keywords;
|
88
|
$page_link=&$wb->link;
|
89
|
|
90
|
$extra_sql=&$wb->extra_sql;
|
91
|
$extra_where_sql=&$wb->extra_where_sql;
|
92
|
|
93
|
|
94
|
// Begin WB < 2.4.x template compatibility code
|
95
|
// Make extra_sql accessable through private_sql
|
96
|
$private_sql = $extra_sql;
|
97
|
$private_where_sql = $extra_where_sql;
|
98
|
// Query pages for menu
|
99
|
$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
|
100
|
// Check if current pages is a parent page and if we need its submenu
|
101
|
if(PARENT == 0) {
|
102
|
// Get the pages submenu
|
103
|
$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
|
104
|
} else {
|
105
|
// Get the pages submenu
|
106
|
$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
|
107
|
}
|
108
|
// End WB < 2.4.x template compatibility code
|
109
|
// Include template file
|
110
|
|
111
|
|
112
|
?>
|