PHP: The next step for me (Much rambling)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Jacobs

    PHP: The next step for me (Much rambling)

    Hi all

    I've been messing with PHP for a while now and have reached a point
    where I can make it do just about anything that I want it to do. That
    doesn't mean that I can make it do anything, far from it, just that I've
    got to the point where I've got no 'real world' projects to further my
    knowledge.

    My next goal is to make my code much more graceful and efficient.

    For example, I've written a CMS. To make this work, I have to create
    about 5 or 6 template pages, eg:

    1. content.php - this selects from the content table where id=x
    2. news.php - this selects from the news table where id=x
    3. allnews.php - this selects from the news table where today >
    release_date and today < closing_date

    I'm sure that there must be a better way of doing this so that if, for
    example, a customer wants to change the look and feel of the site, I
    only have to change ONE page instead of 5 or 6.

    The problem is, I don't know what I should be learning about next. It's
    like knowing that there's a more efficient way to get from A to B but
    not knowing that you need to learn to drive because you don't know the
    existence of cars, if that makes sense. I have a feeling that this
    could all be accomplished through using functions in an external
    functions.inc file or something. Should I be using case and switch and
    passing some sort of 'action' flag with the URL - &flag=news or
    something - so that it knows which query to run?

    I'm just a bit lost now. I'm not looking for someone to do it for me
    but maybe someone who can tell me what I should be reading about next.

    Cheers

    Andy
  • Geoff Berrow

    #2
    Re: PHP: The next step for me (Much rambling)

    I noticed that Message-ID:
    <andy-F588F8.22180919 112004@newstria l.btopenworld.c om> from Andy Jacobs
    contained the following:
    [color=blue]
    >1. content.php - this selects from the content table where id=x
    >2. news.php - this selects from the news table where id=x
    >3. allnews.php - this selects from the news table where today >
    >release_date and today < closing_date
    >
    >I'm sure that there must be a better way of doing this so that if, for
    >example, a customer wants to change the look and feel of the site, I
    >only have to change ONE page instead of 5 or 6.[/color]

    Well if the pages are properly marked up, this is just a question of
    storing CSS information surely?
    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • JAS

      #3
      Re: PHP: The next step for me (Much rambling)

      > I'm just a bit lost now. I'm not looking for someone to do it for me[color=blue]
      > but maybe someone who can tell me what I should be reading about next.
      >
      > Cheers
      >
      > Andy[/color]

      CSS is the way forward for you -- dont have people edit your PHP pages,
      have them control the pages using CSS and give them the ability to turn
      bits on and off without tampering with the code. The seperation will
      make it a lot easier to maintain as well. You'll be able to completly
      re-tool a page without have to have people re-edit it to make the
      changes they did.

      J

      Comment

      Working...