本文整理汇总了PHP中wppa_get_imgdir函数的典型用法代码示例。如果您正苦于以下问题:PHP wppa_get_imgdir函数的具体用法?PHP wppa_get_imgdir怎么用?PHP wppa_get_imgdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wppa_get_imgdir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wppa_inject_js
function wppa_inject_js()
{
global $wppa_api_version;
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
echo '<script type="text/javascript">' . "\n";
echo '/* <![CDATA[ */' . "\n";
echo "\t" . 'wppaImageDirectory = "' . wppa_get_imgdir() . '";' . "\n";
echo "\t" . 'wppaAjaxUrl = "' . admin_url('admin-ajax.php') . '";' . "\n";
echo "\t" . 'wppaPhotoDirectory = "' . WPPA_UPLOAD_URL . '/";' . "\n";
echo "\t" . 'wppaThumbDirectory = "' . WPPA_UPLOAD_URL . '/thumbs/";' . "\n";
echo "\t" . 'wppaTempDirectory = "' . WPPA_UPLOAD_URL . '/temp/";' . "\n";
echo "\t" . 'wppaFontDirectory = "' . WPPA_UPLOAD_URL . '/fonts/";' . "\n";
echo "\t" . 'wppaNoPreview = "' . __('No Preview available', 'wp-photo-album-plus') . '";' . "\n";
echo "\t" . 'wppaVersion = "' . $wppa_api_version . '";' . "\n";
echo "\t" . 'wppaSiteUrl = "' . site_url() . '";' . "\n";
echo "\t" . 'wppaWppaUrl = "' . WPPA_URL . '";' . "\n";
echo "\t" . 'wppaIncludeUrl = "' . trim(includes_url(), '/') . '";' . "\n";
echo "/* ]]> */\n";
echo "</script>\n";
}
示例2: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
global $wppa;
$wppa['in_widget'] = 'potd';
$wppa['mocc']++;
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);
$widget_title = apply_filters('widget_title', $instance['title']);
// get the photo ($image)
$image = wppa_get_potd();
// Make the HTML for current picture
$widget_content = "\n" . '<!-- WPPA+ Photo of the day Widget start -->';
$ali = wppa_opt('wppa_potd_align');
if ($ali != 'none') {
$align = 'text-align:' . $ali . ';';
} else {
$align = '';
}
$widget_content .= "\n" . '<div class="wppa-widget-photo" style="' . $align . ' padding-top:2px; ">';
if ($image) {
$id = $image['id'];
$w = wppa_opt('wppa_potd_widget_width');
$ratio = wppa_get_photoy($id) / wppa_get_photox($id);
$h = round($w * $ratio);
$usethumb = wppa_use_thumb_file($id, wppa_opt('wppa_widget_width'), '0');
$imgurl = wppa_fix_poster_ext($usethumb ? wppa_get_thumb_url($id, '', $w, $h) : wppa_get_photo_url($id, '', $w, $h), $id);
$name = wppa_get_photo_name($id);
$page = in_array(wppa_opt('wppa_widget_linktype'), $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_widget_linkpage', __a('Photo of the day'));
$link = wppa_get_imglnk_a('potdwidget', $id);
$is_video = wppa_is_video($id);
$has_audio = wppa_has_audio($id);
if ($link['is_lightbox']) {
$lightbox = ($is_video ? ' data-videohtml="' . esc_attr(wppa_get_video_body($id)) . '"' . ' data-videonatwidth="' . wppa_get_videox($id) . '"' . ' data-videonatheight="' . wppa_get_videoy($id) . '"' : '') . ($has_audio ? ' data-audiohtml="' . esc_attr(wppa_get_audio_body($id)) . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '"';
} else {
$lightbox = '';
}
if ($link) {
if ($link['is_lightbox']) {
$cursor = ' cursor:url(' . wppa_get_imgdir() . wppa_opt('wppa_magnifier') . '),pointer;';
$title = wppa_zoom_in($id);
$ltitle = wppa_get_lbtitle('potd', $id);
} else {
$cursor = ' cursor:pointer;';
$title = $link['title'];
$ltitle = $title;
}
} else {
$cursor = ' cursor:default;';
$title = esc_attr(stripslashes(__($image['name'])));
}
// The medal if on top
$widget_content .= wppa_get_medal_html_a(array('id' => $id, 'size' => 'M', 'where' => 'top'));
// The link, if any
if ($link) {
$widget_content .= "\n\t" . '<a href = "' . $link['url'] . '" target="' . $link['target'] . '" ' . $lightbox . ' ' . wppa('lbtitle') . '="' . $ltitle . '">';
}
// The image
if (wppa_is_video($id)) {
$widget_content .= "\n\t\t" . wppa_get_video_html(array('id' => $id, 'width' => wppa_opt('wppa_potd_widget_width'), 'title' => $title, 'controls' => wppa_opt('widget_linktype') == 'none', 'cursor' => $cursor));
} else {
$widget_content .= '<img' . ' src="' . $imgurl . '"' . ' style="width: ' . wppa_opt('wppa_potd_widget_width') . 'px;' . $cursor . '"' . ' ' . wppa_get_imgalt($id) . ($title ? 'title="' . $title . '"' : '') . '/ >';
}
// Close the link
if ($link) {
$widget_content .= "\n\t" . '</a>';
}
// The medal if at the bottom
$widget_content .= wppa_get_medal_html_a(array('id' => $id, 'size' => 'M', 'where' => 'bot'));
// Audio
if (wppa_has_audio($id)) {
$widget_content .= wppa_get_audio_html(array('id' => $id, 'width' => wppa_opt('wppa_potd_widget_width'), 'controls' => true));
}
} else {
// No image
$widget_content .= __a('Photo not found.', 'wppa_theme');
}
$widget_content .= "\n" . '</div>';
// Add subtitle, if any
switch (wppa_opt('wppa_widget_subtitle')) {
case 'none':
break;
case 'name':
if ($image && $image['name'] != '') {
$widget_content .= "\n" . '<div class="wppa-widget-text wppa-potd-text" style="' . $align . '">' . wppa_get_photo_name($id) . '</div>';
}
break;
case 'desc':
if ($image && $image['description'] != '') {
$widget_content .= "\n" . '<div class="wppa-widget-text wppa-potd-text" style="' . $align . '">' . wppa_get_photo_desc($id) . '</div>';
}
break;
case 'owner':
//.........这里部分代码省略.........
示例3: wppa_get_imgstyle_a
//.........这里部分代码省略.........
$height = $image_attr[1];
}
}
}
} else {
if ($type == 'cover' && wppa_switch('wppa_coversize_is_height') && (wppa_opt('wppa_coverphoto_pos') == 'top' || wppa_opt('wppa_coverphoto_pos') == 'bottom')) {
$height = $max_size;
$width = round($max_size * $image_attr[0] / $image_attr[1]);
} else {
if (wppa_is_landscape($image_attr)) {
$width = $max_size;
$height = round($max_size * $image_attr[1] / $image_attr[0]);
} else {
$height = $max_size;
$width = round($max_size * $image_attr[0] / $image_attr[1]);
}
}
}
switch ($type) {
case 'cover':
if (wppa_opt('wppa_bcolor_img') != '') {
// There is a border color given
$result['style'] .= ' border: 1px solid ' . wppa_opt('wppa_bcolor_img') . ';';
} else {
// No border color: no border
$result['style'] .= ' border-width: 0px;';
}
$result['style'] .= ' width:' . $width . 'px; height:' . $height . 'px;';
if (wppa_switch('wppa_use_cover_opacity') && !is_feed()) {
$opac = wppa_opt('wppa_cover_opacity');
$result['style'] .= ' opacity:' . $opac / 100 . '; filter:alpha( opacity=' . $opac . ' );';
}
if (wppa_opt('wppa_coverimg_linktype') == 'lightbox') {
$result['cursor'] = ' cursor:url( ' . wppa_get_imgdir() . wppa_opt('wppa_magnifier') . ' ),pointer;';
}
break;
case 'thumb':
// Normal
// Normal
case 'ttthumb':
// Topten
// Topten
case 'comthumb':
// Comment widget
// Comment widget
case 'fthumb':
// Filmthumb
// Filmthumb
case 'twthumb':
// Thumbnail widget
// Thumbnail widget
case 'ltthumb':
// Lasten widget
// Lasten widget
case 'albthumb':
// Album widget
if ($type == 'thumb' && wppa_get_get('hilite') == $id) {
$result['style'] .= ' border:2px solid blue;box-sizing:border-box;';
} else {
$result['style'] .= ' border-width: 0px;';
}
$result['style'] .= ' width:' . $width . 'px; height:' . $height . 'px;';
if ($xvalign == 'optional') {
$valign = wppa_opt('wppa_valign');
} else {
$valign = $xvalign;
示例4: _wppa_comment_admin
//.........这里部分代码省略.........
, this.value)">
<option value="pending" <?php
if ($com['status'] == 'pending') {
echo 'selected="selected"';
}
?>
><?php
_e('Pending', 'wp-photo-album-plus');
?>
</option>
<option value="approved" <?php
if ($com['status'] == 'approved') {
echo 'selected="selected"';
}
?>
><?php
_e('Approved', 'wp-photo-album-plus');
?>
</option>
<option value="spam" <?php
if ($com['status'] == 'spam') {
echo 'selected="selected"';
}
?>
><?php
_e('Spam', 'wp-photo-album-plus');
?>
</option>
</select>
<img id="wppa-comment-spin-<?php
echo $com['id'];
?>
" src="<?php
echo wppa_get_imgdir() . 'spinner.gif';
?>
" style="visibility:hidden" />
</td>
<?php
$url = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_manage_comments&tab=edit&edit_id=' . $com['id']);
if (isset($_GET['wppa-page'])) {
$url .= '&compage=' . strval(intval($_GET['wppa-page']));
}
if (isset($_GET['commentid'])) {
$url .= '&commentid=' . strval(intval($_GET['commentid']));
}
?>
<?php
$delurl = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_manage_comments&tab=delete&delete_id=' . $com['id']);
?>
<td style="color:green; cursor:pointer;" onclick="document.location='<?php
echo $url;
?>
'"><b><?php
_e('Edit', 'wp-photo-album-plus');
?>
</b></td>
<td style="color:red; cursor:pointer;" onclick="if (confirm('<?php
_e('Are you sure you want to delete this comment?', 'wp-photo-album-plus');
?>
')) document.location = '<?php
echo $delurl;
?>
';"><b><?php
_e('Delete', 'wp-photo-album-plus');
?>
</b></td>
示例5: wppa_create_wppa_init_js
//.........这里部分代码省略.........
wppaNextP = "' . __('Next', 'wp-photo-album-plus') . '";
wppaAvgRating = "' . __('Average rating', 'wp-photo-album-plus') . '";
wppaMyRating = "' . __('My rating', 'wp-photo-album-plus') . '";
wppaAvgRat = "' . __('Avg.', 'wp-photo-album-plus') . '";
wppaMyRat = "' . __('Mine', 'wp-photo-album-plus') . '";
wppaDislikeMsg = "' . __('You marked this image as inappropriate.', 'wp-photo-album-plus') . '";
wppaMiniTreshold = ' . (wppa_opt('mini_treshold') ? wppa_opt('mini_treshold') : '0') . ';
wppaRatingOnce = ' . (wppa_switch('rating_change') || wppa_switch('rating_multi') ? 'false' : 'true') . ';
wppaPleaseName = "' . __('Please enter your name', 'wp-photo-album-plus') . '";
wppaPleaseEmail = "' . __('Please enter a valid email address', 'wp-photo-album-plus') . '";
wppaPleaseComment = "' . __('Please enter a comment', 'wp-photo-album-plus') . '";
wppaHideWhenEmpty = ' . (wppa_switch('hide_when_empty') ? 'true' : 'false') . ';
wppaBGcolorNumbar = "' . wppa_opt('bgcolor_numbar') . '";
wppaBcolorNumbar = "' . wppa_opt('bcolor_numbar') . '";
wppaBGcolorNumbarActive = "' . wppa_opt('bgcolor_numbar_active') . '";
wppaBcolorNumbarActive = "' . wppa_opt('bcolor_numbar_active') . '";
wppaFontFamilyNumbar = "' . wppa_opt('fontfamily_numbar') . '";
wppaFontSizeNumbar = "' . wppa_opt('fontsize_numbar') . 'px";
wppaFontColorNumbar = "' . wppa_opt('fontcolor_numbar') . '";
wppaFontWeightNumbar = "' . wppa_opt('fontweight_numbar') . '";
wppaFontFamilyNumbarActive = "' . wppa_opt('fontfamily_numbar_active') . '";
wppaFontSizeNumbarActive = "' . wppa_opt('fontsize_numbar_active') . 'px";
wppaFontColorNumbarActive = "' . wppa_opt('fontcolor_numbar_active') . '";
wppaFontWeightNumbarActive = "' . wppa_opt('fontweight_numbar_active') . '";
wppaNumbarMax = "' . wppa_opt('numbar_max') . '";
wppaLang = "' . $wppa_lang . '";
wppaNextOnCallback = ' . (wppa_switch('next_on_callback') ? 'true' : 'false') . ';
wppaStarOpacity = ' . str_replace(',', '.', wppa_opt('star_opacity') / '100') . ';
wppaSlideWrap = ' . (wppa_switch('slide_wrap') ? 'true' : 'false') . ';
wppaEmailRequired = "' . wppa_opt('comment_email_required') . '";
wppaSlideBorderWidth = ' . $fbw . ';
wppaAllowAjax = ' . (wppa_switch('allow_ajax') ? 'true' : 'false') . ';
wppaUsePhotoNamesInUrls = ' . (wppa_switch('use_photo_names_in_urls') ? 'true' : 'false') . ';
wppaThumbTargetBlank = ' . (wppa_switch('thumb_blank') ? 'true' : 'false') . ';
wppaRatingMax = ' . wppa_opt('rating_max') . ';
wppaRatingDisplayType = "' . wppa_opt('rating_display_type') . '";
wppaRatingPrec = ' . wppa_opt('rating_prec') . ';
wppaStretch = ' . (wppa_switch('enlarge') ? 'true' : 'false') . ';
wppaMinThumbSpace = ' . wppa_opt('tn_margin') . ';
wppaThumbSpaceAuto = ' . (wppa_switch('thumb_auto') ? 'true' : 'false') . ';
wppaMagnifierCursor = "' . wppa_opt('magnifier') . '";
wppaArtMonkyLink = "' . wppa_opt('art_monkey_link') . '";
wppaAutoOpenComments = ' . (wppa_switch('auto_open_comments') ? 'true' : 'false') . ';
wppaUpdateAddressLine = ' . (wppa_switch('update_addressline') ? 'true' : 'false') . ';
wppaFilmThumbTitle = "' . (wppa_opt('film_linktype') == 'lightbox' ? wppa_zoom_in(false) : __('Double click to start/stop slideshow running', 'wp-photo-album-plus')) . '";
wppaVoteForMe = "' . __(wppa_opt('vote_button_text'), 'wp-photo-album-plus') . '";
wppaVotedForMe = "' . __(wppa_opt('voted_button_text'), 'wp-photo-album-plus') . '";
wppaSlideSwipe = ' . (wppa_switch('slide_swipe') ? 'true' : 'false') . ';
wppaMaxCoverWidth = ' . wppa_opt('max_cover_width') . ';
wppaDownLoad = "' . __('Download', 'wp-photo-album-plus') . '";
wppaSlideToFullpopup = ' . (wppa_opt('slideshow_linktype') == 'fullpopup' ? 'true' : 'false') . ';
wppaComAltSize = ' . wppa_opt('comten_alt_thumbsize') . ';
wppaBumpViewCount = ' . (wppa_switch('track_viewcounts') ? 'true' : 'false') . ';
wppaBumpClickCount = ' . (wppa_switch('track_clickcounts') ? 'true' : 'false') . ';
wppaShareHideWhenRunning = ' . (wppa_switch('share_hide_when_running') ? 'true' : 'false') . ';
wppaFotomoto = ' . (wppa_switch('fotomoto_on') ? 'true' : 'false') . ';
wppaArtMonkeyButton = ' . (wppa_opt('art_monkey_display') == 'button' ? 'true' : 'false') . ';
wppaFotomotoHideWhenRunning = ' . (wppa_switch('fotomoto_hide_when_running') ? 'true' : 'false') . ';
wppaCommentRequiredAfterVote = ' . (wppa_switch('vote_needs_comment') ? 'true' : 'false') . ';
wppaFotomotoMinWidth = ' . wppa_opt('fotomoto_min_width') . ';
wppaShortQargs = ' . (wppa_switch('use_short_qargs') ? 'true' : 'false') . ';
wppaOvlHires = ' . (wppa_switch('lb_hres') ? 'true' : 'false') . ';
wppaSlideVideoStart = ' . (wppa_switch('start_slide_video') ? 'true' : 'false') . ';
wppaSlideAudioStart = ' . (wppa_switch('start_slide_audio') ? 'true' : 'false') . ';
wppaAudioHeight = ' . wppa_get_audio_control_height() . ';
wppaRel = "' . (wppa_opt('lightbox_name') == 'wppa' ? 'data-rel' : 'rel') . '";
wppaOvlRadius = ' . wppa_opt('ovl_border_radius') . ';
wppaOvlBorderWidth = ' . wppa_opt('ovl_border_width') . ';
wppaEditPhotoWidth = "' . (wppa_opt('upload_edit') == 'new' ? 500 : 960) . '";
wppaThemeStyles = "' . (wppa_switch('upload_edit_theme_css') ? get_stylesheet_uri() : '') . '";
wppaStickyHeaderHeight = ' . wppa_opt('sticky_header_size') . ';
wppaRenderModal = ' . (wppa_switch('ajax_render_modal') ? 'true' : 'false') . ';
wppaModalQuitImg = "url(' . wppa_get_imgdir('smallcross-' . wppa_opt('ovl_theme') . '.gif') . ')";
wppaBoxRadius = "' . wppa_opt('bradius') . '";
wppaModalBgColor = "' . wppa_opt('bgcolor_modal') . '";
wppaUploadEdit = "' . wppa_opt('upload_edit') . '";
wppaSvgFillcolor = "' . wppa_opt('svg_color') . '";
wppaSvgBgcolor = "' . wppa_opt('svg_bg_color') . '";
wppaOvlSvgFillcolor = "' . wppa_opt('ovl_svg_color') . '";
wppaOvlSvgBgcolor = "' . wppa_opt('ovl_svg_bg_color') . '";
wppaSvgCornerStyle = "' . wppa_opt('icon_corner_style') . '";
';
// Open file
$file = @fopen(WPPA_PATH . '/wppa-init.' . $wppa_lang . '.js', 'wb');
if ($file) {
// Write file
fwrite($file, $content);
// Close file
fclose($file);
$wppa_init_js_data = '';
} else {
$wppa_init_js_data = '<script type="text/javascript">
/* Warning: file wppa-init.' . $wppa_lang . '.js could not be created */
/* The content is therefor output here */
' . $content . '
</script>
';
}
}
示例6: wppa_admin_spinner
function wppa_admin_spinner()
{
$result = '<img' . ' id="wppa-admin-spinner"' . ' src="' . wppa_get_imgdir('loader.gif') . '"' . ' style="' . 'position:fixed;' . 'left:50%;' . 'top:50%;' . 'margin-left:-33px;' . 'margin-top:-33px;' . 'z-index:9999999;' . '"' . ' />' . '<script type="text/javascript" >' . 'jQuery( document ).ready( function() { ' . 'setTimeout( "wppaTestAdminReady()", 200 ); ' . '} );' . 'function wppaTestAdminReady() { ' . ' if ( document.readyState === "complete" ) {' . 'jQuery( "#wppa-admin-spinner" ).fadeOut(); ' . ' } else { ' . ' setTimeout( "wppaTestAdminReady()", 200 ); ' . '}' . '}' . '</script>';
echo $result;
}
示例7: wppa_sphoto
function wppa_sphoto()
{
$id = wppa('single_photo');
$width = wppa_get_container_width();
$height = floor($width / wppa_get_ratio($id));
$usethumb = wppa_use_thumb_file($id, $width, $height);
$src = $usethumb ? wppa_get_thumb_url($id, '', $width, $height) : wppa_get_photo_url($id, '', $width, $height);
if (wppa_has_audio($id)) {
$src = wppa_fix_poster_ext($src, $id);
}
if (!wppa_in_widget()) {
wppa_bump_viewcount('photo', $id);
}
$autocol = wppa('auto_colwidth') || $width > 0 && $width <= 1.0;
// The initial width is $width if not autocol, else it should default to initial column width when auto
// or initial column width * fraction
if ($autocol) {
if ($width == 'auto') {
$contwidth = wppa_opt('initial_colwidth');
} else {
$contwidth = wppa_opt('initial_colwidth') * $width;
}
} else {
$contwidth = $width;
}
// Open the pseudo container
wppa_out('<div' . ' id="wppa-container-' . wppa('mocc') . '"' . ' class="' . (wppa('align') ? 'align' . wppa('align') : '') . ' wppa-sphoto-' . wppa('mocc') . '"' . ' style="width:' . $contwidth . 'px;position:relative;"' . ' >');
// The script for responsive
wppa_add_js_page_data("\n" . '<script type="text/javascript">');
if ($autocol) {
wppa_add_js_page_data("\n" . 'wppaAutoColumnWidth[' . wppa('mocc') . '] = true;');
if ($width > 0 && $width <= 1.0) {
wppa_add_js_page_data("\n" . 'wppaAutoColumnFrac[' . wppa('mocc') . '] = ' . $width . ';');
} else {
wppa_add_js_page_data("\n" . 'wppaAutoColumnFrac[' . wppa('mocc') . '] = 1.0;');
}
wppa_add_js_page_data("\n" . 'wppaColWidth[' . wppa('mocc') . '] = 0;');
}
wppa_add_js_page_data("\n" . 'wppaTopMoc = ' . wppa('mocc') . ';');
wppa_add_js_page_data("\n" . '</script>');
wppa('portrait_only', true);
$fis = wppa_get_fullimgstyle_a($id);
$width = $fis['width'];
$height = $fis['height'];
$style = $fis['style'];
$style .= 'box-sizing:content-box;vertical-align:middle;';
// The link
$link = wppa_get_imglnk_a('sphoto', $id);
if ($link) {
if ($link['is_lightbox']) {
$lbtitle = wppa_get_lbtitle('sphoto', $id);
$videobody = esc_attr(wppa_get_video_body($id));
$audiobody = esc_attr(wppa_get_audio_body($id));
$videox = wppa_get_videox($id);
$videoy = wppa_get_videoy($id);
wppa_out('<a' . ' href="' . $link['url'] . '"' . ($lbtitle ? ' ' . wppa('lbtitle') . '="' . $lbtitle . '"' : '') . ($videobody ? ' data-videohtml="' . $videobody . '"' : '') . ($audiobody ? ' data-audiohtml="' . $audiobody . '"' : '') . ($videox ? ' data-videonatwidth="' . $videox . '"' : '') . ($videoy ? ' data-videonatheight="' . $videoy . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '"' . ($link['target'] ? ' target="' . $link['target'] . '"' : '') . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' >');
} else {
wppa_out('<a' . ' href="' . $link['url'] . '"' . ' title="' . $link['title'] . '"' . ' target="' . $link['target'] . '"' . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' >');
}
}
// The image
$title = $link ? esc_attr($link['title']) : esc_attr(stripslashes(wppa_get_photo_name($id)));
if ($link['is_lightbox']) {
$style .= ' cursor:url( ' . wppa_get_imgdir() . wppa_opt('magnifier') . ' ),pointer;';
$title = wppa_zoom_in($id);
}
if (wppa_is_video($id)) {
if ($autocol) {
wppa_out(wppa_get_video_html(array('id' => $id, 'controls' => !$link['is_lightbox'], 'style' => $style, 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
} else {
wppa_out(wppa_get_video_html(array('id' => $id, 'width' => $width, 'height' => $height, 'controls' => !$link['is_lightbox'], 'style' => $style, 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
}
} else {
wppa_out('<img' . ' src="' . $src . '"' . ' ' . wppa_get_imgalt($id) . ' class="size-medium wppa-sphoto wppa-simg-' . wppa('mocc') . '"' . ' ' . wppa_get_imgalt($id) . ($title ? ' title="' . $title . '" ' : '') . ' style="' . $style . '"' . ($autocol ? '' : ' width="' . $width . '" height="' . $height . '" ') . '/ >');
}
// Close the link
if ($link) {
wppa_out('</a>');
}
// Add audio? sphoto
if (wppa_has_audio($id)) {
wppa_out('<div style="position:relative;z-index:11;" >');
$margl = wppa_opt('fullimage_border_width') === '' ? 0 : wppa_opt('fullimage_border_width') + 1;
$margb = $margl;
wppa_out(wppa_get_audio_html(array('id' => $id, 'cursor' => 'cursor:pointer;', 'style' => $style . 'position:absolute;' . 'left:' . $margl . 'px;' . 'bottom:' . $margb . 'px;' . 'padding:0;' . 'margin:0;' . 'border:none;' . 'height:' . wppa_get_audio_control_height() . 'px;' . 'border-radius:0;', 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
wppa_out('</div>');
}
// The pseudo container
wppa_out('</div>');
}
示例8: wppa_get_picture_html
function wppa_get_picture_html($args)
{
// Init
$defaults = array('id' => '0', 'type' => '', 'class' => '');
$args = wp_parse_args($args, $defaults);
$id = strval(intval($args['id']));
$type = $args['type'];
$class = $args['class'];
// Check existance of required args
foreach (array('id', 'type') as $item) {
if (!$args[$item]) {
wppa_dbg_msg('Missing ' . $item . ' in call to wppa_get_picture_html()', 'red', 'force');
return false;
}
}
// Check validity of args
if (!wppa_photo_exists($id)) {
wppa_dbg_msg('Photo ' . $id . ' does not exist in call to wppa_get_picture_html(). Type = ' . $type, 'red', 'force');
return false;
}
$types = array('sphoto', 'mphoto', 'xphoto', 'cover', 'thumb', 'ttthumb', 'comthumb', 'fthumb', 'twthumb', 'ltthumb', 'albthumb');
if (!in_array($type, $types)) {
wppa_dbg_msg('Unimplemented type ' . $type . ' in call to wppa_get_picture_html()', 'red', 'force');
return false;
}
// Get other data
$link = wppa_get_imglnk_a($type, $id);
$isthumb = strpos($type, 'thumb') !== false;
$file = wppa_fix_poster_ext($isthumb ? wppa_get_thumb_path($id) : wppa_get_photo_path($id), $id);
$href = wppa_fix_poster_ext($isthumb ? wppa_get_thumb_url($id) : wppa_get_photo_url($id), $id);
$autocol = wppa('auto_colwidth') || wppa('fullsize') > 0 && wppa('fullsize') <= 1.0;
$title = $link ? esc_attr($link['title']) : esc_attr(stripslashes(wppa_get_photo_name($id)));
$alt = wppa_get_imgalt($id);
// Find image style
switch ($type) {
case 'sphoto':
$style = 'width:100%;margin:0;';
if (!wppa_in_widget()) {
switch (wppa_opt('fullimage_border_width')) {
case '':
$style .= 'padding:0;' . 'border:none;';
break;
case '0':
$style .= 'padding:0;' . 'border:1px solid ' . wppa_opt('bcolor_fullimg') . ';' . 'box-sizing:border-box;';
break;
default:
$style .= 'padding:' . (wppa_opt('fullimage_border_width') - '1') . 'px;' . 'border:1px solid ' . wppa_opt('bcolor_fullimg') . ';' . 'box-sizing:border-box;' . 'background-color:' . wppa_opt('bgcolor_fullimg') . ';';
// If we do round corners...
if (wppa_opt('bradius') > '0') {
// then also here
$style .= 'border-radius:' . wppa_opt('fullimage_border_width') . 'px;';
}
}
}
break;
case 'mphoto':
case 'xphoto':
$style = 'width:100%;margin:0;padding:0;border:none;';
break;
default:
wppa_dbg_msg('Style for type ' . $type . ' is not implemented yet in wppa_get_picture_html()', 'red', 'force');
return false;
}
if ($link['is_lightbox']) {
$style .= 'cursor:url( ' . wppa_get_imgdir() . wppa_opt('magnifier') . ' ),pointer;';
$title = wppa_zoom_in($id);
}
// Create the html
$result = '';
// The link
if ($link) {
// Link is lightbox
if ($link['is_lightbox']) {
$lbtitle = wppa_get_lbtitle($type, $id);
$videobody = esc_attr(wppa_get_video_body($id));
$audiobody = esc_attr(wppa_get_audio_body($id));
$videox = wppa_get_videox($id);
$videoy = wppa_get_videoy($id);
$result .= '<a' . ' href="' . $link['url'] . '"' . ($lbtitle ? ' ' . wppa('lbtitle') . '="' . $lbtitle . '"' : '') . ($videobody ? ' data-videohtml="' . $videobody . '"' : '') . ($audiobody ? ' data-audiohtml="' . $audiobody . '"' : '') . ($videox ? ' data-videonatwidth="' . $videox . '"' : '') . ($videoy ? ' data-videonatheight="' . $videoy . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '"' . ($link['target'] ? ' target="' . $link['target'] . '"' : '') . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' data-alt="' . esc_attr(wppa_get_imgalt($id, true)) . '"' . ' >';
} else {
$result .= '<a' . (wppa_is_mobile() ? ' ontouchstart="wppaStartTime();" ontouchend="wppaTapLink(\'' . $id . '\',\'' . $link['url'] . '\');" ' : ' onclick="_bumpClickCount( \'' . $id . '\' );window.open(\'' . $link['url'] . '\', \'' . $link['target'] . '\' )"') . ' title="' . $link['title'] . '"' . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' >';
}
}
// The image
// Video?
if (wppa_is_video($id)) {
$result .= wppa_get_video_html(array('id' => $id, 'controls' => !$link, 'style' => $style, 'class' => $class));
} else {
$result .= '<img' . ' id="ph-' . $id . '-' . wppa('mocc') . '"' . ' src="' . $href . '"' . ' ' . wppa_get_imgalt($id) . ($class ? ' class="' . $class . '" ' : '') . ($title ? ' title="' . $title . '" ' : '') . ' style="' . $style . '"' . ' />';
}
// Close the link
if ($link) {
$result .= '</a>';
}
// Add audio? sphoto
if (wppa_has_audio($id)) {
$result .= '<div style="position:relative;z-index:11;" >';
// Find style for audio controls
switch ($type) {
case 'sphoto':
//.........这里部分代码省略.........
示例9: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
wppa('in_widget', 'potd');
wppa_bump_mocc();
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);
$widget_title = apply_filters('widget_title', $instance['title']);
// get the photo ($image)
$image = wppa_get_potd();
// Make the HTML for current picture
$widget_content = "\n" . '<!-- WPPA+ Photo of the day Widget start -->';
$ali = wppa_opt('potd_align');
if ($ali != 'none') {
$align = 'text-align:' . $ali . ';';
} else {
$align = '';
}
$widget_content .= "\n" . '<div class="wppa-widget-photo" style="' . $align . ' padding-top:2px;position:relative;" >';
if ($image) {
$id = $image['id'];
$w = wppa_opt('potd_widget_width');
$ratio = wppa_get_photoy($id) / wppa_get_photox($id);
$h = round($w * $ratio);
$usethumb = wppa_use_thumb_file($id, wppa_opt('potd_widget_width'), '0');
$imgurl = wppa_fix_poster_ext($usethumb ? wppa_get_thumb_url($id, '', $w, $h) : wppa_get_photo_url($id, '', $w, $h), $id);
$name = wppa_get_photo_name($id);
$page = in_array(wppa_opt('potd_linktype'), wppa('links_no_page')) && !wppa_switch('potd_counter') ? '' : wppa_get_the_landing_page('potd_linkpage', __('Photo of the day', 'wp-photo-album-plus'));
$link = wppa_get_imglnk_a('potdwidget', $id);
$is_video = wppa_is_video($id);
$has_audio = wppa_has_audio($id);
if ($link['is_lightbox']) {
$lightbox = ($is_video ? ' data-videohtml="' . esc_attr(wppa_get_video_body($id)) . '"' . ' data-videonatwidth="' . wppa_get_videox($id) . '"' . ' data-videonatheight="' . wppa_get_videoy($id) . '"' : '') . ($has_audio ? ' data-audiohtml="' . esc_attr(wppa_get_audio_body($id)) . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '"' . ' data-alt="' . esc_attr(wppa_get_imgalt($id, true)) . '"';
} else {
$lightbox = '';
}
if ($link) {
if ($link['is_lightbox']) {
$cursor = ' cursor:url(' . wppa_get_imgdir() . wppa_opt('magnifier') . '),pointer;';
$title = wppa_zoom_in($id);
$ltitle = wppa_get_lbtitle('potd', $id);
} else {
$cursor = ' cursor:pointer;';
$title = $link['title'];
$ltitle = $title;
}
} else {
$cursor = ' cursor:default;';
$title = esc_attr(stripslashes(__($image['name'], 'wp-photo-album-plus')));
}
// The medal if on top
$widget_content .= wppa_get_medal_html_a(array('id' => $id, 'size' => 'M', 'where' => 'top'));
// The link, if any
if ($link) {
$widget_content .= "\n\t" . '<a href = "' . $link['url'] . '" target="' . $link['target'] . '" ' . $lightbox . ' ' . wppa('lbtitle') . '="' . $ltitle . '">';
}
// The image
if (wppa_is_video($id)) {
$widget_content .= "\n\t\t" . wppa_get_video_html(array('id' => $id, 'width' => wppa_opt('potd_widget_width'), 'title' => $title, 'controls' => wppa_opt('potd_linktype') == 'none', 'cursor' => $cursor));
} else {
$widget_content .= '<img' . ' src="' . $imgurl . '"' . ' style="width: ' . wppa_opt('potd_widget_width') . 'px;' . $cursor . '"' . ' ' . wppa_get_imgalt($id) . ($title ? 'title="' . $title . '"' : '') . ' />';
}
// Close the link
if ($link) {
$widget_content .= '</a>';
}
// The medal if at the bottom
$widget_content .= wppa_get_medal_html_a(array('id' => $id, 'size' => 'M', 'where' => 'bot'));
// The counter
if (wppa_switch('potd_counter')) {
// If we want this
$alb = wppa_get_photo_item($id, 'album');
$c = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `album` = " . $alb) - 1;
if ($c > 0) {
if (wppa_opt('potd_counter_link') == 'thumbs') {
$lnk = wppa_get_album_url($alb, $page, 'thumbs', '1');
} elseif (wppa_opt('potd_counter_link') == 'slide') {
$lnk = wppa_get_slideshow_url($alb, $page, $id, '1');
} elseif (wppa_opt('potd_counter_link') == 'single') {
$lnk = wppa_encrypt_url(get_permalink($page) . '?occur=1&photo=' . $id);
// wppa_get_image_page_url_by_id( $id, true, false, $page );
} else {
wppa_log('Err', 'Unimplemented counter link type in wppa-potd-widget: ' . wppa_opt('potd_counter_link'));
}
$widget_content .= '<a href="' . $lnk . '" >' . '<div style="font-size:12px;position:absolute;right:4px;bottom:4px;" >+' . $c . '</div>' . '</a>';
}
}
// Audio
if (wppa_has_audio($id)) {
$widget_content .= wppa_get_audio_html(array('id' => $id, 'width' => wppa_opt('potd_widget_width'), 'controls' => true));
}
} else {
// No image
//.........这里部分代码省略.........
示例10: wppa_album_photos
//.........这里部分代码省略.........
?>
</label>
</th>
<?php
if (wppa_switch('use_wp_editor')) {
?>
<td>
<?php
$alfaid = wppa_alfa_id($photo['id']);
// $quicktags_settings = array( 'buttons' => 'strong,em,link,block,ins,ul,ol,li,code,close' );
wp_editor(stripslashes($photo['description']), 'wppaphotodesc' . $alfaid, array('wpautop' => true, 'media_buttons' => false, 'textarea_rows' => '6', 'tinymce' => true));
//, 'quicktags' => $quicktags_settings ) );
?>
<input
type="button" class="button-secundary" value="<?php
_e('Update Photo description', 'wp-photo-album-plus');
?>
" onclick="wppaAjaxUpdatePhoto( <?php
echo $photo['id'];
?>
, 'description', document.getElementById( 'wppaphotodesc'+'<?php
echo $alfaid;
?>
' ), false, '<?php
echo $alfaid;
?>
' )" />
<img id="wppa-photo-spin-<?php
echo $photo['id'];
?>
" src="<?php
echo wppa_get_imgdir() . 'wpspin.gif';
?>
" style="visibility:hidden" />
</td>
<?php
} else {
?>
<td>
<textarea style="width: 100%; height:120px;" onkeyup="wppaAjaxUpdatePhoto( <?php
echo $photo['id'];
?>
, 'description', this )" onchange="wppaAjaxUpdatePhoto( <?php
echo $photo['id'];
?>
, 'description', this )" ><?php
echo stripslashes($photo['description']);
?>
</textarea>
</td>
<?php
}
?>
</tr>
<?php
} else {
?>
<tr>
<th>
<label><?php
_e('Description:', 'wp-photo-album-plus');
?>
</label>
</th>
示例11: wppa_do_albumlist
function wppa_do_albumlist($parent, $nestinglevel, $albums, $seq)
{
global $wpdb;
$alt = true;
foreach (array_keys($seq) as $s) {
// Obey the global sequence
$album = $albums[$s];
if ($album['a_parent'] == $parent) {
if (wppa_have_access($album)) {
$counts = wppa_treecount_a($album['id']);
$pendcount = $counts['pendphotos'];
$schedulecount = $counts['scheduledphotos'];
$haschildren = wppa_have_accessable_children($album);
$class = '';
if ($parent != '0' && $parent != '-1') {
$class .= 'wppa-alb-on-' . $parent . ' ';
$par = $parent;
while ($par != '0' && $par != '-1') {
$class .= 'wppa-alb-off-' . $par . ' ';
$par = wppa_get_parentalbumid($par);
}
}
if ($alt) {
$class .= ' alternate';
}
$style = '';
if ($pendcount) {
$style .= 'background-color:#ffdddd; ';
}
// if ( $haschildren ) $style .= 'font-weight:bold; ';
if ($parent != '0' && $parent != '-1') {
$style .= 'display:none; ';
}
$onclickon = 'jQuery(\'.wppa-alb-on-' . $album['id'] . '\').css(\'display\',\'\'); jQuery(\'#alb-arrow-on-' . $album['id'] . '\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-off-' . $album['id'] . '\').css(\'display\',\'\');';
$onclickoff = 'jQuery(\'.wppa-alb-off-' . $album['id'] . '\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-on-' . $album['id'] . '\').css(\'display\',\'\'); jQuery(\'#alb-arrow-off-' . $album['id'] . '\').css(\'display\',\'none\'); checkArrows();';
$indent = $nestinglevel;
if ($indent > '5') {
$indent = 5;
}
?>
<tr class="<?php
echo $class;
?>
" style="<?php
echo $style;
?>
" >
<?php
$i = 0;
while ($i < $indent) {
echo '<td style="padding:2px;" ></td>';
$i++;
}
?>
<td style="padding:2px; text-align:center;" ><?php
if ($haschildren) {
?>
<img id="alb-arrow-off-<?php
echo $album['id'];
?>
" class="alb-arrow-off" style="height:16px; display:none;" src="<?php
echo wppa_get_imgdir() . 'backarrow.gif';
?>
" onclick="<?php
echo $onclickoff;
?>
" title="<?php
_e('Collapse subalbums', 'wp-photo-album-plus');
?>
" />
<img id="alb-arrow-on-<?php
echo $album['id'];
?>
" class="alb-arrow-on" style="height:16px;" src="<?php
echo wppa_get_imgdir() . 'arrow.gif';
?>
" onclick="<?php
echo $onclickon;
?>
" title="<?php
_e('Expand subalbums', 'wp-photo-album-plus');
?>
" />
<?php
}
?>
</td>
<td style="padding:2px;" ><?php
echo $album['id'];
?>
</td>
<?php
$i = $indent;
while ($i < 5) {
echo '<td style="padding:2px;" ></td>';
$i++;
}
?>
<td><?php
//.........这里部分代码省略.........
示例12: wppa_album_sequence
//.........这里部分代码省略.........
xmlhttp.onreadystatechange = function() {
if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
var ArrValues = xmlhttp.responseText.split( "||" );
if ( ArrValues[0] != '' ) {
alert( 'The server returned unexpected output:\n' + ArrValues[0] );
}
switch ( ArrValues[1] ) {
case '0': // No error
var i = seqno - 1;
var descend = <?php
if ($is_descending) {
echo 'true';
} else {
echo 'false';
}
?>
;
if ( descend ) {
i = <?php
echo count($albums);
?>
- seqno;
}
jQuery( '#wppa-album-seqno-' + album ).html( seqno );
if ( wppaRenumberPending ) {
jQuery( '#wppa-pb-'+i ).css({backgroundColor:'orange'});
}
else {
jQuery( '#wppa-pb-'+i ).css({backgroundColor:'green'});
}
if ( wppaLastAlbum = album ) {
wppaRenumberBusy = false;
}
break;
default: // Any error
jQuery( '#wppa-album-seqno-' + album ).html( '<span style="color"red" >Err:' + ArrValues[1] + '</span>' );
break;
}
wppaAjaxInProgress--;
// No longer busy?
if ( wppaAjaxInProgress == 0 ) {
if ( wppaRenumberPending ) {
// Redo
wppaRenumberPending = false;
wppaDoRenumber();
}
}
}
}
xmlhttp.open( 'POST',wppaAjaxUrl,true );
xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
xmlhttp.send( data );
wppaAjaxInProgress++;
jQuery( "#wppa-sort-seqn-albums-" + album ).attr( 'value', seqno ); // set hidden value to new value to prevent duplicate action
var spinnerhtml = '<img src="' + wppaImageDirectory + 'spinner.gif' + '" />';
jQuery( '#wppa-album-seqno-' + album ).html( spinnerhtml );
}
</script>
<br />
<div id="wppa-progbar" style="width:100%;height:12px;" >
<?php
$c = count($albums);
$l = 100 / $c;
$i = 0;
while ($i < $c) {
echo '<div' . ' id="wppa-pb-' . $i . '"' . ' style="display:inline;float:left;background-color:green;height:12px;width:' . $l . '%;"' . ' >' . '</div>';
$i++;
}
?>
</div>
<br />
<div class="widefat" style="max-width:600px;" >
<div id="sortable-albums">
<?php
foreach ($albums as $album) {
$cover_photo_id = wppa_get_coverphoto_id($album['id']);
echo '
<div' . ' id="albumitem-' . $album['id'] . '"' . ' class="ui-state-default-albums"' . ' style="background-color:#eeeeee;cursor:move;"' . ' >' . '<div' . ' style="height:100%;width:25%;float:left;text-align:center;overflow:hidden;" >';
if (wppa_is_video($cover_photo_id)) {
echo wppa_get_video_html(array('id' => $cover_photo_id, 'height' => '50', 'margin_top' => '5', 'margin_bottom' => '5', 'controls' => false));
} else {
echo '<img' . ' class="wppa-cover-image"' . ' src="' . wppa_fix_poster_ext(wppa_get_thumb_url(wppa_get_coverphoto_id($album['id'])), $cover_photo_id) . '"' . ' style="max-height:50px; margin: 5px;"' . ' />';
}
echo '</div>' . '<div style="height:100%;width:40%;float:left;font-size:12px;overflow:hidden;" >' . '<b>' . wppa_get_album_name($album['id']) . '</b>' . '<br />' . wppa_get_album_desc($album['id']) . '</div>' . '<div style="float:right;width:10%;" >' . '<table>' . '<tr><td>' . '<img' . ' src="' . wppa_get_imgdir('up.png') . '"' . ' title="' . esc_attr(__('To top', 'wp-photo-album-plus')) . '"' . ' style="cursor:pointer;"' . ' onclick="' . 'jQuery( \'#albumitem-' . $album['id'] . '\' ).parent().prepend(jQuery( \'#albumitem-' . $album['id'] . '\' ));' . 'wppaDoRenumber();' . '"' . ' />' . '</td></tr>' . '<tr><td>' . '<img' . ' src="' . wppa_get_imgdir('up.png') . '"' . ' title="' . esc_attr(__('One up', 'wp-photo-album-plus')) . '"' . ' style="cursor:pointer;width:24px;"' . ' onclick="' . 'jQuery( \'#albumitem-' . $album['id'] . '\' ).prev().before(jQuery( \'#albumitem-' . $album['id'] . '\' ));' . 'wppaDoRenumber();' . '"' . ' />' . '</td></tr>' . '<tr><td>' . '<img' . ' src="' . wppa_get_imgdir('down.png') . '"' . ' title="' . esc_attr(__('One down', 'wp-photo-album-plus')) . '"' . ' style="cursor:pointer;width:24px;"' . ' onclick="' . 'jQuery( \'#albumitem-' . $album['id'] . '\' ).next().after(jQuery( \'#albumitem-' . $album['id'] . '\' ));' . 'wppaDoRenumber();' . '"' . ' />' . '</td></tr>' . '<tr><td>' . '<img' . ' src="' . wppa_get_imgdir('down.png') . '"' . ' title="' . esc_attr(__('To bottom', 'wp-photo-album-plus')) . '"' . ' style="cursor:pointer;"' . ' onclick="' . 'jQuery( \'#albumitem-' . $album['id'] . '\' ).parent().append(jQuery( \'#albumitem-' . $album['id'] . '\' ));' . 'wppaDoRenumber();' . '"' . ' />' . '</td></tr>' . '</table>' . '</div>' . '<div style="float:right; width:25%;" >' . '<span style=""> ' . __('Id:', 'wp-photo-album-plus') . ' ' . $album['id'] . '</span>' . '<span style=""> - ' . __('Ord:', 'wp-photo-album-plus') . '</span>' . '<span id="wppa-album-seqno-' . $album['id'] . '" > ' . $album['a_order'] . '</span>' . '<br />' . '<a href="' . wppa_ea_url($album['id']) . '" style="position:absolute;bottom:0;" >' . __('Edit', 'wp-photo-album-plus') . '</a>' . '</div>' . '<input type="hidden" id="album-nonce-' . $album['id'] . '" value="' . wp_create_nonce('wppa_nonce_' . $album['id']) . '" />' . '<input type="hidden" class="wppa-sort-item-albums" value="' . $album['id'] . '" />' . '<input type="hidden" class="wppa-sort-seqn-albums" id="wppa-sort-seqn-albums-' . $album['id'] . '" value="' . $album['a_order'] . '" />' . '</div>';
}
?>
</div>
<div style="clear:both;"></div>
</div>
<?php
}
示例13: wppa_slide_rating_range
function wppa_slide_rating_range($opt)
{
global $wppa;
global $wppa_opt;
if ($opt == 'optional' && !wppa_switch('wppa_rating_on')) {
return;
}
if ($wppa['is_slideonly'] == '1') {
return;
}
/* Not when slideonly */
if (is_feed()) {
wppa_dummy_bar(__a('- - - Rating enabled - - -', 'wppa_theme'));
return;
}
$fs = $wppa_opt['wppa_fontsize_nav'];
if ($fs != '') {
$fs += 3;
} else {
$fs = '15';
}
// iconsize = fontsize+3, Default to 15
$dh = $fs + '6';
$size = 'font-size:' . $fs . 'px;';
// Open the rating box
$wppa['out'] .= '
<!-- wppa-rating-' . $wppa['mocc'] . ' -->
<div id="wppa-rating-' . $wppa['mocc'] . '" class="wppa-box wppa-nav wppa-nav-text" style="' . __wcs('wppa-box') . __wcs('wppa-nav') . __wcs('wppa-nav-text') . $size . ' text-align:center;">';
// Graphic display ?
if ($wppa_opt['wppa_rating_display_type'] == 'graphic') {
if ($wppa_opt['wppa_rating_max'] == '5') {
$r['1'] = __a('very low', 'wppa_theme');
$r['2'] = __a('low', 'wppa_theme');
$r['3'] = __a('average', 'wppa_theme');
$r['4'] = __a('high', 'wppa_theme');
$r['5'] = __a('very high', 'wppa_theme');
} else {
for ($i = '1'; $i <= '10'; $i++) {
$r[$i] = $i;
}
}
$style = 'style="height:' . $fs . 'px; margin:0 0 -3px 0; padding:0; box-shadow:none; display:inline;"';
$icon = 'star.png';
// Display avg rating
if (wppa_switch('wppa_show_avg_rating')) {
$wppa['out'] .= '<span id="wppa-avg-rat-' . $wppa['mocc'] . '">' . __a('Average rating', 'wppa_theme') . '</span> ';
$i = '1';
while ($i <= $wppa_opt['wppa_rating_max']) {
$wppa['out'] .= wppa_nltab() . '<img id="wppa-avg-' . $wppa['mocc'] . '-' . $i . '" class="wppa-avg-' . $wppa['mocc'] . ' no-shadow" ' . $style . ' src="' . wppa_get_imgdir() . $icon . '" alt="' . $i . '" title="' . __a('Average rating', 'wppa_theme') . ': ' . $r[$i] . '" />';
$i++;
}
}
$wppa['out'] .= '<img id="wppa-filler-' . $wppa['mocc'] . '" src="' . wppa_get_imgdir() . 'transp.png" alt="f" style="width:' . $wppa_opt['wppa_ratspacing'] . 'px; height:15px; box-shadow:none; padding:0; margin:0; border:none;" />';
// Display my rating
if (!wppa_switch('wppa_rating_login') || is_user_logged_in()) {
// Logged in or do'nt care
// Show dislike icon?
$pad = round(($wppa_opt['wppa_ratspacing'] - $fs) / 2);
if ($pad < 5) {
$pad = '5';
}
$tdstyle = 'style="height:' . $fs . 'px; margin:0 0 -3px 0; padding:0 ' . $pad . 'px; box-shadow:none; display:inline;"';
if ($wppa_opt['wppa_dislike_mail_every']) {
$evnts = 'onmouseover="jQuery(this).stop().fadeTo(100, 1.0)" onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)" onclick="if (confirm(\'' . __a('Are you sure you want to mark this image as inappropriate?') . '\')) wppaRateIt(' . $wppa['mocc'] . ', -1)"';
$title = 'title="' . __a('Click this if you do NOT like this image!', 'wppa_theme') . '"';
$wppa['out'] .= '<img id="wppa-dislike-' . $wppa['mocc'] . '" ' . $title . ' src="' . wppa_get_imgdir() . 'thumbdown.png" alt="d" ' . $tdstyle . ' class="no-shadow" ' . $evnts . ' />';
if (wppa_switch('wppa_dislike_show_count')) {
$wppa['out'] .= '<span id="wppa-discount-' . $wppa['mocc'] . '" style="cursor:default" title="' . __a('Number of people who marked this photo as inapprpriate') . '"></span>';
}
}
// Text left if no avg rating
if (!wppa_switch('wppa_show_avg_rating')) {
$wppa['out'] .= __a('My rating', 'wppa_theme') . ': ';
}
// Display the my rating stars
$i = '1';
while ($i <= $wppa_opt['wppa_rating_max']) {
$wppa['out'] .= wppa_nltab() . '<img id="wppa-rate-' . $wppa['mocc'] . '-' . $i . '" class="wppa-rate-' . $wppa['mocc'] . ' no-shadow" ' . $style . ' src="' . wppa_get_imgdir() . $icon . '" alt="' . $i . '" title="' . __a('My rating', 'wppa_theme') . ': ' . $r[$i] . '" onmouseover="wppaFollowMe(' . $wppa['mocc'] . ', ' . $i . ')" onmouseout="wppaLeaveMe(' . $wppa['mocc'] . ', ' . $i . ')" onclick="wppaRateIt(' . $wppa['mocc'] . ', ' . $i . ')" />';
$i++;
}
// Text right if avg rating diaplayed
if (wppa_switch('wppa_show_avg_rating')) {
$wppa['out'] .= ' ' . '<span id="wppa-my-rat-' . $wppa['mocc'] . '">' . __a('My rating', 'wppa_theme') . '</span>';
}
} else {
if (wppa_switch('wppa_login_links')) {
$wppa['out'] .= sprintf(__a('You must <a href="%s">login</a> to vote'), site_url('wp-login.php', 'login'));
} else {
$wppa['out'] .= __a('You must login to vote');
}
}
} elseif ($wppa_opt['wppa_rating_display_type'] == 'numeric') {
// Display avg rating
if (wppa_switch('wppa_show_avg_rating')) {
$wppa['out'] .= __a('Average rating', 'wppa_theme') . ': ';
$wppa['out'] .= '<span id="wppa-numrate-avg-' . $wppa['mocc'] . '"></span>';
$wppa['out'] .= ' •';
}
// Display my rating
if (!wppa_switch('wppa_rating_login') || is_user_logged_in()) {
//.........这里部分代码省略.........
示例14: wppa_album_photos
//.........这里部分代码省略.........
echo '<table' . ' class="wppa-table wppa-photo-table"' . ' style="width:100%;"' . ' >' . '<tbody>' . '<tr>' . '<td>';
// Stereo
if (wppa_switch('enable_stereo') && !$is_multi) {
echo __('Stereophoto:', 'wp-photo-album-plus') . ' ' . '<select' . ' id="stereo-' . $id . '"' . ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'stereo\', this )"' . ' >' . '<option value="0"' . ($stereo == '0' ? ' selected="selected"' : '') . ' >' . __('no stereo image or ready anaglyph', 'wp-photo-album-plus') . '</option>' . '<option value="1"' . ($stereo == '1' ? ' selected="selected"' : '') . ' >' . __('Left - right stereo image', 'wp-photo-album-plus') . '</option>' . '<option value="-1"' . ($stereo == '-1' ? ' selected="selected"' : '') . ' >' . __('Right - left stereo image', 'wp-photo-album-plus') . '</option>' . '</select>' . ' ';
__('Images:', 'wp-photo-album-plus') . ' ';
$files = glob(WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*');
$c = 0;
if (!empty($files)) {
sort($files);
foreach ($files as $file) {
echo '<a href="' . str_replace(WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file) . '" target="_blank" >' . basename($file) . '</a>';
$c++;
if ($c == count($files)) {
echo '. ';
} else {
echo ', ';
}
}
}
}
// Watermark
if (!$is_multi || is_file(wppa_fix_poster_ext(wppa_get_photo_path($id), $id))) {
echo __('Watermark:', 'wp-photo-album-plus') . ' ';
if (wppa_switch('watermark_on')) {
$user = wppa_get_user();
if (wppa_switch('watermark_user') || current_user_can('wppa_settings')) {
echo '<select' . ' id="wmfsel_' . $id . '"' . ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this );"' . ' >' . wppa_watermark_file_select() . '</select>' . __('Pos:', 'wp-photo-album-plus') . ' ' . '<select' . ' id="wmpsel_' . $id . '"' . ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this );"' . ' >' . wppa_watermark_pos_select() . '</select>' . '<input' . ' type="button"' . ' class="button-secundary"' . ' value="' . esc_attr(__('Apply watermark', 'wp-photo-album-plus')) . '"' . ' onclick="wppaTryWatermark( ' . $id . ' )"' . ' />';
} else {
echo __('File:', 'wp-photo-album-plus') . ' ' . __($wmfile, 'wp-photo-album-plus') . ' ';
if ($wmfile != '--- none ---') {
echo __('Pos:', 'wp-photo-album-plus') . ' ' . $wmpos;
}
}
echo '<img' . ' id="wppa-water-spin-' . $id . '"' . ' src="' . wppa_get_imgdir() . 'spinner.gif' . '"' . ' alt="Spin"' . ' style="visibility:hidden"' . ' />';
} else {
echo __('Not configured', 'wp-photo-album-plus');
}
echo ' ';
}
echo '</td>' . '</tr>' . '</tbody>' . '</table>';
}
echo "\n" . '<!-- Section 3 -->' . '<table' . ' class="wppa-table wppa-photo-table"' . ' style="width:100%;"' . ' >' . '<tbody>' . '<tr>' . '<td>';
// --- Actions ---
// Rotate
if (!$b_is_video) {
echo '<input' . ' type="button"' . ' onclick="wppaTryRotLeft( ' . $id . ' )"' . ' value="' . esc_attr(__('Rotate left', 'wp-photo-album-plus')) . '"' . ' />' . ' ' . '<input' . ' type="button"' . ' onclick="wppaTryRot180( ' . $id . ' )"' . ' value="' . esc_attr(__('Rotate 180°', 'wp-photo-album-plus')) . '"' . ' />' . ' ' . '<input' . ' type="button"' . ' onclick="wppaTryRotRight( ' . $id . ' )"' . ' value="' . esc_attr(__('Rotate right', 'wp-photo-album-plus')) . '"' . ' />' . ' ' . '<input' . ' type="button"' . ' onclick="wppaTryFlip( ' . $id . ' )"' . ' value="' . esc_attr(__('Flip', 'wp-photo-album-plus')) . '"' . ' />' . ' ';
}
// Remake displayfiles
if (!$is_video) {
echo '<input' . ' type="button"' . ' title="' . esc_attr(__('Remake display file and thumbnail file', 'wp-photo-album-plus')) . '"' . ' onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', this, ' . (wppa('front_edit') ? 'false' : 'true') . ' )"' . ' value="' . esc_attr(__('Remake files', 'wp-photo-album-plus')) . '"' . ' />' . ' ';
}
// Remake thumbnail
if (!$is_video) {
echo '<input' . ' type="button"' . ' title=' . esc_attr(__('Remake thumbnail file', 'wp-photo-album-plus')) . '"' . ' onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', this, ' . (wppa('front_edit') ? 'false' : 'true') . ' )"' . ' value="' . esc_attr(__('Remake thumbnail file', 'wp-photo-album-plus')) . '"' . ' />' . ' ';
}
// Move/copy
if (!$quick) {
$max = wppa_opt('photo_admin_max_albums');
if (!$max || wppa_get_total_album_count() < $max) {
// If not done yet, get the album options html with the current album excluded
if (!isset($album_select[$album])) {
$album_select[$album] = wppa_album_select_a(array('checkaccess' => true, 'path' => wppa_switch('hier_albsel'), 'exclude' => $album, 'selected' => '0', 'addpleaseselect' => true));
}
echo __('Target album for copy/move:', 'wp-photo-album-plus') . '<select' . ' id="target-' . $id . '"' . ' >' . $album_select[$album] . '</select>';
} else {
echo __('Target album for copy/move:', 'wp-photo-album-plus') . '<input' . ' id="target-' . $id . '"' . ' type="number"' . ' style="height:20px;"' . ' placeholder="' . __('Album id', 'wp-photo-album-plus') . '"' . ' />';
示例15: wppa_container
function wppa_container($action)
{
global $wppa_version;
// The theme version ( wppa_theme.php )
global $wppa_microtime;
global $wppa_microtime_cum;
global $wppa_err_displayed;
global $wppa_loadtime;
global $wppa_initruntimetime;
static $wppa_numqueries;
static $auto;
global $blog_id;
if (is_feed()) {
return;
}
// Need no container in RSS feeds
if ($action == 'open') {
$wppa_numqueries = get_num_queries();
// Open the container
if (!wppa('ajax')) {
// A modal container
wppa_out('<div' . ' id="wppa-modal-container-' . wppa('mocc') . '"' . ' style="position:relative;z-index:100000;"' . ' >' . '</div>');
// If static maximum in responsive theme, add wrapper
wppa_container_wrapper('open');
wppa_out('<div' . ' id="wppa-container-' . wppa('mocc') . '"' . ' style="' . wppa_get_container_style() . '"' . ' class="' . 'wppa-container' . ' ' . 'wppa-container-' . wppa('mocc') . ' ' . 'wppa-rev-' . wppa('revno') . ' ' . 'wppa-prevrev-' . wppa_opt('prevrev') . ' ' . 'wppa-theme-' . $wppa_version . ' ' . 'wppa-api-' . wppa('api_version') . '"' . ' >');
}
// Spinner for Ajax
if (wppa_switch('allow_ajax')) {
if (!wppa_in_widget()) {
wppa_out('<img' . ' id="wppa-ajax-spin-' . wppa('mocc') . '"' . ' src="' . wppa_get_imgdir() . 'loader.gif"' . ' alt="spinner"' . ' style="' . 'box-shadow:none;' . 'z-index:1010;' . 'position:fixed;' . 'top:50%;' . 'margin-top:-32px;' . 'left:50%;' . 'margin-left:-32px;' . 'display:none;' . '"' . ' />');
}
}
// Start timer if in debug mode
if (wppa('debug')) {
$wppa_microtime = -microtime(true);
}
if (wppa('mocc') == '1') {
wppa_dbg_msg('Plugin load time :' . substr($wppa_loadtime, 0, 5) . 's.');
wppa_dbg_msg('Init runtime time :' . substr($wppa_initruntimetime, 0, 5) . 's.');
wppa_dbg_msg('Num queries before wppa :' . get_num_queries());
}
/* Check if wppa.js and jQuery are present */
if (!$wppa_err_displayed && (WPPA_DEBUG || wppa_get_get('debug') || WP_DEBUG) && !wppa_switch('defer_javascript')) {
wppa_out('<script type="text/javascript">/* <![CDATA[ */');
wppa_out("if ( typeof( _wppaSlides ) == 'undefined' ) " . "alert( 'There is a problem with your theme. The file wppa.js is not loaded when it is expected ( Errloc = wppa_container ).' );");
wppa_out("if ( typeof( jQuery ) == 'undefined' ) " . "alert( 'There is a problem with your theme. The jQuery library is not loaded when it is expected ( Errloc = wppa_container ).' );");
wppa_out("/* ]]> */</script>");
$wppa_err_displayed = true;
}
/* Check if init is properly done */
if (!wppa_opt('fullsize')) {
wppa_out('<script type="text/javascript">/* <![CDATA[ */');
wppa_out("alert( 'The initialisation of wppa+ is not complete yet. " . "You will probably see division by zero errors. " . "Please run Photo Albums -> Settings admin page Table VIII-A1. ( Errloc = wppa_container ).' );");
wppa_out("/* ]]> */</script>");
}
// Nonce field check for rating security
if (wppa('mocc') == '1') {
if (wppa_get_get('rating')) {
$nonce = wppa_get_get('nonce');
$ok = wp_verify_nonce($nonce, 'wppa-check');
if ($ok) {
wppa_dbg_msg('Rating nonce ok');
if (!is_user_logged_in()) {
sleep(2);
}
} else {
die('<b>' . __('ERROR: Illegal attempt to enter a rating.', 'wp-photo-album-plus') . '</b>');
}
}
}
// Nonce field check for comment security
if (wppa('mocc') == '1') {
if (wppa_get_post('comment')) {
$nonce = wppa_get_post('nonce');
$ok = wp_verify_nonce($nonce, 'wppa-check');
if ($ok) {
wppa_dbg_msg('Comment nonce ok');
if (!is_user_logged_in()) {
sleep(2);
}
} else {
die('<b>' . __('ERROR: Illegal attempt to enter a comment.', 'wp-photo-album-plus') . '</b>');
}
}
}
wppa_out(wppa_nonce_field('wppa-check', 'wppa-nonce', false, false));
if (wppa_page('oneofone')) {
wppa('portrait_only', true);
}
wppa('alt', 'alt');
// Javascript occurrence dependant stuff
wppa_add_js_page_data("\n" . '<script type="text/javascript">');
// wppa( 'auto_colwidth' ) is set by the filter or by wppa_albums in case called directly
// wppa_opt( 'colwidth' ) is the option setting
// script or call has precedence over option setting
// so: if set by script or call: auto, else if set by option: auto
$auto = false;
$contw = wppa_get_container_width();
if (wppa('auto_colwidth')) {
$auto = true;
//.........这里部分代码省略.........