Oct 25, 2021, 06:03 PM

News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.


Under construction

Started by SleePy, Mar 23, 2008, 04:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SleePy

* SleePy puts on his hard hat.
Time to go indepth about my site changes I am working on.

The major thing in this is the splitting of the source from the templates.
I have taken things and named two folders core and visual. The visual if you haven't guessed is holding my templates for all my pages. The core of course is doing all the dirty work. To help accomplish this easily, I simply created a new function that handles my template loading. This was setup so I supply two arguments to the function. The first tells us which file we are looking at, the second tells which function in the template to call.
Very simple. But this type of handling lets me change easily how I want to handle templates easily or its location without the need to edit my code to much.

The second major thing is I am in the process of removing all my direct header calls. In my old code I would call a function that was calling my header and then a function that would do my footer.
Since everything in my site goes through an ob_start function anyways to handle SEF urls I have had fun with. I decided I could easily take that output and before I do the SEF on it, just simply wrap my header and footer around the contents. Works well and doesn't seem to cause any load time changes (though it is running on my  macbook so you couldn't see much of a difference unless I was overloading it again :P ).

The next major thing would be actually two things. I recently found out about func-get-args ability in php. Why is this so important? Well, this reduces the amount of arrays I put everything into so I could easily pass it into another function. I can simply just use a foreach loop and get this just as fast if not better :P
This lead me to redesign how I handle my breadcrumbs (more commonly known as the link tree in SMF). I took an SMF style approach to it, which I didn't like since I want to stay away from making my site look like SMF. But it has to be the most simplistic method there is out there.

I also am working on localizing all language strings. While I won't approve your customization because of this, I have been slacking on it myself on my own site. I currently have it all in one big language file. But I do not use that many language strings around here yet to need a second file. I also took an approach to use sprintf in php to make it so moving numbers and other things around I send to output easy.

I do not know yet if I want a new site theme in all this work I have been doing. I like my layout currently. It seems kinda old though as I have had it for a long time now. It takes a lot of work to design a site. I don't know if I would have time to design this site again. It took me a long time to develop this site layout. So I am thinking I may just keep it...

Where is all this going? Well I saved it for the end, but I plan on opening my site up to have publicly viewable source. This itself requires me to write a nice safe and secure method of doing this. I plan on having a big array of files that are accessible. If the file you are attempting to get is not in the array, to bad so sad for you :P I hope this helps people looking at ways to improve their own sites and gives others hints on how thins can be done.

That is all for now. There is a good show starting now and I don't want to miss it :P
No siggy! :D