[geeklog-devel] Regarding PHP, thtml, and comments

Rob Griffiths robg at macosxhints.com
Wed Feb 26 09:45:36 EST 2003


Taken from Tony's recent post to the Geeklog users' list:

> Here is the general process for finding templates to edit:
>
> 1) Identify  PHP page that shows the forum in question.  In this case, 
> it
> is profiles.php
>
> 2) open that page and look for a corresponding function that displays 
> the
> form
>
> 3) In that function you will see the .thtml pages loaded.  Look into 
> those
> .thtml pages for the settings you need to tweak.

For themers, who may only have HTML experience, this process can be 
more than a little daunting.  If something like the vBulletin solution 
could be worked into GL2, I think you'd find the incidence of 
templating questions would drop by about 100%.  In vBulletin's master 
config panel, there's a "Show comments" variable that I can enable.  
Once enabled, every template page gets "<!-- START some_template -->" 
and "<!-- END some_template -->" tags around the relevant sections of 
code.  When working on a theme, all you need to do is load the page in 
the browser, view the source, and then look for the template markers to 
know exactly where you need to go.

I've done this in a brute-force manner with my development site (just 
added hard-coded comments to every .thtml file) as I was getting lost 
in the maze of inter-connected code bits.  But that's not really the 
best way to do it, as you'd rather not have the comments in the source 
view of the "real" site (it will make the HTML code larger, for one 
thing).  I don't know, though, what would be required to do it 
programmatically -- ideally it would be in the PHP files only, so 
themers wouldn't have to worry about making a change in the .thtml 
files that broke the commenting system.

Just my $0.02 to further muddy the waters! ;-)

-rob.




More information about the geeklog-devel mailing list