• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP C_Component_Registry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中C_Component_Registry的典型用法代码示例。如果您正苦于以下问题:PHP C_Component_Registry类的具体用法?PHP C_Component_Registry怎么用?PHP C_Component_Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了C_Component_Registry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_gallery

 /**
  * Retrieves and caches an I_Gallery_Mapper instance for this gallery id
  *
  * @param int $gallery_id Gallery ID
  * @return mixed
  */
 public function get_gallery($gallery_id)
 {
     if (!isset($this->galleries[$gallery_id]) || is_null($this->galleries[$gallery_id])) {
         $this->galleries[$gallery_id] = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
     }
     return $this->galleries[$gallery_id];
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:13,代码来源:class.image_wrapper_collection.php


示例2: getData

 function getData($number)
 {
     global $wpdb;
     $data = array();
     $pictures = $wpdb->get_results("SELECT a.*, b.path FROM " . $wpdb->base_prefix . "ngg_pictures AS a LEFT JOIN " . $wpdb->base_prefix . "ngg_gallery AS b ON a.galleryid = b.gid WHERE a.galleryid = '" . intval($this->_data->get('nggsourcegallery', 0)) . "'");
     $i = 0;
     if (class_exists('nggGallery') && !class_exists('C_Component_Registry')) {
         // legacy
         foreach ($pictures as $p) {
             $data[$i]['alt_text'] = $p->alttext;
             $data[$i]['image'] = nggGallery::get_image_url($p->pid, $p->path, $p->filename);
             $data[$i]['thumbnail'] = nggGallery::get_thumbnail_url($p->pid, $p->path, $p->filename);
             $i++;
         }
     } else {
         $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage');
         foreach ($pictures as $p) {
             $data[$i]['alt_text'] = $p->alttext;
             $data[$i]['image'] = $storage->get_image_url($p);
             $data[$i]['thumbnail'] = $storage->get_thumbnail_url($p);
             $i++;
         }
     }
     return $data;
 }
开发者ID:AndyHuntDesign,项目名称:andyhuntdesign,代码行数:25,代码来源:generator.php


示例3: render_related_string

 function render_related_string()
 {
     $settings = C_NextGen_Settings::get_instance();
     $type = $settings->appendType;
     $maxImages = $settings->maxImages;
     $sluglist = array();
     switch ($type) {
         case 'tags':
             if (function_exists('get_the_tags')) {
                 $taglist = get_the_tags();
                 if (is_array($taglist)) {
                     foreach ($taglist as $tag) {
                         $sluglist[] = $tag->slug;
                     }
                 }
             }
             break;
         case 'category':
             $catlist = get_the_category();
             if (is_array($catlist)) {
                 foreach ($catlist as $cat) {
                     $sluglist[] = $cat->category_nicename;
                 }
             }
             break;
     }
     $taglist = implode(',', $sluglist);
     if ($taglist === 'uncategorized' || empty($taglist)) {
         return;
     }
     $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
     $view = C_Component_Registry::get_instance()->get_utility('I_Component_Factory')->create('mvc_view', '');
     $retval = $renderer->display_images(array('source' => 'tags', 'container_ids' => $taglist, 'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS, 'images_per_page' => $maxImages, 'maximum_entity_count' => $maxImages, 'template' => $view->get_template_abspath('photocrati-nextgen_gallery_display#related'), 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'disable_pagination' => TRUE));
     return apply_filters('ngg_show_related_gallery_content', $retval, $taglist);
 }
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:35,代码来源:adapter.displayed_gallery_related_element.php


示例4: enqueue_displayed_gallery_trigger_buttons_resources

 function enqueue_displayed_gallery_trigger_buttons_resources($displayed_gallery = FALSE)
 {
     if (!wp_style_is('fontawesome', 'registered')) {
         if (strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') !== FALSE) {
             wp_register_style('fontawesome', site_url('/?ngg_serve_fontawesome_css=1'));
         } else {
             $router = C_Component_Registry::get_instance()->get_utility('I_Router');
             wp_register_style('fontawesome', $router->get_static_url('photocrati-nextgen_gallery_display#fontawesome/font-awesome.css'));
         }
     }
     if (!$this->run_once && !empty($displayed_gallery) && !empty($displayed_gallery->display_settings['ngg_triggers_display']) && $displayed_gallery->display_settings['ngg_triggers_display'] !== 'never') {
         $pro_active = FALSE;
         if (defined('NGG_PRO_PLUGIN_VERSION')) {
             $pro_active = 'NGG_PRO_PLUGIN_VERSION';
         }
         if (defined('NEXTGEN_GALLERY_PRO_VERSION')) {
             $pro_active = 'NEXTGEN_GALLERY_PRO_VERSION';
         }
         if (!empty($pro_active)) {
             $pro_active = constant($pro_active);
         }
         if (!is_admin() && (empty($pro_active) || version_compare($pro_active, '1.0.11') >= 0)) {
             wp_enqueue_style('fontawesome');
             $this->run_once = TRUE;
         }
     }
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:27,代码来源:adapter.displayed_gallery_trigger_resources.php


示例5: get_registry

 /**
  * Gets the Pope component registry
  * @return C_Component_Registry
  */
 function get_registry()
 {
     if (!isset($this->_registry)) {
         $this->_registry = C_Component_Registry::get_instance();
     }
     return $this->_registry;
 }
开发者ID:kixortillan,项目名称:dfosashworks,代码行数:11,代码来源:album.php


示例6:

 /**
  * Returns a singleton
  * @return C_Component_Registry()
  */
 static function &get_instance()
 {
     if (is_null(self::$_instance)) {
         $klass = get_class();
         self::$_instance = new $klass();
     }
     return self::$_instance;
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:12,代码来源:class.component_registry.php


示例7: _handle_url

 /**
  * Parses certain paths through get_static_url
  *
  * @param string $url
  * @return string Resulting URL
  */
 static function _handle_url($url)
 {
     $router = C_Component_Registry::get_instance()->get_utility('I_Router');
     if (0 !== strpos($url, '/') && 0 !== strpos($url, 'wordpress#') && 0 !== strpos($url, 'http://') && 0 !== strpos($url, 'https://')) {
         $url = $router->get_static_url($url);
     } elseif (strpos($url, '/') === 0) {
         $url = home_url($url);
     }
     return $url;
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:16,代码来源:module.lightbox.php


示例8: _generate_module_info

 static function _generate_module_info()
 {
     $retval = array();
     $registry = C_Component_Registry::get_instance();
     foreach ($registry->get_module_list() as $module_id) {
         $module_version = $registry->get_module($module_id)->module_version;
         $retval[$module_id] = "{$module_id}|{$module_version}";
     }
     return $retval;
 }
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:10,代码来源:class.photocrati_installer.php


示例9: _filter_modules

 function _filter_modules($pope_modules_list, $product)
 {
     foreach ($product as $module_name) {
         $module = C_Component_Registry::get_instance()->get_module($module_name);
         $str = $module->module_id . '|' . $module->module_version;
         $search = array_search($str, $pope_modules_list);
         if (FALSE !== $search) {
             unset($pope_modules_list[$search]);
         }
     }
     return $pope_modules_list;
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:12,代码来源:class.nextgen_product_installer.php


示例10: render_slideshow

 function render_slideshow($galleryID, $irWidth = '', $irHeight = '', $args)
 {
     $registry = C_Component_Registry::get_instance();
     $renderer = $registry->get_utility('I_Displayed_Gallery_Renderer');
     $params = array('container_ids' => $galleryID, 'display_type' => 'photocrati-nextgen_basic_slideshow', 'gallery_width' => $irWidth, 'gallery_height' => $irHeight, 'source' => 'galleries', 'slug' => 'widget-' . $args['widget_id'], 'entity_types' => array('image'), 'show_thumbnail_link' => FALSE, 'ngg_triggers_display' => 'never');
     if (0 === $galleryID) {
         $params['source'] = 'random_images';
         unset($params['container_ids']);
     }
     $retval = $renderer->display_images($params, NULL);
     $retval = apply_filters('ngg_show_slideshow_widget_content', $retval, $galleryID, $irWidth, $irHeight);
     return $retval;
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:13,代码来源:class.widget_slideshow.php


示例11: widget

 function widget($args, $instance)
 {
     // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist
     $before_widget = NULL;
     $before_title = NULL;
     $after_widget = NULL;
     $after_title = NULL;
     $widget_id = NULL;
     extract($args);
     $settings = C_NextGen_Settings::get_instance();
     $parent = C_Component_Registry::get_instance()->get_utility('I_Widget');
     $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base);
     $parent->render_partial('photocrati-widget#display_mediarss', array('self' => $this, 'instance' => $instance, 'title' => $title, 'settings' => $settings, 'before_widget' => $before_widget, 'before_title' => $before_title, 'after_widget' => $after_widget, 'after_title' => $after_title, 'widget_id' => $widget_id));
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:14,代码来源:class.widget_mediarss.php


示例12: media_upload_nextgen

function media_upload_nextgen()
{
    // Not in use
    $errors = false;
    // Generate TinyMCE HTML output
    if (isset($_POST['send'])) {
        $keys = array_keys($_POST['send']);
        $send_id = (int) array_shift($keys);
        $image = $_POST['image'][$send_id];
        $alttext = stripslashes(htmlspecialchars($image['alttext'], ENT_QUOTES));
        $description = stripslashes(htmlspecialchars($image['description'], ENT_QUOTES));
        // here is no new line allowed
        $clean_description = preg_replace("/\n|\r\n|\r\$/", " ", $description);
        $img = nggdb::find_image($send_id);
        $thumbcode = $img->get_thumbcode();
        $class = "ngg-singlepic ngg-{$image['align']}";
        // Create a shell displayed-gallery so we can inspect its settings
        $registry = C_Component_Registry::get_instance();
        $mapper = $registry->get_utility('I_Displayed_Gallery_Mapper');
        $factory = $registry->get_utility('I_Component_Factory');
        $args = array('display_type' => NGG_BASIC_SINGLEPIC);
        $displayed_gallery = $factory->create('displayed_gallery', $args, $mapper);
        $width = $displayed_gallery->display_settings['width'];
        $height = $displayed_gallery->display_settings['height'];
        // Build output
        if ($image['size'] == "thumbnail") {
            $html = "<img src='{$image['thumb']}' alt='{$alttext}' class='{$class}' />";
        } else {
            $html = '';
        }
        // Wrap the link to the fullsize image around
        $html = "<a {$thumbcode} href='{$image['url']}' title='{$clean_description}'>{$html}</a>";
        if ($image['size'] == "full") {
            $html = "<img src='{$image['url']}' alt='{$alttext}' class='{$class}' />";
        }
        if ($image['size'] == "singlepic") {
            $html = "[singlepic id={$send_id} w={$width} h={$height} float={$image['align']}]";
        }
        media_upload_nextgen_save_image();
        // Return it to TinyMCE
        return media_send_to_editor($html);
    }
    // Save button
    if (isset($_POST['save'])) {
        media_upload_nextgen_save_image();
    }
    return wp_iframe('media_upload_nextgen_form', $errors);
}
开发者ID:radscheit,项目名称:unicorn,代码行数:48,代码来源:media-upload.php


示例13: enqueue_nextgen_proofing_trigger_buttons_resources

 function enqueue_nextgen_proofing_trigger_buttons_resources($displayed_gallery = FALSE)
 {
     $retval = FALSE;
     if (!$this->run_once && !empty($displayed_gallery) && !empty($displayed_gallery->display_settings['ngg_proofing_display'])) {
         $router = C_Component_Registry::get_instance()->get_utility('I_Router');
         wp_enqueue_script('jquery-placeholder', $router->get_static_url('photocrati-nextgen_admin#jquery.placeholder.min.js'), 'jquery', FALSE, FALSE);
         wp_enqueue_script('ngg-pro-proofing-script', $router->get_static_url('photocrati-nextgen_pro_proofing#nextgen_pro-proofing.js'), array('jquery', 'underscore', 'jquery-placeholder'), FALSE, FALSE);
         wp_localize_script('ngg-pro-proofing-script', 'ngg_pro_proofing_i18n', array('image_list' => __('Submitting {0} image{1}', 'nextgen-gallery-pro'), 'submit_cancel' => __('Cancel', 'nextgen-gallery-pro'), 'submit_button' => __('Send', 'nextgen-gallery-pro'), 'submit_message' => __('Submitting...', 'nextgen-gallery-pro'), 'example_name' => __('Name', 'nextgen-gallery-pro'), 'example_email' => __('Email', 'nextgen-gallery-pro'), 'nggpl_title' => __('Proof image?', 'nextgen-gallery-pro')));
         $deps = false;
         if (wp_script_is('ngg-trigger-buttons', 'registered')) {
             $deps = array('ngg-trigger-buttons');
         }
         wp_enqueue_style('ngg-pro-proofing-style', $router->get_static_url('photocrati-nextgen_pro_proofing#nextgen_pro-proofing.css'), $deps);
         $this->run_once = TRUE;
     }
     return $retval;
 }
开发者ID:CodeNoEvil,项目名称:mbp_web_infrastructure,代码行数:17,代码来源:adapter.nextgen_pro_proofing_trigger_resources.php


示例14: uninstall

 function uninstall($hard)
 {
     // remove this products modules from the pope_module_list registry
     $registry = C_Component_Registry::get_instance();
     $nextgen_product = $registry->get_product('photocrati-nextgen');
     $pope_modules_list = get_option('pope_module_list', array());
     $pope_modules_list = $this->_filter_modules($pope_modules_list, $nextgen_product->get_modules_to_load());
     // run each modules respective uninstall routines
     foreach ($nextgen_product->get_modules_to_load() as $module_name) {
         if ($handler = C_Photocrati_Installer::get_handler_instance($module_name)) {
             if (method_exists($handler, 'uninstall')) {
                 $handler->uninstall($hard);
             }
         }
     }
     // lastly remove this product itself from the pope_module_list registry
     $search = array_search('photocrati-nextgen|' . NGG_PLUGIN_VERSION, $pope_modules_list);
     if (FALSE !== $search) {
         unset($pope_modules_list[$search]);
     }
     // TODO: remove this. NextGen Pro's uninstall routine will be updated in a separate release,
     // so to maintain proper support we run the same routine as above for it
     $pro_version = FALSE;
     if (defined('NGG_PRO_PLUGIN_VERSION')) {
         $pro_version = 'NGG_PRO_PLUGIN_VERSION';
     }
     if (defined('NEXTGEN_GALLERY_PRO_VERSION')) {
         $pro_version = 'NEXTGEN_GALLERY_PRO_VERSION';
     }
     if (FALSE !== $pro_version) {
         $pro_version = constant($pro_version);
     }
     if (FALSE !== $pro_version) {
         $pope_modules_list = $this->_filter_modules($pope_modules_list, $this->get_modules_to_load_for('photocrati-nextgen-pro'));
         $search = array_search('photocrati-nextgen-pro|' . $pro_version, $pope_modules_list);
         if (FALSE !== $search) {
             unset($pope_modules_list[$search]);
         }
     }
     if (empty($pope_modules_list)) {
         delete_option('pope_module_list');
     } else {
         update_option('pope_module_list', $pope_modules_list);
     }
 }
开发者ID:albinmartinsson91,项目名称:ux_blog,代码行数:45,代码来源:class.nextgen_product_installer.php


示例15: widget

 function widget($args, $instance)
 {
     $router = C_Router::get_instance();
     wp_enqueue_style('nextgen_widgets_style', $router->get_static_url('photocrati-widget#widgets.css'));
     wp_enqueue_style('nextgen_basic_thumbnails_style', $router->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.css'));
     // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist
     $before_widget = NULL;
     $before_title = NULL;
     $after_widget = NULL;
     $after_title = NULL;
     $widget_id = NULL;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title'], $instance, $this->id_base);
     $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
     $factory = C_Component_Registry::get_instance()->get_utility('I_Component_Factory');
     $view = $factory->create('mvc_view', '');
     // IE8 webslice support if needed
     if ($instance['webslice']) {
         $before_widget .= '<div class="hslice" id="ngg-webslice">';
         $before_title = str_replace('class="', 'class="entry-title ', $before_title);
         $after_widget = '</div>' . $after_widget;
     }
     $source = $instance['type'] == 'random' ? 'random_images' : 'recent';
     $params = array('slug' => 'widget-' . $args['widget_id'], 'source' => $source, 'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS, 'images_per_page' => $instance['items'], 'maximum_entity_count' => $instance['items'], 'template' => $view->get_template_abspath('photocrati-widget#display_gallery'), 'image_type' => $instance['show'] == 'original' ? 'full' : 'thumb', 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'disable_pagination' => TRUE, 'image_width' => $instance['width'], 'image_height' => $instance['height'], 'ngg_triggers_display' => 'never', 'widget_setting_title' => $title, 'widget_setting_before_widget' => $before_widget, 'widget_setting_before_title' => $before_title, 'widget_setting_after_widget' => $after_widget, 'widget_setting_after_title' => $after_title, 'widget_setting_width' => $instance['width'], 'widget_setting_height' => $instance['height'], 'widget_setting_show_setting' => $instance['show'], 'widget_setting_widget_id' => $widget_id);
     switch ($instance['exclude']) {
         case 'all':
             break;
         case 'denied':
             $mapper = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
             $gallery_ids = array();
             $list = explode(',', $instance['list']);
             foreach ($mapper->find_all() as $gallery) {
                 if (!in_array($gallery->{$gallery->id_field}, $list)) {
                     $gallery_ids[] = $gallery->{$gallery->id_field};
                 }
             }
             $params['container_ids'] = implode(',', $gallery_ids);
             break;
         case 'allow':
             $params['container_ids'] = $instance['list'];
             break;
     }
     echo $renderer->display_images($params);
 }
开发者ID:jeanpage,项目名称:ca_learn,代码行数:44,代码来源:class.widget_gallery.php


示例16: check_request

 /**
  * Checks the 'callback' parameter for possible ajax-like actions to take
  *
  * @param $wp
  */
 function check_request($wp)
 {
     $app = C_Component_Registry::get_instance()->get_utility('I_Router')->get_routed_app();
     if (!$app->get_parameter('callback')) {
         return;
     }
     switch ($app->get_parameter('callback')) {
         case 'imagerotator':
             require_once dirname(__FILE__) . '/xml/imagerotator.php';
             break;
         case 'json':
             require_once dirname(__FILE__) . '/xml/json.php';
             break;
         case 'image':
             require_once dirname(__FILE__) . '/nggshow.php';
             break;
         default:
             return;
     }
     C_NextGEN_Bootstrap::shutdown();
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:26,代码来源:nggallery.php


示例17: wp_smush_column_options

 /**
  * Returns Smush option / Stats, depending if image is already smushed or not
  *
  * @param $column_name
  * @param $id
  */
 function wp_smush_column_options($column_name, $id)
 {
     global $wpsmushnextgenstats;
     //NExtGen Doesn't returns Column name, weird? yeah, right, it is proper because hook is called for the particular column
     if ($column_name == 'wp_smush_image' || $column_name == '') {
         $supported_image = array('image/jpeg', 'image/gif', 'image/png', 'image/jpg');
         // Registry Object for NextGen Gallery
         $registry = C_Component_Registry::get_instance();
         //Gallery Storage Object
         $storage = $registry->get_utility('I_Gallery_Storage');
         //We'll get the image object in $id itself, else fetch it using Gallery Storage
         if (is_object($id)) {
             $image = $id;
         } else {
             // get an image object
             $image = $storage->object->_image_mapper->find($id);
         }
         //Check if it is supported image format, get image type to do that
         // get the absolute path
         $file_path = $storage->get_image_abspath($image, 'full');
         //Get image type from file path
         $image_type = $this->get_file_type($file_path);
         //If image type not supported
         if (!in_array($image_type, $supported_image)) {
             return;
         }
         //Check Image metadata, if smushed, print the stats or super smush button
         if (!empty($image->meta_data['wp_smush'])) {
             //Echo the smush stats
             $wpsmushnextgenstats->show_stats($image->pid, $image->meta_data['wp_smush'], $image_type, false, true);
             return;
         }
         //Print the status of image, if Not smushed
         $this->set_status($image->pid, true, false);
     }
 }
开发者ID:aarontgrogg,项目名称:aarontgrogg,代码行数:42,代码来源:class-wp-smush-nextgen-admin.php


示例18: get_router

 function get_router()
 {
     return C_Component_Registry::get_instance()->get_utility('I_Router');
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:4,代码来源:class.nextgen_admin_option_handler.php


示例19: task

 protected function task($item)
 {
     session_write_close();
     $max_attempts = 15;
     if (empty($item['attempts'])) {
         $item['attempts'] = 0;
     }
     $id = $item['id'];
     ewwwio_debug_message("background processing nextgen2: {$id}");
     // creating the 'registry' object for working with nextgen
     $registry = C_Component_Registry::get_instance();
     // creating a database storage object from the 'registry' object
     $storage = $registry->get_utility('I_Gallery_Storage');
     // get an image object
     $image = $storage->object->_image_mapper->find($id);
     if (!is_object($image) && $item['attempts'] < $max_attempts) {
         $item['attempts']++;
         sleep(4);
         ewwwio_debug_message("could not retrieve image, requeueing {$item['attempts']}");
         ewww_image_optimizer_debug_log();
         return $item;
     } elseif (empty($image)) {
         ewwwio_debug_message("could not retrieve image, out of attempts");
         ewww_image_optimizer_debug_log();
         delete_transient('ewwwio-background-in-progress-ngg-' . $id);
         return false;
     }
     global $ewwwngg;
     $ewwwngg->ewww_added_new_image($image, $storage);
     delete_transient('ewwwio-background-in-progress-ngg-' . $id);
     sleep(ewww_image_optimizer_get_option('ewww_image_optimizer_delay'));
     ewww_image_optimizer_debug_log();
     return false;
 }
开发者ID:kanei,项目名称:vantuch.cz,代码行数:34,代码来源:background.php


示例20: getNGGalleryImages

function getNGGalleryImages($ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset, &$error)
{
    $result = array();
    $galids = explode(',', $ngGalleries);
    $imgids = explode(',', $ngImages);
    if (!isNGGalleryActive()) {
        return '';
    }
    try {
        $pictures = array();
        foreach ($galids as $g) {
            $pictures = array_merge($pictures, nggdb::get_gallery($g));
        }
        foreach ($imgids as $i) {
            array_push($pictures, nggdb::find_image($i));
        }
        foreach ($pictures as $p) {
            $item = array();
            $item["data"] = $p->thumbHTML;
            if (is_callable('exif_read_data')) {
                $exif = @exif_read_data($p->imagePath);
                if ($exif !== false) {
                    $item["lon"] = getExifGps($exif["GPSLongitude"], $exif['GPSLongitudeRef']);
                    $item["lat"] = getExifGps($exif["GPSLatitude"], $exif['GPSLatitudeRef']);
                    if ($item["lat"] != 0 || $item["lon"] != 0) {
                        $result[] = $item;
                    } else {
                        if (isset($p->imagedate)) {
                            $_dt = strtotime($p->imagedate) + $dtoffset;
                            $_item = findItemCoordinate($_dt, $dt, $lat, $lon);
                            if ($_item != null) {
                                $item["lat"] = $_item["lat"];
                                $item["lon"] = $_item["lon"];
                                $result[] = $item;
                            }
                        }
                    }
                }
            } else {
                $error .= "Sorry, <a href='http://php.net/manual/en/function.exif-read-data.php' target='_blank' >exif_read_data</a> function not found! check your hosting..<br />";
            }
        }
        /* START FIX NEXT GEN GALLERY 2.x */
        if (class_exists("C_Component_Registry")) {
            $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
            $params['gallery_ids'] = $ngGalleries;
            $params['image_ids'] = $ngImages;
            $params['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
            $params['images_per_page'] = 999;
            // also add js references to get the gallery working
            $dummy = $renderer->display_images($params, $inner_content);
            /* START FIX NEXT GEN GALLERY PRO */
            if (preg_match("/data-nplmodal-gallery-id=[\"'](.*?)[\"']/", $dummy, $m)) {
                $galid = $m[1];
                if ($galid) {
                    for ($i = 0; $i < count($result); ++$i) {
                        $result[$i]["data"] = str_replace("%PRO_LIGHTBOX_GALLERY_ID%", $galid, $result[$i]["data"]);
                    }
                }
            }
            /* END FIX NEXT GEN GALLERY PRO */
        }
        /* END FIX NEXT GEN GALLERY 2.x */
    } catch (Exception $e) {
        $error .= 'Error When Retrieving NextGen Gallery galleries/images: $e <br />';
    }
    return $result;
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:68,代码来源:wp-gpx-maps_utils_nggallery.php



注:本文中的C_Component_Registry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP C_Gallery_Mapper类代码示例发布时间:2022-05-20
下一篇:
PHP C_Component类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap