Exemplo n.º 1
0
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new WiziappDB();
     }
     return self::$_instance;
 }
 public function getAll()
 {
     $albums = array();
     // Get all the images grouped by the content
     $data = WiziappDB::getInstance()->get_images_for_albums();
     if ($data !== FALSE) {
         // We have images, now we need to sort them into albums if they fit the rules
         foreach ($data as $content_id => $images) {
             $minimumForAppearInAlbums = WiziappConfig::getInstance()->count_minimum_for_appear_in_albums;
             if (count($images) >= $minimumForAppearInAlbums) {
                 $albums[] = $this->_prepareAlbumBasicData($content_id, $images);
             }
         }
     }
     return $albums;
 }
 /**
  * Revert the installation to remove everything the plugin added
  */
 public function uninstall()
 {
     WiziappDB::getInstance()->uninstall();
     // Remove scheduled tasks
     wp_clear_scheduled_hook('wiziapp_daily_function_hook');
     wp_clear_scheduled_hook('wiziapp_weekly_function_hook');
     wp_clear_scheduled_hook('wiziapp_monthly_function_hook');
     // Deactivate the blog with the global services
     try {
         $cms = new WiziappCms();
         $cms->deactivate();
     } catch (Exception $e) {
         // If it failed, it's ok... move on
     }
     // Remove all options - must be done last
     delete_option('wiziapp_screens');
     delete_option('wiziapp_components');
     delete_option('wiziapp_pages');
     delete_option('wiziapp_last_processed');
     WiziappConfig::getInstance()->uninstall();
 }
Exemplo n.º 4
0
function wiziapp_buildVideoPage($video_id)
{
    //    $screen_conf = $GLOBALS['WiziappScreens']->getScreenLayout('video', 'page');
    global $video_row, $blog_title;
    //    $page = array();
    //$video_row = $GLOBALS['WiziappDB']->get_videos_by_provider_id($video_id);
    $video_row = WiziappDB::getInstance()->get_videos_by_id($video_id);
    $blog_title = wiziapp_apply_request_title(wp_title('«', false, 'right') . get_bloginfo('name'));
    $GLOBALS['WiziappLog']->write('info', "Preloading the video: " . $video_id, "screens.wiziapp_buildVideoPage");
    wiziapp_load_template(dirname(__FILE__) . '/../../themes/iphone/video.php');
}