[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/includes/ -> nsnne_func.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /********************************************************/
   7  /* NSN News                                             */
   8  /* By: NukeScripts Network (webmaster@nukescripts.net)  */
   9  /* http://www.nukescripts.net                           */
  10  /* Copyright (c)2000-2005 by NukeScripts Network         */
  11  /********************************************************/
  12  
  13  /*****[CHANGES]**********************************************************
  14  -=[Base]=-
  15        Nuke Patched                             v3.1.0       06/26/2005
  16        Caching System                           v1.0.0       10/31/2005
  17   ************************************************************************/
  18  
  19  if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
  20      exit('Access Denied');
  21  }
  22  
  23  function ne_save_config($config_name, $config_value){
  24      global $prefix, $db, $cache;
  25      $db->sql_query("UPDATE ".$prefix."_nsnne_config SET config_value='$config_value' WHERE config_name='$config_name'");
  26  /*****[BEGIN]******************************************
  27   [ Base:    Caching System                     v3.0.0 ]
  28   ******************************************************/
  29      $cache->delete('news', 'config');
  30  /*****[END]********************************************
  31   [ Base:    Caching System                     v3.0.0 ]
  32   ******************************************************/
  33  }
  34  
  35  function ne_get_configs(){
  36      global $prefix, $db, $cache;
  37      static $config;
  38      if(isset($config)) return $config;
  39  /*****[BEGIN]******************************************
  40   [ Base:    Caching System                     v3.0.0 ]
  41   ******************************************************/
  42      if(($config = $cache->load('news', 'config')) === false) {
  43  /*****[END]********************************************
  44   [ Base:    Caching System                     v3.0.0 ]
  45   ******************************************************/
  46          $configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_nsnne_config");
  47          while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
  48              $config[$config_name] = $config_value;
  49          }
  50          $db->sql_freeresult($configresult);
  51  /*****[BEGIN]******************************************
  52   [ Base:    Caching System                     v3.0.0 ]
  53   ******************************************************/
  54          $cache->save('news', 'config', $config);
  55      }
  56  /*****[END]********************************************
  57   [ Base:    Caching System                     v3.0.0 ]
  58   ******************************************************/
  59      return $config;
  60  }
  61  
  62  function automated_news() {
  63      global $prefix, $multilingual, $currentlang, $db;
  64      $result = $db->sql_query('SELECT * FROM '.$prefix.'_autonews WHERE time<="'.date('Y-m-d G:i:s', time()).'"');
  65      while ($row2 = $db->sql_fetchrow($result)) {
  66          $title = addslashes($row2['title']);
  67          $hometext = addslashes($row2['hometext']);
  68          $bodytext = addslashes($row2['bodytext']);
  69          $notes = addslashes($row2['notes']);
  70          $db->sql_query("INSERT INTO ".$prefix."_stories VALUES (NULL, '$row2[catid]', '$row2[aid]', '$title', '$row2[time]', '$hometext', '$bodytext', '0', '0', '$row2[topic]', '$row2[informant]', '$notes', '$row2[ihome]', '$row2[alanguage]', '$row2[acomm]', '0', '0', '0', '0', '$row2[associated]', '0', '1')");
  71      }
  72      if ($db->sql_numrows($result)) {
  73          $db->sql_query('DELETE FROM '.$prefix.'_autonews WHERE time<="'.date('Y-m-d G:i:s', time()).'"');
  74      }
  75      $db->sql_freeresult($result);
  76  }
  77  
  78  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7