Re: [PHP-DB] Read more link with HTML code

2007-05-08 Thread Mike van Hoof

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 .= "";
   }
   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:

The 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?The challengeGbongay, 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./>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.A real leaderWhat 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 engineerin the food 
industry and recently joined NABUUR.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 theNeighbours 
was going to be essential.The Neighbours -- from more than 
ten countries -- were involved at different stages of the project 
depending on their expertise. Somevolunteers helped with general 
tasks, like Internet research, letter writing and contacting 
organisations for information, while others helped with more specific 
assignments that pertained to beekeepingitself./>Quick successGbongay'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 mobilisevolunteers 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!/>Beekeeping todaysrc="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 toensure the future of the beekeeping business. In 
March 2006, everyone began work on the school.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,the first 
customers are buying honey!Bonus"Gbongay has 
been rewarded by nature. It wasgiven the local bee, which is 
extremely prolific, anabundance of bee flora and a favourable 
climatefor beekeeping -- making this initiative a lucrative/>one."Mariama Fawundu, Local Representative



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 

Re: [PHP-DB] Re: Read more link with HTML code

2007-05-08 Thread Mike van Hoof

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: 
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:



Your 200 characters




--
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 (
  

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

2007-05-07 Thread Mike van Hoof

Hello:

EG:

The 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?The challengeGbongay, 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.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.A real leaderWhat 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 engineerin 
the food industry and recently joined NABUUR.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 theNeighbours was going to be essential.The Neighbours -- from more than ten countries -- were involved at different stages of 
the project depending on their expertise. Somevolunteers helped with general tasks, like Internet research, letter writing and contacting organisations for information, while others helped with more specific assignments that pertained to beekeepingitself.Quick successGbongay'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 mobilisevolunteers 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!Beekeeping todayhttp://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 toensure the future of the 
beekeeping business. In March 2006, everyone began work on the school.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,the first customers are buying honey!Bonus"Gbongay has been rewarded by 
nature. It wasgiven the local bee, which is extremely prolific, anabundance of bee flora and a favourable climatefor beekeeping -- making this initiative a lucrativeone."Mariama Fawundu, Local Representative


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 (
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 


[PHP-DB] Read more link with HTML code

2007-05-07 Thread Mike van Hoof

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 ( 
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] weird comparsion

2007-05-03 Thread Mike van Hoof

http://nl3.php.net/manual/en/language.operators.comparison.php

try using === (3x =) for comparison

- Mike

OKi98 schreef:

Hello,

Why does anything compared to 0 return true?

I know it might seem to be a bit off-topic, but for me it is important 
for detecting if NULL value in table has been changed (for example 
NULL is changed to 0).


if ("foo"==0) echo("foo equals to 0");

OKi98



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PHP_AUTH_USER & .htaccess

2007-03-06 Thread Mike van Hoof
This must be set on "On", because in a directory where the .htaccess 
file doesn't exist it works, or can that setting also be set to on?


- Mike

bedul schreef:

- Original Message -----
From: "Mike van Hoof" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, March 06, 2007 3:02 PM
Subject: [PHP-DB] PHP_AUTH_USER & .htaccess


  

Hello,

I've got a really strange problem, and hope this is the right list to
post to.

I got a website with a login, which uses a .htaccess file for
autentication. That part works like a charm. But when i want to read the
loggin details with PHP, the variable $_SERVER['|PHP_AUTH_USER'] isn't
set (in the directory where i logged into)

when i go a directory back, and view a phpinfo() there i see
|$_SERVER['|PHP_AUTH_USER']|| is set, so i do a phpinfo() in the
directory with the .htaccess and it is gone.

Had anyone ever had experience with this, because i can't find a solution.

- Mike|


i do believe this can only be answer by your webadmin.. since this might not
your local but using web right??
try ask to them are the php_auth_user is set ON

  


[PHP-DB] PHP_AUTH_USER & .htaccess

2007-03-06 Thread Mike van Hoof

Hello,

I've got a really strange problem, and hope this is the right list to 
post to.


I got a website with a login, which uses a .htaccess file for 
autentication. That part works like a charm. But when i want to read the 
loggin details with PHP, the variable $_SERVER['|PHP_AUTH_USER'] isn't 
set (in the directory where i logged into)


when i go a directory back, and view a phpinfo() there i see 
|$_SERVER['|PHP_AUTH_USER']|| is set, so i do a phpinfo() in the 
directory with the .htaccess and it is gone.


Had anyone ever had experience with this, because i can't find a solution.

- Mike|


Re: [PHP-DB] MYSQL REGEXP question

2007-01-10 Thread Mike van Hoof

That is it almost :)

SELECT 'oer bv b' REGEXP 'b[^v]$|b[^v]\s?';

gives me 0 as a result, while it shoud give me 1, because there is a b 
in there which is not bv.


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



Micah Stevens schreef:


Your code states:

Match: one of the following letters: -,b,|,^,b negative look ahead one 
of these: -,v,$,|,v


Which isn't what you're looking for. Remember the negating '^' only 
works at the start of a [] list. And '$' only means line-end if it's 
outside [], inside it stands for the '$' character.


I think this would work better:


b[^v]$|b[^v]\s?

HTH,
-Micah

[EMAIL PROTECTED] wrote:

Hello,

i am try to make a regular expression work, but keep getting an error 
message

does anyone know how i can make it work?
The query is:

SELECT 'boer bv' REGEXP '[ b|^b](?![v$|v ])';

So it has to match each starting 'b' and all the b's pf following 
words. But now followed by a v(line end) or a v followed by a space.


so it should match:

'b test'
'test b'
'test b bv'
'bv b test'

and NOT

'test bv'
'bv test'

Any idea's?!

Thanks, mike

  



AdmID:FB05127CFE0569CA76887DED108E0F2F



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use 
of this communication or the information in it is strictly 
prohibited. Piranha Studios Limited asserts its rights in this 
communication and the information in it and reserves the right to 
take action against anyone who misuses it or the information in it.


Piranha Studios Limited cannot accept any liability sustained as a 
result of software viruses and would recommend that you carry out your

own virus checks before opening any attachment.


<<<>>>
  





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MYSQL REGEXP question

2007-01-08 Thread Mike van Hoof

Hello,

i am try to make a regular expression work, but keep getting an error 
message

does anyone know how i can make it work?
The query is:

SELECT 'boer bv' REGEXP '[ b|^b](?![v$|v ])';

So it has to match each starting 'b' and all the b's pf following words. 
But now followed by a v(line end) or a v followed by a space.


so it should match:

'b test'
'test b'
'test b bv'
'bv b test'

and NOT

'test bv'
'bv test'

Any idea's?!

Thanks, mike

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php