Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 16, 2012, 09:54:08 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155094
Posts in
21661
Topics by
7721
Members
Latest Member:
arrow345
WebsiteBaker Community Forum
English
Archive (posts up to 2007)
(Moderator:
Argos
)
sitemap problem
Pages: [
1
]
Go Down
Author
Topic: sitemap problem (Read 3025 times)
elvis
Offline
Posts: 4
sitemap problem
«
on:
December 09, 2005, 03:10:07 AM »
Hello,
I'm trying to add a page "sitemap" but getting the following error.
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop,footer,level_header,level_footer,startatroot,depth) VALUES ('13','13','1','' at line 1
When I click the sitemap on the actual website, the following error shows up:
Quote
Fatal error: Call to a member function on a non-object in /var/www/sb/modules/sitemap/view.php on line 26
This happens on website baker 2.5.2 with the sitemap module 2.5 (dowloaded from
http://www.ffnn.nl/pages/projects/fools-gold/downloads.php
)
Thanks in advance.
Logged
ruebenwurzel
WebsiteBaker Org e.V.
Offline
Posts: 7970
Re: sitemap problem
«
Reply #1 on:
December 09, 2005, 07:03:19 AM »
Try the Sitemap Modul from Completed Modules
http://forum.websitebaker.org/index.php/topic,1293.msg11006.html#msg11006
Matthias
Logged
elvis
Offline
Posts: 4
Re: sitemap problem
«
Reply #2 on:
December 09, 2005, 07:28:46 PM »
Quote from: ruebenwurzel on December 09, 2005, 07:03:19 AM
Try the Sitemap Modul from Completed Modules
http://forum.websitebaker.org/index.php/topic,1293.msg11006.html#msg11006
Matthias
tried as suggested, I get the following error:
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop,footer,level_header,level_footer,startatroot,depth) VALUES ('15','15','1','' at line 1
If I click the sitemap on my website following error shows up:
Quote
Fatal error: Call to a member function on a non-object in /var/www/sb/modules/sitemap/view.php on line 26
/var/www/sb/modules/sitemap/view.php is as follows: Line 26 reads: $fetch_settings = $get_settings->fetchRow();
Code:
<?php
/*
WebsiteBaker Project <http://www.websitebaker.org/>
Copyright (C) 2004-2005, Ryan Djurovich
WebsiteBaker is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
WebsiteBaker is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with websitebaker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Get settings
$get_settings
=
$database
->
query
(
"SELECT header,loop,footer,level_header,level_footer,static,startatroot,depth FROM "
.
TABLE_PREFIX
.
"mod_sitemap WHERE section_id = '
$section_id
'"
);
$fetch_settings
=
$get_settings
->
fetchRow
();
$header
=
stripslashes
(
$fetch_settings
[
'header'
]);
$loop
=
stripslashes
(
$fetch_settings
[
'loop'
]);
$footer
=
stripslashes
(
$fetch_settings
[
'footer'
]);
$level_header
=
stripslashes
(
$fetch_settings
[
'level_header'
]);
$level_footer
=
stripslashes
(
$fetch_settings
[
'level_footer'
]);
$static
=
$fetch_settings
[
'static'
];
$startatroot
=
$fetch_settings
[
'startatroot'
];
$depth
=
$fetch_settings
[
'depth'
];
echo
$header
;
if(
$static
==
true
OR
$static
==
false
) {
// Set private sql extra code
if(
FRONTEND_LOGIN
==
'enabled'
AND
is_numeric
(
$admin
->
get_session
(
'USER_ID'
))) {
$private_sql
=
",viewing_groups,viewing_users"
;
$private_where_sql
=
"visibility != 'none'"
;
} else {
$private_sql
=
""
;
$private_where_sql
=
"visibility = 'public'"
;
}
// determine sitemap starting point
global
$page_id
;
switch(
$startatroot
) {
case
2
:
// value 2 means start at current page
$parent
=
$page_id
;
break;
case
3
:
// value 3 means start at parent of current page
global
$database
;
$query_parent_id
=
$database
->
query
(
"SELECT parent FROM "
.
TABLE_PREFIX
.
"pages WHERE page_id='
$page_id
'"
);
if(
$query_parent_id
->
numRows
() >
0
) {
$parentrow
=
$query_parent_id
->
fetchRow
();
$parent
=
$parentrow
[
'parent'
];
}
break;
case
1
:
default:
// start at site root
$parent
=
0
;
break;
}
// sanity check on parent, check for smaller than 1 because of string cast
if( (
trim
(
$parent
) ==
""
) || (
$parent
<
1
) ) {
$parent
=
0
;
}
// build the sitemap
sitemap
(
$level_header
,
$loop
,
$level_footer
,
$parent
,
$depth
);
}
echo
$footer
;
// Function to build sitemap
function
sitemap
(
$level_header
,
$loop
,
$level_footer
,
$parent
=
0
,
$to_depth
=
0
,
$current_depth
=
0
) {
global
$database
;
global
$private_sql
;
global
$private_where_sql
;
// Query pages
$query_menu
=
$database
->
query
(
"SELECT page_id,parent,link,page_title,menu_title,description,keywords,modified_when,modified_by,link,target,visibility
$private_sql
FROM "
.
TABLE_PREFIX
.
"pages WHERE
$private_where_sql
AND parent = '
$parent
' ORDER BY position ASC"
);
// Check if there are any pages to show
if(
$query_menu
->
numRows
() >
0
) {
// Print level header
echo
$level_header
;
// Loop through pages
$new_depth
=
$current_depth
+
1
;
while(
$page
=
$query_menu
->
fetchRow
()) {
$vars
= array(
'[PAGE_ID]'
,
'[PARENT]'
,
'[LINK]'
,
'[PAGE_TITLE]'
,
'[MENU_TITLE]'
,
'[DESCRIPTION]'
,
'[KEYWORDS]'
,
'[TARGET]'
,
'[MODIFIED_WHEN]'
,
'[MODIFIED_BY]'
);
$values
= array(
$page
[
'page_id'
],
$page
[
'parent'
],
page_link
(
$page
[
'link'
]),
stripslashes
(
$page
[
'page_title'
]),
stripslashes
(
$page
[
'menu_title'
]),
stripslashes
(
$page
[
'description'
]),
stripslashes
(
$page
[
'keywords'
]),
$page
[
'target'
],
$page
[
'modified_when'
],
$page
[
'modified_by'
]);
echo
str_replace
(
$vars
,
$values
,
$loop
);
// determine if we may descend further in the subpages
if(
$new_depth
!=
$to_depth
) {
// pass on the maximum and current depth
sitemap
(
$level_header
,
$loop
,
$level_footer
,
$page
[
'page_id'
],
$to_depth
,
$new_depth
);
}
}
// Print level footer
echo
$level_footer
;
}
}
?>
I have MySQL 5.0.16-Debian installed, any idea how to fix this is appericiated.
Thanks
«
Last Edit: December 09, 2005, 07:45:36 PM by elvis
»
Logged
Woudloper
Guest
Re: sitemap problem
«
Reply #3 on:
December 09, 2005, 11:44:38 PM »
Never worked with MySQL > 5.0, but could this has something to do with the fact that integer (number) fields are queried as string, this value between quotation marks? Hope someone can test that out who has MySQL > 5.0 running
Logged
elvis
Offline
Posts: 4
Re: sitemap problem
«
Reply #4 on:
December 10, 2005, 05:55:49 AM »
Thanks Woudloper
Here's what I did:
Removed MySQL 5.0.16
Installed MySQL 4.1.14
Created a website with WebsiteBaker 2.6
installed sitemap module, works and I'm happy
installed bookmarks module, doesn't work
Created a website with WebsiteBaker 2.5.2
installed sitemap module, works and I'm happy
installed bookmarks module, works and I'm happy
I guess I'll stick with MySQL 4.1.14 and WebsiteBaker 2.5.2 for a while.
Thanks again
Logged
Woudloper
Guest
Feedback about the bookmarks module problem?
«
Reply #5 on:
December 10, 2005, 10:57:38 AM »
Quote from: elvis on December 10, 2005, 05:55:49 AM
Removed MySQL 5.0.16
Installed MySQL 4.1.14
Created a website with WebsiteBaker 2.6
installed sitemap module, works and I'm happy
installed bookmarks module, doesn't work
Could you tell something more about the problem you where having with the 'Bookmarks module' when working with MySQL 4.1.14 and WB2.6.0. as I am working with MySQL 4.1.11-nt and also work with the WB2.6.0. installating and this all is working fine. Did you have logged the issue you had? Hope to hear from you...
Logged
elvis
Offline
Posts: 4
Re: sitemap problem
«
Reply #6 on:
December 11, 2005, 09:03:40 AM »
Hi Woudloper and everyone,
It's really weird! After fiddling around, I attempted to install and use the bookmarks module on WB 2.6 based site from my wife's WinXP PC:
I accessed the WB 2.6 site on my Linux machine from a WinXP and everything went smooth.
To verify the problem, I created another site using WB 2.6 with its own database and tried the bookmarks module with no luck. Following error shows up:
Quote
Warning: main(/var/www/wb26/temp/unzip/info.php): failed to open stream: No such file or directory in /var/www/wb26/admin/modules/install.php on line 60
Fatal error: main(): Failed opening required '/var/www/wb26/temp/unzip/info.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/wb26/admin/modules/install.php on line 60
I repeated the installation from the WinXP and it worked again!
It's kinda strange and sad!
Here are the specs for my Linux box:
OS: SimplyMEPIS 3.4-1 (release candidate but modified with Debian unstable [sid] repos)
Web server: Apache 2.0.55-3
DBMS: MySQL MySQL 4.1.14
and PHP 4.4.0-4
Hope this helps to figure out the problem.
Cheers,
Elvis
Logged
Woudloper
Guest
Re: sitemap problem
«
Reply #7 on:
December 12, 2005, 08:49:53 PM »
Really strange indeed! I don't have a glue why this is happening this way!?
Regarding the other problem you had with MySQL 5.0., thus this error:
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'loop,footer,level_header,level_footer,startatroot,depth) VALUES ('15','15','1','' at line 1
This all has to do with the new
reserved words
within the SQL syntax of MySQL. I found the following sentence:
Quote
The following are new reserved words in MySQL 5.0: ASENSITIVE, CALL, CONDITION, CONNECTION, CONTINUE, CURSOR, DECLARE, DETERMINISTIC, EACH, ELSEIF, EXIT, FETCH, GOTO, INOUT, INSENSITIVE, ITERATE, LABEL, LEAVE,
LOOP
, MODIFIES, OUT, READS, RELEASE, REPEAT, RETURN, SCHEMA, SCHEMAS, SENSITIVE, SPECIFIC, SQL, SQLEXCEPTION, SQLSTATE, SQLWARNING, TRIGGER, UNDO, WHILE.
As you can see the sitemap module uses a table with a columname of 'loop'. This will be fixed in a future release...
Logged
karldehall
Offline
Posts: 18
Re: sitemap problem
«
Reply #8 on:
February 20, 2006, 08:54:42 PM »
Hello,
when I tried to install the sitemap 2.7-module on a MySQl 5.0, I got this problem too.
In accordance with the last reply of Woudloper, I made a new row (or is that rather a field? I know better the german denominations for databases) in the mod_sitemap-table named "loop
s
" and dropped the "loop"-row. After that I changed in every *.php-file in the /sitemap-directory "loop" to "loops" (LOOP to LOOPS), and zipped all the files again.
Installation was successfull and the sitemap-module runs.
Karl
Logged
ruebenwurzel
WebsiteBaker Org e.V.
Offline
Posts: 7970
Re: sitemap problem
«
Reply #9 on:
March 04, 2006, 12:35:15 PM »
Hello,
new version available wich fixes this issue.
Look
here
Matthias
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...