Show
Ignore:
Timestamp:
02/18/08 20:28:30 (9 months ago)
Author:
aarkerio
Message:

Update views to cakephp 1.2

Files:
1 modified

Legend:

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

    r238 r240  
    1  <div class="titnew"><?php echo $data['News']['title']; ?></div> 
    2  <div class="redaccion">From  <i><?php echo $data['Theme']['theme']; ?> dept</i>,  
    3     posted by <a style="font-size:7pt;" href="/users/blogger/<?php echo $data['User']['username']; ?>"><?php echo $data['User']['username']; ?></a> on <?php echo $data['News']['created']; ?></div>  
    4     <div class="bodynew"> 
    5      
    6     <div class="img_new">            
    7     <?php echo $html->link( 
    8                            $html->image('themes/'.$data['Theme']['img'], array("alt"=>$data['Theme']['theme'], "title"=>$data['Theme']['theme'], "class"=>"themes")),  
    9                            '/news/category/' .$data['News']['theme_id'],  
    10                            null, null, false);  
    11     ?> 
    12     </div> 
    13       
    14     <?php  echo $data['News']['body']; ?> 
    15      
    16     <br /> 
    17     <span style="font-size:7pt;">Permalink:</span> <br /> 
    18     <a style="font-size:7pt;" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/news/display/<?php echo $data['News']['id']; ?>">http://<?php echo $_SERVER['SERVER_NAME']; ?>/news/display/<?php echo $data['News']['id']; ?></a> 
    19     <br /><br /> 
    20     <b>Reference:</b> 
    21      
    22     <?php echo $html->link( 
    23                            $html->image('static/newwindow.gif', array("alt"=>"Open new window", "title"=>"Open new window")), 
    24                            $data['News']['reference'], 
    25                            array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
    26                            null, 
    27                            null, 
    28                            false); 
    29      
    30      
    31   echo $news->socialNets($data['News']['id'], $data['News']['title']); // Social nets buttons 
    32      
    33   if ( $data['News']['comments'] == 1 )  // comments are actived ?? 
     1<div class="title_section">News</div> 
     2 
     3<?php 
     4//die(var_dump($data)); 
     5 
     6foreach ($data as $key => $val) 
     7{ 
     8  echo "<div class=\"wrapnew\">"; 
     9  echo "<div class=\"news_title\">". $val['News']['title']   . "</div>"; 
     10  echo "<div class=\"news_date\">" . $val['News']['created'] . "</div>"; 
     11  echo "<div class=\"news_body\">"; 
     12   
     13  echo "Subject: ". $html->link($val['Subject']['title'], '/news/all/'.$val['Subject']['id'], null, false, false) . "<br /><br />"; 
     14   
     15  echo  $val['News']['body']    . "</div>"; 
     16   
     17  if (strlen($val['News']['reference'])  > 5 )  // the reference 
    3418  { 
    35          $i = 1; 
    36             echo '<div id="cnews">'; 
    37             foreach($data["Commentnews"] as $v) 
    38             { 
    39               $bg = ($i%2==0) ? "#e2e2e2" : "#fff"; 
    40                
    41               echo '<div class="comentnew" style="background-color:'.$bg.'">';   
    42                  echo $time->timeAgoInWords($v["created"]) . " <b>". $v["name"]    . "</b> wrote:<br />"; 
    43                  echo $v["comment"]; 
    44               echo "</div>"; 
    45               $i++; 
    46             } 
    47             echo "</div>"; 
     19      echo "<div>". $html->link('Reference', $val['News']['reference']) ."</div>"; 
     20  } 
     21   
     22  echo "</div>"; 
     23 } 
    4824?> 
    49  
    50 <p> 
    51 <?php  
    52    echo $html->formTag('/commentnews/add/','post', array("onsubmit"=>"return validateNew()")); 
    53    echo $html->hiddenTag('Commentnews/new_id', $data['News']['id']);  
    54    echo $html->hiddenTag('Commentnews/level', 1); 
    55    echo $html->hiddenTag('Commentnews/comentnew_id', 1); 
    56 ?> 
    57 <fieldset> 
    58 <legend>Add comment:</legend> 
    59  
    60   <?php  
    61   if ( $othAuth->user('username') )  
    62   { 
    63      echo $html->hiddenTag('Commentnews/user_id', $othAuth->user('id')); 
    64      echo $html->hiddenTag('Commentnews/name', $othAuth->user('username')); 
    65      echo '<b>'. $othAuth->user('username') . '</b>  writes. '; 
    66   } 
    67   else 
    68   { 
    69      echo $html->hiddenTag('Commentnews/user_id', 0); 
    70      echo $html->input('Commentnews/name', array("size" => 25, "maxlength" => 50)); 
    71      echo $form->labelTag( 'Commentnews/name', ' Name:' ); 
    72      echo $html->tagErrorMsg('Commentnews/name', 'Name is required.'); 
    73       
    74      echo '<br /><br /> <img src="'. $html->url('/comentnews/captcha') .'" alt="Captcha" /> <br />'; 
    75      echo $html->input('Commentnews/captcha', array("size" => 6, "maxlength" => 6)); 
    76      echo $form->labelTag( 'Commentnews/cptcha', 'Introduce el codigo, todas la letras son minusculas' ); 
    77   } 
    78   ?> 
    79    
    80   <?php echo $form->labelTag( 'Commentnews/comment', 'Comment:' );?><br /> 
    81   <?php echo $html->textarea('Commentnews/comment', array("cols"=>70, "rows"=>10)) ?> 
    82   <?php echo $html->tagErrorMsg('Commentnews/comment', 'Comment is required.'); ?> 
    83   <br /> 
    84  </p> 
    85    
    86   <br /> 
    87   <?php echo $html->submit('Add comment') ?> 
    88 </fieldset> 
    89 </form> 
    90 <?php } ?> 
    91 </div>