/**
  * Set variables for blog display
  *
  */
 function Init()
 {
     global $addonPathData;
     $this->addonPathData = $addonPathData;
     $this->indexFile = $this->addonPathData . '/index.php';
     if (SimpleBlogCommon::$data) {
         return;
     }
     SimpleBlogCommon::$root_url = 'Special_Blog';
     if (is_callable(array('common', 'SpecialHref'))) {
         SimpleBlogCommon::$root_url = common::SpecialHref('Special_Blog');
     }
     $this->GetBlogData();
     SimpleBlogCommon::AddCSS();
 }
Example #2
0
 /**
  * Set variables for blog display
  *
  */
 public static function Init()
 {
     global $addonPathData;
     if (isset(self::$data)) {
         return;
     }
     self::$data_dir = $addonPathData;
     self::$index_file = self::$data_dir . '/index.php';
     self::$root_url = 'Special_Blog';
     if (is_callable(array('common', 'SpecialHref'))) {
         self::$root_url = common::SpecialHref('Special_Blog');
     }
     self::GetBlogData();
     self::AddCSS();
     //regenerate if there are pending posts that need to be published
     if (!is_null(SimpleBlogCommon::$data['next_regen']) && SimpleBlogCommon::$data['next_regen'] < time()) {
         if (@gpFiles::WriteLock()) {
             self::GenStaticContent();
             SimpleBlogCommon::NextGenTime();
             SimpleBlogCommon::SaveIndex();
             gpFiles::Unlock('write', gp_random);
         }
     }
 }