phpodpworld-users Mailing List for phpODPWorld (Page 2)
Status: Beta
Brought to you by:
hansfn
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
(14) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Howard L. <hl...@gm...> - 2007-07-03 14:58:46
|
Thanks for the reply as always, I really appreciate it. Nowadays all software are full of bugs , commercial, free or otherwise :) Apparently what your saying is correct, it's just a PHP setting. This is not really a bug, perhaps any decent web admin would figure it out, but not me :-O I actually checked the codes in index.php and functions.php before sending to the list. Of course I couldn't find anything about the extra quotes, and it left me wondering. Anyway, I hope somebody else would find this useful too. Howard |
From: Hans F. N. <Han...@hi...> - 2007-07-02 22:16:55
|
* Howard Lee <hl...@gm...> [2007-07-02]: > Dear all, > > Some of the DMOZ categories have the ' character. I found that these > categories are not displayed. It seems the ' character is escaped and > displayed as \'. For example, this error message is shown when I > access the page: > The category "Reference: Education: Colleges and Universities: North > America: United States: Women\'s Colleges" was not found. > > I checked the apache log and it is not escaped. > 210.17.204.242 - - [02/Jul/2007:01:58:57 -0700] "GET > /Reference/Education/Colleges_and_Universities/North_America/United_States/Women's_Colleges > HTTP/1.1" 200 1897 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT > 5.1; SV1; .NET CLR 2.0.50727)" > > I am using MySQL 5.0 as the database, and the category is indeed > there. Does anybody experience the same problem? Thank you. As you all know (?), phpodpworld is just a hobby project of mine. It basically means there are plenty of bugs - this is one of them. My guess is that you have activated magic_quotes_gpc[1] and my code isn't checking for that. Could you please try to turn off magic_quotes_gpc and see if the problem is fixed? If so, I'll add some checks for magic quotes before the next release. Hans [1] This is a PHP setting so it will not affect the Apache logs. (Look in your php.ini. It can be disabled at directory level using .htaccess.) |
From: Howard L. <hl...@gm...> - 2007-07-02 09:29:59
|
Dear all, Some of the DMOZ categories have the ' character. I found that these categories are not displayed. It seems the ' character is escaped and displayed as \'. For example, this error message is shown when I access the page: The category "Reference: Education: Colleges and Universities: North America: United States: Women\'s Colleges" was not found. I checked the apache log and it is not escaped. 210.17.204.242 - - [02/Jul/2007:01:58:57 -0700] "GET /Reference/Education/Colleges_and_Universities/North_America/United_States/Women's_Colleges HTTP/1.1" 200 1897 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" I am using MySQL 5.0 as the database, and the category is indeed there. Does anybody experience the same problem? Thank you. Howard |
From: Hans F. N. <Han...@hi...> - 2007-06-01 23:52:56
|
* Wayne Khan [2007-06-01]: > Hi hansfn, > I noticed that the tools/db.sql file has some syntax errors. Table names > should be enclosed in backticks, not double quotes! phpODPWorld is written to work with both MySQL and PostgreSQL (and other databases supported by Pear DB), so using backticks isn't portable - it's MySQL specific (AFAIK and can read from the MySQL and PostgreSQL docs). Double quotes works fine in MySQL if you are using ANSI_QUOTES SQL mode - ref http://www.mysql.org/doc/refman/5.1/en/identifiers.html (You are the first MySQL user complaining...) An option would be to not use quotes at all, but since PostgreSQL folds un-quoted identifiers to lower case (which is incompatible with the SQL standard) quoting is recommended when writing portable apps. Regards, Hans - who really isn't a DB expert. PS! Please use the mailing list for such questions so other users can benefit - I have forwarded this e-mail to the list. |
From: Hans F. N. <Han...@hi...> - 2007-04-03 19:16:11
|
* Darryl Koster <dk...@se...> [2007-03-31]: > I notice in phpodpworld that the functions.inc.php has Wikipedia listed > as no.wikipedia.org. It might be better as www.wikipedia.org. Or as en.wikipedia.org. Anyway, this was an omission - I developed this software to display World/Norsk and no.wikipedia.org was a leftover from that. Since I was fixing this, I decided to make the list of related sites configurable. Hope you like it: http://phpodpworld.cvs.sourceforge.net/phpodpworld/phpodpworld/config.inc.php?r1=1.5&r2=1.6 http://phpodpworld.cvs.sourceforge.net/phpodpworld/phpodpworld/functions.inc.php?r1=1.8&r2=1.9 Thanks for the report, and best Easter wishes from Norway. Regards, Hans |
From: Darryl K. <dk...@se...> - 2007-04-01 08:37:52
|
I notice in phpodpworld that the functions.inc.php has Wikipedia listed as no.wikipedia.org. It might be better as www.wikipedia.org. Darryl K. |
From: Darryl K. <dk...@se...> - 2007-03-27 03:41:03
|
Well, that put me on the right track. I managed to fix it by using example #2 and tweaking it a little. Here's the code that worked for me. Feel free to use it, and thanks for your help! Regards, Darryl Koster |
From: Hans F. N. <Han...@hi...> - 2007-03-27 00:19:58
|
* Darryl Koster <dk...@se...> [2007-03-27]: > I have $config["use_rewrite"] = true; set in the config.inc.php, and am > using example1.htaccess as my .htaccess file. > > When I click on say, "Personal Pages" on my site I get a 404 "The > requested URL /Computers/Robotics/Personal_Pages was not found on this > server." Thx for the added info. I must admit that I didn't tell the complete truth - I use the content of example1.htaccess directly inside the Apache config file (httpd.conf/apache.conf or whatever it's called on your machine). This might make a difference because (quote from http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule): When using the rewrite engine in .htaccess files the per-directory prefix (which always is the same for a specific directory) is automatically removed for the pattern matching and automatically added after the substitution has been done. This feature is essential for many sorts of rewriting; without this, you would always have to match the parent directory, which is not always possible. This seems to indicate that you should replace all (three) occurences of "^/" with just "^" in the .htaccess file. Let me know if it helps (and I'll update the docs/example files). The reason I think this should work is: > I enabled the rewrite log, and this is what I got below for that: > ----------------------------------------------------------------------- > > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] add path info postfix: > /www/robotmoz.com/public_html/Computers -> > /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] strip per-dir prefix: > /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> > Computers/Robotics/Personal_Pages > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] applying pattern '^/index.php$' to uri > 'Computers/Robotics/Personal_Pages' We are trying to match something that starts with a slash with something that doesn't... Regards, Hans PS! www.robotmoz.com looked really nice. At first glance there is only one minor glitch (on my screen) - the languages/links in the "This category in other languages" box is almost impossible to see. |
From: Darryl K. <dk...@se...> - 2007-03-26 23:55:07
|
I have $config["use_rewrite"] = true; set in the config.inc.php, and am using example1.htaccess as my .htaccess file. When I click on say, "Personal Pages" on my site I get a 404 "The requested URL /Computers/Robotics/Personal_Pages was not found on this server." I enabled the rewrite log, and this is what I got below for that: ----------------------------------------------------------------------- 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/index.php$' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/.*' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/(.*)' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (1) [perdir /www/robotmoz.com/public_html/] pass through /www/robotmoz.com/public_html/Computers ----------------------------------------------------------------- Any idea on what I'm doing wrong here? Darryl Koster |
From: Hans F. N. <Han...@hi...> - 2007-03-26 06:13:55
|
* Darryl Koster <dk...@se...> [2007-03-26]: > I'm trying to set up a .htaccess file to do search engine friendly urls > on a phpODPWorld site that I put together. > > Does anyone have any examples of how to do this? I've found that it's a > bit difficult. The files you downloaded when you installed phpODPWorld contains example1.htaccess and example2.htaccess. I do agree that these files aren't trivial, but unless you tell us what you are trying to achieve *and* what you have tried that didn't work, it's very hard to help you. On http://odp.no/ I'm using example1.htaccess (renamed to .htaccess of course). Regards, Hans |
From: Darryl K. <dk...@se...> - 2007-03-26 00:45:01
|
I'm trying to set up a .htaccess file to do search engine friendly urls on a phpODPWorld site that I put together. Does anyone have any examples of how to do this? I've found that it's a bit difficult. Darryl Koster dk...@se... |
From: Hans F. N. <Han...@hi...> - 2006-12-14 22:48:46
|
I'm happy to announce the new release 3.0 pre1. From the release notes: This is the first pre-release for version 3.0. The goal for 3.0 is increased speed, improved robustness and documentation. This pre-release only increases the speed of database handling. Read the changelog at http://sourceforge.net/project/shownotes.php?release_id=471354&group_id=161091 The only really slow part left is the setting of number of links (counting) per category. I'll look at that now and hopefully a pre2 isn't that many weeks away. Thx for your time. It's time to go to bed. Regards, Hans / hansfn |
From: Hans F. N. <Han...@hi...> - 2006-04-21 20:39:47
|
* Howard Lee <hl...@gm...> [2006-04-21]: > Dear all, > > The below function definition in the file functions.inc.php causes an > error while running index.php. > function cat_exists(&$cat, &$catid = null) { > .... > > So I've change it to below, and it is OK now: > function cat_exists(&$cat, &$catid) { > .... > > I'm not very familiar with PHP, but I suspect it was a typo in the > original script. Or is it specific to the PHP version used? Sorry for > having so many questions.... Default values for variables passed by reference (as for cat_exists) is only available in PHP 5 - my bad again. Thx for reporting. I'm very glad that you ask all these questions because I want this software to work for both Postgresql and MySQL... Regards, Hans PS! I'll use the DEFAULT keyword in stead of hard-coding "-1" in the insert statement as you suggested in another message. |
From: Howard L. <hl...@gm...> - 2006-04-21 14:12:19
|
Dear all, The below function definition in the file functions.inc.php causes an error while running index.php. function cat_exists(&$cat, &$catid =3D null) { .... So I've change it to below, and it is OK now: function cat_exists(&$cat, &$catid) { .... I'm not very familiar with PHP, but I suspect it was a typo in the original script. Or is it specific to the PHP version used? Sorry for having so many questions.... Howard |
From: Howard L. <hl...@gm...> - 2006-04-21 14:04:05
|
Hello Hans, Thanks for the reply. I did "fix" it myself but in another way (changed to the case-sensitive str_replace), but I think your method is much better :) Howard |
From: Howard L. <hl...@gm...> - 2006-04-21 12:26:13
|
Hi Hans, I checked it should be specific to MySQL, and I think it affects MySQL 4.x and 5.x. http://dev.mysql.com/doc/refman/4.1/en/insert.html "If you do not specify a list of column names for INSERT ... VALUES or INSERT ... SELECT, values for every column in the table must be provided by the VALUES list or the SELECT statement. If you do not know the order of the columns in the table, use DESCRIBE tbl_name to find out." And I'm thinking it might be better to use the DEFAULT keyword instead of hard coding to -1. But the DEFAULT keyword requires MySQL 4.0.3 or above. Howard |
From: Hans F. N. <Han...@hi...> - 2006-04-20 19:49:22
|
* Hans F. Nordhaug <Han...@hi...> [2006-04-20]: > * Howard Lee <hl...@gm...> [2006-04-20]: > > Dear all, > > > > According to the phpodpworld home page, PHP 4.3 or better is required. > > However, the function str_ireplace is used in the file > > functions.inc.php. This function is only present in PHP 5 as I > > understand. Any comments? > > Your are correct on both issues - str_ireplace requires PHP 5 - and > the intended requirement for phpodpworld was 4.3. Is this an immediate > problem for you? I'll of course rewrite the part that use str_ireplace > because requiring PHP is too strict. The easy solution (which I'll implement) is to use str_ireplace from PHP_Compat - see http://pear.php.net/package/PHP_Compat/ For your convenience I have included the function below - just add it to functions.inc.php and you should be fine (but you have maybe done this already)? Hans ---------- str_ireplace ---------------------------------------------------- // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/3_0.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Aidan Lister <ai...@ph...> | // +----------------------------------------------------------------------+ // // $Id: str_ireplace.php,v 1.18 2005/01/26 04:55:13 aidan Exp $ /** * Replace str_ireplace() * * @category PHP * @package PHP_Compat * @link http://php.net/function.str_ireplace * @author Aidan Lister <ai...@ph...> * @version $Revision: 1.18 $ * @since PHP 5 * @require PHP 4.0.0 (user_error) * @note count not by returned by reference, to enable * change '$count = null' to '&$count' */ if (!function_exists('str_ireplace')) { function str_ireplace($search, $replace, $subject, $count = null) { // Sanity check if (is_string($search) && is_array($replace)) { user_error('Array to string conversion', E_USER_NOTICE); $replace = (string) $replace; } // If search isn't an array, make it one if (!is_array($search)) { $search = array ($search); } $search = array_values($search); // If replace isn't an array, make it one, and pad it to the length of search if (!is_array($replace)) { $replace_string = $replace; $replace = array (); for ($i = 0, $c = count($search); $i < $c; $i++) { $replace[$i] = $replace_string; } } $replace = array_values($replace); // Check the replace array is padded to the correct length $length_replace = count($replace); $length_search = count($search); if ($length_replace < $length_search) { for ($i = $length_replace; $i < $length_search; $i++) { $replace[$i] = ''; } } // If subject is not an array, make it one $was_array = false; if (!is_array($subject)) { $was_array = true; $subject = array ($subject); } // Loop through each subject $count = 0; foreach ($subject as $subject_key => $subject_value) { // Loop through each search foreach ($search as $search_key => $search_value) { // Split the array into segments, in between each part is our search $segments = explode(strtolower($search_value), strtolower($subject_value)); // The number of replacements done is the number of segments minus the first $count += count($segments) - 1; $pos = 0; // Loop through each segment foreach ($segments as $segment_key => $segment_value) { // Replace the lowercase segments with the upper case versions $segments[$segment_key] = substr($subject_value, $pos, strlen($segment_value)); // Increase the position relative to the initial string $pos += strlen($segment_value) + strlen($search_value); } // Put our original string back together $subject_value = implode($replace[$search_key], $segments); } $result[$subject_key] = $subject_value; } // Check if subject was initially a string and return it as a string if ($was_array === true) { return $result[0]; } // Otherwise, just return the array return $result; } } |
From: Hans F. N. <Han...@hi...> - 2006-04-20 14:47:03
|
* Howard Lee <hl...@gm...> [2006-04-20]: > Dear all, > > According to the phpodpworld home page, PHP 4.3 or better is required. > However, the function str_ireplace is used in the file > functions.inc.php. This function is only present in PHP 5 as I > understand. Any comments? Your are correct on both issues - str_ireplace requires PHP 5 - and the intended requirement for phpodpworld was 4.3. Is this an immediate problem for you? I'll of course rewrite the part that use str_ireplace because requiring PHP is too strict. Hans PS! And you know that my development environment is PHP5 :-) |
From: Howard L. <hl...@gm...> - 2006-04-20 14:08:12
|
Dear all, According to the phpodpworld home page, PHP 4.3 or better is required. However, the function str_ireplace is used in the file functions.inc.php. This function is only present in PHP 5 as I understand. Any comments? Howard |
From: Hans F. N. <Han...@hi...> - 2006-04-19 21:31:42
|
FYI: SourceForge has CVS hardware problems. Quoting http://sourceforge.net/docs/A04/: "The sync process between developer and anonymous CVS (ViewCVS, etc.) is disabled now until the new infrastructure is in place" So until the end of April, you won't see the updates that I do - you just have to trust me :-) Regards, Hans |
From: Hans F. N. <Han...@hi...> - 2006-04-19 16:12:49
|
* Howard Lee <hl...@gm...> [2006-04-19]: > Dear all, > > In the structure table, there are 7 fields as shown in tools/db.sql. > However, in the script tools/structure2db.pl, there are only 5 fields > when inserting records to the table. I have met a problem with MySQL > 5.x and it returns an error. It might work for Postgresql but I have > not verified it though. Of course it works on Postgresql - this software is in use :-) > As I understand, the last 2 fields "count" and "totalcount" are not > imported by this script and the default are "-1". So I have modified > the tools/structure2db.pl file, line 123 from: > my $str_sth = $dbh->prepare("INSERT INTO structure VALUES (?, ?, ?, ?, ?)"); > to: > my $str_sth = $dbh->prepare("INSERT INTO structure VALUES (?, ?, ?, ?, ?, -1, -1)"); > > It then works for my MySQL 5.x. Strange that this is needed, but since it doesn't hurt adding it I will do so. (Yes, my development environment is using Postgresql so I have noticed this problem.) Thanks again for fixing (and reporting here). Hans |
From: Howard L. <hl...@gm...> - 2006-04-19 14:18:36
|
Dear all, In the structure table, there are 7 fields as shown in tools/db.sql. However, in the script tools/structure2db.pl, there are only 5 fields when inserting records to the table. I have met a problem with MySQL 5.x and it returns an error. It might work for Postgresql but I have not verified it though. As I understand, the last 2 fields "count" and "totalcount" are not imported by this script and the default are "-1". So I have modified the tools/structure2db.pl file, line 123 from: my $str_sth =3D $dbh->prepare("INSERT INTO structure VALUES (?, ?, ?, ?, ?)= "); to: my $str_sth =3D $dbh->prepare("INSERT INTO structure VALUES (?, ?, ?, ?, ?, -1, -1)"); It then works for my MySQL 5.x. Cheers, Howard |
From: Hans F. N. <Han...@hi...> - 2006-04-19 13:07:11
|
* Howard Lee <hl...@gm...> [2006-04-19]: > Dear all, > > I have downloaded phpodpworld 2.0 and installed it with a remote MySQL > 5.x database. I have found a problem with the content2db.pl script. > > It is supposed that the config.inc.php and tools/config.pl can specify > the type of database to be Postgresql or MySQL. However, there isn't > an option to specify the database to be remote in tools/config.pl. I > have made some modifications to make this work. > > 1. In the file tools/config.pl, add the following line which can be > used to specify the database hostname. > $db_host=""; > > 2. In the file tools/content2db.pl > (a) locate the line our $db_user; and add: > our $db_host; > (b) There is a problem with the database type detection following the line: > my $dsn; > The string comparison operator "eq" should be used instead of "==" for > the "if" and "elsif" statements. (How embarrassing.) > (c) Modify the $dsn for MySQL to become: > $dsn = "dbi:$db_type:database=$db_name;host=$db_host"; > > I'm sending this to the list and hope it will benefit others, or > perhaps be considered for the next version. Thx for the heads up. The possibility to add host (in general, not only for MySQL) is added - see http://cvs.sourceforge.net/viewcvs.py/phpodpworld/phpodpworld/tools/ (Not updated yet - there is some lag at SourceForge.) The changes you suggest must of course be applied to structure2db.pl too. Regards, Hans PS! There will soon be a new version which is much faster to insert content and structure into the database. PS! Howard, the list is for members only - I forwarded your initial message and am sending you a copy now, but I can't continue like this :-) |
From: Howard L. <hl...@gm...> - 2006-04-19 12:15:45
|
Dear all, I have downloaded phpodpworld 2.0 and installed it with a remote MySQL 5.x database. I have found a problem with the content2db.pl script. It is supposed that the config.inc.php and tools/config.pl can specify the type of database to be Postgresql or MySQL. However, there isn't an option to specify the database to be remote in tools/config.pl. I have made some modifications to make this work. 1. In the file tools/config.pl, add the following line which can be used to specify the database hostname. $db_host=3D""; 2. In the file tools/content2db.pl (a) locate the line our $db_user; and add: our $db_host; (b) There is a problem with the database type detection following the line: my $dsn; The string comparison operator "eq" should be used instead of "=3D=3D" for the "if" and "elsif" statements. (c) Modify the $dsn for MySQL to become: $dsn =3D "dbi:$db_type:database=3D$db_name;host=3D$db_host"; I'm sending this to the list and hope it will benefit others, or perhaps be considered for the next version. Cheers, Howard |
From: Hans F. N. <Han...@hi...> - 2006-04-05 21:58:08
|
(I changed the subject since was inapropriate - telling nothing about the problem. Please use sensible subjects.) * Jason Yu <go...@gm...> [2006-04-03]: > I want to tell you another problem (I don't know it's my problem or the > program's). > In the db.sql file > --------------------------------------------- > CREATE TABLE "structure" ( > catid INT NOT NULL DEFAULT '0' PRIMARY KEY, > topic VARCHAR(1024) NOT NULL, /// Notice this line > title VARCHAR(1024), > description VARCHAR(8192), > lastupdate TIMESTAMP, > count INT DEFAULT '-1', > totalcount INT DEFAULT '-1' > ); > -------------------------------------------- > but in mysql the topic Field will be changed to text type automaticly. > so when go to : > > CREATE INDEX structure_topic_index ON structure (topic); > > it will be wrong . because text can't be maked to index. I'm using PostgreSQL on all my servers, so I can't really help you with MySQL problems. However, looking quickly at the MySQL documentation, I find You can add an index on a BLOB or TEXT column only if you are using the MyISAM, BDB, or InnoDB storage engine. Quoted from http://dev.mysql.com/doc/refman/5.0/en/create-index.html The file db.sql is not optimized for any DB and hence the storage engine is not given. You can play with this - try using MyISAM for example. Further questions about MySQL should be directed to a MySQL forum or newsgroup - for example http://forums.mysql.com/ http://groups.google.no/group/mailing.database.mysql http://groups.google.no/group/comp.databases Regards, Hans |