Changeset 22 for trunk/app/views/news

Show
Ignore:
Timestamp:
06/23/07 20:57:09 (17 months ago)
Author:
aarkerio
Message:

Log

Files:
1 modified

Legend:

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

    r1 r22  
    1 <table class="main_table"> 
    2  
    3 <tr> <td colspan="2"> 
    4  
    5 <?php  
    6 if (count($lastCover) > 0) 
    7 { 
    8     echo "<h1>". $lastCover[0]['Cover']['title'] . "</h1>"; 
    9     echo $lastCover[0]['Cover']['body']; 
    10 } 
    11 ?> 
    12  
    13 </td></tr> 
    14  
    15 <tr><td id="tit_dyk"> News </td> <td id="tit_poll">Sections</td></tr> 
    16  
    17 <tr>  
    18 <td style="padding:3px;width:300px;vertical-align:top;">  
     1<div id="cintillo">News</div> 
     2<div class="barra">Last News</div> 
    193 
    204<?php 
    21 if (count($new) > 0) 
    22 { 
    23        echo "<h2>" . $new[0]['News']['title'] . "</h2>"; 
    24        echo "<div>" .$new[0]['News']['body']  . "</div>";  
    25 } 
     5foreach( $data as $val) { 
    266?> 
    27 <p><a href="/news/all">All News</a></p> 
    28 </td>  
     7    
     8 <div class="titnew"><?php echo $val['News']['title']; ?></div> 
     9    <div class="redaccion"> 
     10        Desde la redacci&oacute;n de <i><?php echo $val['Theme']['theme']; ?></i>,  
     11        <a style="font-size:7pt;" href="/users/blogger/<?php echo $val['User']['username']; ?>"><?php echo $val['User']['username']; ?></a> informa.  &nbsp;  
     12        <?php echo $val['News']['created']; ?> 
     13    </div>  
     14    <div class="bodynew"> 
     15     
     16    <div class="img_new">            
     17    <?php echo $html->link( 
     18                           $html->image('themes/'.$val['Theme']['img'], array("alt"=>$val['Theme']['theme'], "title"=>$val['Theme']['theme'], "class"=>"themes")),  
     19                           '/news/category/' .$val['News']['theme_id'],  
     20                           null, null, false);  
     21    ?> 
     22    </div> 
     23      
     24    <?php  
     25       echo $news->newVote($val['News']['id'], $val['News']['votes']); 
     26       echo $val['News']['body'];  
     27    ?> 
     28     
     29    <br /> 
     30    <span style="font-size:7pt;">Permalink:</span> <br /> 
     31    <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> 
     32    <br /><br /> 
    2933 
    30 <td style="padding:3px;width:300px;vertical-align:top;"> 
    31 <div class="tiny_title">Well, the poll</div> 
    32  
    33 <div id="add_pollrow"> 
    34   <form onsubmit="return false;"> 
    35    
    36   <?php  
    37   //echo $poll->show($data);  
    38   if ( !isset( $_SESSION["poll"] )  ) 
    39   { 
    40     $array   = array(); 
     34    <b>Reference:</b> 
    4135     
    42     $output  = "<p><b>" . $data[0]['Poll']['question'] ."</b></p>"; 
     36    <?php echo $html->link( 
     37                           $html->image('/admin/newwindow.gif', array("alt"=>"Abre Ventana", "title"=>"Abre Ventana")), 
     38                           $val['News']['reference'], 
     39                           array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
     40                           null,  
     41                           null,  
     42                           false). "&nbsp;"; 
     43                           
    4344     
    44     $output .= $html->hiddenTag('Pollrow/poll_id', $data[0]['Poll']['id']); 
    45      
    46     foreach ($data[0]['Pollrow'] as $key=>$val) 
     45    if ( $val['News']['comments'] == 1 )  //Ya hay comentarios?? 
    4746    { 
    48        $array[$val['id']] = $val['answer']; 
     47            $num_coment = count($val["Comentnew"]); 
     48            if ( $num_coment > 0 )  
     49            { 
     50                echo  "&nbsp;". $html->link($num_coment . ' Comentarios', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt")); 
     51            } 
     52            echo  $html->link('Pon tu comentario', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt;padding-left:20px")) . "<br />"; 
    4953    } 
    5054     
    51     $output .= $html->radio('Pollrow/answer', $array, '<br />'); //, array("onclick"=>"return submitPoll()") 
     55    echo $news->socialNets($val['News']['id'], $val['News']['title']); // Social nets buttons 
    5256     
    53     $output .= '<br />'; 
     57    echo "</div><br />"; 
    5458     
    55     $output .= $ajax->submit('Vote', array( 
    56                                            "url" => "/pollrows/vote",  
    57                                            "update"=>"add_pollrow", 
    58                                            "loading" => "Element.hide('add_pollrow');Element.show('loading')", 
    59                                            "complete" => "Element.hide('loading');Effect.Appear('add_pollrow')" 
    60         )); 
    61      
    62     echo $output; 
    63    
    64   } else { 
    65      
    66     $total_votes = 0; 
    67      
    68     foreach ($data[0]["Pollrow"] as $key => $val)  
    69     { 
    70         $total_votes += $val["vote"]; 
    71     } 
    72     //die( var_dump($data) ); 
    73      
    74     //die( var_dump($data[0]["Pollrow"]) ); 
    75      
    76     foreach ($data[0]["Pollrow"] as $key => $val)  
    77     { 
    78              //echo $val["answer"] . "  " . $val["vote"] ."<br />"; 
    79              // % = votes * 100 / total 
    80              //echo "El key es ". $key ." y el val " . var_dump($val); 
    81              $percent = ($val["vote"] * 100) / $total_votes; 
    82              $width   = number_format($percent, 0); 
    83              echo '<p><b>'.$val['answer'].'</b> '.number_format($percent, 2).'% <br />';  
    84              echo $html->image('static/poll/'.$val["color"].'.png', array("height"=>"10", "width"=>$width,"alt"=>$val["answer"], "title"=>$val["answer"]) ); 
    85              echo "  ". $val['vote']; 
    86     } 
    87    
    88   echo "<p class=\"negrita\">Total votes:" . $total_votes . "</p>";  
    89 } 
     59    }  
     60 
     61print $pagination; 
    9062 
    9163?> 
    92   </form> 
    93 </div> 
    94 <br /> 
    95  
    96 <div class="tiny_title">Teacher's Blogs</div> 
    97 <div style="width:150px;margin-left:auto;margin-right:auto;"> 
    98   <?php echo $html->image('teacher_gonzalez.jpg', array("alt"=>"Teachers are blogging", "title"=>"Teachers are blogging") ) ?> 
    99 </div> 
    100 <?php 
    101 foreach( $entries as $key => $val) 
    102  { 
    103      echo '<div style="margin:8px 0 10px 0"><a style="font-size:10pt" href="/users/blog/'.$val['User']['username'].'/'.$val['Entry']['id'].'">' . $val['Entry']['title'] .'</a> <br />'; 
    104      echo 'Author:' . $val['User']['username'] .'<br />'; 
    105      echo '<span class="negrita">' . $val['Entry']['created'] . '<span></div>'; 
    106  } 
    107 ?> 
    108  
    109 </td>  
    110 </tr> 
    111  
    112 </table> 
    113