本文整理汇总了PHP中wppa函数的典型用法代码示例。如果您正苦于以下问题:PHP wppa函数的具体用法?PHP wppa怎么用?PHP wppa使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wppa函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $widget_content;
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', 'tagcloud');
wppa_bump_mocc();
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => __('Photo Tags', 'wp-photo-album-plus'), 'tags' => array()));
if (empty($instance['tags'])) {
$instance['tags'] = array();
}
$widget_title = apply_filters('widget_title', $instance['title']);
// Display the widget
echo $before_widget;
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
echo '<div class="wppa-tagcloud-widget" >' . wppa_get_tagcloud_html(implode(',', $instance['tags']), wppa_opt('tagcloud_min'), wppa_opt('tagcloud_max')) . '</div>';
echo '<div style="clear:both"></div>';
echo $after_widget;
wppa('in_widget', false);
}
示例2: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
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', 'stereo');
wppa_bump_mocc();
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => __('3D Stereo Settings', 'wp-photo-album-plus')));
$widget_title = apply_filters('widget_title', $instance['title']);
$widget_content = "\n" . '<!-- WPPA+ stereo Widget start -->';
$widget_content .= wppa_get_stereo_html();
$widget_content .= '<div style="clear:both"></div>';
$widget_content .= "\n" . '<!-- WPPA+ stereo 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);
}
示例3: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $widget_content;
global $wpdb;
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('mocc', wppa('mocc') + 1);
wppa('in_widget', 'search');
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => __('Search Photos', 'wp-photo-album-plus'), 'label' => '', 'root' => false, 'sub' => false, 'album' => '', 'landingpage' => '0'));
$widget_title = apply_filters('widget_title', $instance['title']);
// Display the widget
echo $before_widget;
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
echo wppa_get_search_html($instance['label'], $instance['sub'], $instance['root'], $instance['album'], $instance['landingpage']);
echo $after_widget;
wppa('in_widget', false);
}
示例4: wppa_get_video_html
function wppa_get_video_html($args)
{
extract(wp_parse_args((array) $args, array('id' => '0', 'width' => '0', 'height' => '0', 'controls' => true, 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'video-' . wppa('mocc'), 'cursor' => '', 'events' => '', 'title' => '', 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => '', 'use_thumb' => false, 'autoplay' => false)));
// No id? no go
if (!$id) {
return '';
}
// Not a video? no go
if (!wppa_is_video($id)) {
return '';
}
extract(wp_parse_args((array) wppa_is_video($id), array('mp4' => false, 'ogv' => false, 'webm' => false)));
// Prepare attributes
$w = $width ? ' width:' . $width . 'px;' : '';
$h = $height ? ' height:' . $height . 'px;' : '';
$t = $margin_top ? ' margin-top:' . $margin_top . 'px;' : '';
$b = $margin_bottom ? ' margin-bottom:' . $margin_bottom . 'px;' : '';
$ctrl = $controls ? ' controls' : '';
$tit = $title ? ' title="' . $title . '"' : '';
$onc = $onclick ? ' onclick="' . $onclick . '"' : '';
$cls = $class ? ' class="' . $class . '"' : '';
$style = $style ? rtrim(trim($style), ';') . ';' : '';
$play = $autoplay ? ' autoplay' : '';
// See if there is a poster image
$poster_photo_path = wppa_fix_poster_ext(wppa_get_photo_path($id), $id);
$poster_thumb_path = wppa_fix_poster_ext(wppa_get_thumb_path($id), $id);
$poster_photo = is_file($poster_photo_path) ? ' poster="' . wppa_fix_poster_ext(wppa_get_photo_url($id), $id) . '"' : '';
$poster_thumb = is_file($poster_thumb_path) ? ' poster="' . wppa_fix_poster_ext(wppa_get_thumb_url($id), $id) . '"' : '';
$poster = '';
// Init to none
// Thumbnail?
if ($use_thumb) {
$poster = $poster_thumb;
} else {
$poster = $poster_photo;
}
// If the poster exists and no controls, we need no preload at all.
if ($poster && !$controls) {
$preload = 'none';
}
// Do we have html5 video tag supported filetypes on board?
if ($mp4 || $ogv || $webm) {
// Assume the browser supports html5
$result = '<video id="' . $tagid . '" ' . $ctrl . $play . ' style="' . $style . $w . $h . $t . $b . $cursor . '" ' . $events . ' ' . $tit . $onc . $poster . ' preload="' . $preload . '"' . $cls . ' >';
$result .= wppa_get_video_body($id, false, $width, $height);
// Close the video tag
$result .= '</video>';
}
// Done
return $result;
}
示例5: widget
function widget($args, $instance)
{
global $wpdb;
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);
$instance = wp_parse_args((array) $instance, array('title' => '', 'album' => '0'));
$title = apply_filters('widget_title', $instance['title']);
$album = $instance['album'];
if (!$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `id` = %d", $album))) {
$album = '0';
// Album vanished
}
wppa_user_upload();
// Do the upload if required
wppa('in_widget', 'upload');
wppa_bump_mocc();
$mocc = wppa('mocc');
$is_responsive = wppa_opt('colwidth') == 'auto';
if ($is_responsive) {
// Responsive widgetwppaAutoColumnWidth[1] = true;
$js = wppa_get_responsive_widget_js_html($mocc);
} else {
$js = '';
}
$create = wppa_get_user_create_html($album, wppa_opt('widget_width'), 'widget');
$upload = wppa_get_user_upload_html($album, wppa_opt('widget_width'), 'widget', $is_responsive);
if (!$create && !$upload) {
return;
}
// Nothing to do
$text = '<div id="wppa-container-' . $mocc . '" class="wppa-upload-widget" style="margin-top:2px; margin-left:2px;" >' . $js . $create . $upload . '</div>';
echo $before_widget;
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
echo $text;
echo '<div style="clear:both"></div>';
echo $after_widget;
wppa('in_widget', false);
}
示例6: widget
function widget($args, $instance)
{
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);
$instance = wp_parse_args((array) $instance, array('title' => __('WPPA+ Text', 'wp-photo-album-plus'), 'text' => '', 'loggedinonly' => false));
if ($instance['loggedinonly'] && !is_user_logged_in()) {
return;
}
$title = apply_filters('widget_title', $instance['title']);
wppa('in_widget', 'gp');
wppa_bump_mocc();
// Open the widget
echo $before_widget;
// Title optional
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
// Body
$text = $instance['text'];
if ($instance['filter']) {
// Do wpautop BEFORE do_shortcode
$text = wpautop($text);
}
$text = do_shortcode($text);
$text = apply_filters('widget_text', $text);
// If shortcode at wppa filter priority, insert result. See wppa-filter.php
echo '<div class="wppa-gp-widget" style="margin-top:2px; margin-left:2px;" >' . $text . '</div>';
echo '<div style="clear:both"></div>';
// Close widget
echo $after_widget;
wppa('in_widget', false);
wppa('fullsize', '');
// Reset to prevent inheritage of wrong size in case widget is rendered before main column
}
示例7: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
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_bump_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('album_navigator_widget_linkpage', __('Photo Albums', 'wp-photo-album-plus'));
$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, '');
} elseif ($parent == 'owner') {
$widget_content .= $this->do_album_navigator('0', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '" . wppa_get_user() . "' ) ");
$widget_content .= $this->do_album_navigator('-1', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '" . wppa_get_user() . "' ) ");
} 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);
}
示例8: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
global $widget_content;
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);
$instance = wp_parse_args((array) $instance, array('title' => '', 'root' => '0', 'sort' => true));
$widget_title = apply_filters('widget_title', $instance['title']);
$album_root = $instance['root'];
$sort = $instance['sort'];
wppa('in_widget', 'superview');
wppa_bump_mocc();
$widget_content = wppa_get_superview_html($album_root, $sort);
wppa('in_widget', false);
echo $before_widget . $before_title . $widget_title . $after_title . $widget_content . $after_widget;
}
示例9: wppa_get_audio_html
function wppa_get_audio_html($args)
{
// Audio enabled?
if (!wppa_switch('enable_audio')) {
return '';
}
extract(wp_parse_args((array) $args, array('id' => '0', 'width' => '0', 'height' => '0', 'controls' => true, 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'audio-' . wppa('mocc'), 'cursor' => '', 'events' => '', 'title' => '', 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => '', 'use_thumb' => false, 'autoplay' => false)));
// No id? no go
if (!$id) {
return '';
}
// Not a audio? no go
if (!wppa_has_audio($id)) {
return '';
}
extract(wp_parse_args((array) wppa_has_audio($id), array('mp3' => false, 'wav' => false, 'ogg' => false)));
// Prepare attributes
$w = $width ? ' width:' . $width . 'px;' : '';
$h = $height ? ' height:' . $height . 'px;' : '';
$t = $margin_top ? ' margin-top:' . $margin_top . 'px;' : '';
$b = $margin_bottom ? ' margin-bottom:' . $margin_bottom . 'px;' : '';
$ctrl = $controls ? ' controls' : '';
$tit = $title ? ' title="' . $title . '"' : '';
$onc = $onclick ? ' onclick="' . $onclick . '"' : '';
$cls = $class ? ' class="' . $class . '"' : '';
$style = $style ? rtrim(trim($style), ';') . ';' : '';
$play = $autoplay ? ' autoplay' : '';
// Do we have html5 audio tag supported filetypes on board?
if ($mp3 || $wav || $ogg) {
// Assume the browser supports html5
$result = '<audio' . ' id="' . $tagid . '"' . ' data-from="wppa"' . ' ' . $ctrl . $play . ' style="' . $style . $w . $h . $t . $b . $cursor . '"' . ' ' . $events . ' ' . $tit . $onc . ' preload="' . $preload . '"' . $cls . ' >';
$result .= wppa_get_audio_body($id, false, $width, $height);
// Close the audio tag
$result .= '</audio>';
}
// Done
return $result;
}
示例10: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
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_bump_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', __('Best Of Photos', 'wp-photo-album-plus'));
$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('widget_width');
// $data = wppa_get_the_bestof( $count, $period, $sortby, $display );
$lineheight = wppa_opt('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;
wppa('in_widget', false);
}
示例11: wppa_get_lbtitle
function wppa_get_lbtitle($type, $id)
{
if (!is_numeric($id) || $id < '1') {
wppa_dbg_msg('Invalid arg wppa_get_lbtitle( ' . $id . ' )', 'red');
}
$thumb = wppa_cache_thumb($id);
$do_download = wppa_is_video($id) ? false : wppa_switch('art_monkey_on_lightbox');
$do_name = wppa_switch('ovl_' . $type . '_name') || wppa_switch('ovl_add_owner');
$do_desc = wppa_switch('ovl_' . $type . '_desc');
$do_sm = wppa_switch('share_on_lightbox');
$result = '';
if ($do_download) {
if (wppa_opt('art_monkey_display') == 'button') {
$result .= '<input' . ' type="button"' . ' title="' . __('Download', 'wp-photo-album-plus') . '"' . ' style="cursor:pointer; margin-bottom:0px; max-width:500px;"' . ' class="wppa-download-button"' . ' onclick="wppaAjaxMakeOrigName( ' . wppa('mocc') . ', ' . $id . ' );"' . ' value="' . __('Download:', 'wp-photo-album-plus') . ' ' . wppa_get_photo_name($id, wppa_switch('ovl_add_owner'), false, false, wppa_switch('ovl_' . $type . '_name')) . '"' . ' />';
} else {
$result .= '<a' . ' title="' . __('Download', 'wp-photo-album-plus') . '"' . ' style="cursor:pointer;"' . ' onclick="wppaAjaxMakeOrigName( ' . wppa('mocc') . ', ' . $id . ' );"' . ' >' . __('Download:', 'wp-photo-album-plus') . ' ' . wppa_get_photo_name($id, wppa_switch('ovl_add_owner'), false, false, wppa_switch('ovl_' . $type . '_name')) . '</a>';
}
} else {
if ($do_name) {
$result .= wppa_get_photo_name($id, wppa_switch('ovl_add_owner'), false, false, wppa_switch('ovl_' . $type . '_name'));
}
}
if ($do_name && $do_desc) {
$result .= '<br />';
}
if ($do_desc) {
$result .= wppa_get_photo_desc($thumb['id']);
}
if (($do_name || $do_desc) && $do_sm) {
$result .= '<br />';
}
if ($do_sm) {
$result .= wppa_get_share_html($thumb['id'], 'lightbox');
}
$result = esc_attr($result);
return $result;
}
示例12: wppa_do_filmthumb
function wppa_do_filmthumb($id, $idx, $do_for_feed = false, $glue = false)
{
$thumb = wppa_cache_thumb($id);
$result = '';
$src = wppa_fix_poster_ext(wppa_get_thumb_path($thumb['id']), $thumb['id']);
$max_size = wppa_opt('thumbsize');
if (wppa_in_widget()) {
$max_size /= 2;
}
$com_alt = wppa('is_comten') && wppa_switch('comten_alt_display') && !wppa_in_widget();
$imgattr_a = wppa_get_imgstyle_a($thumb['id'], $src, $max_size, 'optional', 'fthumb');
$imgstyle = $imgattr_a['style'];
$imgwidth = $imgattr_a['width'];
$imgheight = $imgattr_a['height'];
$cursor = $imgattr_a['cursor'];
$url = wppa_fix_poster_ext(wppa_get_thumb_url($thumb['id'], '', $imgwidth, $imgheight), $thumb['id']);
$furl = str_replace('/thumbs', '', $url);
$events = wppa_get_imgevents('film', $thumb['id'], 'nopopup', $idx);
$thumbname = wppa_get_photo_name($thumb['id']);
$target = wppa_switch('film_blank') || $thumb['linktarget'] == '_blank' ? 'target="_blank" ' : '';
$psotitle = $thumb['linktitle'] ? 'title="' . esc_attr($thumb['linktitle']) . '" ' : '';
$psourl = wppa_switch('film_overrule') && $thumb['linkurl'] ? 'href="' . $thumb['linkurl'] . '" ' . $target . $psotitle : '';
$imgalt = wppa_get_imgalt($thumb['id']);
if (wppa_opt('film_linktype') == 'lightbox') {
// $title = esc_attr( wppa_zoom_in( $thumb['id'] ) );
} else {
$events .= ' onclick="wppaGotoKeepState( ' . wppa('mocc') . ', ' . $idx . ' )"';
$events .= ' ondblclick="wppaStartStop( ' . wppa('mocc') . ', -1 )"';
}
if (is_feed()) {
if ($do_for_feed) {
$style_a = wppa_get_imgstyle_a($thumb['id'], $src, '100', '4', 'thumb');
$style = $style_a['style'];
$result .= '<a href="' . get_permalink() . '">' . '<img' . ' src="' . $url . '"' . ' ' . $imgalt . ' title="' . $thumbname . '"' . ' style="' . $style . '"' . ' />' . '</a>';
}
} else {
// If ! $do_for_feed: pre-or post-ambule. To avoid dup id change it in that case
$tmp = $do_for_feed ? 'film' : 'pre';
$style = $glue ? 'style="' . wppa_get_thumb_frame_style($glue, 'film') . '"' : '';
$result .= '<div' . ' id="' . $tmp . '_wppatnf_' . $thumb['id'] . '_' . wppa('mocc') . '"' . ' class="thumbnail-frame"' . ' ' . $style . ' >';
if ($psourl) {
// True only when pso activated and data present
$result .= '<a ' . $psourl . '>';
// $psourl contains url, target and title
} elseif (wppa_opt('film_linktype') == 'lightbox' && $tmp == 'film') {
$title = wppa_get_lbtitle('slide', $thumb['id']);
$videohtml = esc_attr(wppa_get_video_body($thumb['id']));
$audiohtml = esc_attr(wppa_get_audio_body($thumb['id']));
$result .= '<a href="' . $furl . '"' . ($videohtml ? ' data-videohtml="' . $videohtml . '"' . ' data-videonatwidth="' . wppa_get_videox($thumb['id']) . '"' . ' data-videonatheight="' . wppa_get_videoy($thumb['id']) . '"' : '') . ($audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '[occ' . wppa('mocc') . ']"' . ($title ? ' ' . wppa('lbtitle') . '="' . $title . '"' : '') . ' >';
}
if ($tmp == 'pre' && wppa_opt('film_linktype') == 'lightbox') {
$cursor = 'cursor:default;';
}
if ($tmp == 'film' && !$com_alt && !wppa_cdn('front') && !wppa_switch('lazy_or_htmlcomp')) {
$result .= '<!--';
}
if (wppa_is_video($thumb['id'])) {
$result .= wppa_get_video_html(array('id' => $thumb['id'], 'width' => $imgattr_a['width'], 'height' => $imgattr_a['height'], 'controls' => false, 'margin_top' => $imgattr_a['margin-top'], 'margin_bottom' => $imgattr_a['margin-bottom'], 'cursor' => $imgattr_a['cursor'], 'events' => $events, 'tagid' => 'wppa-' . $tmp . '-' . $idx . '-' . wppa('mocc')));
} else {
$result .= '<img' . ' id="wppa-' . $tmp . '-' . $idx . '-' . wppa('mocc') . '"' . ' class="wppa-' . $tmp . '-' . wppa('mocc') . '"' . ' src="' . $url . '"' . ' ' . $imgalt . ' style="' . $imgstyle . $cursor . '"' . ' ' . $events . ' data-title="' . ($psourl ? esc_attr($thumb['linktitle']) : '') . '"' . ' />';
}
if ($tmp == 'film' && !$com_alt && !wppa_cdn('front') && !wppa_switch('lazy_or_htmlcomp')) {
$result .= '-->';
}
if ($psourl) {
// True only when pso activated and data present
$result .= '</a>';
// $psourl contains url, target and title
} elseif (wppa_opt('film_linktype') == 'lightbox' && $tmp == 'film') {
$result .= '</a>';
}
$result .= '</div>';
}
wppa_out($result);
}
示例13: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
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', 'com');
wppa_bump_mocc();
// Hide widget if not logged in and login required to see comments
if (wppa_switch('comment_view_login') && !is_user_logged_in()) {
return;
}
extract($args);
$page = in_array(wppa_opt('comment_widget_linktype'), wppa('links_no_page')) ? '' : wppa_get_the_landing_page('wppa_comment_widget_linkpage', __('Recently commented photos', 'wp-photo-album-plus'));
$max = wppa_opt('comten_count');
$widget_title = apply_filters('widget_title', $instance['title']);
$photo_ids = wppa_get_comten_ids($max);
$widget_content = "\n" . '<!-- WPPA+ Comment Widget start -->';
$maxw = wppa_opt('comten_size');
$maxh = $maxw + 18;
if ($photo_ids) {
foreach ($photo_ids as $id) {
// Make the HTML for current comment
$widget_content .= "\n" . '<div class="wppa-widget" style="width:' . $maxw . 'px; height:' . $maxh . 'px; margin:4px; display:inline; text-align:center; float:left;">';
$image = wppa_cache_thumb($id);
if ($image) {
$link = wppa_get_imglnk_a('comten', $id, '', '', true);
$file = wppa_get_thumb_path($id);
$imgstyle_a = wppa_get_imgstyle_a($id, $file, $maxw, 'center', 'comthumb');
$imgstyle = $imgstyle_a['style'];
$width = $imgstyle_a['width'];
$height = $imgstyle_a['height'];
$cursor = $imgstyle_a['cursor'];
$imgurl = wppa_get_thumb_url($id, '', $width, $height);
$imgevents = wppa_get_imgevents('thumb', $id, true);
$title = '';
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_COMMENTS . "` WHERE `photo` = %s ORDER BY `timestamp` DESC", $id), ARRAY_A);
if ($comments) {
$first_comment = $comments['0'];
foreach ($comments as $comment) {
$title .= $comment['user'] . ' ' . __('wrote', 'wp-photo-album-plus') . ' ' . wppa_get_time_since($comment['timestamp']) . ":\n";
$title .= $comment['comment'] . "\n\n";
}
}
$title = esc_attr(strip_tags(trim($title)));
$album = '0';
$display = 'thumbs';
$widget_content .= wppa_get_the_widget_thumb('comten', $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents);
} else {
$widget_content .= __('Photo not found.', 'wp-photo-album-plus');
}
$widget_content .= "\n\t" . '<span style="font-size:' . wppa_opt('fontsize_widget_thumb') . 'px; cursor:pointer;" title="' . esc_attr($first_comment['comment']) . '" >' . $first_comment['user'] . '</span>';
$widget_content .= "\n" . '</div>';
}
} else {
$widget_content .= 'There are no commented photos (yet).';
}
$widget_content .= '<div style="clear:both"></div>';
$widget_content .= "\n" . '<!-- WPPA+ comment 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);
}
示例14: wppa_kickoff
function wppa_kickoff()
{
global $wppa_lang;
global $wppa_api_version;
global $wppa_init_js_data;
global $wppa_dynamic_css_data;
// init.css failed?
if ($wppa_dynamic_css_data) {
echo $wppa_dynamic_css_data;
}
// init.js failed?
if ($wppa_init_js_data) {
echo $wppa_init_js_data;
}
/* Obsolete?
// Patch for chrome or Edge?
// Test for chrome needs also test for NOT Edge, because browser signature of Edge also reports that it is chrome(-like)
if ( false && isset($_SERVER["HTTP_USER_AGENT"] ) ) {
echo '
<!-- WPPA+ Kickoff -->
<!-- Browser detected = '.wppa_decode_uri_component(strip_tags($_SERVER["HTTP_USER_AGENT"])).' -->';
if ( strstr($_SERVER["HTTP_USER_AGENT"], 'Chrome') && ! strstr($_SERVER["HTTP_USER_AGENT"], 'Edge') && wppa_switch( 'ovl_chrome_at_top') ) echo '
<style type="text/css">
#wppa-overlay-ic { padding-top: 5px !important; }
#wppa-overlay-qt-img { top: 5px !important; }
</style>';
if ( strstr($_SERVER["HTTP_USER_AGENT"], 'Edge') ) echo '
<style type="text/css">
#wppa-overlay-ic { padding-top: 0px !important; }
#wppa-overlay-qt-img { top: 5px !important; }
</style>';
}
*/
// Inline styles?
if (wppa_switch('inline_css')) {
echo '
<!-- WPPA+ Custom styles -->
<style type="text/css" >';
if (!wppa_switch('ovl_fs_icons')) {
echo '#wppa-norms-btn, #wppa-fulls-btn { display:none; }';
}
echo wppa_opt('custom_style') . '
</style>';
}
// Pinterest js
if ((wppa_switch('share_on') || wppa_switch('share_on_widget')) && wppa_switch('share_pinterest')) {
echo '
<!-- Pinterest share -->
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>';
}
if (wppa('debug')) {
error_reporting(wppa('debug'));
add_action('wp_footer', 'wppa_phpinfo');
add_action('wp_footer', 'wppa_errorlog');
echo '
<script type="text/javascript" >
wppaDebug = true;
</script>';
}
wppa('rendering_enabled', true);
echo '
<!-- Rendering enabled -->
<!-- /WPPA Kickoff -->
';
}
示例15: wppa_is_wanted_empty
function wppa_is_wanted_empty($thumbs)
{
if (!wppa_switch('show_empty_thumblist')) {
return false;
}
// Feature not enabled
if (is_array($thumbs) && count($thumbs) > wppa_get_mincount()) {
return false;
}
// Album is not empty
if (wppa_is_virtual()) {
return false;
}
// wanted empty only on real albums
if (wppa('albums_only')) {
return false;
}
// Explicitly no thumbs
// if ( wppa_switch( 'thumbs_first' ) && wppa_get_curpage() != '1' ) return false; // Only on page 1 if thumbs first
wppa('current_album', wppa('start_album'));
// Make sure upload knows the album
return true;
}