Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-29-2009, 10:24 AM   PM User | #1
moss2076
Regular Coder

 
Join Date: Oct 2005
Posts: 332
Thanks: 42
Thanked 2 Times in 2 Posts
moss2076 is an unknown quantity at this point
Modiying PHP code for a Joomla module?

Hello forum

I need some help modifying a secton of PHP code which is used in a module for displaying news article headlines.

The code snippet allows for either a single-column or a two-column layout.

What I would love to do is add a THIRD column to produce a 3 column layout if desired.

The single-column layout class is called "singleColumn", and the two-column layout class is called "firstColumn" and "secondColumn".

I have this snippet from my default.php module code, but I don't really know how to add the option for a third column, can anyone help, I would be very greatful

PHP Code:
$singleColumn '';
$firstColumn $secondColumn '';
for (
$b 0; (($this->news_amount - ($b $this->news_column)) > 0); $b++) { 

   for (
$c 0$c $this->news_column$c++) { 

      if (
$this->news_column == 1) { 
         
$div_class 'single_column_class';  
      } elseif (
$this->news_column == 2) { 
         
$div_class = ($c == 0) ? 'first_column_class' 'second_column_class'
      } 
      
      
$column = ($b $this->news_column) + $c
Im not sure how to code to allow for a third column, could anyone help me out?

Last edited by moss2076; 08-30-2009 at 06:05 PM..
moss2076 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Advertisement
Log in to turn off these ads.