Changeset 29

Show
Ignore:
Timestamp:
07/13/07 20:42:19 (18 months ago)
Author:
aarkerio
Message:

Add images

Location:
trunk/app
Files:
43 added
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/news_controller.php

    r25 r29  
    137137         $this->data["News"]["user_id"] = $this->othAuth->user('id'); 
    138138          
    139      if ($this->News->save($this->data["News"])) 
     139          if ($this->News->save($this->data["News"])) 
    140140         { 
    141141             if ( $this->data["News"]["end"] == 1 ) 
    142142             { 
    143                           $this->redirect('/admin/news/listing'); 
     143                         $this->redirect('/admin/news/listing'); 
    144144              }  
    145145              else  
    146146              { 
    147                           $id = $this->News->getLastInsertID(); 
    148                            $this->msgFlash('Your story has been added!','/admin/news/edit/'.$id); 
    149                            exit(); 
     147                         $id = $this->News->getLastInsertID(); 
     148                         $this->msgFlash('Your story has been added!','/admin/news/edit/'.$id); 
     149                         exit(); 
    150150             } 
    151151         } 
  • trunk/app/controllers/pollrows_controller.php

    r15 r29  
    1515    } 
    1616   
    17   public function vote()  
    18   { 
    19       // adds new vote to database 
    20       if (!empty($this->data["Pollrow"])) 
    21       { 
    22         $vote = $this->Pollrow->field('Pollrow.vote', array("Pollrow.id" => $this->data['Pollrow']['id']) ); 
    23          
    24         $vote += 1; 
    25          
    26         $this->data['Pollrow']['vote'] = $vote;  // add vote 
    27          
    28          if ( $this->Pollrow->save($this->data) )   // add the Poll vote 
    29          { 
    30              $_SESSION["poll"] = true; //set session, only one vote per session 
    31               
    32              $conditions = array("Pollrow.poll_id" => $this->data['Pollrow']['poll_id']); 
    33              $fields     = array("Pollrow.answer", "Pollrow.color", "Pollrow.vote", "Pollrow.poll_id"); 
    34              $order      = "Pollrow.answer DESC"; 
    35               
    36              $this->set('poll', $this->Pollrow->findAll($conditions, $fields, $order, null, null, 2)); 
    37               
    38              $this->render('results', 'ajax'); 
    39       } 
    40       } 
    41    } 
     17 public function vote()  
     18 { 
     19    // adds new vote to database 
     20    if (!empty($this->data)) 
     21    {   
     22           //die(print_r($this->data)); 
     23            
     24           $vote  = $this->Pollrow->field('vote', array("id" => $this->data['Pollrow']['id'])); 
     25            
     26           $vote += 1; 
     27           //exit("votos " . $vote); 
     28           $this->data['Pollrow']['vote'] = $vote;  // add vote 
     29               
     30           if ( $this->Pollrow->save( $this->data['Pollrow'] ) )  // add the Poll vote 
     31            { 
     32                    $this->Session->write('poll',  $this->data['Pollrow']['poll_id']); //set session, only one vote per session 
     33                     
     34                    $conditions = array("Pollrow.poll_id" => $this->data['Pollrow']['poll_id']); 
     35                    $fields     = array("Pollrow.answer", "Pollrow.color", "Pollrow.vote", "Pollrow.poll_id", "Poll.id", "Poll.question"); 
     36                    $order      = "Pollrow.id"; 
     37                     
     38                    $this->set('poll', $this->Pollrow->findAll($conditions, $fields, $order)); 
     39                     
     40                    $this->render('results', 'ajax'); 
     41            } 
     42            else 
     43            { 
     44                  echo "Ajax error, check with the company's computer guy..."; 
     45            } 
     46       } 
     47  } 
    4248  
    4349 public function add() 
  • trunk/app/views/elements/lastentries.thtml

    r23 r29  
    11<?php 
    22 
    3 echo $html->image('static/blogactiv.gif', array("alt"=>"Bloggers Activos", "title"=>"Bloggers Activos", "style"=>"margin-right:5px 0 10px 0")); 
     3echo $html->image('static/blogactiv.gif', array("alt"=>"Teachers Blogging", "title"=>"Teachers Blogging", "style"=>"margin-right:5px 0 10px 0")); 
    44echo  "<br />"; 
    55 
  • trunk/app/views/news/admin_add.thtml

    r25 r29  
    1919<td> 
    2020  <?php  
    21     echo $form->labelTag( 'News/subject_id', 'Category' ); 
    22     echo $html->selectTag('News/subject_id', $subjects, null, null, null, false, false);       
     21    echo $form->labelTag( 'News/theme_id', 'Theme:' ); 
     22    echo $html->selectTag('News/theme_id', $themes, null, null, null, false, false);       
    2323  ?> 
    2424</td> 
     
    3838  <?php echo $html->tagErrorMsg('News/body', 'Body is required.'); ?> 
    3939</td></tr> 
    40 <tr><td colspan="4"><?php  
     40<tr><td colspan="2"><?php  
    4141              echo $form->labelTag( 'News/status', 'Published:' ); 
    4242              echo $html->checkbox('News/status', null, array("value"=>1));  
    4343              ?> 
    44 </td></tr> 
     44</td> 
     45 <td colspan="2"> 
     46            <?php  
     47              echo $form->labelTag( 'News/end', 'Finish editing:' ); 
     48              echo $html->checkbox('News/end', null, array("value"=>1));  
     49              ?> 
     50</td> 
     51</tr> 
    4552   
    4653<tr><td colspan="4">  <?php echo $html->submit('Add'); ?> </form></td></tr> 
  • trunk/app/views/news/admin_edit.thtml

    r20 r29  
    1 <?php echo $javascript->link('prototype'); ?> 
    2 <?php echo $javascript->link('myfunctions'); ?> 
    3 <?php echo $javascript->link('poll'); ?> 
    4 <?php echo $javascript->link('fckeditor/fckeditor'); ?>  
     1 
     2<?php echo $javascript->link('fckeditor/fckeditor'); ?> 
     3 
     4<script type="text/javascript"> 
     5   window.onload = timedMsg; 
     6</script> 
     7<?php $session->flash(); ?> 
    58 
    69<?php echo $html->addCrumb('Control Tools', '/admin/entries/index'); ?>  
     
    2225<td> 
    2326  <?php  
    24     echo $form->labelTag( 'News/subject_id', 'Category' ); 
    25     echo $html->selectTag('News/subject_id', $subjects, null, null, null, false, false);       
     27    echo $form->labelTag( 'News/theme_id', 'Theme:' ); 
     28    echo $html->selectTag('News/theme_id', $themes, null, null, null, false, false);       
    2629  ?> 
    2730</td> 
  • trunk/app/views/news/view.thtml

    r22 r29  
    88 <div class="titnew"><?php echo $val['News']['title']; ?></div> 
    99    <div class="redaccion"> 
    10         Desde la redacci&oacute;n de <i><?php echo $val['Theme']['theme']; ?></i>,  
     10        <i>From the <?php echo $val['Theme']['theme']; ?> department</i>,  
    1111        <a style="font-size:7pt;" href="/users/blogger/<?php echo $val['User']['username']; ?>"><?php echo $val['User']['username']; ?></a> informa.  &nbsp;  
    1212        <?php echo $val['News']['created']; ?> 
     
    2222    </div> 
    2323      
    24     <?php  
    25        echo $news->newVote($val['News']['id'], $val['News']['votes']); 
     24    <?php 
    2625       echo $val['News']['body'];  
    2726    ?> 
     
    3534     
    3635    <?php echo $html->link( 
    37                            $html->image('/admin/newwindow.gif', array("alt"=>"Abre Ventana", "title"=>"Abre Ventana")), 
     36                           $html->image('admin/newwindow.gif', array("alt"=>"Open Window", "title"=>"Open Window")), 
    3837                           $val['News']['reference'], 
    3938                           array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
     
    4645    { 
    4746            $num_coment = count($val["Comentnew"]); 
     47             
    4848            if ( $num_coment > 0 )  
    4949            { 
    50                 echo  "&nbsp;". $html->link($num_coment . ' Comentarios', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt")); 
     50                echo  "&nbsp;". $html->link($num_coment . ' Comments', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt")); 
    5151            } 
    5252            echo  $html->link('Pon tu comentario', '/news/display/'.$val['News']['id'], array("style"=>"font-size:7pt;padding-left:20px")) . "<br />"; 
     
    5757    echo "</div><br />"; 
    5858     
    59     }  
     59    } 
    6060 
    6161print $pagination;