Show
Ignore:
Timestamp:
03/14/08 09:58:47 (10 months ago)
Author:
aarkerio
Message:

Forums update

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/forums/display.ctp

    r321 r322  
    11<?php 
    22//die(print_r($data)); 
    3 echo '<p>Foro: '. $html->link($data["Catforum"]["title"], '/catforums/display/'.$blog["User"]["username"].'/'.$blog["User"]["id"].'/'.$data["Catforum"]["id"]) . '</p>'; 
     3echo $html->para(null, 'Foro: '. $html->link($data["Catforum"]["title"], '/catforums/display/'.$blog["User"]["username"].'/'.$blog["User"]["id"].'/'.$data["Catforum"]["id"])); 
    44 
    5   echo '<div style="padding:6px;border:1px dotted gray;margin:15px 0 15px 0">'; 
    6          echo '<div style="padding:6px;border:1px solid orange;font-size:17pt;color:orange;font-weight:bold">'; 
    7                 echo $data["Forum"]["title"]; 
    8          echo '</div>'; 
    9          echo '<span ="font-size:pt">'. $data["Forum"]["description"] . "</span>"; 
     5 echo '<div style="padding:6px;border:1px dotted gray;margin:15px 0 15px 0">'; 
     6   echo '<div style="padding:6px;border:1px solid orange;font-size:17pt;color:orange;font-weight:bold">'.$data["Forum"]["title"].'</div>'; 
     7     echo '<span ="font-size:pt">'. $data["Forum"]["description"] . "</span>";        
     8     echo '<div style="width:100px;margin-top:15px">'; 
     9     echo $html->link($html->image('static/new_post.gif', array("alt"=>"Add new topic", "title"=>"Add new topic")),  
     10                      '/topics/add/'.$blog["User"]["username"].'/'.$data["Forum"]["id"],  
     11                      null, null, false); 
     12     echo '</div>'; 
    1013          
    11          echo '<div style="width:100px;margin-top:15px">'; 
    12          echo $html->link($html->image('static/new_post.gif', array("alt"=>"Add new topic", "title"=>"Add new topic")),  
    13                       '/topics/add/'.$blog["User"]["username"].'/'.$data["Forum"]["title"].'/'.$data["Forum"]["id"].'/'.$data["Forum"]["user_id"], null, null, false); 
    14          echo '</div>'; 
    15           
    16          //Topics 
    17          echo '<table style="border-collapse:collapse;width:100%">'; 
    18              
    19             if ( count($data["Topic"]) == 0) 
    20             { 
     14     //Topics 
     15     echo '<table style="border-collapse:collapse;width:100%">'; 
     16        if ( count($data["Topic"]) == 0) 
     17        { 
    2118                 echo '<tr><td colspan="6"><br /><h4>There is not topic on this forum yet</h4></td></tr>'; 
    22             } 
    23             else 
    24             { 
     19        } 
     20        else 
     21        { 
    2522                $th = array('Read', 'Topics', 'Replies', 'Author', 'Views', 'Last Post'); 
    2623                echo $html->tableHeaders($th); 
    27             } 
    28             //die(print_r($data["Topic"])); 
     24        } 
     25        //die(print_r($data["Topic"])); 
    2926             
    30             foreach ($data["Topic"] as $val) 
    31             { 
    32              $tr = array ( 
    33                    $html->image('static/folder.gif'), 
    34                    $html->link($val['subject'], '/topics/display/'.$Element[0]["User"]["username"].'/'.$Element[0]["User"]["id"].'/'.$data["Forum"]["id"].'/'.$val['id']), 
     27        foreach ($data["Topic"] as $val) 
     28        { 
     29     if ($val['level'] == 0) 
     30     { 
     31         $tr = array ( 
     32         $html->image('static/folder.gif'),  
     33         $html->link($val['subject'], '/forums/discussion/'.$data['Forum']['user_id'].'/'.$val['forum_id'].'/'.$val['id']), 
    3534                   count($data["Topic"]), 
    3635                   $val["User"]["username"], 
     
    4039                
    4140               echo $html->tableCells($tr, array("style"=>"border:1px solid gray;padding:6px;background-color:#e8f6fe"),  
    42                                            array("style"=>"border:1px solid gray;padding:6px;background-color:#c0c0c0")); 
    43              } 
     41                                            array("style"=>"border:1px solid gray;padding:6px;background-color:#c0c0c0")); 
     42     } 
     43         } 
    4444               
    4545          echo '</table>';