[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/content/ -> content_update_check.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_update_check.php,v $
  14  |     $Revision: 1.10 $
  15  |     $Date: 2006/07/28 14:07:14 $
  16  |     $Author: lisa_ $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  if (!defined('e107_INIT')) { exit; }
  21  
  22  $dbupdatep['content_07'] =  LAN_UPDATE_8." .617 content ".LAN_UPDATE_9." .7 content";
  23  function update_content_07($type='') 
  24  {
  25      global $sql, $mySQLdefaultdb;
  26      if($type == 'do')
  27      {
  28          if(!isset($_POST['updateall']))
  29          {    
  30              include_once(e_PLUGIN.'content/content_update.php');
  31          }
  32      }
  33      else
  34      {
  35          // FALSE = needed, TRUE = not needed.
  36          
  37          //if not installed, return FALSE = needed
  38          if(!$sql->db_Select("plugin", "plugin_version", "plugin_path = 'content'")){
  39              return FALSE; //needed
  40          }else{
  41              $row = $sql->db_Fetch();
  42              
  43              //if version < 1.23, return FALSE = needed
  44              if($row['plugin_version'] < 1.24){
  45                  return FALSE; //needed
  46              }
  47  
  48              $newcontent = $sql -> db_Count("pcontent", "(*)", "");
  49              
  50              //if no rows in new table && no old content table exists, return FALSE = needed
  51              $exists = mysql_query("SELECT 1 FROM ".MPREFIX."content LIMIT 0");
  52              if($newcontent == 0 && !$exists){
  53                  return FALSE; //needed
  54              }
  55              
  56              //if parent value is old style, return FALSE = needed
  57              if($newcontent > 0){
  58                  if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){
  59                      while($row = $sql -> db_Fetch()){
  60                          if( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){
  61                              //if item with old parent value exists, you need to upgrade to 1.1
  62                              return FALSE; //needed
  63                          }
  64                      }
  65                  }
  66              }
  67  
  68              //if added fields are not present, return FALSE = needed
  69              $field1 = $sql->db_Field("pcontent",19);
  70              $field2 = $sql->db_Field("pcontent",20);
  71              $field3 = $sql->db_Field("pcontent",21);
  72              if($field1 != "content_score" && $field2 != "content_meta" && $field3 != "content_layout"){
  73                  return FALSE; //needed
  74              }
  75  
  76              //else if passing all above checks, return TRUE = not needed
  77              return TRUE;
  78          }
  79      }
  80  }
  81  
  82  
  83  
  84  ?>
  85              


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7