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


PHP wppa_has_audio函数代码示例

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


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

示例1: wppa_copy_photo

function wppa_copy_photo($photoid, $albumto)
{
    global $wpdb;
    $err = '1';
    // Check args
    if (!is_numeric($photoid) || !is_numeric($albumto)) {
        return $err;
    }
    $err = '2';
    // Find photo details
    $photo = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE id = %s', $photoid), 'ARRAY_A');
    if (!$photo) {
        return $err;
    }
    $albumfrom = $photo['album'];
    $album = $albumto;
    $ext = $photo['ext'];
    $name = $photo['name'];
    $porder = '0';
    $desc = $photo['description'];
    $linkurl = $photo['linkurl'];
    $linktitle = $photo['linktitle'];
    $linktarget = $photo['linktarget'];
    $status = $photo['status'];
    $filename = $photo['filename'];
    $location = $photo['location'];
    $oldimage = wppa_fix_poster_ext(wppa_get_photo_path($photo['id']), $photo['id']);
    $oldthumb = wppa_fix_poster_ext(wppa_get_thumb_path($photo['id']), $photo['id']);
    $tags = $photo['tags'];
    $exifdtm = $photo['exifdtm'];
    $err = '3';
    // Make new db table entry
    $owner = wppa_switch('copy_owner') ? $photo['owner'] : wppa_get_user();
    $time = wppa_switch('copy_timestamp') ? $photo['timestamp'] : time();
    $id = wppa_create_photo_entry(array('album' => $album, 'ext' => $ext, 'name' => $name, 'p_order' => $porder, 'description' => $desc, 'linkurl' => $linkurl, 'linktitle' => $linktitle, 'linktarget' => $linktarget, 'timestamp' => $time, 'owner' => $owner, 'status' => $status, 'filename' => $filename, 'location' => $location, 'tags' => $tags, 'exifdtm' => $exifdtm, 'videox' => $photo['videox'], 'videoy' => $photo['videoy']));
    if (!$id) {
        return $err;
    }
    wppa_flush_treecounts($album);
    wppa_index_add('photo', $id);
    $err = '4';
    // Find copied photo details
    if (!$id) {
        return $err;
    }
    $image_id = $id;
    $newimage = wppa_strip_ext(wppa_get_photo_path($image_id)) . '.' . wppa_get_ext($oldimage);
    $newthumb = wppa_strip_ext(wppa_get_thumb_path($image_id)) . '.' . wppa_get_ext($oldthumb);
    $err = '5';
    // Do the filesystem copy
    if (wppa_is_video($photo['id'])) {
        if (!wppa_copy_video_files($photo['id'], $image_id)) {
            return $err;
        }
    } elseif (wppa_has_audio($photo['id'])) {
        if (!wppa_copy_audio_files($photo['id'], $image_id)) {
            return $err;
        }
    }
    $err = '6';
    // Copy photo or poster
    if (!copy($oldimage, $newimage)) {
        return $err;
    }
    $err = '7';
    // Copy thumbnail
    if (!copy($oldthumb, $newthumb)) {
        return $err;
    }
    $err = '8';
    // Copy source
    wppa_copy_source($filename, $albumfrom, $albumto);
    $err = '9';
    // Copy Exif and iptc
    wppa_copy_exif($photoid, $id);
    wppa_copy_iptc($photoid, $id);
    // Bubble album timestamp
    if (!wppa_switch('copy_timestamp')) {
        wppa_update_album(array('id' => $albumto, 'modified' => time()));
    }
    return false;
    // No error
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:83,代码来源:wppa-admin-functions.php

示例2: wppa_get_the_widget_thumb

function wppa_get_the_widget_thumb($type, $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents)
{
    // Init
    $result = '';
    // Get the id
    $id = $image ? $image['id'] : '0';
    // Fix url if audio
    if (wppa_has_audio($id)) {
        $imgurl = wppa_fix_poster_ext($imgurl, $id);
    }
    // Is it a video?
    $is_video = $id ? wppa_is_video($id) : false;
    // Get the video and audio bodies
    $videobody = $id ? wppa_get_video_body($id) : '';
    $audiobody = $id ? wppa_get_audio_body($id) : '';
    // Open container if an image must be displayed
    if ($display == 'thumbs') {
        $size = max($imgstyle_a['width'], $imgstyle_a['height']);
        $result .= '<div style="width:' . $size . 'px; height:' . $size . 'px; overflow:hidden;" >';
    }
    // The medals if on top
    if ($display == 'thumbs') {
        $result .= $id ? wppa_get_medal_html_a(array('id' => $id, 'size' => 'S', 'where' => 'top')) : '';
    }
    // Get the name
    $name = $id ? wppa_get_photo_name($id) : '';
    if ($link) {
        if ($link['is_url']) {
            // Is a href
            $result .= "\n\t" . '<a href="' . $link['url'] . '" title="' . $title . '" target="' . $link['target'] . '" >';
            $result .= "\n\t\t";
            if ($display == 'thumbs') {
                if ($is_video) {
                    $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgstyle_a['width'], 'height' => $imgstyle_a['height'], 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $imgevents, 'title' => $title));
                } else {
                    $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ($title ? ' title="' . $title . '"' : '') . ' src="' . $imgurl . '"' . ' width="' . $imgstyle_a['width'] . '"' . ' height="' . $imgstyle_a['height'] . '"' . ' style="' . $imgstyle_a['style'] . ' cursor:pointer;"' . ' ' . $imgevents . ' ' . wppa_get_imgalt($id) . ' />';
                }
            } else {
                $result .= $name;
            }
            $result .= "\n\t" . '</a>';
        } elseif ($link['is_lightbox']) {
            $title = wppa_get_lbtitle('thumb', $id);
            $videohtml = esc_attr($videobody);
            $audiohtml = esc_attr($audiobody);
            $result .= '<a href="' . $link['url'] . '"' . ($videohtml ? ' data-videohtml="' . $videohtml . '"' . ' data-videonatwidth="' . wppa_get_videox($id) . '"' . ' data-videonatheight="' . wppa_get_videoy($id) . '"' : '') . ($audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '[' . $type . '-' . $album . '-' . wppa('mocc') . ']"' . ($title ? ' ' . wppa('lbtitle') . '="' . $title . '"' : '') . ' target="' . $link['target'] . '" >';
            $result .= "\n\t\t";
            if ($display == 'thumbs') {
                $title = wppa_zoom_in($id);
                if ($is_video) {
                    $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgstyle_a['width'], 'height' => $imgstyle_a['height'], 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => $imgstyle_a['cursor'], 'events' => $imgevents, 'title' => $title));
                } else {
                    $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ($title ? ' title="' . $title . '"' : '') . ' src="' . $imgurl . '"' . ' width="' . $imgstyle_a['width'] . '"' . ' height="' . $imgstyle_a['height'] . '"' . ' style="' . $imgstyle_a['style'] . $imgstyle_a['cursor'] . '"' . ' ' . $imgevents . ' ' . wppa_get_imgalt($id) . ' />';
                }
            } else {
                $result .= $name;
            }
            $result .= "\n\t" . '</a>';
        } else {
            // Is an onclick unit
            $result .= "\n\t";
            if ($display == 'thumbs') {
                if ($is_video) {
                    $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgstyle_a['width'], 'height' => $imgstyle_a['height'], 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $imgevents, 'title' => $title, 'onclick' => $link['url']));
                } else {
                    $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ($title ? ' title="' . $title . '"' : '') . ' src="' . $imgurl . '"' . ' width="' . $imgstyle_a['width'] . '"' . ' height="' . $imgstyle_a['height'] . '"' . ' style="' . $imgstyle_a['style'] . ' cursor:pointer;"' . ' ' . $imgevents . ' onclick="' . $link['url'] . '"' . ' ' . wppa_get_imgalt($id) . ' />';
                }
            } else {
                $result .= '<a' . ' style="cursor:pointer;"' . ' onclick="' . $link['url'] . '"' . ' >' . $name . '</a>';
            }
        }
    } else {
        // No link
        $result .= "\n\t";
        if ($display == 'thumbs') {
            if ($is_video) {
                $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgstyle_a['width'], 'height' => $imgstyle_a['height'], 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $imgevents, 'title' => $title));
            } else {
                $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ($title ? ' title="' . $title . '"' : '') . ' src="' . $imgurl . '"' . ' width="' . $imgstyle_a['width'] . '"' . ' height="' . $imgstyle_a['height'] . '"' . ' style="' . $imgstyle_a['style'] . '"' . ' ' . $imgevents . ' ' . wppa_get_imgalt($id) . ' />';
            }
        } else {
            $result .= $name;
        }
    }
    // The medals if at the bottom
    if ($display == 'thumbs') {
        $result .= $id ? wppa_get_medal_html_a(array('id' => $id, 'size' => 'S', 'where' => 'bot')) : '';
    }
    // Close container
    if ($display == 'thumbs') {
        $result .= '</div>';
    }
    return $result;
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:94,代码来源:wppa-thumbnails.php

示例3: 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>');
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:90,代码来源:wppa-functions.php

示例4: wppa_fix_poster_ext

function wppa_fix_poster_ext($fileorurl, $id)
{
    $poster_ext = wppa_get_poster_ext($id);
    // If found, replace extension to ext of existing file
    if ($poster_ext) {
        return str_replace('.xxx', '.' . $poster_ext, $fileorurl);
    }
    // Not found. If audio, return audiostub file or url
    if (wppa_has_audio($id)) {
        $audiostub = wppa_opt('audiostub');
        // Url ?
        if (strpos($fileorurl, 'http://') !== false || strpos($fileorurl, 'https://') !== false) {
            return WPPA_UPLOAD_URL . '/' . $audiostub;
        } else {
            return WPPA_UPLOAD_PATH . '/' . $audiostub;
        }
    }
    // Not found. Is Video, return as jpg
    return str_replace('.xxx', '.jpg', $fileorurl);
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:20,代码来源:wppa-utils.php

示例5: wppa_get_slide_info


//.........这里部分代码省略.........
    // Get the callback url.
    if (wppa_switch('rating_on')) {
        $url = wppa_get_slide_callback_url($callbackid);
        $url = str_replace('&amp;', '&', $url);
        // js use
    } else {
        $url = '';
    }
    // Find link url, link title and link target
    if (wppa_in_widget() == 'ss') {
        $link = wppa_get_imglnk_a('sswidget', $id);
    } else {
        $link = wppa_get_imglnk_a('slideshow', $id);
    }
    $linkurl = $link['url'];
    $linktitle = $link['title'];
    $linktarget = $link['target'];
    // Find full image style and size
    if (wppa('is_filmonly')) {
        $style_a['style'] = '';
        $style_a['width'] = '';
        $style_a['height'] = '';
    } else {
        $style_a = wppa_get_fullimgstyle_a($id);
    }
    // Find image url
    if (wppa_switch('fotomoto_on') && !wppa_is_stereo($id)) {
        $photourl = wppa_get_hires_url($id);
    } elseif (wppa_use_thumb_file($id, $style_a['width'], $style_a['height']) && !wppa_is_stereo($id)) {
        $photourl = wppa_get_thumb_url($id, '', $style_a['width'], $style_a['height']);
    } else {
        $photourl = wppa_get_photo_url($id, '', $style_a['width'], $style_a['height']);
    }
    if (wppa_has_audio($id)) {
        $photourl = wppa_fix_poster_ext($photourl, $id);
    }
    // Find iptc data
    $iptc = wppa_switch('show_iptc') && !wppa('is_slideonly') && !wppa('is_filmonly') ? wppa_iptc_html($id) : '';
    // Find EXIF data
    $exif = wppa_switch('show_exif') && !wppa('is_slideonly') && !wppa('is_filmonly') ? wppa_exif_html($id) : '';
    // Lightbox subtitle
    $doit = false;
    if (wppa_opt('slideshow_linktype') == 'lightbox' || wppa_opt('slideshow_linktype') == 'lightboxsingle') {
        $doit = true;
    }
    // For fullsize
    if (wppa_switch('filmstrip') && wppa_opt('film_linktype') == 'lightbox') {
        // For filmstrip?
        if (!wppa('is_slideonly')) {
            $doit = true;
        }
        // Film below fullsize
        if (wppa('film_on')) {
            $doit = true;
        }
        // Film explicitly on ( slideonlyf )
    }
    if ($doit) {
        $lbtitle = wppa_get_lbtitle('slide', $id);
    } else {
        $lbtitle = '';
    }
    // Name
    $name = '';
    $fullname = '';
    if ((!wppa('is_slideonly') || wppa('name_on')) && !wppa('is_filmonly')) {
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:67,代码来源:wppa-functions.php

示例6: wppa_copy_audio_files

function wppa_copy_audio_files($fromid, $toid)
{
    global $wppa_supported_audio_extensions;
    // Is it an audio?
    if (!wppa_has_audio($fromid)) {
        return false;
    }
    // Get paths
    $from_path = wppa_get_photo_path($fromid);
    $raw_from_path = wppa_strip_ext($from_path);
    $to_path = wppa_get_photo_path($toid);
    $raw_to_path = wppa_strip_ext($to_path);
    // Copy the media files
    foreach ($wppa_supported_audio_extensions as $ext) {
        $file = $raw_from_path . '.' . $ext;
        if (is_file($file)) {
            if (!copy($file, $raw_to_path . '.' . $ext)) {
                return false;
            }
        }
    }
    /*
    	// Copy the poster file
    	$poster = wppa_fix_poster_ext( $from_path, $fromid );
    	if ( is_file( $poster ) ) {
    		if ( ! copy( $poster,  $raw_to_path . '.' . wppa_get_ext( $from_path ) ) ) return false;
    	}
    
    	// Copy the poster thumb
    	$poster_thumb 		= wppa_fix_poster_ext( wppa_get_thumb_path( $fromid ) );
    	$poster_thumb_to 	= wppa_strip_ext( wppa_get_thumb_path( $toid ) ) . '.' . wppa_get_ext( $poster_thumb );
    	if ( is_file( $poster_thumb ) ) {
    		if ( ! copy( $poster_thumb, $poster_thumb_to ) ) return false;
    	}
    */
    // Done!
    return true;
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:38,代码来源:wppa-audio.php

示例7: _wppa_sidebar_page_options


//.........这里部分代码省略.........
    ?>
</option>
								<option value="owner" <?php 
    if ($subtit == 'owner') {
        echo $sel;
    }
    ?>
><?php 
    _e('Owner', 'wp-photo-album-plus');
    ?>
</option>
							</select>
							<span class="description"><br/><?php 
    _e('Select the content of the subtitle.', 'wp-photo-album-plus');
    ?>
</span>	
						</td>
					</tr>
				</tbody>
			</table>
			<p>
				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php 
    _e('Save Changes', 'wp-photo-album-plus');
    ?>
" />
			</p>
			<?php 
    $alb = wppa_opt('widget_album');
    $opt = wppa_is_int($alb) ? ' ' . wppa_get_photo_order($alb) . ' ' : '';
    $photos = wppa_get_widgetphotos($alb, $opt);
    if (empty($photos)) {
        echo '<p>' . __('No photos yet in this album.', 'wp-photo-album-plus') . '</p>';
    } else {
        $curid = wppa_opt('widget_photo');
        // Process photos
        foreach ($photos as $photo) {
            $id = $photo['id'];
            // Open container div
            echo '<div' . ' class="photoselect"' . ' style="' . 'width:180px;' . 'height:300px;' . '" >';
            // Open image container div
            echo '<div' . ' style="' . 'width:180px;' . 'height:135px;' . 'overflow:hidden;' . 'text-align:center;' . '" >';
            // The image if a video
            if (wppa_is_video($id)) {
                echo wppa_get_video_html(array('id' => $id, 'style' => 'width:180px;'));
            } else {
                echo '<img' . ' src=" ' . wppa_fix_poster_ext(wppa_get_thumb_url($id), $id) . '"' . ' style="' . 'max-width:180px;' . 'max-height:135px;' . 'margin:auto;' . '"' . ' alt="' . esc_attr(wppa_get_photo_name($photo['id'])) . '" />';
                // Audio ?
                if (wppa_has_audio($id)) {
                    echo wppa_get_audio_html(array('id' => $id, 'style' => 'width:180px;' . 'position:relative;' . 'bottom:' . (wppa_get_audio_control_height() + 4) . 'px;'));
                }
            }
            // Close image container div
            echo '</div>';
            ?>
						<div style="clear:both;width:100%;margin:3px 0;" >
							<div style="font-size:9px; line-height:10px;float:left;"><?php 
            echo '(#' . $photo['p_order'] . ')';
            ?>
</div>
							<input style="float:right;" type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php 
            echo $id;
            ?>
" value="<?php 
            echo $id;
            ?>
" <?php 
            if ($id == $curid) {
                echo 'checked="checked"';
            }
            ?>
/>
						</div>
						<div style="clear:both;overflow:auto;height:150px" >
							<div style="font-size:11px; overflow:hidden;"><?php 
            echo wppa_get_photo_name($photo['id']);
            ?>
</div>
							<div style="font-size:9px; line-height:10px;"><?php 
            echo wppa_get_photo_desc($photo['id']);
            ?>
</div>
						</div>
					</div>
					<?php 
        }
        echo '<div class="clear"></div>';
    }
    ?>
			<script type="text/javascript">wppaCheckWidgetMethod();</script>
			<br />
			<p>
				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php 
    _e('Save Changes', 'wp-photo-album-plus');
    ?>
" />
			</p>
		</form>
	</div>
<?php 
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:101,代码来源:wppa-widget-admin.php

示例8: 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':
//.........这里部分代码省略.........
开发者ID:billadams,项目名称:forever-frame,代码行数:101,代码来源:wppa-potd-widget.php

示例9: wppa_the_coverphotos

function wppa_the_coverphotos($albumid, $images, $srcs, $photo_pos, $photolinks, $title, $imgattrs_a, $events)
{
    global $wpdb;
    if (!$images) {
        return;
    }
    // Find the photo frame style
    $photoframestyle = 'style="text-align:center; "';
    // Open the coverphoto frame
    wppa_out('<div id="coverphoto_frame_' . $albumid . '_' . wppa('mocc') . '" class="coverphoto-frame" ' . $photoframestyle . '>');
    // Process the images
    $n = count($images);
    for ($idx = '0'; $idx < $n; $idx++) {
        $image = $images[$idx];
        $src = $srcs[$idx];
        if (wppa_has_audio($image['id'])) {
            $src = wppa_fix_poster_ext($src, $image['id']);
        }
        $imgattr = $imgattrs_a[$idx]['style'];
        $imgwidth = $imgattrs_a[$idx]['width'];
        $imgheight = $imgattrs_a[$idx]['height'];
        $frmwidth = $imgwidth + '10';
        // + 2 * 1 border + 2 * 4 padding
        $imgattr_a = $imgattrs_a[$idx];
        $photolink = $photolinks[$idx];
        if ($photolink) {
            if ($photolink['is_lightbox']) {
                $thumb = $image;
                $title = wppa_get_lbtitle('cover', $thumb['id']);
                if (wppa_is_video($thumb['id'])) {
                    $siz['0'] = wppa_get_videox($thumb['id']);
                    $siz['1'] = wppa_get_videoy($thumb['id']);
                } else {
                    $siz['0'] = wppa_get_photox($thumb['id']);
                    $siz['1'] = wppa_get_photoy($thumb['id']);
                }
                $link = wppa_get_photo_url($thumb['id'], '', $siz['0'], $siz['1']);
                if (wppa_has_audio($thumb['id'])) {
                    $link = wppa_fix_poster_ext($link, $thumb['id']);
                }
                $is_video = wppa_is_video($thumb['id']);
                $has_audio = wppa_has_audio($thumb['id']);
                wppa_out('<a' . ' href="' . $link . '"' . ($is_video ? ' data-videohtml="' . esc_attr(wppa_get_video_body($thumb['id'])) . '"' . ' data-videonatwidth="' . wppa_get_videox($thumb['id']) . '"' . ' data-videonatheight="' . wppa_get_videoy($thumb['id']) . '"' : '') . ($has_audio ? ' data-audiohtml="' . esc_attr(wppa_get_audio_body($thumb['id'])) . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '[alw-' . wppa('mocc') . '-' . $albumid . ']"' . ($title ? ' ' . wppa('lbtitle') . '="' . $title . '"' : '') . ' >');
                // the cover image
                if ($thumb['id'] == $image['id']) {
                    if (wppa_is_video($image['id'])) {
                        wppa_out("\n\t\t" . '<video preload="metadata" class="image wppa-img" id="i-' . $image['id'] . '-' . wppa('mocc') . '" title="' . wppa_zoom_in($image['id']) . '" width="' . $imgwidth . '" height="' . $imgheight . '" style="' . __wcs('wppa-img') . $imgattr . $imgattr_a['cursor'] . '" ' . $events . '>' . wppa_get_video_body($image['id']) . '</video>');
                    } else {
                        wppa_out("\n\t\t" . '<img class="image wppa-img" id="i-' . $image['id'] . '-' . wppa('mocc') . '" title="' . wppa_zoom_in($image['id']) . '" src="' . $src . '" width="' . $imgwidth . '" height="' . $imgheight . '" style="' . __wcs('wppa-img') . $imgattr . $imgattr_a['cursor'] . '" ' . $events . ' ' . wppa_get_imgalt($image['id']) . '>');
                    }
                }
                wppa_out('</a> ');
            } else {
                // Link is NOT lightbox
                $href = $photolink['url'] == '#' ? '' : 'href="' . wppa_convert_to_pretty($photolink['url']) . '" ';
                wppa_out('<a ' . $href . 'target="' . $photolink['target'] . '" title="' . $photolink['title'] . '" onclick="' . $photolink['onclick'] . '" >');
                if (wppa_is_video($image['id'])) {
                    wppa_out('<video preload="metadata" ' . ' class="image wppa-img" width="' . $imgwidth . '" height="' . $imgheight . '" style="' . __wcs('wppa-img') . $imgattr . '" ' . $events . ' >' . wppa_get_video_body($image['id']) . '</video>');
                } else {
                    wppa_out('<img src="' . $src . '" ' . wppa_get_imgalt($image['id']) . ' class="image wppa-img" width="' . $imgwidth . '" height="' . $imgheight . '" style="' . __wcs('wppa-img') . $imgattr . '" ' . $events . ' />');
                }
                wppa_out('</a> ');
            }
        } else {
            wppa_out('<img src="' . $src . '" ' . wppa_get_imgalt($image['id']) . ' class="image wppa-img" width="' . $imgwidth . '" height="' . $imgheight . '" style="' . __wcs('wppa-img') . $imgattr . '" ' . $events . ' />');
        }
    }
    // Close the coverphoto frame
    wppa_out('</div>');
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:70,代码来源:wppa-album-covers.php

示例10: _wppa_sidebar_page_options


//.........这里部分代码省略.........
    if ($subtit == 'owner') {
        echo $sel;
    }
    ?>
><?php 
    _e('Owner', 'wppa');
    ?>
</option>
							</select>
							<span class="description"><br/><?php 
    _e('Select the content of the subtitle.', 'wppa');
    ?>
</span>	
						</td>
					</tr>
				</tbody>
			</table>
			<p>
				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php 
    _e('Save Changes', 'wppa');
    ?>
" />
			</p>
			<?php 
    $alb = wppa_opt('widget_album');
    $photos = wppa_get_widgetphotos($alb);
    if (empty($photos)) {
        echo '<p>' . __('No photos yet in this album.', 'wppa') . '</p>';
    } else {
        $curid = wppa_opt('widget_photo');
        $wi = wppa_get_minisize() + 24;
        $hi = $wi + 48;
        // Process photos
        foreach ($photos as $photo) {
            $id = $photo['id'];
            // Open container div
            echo '<div' . ' class="photoselect"' . ' style="' . 'width:' . wppa_opt('widget_width') . 'px;' . 'height:' . $hi . 'px;' . 'overflow:hidden;' . '" >';
            // The image if a video
            if (wppa_is_video($id)) {
                echo wppa_get_video_html(array('id' => $id, 'style' => 'width:' . wppa_opt('widget_width') . 'px;'));
            } else {
                echo '<img' . ' src=" ' . wppa_fix_poster_ext(wppa_get_thumb_url($id), $id) . '"' . ' style="' . 'width:' . wppa_opt('widget_width') . 'px;' . '"' . ' alt="' . $photo['name'] . '" />';
                // Audio ?
                if (wppa_has_audio($id)) {
                    echo wppa_get_audio_html(array('id' => $id, 'style' => 'width:' . wppa_opt('widget_width') . 'px;' . 'position:relative;' . 'bottom:' . (wppa_get_audio_control_height() + 4) . 'px;'));
                }
            }
            ?>
						<input type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php 
            echo $id;
            ?>
" value="<?php 
            echo $id;
            ?>
" <?php 
            if ($id == $curid) {
                echo 'checked="checked"';
            }
            ?>
/>
						<div class="clear"></div>
						<h4 style="position: absolute; top:<?php 
            echo $wi - 12;
            ?>
px; font-size:11px; overflow:hidden;"><?php 
            echo wppa_qtrans(stripslashes($photo['name']));
            ?>
</h4>
						<h6 style="position: absolute; top:<?php 
            echo $wi + 6;
            ?>
px; font-size:9px; line-height:10px;"><?php 
            echo wppa_qtrans(stripslashes($photo['description']));
            ?>
</h6>
						<h5 style="position: absolute; top:<?php 
            echo $wi + 24;
            ?>
px; font-size:9px; line-height:10px;"><?php 
            echo '(#' . $photo['p_order'] . ')';
            ?>
</h5>
						</div><?php 
        }
        echo '<div class="clear"></div>';
    }
    ?>
			<script type="text/javascript">wppaCheckWidgetMethod();</script>
			<script type="text/javascript">wppaCheckWidgetSubtitle();</script>
			<br />
			<p>
				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php 
    _e('Save Changes', 'wppa');
    ?>
" />
			</p>
		</form>
	</div>
<?php 
}
开发者ID:billadams,项目名称:forever-frame,代码行数:101,代码来源:wppa-widget-admin.php

示例11: 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':
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:wppa-picture.php

示例12: 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
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:wppa-potd-widget.php

示例13: wppa_album_photos_sequence


//.........这里部分代码省略.........
                    $imgstyle = 'max-width:' . $mw . 'px; max-height:' . $mh . 'px; margin-top:' . $mt . 'px;';
                    ?>
					<?php 
                    echo wppa_get_video_html(array('id' => $id, 'controls' => false, 'tagid' => 'pa-id-' . $id, 'preload' => 'metadata', 'class' => 'wppa-bulk-thumb', 'style' => $imgstyle, 'use_thumb' => true));
                    ?>
	<!--					<video preload="metadata" class="wppa-bulk-thumb" style="max-width:<?php 
                    echo $mw;
                    ?>
px; max-height:<?php 
                    echo $mh;
                    ?>
px; margin-top: <?php 
                    echo $mt;
                    ?>
px;" >
						 // echo //wppa_get_video_body( $photo['id'] ) ?>
						</video>
	-->
					<?php 
                } else {
                    ?>
						<img class="wppa-bulk-thumb" src="<?php 
                    echo wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']);
                    ?>
" style="max-width:<?php 
                    echo $mw;
                    ?>
px; max-height:<?php 
                    echo $mh;
                    ?>
px; margin-top: <?php 
                    echo $mt;
                    ?>
px;" />
					<?php 
                }
                ?>
						<div style="font-size:9px; position:absolute; bottom:24px; text-align:center; width:<?php 
                echo $size;
                ?>
px;" ><?php 
                echo wppa_get_photo_name($photo['id']);
                ?>
</div>
						<div style="text-align: center; width: <?php 
                echo $size;
                ?>
px; position:absolute; bottom:8px;" >
							<span style="margin-left:15px;float:left"><?php 
                echo __('Id: ', 'wp-photo-album-plus') . $photo['id'];
                ?>
</span>
							<?php 
                if (wppa_is_video($photo['id'])) {
                    _e('Video', 'wp-photo-album-plus');
                }
                ?>
							<?php 
                if (wppa_has_audio($photo['id'])) {
                    _e('Audio', 'wp-photo-album-plus');
                }
                ?>
							<span style="float:right; margin-right:15px;"><?php 
                echo __('Ord: ', 'wp-photo-album-plus') . '<span id="wppa-seqno-' . $photo['id'] . '" >' . $photo['p_order'];
                ?>
</span>
						</div>
						<input type="hidden" id="photo-nonce-<?php 
                echo $photo['id'];
                ?>
" value="<?php 
                echo wp_create_nonce('wppa_nonce_' . $photo['id']);
                ?>
" />
						<input type="hidden" class="wppa-sort-item" value="<?php 
                echo $photo['id'];
                ?>
" />
						<input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php 
                echo $photo['id'];
                ?>
" value="<?php 
                echo $photo['p_order'];
                ?>
" />
					</div>
					<?php 
            }
            ?>
				</div>
				<div style="clear:both;"></div>
			</div>
			<?php 
        } else {
            echo '<h3>' . __('The album is empty.', 'wp-photo-album-plus') . '</h3>';
        }
    } else {
        wppa_dbg_msg('Missing required argument in wppa_album_photos() 3', 'red', 'force');
    }
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:101,代码来源:wppa-photo-admin-autosave.php

示例14: wppa_get_thumby

function wppa_get_thumby($id, $force = false)
{
    if (wppa_is_video($id)) {
        $x = wppa_get_videox($id);
        $y = wppa_get_videoy($id);
        if ($x > $y) {
            // Landscape
            $result = wppa_opt('thumbsize') * $y / $x;
        } else {
            $result = wppa_opt('thumbsize');
        }
    } else {
        $result = wppa_get_thumbphotoxy($id, 'thumby', $force);
    }
    if (!$result && wppa_has_audio($id)) {
        $result = wppa_opt('thumbsize');
        // * 1080 / 1920;
        $siz = getimagesize(WPPA_UPLOAD_PATH . '/' . wppa_opt('audiostub'));
        $result *= $siz['1'] / $siz['0'];
    }
    return $result;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:22,代码来源:wppa-items.php

示例15: widget


//.........这里部分代码省略.........
                     }
                     $imgurl = wppa_get_thumb_url($image['id'], '', $width, $height);
                 } else {
                     $link = '';
                     $file = '';
                     $imgevents = '';
                     $imgstyle = 'width:' . $maxw . ';height:' . $maxh . ';';
                     $width = $maxw;
                     $height = $maxw;
                     // !!
                     $cursor = 'default';
                     $title = sprintf(__a('Upload at least %d photos to this album!', 'wppa_theme'), wppa_opt('wppa_min_thumbs') - $imgcount + 1);
                     if ($imageid) {
                         // The 'empty album has a cover image
                         $file = wppa_get_thumb_path($image['id']);
                         $imgstyle_a = wppa_get_imgstyle_a($image['id'], $file, $maxw, 'center', 'albthumb');
                         $imgstyle = $imgstyle_a['style'];
                         $width = $imgstyle_a['width'];
                         $height = $imgstyle_a['height'];
                         $imgurl = wppa_get_thumb_url($image['id'], '', $width, $height);
                     } else {
                         $imgurl = wppa_get_imgdir() . 'album32.png';
                     }
                 }
                 $imgurl = wppa_fix_poster_ext($imgurl, $image['id']);
                 if ($imgcount > wppa_opt('wppa_min_thumbs') || $skip == 'no') {
                     $widget_content .= "\n" . '<div class="wppa-widget" style="width:' . $maxw . 'px; height:' . $maxh . 'px; margin:4px; display:inline; text-align:center; float:left;">';
                     if ($link) {
                         if ($link['is_url']) {
                             // Is a href
                             $widget_content .= "\n\t" . '<a href="' . $link['url'] . '" title="' . $title . '" target="' . $link['target'] . '" >';
                             if (wppa_is_video($image['id'])) {
                                 $widget_content .= wppa_get_video_html(array('id' => $image['id'], 'width' => $width, 'height' => $height, 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'cursor' => 'pointer', 'events' => $imgevents, 'tagid' => 'i-' . $image['id'] . '-' . $wppa['mocc'], 'title' => $title));
                             } else {
                                 $widget_content .= "\n\t\t" . '<img id="i-' . $image['id'] . '-' . $wppa['mocc'] . '" title="' . $title . '" src="' . $imgurl . '" width="' . $width . '" height="' . $height . '" style="' . $imgstyle . ' cursor:pointer;" ' . $imgevents . ' ' . wppa_get_imgalt($image['id']) . ' >';
                             }
                             $widget_content .= "\n\t" . '</a>';
                         } elseif ($link['is_lightbox']) {
                             $thumbs = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . wppa_get_photo_order($album['id']), $album['id']), 'ARRAY_A');
                             if ($thumbs) {
                                 foreach ($thumbs as $thumb) {
                                     $title = wppa_get_lbtitle('alw', $thumb['id']);
                                     if (wppa_is_video($thumb['id'])) {
                                         $siz['0'] = wppa_get_videox($thumb['id']);
                                         $siz['1'] = wppa_get_videoy($thumb['id']);
                                     } else {
                                         //	$siz = getimagesize( wppa_get_photo_path( $thumb['id'] ) );
                                         $siz['0'] = wppa_get_photox($thumb['id']);
                                         $siz['1'] = wppa_get_photoy($thumb['id']);
                                     }
                                     $link = wppa_fix_poster_ext(wppa_get_photo_url($thumb['id'], '', $siz['0'], $siz['1']), $thumb['id']);
                                     $is_video = wppa_is_video($thumb['id']);
                                     $has_audio = wppa_has_audio($thumb['id']);
                                     $widget_content .= "\n\t" . '<a href="' . $link . '"' . ($is_video ? ' data-videohtml="' . esc_attr(wppa_get_video_body($thumb['id'])) . '"' . ' data-videonatwidth="' . wppa_get_videox($thumb['id']) . '"' . ' data-videonatheight="' . wppa_get_videoy($thumb['id']) . '"' : '') . ($has_audio ? ' data-audiohtml="' . esc_attr(wppa_get_audio_body($thumb['id'])) . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('wppa_lightbox_name') . '[alw-' . $wppa['mocc'] . '-' . $album['id'] . ']"' . ' ' . wppa('lbtitle') . '="' . $title . '" >';
                                     if ($thumb['id'] == $image['id']) {
                                         // the cover image
                                         if (wppa_is_video($image['id'])) {
                                             $widget_content .= wppa_get_video_html(array('id' => $image['id'], 'width' => $width, 'height' => $height, 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'cursor' => $cursor, 'events' => $imgevents, 'tagid' => 'i-' . $image['id'] . '-' . $wppa['mocc'], 'title' => wppa_zoom_in($image['id'])));
                                         } else {
                                             $widget_content .= "\n\t\t" . '<img id="i-' . $image['id'] . '-' . $wppa['mocc'] . '" title="' . wppa_zoom_in($image['id']) . '" src="' . $imgurl . '" width="' . $width . '" height="' . $height . '" style="' . $imgstyle . $cursor . '" ' . $imgevents . ' ' . wppa_get_imgalt($image['id']) . ' >';
                                         }
                                     }
                                     $widget_content .= "\n\t" . '</a>';
                                 }
                             }
                         } else {
                             // Is an onclick unit
                             if (wppa_is_video($image['id'])) {
                                 $widget_content .= wppa_get_video_html(array('id' => $image['id'], 'width' => $width, 'height' => $height, 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'cursor' => 'pointer', 'events' => $imgevents . ' onclick="' . $link['url'] . '"', 'tagid' => 'i-' . $image['id'] . '-' . $wppa['mocc'], 'title' => $title));
                             } else {
                                 $widget_content .= "\n\t" . '<img id="i-' . $image['id'] . '-' . $wppa['mocc'] . '" title="' . $title . '" src="' . $imgurl . '" width="' . $width . '" height="' . $height . '" style="' . $imgstyle . ' cursor:pointer;" ' . $imgevents . ' onclick="' . $link['url'] . '" ' . wppa_get_imgalt($image['id']) . ' >';
                             }
                         }
                     } else {
                         if (wppa_is_video($image['id'])) {
                             $widget_content .= wppa_get_video_html(array('id' => $image['id'], 'width' => $width, 'height' => $height, 'controls' => false, 'margin_top' => $imgstyle_a['margin-top'], 'margin_bottom' => $imgstyle_a['margin-bottom'], 'cursor' => 'pointer', 'events' => $imgevents, 'tagid' => 'i-' . $image['id'] . '-' . $wppa['mocc'], 'title' => $title));
                         } else {
                             $widget_content .= "\n\t" . '<img id="i-' . $image['id'] . '-' . $wppa['mocc'] . '" title="' . $title . '" src="' . $imgurl . '" width="' . $width . '" height="' . $height . '" style="' . $imgstyle . '" ' . $imgevents . ' ' . wppa_get_imgalt($image['id']) . ' >';
                         }
                     }
                     if ($name == 'yes') {
                         $widget_content .= "\n\t" . '<span style="font-size:' . wppa_opt('wppa_fontsize_widget_thumb') . 'px; min-height:100%;">' . __(stripslashes($album['name'])) . '</span>';
                     }
                     $widget_content .= "\n" . '</div>';
                     $count++;
                 }
             }
         }
     } else {
         $widget_content .= 'There are no albums (yet).';
     }
     $widget_content .= '<div style="clear:both"></div>';
     $widget_content .= "\n" . '<!-- WPPA+ thumbnail 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,代码行数:101,代码来源:wppa-album-widget.php


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