Welcome to Geeklog, Anonymous Thursday, November 21 2024 @ 10:25 am EST

Geeklog Forums

Split up the index items in 2 columns


Status: offline

bloc

Forum User
Newbie
Registered: 02/21/03
Posts: 1
Recently a friend of mine wanted to start using Geeklog, and asked if it was possible to have 2 columns instead of just the one on the index-page.

Well, I made a hack to mimic that, since geeklog doesn't seem to support multiple columns...Its very basic, just 2 columns where "featured" gets on top in the left column and the rest follows left - right column.
Perhaps someone might find a use for it. Wink

Since my friend didn't want "featured" to be just 1 column I left that one out...but it is easy to add back in again.

The changes are made in public_html/index.php

Text Formatted Code

$data = DB_query ("SELECT COUNT(*) AS count " . $sql);
$D = DB_fetchArray ($data);
$num_pages = ceil ($D['count'] / $limit);
 
// between here the changes are made

if ($nrows > 0) {
$half=ceil($nrows/2);
$rest=$nrows-$half;
$display .= '<table border="0" width="100%" cellpadding="3" cellspacing="0"><tr><td valign="top"';
if ($rest <=0) { $display .=' width="100%"';} else {$display .=' width="50%"';}
$display .= '>';
  for ($x = 1; $x <= $half; $x++) {
        $A = DB_fetchArray($result);
        if ($A['featured'] == 1) {
            $feature = 'true';
        } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) {
            $feature = 'true';
            $A['featured'] = 1;
        }
       $display .= COM_article($A,'y');
   }
$display .= '</td>';
if ($rest>0)
   {$display .= '<td width="50%" valign="top">';
       for ($x = $half+1; $x <= $nrows; $x++) {
        $A = DB_fetchArray($result);
        $display .= COM_article($A,'y');
       }
                    $display .= '</td>';
                }

$display .= '</tr></table>';

// between here the changes are made

    $display .= PLG_showCenterblock (3, $page, $topic); // bottom blocks


 
 Quote

greenhil

Anonymous
THIS ROCKS!

i came here looking for precisely this and it works great.

thanks for the hack
greenhil
 Quote

Status: offline

Euan

Forum User
Full Member
Registered: 04/22/02
Posts: 292
Here's another one that uses templates and puts the featured article in across both columns (index.php included is from 1.3.10rc2).

Cheers,

Euan.
-- Heather Engineering
-- No job too small
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
Quote by: euan

<a href="http://www.heatherengineering.com/staticpages/index.php/in.columns.en">Here's another one</a> that uses templates and puts the featured article in across both columns (index.php included is from 1.3.10rc2).

Cheers,

Euan.




Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions. Cry
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

All times are EST. The time is now 10:25 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content