Ejemplo n.º 1
0
 function actionPerform(&$skin, $moduleID)
 {
     $query = "SELECT  *  FROM {$skin->main->databaseTablePrefix}module_settings WHERE setting_key='feed_URL' AND module_id={$moduleID}";
     $recordSet = $skin->main->databaseConnection->Execute($query);
     //Check for error, if an error occured then report that error
     if (!$recordSet) {
         //Assign codeBehind variables
         $skin->main->controlVariables["rssFeed"]["allItems"] = array();
         $skin->main->controlVariables["rssFeed"]["itemCount"] = 0;
         trigger_error("Unable to get rss feed url\nreason is : " . $skin->main->databaseConnection->ErrorMsg());
     } else {
         $rows = $recordSet->GetRows();
         if (sizeof($rows) == 1) {
             $feedURL = $rows[0]['setting_value'];
             $rss = new RSS(implode("", file($feedURL)));
             //Assign codeBehind variables
             $allItems = $rss->getAllItems();
             $skin->main->controlVariables["rssFeed"]["allItems"] = $allItems;
             $skin->main->controlVariables["rssFeed"]["itemCount"] = count($allItems);
         } else {
             //Assign codeBehind variables
             $skin->main->controlVariables["rssFeed"]["allItems"] = array();
             $skin->main->controlVariables["rssFeed"]["itemCount"] = 0;
         }
     }
 }