Re: [PHP-DB] Re: Read more link with HTML code
i prefer u use the prefix.. but it very advance.. can u spesific more.. client able to type what tag (u must consider lock other than what u type earlier) anyway.. using a table is a good idea.. actualy if your client type using table.. what should u do?? - Original Message - From: itoctopus [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Tuesday, May 08, 2007 7:26 AM Subject: [PHP-DB] Re: Read more link with HTML code Put your 200 characters in a table block: table tr td Your 200 characters /td /tr /table -- itoctopus - http://www.itoctopus.com Mike van Hoof [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello list, I got a problem with displaying content in a read more block which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (bui etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. somebody got a solution ? Thanks for reading. Mike -- Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL ERRORS
Chetan Graham wrote: Hi to All, I am having problems with the MySQL DB. It started with this command from a call in a PHP script... INSERT INTO docprouser (id,valid,password)VALUES ('user5','Y',md5('ksobhinyai')); or die(mysql_error()); That doesn't do anything (it will create a parse error). You need to: mysql_query(INSERT INTO docprouser (id,valid,password) VALUES( 'user5','Y',md5('ksobhinyai'))) or die(mysql_error()); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Read more link with HTML code
Hello: EG: iThe community of Gbongay, Sierra Leone, suffered greatly after the country's civil war, and had aspirations of starting a beekeeping operation to improve their situation. That's when they turned to NABUUR for assistance. But with Neighbours living all over the world and a Facilitator with no knowledge of bees, could this dream ever become a reality?/ibr /br /bThe challenge/bbr /Gbongay, a rural village situated in southeast Sierra Leone, lost everything after the civil war -- the school and hospital were destroyed, and its inhabitants no longer had access to safe water. To try to overcome this tragedy, the community decided it needed to raise money, which could be used to create a small, sustainable business.br /br /Beekeeping seemed to be a promising option, since it required only a small investment and had the potential for a high return -- and the proof was in the neighbouring village, which already had a successful honey business.br /br /bA real leader/bbr /What really got this project started was the project's Facilitator, Raul Alberto Caceres. Born in Colombia, Raul moved to Australia for a post-graduate programme. He now works as a chemical engineerbr /in the food industry and recently joined NABUUR.br /br /As the leader of the beekeeping project, Raul designed a detailed plan. He knew they needed to research as much as possible about starting and running a beekeeping operation, and that the assistance of thebr /Neighbours was going to be essential.br /br /The Neighbours -- from more than ten countries -- were involved at different stages of the project depending on their expertise. Somebr /volunteers helped with general tasks, like Internet research, letter writing and contacting organisations for information, while others helped with more specific assignments that pertained to beekeepingbr /itself.br /br /bQuick success/bbr /Gbongay's beekeeping operation progressed quickly -- and it couldn't have been done without Raul's impressive leadership abilities. He showed enthusiasm on the website and was able to mobilisebr /volunteers all over the world, including Turkey, Ghana, Canada and the Netherlands. Because NABUUR volunteers often never have the chance to meet in person, it's essential that a project's Facilitator be an organised and enthusiastic leader. Fortunately for the community of Gbongay, Raul was just that!br /br /bBeekeeping today/bbr /img src=http://www.nabuur.com/uploads/img_4512900141172.jpg; align=right hspace=15 alt= /The beekeeping operation in Gbongay has further expanded and now includes a beekeeping school. After some research, the Neighbours and local community decided this would be a great way tobr /ensure the future of the beekeeping business. In March 2006, everyone began work on the school.br /br /Today, things are looking better for the village of Gbongay. The community's first water pump has been installed, the first 35 beekeepers have graduated from the new school -- and, best of all,br /the first customers are buying honey!br /br /bBonus/bbr /Gbongay has been rewarded by nature. It wasbr /given the local bee, which is extremely prolific, anbr /abundance of bee flora and a favourable climatebr /for beekeeping -- making this initiative a lucrativebr /one.br /br /Mariama Fawundu, Local Representativebr /br / With kind regards Mike Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat Rafael Costa Pimenta schreef: could you show some example? 2007/5/7, Mike van Hoof [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Hello list, I got a problem with displaying content in a read more block which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (bui etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. somebody got a solution ? Thanks for reading. Mike -- Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl http://www.medusa.nl mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Atenciosamente, Rafael C. Pimenta Programador - CTT Integration Group
Re: [PHP-DB] Re: Read more link with HTML code
Hey, a client can type anything in the field, so all kind of HTML tags can be inserted... - Mike Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat bedul schreef: i prefer u use the prefix.. but it very advance.. can u spesific more.. client able to type what tag (u must consider lock other than what u type earlier) anyway.. using a table is a good idea.. actualy if your client type using table.. what should u do?? - Original Message - From: itoctopus [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Tuesday, May 08, 2007 7:26 AM Subject: [PHP-DB] Re: Read more link with HTML code Put your 200 characters in a table block: table tr td Your 200 characters /td /tr /table -- itoctopus - http://www.itoctopus.com Mike van Hoof [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello list, I got a problem with displaying content in a read more block which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (bui etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. somebody got a solution ? Thanks for reading. Mike -- Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Read more link with HTML code
Mike van Hoof wrote: Hello list, I got a problem with displaying content in a read more block which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (bui etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. You could try using http://php.net/substr_count and do something like: $tags = array('b', 'i', 'u'); foreach ($tags as $p = $tag) { $count = substr_count($string, $tag); if ($count % 2 != 0) { echo Found a mismatch for tag . htmlentities($tag) . br/; } } Not a great solution because you're hardcoding the tags you're looking for but there aren't that many that change text appearances like these do (but then again this method won't work for span or div tags because you can place styles inside those tags) Unless you want to get into regex'es -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Read more link with HTML code
Chris wrote: Mike van Hoof wrote: Hello list, I got a problem with displaying content in a read more block which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (bui etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. You could try using http://php.net/substr_count and do something like: $tags = array('b', 'i', 'u'); foreach ($tags as $p = $tag) { $count = substr_count($string, $tag); if ($count % 2 != 0) { echo Found a mismatch for tag . htmlentities($tag) . br/; } } Not a great solution because you're hardcoding the tags you're looking for but there aren't that many that change text appearances like these do (but then again this method won't work for span or div tags because you can place styles inside those tags) Unless you want to get into regex'es Actually that's not going to work at all. You'd have to do something like: $open_tags = array('b', 'i', 'u'); $close_tags = array('/b', '/i', '/u'); foreach ($open_tags as $p = $tag) { $open_count = substr_count($string, $tag); $close_count = substr_count($string, $close_tags[$p]); if ($open_count != $close_count) { echo Mismatch for tag . htmlentities($tag) . br/; } } -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Read more link with HTML code
Hey, thanks for the help everyone, but after reading all the answers i decided to do some regexp thingies. Came up with this: function readMore_closedtags($text, $length) { preg_match_all('/(.*?)/s',substr(stripslashes($text), 0, $length),$out); foreach($out[1] as $key2 = $val2){ if( !preg_match(/br.*/, $val2) !empty($val2) ){ $val2_arr = explode( , $val2); $val2 = $val2_arr[0]; if(preg_match(/^\//, $val2)) $html_arr_close[] = strtolower($val2); else $html_arr_open[] = strtolower($val2); } } $not_closed_tags = array(); foreach($html_arr_open as $tag){ $key = array_search(/ . $tag, $html_arr_close); if($key !== false){ unset($html_arr_close[$key]); } else { $not_closed_tags[] = $tag; } } $closed_tags_str = ''; foreach($not_closed_tags as $tag){ $closed_tags_str .= / . $tag . ; } return $closed_tags_str; } Mike Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat Mike van Hoof schreef: Hello: EG: iThe community of Gbongay, Sierra Leone, suffered greatly after the country's civil war, and had aspirations of starting a beekeeping operation to improve their situation. That's when they turned to NABUUR for assistance. But with Neighbours living all over the world and a Facilitator with no knowledge of bees, could this dream ever become a reality?/ibr /br /bThe challenge/bbr /Gbongay, a rural village situated in southeast Sierra Leone, lost everything after the civil war -- the school and hospital were destroyed, and its inhabitants no longer had access to safe water. To try to overcome this tragedy, the community decided it needed to raise money, which could be used to create a small, sustainable business.br /br /Beekeeping seemed to be a promising option, since it required only a small investment and had the potential for a high return -- and the proof was in the neighbouring village, which already had a successful honey business.br /br /bA real leader/bbr /What really got this project started was the project's Facilitator, Raul Alberto Caceres. Born in Colombia, Raul moved to Australia for a post-graduate programme. He now works as a chemical engineerbr /in the food industry and recently joined NABUUR.br /br /As the leader of the beekeeping project, Raul designed a detailed plan. He knew they needed to research as much as possible about starting and running a beekeeping operation, and that the assistance of thebr /Neighbours was going to be essential.br /br /The Neighbours -- from more than ten countries -- were involved at different stages of the project depending on their expertise. Somebr /volunteers helped with general tasks, like Internet research, letter writing and contacting organisations for information, while others helped with more specific assignments that pertained to beekeepingbr /itself.br /br /bQuick success/bbr /Gbongay's beekeeping operation progressed quickly -- and it couldn't have been done without Raul's impressive leadership abilities. He showed enthusiasm on the website and was able to mobilisebr /volunteers all over the world, including Turkey, Ghana, Canada and the Netherlands. Because NABUUR volunteers often never have the chance to meet in person, it's essential that a project's Facilitator be an organised and enthusiastic leader. Fortunately for the community of Gbongay, Raul was just that!br /br /bBeekeeping today/bbr /img src=http://www.nabuur.com/uploads/img_4512900141172.jpg; align=right hspace=15 alt= /The beekeeping operation in Gbongay has further expanded and now includes a beekeeping school. After some research, the Neighbours and local community decided this would be a great way tobr /ensure the future of the beekeeping business. In March 2006, everyone began work on the school.br /br /Today, things are looking better for the village of Gbongay. The community's first water pump has been installed, the first 35 beekeepers have graduated from the new school -- and, best of all,br /the first customers are buying honey!br /br /bBonus/bbr /Gbongay has been rewarded by nature. It wasbr /given the local bee, which is extremely prolific, anbr /abundance of bee flora and a favourable climatebr /for beekeeping -- making this initiative a lucrativebr /one.br /br /Mariama Fawundu, Local Representativebr /br / With kind regards Mike Medusa, Media Usage Advice B.V. Science Park Eindhoven 5216 5692 EG SON tel: 040-24 57 024 fax: 040-29 63 567 url: www.medusa.nl mail: [EMAIL PROTECTED] Uw bedrijf voor Multimedia op Maat Rafael Costa Pimenta
[PHP-DB] Re: MySQL5037srv//PHP522//WIN2KSP4//IISV5//***MySQL ERRORS
Thanks for everyone's indulgence, I figured out the problem. simple syntax around the INSERT as follows with the mysql_query. mysql_query(INSERT INTO docprouser (id,valid,password VALUES('root','y',md5('ksobhinyai'))); Blessings, Chetan I am having problems with the MySQL DB. It started with this command from a call in a PHP script... INSERT INTO docprouser (id,valid,password)VALUES ('user5','Y',md5('ksobhinyai')); or die(mysql_error()); The script actually connects with the DB fine and no errors at all. You can see the screen output in the attatched text file. However, there is no new entry in DB. Upon looking at the error log for the specified time I get: **Query Execute Thread cannot connect to MySQL ** However, if I cut/paste the above into the query window of GUI it executes just fine, and shows the record written. I've dnloaded the latest OBDC connector and set up correctly. I've googled the MySQL errors to no avail. TCP/IP is active on pc. The tables were even created with this script. I'm beyond frustrated, as two days now have been stuck with this DB problem. I just spent the last five or six hours deleting the DB off the server and reloading it several times which cleared up several previous problems. Now, it comes down to this one. Any help would be appreciated. Blessings, Chetan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php