Changeset 750

Show
Ignore:
Timestamp:
09/02/08 21:40:55 (3 months ago)
Author:
aarkerio
Message:

backups scripts

Location:
trunk/app
Files:
1 added
1 removed
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/postgresql/entries.sql

    r665 r750  
    1111"karanet" smallint NOT NULL DEFAULT 0 
    1212); 
     13-- search engine index 
     14CREATE INDEX entries_idx ON entries USING gin(to_tsvector('spanish', body)); 
    1315 
    14  
  • trunk/app/config/sql/postgresql/lessons.sql

    r436 r750  
    1414); 
    1515 
    16  
     16CREATE INDEX lessons_idx ON lessons USING gin(to_tsvector('spanish', body)); 
  • trunk/app/config/sql/postgresql/news.sql

    r665 r750  
    18183, 1, 1); 
    1919 
     20CREATE INDEX news_idx ON news USING gin(to_tsvector('spanish', body)); 
  • trunk/app/controllers/entries_controller.php

    r738 r750  
    106106  $this->layout = 'portal'; 
    107107       
    108   $this->pageTitle = 'Search Results :: Karamelo E-learning on Web 2.0'; 
     108  $this->pageTitle = __('Search Results',true). ' :: Karamelo E-learning on Web 2.0'; 
    109109       
    110110  $this->Portal->statics(); // Charge Portal components aka Sidebars 
     
    112112  $this->Sanitize = new Sanitize; 
    113113       
    114   $this->Sanitize->paranoid($this->data["Entry"]["terms"]);  
    115        
    116   $this->set('data', $this->Search->getRows($this->data["Entry"]["terms"])); 
     114  $this->Sanitize->paranoid($this->data['Entry']['terms']);  
     115  $q  = 'SELECT id, title FROM entries WHERE '; 
     116  $q .= '  to_tsvector(title || body) @@ to_tsquery(\''.$this->data['Entry']['terms'].'\') '; 
     117  $q .= '  ORDER BY created DESC LIMIT 10'; 
     118      
     119  $this->set('data', $this->Search->getRows($this->data['Entry']['terms'])); 
    117120 } 
    118121  
  • trunk/app/views/layouts/basic.ctp

    r674 r750  
    7272<tr><td id="tdsidebar"> 
    7373<?php  
    74  if ( $blog["Vclassroom"] != null):  
     74 if ( $blog['Vclassroom'] != null):  
    7575     echo $this->element('vclassrooms', $blog['Vclassroom']);   
    7676 endif; 
     
    8888  
    8989     
    90  if ( $blog["Lesson"] != null ): 
     90 if ( $blog['Lesson'] != null ): 
    9191      echo $this->element('lesson', $blog['Lesson']);   
    9292 endif;  
    9393          
    94  if ( $blog["Podcast"] != null ):  
     94 if ( $blog['Podcast'] != null ):  
    9595      echo $this->element('podcast', $blog['Podcast']);   
    9696 endif; 
    9797          
    98  if ( $blog["Catfaq"] != null ):  
     98 if ( $blog['Catfaq'] != null ):  
    9999      echo $this->element('catfaqs', $blog['Catfaq']);   
    100100 endif; 
    101101          
    102  if ( $blog["Acquaintance"] != null ):  
     102 if ( $blog['Acquaintance'] != null ):  
    103103     echo $this->element('acquaintances', $blog['Acquaintance']);   
    104104 endif; 
  • trunk/app/views/layouts/paris.ctp

    r541 r750  
     1<?php 
     2   echo '<?xml version="1.0"?>'; 
     3   echo $html->docType(); 
     4?> 
     5<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
     6<head>  
     7<?php 
     8    if ( isset($javascript) ): 
     9          echo $html->charset('UTF-8'); 
     10          echo $javascript->link('prototype'); 
     11          echo $javascript->link('myfunctions'); 
     12          echo $javascript->link('scriptaculous.js?load=effects'); 
     13     endif; 
     14?> 
     15<meta http-equiv="content-type" content="text/html; charset=utf-8" />  
     16<meta http-equiv="content-language" content="es" />  
     17<meta name="robots" content="all,follow" />  
     18<meta name="author" content="Karamelo by Chipotle Software" />  
     19<meta name="copyright" content="Chipotle Software" /> 
     20<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php echo '/entries/rss/'.$blog['User']['username'].'.rss'; ?>" /> 
     21<title> <?php echo $title_for_layout?> </title>  
     22<meta name="description" content="Edublog" />  
     23<meta name="keywords" content="edublog, elearning, karamelo" />  
     24              
     25<link rel="index" href="./" title="Home" />  
     26<?php echo $html->css('paris/styles'); ?> 
     27</head> 
     28<body>  
     29<script type="text/javascript"> 
     30   window.onload = timedMsg; 
     31</script> 
     32<?php $session->flash(); ?>  
     33 
     34<table id="maintable">   
     35<tr><td colspan="2" id="header"> 
     36<h1> 
    137<?php  
    2    echo '<?xml version="1.0"?>';  
    3    echo $html->docType();  
     38e($html->link($blog['User']['name_blog'], '/blog/'.$blog['User']['username'], array("title"=>$blog['User']['name_blog'])));  
    439?> 
    5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    6 <head> 
     40</h1>  
     41 
     42<?php echo $html->div('quote', ''.$blog['User']['quote']); ?>  
     43   
     44<div id="toplinks"> 
     45<?php  
     46 echo $html->link('eduBlog',   '/blog/'.$blog['User']['username']);  
     47 echo $html->link('Portfolio', '/users/portfolio/'.$blog['User']['username']);  
     48 echo $html->link('About me',  '/vclassrooms/aboutme/'.$blog['User']['username']); 
     49 echo $html->link('Contact',   '/messages/message/'.$blog['User']['username']); 
     50?> 
     51</div> 
     52</td></tr> 
     53<tr><td colspan="2" id="separator">&nbsp;</td></tr> 
     54<tr> 
     55<td id="tdrss">  
     56<!-- RSS feeds -->  
     57<strong>RSS:</strong>  
    758<?php 
    8 if ( isset($javascript) ): 
    9          echo $html->charset('UTF-8'); 
    10          echo $javascript->link('prototype'); 
    11          echo $javascript->link('scriptaculous.js?load=effects'); 
    12 endif; 
     59 e($html->link('Blog', '/entries/rss/'.$blog['User']['username'] . '.rss', array('class'=>'smallinks')). ' / ');  
     60 e($html->link('Podcast', '/podcasts/rss/'.$blog['User']['username'].'.rss', array('class'=>'smallinks'))); 
     61?> 
     62</td> 
     63<td id="tdquote"> 
     64<?php  
     65 if ( isset($blog['Quote'][0]['quote']) ): 
     66    e('<i>'.$blog['Quote'][0]['quote'] . '</i><br /><b>'. $blog['Quote'][0]['author'].'</b>'); 
     67 endif; 
     68?> 
     69</td> 
     70</tr> 
    1371 
    14 echo $html->css('paris/paris'); 
    15  
    16 ?> 
    17 <title><?php echo $title_for_layout?> </title> 
    18 </head> 
    19  
    20 <body> 
    21 <?php echo $this->element('search_blog'); ?> 
    22  
    23 <div id="box"> 
    24  
    25 <!-- Top Corners Nested divs --><div id="top-left"><div id="top-right">&nbsp;</div>&nbsp;</div> 
    26  
    27 <!-- Header --> 
    28 <div id="header"> 
    29  <!-- user_name_blog -->          
    30  <h1 id="logo"> 
    31  <?php 
    32       echo $html->link($blog["User"]["name_blog"], '/blog/'.$blog["User"]["username"], 
    33                        array("title"=>$blog["User"]["name_blog"])); 
    34  ?> 
    35  </h1> 
    36     <div id="quote"><?php echo $blog["User"]["quote"] ?></div> 
    37            
    38  </div><!-- /header --> 
    39  <div style="clear:both"></div> 
    40  <!-- Main menu  --> 
    41  <div id="menu5"> 
    42  <ul> 
    43  <?php 
    44     $url = substr($_SERVER['argv'][0], 4, 10); 
    45        echo ($url == 'users/blog') ? '<li id="active">' : '<li>'; ?><a href="/users/blog/<?php echo $blog["User"]["username"] ?>">eduBlog</a></li> 
    46                         
    47      <?php echo ($url == 'users/port') ? '<li id="active">' : '<li>'; ?><a href="/users/portfolio/<?php echo $blog["User"]["username"] ?>">Portfolio</a></li>                
    48       <?php echo ($url == 'users/abou') ? '<li id="active">' : '<li>'; ?> <a href="/users/about/<?php echo $blog["User"]["username"] ?>">About Me</a></li> 
    49    
    50       <?php echo ($url == 'messages/c') ? '<li id="active">' : '<li>'; ?> <a href="/messages/message/<?php echo $blog["User"]["username"] ?>">Contact</a></li> 
    51   </ul> 
    52 </div> <!-- /tabs --> 
    53 <!-- Content div --> 
    54 <div id="content"> 
    55  
    56 <div id="main"> 
    57    <?php echo $content_for_layout; ?> 
    58 </div> 
    59  
    60 <div id="sidebar"> 
    61 <?php 
    62  if ( $blog["Lesson"] != null): 
    63             echo $this->element('lesson', $blog["Lesson"]);  
     72<tr><td id="tdsidebar"> 
     73<?php  
     74 if ( $blog['Vclassroom'] != null):  
     75     echo $this->element('vclassrooms', $blog['Vclassroom']);   
    6476 endif; 
    6577 
    66  if ( $blog["Podcast"] != null ): 
    67             echo $this->element('podcast', $blog["Podcast"]);  
     78 echo $html->para(null,$html->link($html->image('static/ooo_banner.png', array('alt'=>'OpenOffice.org')), 'http://extensions.services.openoffice.org/',  null, null, false)); 
     79 
     80 echo $html->div('temas', $blog['User']['username'] . ' profile');  
     81 echo $html->para('cv', $blog['User']['cv']); 
     82 echo $html->para(null,$html->image('avatars/'.$blog['User']['avatar'], array("alt"=>$blog['User']['username'], "title"=>$blog['User']['username'])), array('style'=>'text-align:center')); 
     83     
     84 echo $html->div('temas', 'College');  
     85 echo $html->para(null,$html->link( 
     86               $html->image(' 
     87static/cwclogo.jpg', array('alt'=>'Conrad', 'title'=>'Conrad College')), '/', null,null, false), 
     88        array('style'=>'text-align:center')); 
     89  
     90     
     91 if ( $blog['Lesson'] != null ): 
     92      echo $this->element('lesson', $blog['Lesson']);   
     93 endif;  
     94          
     95 if ( $blog['Podcast'] != null ):  
     96      echo $this->element('podcast', $blog['Podcast']);   
    6897 endif; 
    69                  
    70  if ( $blog["Catfaq"] != null ): 
    71            echo $this->element('catfaqs', $blog["Catfaq"]);  
     98         
     99 if ( $blog['Catfaq'] != null ):  
     100      echo $this->element('catfaqs', $blog['Catfaq']);  
    72101 endif; 
    73                  
    74  if ( $blog["Acquaintance"] != null); 
    75            echo $this->element('acquaintances', $blog["Acquaintance"]);  
     102         
     103 if ( $blog['Acquaintance'] != null ):  
     104     echo $this->element('acquaintances', $blog['Acquaintance']);  
    76105 endif; 
    77106         
    78  if ( $blog["Vclassroom"] != null): 
    79            echo $this->element('vclassrooms', $blog["Vclassroom"]);  
    80  endif; 
    81         
    82 /* if ( $blog["Catforum"] != null): 
    83                       echo $this->element('catforums', $blog["Catforum"]);  
    84  endif; */ 
    85107 
    86  if ( !$session->check('Auth.User') ):  
    87       echo '<p style="text-align:center;margin:35px 0 35px 0">' . $html->link( 
    88          $html->image('static/login.png', array("alt"=>'Login', "title"=>'Login')), 
    89                                                          '/users/login', false, false, null) . "</p>"; 
    90  endif; 
    91 ?> 
    92            
    93          <div class="temas">Powered by:</div> 
    94          <div style="text-align:center;padding-top:15px"><a href="/"> 
    95                <img src="/img/static/karamelo_logo.jpg" alt="Karamelo" title="Karamelo" style="border:2px solid black;" />  
    96          </a> 
    97          </div> <!-- /col-in --> 
    98         </div> <!-- /col --> 
    99 </div> 
    100 <div style="clear:both"></div> 
    101  <!-- Footer --> 
    102  <div id="footer"> 
    103       <div id="top">Back on top <a href="#header" title="Back on top ^">^</a></div> 
    104       <div>Chipotle Software &copy; 2002-2008. Creative Commons. Some rights reserved.</div> 
    105   </div> <!-- /footer --> 
     108 if ( !$session->check('Auth.User') ):   
     109      e($html->para(null, $html->link( 
     110                           $html->image('static/login.png', array('alt'=>'Login', 'title'=>'Login')),  
     111                           '/users/login', false, false, null), array('style'=>'text-align:center;margin:35px 0 35px 0')));  
     112 endif;  
     113      
     114 e($html->div('temas', 'Powered by')); 
     115 e($html->div(null, $html->link($html->image('banners/banner_karamelo.jpg', array('style'=>'border:1px solid black','alt'=>'Karamelo', 'title'=>'Karamelo')),  
     116'http://www.chipotle-software.com', null, null,false), aa('style', 'text-align:center;padding-top:15px'))); 
     117?>                
     118</td> 
     119<td id="tdcontent"> 
     120    <?php e($content_for_layout); ?>  
     121</td> 
     122</tr> 
     123</table> 
    106124 
    107 </div><!-- div content ends --> 
    108  
    109  
    110 <!-- Bottom Corners Nested divs --> 
    111 <div id="bottom-left"> 
    112 <div id="bottom-right">&nbsp;</div>&nbsp;</div><!-- "Empty" divs contain non-breaking spaces to avoid a rendering problem with the bottom corners extending below the box in IE 5 (Mac). --> 
    113  
    114 </div><!-- end box div --> 
    115  
    116 </body> 
    117  
     125<!-- Footer -->  
     126<div id="footer">  
     127  Back on top <a href="#header" title="Back on top ^">^</a> <b>Chipotle Software &copy; 2002-2008</b>. Creative Commons. Some rights reserved. 
     128</div>  
     129</body>  
    118130</html>