OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 25 Jul 2004 20:34:43 -0000 Issue 2898

php-general-digest-helplists.php.net
Date: Sun Jul 25 2004 - 15:34:43 CDT


php-general Digest 25 Jul 2004 20:34:43 -0000 Issue 2898

Topics (messages 191807 through 191836):

Re: How to get all links from a webpage?
        191807 by: Jason Barnett
        191828 by: Jason Wong

Re: Disk serial number
        191808 by: Rosen
        191809 by: Rosen
        191815 by: Tom Rogers

Re: include_path ???
        191810 by: Jason Barnett
        191829 by: Jason Wong

Re: DOMXML support should be added to PHP5
        191811 by: Scrumpy
        191812 by: Christian Stocker
        191832 by: Scrumpy

Re: If...Or...Else
        191813 by: rush

Re: Learning Regex
        191814 by: PHP Gen

PHP - mySQL query question
        191816 by: Karl-Heinz Schulz
        191817 by: John W. Holmes
        191825 by: Jason Davidson

Embedding JavaScript into a PHP generated web page
        191818 by: Robert Frame
        191819 by: Torsten Roehr
        191820 by: Ash Young
        191821 by: Manuel Lemos
        191824 by: Jason Davidson

Can't find the rest of the this article? [HAB]
        191822 by: EE

Refer a class
        191823 by: Michael Ochs
        191826 by: Jason Davidson
        191827 by: Michael Ochs

Question about for
        191830 by: Henri Marc
        191831 by: Ash Young
        191835 by: Miroslav Hudak (php/ml)

Re: PHP Web Mail
        191833 by: robert mena

class help (PLEASE)
        191834 by: PHP Gen

Re: Code elegance and cleanliness
        191836 by: Al

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Wudi wrote:
> This script can replace links:
> $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $text);
> But it cannot get the links.

Magic 8-ball says... go read ereg() in your manual.

attached mail follows:


On Sunday 25 July 2004 13:14, Wudi wrote:

Please do not top post.

> This script can replace links:
> $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a
> href=\"\\0\">\\0</a>", $text); But it cannot get the links.

I repeat:

> > Hmmm it needs to be able to *find* the links before it can replace them.
> > Just borrow the code that finds the links.

The "get" links part, the bit which you're interested in, is the regex. So
just plug the regex into ereg() or for this application eregi() may be more
useful.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Hurewitz's Memory Principle:
        The chance of forgetting something is directly proportional
        to... to... uh.....
*/

attached mail follows:


This didn't work :(
Apache crashes after execution of script.

"Tom Rogers" <trogerskwikin.com> wrote in message
news:967452889.20040723230552kwikin.com...
> Hi,
>
> Friday, July 23, 2004, 8:08:22 PM, you wrote:
> R> I receive an error:
>
> R> "Warning: dl(): Not supported in multithreaded Web servers - use
extension
> R> statements in your php.ini "
>
>
> You need to add
>
> extension=php_w32api.dll
>
> to your php.ini and restart the web server
>
> --
> regards,
> Tom

attached mail follows:


 This didn't work :(
 Apache crashes after execution of script on this row:

$api->registerfunction("long GetLastError
Alias GetError ()
From kernel32.dll");

>
> "Tom Rogers" <trogerskwikin.com> wrote in message
> news:967452889.20040723230552kwikin.com...
> > Hi,
> >
> > Friday, July 23, 2004, 8:08:22 PM, you wrote:
> > R> I receive an error:
> >
> > R> "Warning: dl(): Not supported in multithreaded Web servers - use
> extension
> > R> statements in your php.ini "
> >
> >
> > You need to add
> >
> > extension=php_w32api.dll
> >
> > to your php.ini and restart the web server
> >
> > --
> > regards,
> > Tom

attached mail follows:


Hi,

Sunday, July 25, 2004, 9:48:20 PM, you wrote:
R> This didn't work :(
R> Apache crashes after execution of script.

Yes it does that ...you can download a working version here

http://fred.kwikin.com/php_w32api.dll

--
regards,
Tom

attached mail follows:


Lester Caine wrote:

> D_angle wrote:
>
>> This is taken right out of the download of PHP 5 zip file
>> "php-5.0.0-Win32.zip". Opening the "php.ini-recommended" it states the
>> following configuration

php.ini-recommended is probably not the one being used... if you want to use
this you most likely just need to strip of the -recommended from the file name.
  PHP does this because you could be using this in production vs. development.

Magic 8-ball says:
!!!Search your hard drive for php.ini!!!

>
>
> What is in the php.ini in your windows directory?
> THAT is the copy that PHP is using.
> ( Is there something missing in the install notes - this is the second
> time I've had to mention where the php.ini is located ;) )
>

php.ini can actually be located in a number of places. I keep mine located in
the same directory as my apache.conf file, some put theirs into the system32
folder, some keep it with the CGI binary. There's a specific ordering to where
PHP looks first, etc. and that could make a difference if you have several ini
files scattered about. So for instance when I upgraded from 4.3.7 to 5.0 I just
added a few lines to my already-existent php.ini file.

attached mail follows:


On Sunday 25 July 2004 19:54, Jason Barnett wrote:

> Magic 8-ball says:
> !!!Search your hard drive for php.ini!!!

The definitive way to find out where PHP is expecting its php.ini file is to
use phpinfo() -- no need for 8-balls, magic or otherwise :)

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Do not use that foreign word "ideals". We have that excellent native
word "lies".
                -- Henrik Ibsen, "The Wild Duck"
*/

attached mail follows:


jasbarneindiana.edu (Jason Barnett) wrote in
news:20040724003530.27087.qmailpb1.pair.com:

> Well you are right that if
> you used the old DOMXML functions in PHP4 that there is no clean way
> to move that code forward without rewriting / supporting two
> infrastructures. I'm not a core developer but my guess is that they
> didn't mind dropping the support completely because in PHP4 it was all
> tagged as "experimental".

Looking at the two approaches, I preferred using DOMXML and as it was based
on libxml2 & libxslt it seemed to be the better option.

Clearly I've learn't my lesson never to use anything tagged as experimental
again unless I'm highly competent with that language and if necessary, be
willing and able to code everything myself.

> It's unfortunate for you, but I think making the change now makes
> sense because of the new DOM / SimpleXML support.

To a 'certain' extent the timing of the change is out of my hands as, like
the majority of users, my website is hosted on a shared web server whose
settings are out of my control.

> Perhaps another solution: create a class and call it DomDocument4_3_8
> or something that mimics the method calls / properties of the new
> DomDocument class. Contact me off list if you need help with this.

Thanks for your offer of help.

Due to my current level of familiarity with PHP, the option best suited to
me is the second workaround I mentioned in my earlier post i.e. to create
PHP5 DOM versions of my scripts and a PHP version checking script that also
then runs either my PHP4 DOMXML or PHP5 DOM scripts.

In order to learn PHP5's DOM function and develop replacement scripts, I'll
have to find out how I can run both PHP4 & 5 interpreters with Apache on my
PC. I have some ideas about how I can manage that ;-)

I don't have a broad knowledge of PHP yet. Up until now I narrowly focused
on only what I needed to learn to be able to build something specific. That
helped me to build a basic website templating system using XSLT but the
vulnerabilities of that narrow approach are now all too obvious.

I hope in the future that other relatively inexperienced PHP users don't
have to face this same situation.

In the future a transitional approach in PHP to replacing any function
should be implemented. IMO, that is part of good project/life-cycle
management.

My hope for the future is that PHP remains accessible and attractive to new
users. It could be all too easy for the core PHP 'guru' developers to
become blase about this aspect of the language.

Cheers,
Scrumpy :)

attached mail follows:


On 25 Jul 2004 12:34:15 -0000, Scrumpy <libogenhotmail.com> wrote:
> jasbarneindiana.edu (Jason Barnett) wrote in
> news:20040724003530.27087.qmailpb1.pair.com:
>
> > Well you are right that if
> > you used the old DOMXML functions in PHP4 that there is no clean way
> > to move that code forward without rewriting / supporting two
> > infrastructures. I'm not a core developer but my guess is that they
> > didn't mind dropping the support completely because in PHP4 it was all
> > tagged as "experimental".
>
> Looking at the two approaches, I preferred using DOMXML and as it was based
> on libxml2 & libxslt it seemed to be the better option.

I don't get that. The new DOM and XSL extension is still based on
libxml2 and libxslt. Actually, the whole XML support in PHP 5 is now
based on libxml2 (meaning SimpleXML, ext/xml et al. as well)

> Clearly I've learn't my lesson never to use anything tagged as experimental
> again unless I'm highly competent with that language and if necessary, be
> willing and able to code everything myself.

Transitioning from DOMXML/PHP4 to DOM/PHP5 isn't really that
complicated. You have to change some methods and most if it can be
done with find&replace (for example create_element() to
createElement() ). Some functions are not anymore available in DOM, so
you have to invest a little bit more, but the logic of you're whole
application doesn't have to be changed (one such example is
new_child(), which has to be replaced with createElement/appendChild).

I agree that writing code, which should work on PHP4 and PHP 5 is a
little bit more complicated, but feasible as well (see
http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ for a start
(reposting this link, because I think the first message by me to this
topic didn't made it to the lists..))

> > It's unfortunate for you, but I think making the change now makes
> > sense because of the new DOM / SimpleXML support.
>
> To a 'certain' extent the timing of the change is out of my hands as, like
> the majority of users, my website is hosted on a shared web server whose
> settings are out of my control.

But he will inform you some time in advance, right? ;)

[...]
>
> In the future a transitional approach in PHP to replacing any function
> should be implemented. IMO, that is part of good project/life-cycle
> management.

It's usually the approach of PHP, but due to the chaotic and
nonstandard API of DOMXML/PHP4, it was decided to make a clear cut and
not invest any time in that, but instead really concentrate on
DOM/PHP5.
Furthermore it was marked (as you realized) experimental, so "we" warned you ;)

It won't happen again. DOM/PHP5 follows the standards established by
the W3C, so there's no reason to break backwards compatibility
again... And it's not marked as experimental anymore.

>
> My hope for the future is that PHP remains accessible and attractive to new
> users. It could be all too easy for the core PHP 'guru' developers to
> become blase about this aspect of the language.

Drop your "guru" conspiracy, please ;)
The PHP core team is usually very concerned about BC (backwards
compatibility) and as you maybe realized, 99% of PHP 4 scripts run on
PHP 5 without any problems at all. The one big exception is DOMXML,
for the reasons stated above.

chregu

>
> Cheers,
> Scrumpy :)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB

attached mail follows:


chregugmail.com (Christian Stocker) wrote in
news:49373ab7040725061332ffa0b1mail.gmail.com:

>> Looking at the two approaches, I preferred using DOMXML and as it was
>> based on libxml2 & libxslt it seemed to be the better option.
>
> I don't get that. The new DOM and XSL extension is still based on
> libxml2 and libxslt. Actually, the whole XML support in PHP 5 is now
> based on libxml2 (meaning SimpleXML, ext/xml et al. as well)

The two *PHP4* approaches, the other being Expat + Sablotron.

> Transitioning from DOMXML/PHP4 to DOM/PHP5 isn't really that
> complicated.
[snip]
> I agree that writing code, which should work on PHP4 and PHP 5 is a
> little bit more complicated

A "little bit more complicated" than "isn't really that complicated"!

Translating function calls isn't something my current level of PHP can
readily handle (although I'll work on improving that for the future).
That's why I mentioned that the approach BEST suited to MY current
abilities is to have my existing PHP4 DOMXML scripts and new PHP5 DOM
scripts selected by a PHP version 'sensing' script.

> (see http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/

Thank you. I had seen that but it covers only some of DOMXML's XML
functions and none of it's XSLT functions.

Of course it's good that Alexandre has published his code and it should be
of help in the future when I'm learning how to translate function calls.

>> To a 'certain' extent the timing of the change is out of my hands as,
>> like the majority of users, my website is hosted on a shared web
>> server whose settings are out of my control.
>
> But he will inform you some time in advance, right? ;)

Of course! Again, the point is that PHP4 DOMXML scripts will fail on
webhosts' servers when they replace PHP4 with PHP5, unless a workaround has
been put in place by each website's maintainer.

> Furthermore it was marked (as you realized) experimental, so "we"
> warned you ;)

I accept that based on my level of knowledge of PHP, I made a mistake in
using an experimental function and didn't sufficiently heed the warning. At
the time I had naively thought that as DOMXML used the same libraries that
were going to be used in PHP5's XML/XSLT support, that my code would also
work in the future PHP5.

My background is not in programming as you might have realised :)

>> My hope for the future is that PHP remains accessible and attractive
>> to new users. It could be all too easy for the core PHP 'guru'
>> developers to become blase about this aspect of the language.
>
> Drop your "guru" conspiracy, please ;)

"Guru" is used to highlight that the core developers must be experts.

It's possible that as their level of expertise grows, PHP's complexity
increases, resulting in a more difficult learning curve for beginners and
that this is something to guard against.

Cheers,
Scrumpy :)

attached mail follows:


"Jason Davidson" <jason.davidsongmail.com> wrote in message
news:6c925ae204072412386fa9cefamail.gmail.com...
> ah right.. :)
> Jason

OR has a very low priority , and right argument is not evaluated if left one
is true. In other words OR is here so that you could in pre exception
handling days easily write something like this:

mysql_query(...) OR die;

so as long mysql_query returns non false result , everything is fine and
script continues, if it returns 0 (false), script dies.

rush
--
http://www.templatetamer.com/

attached mail follows:


> This helped me get started with Perl-compatible
> regular expressions:
>
> http://www.weitz.de/regex-coach/
>

Thanks Jason, will try it immd.
Cheers,
Mag.

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

                
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

attached mail follows:


I have a simple question (not for me).

Why does this query does not work?

        $links_query = mysql_query("select id, inserted, title, information,
international from links WHERE international = y; order by inserted desc
LIMIT 0 , 30");

The information for the "international" fields are:

Field: international
Type: char(1)
Null: No
Default:n

The error is -> Warning: mysql_fetch_row(): supplied argument is not a valid
MySQL result resource in

TIA

Tracking #: BC19379918870340BDA57FD3E349C2D0B4B484BC

attached mail follows:


Karl-Heinz Schulz wrote:

> I have a simple question (not for me).
>
> Why does this query does not work?
>
> $links_query = mysql_query("select id, inserted, title, information,
> international from links WHERE international = y; order by inserted desc
> LIMIT 0 , 30");
>
> The information for the "international" fields are:
>
> Field: international
> Type: char(1)
> Null: No
> Default:n
>
> The error is -> Warning: mysql_fetch_row(): supplied argument is not a valid
> MySQL result resource in

Your query has failed. You'd know this if you checked mysql_error()
after running your query.

$result = mysql_query(...) or die(mysql_error())

Your query fails because you need quotes around the "y" and you need to
remove the semi-colon.

$links_query = mysql_query("select id, inserted, title, information,
international from links WHERE international = 'y' order by inserted
desc LIMIT 0 , 30") or die(mysql_error());

Also, why are you selecting the international column when you're
filtering the results to rows that have "y" for international. You
already know what international is, why select it in your query?

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


single quote 'y'

Jason

On Sun, 25 Jul 2004 11:05:23 -0400, Karl-Heinz Schulz
<karlheinzkhschulz.com> wrote:
> I have a simple question (not for me).
>
> Why does this query does not work?
>
> $links_query = mysql_query("select id, inserted, title, information,
> international from links WHERE international = y; order by inserted desc
> LIMIT 0 , 30");
>
> The information for the "international" fields are:
>
> Field: international
> Type: char(1)
> Null: No
> Default:n
>
> The error is -> Warning: mysql_fetch_row(): supplied argument is not a valid
> MySQL result resource in
>
> TIA
>
> Tracking #: BC19379918870340BDA57FD3E349C2D0B4B484BC
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hi There,

I have a web page with a form that is generated by PHP, and part of my
design utilizes JavaScript to provide some error checking within the objects
in the form. I have written the javascript in an html document, but I am
having trouble blending the two together.

I have tried sending the javascript within an echo statement, as well as
using straight HTML/JavaScript code, but nothing seems to work.

Can anyone offer some help or direct me to a solution?

Thanks,
Rob

attached mail follows:


"Robert Frame" <Robert_M_Frameverizon.net> wrote in message
news:20040725153214.12854.qmailpb1.pair.com...
> Hi There,
>
> I have a web page with a form that is generated by PHP, and part of my
> design utilizes JavaScript to provide some error checking within the
objects
> in the form. I have written the javascript in an html document, but I am
> having trouble blending the two together.
>
> I have tried sending the javascript within an echo statement, as well as
> using straight HTML/JavaScript code, but nothing seems to work.
>
> Can anyone offer some help or direct me to a solution?
>
> Thanks,
> Rob

Hi Rob,

usually it works by just putting plain JS/HTML into the page outside of the
php code sections. But without seeing any code we cannot help you.

Regards, Torsten Roehr

attached mail follows:


Are you getting any error message at all or is the JavaScript just failing?

If your receiving a PHP error, are you sure you've escaped all the quotes in
the JavaScript?

--
ash young :: http://evoluted.net/

attached mail follows:


Hello,

On 07/25/2004 12:05 PM, Robert Frame wrote:
> I have a web page with a form that is generated by PHP, and part of my
> design utilizes JavaScript to provide some error checking within the objects
> in the form. I have written the javascript in an html document, but I am
> having trouble blending the two together.
>
> I have tried sending the javascript within an echo statement, as well as
> using straight HTML/JavaScript code, but nothing seems to work.
>
> Can anyone offer some help or direct me to a solution?

Usually, the Javascript must be within <script> tags inside HTML comments.

You may want to take a look at this forms generation and validation
class that is meant for performing client and server side forms
validation. It generates Javascript to perform the client side
validation as you want.

http://www.phpclasses.org/formsgeneration

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

attached mail follows:


Hey, keep trying, you can use php to generate JS to send to the
browser, its especially usefull for form validation as you said. Make
sure your JS is correct, and within script tags. Start with simple
JS, like, alert("i worked"); then start adding one piece at a time
and constantly checking to see if its still working.

JAson

On Sun, 25 Jul 2004 08:05:07 -0700, Robert Frame
<robert_m_frameverizon.net> wrote:
> Hi There,
>
> I have a web page with a form that is generated by PHP, and part of my
> design utilizes JavaScript to provide some error checking within the objects
> in the form. I have written the javascript in an html document, but I am
> having trouble blending the two together.
>
> I have tried sending the javascript within an echo statement, as well as
> using straight HTML/JavaScript code, but nothing seems to work.
>
> Can anyone offer some help or direct me to a solution?
>
> Thanks,
> Rob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Dears,

Can anyone tell me where can I find the rest of this artilce i.e. parts
2-6:

Building a Members Area with PHP - Part 1 of 6 -- By Ben Rowe

I tried to search/google for it on the net with but with no help. I went
to the site that where I got part 1 of 6 but with no help?

Plz help.

attached mail follows:


Hi,
I try to load some 'modules' into my class. These modules are other classes.
I want to refer the main class to this new module but that doesn't work. At
the moment it looks like this:

Mainclass:

function loadModule($name) {
    if(class_exists($name)) { //Class found
        if(!$this->module[$name]) {
            $this->module[$name] = new $name(&$this);
        }
        return true;
    } else {
        return false;
    }
}

The mainfunktion of the module:

function module_artikelvote(&$parent) {
    $this->main = &$parent;
    return true;
}

I can use $this->main->VARIABLE but the values are old. If I call a function
with $this->main->func_name(); it doesn't work, but there also isn't an
error message!

What's wrong with these functions?

Thanks for help, Michael

attached mail follows:


If there is no error, check the values of all the vars and array
ellements in your logic for the first method. Make sure its actually
getting to the point where it instantiates the new object.

Jason

On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <michael.ochsgmx.net> wrote:
> Hi,
> I try to load some 'modules' into my class. These modules are other classes.
> I want to refer the main class to this new module but that doesn't work. At
> the moment it looks like this:
>
> Mainclass:
>
> function loadModule($name) {
> if(class_exists($name)) { //Class found
> if(!$this->module[$name]) {
> $this->module[$name] = new $name(&$this);
> }
> return true;
> } else {
> return false;
> }
> }
>
> The mainfunktion of the module:
>
> function module_artikelvote(&$parent) {
> $this->main = &$parent;
> return true;
> }
>
> I can use $this->main->VARIABLE but the values are old. If I call a function
> with $this->main->func_name(); it doesn't work, but there also isn't an
> error message!
>
> What's wrong with these functions?
>
> Thanks for help, Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I can call $myclass->module['mymodule']->variable; so I think the class is
instantiate correctly. But the reference doesn't seem to work, cause the
variable I get ist always the same:

$myclass->nickname = "xyz";
$class2 = $myclass->loadModule("mysecondclass");
$myclass->nickname = "abc";

Now, when I call $this->main->nickname in $class2, wich actually should call
$myclass, it returns "xyz" instead of "abc"!

Any idea?

Thanks, Michael

"Jason Davidson" <jason.davidsongmail.com> schrieb im Newsbeitrag
news:6c925ae204072510516d870312mail.gmail.com...
> If there is no error, check the values of all the vars and array
> ellements in your logic for the first method. Make sure its actually
> getting to the point where it instantiates the new object.
>
> Jason
>
> On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <michael.ochsgmx.net>
wrote:
> > Hi,
> > I try to load some 'modules' into my class. These modules are other
classes.
> > I want to refer the main class to this new module but that doesn't work.
At
> > the moment it looks like this:
> >
> > Mainclass:
> >
> > function loadModule($name) {
> > if(class_exists($name)) { //Class found
> > if(!$this->module[$name]) {
> > $this->module[$name] = new $name(&$this);
> > }
> > return true;
> > } else {
> > return false;
> > }
> > }
> >
> > The mainfunktion of the module:
> >
> > function module_artikelvote(&$parent) {
> > $this->main = &$parent;
> > return true;
> > }
> >
> > I can use $this->main->VARIABLE but the values are old. If I call a
function
> > with $this->main->func_name(); it doesn't work, but there also isn't an
> > error message!
> >
> > What's wrong with these functions?
> >
> > Thanks for help, Michael
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

attached mail follows:


Hello,

I woudlike to use a loop:

for ($i=1;$i<11;$i++)

But instead of incrementing with 1, I would like to
increment by 2. So $i would be 1,3,5,7,9. I tried to
find the answer may be with "step" but couldn't find
anything.

Thank you for your help.

Dave

        

        
                
Vous manquez d’espace pour stocker vos mails ?
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

attached mail follows:


You could try

for ($i=1;$i<11;$i=$i+2)

--
ash young :: http://evoluted.net/

attached mail follows:


<?php
     for ($x = 0; $x < 10; $x += 2)
         echo $x.',';
?>

m.

Henri Marc wrote:
> Hello,
>
> I woudlike to use a loop:
>
> for ($i=1;$i<11;$i++)
>
> But instead of incrementing with 1, I would like to
> increment by 2. So $i would be 1,3,5,7,9. I tried to
> find the answer may be with "step" but couldn't find
> anything.
>
> Thank you for your help.
>
> Dave
>
>
>
>
>
>
> Vous manquez d’espace pour stocker vos mails ?
> Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
> Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com
>

--
Miroslav Hudak
developer & designer
http://hudak.info

attached mail follows:


Yeah, but it is slow as hell. webmiau in the other way is fast

On Mon, 5 Jul 2004 12:45:33 +0100, webmasterjnsolutions.co.uk
<webmasterjnsolutions.co.uk> wrote:
> Try www.horde.org
>
> It's not only a webmail client, but has a whole load more!
>
> Nunners
>
> Quoting "I.A. Gray" <techselectperformers.com>:
>
> > Thanks- looked at Squirrel Mail. Looks really good, however we use POP3- I
> > don't think Squirrel Mail uses POP3 does it?
> >
> >
> >
> > -----Original Message-----
> > From: Jose Leon [mailto:qadramgmail.com]
> > Sent: 05 July 2004 12:09
> > To: I.A. Gray
> > Cc: php-generallists.php.net
> > Subject: Re: [PHP] PHP Web Mail
> >
> >
> > Hello,
> > > Does anyone know a good PHP-based (free if possible) web mail other than
> > > UebiMiau that they would recommend?
> > Why not Squirrel Mail?
> >
> > http://www.squirrelmail.org
>
>
> >
> > Regards.
> > --
> > qadram :: software development
> > http://www.qadram.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hi,
After searching the archives and google I found a
class that does bb code conversions, although I know
how to use classes (thanks to the docs the writers
write) I dont really understand them too well.

The class is REALLY good and covers all my needs
(which is to display php code in colors) but
unfortunatly if there is no carrage return in the text
it screws up my entire table...

eg:
I have a <table width=70%> , after calling this class
if I try to display this:

$result = mysql_query(insert into the_articles
(author, headline, content10, content1, content2,
content3, content4, content5, content6, content7,
content8, content9, date, confirm, pages, link10,
link1, link2, link3, link4, link5, link6, link7,
link8, link9, typeNews) values .....

it expands my table to more than 150% and screws up my
whole page.

If somebody could please just edit the classfile so it
"breaks" long text strings to the next line and does
not screw up my page layout I will be MOST grateful
and sing your praises, plus name my first child after
you (heck, if you're a woman will name my next
girlfriend after you!) :-)

The classfile is below (tried writing to the author
but I dont think he speaks english coz his website's
in Italian I think: http://www.3site.it/)

******************* Class file *******************

<?php
/**
* TEXT HTML's TAGS EMULATOR
* Compatibility: PHP >= 4.1
* Page Example:
http://www.3site.it/varie/codeLighter/index.php
*
---------------------------------------------------------------------
* LAST FIXED: multiple URL inline, increase speed
convertion, adjusted code, color and list tags,
unclosed /* comment.
* Totally rewrote and fixed wrap_convert() function
with url/img/mail preservation.
* LAST ADDS: [AS] tag with different highlight
FlashMX like
* you can add one or more personal tags
* LAST CHANGES: IMG now use
[IMG="{url}"]{comment}[/IMG] as quote and url.
* Now [PHP] & [AS] use monospace font on.
* Now are right both [URL="{URL}"] , [URL={URL}]
*
*
---------------------------------------------------------------------
* WHAT IS THIS:
* HTML 4.01 W3C Strict Standard VAlidated tags
emulator with:
* personalizable style sheet
* great [tag] engine
* JavaScript crossbrowser for checks and helps
* automatic form / textarea / buttons generation
*
*
---------------------------------------------------------------------
* HOW TO USE:
* $codeLighter = new codeLighter();
* echo $codeLighter->convert($text_var);
* WARNING: the better way to use this script is give
an htmlentities($text_var);
* so if you haven't converted $text_var you need to do
this.
* Example:
* echo $codeLighter->convert( htmlentities($text_var)
);
*
*
---------------------------------------------------------------------
* WHAT YOU CAN DO WITH THIS:
* Accepted tags: B, U, I, CODE, PHP, AS, QUOTE, LIST,
MAIL, URL, IMG, FONT, SIZE, COLOR, CENTER, RIGHT
* B => [b]{TEXT}[/b]
* U => [u]{TEXT}[/u]
* I => [i]{TEXT}[/i]
* CENTER => [center]{center text}[/center]
* RIGHT => [right]{right text}[/right]
* CODE => [code]{code text}[/code]
* PHP => [php]{php text}[/php]
* ACTIONSCRIPT => [as]{action script text}[/as]
* QUOTE => [quote]{quoted text}[/quote] |
[quote="posted from"]{quoted text}[/quote]
* LIST => [list][*]{TEXT}[/list] |
[list=1][*]{TEXT}[/list]
* type: NULL => default, unordered list
* 1 => numeric ordered list
* [ for alphabetic list write to W3.org ... they
wrote "Safe for kids" with DL sintax ... ]
*
* Example: "[list]
* [*]something
* [*]something else
* [/list]"
* Example: "[list=1]
* [*]something
* [*]something else
* [/list]"
* MAIL => {valid email addres} | [mail]{valid email
addres}[/mail] | [mail={valid email
addres}]{TEXT}[/mail]
* Example: "[mail]andrea3site.it[/mail]"
* Example: "[mail=andrea3site.it]my email[/mail]"
* URL => {valid url addres} | [url]{valid url
addres}[/url] | [url="{valid url addres}"]{TEXT}[/url]
| [url={valid url addres}]{TEXT}[/url]
* Example: "[url]http://www.3site.it/[/url]"
* Example: "[url="http://www.3site.it/"]hello
world![/url]"
* Example: "[url=http://www.3site.it/]hello
world![/url]"
* IMG => [img]{valid url addres with img}[/img] |
[img="{valid url addres with img}"]{ALT/TITLE}[/img] |
[img={WIDTHxHEIGHT}]{valid url addres with img}[/img]
* Example:
"[img]http://www.3site.it/grafica/3site1.gif[/img]"
* Example:
"[img="http://www.3site.it/grafica/3site1.gif"]this is
my site's logo[/img]"
*
* Example:
"[IMG=100x38]http://www.3site.it/grafica/3site1.gif[/IMG]"
* NOTE: you need to auth this last type of parsing
with $codeLighter->imgSize(maxWidth, maxHeight);
function.
* FONT => [font={valid font type}]{TEXT}[/font]
* Example: "[font=courier]hello[/font]
[font=arial]world[/font] !"
*
* SIZE => [size={number between 1 and 9}]{TEXT}[/size]
* Example: "[size=1]hello[/size] [size=9]world[/size]
!"
* COLOR => [color={valid hex value}]{TEXT}[/color] |
[color=#{valid hex value}]{TEXT}[/color] |
[color={valid color name}]{TEXT}[/color]
* Example: "[color=#002255]hello[/color]
[color=red]world[/color] !"
*
*
---------------------------------------------------------------------
* INTERNAL VARIABLES
* $codeLighter->maxUrlLenght;
* This variable set max url length for validated link.
* DEFAULT: 100
* NOTE: you need to set this before ->convert()
function.
*
* TEXTAREA SETTINGS [ optional ]
*
* $codeLighter->textareaButtons;
* This variable will return a buttons list with
text's shortcuts dedicated for a textArea with
id="codeLighterInternalTextarea"
* NOTE: you need to print $codeLighter->jsLighter; to
enable JavaScript buttons functions
* SHORTCUTS: [B] [U] [I] [IMG] [CODE] [PHP]
[URL] [MAIL]
* NOTE: You can specify different buttons with
$codeLighter->area_buttons;
*
* Example:
* echo $codeLighter->jsLighter; // dedicated
JavaScript functions ofr these buttons
* echo $codeLighter->textareaButtons; // buttons
*
* $codeLighter->area_buttons;
* This variable modify buttons at the top of TextArea.
* WARNING: You need to inizialize the textarea with
$codeLighter->createTextareaLighter(); if you 'll not
use automatic form's creator.

* DEFAULT: Array('B', 'U', 'I', 'IMG', 'CENTER',
'CODE', 'PHP', 'AS');
* MAX USAGE: Array('MAIL', 'URL', 'PHP', 'CODE',
'QUOTE', 'IMG', 'LIST', 'B', 'I', 'U', 'CENTER',
'RIGHT', 'AS');
* NOTE: LIST need [*] simbol
*
* Example:
* $codeLighter->area_buttons = Array('PHP', 'CODE',
'B', 'I', 'U'); // will create only these ordered
buttons
* NOTE: You must specify this variable befor textarea
print.
*
* Example with no automatic form generator:
* $codeLighter->area_buttons = Array('PHP', 'CODE',
'B', 'I', 'U'); // will create only these ordered
buttons
* $codeLighter->createTextareaLighter();
* echo $codeLighter->textareaButtons;
* echo $codeLighter->textarea;
*
* $codeLighter->textarea;
* This variable will return a dedicated CSS textarea's
class style with:
* class="codeLighterTextarea"
* id="codeLighterInternalTextarea"
* name="codeLighterText"
* clos="74"
* rows="10"
*
* Author Andrea Giammarchi
* Alias andr3a
* Site http://www.3site.it
* Mail andrea3site.it
* Version 0.2c
* Begin 31/10/2003
* lastModify 08/02/2004 18:48
* Demo
http://www.3site.it/varie/codeLighter/index.php
*/
Class codeLighter {
        var $style, $output, $jsLighter, $textarea,
$textareaButtons, $fake, $restriction,
$newRestriction, $textarea_check, $area_buttons,
$codeConverter;
        var $css_code, $css_a_link, $css_a_visited,
$css_a_hover, $css_quote, $css_php, $css_img,
$css_button, $css_textarea, $css_textarea_span;
        var $maxUrlLenght, $maxImgWidth, $maxImgHeight;
        var $preg_a, $preg_b, $preg_c, $preg_d, $preg_e,
$preg_f;
        /**
        * Public constructor.
        * Example $codeLighter = new codeLighter();
        */
        function codeLighter() {
                $this->newRestriction = Array();
                $this->codeConverter = Array();
                $this->maxImgWidth = false;
                $this->maxImgHeight = false;
                $this->maxUrlLenght = 100;
                $this->jsAddLighter();
                $this->createTextareaLighter();
                $this->fake = 0;
                $def_rest = Array("mail", "url", "php", "as",
"code", "quote", "font", "size", "color", "img",
"list", "b", "i", "u", "center", "right");
                $this->restrict($def_rest);
                $this->css_code = "
                        border: 1px solid silver;
                        padding: 8pt;
                        font-family: courier, monospace, sans-serif;
                        font-size: 8pt;
                        color: #000033;
                        background-color: #FAFAFA;
                ";
                $this->css_a_link = "
                        text-decoration: none;
                        color: #000080;
                        font-family: Verdana, Helvetica, sans-serif;
                ";
                $this->css_a_visited = "
                        text-decoration: none;
                        color: #002255;
                        font-family: Verdana, Helvetica, sans-serif;
                ";
                $this->css_a_hover = "
                        text-decoration: underline;
                        color: #0000AA;
                        font-family: Verdana, Helvetica, sans-serif;
                ";
                $this->css_quote = "
                        width: 100%;
                        height: 1%;
                        border: 1px solid silver;
                        padding: 8pt;
                        font-family: Verdana, Helvetica, sans-serif;
                        font-size: 8pt;
                        color: #000000;
                        background-color: #F1F1F1;
                ";
                $this->css_php = "
                        border: 1px solid silver;
                        padding: 8px;
                        font-family: courier, monospace, sans-serif;
                        font-size: 8pt;
                        color: #000000;
                        background-color: #FDFDFD;
                ";
                $this->css_img = "
                        border: 0px;
                ";
                $this->css_button = "
                        border: 1px solid silver;
                        font-family: Verdena, Helvetica, sans-serif;
                        font-weight: bold;
                        color: #787878;
                        background-color: #EFEFEF;
                        font-size: 7pt;
                ";
                $this->css_textarea = "
                        border: 1px solid silver;
                        font-family: Verdena, Helvetica, sans-serif;
                        font-size: 9pt;
                ";
                $this->css_textarea_span = "
                        font-family: Verdana, Helvetica, sans-serif;
                        font-size: 7pt;
                        font-weight: normal;
                ";
                $this->setCSS("code", $this->css_code);
                $this->setCSS("a:link", $this->css_a_link);
                $this->setCSS("a:visited", $this->css_a_visited);
                $this->setCSS("a:hover", $this->css_a_hover);
                $this->setCSS("php", $this->css_php);
                $this->setCSS("img", $this->css_img);
                $this->setCSS("button", $this->css_button);
                $this->setCSS("textarea", $this->css_textarea);
                $this->setCSS("textarea_check",
$this->css_textarea_span);
                $this->textarea_check = "Opened Tags";
                $this->area_buttons = Array('B', 'U', 'I', 'IMG',
'CENTER', 'CODE', 'PHP', 'AS');
                $this->preg_a = "/(?i)(^|\
|\n|\r|\t)(http|https|ftp|irc|ed2k|gopher|telnet|gopher|telnet)(\:\/\/)([^\[\<\>[:space:]]+)($|\
|\n|\r|\t)/";
                $this->preg_b = "/(?i)(^|\
|\n|\r|\t)(w){3}(.)([^\[\<\>[:space:]]+)($|\
|\n|\r|\t)/";
                $this->preg_c =
"/(?i)\[url\=(\&quot;|\")(http|https|ftp|irc|ed2k|gopher|telnet|gopher|telnet)(\:\/\/)([^\<\>[:space:]]+?)(\&quot;|\")\]([^\<\>]+?)(\[\/url\])/i";
                $this->preg_d =
"/(?i)(\[url\=)(w){3}(\.)([^\[\<\>[:space:]]+?)(\])([^\"\<\>]+?)(\[\/url\])/i";
                $this->preg_e =
"/(?i)(\[url\])(http|https|ftp|irc|ed2k|gopher|telnet)(\:\/\/)([^\<\>[:space:]]+?)(\[\/url\])/i";
                $this->preg_f =
"/(?i)\[url\]www.([^\<\>[:space:]]+?)\[\/url\]/i";
                $this->preg_g =
"/(?i)\[url\=(http|https|ftp|irc|ed2k|gopher|telnet|gopher|telnet)(\:\/\/)([^\<\>[:space:]]+?)\]([^\<\>]+?)(\[\/url\])/i";
                $this->createTextareaLighter();
        }
        /**
        * Public, use to change defaults CSS.
        *
        * $codeLighter->setCSS($type, $value);
        * With this function you can modify CSS Style
        * Print in your output (in <head> </head> tags to
respect W3C HTML 4.01 standard)
        * the variable $codeLighter->style;
        * Example:
        * echo $codeLighter->style;
        *
        * $type => code - a:link - a:visited - a:hover -
quote - php - img - button - textarea - textarea_check
        * NOTE: these styles have the same CSS information
for:
        * code => table
        * quote => table
        * php => table
        * img => img
        * textarea => textarea
        * textarea_check => span
        * button => input
        * a:link => a:link
        * a:visited => a:visited
        * a:hover => a:hover
        *
        * $value => valid CSS information
        *
        * Example:
        * $CSS_code = "
        * width: 100%;
        * height: 1%;
        * border: 1px solid silver;
        * padding: 8pt;
        * font-family: Verdana, Helvetica, sans-serif;
        * font-size: 8pt;
        * color: #000033;
        * background-color: #FAFAFA;
        * ";
        * $codeLighter->setCSS("code", $CSS_code);
        * NOTE: if you want change default CSS class values
you must use setCSS , then print $codeLighter->style;
        *
        * Param String what type of CSS you want change (
code, a:link, a:visited, a:hover, quote, php, as, img,
button, textarea, textarea_check )
        * Param String valid CSS information.
        */
        function setCSS($type, $def) {
                if( strtolower($type) == "code" ) {
                        $this->css_code = $def;
                }
                elseif( strtolower($type) == "a:link" ) {
                        $this->css_a_link = $def;
                }
                elseif( strtolower($type) == "a:visited" ) {
                        $this->css_a_visited = $def;
                }
                elseif( strtolower($type) == "a:hover" ) {
                        $this->css_a_hover = $def;
                }
                elseif( strtolower($type) == "quote" ) {
                        $this->css_quote = $def;
                }
                elseif( strtolower($type) == "php" ||
strtolower($type) == "as" ) {
                        $this->css_php = $def;
                }
                elseif( strtolower($type) == "img" ) {
                        $this->css_img = $def;
                }
                elseif( strtolower($type) == "button" ) {
                        $this->css_button = $def;
                }
                elseif( strtolower($type) == "textarea" ) {
                        $this->css_textarea = $def;
                }
                elseif( strtolower($type) == "textarea_check" ) {
                        $this->css_textarea_span = $def;
                }
                else {
                        die("<br /><b>WARNING:</b> \$type given (
<b>{$type}</b> ) doesn't exist.<br />Accepted types:
code, a:link, a:visited, a:hover, quote, php, img,
button, textarea .<br />");
                }
                $this->style = "
                <style type=\"text/css\">
                pre.codeLighterCode {".$this->css_code."}
                table.codeLighterQuote {".$this->css_quote."}
                pre.codeLighterPHP {".$this->css_php."}
                img.codeLighterImg {".$this->css_img."}
                a.codeLighterLink:link {".$this->css_a_link."}
                a.codeLighterLink:visited {".$this->css_a_visited."}
                a.codeLighterLink:hover {".$this->css_a_hover."}
                textarea.codeLighterTextarea
{".$this->css_textarea."}
                input.codeLighterButton {".$this->css_button."}
                span.codeLighterSpan {".$this->css_textarea_span."}
                </style>
                ";
                return true;
        }
        /**
        * Public, use to add one or more tags to converter.
        * 2 ways to add new tags
        * $codeLighter->addTag( "myTag", Array("#notes",
"#variables", "#strings", "#generic") );
        * $codeLighter->addTag( "myTag", "font-style:
myStyle; border: myBorder;" );
        * If you need another language to highlight use first
method.
        * If you need a table with a style ( not indented,
not highlighted ) use second method BEFORE echo your
        * $codeLighter->style;
        * Param String internal tag name. Example "python"
( to convert [python]{code}[/python] )
        * Param Array/String Array with 4 colors ( "#notes",
"#variables", "#strings", "#generic" ) for code
        * highlighted, String with regular CSS style for
generic persola table
        */
        function addTag( $tagName, $tagStyle ) {
                $tagName = strtolower( $tagName );
                $this->newRestriction[] = Array( $tagName ,
$tagStyle );
                if( !is_Array( $tagStyle ) ) {
                        $newStyle = explode( "</style>", $this->style );
                        $newStyle = $newStyle[0];
                        $newset = "table.codeLighter{$tagName} {
{$tagStyle} }";
                        $this->style = $newStyle.$newset."
                        </style>
                        ";
                }
        }
        /**
        * Public, use to allow [IMG=width_X_height]{IMAGE
URL}[/IMG] tag
        *
        * $codeLighter->imgSize($maxWidth, $maxHeight);
        * This function allow parser to manipolate size of
imgages.
        * Converter will accept a tag like this:
        *
[IMG=100x38]http://www.3site.it/grafica/3site1.gif[/IMG]
        * $maxWidth -> integer that will be max apceptable
width value for an img
        * $maxHeigh -> integer that will be max apceptable
height value for an img
        * NOTE: if parameters are above these value, the
image will be converted with these for width or height
or width & height.
        * Param int Max width
        * Param int Max height
        */
        function imgSize($w, $h) {
                $this->maxImgWidth = $w;
                $this->maxImgHeight = $h;
                $this->restriction[] = "PrivateCheckImgSize";
        }
        function globalRegCheck( $t ) {
                $preg_modeMail =
"(([a-z0-9]+[\._\-]?){1,3}([a-z0-9])*\([a-z0-9]+[\._\-]?){1,3}([a-z0-9])*\.[a-z]{2,6})";
                $preg_mail1 =
"/(?i)(\[mail\])?{$preg_modeMail}(\[\/mail\])?/";
                $preg_mail2 = "/(?i)\[mail\={$preg_modeMail}\]/";
                $preg_imgModel =
"(http|https|ftp)(\:\/\/)([^\<\>[:space:]]+?)";
                $preg_img1 =
"/(?i)\[img\]{$preg_imgModel}\[\/img\]/i";
                $preg_img2 =
"/(?i)\[img\=(\&quot;|\"){$preg_imgModel}(\&quot;|\")\]/i";
                $preg_img3 =
"/(?i)\[img\=([0-9]{1,}x[0-9]{1,})\]{$preg_imgModel}\[\/img\]/i";
                $preg_urlModel =
"(http|https|ftp|irc|ed2k|gopher|telnet)(\:\/\/)([^\[\<\>[:space:]]+?)";
                $preg_url1 = "/(?i)^{$preg_urlModel}/i";
                $preg_url2 =
"/(?i)^((w){3}(.)([^\[\<\>[:space:]]+))/i";
                $preg_url3 =
"/(?i)(\[url\=)(w){3}(\.)([^\[\<\>[:space:]]+?)(\])/i";
                $preg_url4 =
"/(?i)\[url\=(\&quot;|\")?{$preg_urlModel}(\&quot;|\")?\]/i";
                $preg_url5 =
"/(?i)(\[url\]){$preg_urlModel}(\[\/url\])/i";
                $preg_url6 =
"/(?i)\[url\]www.([^\<\>[:space:]]+?)\[\/url\]/i";
                if( preg_match($preg_url6, $t) ||
preg_match($preg_url5, $t) || preg_match($preg_url4,
$t) || preg_match($preg_url3, $t) ||
preg_match($preg_url2, $t) || preg_match($preg_url1,
$t) || preg_match($preg_modeMail, $t) ||
preg_match($preg_mail1, $t) || preg_match($preg_mail2,
$t) || preg_match($preg_img1, $t) ||
preg_match($preg_img2, $t) || preg_match($preg_img3,
$t) ) {
                        return true;
                }
                else {
                        return false;
                }
        }
        function wrapConvert( $text, $size, $force = true,
$tag = " " ) {
                $withN = explode("\n\r", trim($text));
                $globalWrap = "";
                for( $a=0; $za=count($withN), $a < $za; $a++ ) {
                        $ex = explode(" ", trim($withN[$a]));
                        for( $b=0; $zb = count($ex), $b < $zb; $b++ ) {
                                if( $this->globalRegCheck($ex[$b]) ) {
                                        $globalWrap .= $ex[$b];
                                }
                                else {
                                        $provvisory = "";
                                        $where = 0;
                                        $ex[$b] = $this->unhtmlentities( $ex[$b] );
                                        if($force == false) {
                                                if( strlen($ex[$b]) > $size &&
!is_numeric($ex[$b]) ) {
                                                        for($c=0; $zc = (ceil(strlen($ex[$b])/$size)),
$c < $zc; $c++) {
                                                                $provvisory .=
substr($ex[$b],$where,$size).$tag;
                                                                $where += $size;
                                                        }
                                                }
                                                else {
                                                        $provvisory = $ex[$b];
                                                }
                                        }
                                        else {
                                                if( strlen($ex[$b])>$size ) {
                                                        for($c=0; $zd = (ceil(strlen($ex[$b])/$size)),
$c < $zd; $c++) {
                                                                $provvisory .=
substr($ex[$b],$where,$size).$tag;
                                                                $where += $size;
                                                        }
                                                }
                                                else {
                                                        $provvisory = $ex[$b];
                                                }
                                        }
                                        $globalWrap .= htmlentities( $provvisory );
                                }
                                $globalWrap .= " ";
                        }
                        $globalWrap .= "\n\r";
                }
                return $globalWrap;
        }
        /**
        * Public, use to modify text without delete valid
urls , img or emails tags
        *
        * $codeLighter->wrap_convert($text_var, $max_length
[, $convert_numerics [, $separator]]);
        * This function will parse the text as ->convert();
but you can specify max words lenght.
        * Such PHP's wordwrap function, this method allow you
to chose max lenght of a word and separator type.
        *
        * $text_var -> text with htmlentities(); // as needed
to ->convert();
        * $max_length -> max words length // will truncate
with chosed separator
        * $convert_numerics -> DEFAULT: true // will truncate
numbers too
        * with false value will not truncate numbers
        * $separator -> DEFAULT: " " // only trybcated words
will have this kind of separator [ not as wordwrap,
separate everything ... ]
        * NOTE: this kind of converter doesn't truncate
links/emails, use ->maxUrlLenght to manage links
length
        * Param String your not yet converted string
        * Param int max word length
        * Param boolean force numeric convertion ( default:
true )
        * Param String separator tag ( default: " " )
        */
        function wrap_convert( $text, $size, $force = true,
$tag = " " ) {
                return $this->convert( $this->wrapConvert($text,
$size, $force, $tag) );
        }
        function ereg_engine($st, $a_name, $pre, $suf) {
                while( preg_match(
"/(?i)\[{$a_name}\]([^\a]+?)\[\/{$a_name}\]/i", $st )
) {
                        $st =
preg_replace("/(?i)\[{$a_name}\]([^\a]+?)\[\/{$a_name}\]/i",
$pre."\\1".$suf, $st);
                }
                return $st;
        }
        function case_insensitive_check($st, $tag) {
                $st = preg_replace(
"/(?i)\[{$tag}\]([^\a]+?)\[\/{$tag}\]/i",
"[{$tag}]\\1[/{$tag}]", $st );
                return $st;
        }
        function unhtmlentities($mystring) {
                $phpv = explode(".", phpversion());
                if($phpv[0]==4 && $phpv[1]<3) {
                        // FROM: www.php.net
                        $trans_tbl =
get_html_translation_table(HTML_ENTITIES);
                        $trans_tbl = array_flip ($trans_tbl);
                        return strtr($mystring, $trans_tbl);
                }
                else {
                        return html_entity_decode($mystring);
                }
        }
        function codeModifier( $mod, &$st, &$pre_table_desc,
$c1="#FF8000", $c2="#0000BB", $c3="#DD0000",
$c4="#007700", $btw = false ) {
                if( in_Array( $mod, $this->restriction ) || $btw !=
false ) {
                
preg_match_all("/(?i)\[{$mod}\]([^\a]+?)\[\/{$mod}\]/i",
$st, $php);
                        $countPhp = count( $php[1] );
                        for( $a = 0; $a < $countPhp; $a++ ) {
                                $elaborate = trim($php[1][$a]);
                                $check_add_pre = false;
                                $check_add_suf = false;
                                if((strpos($elaborate, "&lt;?php") === false) &&
(strpos($elaborate, "&lt;?PHP") === false) &&
(strpos($elaborate,"&lt;?") === false)) {
                                        $elaborate = "<?php\n".trim($elaborate);
                                        $check_add_pre = true;
                                }
                                if((strpos($elaborate, "?&gt;") === false)) {
                                        $elaborate = $elaborate."?>";
                                        $check_add_suf = true;
                                }
                                $preserve = md5(" \n\r");
                                $elaborate = preg_replace("/( )([\\n\\r]+){1}(
)/", $preserve, $elaborate);
                                $elaborate = preg_replace("/( )([\\n\\r^ ]+){1}/",
$preserve, $elaborate);
                                $elaborate .= "*/";
                                $elaborate = highlight_string(
$this->unhtmlentities( $elaborate ), true );
                                if( $check_add_pre == true ) {
                                        $elaborate = str_replace("<font
color=\"#0000BB\">&lt;?php<br /></font>", "",
$elaborate);
                                        $elaborate = str_replace("&lt;?php<br />", "",
$elaborate);
                                }
                                if( $check_add_suf == true ) {
                                        $elaborate = str_replace("<font
color=\"#0000BB\">?&gt;</font>", "", $elaborate);
                                        $elaborate = str_replace("?&gt;", "",
$elaborate);
                                }
                                $elaborate = preg_replace("/(\\n|\\r)/", "",
$elaborate );
                                $elaborate = str_replace($preserve, "\r",
$elaborate );
                                $elaborate = str_replace("<font color=\"", "<span
style=\"color: ", $elaborate);
                                $elaborate = str_replace("#FF8000", $c1,
$elaborate);
                                $elaborate = str_replace("#0000BB", $c2,
$elaborate);
                                $elaborate = str_replace("#DD0000", $c3,
$elaborate);
                                $elaborate = str_replace("#007700", $c4,
$elaborate);
                                $elaborate = str_replace("</font>", "</span>",
$elaborate);
                                $elaborate = str_replace("<code>", "",
$elaborate);
                                $elaborate = str_replace("</code>", "",
$elaborate);
                                if( substr($elaborate, ( strlen($elaborate) - 9 ),
9) == "*/</span>" ) {
                                        $elaborate = substr($elaborate, 0, (
strlen($elaborate) - 9 ) );
                                }
                                $st = $this->case_insensitive_check($st, "php");