p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: RES: Re: RES: Re: I am a php code MONSTER


Message #1 by "Rodrigo Penloski - Som Livre.com" <Rodrigo@s...> on Thu, 31 Oct 2002 18:28:49 -0300
Please, go ahead Jorge...

-----Mensagem original-----
De: jorge [mailto:jorge@d...]
Enviada em: quinta-feira, 31 de outubro de 2002 18:38
Para: beginning php
Assunto: [beginning_php] Re: RES: Re: I am a php code MONSTER


Rodrigo r U doing it or should I ?
Regards

Jorge
----- Original Message -----
From: "Rodrigo Penloski - Som Livre.com" <Rodrigo@s...>
To: "beginning php" <beginning_php@p...>
Sent: Wednesday, October 30, 2002 12:27 PM
Subject: [beginning_php] RES: Re: I am a php code MONSTER


> Was that?
> Just to translate to Portuguese?
> Ok, next time leave it to me, I'm brazilian... I'm still learning php,
> but I'm fluent on portuguese...
>
> Ps. Jamal where are you from?
> =C1frica?
>
> -----Mensagem original-----
> De: Jamal [mailto:new_mojam@y...]
> Enviada em: quarta-feira, 30 de outubro de 2002 14:19
> Para: beginning php
> Assunto: [beginning_php] Re: I am a php code MONSTER
>
>
> Jorge
> yes please it is what I want. Sorry for the delay in reply to your
> question.
> God Bless You
> Jamal
>
> > Hi guys,
> i> s there any portugese origin to translate the comments in this
class
> code
> t> o english for me?? I cannot leave the code alone. Why? Because I am
a
>
> php
> c> ode monster.
> H> ere is the code
> <> ?php
> /> /    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> /> /    Classes para criar tabelas em php
> /> /    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>  >
> /> /    ----------
> /> /    <TABLE>
> /> /    ----------
> c> lass cTABLE
> {>
>  >    var $sAtributos =3D array (
>  >            "ALIGN"=3D>"",
>  >            "BACKGROUND"=3D>"",
>  >            "BGCOLOR"=3D>"",
>  >            "BORDER"=3D>"",
>  >            "BORDERCOLOR"=3D>"",
>  >            "BORDERCOLORLIGHT"=3D>"",
>  >            "BORDERCOLORDARK"=3D>"",
>  >            "CELLPADDING"=3D>"",
>  >            "CELLSPACING"=3D>"",
>  >            "CLASS"=3D>"",
>  >            "COLS"=3D>"",
>  >            "DATAPAGESIZE"=3D>"",
>  >            "DATAFLD"=3D>"",
>  >            "DATASRC"=3D>"",
>  >            "FRAME"=3D>"",
>  >            "HEIGHT"=3D>"",
>  >            "ID"=3D>"",
>  >            "LANG"=3D>"",
>  >            "LANGUAGE"=3D>"",
>  >            "RULES"=3D>"",
>  >            "STYLE"=3D>"",
>  >            "TITLE"=3D>"",
>  >            "VALIGN"=3D>"",
>  >            "WIDTH"=3D>""
>  >        );
>  >    var    $sConteudo;
>
> >     //    ----------
>  >    //    Coloca valor em algum atributo
>  >    //    ----------
>  >    function poeAtributo( $sAtributo, $sValor )
>  >    {
>  >        //    Existe o atributo informado?
>  >        if( array_key_exists( $sAtributo, $this->sAtributos ) )
>  >            //    Sim. Coloca o valor nela.
>  >            $this->sAtributos["$sAtributo"] =3D $sValor;
>  >    }
>
> >     //    ----------
>  >    //    Coloca valor no conte=FAdo
>  >    //    ----------
>  >    function poeConteudo( $sConteudo )
>  >    {
>  >        $this->sConteudo =3D $sConteudo;
>  >    }
>  >
>  >    //    ----------
>  >    //    Limpa os atributos da tabela
>  >    //    ----------
>  >    function limpaAtributos()
>  >    {
>  >        $iTotal    =3D 0;
>  >        $iPos    =3D 0;
>  >        $sAtributo =3D "";
>  >
>  >        //    Limpa os atributos.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key($this->sAtributos);
>  >            $this->sAtributos["$sAtributo"] =3D "";
>  >            next($this->sAtributos);
>  >        }
>  >
>  >    }
>
> >     //    --------------------------
>  >    //    Limpa o conte=FAdo da tabela
>  >    //    --------------------------
>  >    function limpaConteudo()
>  >    {
>  >        $this->poeConteudo( "" );
>  >    }
>  >
>  >    //    ----------
>  >    //    Limpa a tabela
>  >    //    ----------
>  >    function limpaTABLE()
>  >    {
>  >        $this->limpaAtributos();
>  >        $this->limpaConteudo();
>  >    }
>  >
>  >    //    ----------
>  >    //    montaTABLE
>  >    //    ----------
>  >    function montaTABLE()
>  >    {
>  >        $iPos =3D 0;
>  >        $iTotal =3D 0;
>  >        $sHTML =3D"";
>  >        $sAtributo =3D "";
>
> >         //    Abre a tag
>  >        $sHTML .=3D sprintf( "<TABLE" );
>
> >         //    Posiciona a matriz de atributos na primeira 
posi=E7=E3o
>  >        reset($this->sAtributos);
>
> >         //    Coloca o atributo na tag se ele tiver algum valor.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key($this->sAtributos);
>  >            if( $this->sAtributos["$sAtributo"] )
>  >            {
>  >                $sAtributo =3D key($this->sAtributos);
>  >                $sHTML .=3D sprintf( " %s=3D'%s'",
>  >                            $sAtributo ,
>  >                            $this->sAtributos["$sAtributo"] );
>  >            }
>  >            next($this->sAtributos);
>  >        }
>  >
>  >        //    Fecha a parte inicial da tag
>  >        $sHTML .=3D sprintf( ">n" );
>  >
>  >        //    Coloca o miolo da tabela
>  >        $sHTML .=3D sprintf( "%s", $this->sConteudo );
>
> >         //    Fecha a tag
>  >        $sHTML .=3D sprintf( "</TABLE>n" );
>  >        return $sHTML;
>  >    }
> }>
>
> > //    ----------
> /> /    <TR>
> /> /    ----------
> c> lass cTR
> {>
>  >    var $sAtributos =3D array (
>  >            "ALIGN"=3D>"",
>  >            "BACKGROUND"=3D>"",
>  >            "BGCOLOR"=3D>"",
>  >            "BORDERCOLOR"=3D>"",
>  >            "BORDERCOLORLIGHT"=3D>"",
>  >            "BORDERCOLORDARK"=3D>"",
>  >            "CLASS"=3D>"",
>  >            "ID"=3D>"",
>  >            "LANG"=3D>"",
>  >            "LANGUAGE"=3D>"",
>  >            "STYLE"=3D>"",
>  >            "TITLE"=3D>"",
>  >            "VALIGN"=3D>""
>  >        );
>  >    var    $sConteudo;
>
> >     //    ----------
>  >    //    Coloca valor em algum atributo
>  >    //    ----------
>  >    function poeAtributo( $sAtributo, $sValor )
>  >    {
>  >        //    Existe o atributo informado?
>  >        if( array_key_exists( $sAtributo, $this->sAtributos ) )
>  >            //    Sim. Coloca o valor nela.
>  >            $this->sAtributos["$sAtributo"] =3D $sValor;
>  >    }
>
> >     //    ----------
>  >    //    Coloca valor no conte=FAdo
>  >    //    ----------
>  >    function poeConteudo( $sConteudo )
>  >    {
>  >        $this->sConteudo =3D $sConteudo;
>  >    }
>  >
>  >    //    ------------------------
>  >    //    Limpa os atributos do TR
>  >    //    ------------------------
>  >    function limpaAtributos()
>  >    {
>  >        $iTotal    =3D 0;
>  >        $iPos    =3D 0;
>  >        $sAtributo =3D "";
>  >
>  >        //    Limpa os atributos.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key($this->sAtributos);
>  >            $this->sAtributos["$sAtributo"] =3D "";
>  >            next($this->sAtributos);
>  >        }
>  >
>  >    }
>
> >     //    ----------------------
>  >    //    Limpa o conte=FAdo do TR
>  >    //    ----------------------
>  >    function limpaConteudo()
>  >    {
>  >        $this->poeConteudo( "" );
>  >    }
>  >
>  >    //    ----------
>  >    //    Limpa o TR
>  >    //    ----------
>  >    function limpaTR()
>  >    {
>  >        $this->limpaAtributos();
>  >        $this->limpaConteudo();
>  >    }
>  >
>  >    //    ----------
>  >    //    montaTR
>  >    //    ----------
>  >    function montaTR()
>  >    {
>  >        $iPos =3D 0;
>  >        $iTotal =3D 0;
>  >        $sHTML =3D"";
>  >        $sAtributo =3D "";
>
> >         //    Abre a tag
>  >        $sHTML .=3D sprintf( "<TR" );
>
> >         //    Posiciona a matriz de atributos na primeira 
posi=E7=E3o
>  >        reset($this->sAtributos);
>
> >         //    Coloca o atributo na tag se ele tiver algum valor.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key($this->sAtributos);
>  >            if( $this->sAtributos["$sAtributo"] )
>  >            {
>  >                $sAtributo =3D key($this->sAtributos);
>  >                $sHTML .=3D sprintf( " %s=3D'%s'",
>  >                            $sAtributo ,
>  >                            $this->sAtributos["$sAtributo"] );
>  >            }
>  >            next($this->sAtributos);
>  >        }
>  >
>  >        //    Fecha a parte inicial da tag
>  >        $sHTML .=3D sprintf( ">n" );
>  >
>  >        //    Coloca o miolo da tabela
>  >        $sHTML .=3D sprintf( "%s", $this->sConteudo );
>
> >         //    Fecha a tag
>  >        $sHTML .=3D sprintf( "</TR>n" );
>  >        return $sHTML;
>  >    }
> }>
>
> > //    ----------
> /> /    <TD>
> /> /    ----------
> c> lass cTD
> {>
>  >    var $sAtributos =3D array (
>  >            "ALIGN"=3D>"",
>  >            "BACKGROUND"=3D>"",
>  >            "BGCOLOR"=3D>"",
>  >            "BORDERCOLOR"=3D>"",
>  >            "BORDERCOLORLIGHT"=3D>"",
>  >            "BORDERCOLORDARK"=3D>"",
>  >            "CLASS"=3D>"",
>  >            "COLSPAN"=3D>"",
>  >            "HEIGHT"=3D>"",
>  >            "ID"=3D>"",
>  >            "LANG"=3D>"",
>  >            "LANGUAGE"=3D>"",
>  >            "NOWRAP"=3D>"",
>  >            "ROWSPAN"=3D>"",
>  >            "STYLE"=3D>"",
>  >            "TITLE"=3D>"",
>  >            "VALIGN"=3D>"",
>  >            "WIDTH"=3D>""
>  >        );
>  >    var    $sConteudo;
>
> >     //    ----------
>  >    //    Coloca valor em algum atributo
>  >    //    ----------
>  >    function poeAtributo( $sAtributo, $sValor )
>  >    {
>  >        //    Existe o atributo informado?
>  >        if( array_key_exists( $sAtributo, $this->sAtributos ) )
>  >            //    Sim. Coloca o valor nela.
>  >            $this->sAtributos["$sAtributo"] =3D $sValor;
>  >    }
>
> >     //    ----------
>  >    //    Coloca valor no conte=FAdo
>  >    //    ----------
>  >    function poeConteudo( $sConteudo )
>  >    {
>  >        $this->sConteudo =3D $sConteudo;
>  >    }
>  >
>  >    //    ------------------------
>  >    //    Limpa os atributos do TD
>  >    //    ------------------------
>  >    function limpaAtributos()
>  >    {
>  >        $iTotal    =3D 0;
>  >        $iPos    =3D 0;
>  >        $sAtributo =3D "";
>  >
>  >        //    Limpa os atributos.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        reset( $this->sAtributos);
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key( $this->sAtributos );
>  >            $this->sAtributos["$sAtributo"] =3D "";
>  >            next($this->sAtributos);
>  >        }
>  >
>  >    }
>
> >     //    ----------------------
>  >    //    Limpa o conte=FAdo do TD
>  >    //    ----------------------
>  >    function limpaConteudo()
>  >    {
>  >        $this->poeConteudo( "" );
>  >    }
>  >
>  >    //    ----------
>  >    //    Limpa o TD
>  >    //    ----------
>  >    function limpaTD()
>  >    {
>  >        $this->limpaAtributos();
>  >        $this->limpaConteudo();
>  >    }
>  >
>  >    //    -------
>  >    //    montaTD
>  >    //    -------
>  >    function montaTD()
>  >    {
>  >        $iPos =3D 0;
>  >        $iTotal =3D 0;
>  >        $sHTML =3D"";
>  >        $sAtributo =3D "";
>
> >         //    Abre a tag
>  >        $sHTML .=3D sprintf( "<TD" );
>
> >         //    Posiciona a matriz de atributos na primeira 
posi=E7=E3o
>  >        reset($this->sAtributos);
>
> >         //    Coloca o atributo na tag se ele tiver algum valor.
>  >        $iTotal =3D count( $this->sAtributos );
>  >        for( $iPos =3D 0; $iPos < $iTotal; $iPos++ )
>  >        {
>  >            $sAtributo =3D key($this->sAtributos);
>  >            if( $this->sAtributos["$sAtributo"] )
>  >            {
>  >                $sAtributo =3D key($this->sAtributos);
>  >                $sHTML .=3D sprintf( " %s=3D'%s'",
>  >                            $sAtributo ,
>  >                            $this->sAtributos["$sAtributo"] );
>  >            }
>  >            next($this->sAtributos);
>  >        }
>  >
>  >        //    Fecha a parte inicial da tag
>  >        $sHTML .=3D sprintf( ">" );
>  >
>  >        //    Coloca o miolo da tabela
>  >        $sHTML .=3D sprintf( "%s", $this->sConteudo );
>
> >         //    Fecha a tag
>  >        $sHTML .=3D sprintf( "</TD>n" );
>  >        return $sHTML;
>  >    }
> }>
> ?> >
>
> >
> t> hanks
> j> amal
>
>



Message #2 by "Nikolai Devereaux" <yomama@u...> on Thu, 31 Oct 2002 13:43:59 -0800
I thought it was already done a while ago!

Look at message #4 of this thread:
  http://p2p.wrox.com/archive/beginning_php/2002-10/83.asp



  Return to Index