当前位置: 首页>>代码示例>>PHP>>正文


PHP __a函数代码示例

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


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

示例1: index

 function index($params = array())
 {
     if (!empty($this->data['Field'])) {
         $location = $this->data['Field']['location'];
         $groupid = $this->data['Field']['groupid'];
         $type = isset($this->data['FieldFilter']) ? Sanitize::getString($this->data['FieldFilter'], 'type') : null;
     } else {
         $location = 'content';
         $groupid = 0;
         $type = null;
     }
     $groupchange = Sanitize::getInt($this->data, 'groupchange');
     $this->action = 'index';
     // Required for paginator helper
     $limit = $this->limit;
     $limitstart = $groupchange == 1 ? 0 : $this->offset;
     $groupchange == 1 and $this->page = 1;
     // First check if there are any field groups created
     $query = "SELECT count(*) FROM #__jreviews_groups";
     $this->_db->setQuery($query);
     if (!$this->_db->loadResult()) {
         return __a("You need to create at least one field group using the Field Groups Manager before you can create custom fields.", true);
     }
     $lists = array();
     $total = 0;
     $rows = $this->Field->getList($location, $groupid, $limitstart, $limit, $total, $type);
     $this->set(array('location' => $location, 'groups' => $this->Group->getSelectList($location), 'rows' => $rows, 'groupid' => $groupid, 'type' => $type, 'pagination' => array('total' => $total)));
     return $this->render('fields', 'index');
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:29,代码来源:fields_controller.php

示例2: _save

 function _save()
 {
     $response = array();
     if ($this->Claim->store($this->data)) {
         if ($this->data['Claim']['approved'] == 0) {
             $response[] = "\n                    jQuery('#jr_moderateForm" . $this->data['Claim']['claim_id'] . "').slideUp('slow',function()\n                    {\n                        jQuery(this).addClass('jr_form').html('" . __a("Claim will remain in moderation pending further action.", true, true) . "').slideDown('normal',function()\n                        {\n                            jQuery(this).effect('highlight',{},4000);\n                            setTimeout(function(){jQuery('#jr_moderateForm" . $this->data['Claim']['claim_id'] . "').fadeOut(1500)},3000);\n                        });\n                    });\n                ";
         } else {
             $response[] = "jQuery('#jr_moderateForm" . $this->data['Claim']['claim_id'] . "').slideUp('slow',function(){jQuery(this).html('');});";
             $response[] = "jreviews_admin.menu.moderation_counter('claim_count');";
         }
     }
     clearCache('', 'views');
     clearCache('', '__data');
     return $this->ajaxResponse($response);
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:15,代码来源:admin_claims_controller.php

示例3: widget

    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        global $wpdb;
        global $widget_content;
        global $wppa_opt;
        require_once dirname(__FILE__) . '/wppa-links.php';
        require_once dirname(__FILE__) . '/wppa-styles.php';
        require_once dirname(__FILE__) . '/wppa-functions.php';
        require_once dirname(__FILE__) . '/wppa-thumbnails.php';
        require_once dirname(__FILE__) . '/wppa-boxes-html.php';
        require_once dirname(__FILE__) . '/wppa-slideshow.php';
        wppa_initialize_runtime();
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __a('QR Widget') : $instance['title']);
        $qrsrc = 'http://api.qrserver.com/v1/create-qr-code/' . '?data=' . site_url() . '&size=' . $wppa_opt['wppa_qr_size'] . 'x' . $wppa_opt['wppa_qr_size'] . '&color=' . trim($wppa_opt['wppa_qr_color'], '#') . '&bgcolor=' . trim($wppa_opt['wppa_qr_bgcolor']);
        $widget_content = '
		<div style="text-align:center;" ><img id="wppa-qr-img" src="' . $qrsrc . '" title="" alt="' . __a('QR code') . '" /></div>
		<div style="clear:both" ></div>';
        $widget_content .= '
		<script type="text/javascript">
			/*[CDATA[*/
			var wppaQRData = document.location.href;
			var wppaQRDataOld = "";
			var wppaQRSrc = "";
			var workData = "";
			
			wppaConsoleLog("doc.loc.href = "+wppaQRData);
			
			function wppaQRUpdate(arg) {
				if ( arg ) wppaQRData = arg;
				if ( wppaQRData != wppaQRDataOld ) {
					wppaQRDataOld = wppaQRData;
					workData = wppaQRData;
					wppaQRSrc = "http://api.qrserver.com/v1/create-qr-code/?data="+encodeURIComponent(workData)+"&size=' . $wppa_opt['wppa_qr_size'] . 'x' . $wppa_opt['wppa_qr_size'] . '&color=' . trim($wppa_opt['wppa_qr_color'], '#') . '&bgcolor=' . trim($wppa_opt['wppa_qr_bgcolor'], '#') . '";
					document.getElementById("wppa-qr-img").src = wppaQRSrc;
					document.getElementById("wppa-qr-img").title = workData;
				}
				return;			
			}

			jQuery(document).ready(function(){
				wppaQRUpdate();
			});
			/*]]*/
		</script>';
        echo $before_widget . $before_title . $title . $after_title . $widget_content . $after_widget;
    }
开发者ID:billadams,项目名称:forever-frame,代码行数:48,代码来源:wppa-qr-widget.php

示例4: wppa_get_statistics

function wppa_get_statistics()
{
    $count = wppa_get_total_album_count();
    $y_id = wppa_get_youngest_album_id();
    $y_name = __(wppa_get_album_name($y_id));
    $p_id = wppa_get_parentalbumid($y_id);
    $p_name = __(wppa_get_album_name($p_id));
    $result = '<div class="wppa-box wppa-nav" style="text-align: center; ' . __wcs('wppa-box') . __wcs('wppa-nav') . '">';
    $result .= __a('There are') . ' ' . $count . ' ' . __a('photo albums. The last album added is') . ' ';
    $result .= '<a href="' . wppa_get_permalink() . 'wppa-album=' . $y_id . '&amp;wppa-cover=0&amp;wppa-occur=1">' . $y_name . '</a>';
    if ($p_id > '0') {
        $result .= __a(', a subalbum of') . ' ';
        $result .= '<a href="' . wppa_get_permalink() . 'wppa-album=' . $p_id . '&amp;wppa-cover=0&amp;wppa-occur=1">' . $p_name . '</a>';
    }
    $result .= '.</div>';
    return $result;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:17,代码来源:wppa-statistics.php

示例5: _save

 function _save()
 {
     if ($this->data['Report']['approved'] == -2) {
         $this->Report->delete('report_id', $this->data['Report']['report_id']);
         $this->response[] = "jQuery('#jr_moderateForm" . $this->data['Report']['report_id'] . "').slideUp('slow',function(){jQuery(this).html('');});";
         $this->response[] = "jreviews_admin.menu.moderation_counter('report_count');";
         return $this->ajaxResponse($this->response);
     }
     if ($this->Report->store($this->data)) {
         if ($this->data['Report']['approved'] == 0) {
             $this->response[] = "\n                        jQuery('#jr_moderateForm" . $this->data['Report']['report_id'] . "').slideUp('slow',function()\n                        {\n                            jQuery(this).addClass('jr_form').html('" . __a("Report will remain in moderation pending further action.", true, true) . "').slideDown('normal',function()\n                            {\n                                jQuery(this).effect('highlight',{},4000);\n                                setTimeout(function(){jQuery('#jr_moderateForm" . $this->data['Report']['report_id'] . "').fadeOut(1500)},3000);\n                            });\n                        });\n                    ";
         } else {
             $this->response[] = "jreviews_admin.menu.moderation_counter('report_count');";
             $this->response[] = "jQuery('#jr_moderateForm" . $this->data['Report']['report_id'] . "').slideUp('slow',function(){jQuery(this).html('');});";
         }
     }
     if ($this->action == '_save') {
         return $this->ajaxResponse($this->response);
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:20,代码来源:admin_reports_controller.php

示例6: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     global $wpdb;
     global $wppa;
     global $widget_content;
     global $thumb;
     require_once dirname(__FILE__) . '/wppa-links.php';
     require_once dirname(__FILE__) . '/wppa-styles.php';
     require_once dirname(__FILE__) . '/wppa-functions.php';
     require_once dirname(__FILE__) . '/wppa-thumbnails.php';
     require_once dirname(__FILE__) . '/wppa-boxes-html.php';
     require_once dirname(__FILE__) . '/wppa-slideshow.php';
     wppa_initialize_runtime();
     $wppa['in_widget'] = 'bestof';
     $wppa['mocc']++;
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'count' => '1', 'sortby' => 'maxratingcount', 'display' => 'photo', 'period' => 'thisweek', 'maxratings' => 'yes', 'meanrat' => 'yes', 'ratcount' => 'yes', 'linktype' => 'none'));
     $widget_title = apply_filters('widget_title', $instance['title']);
     $page = in_array($instance['linktype'], $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_bestof_widget_linkpage', __a('Best Of Photos'));
     $count = $instance['count'];
     $sortby = $instance['sortby'];
     $display = $instance['display'];
     $period = $instance['period'];
     $maxratings = $instance['maxratings'];
     $meanrat = $instance['meanrat'];
     $ratcount = $instance['ratcount'];
     $linktype = $instance['linktype'];
     $size = wppa_opt('wppa_widget_width');
     //		$data 			= wppa_get_the_bestof( $count, $period, $sortby, $display );
     $lineheight = wppa_opt('wppa_fontsize_widget_thumb') * 1.5;
     $widget_content = "\n" . '<!-- WPPA+ BestOf Widget start -->';
     $widget_content .= wppa_bestof_html(array('page' => $page, 'count' => $count, 'sortby' => $sortby, 'display' => $display, 'period' => $period, 'maxratings' => $maxratings, 'meanrat' => $meanrat, 'ratcount' => $ratcount, 'linktype' => $linktype, 'size' => $size, 'lineheight' => $lineheight));
     $widget_content .= '<div style="clear:both"></div>';
     $widget_content .= "\n" . '<!-- WPPA+ BestOf Widget end -->';
     echo "\n" . $before_widget;
     if (!empty($widget_title)) {
         echo $before_title . $widget_title . $after_title;
     }
     echo $widget_content . $after_widget;
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:41,代码来源:wppa-bestof-widget.php

示例7: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     //	global $widget_content;
     global $wpdb;
     global $wppa;
     global $thumb;
     require_once dirname(__FILE__) . '/wppa-links.php';
     require_once dirname(__FILE__) . '/wppa-styles.php';
     require_once dirname(__FILE__) . '/wppa-functions.php';
     require_once dirname(__FILE__) . '/wppa-thumbnails.php';
     require_once dirname(__FILE__) . '/wppa-boxes-html.php';
     require_once dirname(__FILE__) . '/wppa-slideshow.php';
     wppa_initialize_runtime();
     $wppa['in_widget'] = 'albnav';
     $wppa['mocc']++;
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'parent' => '0', 'skip' => 'yes'));
     $widget_title = apply_filters('widget_title', $instance['title']);
     $page = wppa_get_the_landing_page('wppa_album_navigator_widget_linkpage', __a('Photo Albums'));
     $parent = $instance['parent'];
     $skip = $instance['skip'];
     $widget_content = "\n" . '<!-- WPPA+ Album Navigator Widget start -->';
     $widget_content .= '<div style="width:100%; overflow:hidden; position:relative; left: -12px;" >';
     if ($parent == 'all') {
         $widget_content .= $this->do_album_navigator('0', $page, $skip, '');
         $widget_content .= $this->do_album_navigator('-1', $page, $skip, '');
     } else {
         $widget_content .= $this->do_album_navigator($parent, $page, $skip, '');
     }
     $widget_content .= '</div>';
     $widget_content .= '<div style="clear:both"></div>';
     $widget_content .= "\n" . '<!-- WPPA+ Album Navigator Widget end -->';
     echo "\n" . $before_widget;
     if (!empty($widget_title)) {
         echo $before_title . $widget_title . $after_title;
     }
     echo $widget_content . $after_widget;
     $wppa['in_widget'] = false;
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:40,代码来源:wppa-album-navigator-widget.php

示例8: wppa_backend_upload_mail

function wppa_backend_upload_mail($id, $alb, $name)
{
    $owner = wppa_get_user();
    if ($owner == 'admin') {
        return;
    }
    // Admin does not send mails to himself
    if (wppa_switch('wppa_upload_backend_notify')) {
        $to = get_bloginfo('admin_email');
        $subj = sprintf(__a('New photo uploaded: %s'), wppa_sanitize_file_name($name));
        $cont['0'] = sprintf(__a('User %s uploaded photo %s into album %s'), $owner, $id, wppa_get_album_name($alb));
        if (wppa_switch('wppa_upload_moderate') && !current_user_can('wppa_admin')) {
            $cont['1'] = __a('This upload requires moderation');
            $cont['2'] = '<a href="' . get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=pmod&photo=' . $id . '" >' . __a('Moderate manage photo') . '</a>';
        } else {
            $cont['1'] = __a('Details:');
            $cont['1'] .= ' <a href="' . get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=pmod&photo=' . $id . '" >' . __a('Manage photo') . '</a>';
        }
        wppa_send_mail($to, $subj, $cont, $id);
    }
}
开发者ID:billadams,项目名称:forever-frame,代码行数:21,代码来源:wppa-upload.php

示例9: wppa_get_audio_body

function wppa_get_audio_body($id, $for_lb = false, $w = '0', $h = '0')
{
    // Audio enabled?
    if (!wppa_switch('enable_audio')) {
        return '';
    }
    $is_audio = wppa_has_audio($id, true);
    // Not a audio? no go
    if (!$is_audio) {
        return '';
    }
    // See what file types are present
    extract(wp_parse_args($is_audio, array('mp3' => false, 'wav' => false, 'ogg' => false)));
    // Collect other data
    $width = $w ? $w : wppa_get_photox($id);
    $height = $h ? $h : wppa_get_photoy($id);
    $source = wppa_get_photo_url($id);
    $source = substr($source, 0, strrpos($source, '.'));
    $class = $for_lb ? ' class="wppa-overlay-img"' : '';
    $is_opera = strpos($_SERVER["HTTP_USER_AGENT"], 'OPR');
    $is_ie = strpos($_SERVER["HTTP_USER_AGENT"], 'Trident');
    $is_safari = strpos($_SERVER["HTTP_USER_AGENT"], 'Safari');
    wppa_dbg_msg('Mp3:' . $mp3 . ', Opera:' . $is_opera . ', Ie:' . $is_ie . ', Saf:' . $is_safari);
    // Assume the browser supports html5
    $ext = '';
    if ($is_ie) {
        if ($mp3) {
            $ext = 'mp3';
        }
    } elseif ($is_safari) {
        if ($mp3) {
            $ext = 'mp3';
        } elseif ($wav) {
            $ext = 'wav';
        }
    } else {
        if ($mp3) {
            $ext = 'mp3';
        } elseif ($wav) {
            $ext = 'wav';
        } elseif ($ogg) {
            $ext = 'ogg';
        }
    }
    if ($ext) {
        $mime = str_replace('mp3', 'mpeg', 'audio/' . $ext);
        $result = '<source src="' . $source . '.' . $ext . '" type="' . $mime . '">';
    }
    $result .= __a('There is no filetype available for your browser, or your browser does not support html5 audio', 'wppa');
    return $result;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:51,代码来源:wppa-audio.php

示例10: wppa_crumb_page_ancestors

function wppa_crumb_page_ancestors($page = '0')
{
    global $wpdb;
    global $wppa;
    $query = "SELECT post_parent FROM " . $wpdb->posts . " WHERE post_type = 'page' AND post_status = 'publish' AND id = %s LIMIT 0,1";
    $parent = $wpdb->get_var($wpdb->prepare($query, $page));
    wppa_dbg_q('Q-bc4');
    if (!is_numeric($parent) || $parent == '0') {
        return;
    }
    wppa_crumb_page_ancestors($parent);
    $query = "SELECT post_title FROM " . $wpdb->posts . " WHERE post_type = 'page' AND post_status = 'publish' AND id = %s LIMIT 0,1";
    $title = $wpdb->get_var($wpdb->prepare($query, $parent));
    wppa_dbg_q('Q-bc5');
    $title = __(stripslashes($title));
    if (!$title) {
        $title = '****';
        // Page exists but is not publish
        wppa_bcitem($title, '#', __a('Unpublished'), $class = 'b2');
    } else {
        wppa_bcitem($title, get_page_link($parent), __('Page:') . ' ' . $title, 'b2');
    }
}
开发者ID:billadams,项目名称:forever-frame,代码行数:23,代码来源:wppa-breadcrumb.php

示例11: wppa_add_to_cart

function wppa_add_to_cart($atts)
{
    global $post;
    global $thumb;
    global $wppa;
    extract(shortcode_atts(array('name' => wppa_get_photo_name($thumb['id']), 'price' => 0.01, 'qty_field' => '', 'b_title' => __a('Buy now'), 'options' => '', 'options_name' => '', 'qty_field' => '', 'fshipping' => '', 'weight' => ''), $atts));
    $cart =& $_SESSION['wfcart'];
    // load the cart from the session
    $scabn_options = get_option('scabn_options');
    $currency = apply_filters('scabn_display_currency_symbol', NULL);
    // Slideshow?
    if ($wppa['is_slide']) {
        $action_url = wppa_get_slide_callback_url($thumb['id']);
        $item_url = $action_url . '&wppa-single=1';
        $action_url = wppa_convert_to_pretty($action_url);
        $item_url = wppa_convert_to_pretty($item_url);
    } else {
        $action_url = wppa_get_thumb_callback_url();
        if (!strpos($action_url, '&amp;')) {
            $action_url = str_replace('&', '&amp;', $action_url);
        }
        $item_url = wppa_get_slide_callback_url($thumb['id']) . '&wppa-single=1';
        $action_url = wppa_convert_to_pretty($action_url);
        $item_url = wppa_convert_to_pretty($item_url);
    }
    $output = '
	<div class="wppa-addtocart">
		<form method="post" class="wppa-cartform ' . $name . '" action="' . $action_url . '">
			' . wp_nonce_field('add_to_cart', 'scabn-add', false, false) . '
			<input type="hidden" value="add_item" name="action" />
			<input type="hidden" class="item_url" value="' . $item_url . '" name="item_url" />
			<input type="hidden" value="' . $cart->random() . '" name="randomid" />
			<input type="hidden" value="' . $name . '" name="item_id" />
			<input type="hidden" class="item_name" value="' . $name . '" name="item_name" />
			<input type="hidden" class="item_price" value="' . $price . '" name="item_price" />';
    if ($fshipping) {
        $output .= '
			<input type="hidden" class="item_shipping" value="' . $fshipping . '" name="item_shipping" />';
    }
    if ($weight) {
        $output .= '
			<input type="hidden" class="item_weight" value="' . $weight . '" name="item_weight" />';
    }
    if ($options) {
        if ($options_name) {
            $output .= $options_name . ': ';
        }
        $output .= '
			<input type="hidden" value="' . $options_name . '" name="item_options_name" class="item_options_name" />';
        $item_options = explode(',', $options);
        $output .= '
			<select style="max-width:200px; margin:0" name="item_options" class="item_options" >';
        foreach ($item_options as $option) {
            $info = explode(':', $option);
            if (count($info) == 1) {
                $output .= '
					<option value="' . $info[0] . '">' . $info[0] . ' (' . $currency . number_format($price, 2) . ')</option>';
            } else {
                $output .= '
					<option value="' . $info[0] . ':' . $info[1] . '">' . $info[0] . ' (' . $currency . number_format($info[1], 2) . ')</option>';
            }
        }
        $output .= '
			</select>';
    } else {
        $output .= sprintf(__a('Unit Price: %s each'), $currency . number_format($price, 2)) . ' ';
    }
    if ($qty_field) {
        $output .= __a('Qty:') . ' <input type="text" style="max-width:50px; margin:0;" class="item_qty" value="1" size="2" name="item_qty" />';
    } else {
        $output .= '<input type="hidden" class="item_qty" value="1" size="2" name="item_qty" />';
    }
    $output .= '
			<input type="submit" id="' . $name . '" class="add" name="add" value="' . $b_title . '"/>
		</form>
	</div>';
    return $output;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:78,代码来源:wppa-cart.php

示例12: widget

    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        global $wpdb;
        global $wppa_opt;
        global $wppa;
        require_once dirname(__FILE__) . '/wppa-links.php';
        require_once dirname(__FILE__) . '/wppa-styles.php';
        require_once dirname(__FILE__) . '/wppa-functions.php';
        require_once dirname(__FILE__) . '/wppa-thumbnails.php';
        require_once dirname(__FILE__) . '/wppa-boxes-html.php';
        require_once dirname(__FILE__) . '/wppa-slideshow.php';
        wppa_initialize_runtime();
        $wppa['in_widget'] = 'upldr';
        $wppa['mocc']++;
        extract($args);
        $instance = wp_parse_args((array) $instance, array('title' => '', 'sortby' => 'name', 'ignore' => 'admin', 'parent' => ''));
        $widget_title = apply_filters('widget_title', $instance['title']);
        $page = in_array('album', $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_upldr_widget_linkpage', __a('User uploaded photos'));
        $ignorelist = explode(',', $instance['ignore']);
        $upldrcache = wppa_get_upldr_cache();
        $needupdate = false;
        $users = wppa_get_users();
        $workarr = array();
        $selalbs = str_replace('.', ',', wppa_expand_enum(wppa_alb_to_enum_children(wppa_expand_enum($instance['parent']))));
        // Make the data we need
        if ($users) {
            foreach ($users as $user) {
                if (!in_array($user['user_login'], $ignorelist)) {
                    $me = wppa_get_user();
                    if ($user['user_login'] != $me && isset($upldrcache[$this->get_widget_id()][$user['user_login']]['c'])) {
                        $photo_count = $upldrcache[$this->get_widget_id()][$user['user_login']]['c'];
                    } else {
                        if ($instance['parent']) {
                            $query = $wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `owner` = %s AND `album` IN (" . $selalbs . ") AND ( ( `status` <> 'pending' AND `status` <> 'scheduled' ) OR `owner` = %s )", $user['user_login'], $me);
                            //);
                        } else {
                            $query = $wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `owner` = %s AND ( ( `status` <> 'pending' AND `status` <> 'scheduled' ) OR `owner` = %s )", $user['user_login'], $me);
                            //);
                        }
                        $photo_count = $wpdb->get_var($query);
                        if ($user['user_login'] != $me) {
                            $upldrcache[$this->get_widget_id()][$user['user_login']]['c'] = $photo_count;
                            $needupdate = true;
                        }
                    }
                    if ($photo_count) {
                        if ($user['user_login'] != $me && isset($upldrcache[$this->get_widget_id()][$user['user_login']]['d'])) {
                            $last_dtm = $upldrcache[$this->get_widget_id()][$user['user_login']]['d'];
                        } else {
                            if ($instance['parent']) {
                                $last_dtm = $wpdb->get_var($wpdb->prepare("SELECT `timestamp` FROM `" . WPPA_PHOTOS . "` WHERE `owner` = %s AND `album` IN (" . $selalbs . ") AND ( ( `status` <> 'pending' AND `status` <> 'scheduled' ) OR `owner` = %s ) ORDER BY `timestamp` DESC LIMIT 1", $user['user_login'], $me));
                            } else {
                                $last_dtm = $wpdb->get_var($wpdb->prepare("SELECT `timestamp` FROM `" . WPPA_PHOTOS . "` WHERE `owner` = %s AND ( ( `status` <> 'pending' AND `status` <> 'scheduled' ) OR `owner` = %s ) ORDER BY `timestamp` DESC LIMIT 1", $user['user_login'], $me));
                            }
                        }
                        if ($user['user_login'] != $me) {
                            $upldrcache[$this->get_widget_id()][$user['user_login']]['d'] = $last_dtm;
                            $needupdate = true;
                        }
                        $workarr[] = array('login' => $user['user_login'], 'name' => $user['display_name'], 'count' => $photo_count, 'date' => $last_dtm);
                    }
                }
            }
        } else {
            $widget_content = __a('There are too many registered users in the system for this widget');
            echo "\n" . $before_widget;
            if (!empty($widget_title)) {
                echo $before_title . $widget_title . $after_title;
            }
            echo $widget_content . $after_widget;
            return;
        }
        if ($needupdate) {
            update_option('wppa_upldr_cache', $upldrcache);
        }
        // Bring me to top
        $myline = false;
        if (is_user_logged_in()) {
            $me = wppa_get_user();
            foreach (array_keys($workarr) as $key) {
                $user = $workarr[$key];
                if ($user['login'] == $me) {
                    $myline = $workarr[$key];
                    unset($workarr[$key]);
                }
            }
        }
        // Sort workarray
        $ord = $instance['sortby'] == 'name' ? SORT_ASC : SORT_DESC;
        $workarr = wppa_array_sort($workarr, $instance['sortby'], $ord);
        // Create widget content
        $widget_content = "\n" . '<!-- WPPA+ Upldr Widget start -->';
        $widget_content .= '<div class="wppa-upldr" style="max-height:180px; overflow:auto"><table><tbody>';
        $albs = $instance['parent'] ? wppa_alb_to_enum_children(wppa_expand_enum($instance['parent'])) : '';
        $a = $albs ? wppa_trim_wppa_('&amp;wppa-album=' . $albs) : '';
        if ($myline) {
            $user = $myline;
            $widget_content .= '<tr class="wppa-user" >
									<td style="padding: 0 3px;" ><a href="' . wppa_get_upldr_link($user['login']) . $a . '" title="' . __a('Photos uploaded by') . ' ' . $user['name'] . '" ><b>' . $user['name'] . '</b></a></td>
//.........这里部分代码省略.........
开发者ID:billadams,项目名称:forever-frame,代码行数:101,代码来源:wppa-upldr-widget.php

示例13: wppa_format_exif

function wppa_format_exif($tag, $data)
{
    $result = $data;
    switch ($tag) {
        /*
        E#0132		Date Time					Already formatted correctly
        E#013B		Photographer				Already formatted correctly
        E#8298		Copyright					Already formatted correctly
        			Location					Formatted into one line according to the 3 tags below:  2#092, 2#090, 2#095, 2#101
        										2#092		Sub location
        										2#090		City
        										2#095		State
        										2#101		Country
        
        E#0110		Camera						Already formatted correctly  Example: Canon EOS 50D
        aux:Lens	Lens						Already formatted correctly - See line 66 in sample photo exifdata.jpg attached  Example aux:Lens="EF300mm f/4L IS USM +1.4x"
        */
        //	E#920A		Focal length				Must be formatted:  420/1 = 420 mm
        case 'E#920A':
            $temp = explode('/', $data);
            if (isset($temp[1])) {
                if (is_numeric($temp[1])) {
                    if ($temp[1] != 0) {
                        $result = round($temp[0] / $temp[1]) . ' mm.';
                    }
                }
            }
            break;
            //	E#9206		Subject distance			Must be formatted:  765/100 = 7,65 m.
        //	E#9206		Subject distance			Must be formatted:  765/100 = 7,65 m.
        case 'E#9206':
            $temp = explode('/', $data);
            if (isset($temp[1])) {
                if (is_numeric($temp[1])) {
                    if ($temp[1] != 0) {
                        $result = round(100 * $temp[0] / $temp[1]) / "100" . ' m.';
                    }
                }
            }
            break;
            //	E#829A		Shutter Speed				Must be formatted:  1/125 = 1/125 s.
        //	E#829A		Shutter Speed				Must be formatted:  1/125 = 1/125 s.
        case 'E#829A':
            if ($result) {
                $result .= ' s.';
            }
            break;
            //	E#829D		F-Stop						Must be formatted:  56/10 = f/5,6
        //	E#829D		F-Stop						Must be formatted:  56/10 = f/5,6
        case 'E#829D':
            $temp = explode('/', $data);
            if (isset($temp[1])) {
                if (is_numeric($temp[1])) {
                    if ($temp[1] != 0) {
                        $result = 'f/' . round(10 * $temp[0] / $temp[1]) / 10;
                    }
                }
            }
            break;
            /*
            E#8827		ISO	Speed Rating			Already formatted correctly
            E#9204		Exposure bias				Already formatted correctly
            
            E#8822		Exposure program			Must be formatted according to table
            										0 = Not Defined
            										1 = Manual
            										2 = Program AE
            										3 = Aperture-priority AE
            										4 = Shutter speed priority AE
            										5 = Creative (Slow speed)
            										6 = Action (High speed)
            										7 = Portrait
            										8 = Landscape
            										9 = Bulb
            */
        /*
        E#8827		ISO	Speed Rating			Already formatted correctly
        E#9204		Exposure bias				Already formatted correctly
        
        E#8822		Exposure program			Must be formatted according to table
        										0 = Not Defined
        										1 = Manual
        										2 = Program AE
        										3 = Aperture-priority AE
        										4 = Shutter speed priority AE
        										5 = Creative (Slow speed)
        										6 = Action (High speed)
        										7 = Portrait
        										8 = Landscape
        										9 = Bulb
        */
        case 'E#8822':
            switch ($data) {
                case '0':
                    $result = __a('Not Defined');
                    break;
                case '1':
                    $result = __a('Manual');
                    break;
                case '2':
//.........这里部分代码省略.........
开发者ID:billadams,项目名称:forever-frame,代码行数:101,代码来源:wppa-exif-iptc-common.php

示例14: wppa_zoom_in

function wppa_zoom_in($id)
{
    if ($id === false) {
        return '';
    }
    if (wppa_switch('show_zoomin')) {
        if (wppa_opt('magnifier')) {
            return __a('Zoom in');
        } else {
            return esc_attr(stripslashes(wppa_get_photo_name($id)));
        }
    } else {
        return '';
    }
}
开发者ID:billadams,项目名称:forever-frame,代码行数:15,代码来源:wppa-functions.php

示例15: wppa_theme


//.........这里部分代码省略.........
                    $didsome = true;
                    wppa_album_cover();
                    // Show the cover
                }
                // End if on page
            }
            wppa_album_list('close');
            // Close Albums sub-container
        }
        // If albums
        if ($wppa_opt['wppa_thumbtype'] != 'none') {
            $thumbs = wppa_get_thumbs();
            // Get the Thumbs
        } else {
            $thumbs = false;
        }
        $n_thumb_pages = wppa_get_npages('thumbs', $thumbs);
        // How many pages of thumbs will there be?
        if ($n_thumb_pages == '0') {
            $thumbs = false;
        }
        // No pages: no thumbs. Maybe want covers only
        if ($didsome && wppa_is_pagination()) {
            $thumbs = false;
        }
        // Pag on and didsome: pagebreak
        if (count($thumbs) <= wppa_get_mincount()) {
            $thumbs = false;
        }
        // Less than treshold value
        if ($thumbs) {
            $counter_thumbs = '0';
            if (get_option('wppa_thumbtype', 'default') == 'ascovers') {
                // Do the thumbs As covers
                wppa_thumb_list('open');
                // Open Thumblist sub-container
                foreach ($thumbs as $tt) {
                    global $thumb;
                    $thumb = $tt;
                    // Loop the Thumbs
                    $counter_thumbs++;
                    if (wppa_onpage('thumbs', $counter_thumbs, $curpage - $n_album_pages)) {
                        $didsome = true;
                        wppa_thumb_ascover();
                        // Show Thumb as cover
                    }
                    // End if on page
                }
                wppa_thumb_list('close');
                // Close Thumblist sub-container
            } else {
                // Do the thumbs As default
                wppa_thumb_area('open');
                // Open Thumbarea sub-container
                foreach ($thumbs as $tt) {
                    global $thumb;
                    $thumb = $tt;
                    // Loop the Thumbs
                    $counter_thumbs++;
                    if (wppa_onpage('thumbs', $counter_thumbs, $curpage - $n_album_pages)) {
                        $didsome = true;
                        wppa_thumb_default();
                        // Show Thumb as default
                    }
                    // End if on page
                }
                wppa_popup();
                // Prepare Popup box
                wppa_thumb_area('close');
                // Close Thumbarea sub-container
            }
            // As default
        }
        // If thumbs
        if (!wppa_is_pagination()) {
            $totpag = '1';
        } else {
            $totpag = $n_album_pages + $n_thumb_pages;
        }
        wppa_page_links($totpag, $curpage);
        // Show pages navigaion bar if needed
        if (!$didsome && $wppa['src']) {
            $wppa['out'] .= '<div class="center">' . __a('No albums or photos found matching your search criteria.', 'wppa_theme') . '</div>';
        }
    } elseif (wppa_page('oneofone')) {
        // Page 'Single image' requested
        wppa_slide_frame();
        // Setup slideframe
        wppa_run_slidecontainer('single');
        // Fill in the photo and display it
    } elseif (wppa_page('slide') || wppa_page('single')) {
        // Page 'Slideshow' or 'Single' in browsemode requested
        wppa_the_slideshow();
        // Producs all the html required for the slideshow
        wppa_run_slidecontainer('slideshow');
        // Fill in the photo array and display it.
    }
    // wppa_page('slide')
    wppa_container('close');
}
开发者ID:jnsnkrllive,项目名称:wordpress-theme-hhcyouth,代码行数:101,代码来源:wppa-theme.php


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