AnimeGalleries [dot] NetAnimeWallpapers [dot] ComAnimeLyrics [dot] ComAnimePedia [dot] ComAnimeGlobe [dot] Com

User Tag List

Closed Thread
Results 1 to 11 of 11

Thread: [Tutorial - PHP] An idea for a CMS

  1. #1
    Senior Member gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru has a reputation beyond repute gaburieru's Avatar
    Gil
    5,300.00
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    10-26-2009 01:34 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Dec 2007
    Location
    Sweden
    Age
    23
    Threads
    20
    Posts
    265
    Rep Power
    190

    Red face [Tutorial - PHP] An idea for a CMS

    I've always thought that making templates for CMS/Blogs could be easier. But can it be so easy that you won't have to learn anything additional (except for HTML/CSS) AT ALL?

    I recently came up with the idea.
    "What if you could parse HTML into PHP, instead of the otherway around that moste CMS do today?"

    I say you can! THIS handy little piece of AWSOMENESS let you do that. In short, it crawls the DOM of a html-document and edit it. The designer would only have to read the docs and assign proper id/class for the elements.

    The CMS could insert the navigation into <ul id="nav">.

    Instead of this:
    <ul>
    <?php print_navigation() ?>
    </ul>

    Developing this on your own would be hard though...

    GIMMIE FEEDBACK!!

    My sigs and avas

    Need a friend? Just send a PM

  2. #2
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,386.04
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    298 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-21-2014 01:36 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    28
    Threads
    616
    Posts
    19,667
    Blog Entries
    619
    Rep Power
    14704

    Default

    PHP isn't difficult. If you don't understand enough PHP to use it, then you don't understand enough about dynamic web programming to be doing dynamic web programming, and constitute a danger to yourself and others.

    It isn't just enough to accidentally slap together code that does approximately kinda what you sorta like it to do, you need code that you know excactly what it does and does not do. Anything else would be a security nightmare.

    But if you want point-and-drool web design, ruby on rails should be up your alley:

    +
    ERROR: If you can see this, then YouTube is down or you don't have Flash installed.
    Last edited by Eris; 09-12-2009 at 08:59 PM.

  3. #3
    Member
    AnimeLyrics Submitter Lv 2
    div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div has a reputation beyond repute div's Avatar
    Gil
    1,548.54
    Gender
    My Mood
    Bashful
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    02-16-2012 06:31 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jul 2007
    Location
    Michigan
    Threads
    4
    Posts
    85
    Blog Entries
    1
    AL Lyrics
    2
    Rep Power
    184
    Gamer IDs

    Steam ID: _div

    Default

    @Fist of Internet Justice: Just curious - have you ever worked with Ruby on Rails? It seems pretty hyped, but it might be actually useful too.

    Also, I've never understood the point of these pre-written CMS scripts that keep popping up. Well, actually, I understand the point of them, but it always feels like more work to properly "configure" them than it is to just write your own framework/code based on whatever you're actually trying to accomplish.

    In regards to "parsing HTML into PHP," why not just use "include" statements? A lot of "template" systems seem overcomplicated. Include a common HTML header, footer, layout, etc. The point of templating is to have one consolidated chunk of HTML for a given purpose. I've always thought that it makes a lot more sense to just learn HTML rather than use some convoluted half HTML/CSS, half PHP thing.

    ...And that's not to shoot down your idea. It's an interesting concept, really. The problem with it is that I don't think it's a good idea for someone to make something without sufficiently understanding how the back-end actually functions. You'd end up needing to know how to write the HTML/CSS such that the PHP script would know what to do with it, which would likely be about as complicated as just writing the PHP yourself, if that makes sense. I think I just restated what Fist of Internet Justice said, basically.

    @gaburieru: If you want to try writing something like this, I'd be willing to help. It would be a fun project.

  4. #4
    Junior Member TodPunk is on a distinguished road TodPunk's Avatar
    Gil
    40.00
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    10-23-2009 03:31 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Mar 2009
    Threads
    1
    Posts
    2
    Rep Power
    0

    Default

    It would be a good excercise in templating, and might be more useful from a security standpoint. If they get the raw html file, it still looks like something, and doesn't have any dynamic data in it. No PHP code gets out, etc.

    All in all, I agree with Cerebral, it's probably just as over-complicated as any other templating/themeing system, but probably easier for people to understand in the layman ways of things.

  5. #5
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,386.04
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    298 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-21-2014 01:36 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    28
    Threads
    616
    Posts
    19,667
    Blog Entries
    619
    Rep Power
    14704

    Default

    Quote Originally Posted by CerebralDivinity View Post
    @Fist of Internet Justice: Just curious - have you ever worked with Ruby on Rails? It seems pretty hyped, but it might be actually useful too.
    It is a bit over-hyped, but it does definitely have strong benefits over PHP since it's strictly Model-View-Controller based. . It's forces a degree of structure that's possible in PHP, but very seldom actually implemented.

    And since it's so well structured, it can do a lot of grunt work for you as well, which is pretty nice.
    Last edited by Eris; 10-23-2009 at 04:17 PM.

  6. #6
    Yew Neek™ is #1 TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude's Avatar
    Gil
    720.00
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-07-2009 11:43 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Dec 2009
    Age
    24
    Threads
    7
    Posts
    36
    Rep Power
    0

    Default

    The HTML DOM Parser sounds pretty handy actually, saves a lot of writing.

    A little off topic but why haven't many CM systems started implementing ajax yet? It would be awesome if forums were real time, and open a whole new world of opportunities for the users and administrators. Is it just too much data processing to handle in real time?

  7. #7
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,386.04
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    298 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-21-2014 01:36 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    28
    Threads
    616
    Posts
    19,667
    Blog Entries
    619
    Rep Power
    14704

    Default

    Quote Originally Posted by TandooriDude View Post
    The HTML DOM Parser sounds pretty handy actually, saves a lot of writing.

    A little off topic but why haven't many CM systems started implementing ajax yet? It would be awesome if forums were real time, and open a whole new world of opportunities for the users and administrators. Is it just too much data processing to handle in real time?
    The problem with Web 2.0 is that it is insanely bandwidth intensive. Since AJAX is a request/response system, the clients need to poll for status updates, as there is no way for the web server to tell this to the clients without them asking for it. And to get things running smoothly, they need to do this very often (like once a second). Adding to this, the way most webservers are written, this also entails a database request per request, which drains server power even more.
    Last edited by Eris; 12-01-2009 at 11:53 AM.

  8. #8
    Yew Neek™ is #1 TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude's Avatar
    Gil
    720.00
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-07-2009 11:43 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Dec 2009
    Age
    24
    Threads
    7
    Posts
    36
    Rep Power
    0

    Default

    True, I was thinking of a far fetched approach with xml, haha. Replacing the data in the child node using php, under the "forum name" parent everytime the topic is changed in someway.

    Server requests would be something small like once per second, but since its a xml tree-based operation it wouldn't have to read through the server to find+replace, just the xml file.

    I'm really new to php and ajax haha, I just like thinking bout it in a pseudo way. Would reading and writing to an xml file be possible with a forum? Just for the "topic" updates (like what updates normally when the page is refreshed).
    Last edited by TandooriDude; 12-02-2009 at 01:33 AM.

  9. #9
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,386.04
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    298 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-21-2014 01:36 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    28
    Threads
    616
    Posts
    19,667
    Blog Entries
    619
    Rep Power
    14704

    Default

    You use DOM scripting for that. Something like

    Code:
    <script language="javascript">
    foo = function() {
      var message = document.createTextNode('Hello World');
      var b = document.createElement('b');
      b.appendChild(message);
      document.getElementById('hello').appendChild(b);
    };
    </script>
    <body onLoad="foo()">
     <div id="hello"></div>
    </body>
    Which results in a page that looks like
    Code:
    <body>
     <div><b>Hello World</b></div>
    </body>
    This is of course a pretty stupid way of doing that, but the point is that it works just as well from any javascript function -- including the handlers of AJAX responses.

    Just google DOM Scripting in Javascript and you'll find tons of resources.
    Last edited by Eris; 12-02-2009 at 04:22 PM.

  10. #10
    Yew Neek™ is #1 TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude has a reputation beyond repute TandooriDude's Avatar
    Gil
    720.00
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-07-2009 11:43 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Dec 2009
    Age
    24
    Threads
    7
    Posts
    36
    Rep Power
    0

    Default

    Ah sorry, I just meant is it less bandwidth intensive to use xml for constantly updating information?

    Still a stupid pseudo idea haha.
    The word 'impossible' isn't in my dictionary...



  11. #11
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,386.04
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    298 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-21-2014 01:36 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    28
    Threads
    616
    Posts
    19,667
    Blog Entries
    619
    Rep Power
    14704

    Default

    Quote Originally Posted by TandooriDude View Post
    Ah sorry, I just meant is it less bandwidth intensive to use xml for constantly updating information?

    Still a stupid pseudo idea haha.
    It's how you would normally do it when you use AJAX, so no, it's not less intensive.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts