Changeset 409 for trunk/app/views/news

Show
Ignore:
Timestamp:
04/18/08 14:30:29 (8 months ago)
Author:
aarkerio
Message:

Discussions fixed

Location:
trunk/app/views/news
Files:
2 modified

Legend:

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

    r401 r409  
    66foreach ($data as $val) 
    77{ 
    8   $tmp  = $html->div('news_title', $html->link($val['News']['title'], '/news/view/'. $val['News']['id'])); 
     8  echo '<div class="wrapnew">'; 
     9  
     10  echo $html->div('news_title', $html->link($val['News']['title'], '/news/view/'. $val['News']['id'])); 
    911   
    10   $tmp .= $html->div('news_date',  $val['News']['created']); 
     12  echo $html->div('news_date',  $val['News']['created']); 
    1113 
    12   $tmp .= $html->div('news_body', 
     14  echo $html->div('news_body', 
    1315                            $html->div('img_new', $html->link( 
    1416                                                          $html->image('themes/'.$val['Theme']['img'],  
     
    2325   
    2426   
    25   $tmp .= $val['News']['body']; 
    26    
    27   if (strlen($val['News']['reference'])  > 5 )  // the reference 
     27  echo $val['News']['body']; 
     28 
     29  if ($val['News']['comments'] == 1 )  // comments enabled on this new 
    2830  { 
    29       $tmp .= $html->div(null, $html->link('Reference', $val['News']['reference'])); 
    30   } 
    31     
    32   if ($val['News']['comments'] == 1 )  // the reference 
    33   { 
    34     $tmp .= $html->div(null, $html->link('Put your comment', '/news/view/'.$val['News']['id'])); 
     31    echo $html->para(null, $html->link('Put your comment', '/news/view/'.$val['News']['id'])); 
    3532  }  
    36   echo $html->div('wrapnew', $tmp);  
     33 
     34 
     35?> 
     36  <br /> 
     37    <span style="font-size:7pt;">Permalink:</span> <br /> 
     38    <?php echo $html->link( 
     39               'http://'.$_SERVER['SERVER_NAME'].'/news/view/'.$val['News']['id'],  
     40                           'http://'.$_SERVER['SERVER_NAME'].'/news/view/'.$val['News']['id'] 
     41               );  
     42?> 
     43    <br /><br /> 
     44    <b>Reference:</b> 
     45     
     46    <?php echo $html->link( 
     47                           $html->image('static/newwindow.gif', array("alt"=>"Open new window", "title"=>"Open new window")), 
     48                           $val['News']['reference'], 
     49                           array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
     50                           null, 
     51                           null, 
     52                           false); 
     53       
     54echo $news->socialNets($val['News']['id'], $val['News']['title']); // Social nets buttons 
     55       
     56     
     57 
     58  echo '</div>'; 
    3759 } 
    3860?> 
  • trunk/app/views/news/view.ctp

    r407 r409  
    4646               
    4747      echo '<div class="comentnew" style="background-color:'.$bg.'">';   
    48       echo $time->timeAgoInWords($v['created']) . ' <b>'. $v['name']    . '</b> wrote:<br />'; 
     48      echo $time->timeAgoInWords($v['created']) . ' <b>'. $v['username']    . '</b> wrote:<br />'; 
    4949      echo $v["comment"]; 
    5050      echo "</div>"; 
     
    5353  echo "</div>"; 
    5454 
    55   echo $form->create('Discussion', array('action'=>'agregar')); 
    56   //echo '<form action="/discussions/agregar" method="post">'; 
     55if ( isset( $cU['User']['id'] ) ): 
     56  echo $form->create('Discussion', array('action'=>'add')); 
     57  echo $form->hidden('Discussion.new_id', array('value'=>$data['News']['id']));  
    5758?> 
    58  
    59  
    6059<fieldset> 
    6160   <legend>Write comment:</legend> 
    6261<?php  
    63   echo $form->hidden('Discussion.new_id', array('value'=>$data['News']['id']));  
    64   echo $form->hidden('Discussion.level', array('value'=>1)); 
    65   echo $form->hidden('Discussion.comentnew_id', array('value'=>1)); 
    66  
    67   if ( isset( $cU['User']['id'] ) ): 
    68        echo $form->hidden('Discussion.user_id', array('value'=> $cU['User']['id'])); 
    69        echo $form->hidden('Discussion.name',  array('value'=>$cU['User']['username'])); 
    70        echo '<b>'. $cU['User']['username'] . '</b>  write: <br />'; 
    71  
    72   else: 
    73  
    74       echo $form->hidden('Discussion.user_id', array('value'=> 0)); 
    75       echo $form->input('Discussion.name', array('size'=> 25, 'maxlength' => 40)); 
    76       // echo '<br /><br /> <img src="'. $html->url('/discussions/captcha') .'" alt="Captcha" title="Captcha" /> <br />'; 
    77       //echo $form->input('Discussion.captcha', array("size" => 6, "maxlength" => 6)); 
    78       //echo $form->label('Discussion.captcha', 'Introduce el código, todas la letras son minúsculas' ).'<br />'; 
    79   endif; 
    80    
    81   echo $form->textarea('Discussion.comment', array('cols'=>60, 'rows'=>10)) . $form->end('Send comment');  
    82  
     62    echo $form->label('Discussion.comment', '<b>'. $cU['User']['username'] . '</b>  write:').'<br />';  
     63    echo $form->textarea('Discussion.comment', array('cols'=>60, 'rows'=>10)); 
     64    echo $form->end('Send comment'); 
     65 else: 
     66    echo $html->para(null, $html->link('Login to write comments', '/users/login'));  
     67 endif;  
    8368}  
    8469?>