[geeklog-devel] CSS-Layout possible!

Joe Mucchiello joe at ThrowingDice.com
Tue Sep 18 02:28:59 EDT 2007


At 01:50 AM 9/18/2007, Oliver Spiesshofer wrote:
>function COM_displayPage($leftblocks=true, $rightblocks=true, 
>$stories=true, $header=true, $footer=true, $topic='')
>
>if the function is called, it looks the same as index.php with stoires etc.
>If any of the boolean is not true, it has to contain the alternative 
>content for that part of the page.
>If false, that part will not display.

If you are going to do this dump $stories. Also, you are forgetting 
one important piece: the page content:

function COM_displayPage($CONTENT, $skip = Array(), $options = Array())

When the page is public_html/index.php it will put the stories in the $content.
When the page is public_html/poll/index.php it will put a list of 
active polls in the $content.
If you pass array('right' => 0) as $skip, the right blocks will not display.
If you pass array('topic' => $topic) to options, there will be a 
topic variable available in COM_displayPage. This makes the interface 
to COM_displayPage extensible without needing to change lots of other 
code once it exists.
And you can pass Array('msg' => 99, 'plugin' => 'foo') as part of the 
options array to display a system message (although COM_displayPage 
should also check the $_GET array for msg and plugin itself if they 
aren't set here).

-----
The following is sidetrack only peripherally related to the above.

I have a dynamic content hack for 1.4.1 that needs its admin screens 
finished but it basically threw out the concept of left and right and 
just had columns. It also wasn't limited to 3 columns. The blocks 
table was retired in favor of 3 tables: a master_layout table where 
the layouts could be activate/deactivated individually and based on 
topic and/or language; a "run" table which was basically a column of 
blocks (although being a "run" I suppose it could be a row of 
blocks); and, a content table which was combination block/staticpage 
thing. The trick though is that a block could be a run. So you could 
nest the blocks in almost any conceivable way. And every block, run 
and layout had full permission controls. The ultimate plan was to 
allow the user to modify the layout any way he liked (personalized homepages).

The hack was in COM_siteHeader. It bypassed the bulk of that function 
a few lines in by calling my CONTENT_display function. But I'm 
guessing that code is too far "out there" even compared to what 
you're up to here Oliver.

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list