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

PHP wppa_get_thumb_url函数代码示例

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

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



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

示例1: wppa_get_video_html

function wppa_get_video_html($args)
{
    global $wppa;
    extract(wp_parse_args((array) $args, array('id' => '0', 'width' => '0', 'height' => '0', 'controls' => true, 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'video-' . $wppa['mocc'], 'cursor' => '', 'events' => '', 'title' => '', 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => '', 'use_thumb' => false, 'autoplay' => false)));
    // No id? no go
    if (!$id) {
        return '';
    }
    // Not a video? no go
    if (!wppa_is_video($id)) {
        return '';
    }
    extract(wp_parse_args((array) wppa_is_video($id), array('mp4' => false, 'ogv' => false, 'webm' => false)));
    // Prepare attributes
    $w = $width ? ' width:' . $width . 'px;' : '';
    $h = $height ? ' height:' . $height . 'px;' : '';
    $t = $margin_top ? ' margin-top:' . $margin_top . 'px;' : '';
    $b = $margin_bottom ? ' margin-bottom:' . $margin_bottom . 'px;' : '';
    $ctrl = $controls ? ' controls' : '';
    $tit = $title ? ' title="' . $title . '"' : '';
    $onc = $onclick ? ' onclick="' . $onclick . '"' : '';
    $cls = $class ? ' class="' . $class . '"' : '';
    $style = $style ? rtrim(trim($style), ';') . ';' : '';
    $play = $autoplay ? ' autoplay' : '';
    // See if there is a poster image
    $poster_photo_path = wppa_fix_poster_ext(wppa_get_photo_path($id), $id);
    $poster_thumb_path = wppa_fix_poster_ext(wppa_get_thumb_path($id), $id);
    $poster_photo = is_file($poster_photo_path) ? ' poster="' . wppa_fix_poster_ext(wppa_get_photo_url($id), $id) . '"' : '';
    $poster_thumb = is_file($poster_thumb_path) ? ' poster="' . wppa_fix_poster_ext(wppa_get_thumb_url($id), $id) . '"' : '';
    $poster = '';
    // Init to none
    // Thumbnail?
    if ($use_thumb) {
        $poster = $poster_thumb;
    } else {
        $poster = $poster_photo;
    }
    // If the poster exists and no controls, we need no preload at all.
    if ($poster && !$controls) {
        $preload = 'none';
    }
    // Do we have html5 video tag supported filetypes on board?
    if ($mp4 || $ogv || $webm) {
        // Assume the browser supports html5
        $result = '<video id="' . $tagid . '" ' . $ctrl . $play . ' style="' . $style . $w . $h . $t . $b . $cursor . '" ' . $events . ' ' . $tit . $onc . $poster . ' preload="' . $preload . '"' . $cls . ' >';
        $result .= wppa_get_video_body($id, false, $width, $height);
        // Close the video tag
        $result .= '</video>';
    }
    // Done
    return $result;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:52,代码来源:wppa-video.php


示例2: _wppa_sidebar_page_options


//.........这里部分代码省略.........
            }
            while (get_option('wppa_potd_offset', '0') > $n_days) {
                update_option('wppa_potd_offset', get_option('wppa_potd_offset') - $n_days);
            }
            while (get_option('wppa_potd_offset', '0') < '0') {
                update_option('wppa_potd_offset', get_option('wppa_potd_offset') + $n_days);
            }
            $name = __('Day offset:', 'wp-photo-album-plus');
            $desc = __('The difference between daynumber and photo order number.', 'wp-photo-album-plus');
            $help = '';
            $slug = 'wppa_potd_offset';
            $opts = array();
            $day = '0';
            while ($day < $n_days) {
                $opts[] = $day;
                $day++;
            }
            $vals = $opts;
            $html = '<span style="float:left;" >' . sprintf(__('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date($date_key)) . '</span> ' . wppa_select($slug, $opts, $vals, $onch);
            $photo_order = wppa_local_date($date_key) - get_option('wppa_potd_offset', '0');
            while ($photo_order < '0') {
                $photo_order += $n_days;
            }
            $html .= sprintf(__('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order);
            wppa_setting($slug, '11b', $name, $desc, $html, $help);
        }
    }
    $name = __('Preview', 'wp-photo-album-plus');
    $desc = __('Current "photo of the day":', 'wp-photo-album-plus');
    $help = '';
    $slug = 'wppa_potd_photo';
    $photo = wppa_get_potd();
    if ($photo) {
        $html = '<div style="display:inline-block;width:25%;text-align:center;vertical-align:middle;">' . '<img src="' . wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']) . '" />' . '</div>' . '<div style="display:inline-block;width:75%;text-align:center;vertical-align:middle;" >' . __('Album', 'wp-photo-album-plus') . ': ' . wppa_get_album_name($photo['album']) . '<br />' . __('Uploader', 'wp-photo-album-plus') . ': ' . $photo['owner'] . '</div>';
    } else {
        $html = __('Not found.', 'wp-photo-album-plus');
    }
    wppa_setting($slug, '12', $name, $desc, $html, $help);
    $name = __('Show selection', 'wp-photo-album-plus');
    $desc = __('Show the photos in the current selection.', 'wp-photo-album-plus');
    $help = '';
    $slug = 'wppa_potd_preview';
    $html = wppa_checkbox($slug, $onch);
    wppa_setting($slug, '13', $name, $desc, $html, $help);
    // Cose table body
    echo '</tbody>';
    // Table footer
    echo '<tfoot style="font-weight: bold;" >' . '<tr>' . '<td>' . __('#', 'wp-photo-album-plus') . '</td>' . '<td>' . __('Name', 'wp-photo-album-plus') . '</td>' . '<td>' . __('Description', 'wp-photo-album-plus') . '</td>' . '<td>' . __('Setting', 'wp-photo-album-plus') . '</td>' . '<td>' . __('Help', 'wp-photo-album-plus') . '</td>' . '</tr>' . '</tfoot>' . '</table>';
    // Diagnostic
    //		echo
    //		'Diagnostic: wppa_potd_album = ' . get_option( 'wppa_potd_album' ) . ' wppa_potd_photo = ' . get_option( 'wppa_potd_photo' );
    // Status star must be here for js
    echo '<img' . ' id="img_potd_photo"' . ' src="' . wppa_get_imgdir('star.ico') . '" style="height:12px;display:none;"' . ' />';
    // The potd photo pool
    echo '<table class="widefat wppa-table wppa-setting-table" >';
    // Table header
    echo '<thead>' . '<tr>' . '<td>' . __('Photos in the current selection', 'wp-photo-album-plus') . '</td>' . '</tr>' . '</thead>';
    // Table body
    if (wppa_switch('potd_preview')) {
        echo '<tbody>' . '<tr>' . '<td>';
        // Get the photos
        $alb = wppa_opt('potd_album');
        $opt = wppa_is_int($alb) ? ' ' . wppa_get_photo_order($alb) . ' ' : '';
        $photos = wppa_get_widgetphotos($alb, $opt);
        // Count them
        $cnt = count($photos);
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:67,代码来源:wppa-potd-admin.php


示例3: widget


//.........这里部分代码省略.........
     }
     if ($ratcount) {
         $maxh += $lineheight;
     }
     if ($viewcount) {
         $maxh += $lineheight;
     }
     if ($showowner) {
         $maxh += $lineheight;
     }
     if ($showalbum) {
         $maxh += $lineheight;
     }
     if ($thumbs) {
         foreach ($thumbs as $image) {
             $thumb = $image;
             // Make the HTML for current picture
             if ($display == 'thumbs') {
                 $widget_content .= "\n" . '<div class="wppa-widget" style="width:' . $maxw . 'px; height:' . $maxh . 'px; margin:4px; display:inline; text-align:center; float:left;">';
             } else {
                 $widget_content .= "\n" . '<div class="wppa-widget" >';
             }
             if ($image) {
                 $no_album = !$album;
                 if ($no_album) {
                     $tit = __('View the top rated photos', 'wp-photo-album-plus');
                 } else {
                     $tit = esc_attr(__(stripslashes($image['description'])));
                 }
                 $compressed_albumenum = wppa_compress_enum($albenum);
                 $link = wppa_get_imglnk_a('topten', $image['id'], '', $tit, '', $no_album, $compressed_albumenum);
                 $file = wppa_get_thumb_path($image['id']);
                 $imgstyle_a = wppa_get_imgstyle_a($image['id'], $file, $maxw, 'center', 'ttthumb');
                 $imgurl = wppa_get_thumb_url($image['id'], '', $imgstyle_a['width'], $imgstyle_a['height']);
                 $imgevents = wppa_get_imgevents('thumb', $image['id'], true);
                 $title = $link ? esc_attr(stripslashes($link['title'])) : '';
                 $widget_content .= wppa_get_the_widget_thumb('topten', $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents);
                 $widget_content .= "\n\t" . '<div style="font-size:' . wppa_opt('fontsize_widget_thumb') . 'px; line-height:' . $lineheight . 'px;">';
                 // Display (owner) ?
                 if ($showowner) {
                     $widget_content .= '<div>(' . $image['owner'] . ')</div>';
                 }
                 // Display (album) ?
                 if ($showalbum) {
                     $href = wppa_convert_to_pretty(wppa_encrypt_url(wppa_get_album_url($image['album'], $albumlinkpage, 'content', '1')));
                     $widget_content .= '<div>(<a href="' . $href . '" >' . wppa_get_album_name($image['album']) . '</a>)</div>';
                 }
                 // Display the rating
                 if ($likes) {
                     $lt = wppa_get_like_title_a($image['id']);
                 }
                 switch ($instance['sortby']) {
                     case 'mean_rating':
                         if ($meanrat == 'yes') {
                             $widget_content .= '<div>' . wppa_get_rating_by_id($image['id']) . '</div>';
                         }
                         if ($ratcount == 'yes') {
                             $n = wppa_get_rating_count_by_id($image['id']);
                             $widget_content .= '<div>' . sprintf(_n('%d vote', '%d votes', $n, 'wp-photo-album-plus'), $n) . '</div>';
                         }
                         if ($viewcount == 'yes') {
                             $n = $image['views'];
                             $widget_content .= '<div>' . sprintf(_n('%d view', '%d views', $n, 'wp-photo-album-plus'), $n) . '</div>';
                         }
                         break;
                     case 'rating_count':
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:67,代码来源:wppa-topten-widget.php


示例4: _wppa_comment_admin

function _wppa_comment_admin()
{
    global $wpdb;
    $continue = true;
    // Check input
    wppa_vfy_arg('tab', true);
    wppa_vfy_arg('edit_id');
    wppa_vfy_arg('wppa-page');
    wppa_vfy_arg('commentid');
    wppa_vfy_arg('delete_id');
    if (isset($_GET['tab'])) {
        if ($_GET['tab'] == 'edit') {
            $id = $_GET['edit_id'];
            $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . WPPA_COMMENTS . " WHERE id = %s LIMIT 1", $id), ARRAY_A);
            if ($comment) {
                ?>
			<div class="wrap">
				<?php 
                $iconurl = WPPA_URL . '/img/comment.png';
                ?>
				<div id="icon-album" class="icon32" style="background: transparent url(<?php 
                echo $iconurl;
                ?>
) no-repeat">
					<br />
				</div>
				<h2><?php 
                _e('Photo Albums -> Edit Comment', 'wp-photo-album-plus');
                ?>
</h2>
				<?php 
                $action = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_manage_comments');
                if (isset($_GET['wppa-page'])) {
                    $action .= '&compage=' . strval(intval($_GET['wppa-page']));
                }
                if (isset($_GET['commentid'])) {
                    $action .= '&commentid=' . strval(intval($_GET['commentid']));
                }
                ?>
				<form action="<?php 
                echo $action;
                ?>
" method="post">

					<?php 
                wp_nonce_field('$wppa_nonce', WPPA_NONCE);
                ?>
					<input type="hidden" name="edit_comment" value="<?php 
                echo $comment['id'];
                ?>
" />
					<table class="form-table albumtable">
						<tbody>
							<tr style="vertical-align:top" >
								<th>
									<?php 
                $photo = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . WPPA_PHOTOS . " WHERE id =  %s", $comment['photo']), "ARRAY_A");
                ?>
									<?php 
                $url = wppa_fix_poster_ext(wppa_get_thumb_url($comment['photo']), $comment['photo']);
                ?>
									<img src="<?php 
                echo $url;
                ?>
" />
								</th>
								<td>
									<?php 
                echo __($photo['name']) . '<br/><br/>' . __(stripslashes($photo['description']));
                ?>
								</td>
							</tr>
							<tr>
								<th scope="row"><label ><?php 
                _e('Photo:', 'wp-photo-album-plus');
                ?>
</label></th>
								<td><?php 
                echo $comment['photo'];
                ?>
</td>
							</tr>
							<tr>
								<th scope="row"><label ><?php 
                _e('Album:', 'wp-photo-album-plus');
                ?>
</label></th>
								<td><?php 
                echo wppa_get_album_name($photo['album']);
                ?>
								</td>
							</tr>
							<tr>
								<th scope="row"><label ><?php 
                _e('User:', 'wp-photo-album-plus');
                ?>
</label></th>
								<td><input style="width:300px;" type="text" name="user" value="<?php 
                echo $comment['user'];
                ?>
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:wppa-comment-admin.php


示例5: wppa_get_tnres_url

function wppa_get_tnres_url($id)
{
    $tnres_url = wppa_fix_poster_ext(wppa_get_thumb_url($id), $id);
    $temp = explode('?', $tnres_url);
    $tnres_url = $temp['0'];
    return $tnres_url;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:7,代码来源:wppa-utils.php


示例6: wppa_do_maintenance_popup


//.........这里部分代码省略.........
			<style>td, th { border-right: 1px solid darkgray; } </style>
			<h2>List of recent ratings <small>( Max 1000 entries of total ' . $total . ' )</small></h2>
			<div style="float:left; clear:both; width:100%; overflow:auto; background-color:#f1f1f1; border:1px solid #ddd;" >';
            if ($ratings) {
                $result .= '
				<table>
					<thead>
						<tr>
							<th>Id</th>
							<th>Timestamp</th>
							<th>Date/time</th>
							<th>Status</th>
							<th>User</th>
							<th>Value</th>
							<th>Photo id</th>
							<th></th>
							<th># ratings</th>
							<th>Average</th>
						</tr>
						<tr><td colspan="10"><hr /></td></tr>
					</thead>
					<tbody>';
                foreach ($ratings as $rating) {
                    wppa_cache_thumb($rating['photo']);
                    $result .= '
						<tr>
							<td>' . $rating['id'] . '</td>
							<td>' . $rating['timestamp'] . '</td>
							<td>' . ($rating['timestamp'] ? wppa_local_date(get_option('date_format', "F j, Y,") . ' ' . get_option('time_format', "g:i a"), $rating['timestamp']) : 'pre-historic') . '</td>
							<td>' . $rating['status'] . '</td>
							<td>' . $rating['user'] . '</td>
							<td>' . $rating['value'] . '</td>
							<td>' . $rating['photo'] . '</td>
							<td style="width:250px; text-align:center;"><img src="' . wppa_get_thumb_url($rating['photo']) . '" 
								style="height: 40px;" 
								onmouseover="jQuery(this).stop().animate({height:this.naturalHeight}, 200);"
								onmouseout="jQuery(this).stop().animate({height:\'40px\'}, 200);" /></td>
							<td>' . $thumb['rating_count'] . '</td>
							<td>' . $thumb['mean_rating'] . '</td>
						</tr>';
                }
                $result .= '
					</tbody>
				</table>';
            } else {
                $result .= __('There are no ratings', 'wppa');
            }
            $result .= '
				</div><div style="clear:both;"></div>';
            break;
        case 'wppa_list_session':
            $total = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_SESSION . "` WHERE `status` = 'valid'");
            $sessions = $wpdb->get_results("SELECT * FROM `" . WPPA_SESSION . "` WHERE `status` = 'valid' ORDER BY `id` DESC LIMIT 1000", ARRAY_A);
            $result .= '
			<style>td, th { border-right: 1px solid darkgray; } </style>
			<h2>List of active sessions <small>( Max 1000 entries of total ' . $total . ' )</small></h2>
			<div style="float:left; clear:both; width:100%; overflow:auto; background-color:#f1f1f1; border:1px solid #ddd;" >';
            if ($sessions) {
                $result .= '
				<table>
					<thead>
						<tr>
							<th>Id</th>
							<th>Session id</th>
							<th>User</th>
							<th>Rs</th>
开发者ID:billadams,项目名称:forever-frame,代码行数:67,代码来源:wppa-maintenance.php


示例7: wppa_get_slide_info


//.........这里部分代码省略.........
        $wait_text = '';
    }
    // Find comments
    $comment = wppa_switch('show_comments') && !wppa('is_filmonly') && !wppa('is_slideonly') ? wppa_comment_html($id, $comment_allowed) : '';
    // 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 = '';
    }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:67,代码来源:wppa-functions.php


示例8: _wppa_sidebar_page_options


//.........这里部分代码省略.........
    if (substr(wppa_opt('widget_period'), 0, 7) == 'day-of-') {
        switch (substr(wppa_opt('widget_period'), 7)) {
            case 'week':
                $n_days = '7';
                $date_key = 'w';
                break;
            case 'month':
                $n_days = '31';
                $date_key = 'd';
                break;
            case 'year':
                $n_days = '366';
                $date_key = 'z';
                break;
        }
        while (get_option('wppa_potd_offset', '0') > $n_days) {
            update_option('wppa_potd_offset', get_option('wppa_potd_offset') - $n_days);
        }
        echo sprintf(__('Current day# = %s, offset =', 'wp-photo-album-plus'), date_i18n($date_key)) . ' ';
        echo '<select name="wppa-potd-offset" >';
        $day = '0';
        while ($day < $n_days) {
            echo '<option value="' . $day . '" ' . (get_option('wppa_potd_offset', '0') == $day ? 'selected="selected"' : '') . ' >' . $day . '</option>';
            $day++;
        }
        echo '</select>';
        $photo_order = date_i18n($date_key) - get_option('wppa_potd_offset', '0');
        while ($photo_order < '1') {
            $photo_order += $n_days;
        }
        echo '. ' . sprintf(__('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order);
        $photo = wppa_get_potd();
        if ($photo) {
            echo ' <img src="' . wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']) . '" style="width:100px;" />';
        } else {
            echo ' ' . __('Not found.', 'wp-photo-album-plus');
        }
    }
    ?>
							</div>
						</td>
					</tr>
<?php 
    $linktype = wppa_opt('widget_linktype');
    if ($linktype != 'custom') {
        ?>
						<tr>
							<th scope="row">
								<label ><?php 
        _e('Link to:', 'wp-photo-album-plus');
        ?>
</label>
							</th>
							<td>
								<?php 
        _e('Links are set on the <b>Photo Albums -> Settings</b> screen.', 'wp-photo-album-plus');
        ?>
							</td>
						</tr>
<?php 
    } else {
        ?>
						<tr class="wppa-wlu" >
							<th scope="row">
								<label ><?php 
        _e('Link to:', 'wp-photo-album-plus');
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:67,代码来源:wppa-widget-admin.php


示例9: 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 
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:wppa-album-admin-autosave.php


示例10: wppa_fe_edit_new_style

function wppa_fe_edit_new_style($photo)
{
    $items = array('name', 'description', 'tags', 'custom_0', 'custom_1', 'custom_2', 'custom_3', 'custom_4', 'custom_5', 'custom_6', 'custom_7', 'custom_8', 'custom_9');
    $titles = array(__('Name', 'wp-photo-album-plus'), __('Description', 'wp-photo-album-plus'), __('Tags', 'wp-photo-album-plus'), apply_filters('translate_text', wppa_opt('custom_caption_0')), apply_filters('translate_text', wppa_opt('custom_caption_1')), apply_filters('translate_text', wppa_opt('custom_caption_2')), apply_filters('translate_text', wppa_opt('custom_caption_3')), apply_filters('translate_text', wppa_opt('custom_caption_4')), apply_filters('translate_text', wppa_opt('custom_caption_5')), apply_filters('translate_text', wppa_opt('custom_caption_6')), apply_filters('translate_text', wppa_opt('custom_caption_7')), apply_filters('translate_text', wppa_opt('custom_caption_8')), apply_filters('translate_text', wppa_opt('custom_caption_9')));
    $types = array('text', 'textarea', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text');
    $doit = array(wppa_switch('fe_edit_name'), wppa_switch('fe_edit_desc'), wppa_switch('fe_edit_tags'), wppa_switch('custom_edit_0'), wppa_switch('custom_edit_1'), wppa_switch('custom_edit_2'), wppa_switch('custom_edit_3'), wppa_switch('custom_edit_4'), wppa_switch('custom_edit_5'), wppa_switch('custom_edit_6'), wppa_switch('custom_edit_7'), wppa_switch('custom_edit_8'), wppa_switch('custom_edit_9'));
    // Open page
    echo '<div' . ' style="width:100%;margin-top:8px;padding:8px;display:block;box-sizing:border-box;background-color:#fff;"' . ' >' . '<h3>' . '<img' . ' style="height:50px;"' . ' src="' . wppa_get_thumb_url($photo) . '"' . ' alt="' . $photo . '"' . ' />' . '&nbsp;&nbsp;' . wppa_opt('fe_edit_caption') . '</h3>';
    // Open form
    echo '<form' . ' >' . '<input' . ' type="hidden"' . ' id="wppa-nonce-' . $photo . '"' . ' name="wppa-nonce"' . ' value="' . wp_create_nonce('wppa-nonce-' . $photo) . '"' . ' />';
    // Get custom data
    $custom = wppa_get_photo_item($photo, 'custom');
    if ($custom) {
        $custom_data = unserialize($custom);
    } else {
        $custom_data = array('', '', '', '', '', '', '', '', '', '');
    }
    // Items
    foreach (array_keys($items) as $idx) {
        if ($titles[$idx] && $doit[$idx]) {
            echo '<h6>' . $titles[$idx] . '</h6>';
            if (wppa_is_int(substr($items[$idx], -1))) {
                $value = stripslashes($custom_data[substr($items[$idx], -1)]);
            } else {
                $value = wppa_get_photo_item($photo, $items[$idx]);
                if ($items[$idx] == 'tags') {
                    $value = trim($value, ',');
                }
            }
            if ($types[$idx] == 'text') {
                echo '<input' . ' type="text"' . ' style="width:100%;"' . ' id="' . $items[$idx] . '"' . ' name="' . $items[$idx] . '"' . ' value="' . esc_attr($value) . '"' . ' />';
            }
            if ($types[$idx] == 'textarea') {
                echo '<textarea' . ' style="width:100%;min-width:100%;max-width:100%;"' . ' id="' . $items[$idx] . '"' . ' name="' . $items[$idx] . '"' . ' >' . esc_textarea(stripslashes($value)) . '</textarea>';
            }
        }
    }
    // Submit
    echo '<input' . ' type="button"' . ' style="margin-top:8px;margin-right:8px;"' . ' value="' . esc_attr(__('Send', 'wp-photo-album-plus')) . '"' . ' onclick="wppaUpdatePhotoNew(' . $photo . ');document.location.reload(true);"' . ' />';
    // Cancel
    echo '<input' . ' type="button"' . ' style="margin-top:8px;"' . ' value="' . esc_attr(__('Cancel', 'wp-photo-album-plus')) . '"' . ' onclick="jQuery( \'.ui-button\' ).trigger(\'click\')"' . ' />';
    // Close form
    echo '</form>';
    // Close page
    echo '</div>';
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:46,代码来源:wppa-photo-admin-autosave.php


示例11: wppa_album_sequence


//.........这里部分代码省略.........
    }
    echo '<h2>' . __('Manage album order', 'wp-photo-album-plus') . ' - ' . '<small><i>' . __('Change sequence order by drag and drop', 'wp-photo-album-plus') . '</i></small>' . '</h2>';
    ?>
		<style>
			.sortable-placeholder-albums {
				width: 100%;
				height: 60px;
				margin: 5px;
				border: 1px dotted #cccccc;
				border-radius:3px;
				float: left;
			}
			.ui-state-default-albums {
				position: relative;
				width: 100%;
				height: 60px;
				margin: 5px;
				border: 1px solid #cccccc;
				border-radius:3px;
				float: left;
			}
		</style>
		<script>
			jQuery( function() {
				jQuery( "#sortable-albums" ).sortable( {
					cursor: "move",
					placeholder: "sortable-placeholder-albums",
					stop: function( event, ui ) {
						var ids = jQuery( ".wppa-sort-item-albums" );
						var seq = jQuery( ".wppa-sort-seqn-albums" );
						var idx = 0;
						var descend = <?php 
    if ($is_descending) {
        echo 'true';
    } else {
        echo 'false';
    }
    ?>
;
						while ( idx < ids.length ) {
							var newvalue;
							if ( descend ) newvalue = ids.length - idx;
							else newvalue = idx + 1;
							var oldvalue = seq[idx].value;
							var album = ids[idx].value;
							if ( newvalue != oldvalue ) {
								wppaDoSeqUpdateAlbum( album, newvalue );
							}
							idx++;
						}
					}
				} );
			} );
			function wppaDoSeqUpdateAlbum( album, seqno ) {
				var data = 	'action=wppa' +
							'&wppa-action=update-album' +
							'&album-id=' + album +
							'&item=a_order' +
							'&wppa-nonce=' + document.getElementById( 'album-nonce-' + album ).value +
							'&value=' + seqno;
				var xmlhttp = new XMLHttpRequest();

				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
								jQuery( '#wppa-album-seqno-' + album ).html( seqno );
								break;
							default:	// Any error
								jQuery( '#wppa-album-seqno-' + album ).html( '<span style="color"red" >Err:' + ArrValues[1] + '</span>' );
								break;
						}
					}
				}
				xmlhttp.open( 'POST',wppaAjaxUrl,true );
				xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
				xmlhttp.send( data );
				jQuery( "#wppa-sort-seqn-albums-" + album ).attr( 'value', seqno );	// set hidden value to new value to prevent duplicate action
				var spinnerhtml = '<img src="' + wppaImageDirectory + 'wpspin.gif' + '" />';
				jQuery( '#wppa-album-seqno-' + album ).html( spinnerhtml );
			}
		</script>

		<div class="widefat" style="max-width:500px;" >
			<div id="sortable-albums">
				<?php 
    foreach ($albums as $album) {
        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;" >' . '<img' . ' class="wppa-cover-image"' . ' src="' . wppa_fix_poster_ext(wppa_get_thumb_url(wppa_get_coverphoto_id($album['id'])), wppa_get_coverphoto_id($album['id'])) . '"' . ' style="max-height:50px; margin: 5px;"' . ' />' . '</div>' . '<div style="height:100%;width:50%;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: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 
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:101,代码来源:wppa-album-admin-autosave.php


示例12: 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


示例13: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     global $wpdb;
     global $wppa_opt;
     global $wppa;
     require_once dirname(__FILE__) . '/wppa-links.php';
     require_once dirname(__FILE__) . '/wppa-styles.php';
     require_once dirname(__FILE__) . '/wppa-functions.php';
     require_once dirname(__FILE__) . '/wppa-thumbnails.php';
     require_once dirname(__FILE__) . '/wppa-boxes-html.php';
     require_once dirname(__FILE__) . '/wppa-slideshow.php';
     wppa_initialize_runtime();
     $wppa['in_widget'] = 'lasten';
     $wppa['mocc']++;
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'album' => '', 'albumenum' => '', 'timesince' => 'yes', 'display' => 'thumbs'));
     $widget_title = apply_filters('widget_title', $instance['title']);
     $page = in_array($wppa_opt['wppa_lasten_widget_linktype'], $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_lasten_widget_linkpage', __a('Last Ten Uploaded Photos'));
     //		$page 		= $wppa_opt['wppa_lasten_widget_linkpage'];
     $max = $wppa_opt['wppa_lasten_count'];
     $album = $instance['album'];
     $timesince = $instance['timesince'];
     $display = $instance['dis 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wppa_get_user函数代码示例发布时间:2022-05-23
下一篇:
PHP wppa_get_thumb_path函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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