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();
 }
Пример #3
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');
}
Пример #4
0
        delete_option('wiziapp_db_version');
    }
    public function needUpgrade()
    {
        $installedVer = get_option("wiziapp_db_version");
        return $installedVer != $this->internal_version;
    }
    public function upgrade()
    {
        /**
         * If there are any special upgrade between the versions
         * this is the place to call them, we can do this
         * by adding methods like upgradeFrom0_1 and checking if the method exists
         *
         * For now a simple diff that is handled by the install anyway is fine.
         */
        return $this->install();
    }
}
/**
* One database to talk with them all...
* @todo reconsider the global things...
* @global WiziappDB $GLOBALS['WiziappDB']
*/
if (!isset($GLOBALS['WiziappDB'])) {
    /**
     * Initiate the Wiziapp Database Object, for later cache reasons
     */
    unset($GLOBALS['WiziappDB']);
    $GLOBALS['WiziappDB'] = WiziappDB::getInstance();
}