linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file quickbox.php

Documentation is available at quickbox.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage news
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!function_exists('AuthenthificationProcess')) {
  13.     include_once("../lib/lib_common.php");
  14.     ReloadIndex('admin');
  15. } 
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!HaveRight('news')) ReloadIndex('admin');
  20. ////////////
  21.  
  22. $qbx_module=$GLOBALS['lang']['menu']['news'];
  23.  
  24. if ($todo == 'add') {
  25.     $result=$sql_object->DBSelect($req_quickbox_add);
  26.     $qbx_liste='';
  27.     $nb='';
  28.     if($result==0) {
  29.         $qbx_liste.="<li>".$GLOBALS['lang']['divers']['nodata']."</li>";
  30.     } else {    
  31.         if(count($result)>=10) $nb=10; else $nb=count($result);
  32.         for($i=0; $i<count($result); $i++) {
  33.             $qbx_news_title=formatText(cutText($result[$i]['news_title'], 47), '2HTML');
  34.             $qbx_liste.="<li><a href=\"index.php?id=". $result[$i]['news_id'] ."&amp;rub=".$rub."&amp;todo=det\" title=\"".$GLOBALS['lang']['divers']['date_crea'].": ".$result[$i]['news_date_crea_display']." \">". $qbx_news_title ."</a></li>\n";
  35.         }
  36.     }
  37.     $qbx_h1=$nb.$GLOBALS['lang']['news']['qb_titleadd'];
  38. }
  39.  
  40. if ($todo == 'mod' || $todo == 'det') {
  41.     $result=$sql_object->DBSelect($req_quickbox_mod);
  42.     $qbx_liste='';
  43.     $nb='';
  44.     if($result==0) {
  45.         $qbx_liste.="<li>".$GLOBALS['lang']['divers']['nodata']."</li>";
  46.     } else {    
  47.         if(count($result)>=10) $nb=10; else $nb=count($result);
  48.         for($i=0; $i<count($result); $i++) {
  49.             $qbx_news_title=formatText(cutText($result[$i]['news_title'], 47), '2HTML');
  50.             $qbx_liste.="<li><a href=\"index.php?id=". $result[$i]['news_id'] ."&amp;rub=".$rub."&amp;todo=det\" title=\"".$GLOBALS['lang']['divers']['last_modify']." ".$result[$i]['news_last_modify_display']." - (".$GLOBALS['lang']['divers']['date_crea'].": ".$result[$i]['news_date_crea_display'].") \">". $qbx_news_title ."</a></li>\n";
  51.         }
  52.     }
  53.     $qbx_h1=$nb.$GLOBALS['lang']['news']['qb_titlemod'];
  54. }
  55. if ($todo == 'sup') {
  56.     $result=$sql_object->DBSelect($req_quickbox_sup);
  57.     $qbx_liste='';
  58.     $nb='';
  59.     if($result==0) {
  60.         $qbx_liste.="<li>".$GLOBALS['lang']['divers']['nodata']."</li>";
  61.     } else {    
  62.         if(count($result)>=10) $nb=10; else $nb=count($result);
  63.         for($i=0; $i<count($result); $i++) {
  64.             $qbx_news_title=formatText(cutText($result[$i]['news_title'], 47), '2HTML');
  65.             $qbx_liste.="<li><a href=\"#\" title=\"".$GLOBALS['lang']['divers']['date_sup']." ".$result[$i]['news_last_modify_display']." - (".$GLOBALS['lang']['divers']['date_crea'].": ".$result[$i]['news_date_crea_display'].") \">". $qbx_news_title ."</a></li>\n";
  66.         }
  67.     }
  68.     $qbx_h1=$nb.$GLOBALS['lang']['news']['qb_titlesup'];
  69. } 
  70. if ($todo == 'list') {
  71.     $result=$sql_object->DBSelect($req_quickbox_list);
  72.     $qbx_liste='';
  73.     $nb='';
  74.     if($result==0) {
  75.         $qbx_liste.="<li>".$GLOBALS['lang']['divers']['nodata']."</li>";
  76.     } else {    
  77.         if(count($result)>=10) $nb=10; else $nb=count($result);
  78.         for($i=0; $i<count($result); $i++) {
  79.             $qbx_news_title=formatText(cutText($result[$i]['news_title'], 47), '2HTML');
  80.             $qbx_liste.="<li><a href=\"index.php?id=". $result[$i]['news_id'] ."&amp;rub=".$rub."&amp;todo=det\" title=\"".$GLOBALS['lang']['divers']['date_publi']." ".$result[$i]['news_published_date_display']." - (".$GLOBALS['lang']['divers']['date_crea'].": ".$result[$i]['news_date_crea_display'].") \">". $qbx_news_title ."</a></li>\n";
  81.         }
  82.     }
  83.     $qbx_h1=$nb.$GLOBALS['lang']['news']['qb_titlepubli'];
  84. } 
  85.  
  86. echo QuickBoxNow($qbx_module, $qbx_h1, $qbx_liste);
  87. echo "</div>\n";
  88. ?>

Documentation generated on Sat, 08 Nov 2008 14:54:18 +0100 by phpDocumentor 1.4.1