Help with a template class

PythonPython Forum LeaderThe Royal RAM
Hi... I could do with some help with PHP...

Basically Im building a template class which I have now finished.. its fairly simple though.

At the moment ive dne it so that i use tags like {TITLE} into the template and these work fine... however i need something more complex...

At the moment i define these tags with an array.. It is:

[PHP]$tags=array(
'TITLE'=>'This is my title',
'WELCOME'=>'This is my welcome message'
);
[/PHP]

Now what I want to do is to be able to put in my template the tag {LISTUSERS}

This needs to then output a table which has got a list of all the users in a mysql database... kind of like a while statement.

How can I do this?

Thanks

The Royal Ram

Comments

  • martian2k4martian2k4 Llama Hunter Moderator
    Use a function :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • PythonPython Forum Leader The Royal RAM
    would you mind explaining how... :)

    The Royal Ram

  • martian2k4martian2k4 Llama Hunter Moderator
    I aint sure if this will work, but i have done it b4 i had it set up to display news but try this

    function userlist(){
    echo "userlist";
    };
    $tags=array(
    'TITLE'=>'This is my title',
    'WELCOME'=>'This is my welcome message',
    'USERLIST'=>userlist();
    );

    As i said i aint too sure if that will work, if it don't let me know i will try to fish out the old files i had and send em too you so you can look ova em :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • PythonPython Forum Leader The Royal RAM
    its ok...

    I found my own way around it :)

    I just put everything into a single variables... and just used that to perform and output the query,

    thanks anyways

    The Royal Ram

  • martian2k4martian2k4 Llama Hunter Moderator
    Kew gl with it :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
Sign In or Register to comment.