![]() |
Need help outputting data (while making it easy to skin)
Hello,
I'm curious how you guys code your scripts/programs so it is easy to skin down the line? I was making a script today but I realized the way I was outputting all my code was an absolutely horrible way since I'm hoping to release this for free (or paid) if it ever gets to that point. I'm a huge fan of the way wordpress does it, but I couldn't seem to get it working like how they have it such as: PHP Code:
I'm mostly curious if anyone here has a script they release for free or for a fee, and wouldn't mind sending me an example page of code or two so I can see how it is done (OOP would be best since that's what I plan on coding it with). |
AFAIK,
the_post() is a function which returns an array. |
Okay, I'm thinking of just digging into the core functions of wordpress and looking it up, but I'm kinda lazy, and seeing another example would help a lot, as well.
|
Not sure if I understand you 100%, so apologies in advance.
I use Smarty. I have the PHP seperate from the HTML, so skinning would be easy, you wouldn't have to touch the server-side stuff. In PHP, you'd have: php Code:
Quote:
$usernameSome people consider using Smarty as having to learn a new way of coding, but it's far from that [in my opinion]. For example, the equivalent of an if statement in Smarty is:html Code:
Smarty PHP |
Quote:
[quote=CMellor;6828] html Code:
...while still having old style comparison operators (> < == != !). I would suggest that you use smarty, too (though I'm not a fan of using smarty in just any project - I believe it should only be used in projects >= medium size). |
I considered smarty, but I personally dislike it, and I could do a much better job doing it using straight PHP in the template files (which I don't want to do).
What I'm trying to achieve is a Wordpress like system, where all you have is the code for the actual loop, an if statement, then the variables/functions within the loop. However, the trouble I'm having is actually making the loop and using a loop to output a list of products from the database. |
| All times are GMT. The time now is 03:16 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0