PDA

Click to See Complete Forum and Search --> : [RESOLVED] PHP parser?


selfishy_me
Apr 30th, 2006, 10:17 PM
Hello, I'm not sure if the correct term is "parser" but what I want to do is to create a pseudo-language using PHP for HTML-based pages. For example:

<?php

function calendar() {
print "hello world";
}

?>

<html... blah blah...

Below is the calendar
:calendar:

</body>
</html>

I'm building a site for my Dad's business and he doesn't know any programming. So I need to provide him with simple code like :calendar: for him to simply punch in. All he's going to do is sign into the web-based admin interface. If he wants to change some text/design/add new page/etc., all he'll have to do is click, type, and voila. However, the admin script will change the original file. None of his changes will be saved into a database.

Could someone suggest some methods of approach, please? I'm not well-skilled in programming or all the technical terms but I'm willing to learn. If someone could help, I would appreciate some explanations/suggestions on how to do this using the approach above. If in your opinion, using a database is easier/better then I will get one. Thanks for any help!

Datacide
Apr 30th, 2006, 10:18 PM
Welcome to my forums!

Sounds like you need XML...

selfishy_me
May 1st, 2006, 12:12 AM
Hello, thanks for the welcome.

>>Sounds like you need XML...<<

My XML programming knowledge is fairly limited but wouldn't my Dad still need to know how to bind parts of the HTML document to the XML file? I mean, he can't simply type in <calendar> and a calendar will display. He still needs to type in a bunch of mumble jumble. :ehh:

I'm trying to create this so that all he has to do is type in (symbol)function(symbol). As simple as possible.

I do understand, more or less, how the smilies are incorporated. For example, this post will be saved into a database and when it's pulled out for viewing, a parser goes through the post/text character by character until it finds a colon. Then it checks to see if there's another colon after a bunch of words. If there is, it will check against a smily list in the database. If there's a match, then it will insert the smily. But I don't really like having to search through the entire file character by character until I find a match. It can be a bit tedious with larger files~ Any other ideas? :confused:

Datacide
May 1st, 2006, 12:15 AM
Basically, with XML, you can create your own language. So you can make something like:

<calendar size="med">May</calendar>

Datacide
May 1st, 2006, 12:20 AM
Actually, now rereadig your post, you just need a CMS (http://www.google.com/search?hl=en&safe=off&q=php+contact+management+system&btnG=Search&meta=).

selfishy_me
May 1st, 2006, 12:50 AM
Ah. So that's what I should call my custom admin tool, a CMS :D ... Ya, the above example you gave is too complicated for Pop. But I did build a CMS of my own. The only part missing was a few of the Smarty functions. I would use Smarty except my host doesn't allow me to install it :mad: But that's what I get for getting cheap hosting lol. Thanks, I will try out one of the CMS tutorials I found!