|
-
Apr 30th, 2006, 10:17 PM
#1
Thread Starter
New Member
[RESOLVED] PHP parser?
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!
-
Apr 30th, 2006, 10:18 PM
#2
Hyperactive Member
Re: PHP parser?
Welcome to my forums!
Sounds like you need XML...
-
May 1st, 2006, 12:12 AM
#3
Thread Starter
New Member
Re: PHP parser?
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. 
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?
-
May 1st, 2006, 12:15 AM
#4
Hyperactive Member
Re: PHP parser?
Basically, with XML, you can create your own language. So you can make something like:
HTML Code:
<calendar size="med">May</calendar>
-
May 1st, 2006, 12:20 AM
#5
Hyperactive Member
Re: PHP parser?
Actually, now rereadig your post, you just need a CMS.
-
May 1st, 2006, 12:50 AM
#6
Thread Starter
New Member
Re: PHP parser?
Ah. So that's what I should call my custom admin tool, a CMS ... 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 But that's what I get for getting cheap hosting lol. Thanks, I will try out one of the CMS tutorials I found!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|