Changeset 242 for trunk/app/views/news

Show
Ignore:
Timestamp:
02/20/08 19:08:38 (9 months ago)
Author:
aarkerio
Message:

Update views

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/news/view.ctp

    r238 r242  
    1 <?php 
    2 foreach( $data as $val)  
    3 { 
     1<div class="titnew"><?php echo $data['News']['title']; ?></div> 
     2 
     3<div class="redaccion">From  <i><?php echo $data['Theme']['theme']; ?> dept</i>,  
     4    posted by  
     5<?php  
     6  echo $html->link($data['User']['username'], '/users/blogger/'.$data['User']['username']).' on '. $data['News']['created'];  
    47?> 
    5     
    6  <div class="titnew"><?php echo $val['News']['title']; ?></div> 
    7     <div class="redaccion"> 
    8         <i>From the <?php echo $val['Theme']['theme']; ?> department</i>,  
    9         <a style="font-size:7pt;" href="/users/blogger/<?php echo $val['User']['username']; ?>"><?php echo $val['User']['username']; ?></a> reports.  &nbsp;  
    10         <?php echo $val['News']['created']; ?> 
    11     </div>  
    12     <div class="bodynew"> 
     8</div>  
     9<div class="bodynew"> 
    1310     
    14     <div class="img_new">            
    15     <?php echo $html->link( 
    16                            $html->image('themes/'.$val['Theme']['img'], array("alt"=>$val['Theme']['theme'], "title"=>$val['Theme']['theme'], "class"=>"themes")),  
    17                            '/news/category/' .$val['News']['theme_id'],  
    18                            null, null, false);  
     11<div class="img_new"> 
     12<?php  
     13echo $html->link( 
     14           $html->image('themes/'.$data['Theme']['img'],  
     15                            array("alt"=>$data['Theme']['theme'], "title"=>$data['Theme']['theme'], "class"=>"themes")),  
     16                    '/news/category/' .$data['News']['theme_id'],  
     17                    null, null, false);  
    1918    ?> 
    20     </div> 
     19</div> 
    2120      
    22     <?php 
    23        echo $val['News']['body'];  
    24     ?> 
     21<?php  echo $data['News']['body']; ?> 
    2522     
    2623    <br /> 
    2724    <span style="font-size:7pt;">Permalink:</span> <br /> 
    28     <a style="font-size:7pt;" href="/news/display/<?php echo $val['News']['id']; ?>">http://www.mononeurona.org/news/display/<?php echo $val['News']['id']; ?></a> 
     25    <?php echo $html->link( 
     26               'http://'.$_SERVER['SERVER_NAME'].'/news/display/'.$data['News']['id'],  
     27                           'http://'.$_SERVER['SERVER_NAME'].'/news/display/'.$data['News']['id'] 
     28               );  
     29?> 
    2930    <br /><br /> 
    30  
    3131    <b>Reference:</b> 
    3232     
    3333    <?php echo $html->link( 
    34                            $html->image('static/newwindow.gif', array("alt"=>"Open Window", "title"=>"Open Window")), 
    35                            $val['News']['reference'], 
     34                           $html->image('static/newwindow.gif', array("alt"=>"Open new window", "title"=>"Open new window")), 
     35                           $data['News']['reference'], 
    3636                           array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
    37                            null,  
    38                            null,  
    39                            false). "&nbsp;"; 
    40                            
     37                           null, 
     38                           null, 
     39                           false); 
    4140     
    42     if ( $val['News']['comments'] == 1 )  //Ya hay comentarios?? 
     41     
     42echo $news->socialNets($data['News']['id'], $data['News']['title']); // Social nets buttons 
     43     
     44if ( $data['News']['comments'] == 1 )  // comments are actived ?? 
     45{ 
     46  $i = 1; 
     47  echo '<div id="cnews">'; 
     48  foreach($data["Commentnews"] as $v) 
    4349    { 
    44             $num_coment = count($val["Commentnews"]); 
    45              
    46             if ( $num_coment > 0 )  
    47             { 
    48                 echo  "&nbsp;". $html->link($num_coment . ' Comments', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt")); 
    49             } 
    50             echo  $html->link('Write your comment', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt;padding-left:20px")) . "<br />"; 
     50      $bg = ($i%2==0) ? "#e2e2e2" : "#fff"; 
     51               
     52      echo '<div class="comentnew" style="background-color:'.$bg.'">';  
     53      echo $time->timeAgoInWords($v["created"]) . " <b>". $v["name"]    . "</b> wrote:<br />"; 
     54      echo $v["comment"]; 
     55      echo "</div>"; 
     56      $i++; 
    5157    } 
    52      
    53     echo $news->socialNets($val['News']['id'], $val['News']['title']); // Social nets buttons 
    54      
    55     echo "</div><br />"; 
    56      
    57     } 
     58  echo "</div>"; 
     59?> 
     60<p> 
     61<?php  
     62   echo $form->create('Commentnews',array("action"=>"add","onsubmit"=>"return validateNew()")); 
     63   echo $form->hidden('Commentnews.new_id', $data['News']['id']);  
     64   echo $form->hidden('Commentnews.level', 1); 
     65   echo $form->hidden('Commentnews.comentnew_id', 1); 
     66?> 
     67<fieldset> 
     68   <legend>Add comment:</legend> 
    5869 
    59 print $pagination; 
     70  <?php  
     71   if ( isset( $cUser['User']['id'] ) )  
     72   { 
     73       echo $form->hidden('Commentnews.user_id', $cUser['User']['id']); 
     74       echo $form->hidden('Commentnews.name', $cUser['User']['username']); 
     75       echo '<b>'. $cUser['User']['username'] . '</b>  writes. '; 
     76  } 
     77  else 
     78  { 
     79      echo $form->hidden('Commentnews.user_id', 0); 
     80      echo $form->input('Commentnews.name', array("size" => 25, "maxlength" => 50)); 
     81      echo $form->label('Commentnews.name', ' Name:' ); 
     82      echo $form->error('Commentnews.name', 'Name is required.'); 
     83      
     84      echo '<br /><br /> <img src="'. $html->url('/comentnews/captcha') .'" alt="Captcha" /> <br />'; 
     85      echo $form->input('Commentnews.captcha', array("size" => 6, "maxlength" => 6)); 
     86      echo $form->label('Commentnews.cptcha', 'Introduce el codigo, todas la letras son minusculas' ); 
     87  } 
     88   
     89  echo $form->label('Commentnews.comment', 'Comment:' ); 
     90  echo $form->textarea('Commentnews.comment', array("cols"=>70, "rows"=>10)); 
     91  echo $form->error('Commentnews.comment', 'Comment is required.'); ?> 
     92  <br /> 
     93 </p> 
     94   
     95  <br /> 
     96     <?php echo $form->end('Add comment') ?> 
     97</fieldset> 
    6098 
    61 ?> 
     99     <?php } ?> 
     100</div>