本文整理汇总了PHP中wppa_opt函数的典型用法代码示例。如果您正苦于以下问题:PHP wppa_opt函数的具体用法?PHP wppa_opt怎么用?PHP wppa_opt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wppa_opt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $widget_content;
require_once dirname(__FILE__) . '/wppa-links.php';
require_once dirname(__FILE__) . '/wppa-styles.php';
require_once dirname(__FILE__) . '/wppa-functions.php';
require_once dirname(__FILE__) . '/wppa-thumbnails.php';
require_once dirname(__FILE__) . '/wppa-boxes-html.php';
require_once dirname(__FILE__) . '/wppa-slideshow.php';
wppa_initialize_runtime();
wppa('in_widget', 'tagcloud');
wppa_bump_mocc();
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => __('Photo Tags', 'wp-photo-album-plus'), 'tags' => array()));
if (empty($instance['tags'])) {
$instance['tags'] = array();
}
$widget_title = apply_filters('widget_title', $instance['title']);
// Display the widget
echo $before_widget;
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
echo '<div class="wppa-tagcloud-widget" >' . wppa_get_tagcloud_html(implode(',', $instance['tags']), wppa_opt('tagcloud_min'), wppa_opt('tagcloud_max')) . '</div>';
echo '<div style="clear:both"></div>';
echo $after_widget;
wppa('in_widget', false);
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:29,代码来源:wppa-tagcloud-widget.php
示例2: wppa_add_admin
function wppa_add_admin()
{
global $wp_roles;
global $wpdb;
// Make sure admin has access rights
if (wppa_user_is('administrator')) {
$wp_roles->add_cap('administrator', 'wppa_admin');
$wp_roles->add_cap('administrator', 'wppa_upload');
$wp_roles->add_cap('administrator', 'wppa_import');
$wp_roles->add_cap('administrator', 'wppa_moderate');
$wp_roles->add_cap('administrator', 'wppa_export');
$wp_roles->add_cap('administrator', 'wppa_settings');
$wp_roles->add_cap('administrator', 'wppa_potd');
$wp_roles->add_cap('administrator', 'wppa_comments');
$wp_roles->add_cap('administrator', 'wppa_help');
}
// See if there are comments pending moderation
$com_pending = '';
$com_pending_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `status` = 'pending' OR `status` = 'spam'");
if ($com_pending_count) {
$com_pending = '<span class="update-plugins"><span class="plugin-count">' . $com_pending_count . '</span></span>';
}
// See if there are uploads pending moderation
$upl_pending = '';
$upl_pending_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `status` = 'pending'");
if ($upl_pending_count) {
$upl_pending = '<span class="update-plugins"><span class="plugin-count">' . $upl_pending_count . '</span></span>';
}
// Compute total pending moderation
$tot_pending = '';
$tot_pending_count = '0';
if (current_user_can('wppa_comments') || current_user_can('wppa_moderate')) {
$tot_pending_count += $com_pending_count;
}
if (current_user_can('wppa_admin') || current_user_can('wppa_moderate')) {
$tot_pending_count += $upl_pending_count;
}
if ($tot_pending_count) {
$tot_pending = '<span class="update-plugins"><span class="plugin-count">' . '<b>' . $tot_pending_count . '</b>' . '</span></span>';
}
$icon_url = WPPA_URL . '/img/camera16.png';
// page_title menu_title capability menu_slug function icon_url position
add_menu_page('WP Photo Album', __('Photo Albums', 'wp-photo-album-plus') . $tot_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin', $icon_url);
//,'10' );
// parent_slug page_title menu_title capability menu_slug function
add_submenu_page('wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus') . $upl_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin');
add_submenu_page('wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload');
// Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
if (!current_user_can('wppa_admin') && wppa_opt('upload_edit') != 'none') {
add_submenu_page('wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo');
}
add_submenu_page('wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import');
add_submenu_page('wppa_admin_menu', __('Moderate Photos', 'wp-photo-album-plus'), __('Moderate Photos', 'wp-photo-album-plus') . $tot_pending, 'wppa_moderate', 'wppa_moderate_photos', 'wppa_page_moderate');
add_submenu_page('wppa_admin_menu', __('Export Photos', 'wp-photo-album-plus'), __('Export Photos', 'wp-photo-album-plus'), 'wppa_export', 'wppa_export_photos', 'wppa_page_export');
add_submenu_page('wppa_admin_menu', __('Settings', 'wp-photo-album-plus'), __('Settings', 'wp-photo-album-plus'), 'wppa_settings', 'wppa_options', 'wppa_page_options');
add_submenu_page('wppa_admin_menu', __('Photo of the day Widget', 'wp-photo-album-plus'), __('Photo of the day', 'wp-photo-album-plus'), 'wppa_potd', 'wppa_photo_of_the_day', 'wppa_sidebar_page_options');
add_submenu_page('wppa_admin_menu', __('Manage comments', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus') . $com_pending, 'wppa_comments', 'wppa_manage_comments', 'wppa_comment_admin');
add_submenu_page('wppa_admin_menu', __('Help & Info', 'wp-photo-album-plus'), __('Documentation', 'wp-photo-album-plus'), 'wppa_help', 'wppa_help', 'wppa_page_help');
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:59,代码来源:wppa-admin.php
示例3: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
global $widget_content;
require_once dirname(__FILE__) . '/wppa-links.php';
require_once dirname(__FILE__) . '/wppa-styles.php';
require_once dirname(__FILE__) . '/wppa-functions.php';
require_once dirname(__FILE__) . '/wppa-thumbnails.php';
require_once dirname(__FILE__) . '/wppa-boxes-html.php';
require_once dirname(__FILE__) . '/wppa-slideshow.php';
wppa_initialize_runtime();
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('QR Widget', 'wp-photo-album-plus') : $instance['title']);
$qrsrc = 'http://api.qrserver.com/v1/create-qr-code/' . '?data=' . site_url() . '&size=' . wppa_opt('qr_size') . 'x' . wppa_opt('qr_size') . '&color=' . trim(wppa_opt('qr_color'), '#') . '&bgcolor=' . trim(wppa_opt('qr_bgcolor'));
$widget_content = '
<div style="text-align:center;" ><img id="wppa-qr-img" src="' . $qrsrc . '" title="" alt="' . __('QR code', 'wp-photo-album-plus') . '" /></div>
<div style="clear:both" ></div>';
$widget_content .= '
<script type="text/javascript">
/*[CDATA[*/
var wppaQRData = document.location.href;
var wppaQRDataOld = "";
var wppaQRSrc = "";
var workData = "";
wppaConsoleLog( "doc.loc.href = " + wppaQRData );
function wppaQRUpdate( arg ) {
if ( arg ) wppaQRData = arg;
if ( wppaQRData != wppaQRDataOld ) {
wppaQRDataOld = wppaQRData;
workData = wppaQRData;
wppaQRSrc = "http://api.qrserver.com/v1/create-qr-code/?data=" +
encodeURIComponent( workData ) +
"&size=' . wppa_opt('qr_size') . 'x' . wppa_opt('qr_size') . '&color=' . trim(wppa_opt('qr_color'), '#') . '&bgcolor=' . trim(wppa_opt('qr_bgcolor'), '#') . '";
document.getElementById( "wppa-qr-img" ).src = wppaQRSrc;
document.getElementById( "wppa-qr-img" ).title = workData;
}
return;
}
jQuery(document).ready(function(){
wppaQRUpdate();
});
/*]]*/
</script>';
echo $before_widget . $before_title . $title . $after_title . $widget_content . $after_widget;
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:49,代码来源:wppa-qr-widget.php
示例4: widget
function widget($args, $instance)
{
global $wpdb;
require_once dirname(__FILE__) . '/wppa-links.php';
require_once dirname(__FILE__) . '/wppa-styles.php';
require_once dirname(__FILE__) . '/wppa-functions.php';
require_once dirname(__FILE__) . '/wppa-thumbnails.php';
require_once dirname(__FILE__) . '/wppa-boxes-html.php';
require_once dirname(__FILE__) . '/wppa-slideshow.php';
wppa_initialize_runtime();
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => '', 'album' => '0'));
$title = apply_filters('widget_title', $instance['title']);
$album = $instance['album'];
if (!$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `id` = %d", $album))) {
$album = '0';
// Album vanished
}
wppa_user_upload();
// Do the upload if required
wppa('in_widget', 'upload');
wppa_bump_mocc();
$mocc = wppa('mocc');
$is_responsive = wppa_opt('colwidth') == 'auto';
if ($is_responsive) {
// Responsive widgetwppaAutoColumnWidth[1] = true;
$js = wppa_get_responsive_widget_js_html($mocc);
} else {
$js = '';
}
$create = wppa_get_user_create_html($album, wppa_opt('widget_width'), 'widget');
$upload = wppa_get_user_upload_html($album, wppa_opt('widget_width'), 'widget', $is_responsive);
if (!$create && !$upload) {
return;
}
// Nothing to do
$text = '<div id="wppa-container-' . $mocc . '" class="wppa-upload-widget" style="margin-top:2px; margin-left:2px;" >' . $js . $create . $upload . '</div>';
echo $before_widget;
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
echo $text;
echo '<div style="clear:both"></div>';
echo $after_widget;
wppa('in_widget', false);
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:46,代码来源:wppa-upload-widget.php
示例5: wppa_create_pl_htaccess
function wppa_create_pl_htaccess($pl_dirname = '')
{
global $wpdb;
// Only supported on single sites at the moment
if (is_multisite() && !WPPA_MULTISITE_GLOBAL) {
return false;
}
// Where are the photo source files?
$source_root = str_replace(ABSPATH, '', wppa_opt('wppa_source_dir'));
// Find permalink root name
if (!$pl_dirname) {
$pl_dirname = wppa_opt('wppa_pl_dirname');
}
// If no pl_dirname, feature is disabled
if (!$pl_dirname) {
return false;
}
// Create pl root directory
$pl_root = WPPA_CONTENT_PATH . '/' . $pl_dirname;
if (!wppa_mktree($pl_root)) {
wppa_log('Error', 'Can not create ' . $pl_root);
return false;
}
// Create .htaccess file
$file = fopen($pl_root . '/.htaccess', 'wb');
if (!$file) {
wppa_log('Error', 'Can not create ' . $pl_root . '/.htaccess');
return false;
}
fwrite($file, '<IfModule mod_rewrite.c>');
fwrite($file, "\n" . 'RewriteEngine On');
// RewriteBase /wp-content/wppa-pl
fwrite($file, "\n" . 'RewriteBase /' . str_replace(ABSPATH, '', $pl_root));
$albs = $wpdb->get_results("SELECT `id`, `name` FROM `" . WPPA_ALBUMS . "` ORDER BY `name` DESC", ARRAY_A);
if ($albs) {
foreach ($albs as $alb) {
$fm = wppa_sanitize_file_name($alb['name'], false);
$to = $source_root . '/album-' . $alb['id'];
fwrite($file, "\n" . 'RewriteRule ^' . $fm . '/(.*) /' . $to . '/$1 [NC]');
}
}
fwrite($file, "\n" . '</IfModule>');
fclose($file);
return true;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:45,代码来源:wppa-htaccess.php
示例6: wppa_save_source
function wppa_save_source($file, $name, $alb)
{
$doit = true;
// Frontend not enabled and not ajax ?
if (!is_admin() && !wppa_switch('keep_source_frontend')) {
$doit = false;
}
// Frontend not enabled and ajax ?
if (isset($_REQUEST['wppa-action']) && $_REQUEST['wppa-action'] == 'do-fe-upload' && !wppa_switch('keep_source_frontend')) {
$doit = false;
}
// Backend not enabled ?
if ((!isset($_REQUEST['wppa-action']) || $_REQUEST['wppa-action'] != 'do-fe-upload') && is_admin() && !wppa_switch('keep_source_admin')) {
$doit = false;
}
if ($doit) {
if (!is_dir(wppa_opt('source_dir'))) {
@wppa_mktree(wppa_opt('source_dir'));
}
$sourcedir = wppa_get_source_dir();
if (!is_dir($sourcedir)) {
@wppa_mktree($sourcedir);
}
$albdir = wppa_get_source_album_dir($alb);
if (!is_dir($albdir)) {
@wppa_mktree($albdir);
}
if (!is_dir($albdir)) {
wppa_log('Err', 'Could not create source directory ' . $albdir);
}
$dest = $albdir . '/' . wppa_sanitize_file_name($name);
if ($file != $dest) {
@copy($file, $dest);
}
// Do not copy to self, and do not bother on failure
if (is_file($dest)) {
wppa_chmod($dest);
} else {
wppa_log('Err', 'Could not save ' . $dest, true);
}
}
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:42,代码来源:wppa-source.php
示例7: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
global $wppa;
global $widget_content;
global $thumb;
require_once dirname(__FILE__) . '/wppa-links.php';
require_once dirname(__FILE__) . '/wppa-styles.php';
require_once dirname(__FILE__) . '/wppa-functions.php';
require_once dirname(__FILE__) . '/wppa-thumbnails.php';
require_once dirname(__FILE__) . '/wppa-boxes-html.php';
require_once dirname(__FILE__) . '/wppa-slideshow.php';
wppa_initialize_runtime();
$wppa['in_widget'] = 'bestof';
$wppa['mocc']++;
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => '', 'count' => '1', 'sortby' => 'maxratingcount', 'display' => 'photo', 'period' => 'thisweek', 'maxratings' => 'yes', 'meanrat' => 'yes', 'ratcount' => 'yes', 'linktype' => 'none'));
$widget_title = apply_filters('widget_title', $instance['title']);
$page = in_array($instance['linktype'], $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_bestof_widget_linkpage', __a('Best Of Photos'));
$count = $instance['count'];
$sortby = $instance['sortby'];
$display = $instance['display'];
$period = $instance['period'];
$maxratings = $instance['maxratings'];
$meanrat = $instance['meanrat'];
$ratcount = $instance['ratcount'];
$linktype = $instance['linktype'];
$size = wppa_opt('wppa_widget_width');
// $data = wppa_get_the_bestof( $count, $period, $sortby, $display );
$lineheight = wppa_opt('wppa_fontsize_widget_thumb') * 1.5;
$widget_content = "\n" . '<!-- WPPA+ BestOf Widget start -->';
$widget_content .= wppa_bestof_html(array('page' => $page, 'count' => $count, 'sortby' => $sortby, 'display' => $display, 'period' => $period, 'maxratings' => $maxratings, 'meanrat' => $meanrat, 'ratcount' => $ratcount, 'linktype' => $linktype, 'size' => $size, 'lineheight' => $lineheight));
$widget_content .= '<div style="clear:both"></div>';
$widget_content .= "\n" . '<!-- WPPA+ BestOf Widget end -->';
echo "\n" . $before_widget;
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
echo $widget_content . $after_widget;
}
开发者ID:billadams,项目名称:forever-frame,代码行数:41,代码来源:wppa-bestof-widget.php
示例8: do_album_navigator
function do_album_navigator($parent, $page, $skip, $propclass, $extraclause = '')
{
global $wpdb;
static $level;
static $ca;
if (!$level) {
$level = '1';
if (isset($_REQUEST['wppa-album'])) {
$ca = $_REQUEST['wppa-album'];
} elseif (isset($_REQUEST['album'])) {
$ca = $_REQUEST['album'];
} else {
$ca = '0';
}
$ca = wppa_force_numeric_else($ca, '0');
if ($ca && !wppa_album_exists($ca)) {
// wppa_log('dbg', 'Non-existent album '.$ca.' in url. Referrer= '.$_ENV["HTTP_REFERER"].', Request uri= '.$_ENV["REQUEST_URI"]);
$ca = '0';
}
} else {
$level++;
}
$slide = wppa_opt('album_navigator_widget_linktype') == 'slide' ? '&wppa-slide=1' : '';
$w = $this->get_widget_id();
$p = $parent;
$result = '';
$albums = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_ALBUMS . "` WHERE `a_parent` = %s " . $extraclause . wppa_get_album_order(max('0', $parent)), $parent), ARRAY_A);
if (!empty($albums)) {
wppa_cache_album('add', $albums);
$result .= '<ul>';
foreach ($albums as $album) {
$a = $album['id'];
$treecount = wppa_treecount_a($a);
if ($treecount['albums'] || $treecount['photos'] > wppa_opt('min_thumbs') || $skip == 'no') {
$result .= '
<li class="anw-' . $w . '-' . $p . $propclass . '" style="list-style:none; display:' . ($level == '1' ? '' : 'none') . ';">';
if (wppa_has_children($a)) {
$result .= '
<div style="cursor:default;width:12px;float:left;text-align:center;font-weight:bold;" class="anw-' . $w . '-' . $a . '-" onclick="jQuery(\'.anw-' . $w . '-' . $a . '\').css(\'display\',\'\'); jQuery(\'.anw-' . $w . '-' . $a . '-\').css(\'display\',\'none\');" >' . ($a == $ca ? '»' : '+') . '</div>
<div style="cursor:default;width:12px;float:left;text-align:center;font-weight:bold;display:none;" class="anw-' . $w . '-' . $a . '" onclick="jQuery(\'.anw-' . $w . '-' . $a . '-\').css(\'display\',\'\'); jQuery(\'.anw-' . $w . '-' . $a . '\').css(\'display\',\'none\'); jQuery(\'.p-' . $w . '-' . $a . '\').css(\'display\',\'none\');" >' . ($a == $ca ? '»' : '-') . '</div>';
} else {
$result .= '
<div style="width:12px;float:left;" > ' . ($a == $ca ? '»' : '') . '</div>';
}
$result .= '
<a href="' . wppa_encrypt_url(wppa_get_permalink($page) . '&wppa-album=' . $a . '&wppa-cover=0&wppa-occur=1' . $slide) . '">' . wppa_get_album_name($a) . '</a>
</li>';
$newpropclass = $propclass . ' p-' . $w . '-' . $p;
$result .= '<li class="anw-' . $w . '-' . $p . $propclass . '" style="list-style:none;" >' . $this->do_album_navigator($a, $page, $skip, $newpropclass, $extraclause) . '</li>';
}
}
$result .= '</ul>';
if ($level == '1' && $ca) {
// && $parent != '-1' ) {
$result .= '<script type="text/javascript" >';
while ($ca != '0' && $ca != '-1') {
$result .= '
jQuery(\'.anw-' . $w . '-' . $ca . '\').css(\'display\',\'\'); jQuery(\'.anw-' . $w . '-' . $ca . '-\').css(\'display\',\'none\');';
$ca = wppa_get_parentalbumid($ca);
}
$result .= '</script>';
}
}
$level--;
return str_replace('<ul></ul>', '', $result);
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:66,代码来源:wppa-album-navigator-widget.php
示例9: wppa_get_medal_html_a
function wppa_get_medal_html_a($args)
{
// Completize args
$args = wp_parse_args((array) $args, array('id' => '0', 'size' => 'M', 'where' => ''));
// Validate args
if ($args['id'] == '0') {
return '';
}
// Missing required id
if (!in_array($args['size'], array('S', 'M', 'L', 'XL'))) {
return '';
}
// Missing or not implemented size spec
if (!in_array($args['where'], array('top', 'bot'))) {
return '';
}
// Missing or not implemented where
// Do it here?
if (strpos(wppa_opt('medal_position'), $args['where']) === false) {
return '';
}
// No
// Get rquired photo and config data
$id = $args['id'];
$new = wppa_is_photo_new($id);
$mod = wppa_is_photo_modified($id);
$status = wppa_get_photo_item($id, 'status');
$medal = in_array($status, array('gold', 'silver', 'bronze')) ? $status : '';
// Have a medal to show?
if (!$new && !$medal && !$mod) {
return '';
// No
}
// Init local vars
$result = '';
$color = wppa_opt('medal_color');
$left = strpos(wppa_opt('medal_position'), 'left') !== false;
$ctop = strpos(wppa_opt('medal_position'), 'top') === false ? '-32' : '0';
$sizes = array('S' => '16', 'M' => '20', 'L' => '24', 'XL' => '32');
$nsizes = array('S' => '14', 'M' => '16', 'L' => '20', 'XL' => '24');
$fsizes = array('S' => '9', 'M' => '10', 'L' => '14', 'XL' => '20');
$smargs = array('S' => '4', 'M' => '5', 'L' => '6', 'XL' => '8');
$lmargs = array('S' => '22', 'M' => '28', 'L' => '36', 'XL' => '48');
$tops = array('S' => '8', 'M' => '8', 'L' => '6', 'XL' => '0');
$ntops = array('S' => '10', 'M' => '10', 'L' => '8', 'XL' => '0');
$titles = array('gold' => __('Gold medal', 'wp-photo-album-plus'), 'silver' => __('Silver medal', 'wp-photo-album-plus'), 'bronze' => __('Bronze medal', 'wp-photo-album-plus'));
$size = $sizes[$args['size']];
$nsize = $nsizes[$args['size']];
$fsize = $fsizes[$args['size']];
$smarg = $smargs[$args['size']];
$lmarg = $lmargs[$args['size']];
$top = $tops[$args['size']];
$ntop = $ntops[$args['size']];
$title = $medal ? esc_attr($titles[$medal]) : '';
$sstyle = $left ? 'left:' . $smarg . 'px;' : 'right:' . $smarg . 'px;';
$lstyle = $left ? 'left:' . $lmarg . 'px;' : 'right:' . $lmarg . 'px;';
// The medal container
$result .= '<div style="position:relative;top:' . $ctop . 'px;z-index:10;">';
// The medal
if ($medal) {
$result .= '<img' . ' src="' . WPPA_URL . '/images/medal_' . $medal . '_' . $color . '.png"' . ' title="' . $title . '"' . ' alt="' . $title . '"' . ' style="' . $sstyle . 'top:4px;' . 'position:absolute;' . 'border:none;' . 'margin:0;' . 'padding:0;' . 'box-shadow:none;' . 'height:' . $size . 'px;' . 'top:' . $top . 'px;' . '"' . ' />';
}
// Is there a new or modified indicator to display?
if ($new) {
$type = 'new';
} elseif ($mod) {
$type = 'mod';
} else {
$type = '';
}
// Style adjustment if only a new/modified without a real medal
if (!$medal) {
$lstyle = $sstyle;
}
$do_image = !wppa_switch('wppa_new_mod_label_is_text');
// Yes there is one to display
if ($type) {
if ($do_image) {
$result .= '<img' . ' src="' . wppa_opt($type . '_label_url') . '"' . ' title="' . esc_attr(__('New', 'wp-photo-album-plus')) . '"' . ' alt="' . esc_attr(__('New', 'wp-photo-album-plus')) . '"' . ' class="wppa-thumbnew"' . ' style="' . $lstyle . 'top:' . $ntop . 'px;' . 'position:absolute;' . 'border:none;' . 'margin:0;' . 'padding:0;' . 'box-shadow:none;' . 'height:' . $nsize . 'px;' . '"' . ' />';
} else {
$result .= '<div' . ' style="' . $lstyle . 'position:absolute;' . 'top:' . $ntop . 'px;' . 'box-sizing:border-box;' . 'float:' . ($left ? 'left;' : 'right;') . 'font-size:' . $fsize . 'px;' . 'line-height:' . $fsize . 'px;' . 'font-family:\'Arial Black\', Gadget, sans-serif;' . 'border-radius:2px;' . 'border-width:1px;' . 'border-style:solid;' . 'padding:1px;' . wppa_get_text_medal_color_style($type) . '"' . ' >' . ' ' . __(wppa_opt($type . '_label_text')) . ' ' . '</div>';
}
}
// Close container
$result .= '</div>';
return $result;
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:87,代码来源:wppa-thumbnails.php
示例10: _wppa_comment_admin
//.........这里部分代码省略.........
<td><h3 style="margin:0; color:green;"><?php
_e('Approved:', 'wp-photo-album-plus');
?>
</h3></td>
<td><h3 style="margin:0;"><?php
$count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `status` = 'approved'");
echo $count;
?>
</h3></td>
</tr>
<tr>
<td><h3 style="margin:0; color:#e66f00;"><?php
_e('Pending:', 'wp-photo-album-plus');
?>
</h3></td>
<td><h3 style="margin:0;"><?php
$count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `status` = 'pending'");
echo $count;
?>
</h3></td>
</tr>
<tr>
<td><h3 style="margin:0; color:red;"><?php
_e('Spam:', 'wp-photo-album-plus');
?>
</h3></td>
<td><h3 style="margin:0;"><?php
$count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `status` = 'spam'");
echo $count;
?>
</h3></td>
</tr>
<?php
if (wppa_opt('spam_maxage') != 'none') {
?>
<tr>
<td><h3 style="margin:0; color:red;"><?php
_e('Auto deleted spam:', 'wp-photo-album-plus');
?>
</h3></td>
<td><h3 style="margin:0;"><?php
echo get_option('wppa_spam_auto_delcount', '0');
?>
</h3></td>
</tr>
<?php
}
?>
</tbody>
</table>
<!-- end statistics -->
<!-- Settings -->
<div style="border:1px solid #ccc; padding:4px; margin:4px 0" >
<h3><?php
_e('Settings', 'wp-photo-album-plus');
?>
</h3>
<form action="<?php
echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_manage_comments');
?>
" method="post">
<p>
<?php
wp_nonce_field('$wppa_nonce', WPPA_NONCE);
_e('Linkpage:', 'wp-photo-album-plus');
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:67,代码来源:wppa-comment-admin.php
示例11: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
global $wpdb;
require_once dirname(__FILE__) . '/wppa-links.php';
require_once dirname(__FILE__) . '/wppa-styles.php';
require_once dirname(__FILE__) . '/wppa-functions.php';
require_once dirname(__FILE__) . '/wppa-thumbnails.php';
require_once dirname(__FILE__) . '/wppa-boxes-html.php';
require_once dirname(__FILE__) . '/wppa-slideshow.php';
wppa_initialize_runtime();
wppa('in_widget', 'com');
wppa_bump_mocc();
// Hide widget if not logged in and login required to see comments
if (wppa_switch('comment_view_login') && !is_user_logged_in()) {
return;
}
extract($args);
$page = in_array(wppa_opt('comment_widget_linktype'), wppa('links_no_page')) ? '' : wppa_get_the_landing_page('wppa_comment_widget_linkpage', __('Recently commented photos', 'wp-photo-album-plus'));
$max = wppa_opt('comten_count');
$widget_title = apply_filters('widget_title', $instance['title']);
$photo_ids = wppa_get_comten_ids($max);
$widget_content = "\n" . '<!-- WPPA+ Comment Widget start -->';
$maxw = wppa_opt('comten_size');
$maxh = $maxw + 18;
if ($photo_ids) {
foreach ($photo_ids as $id) {
// Make the HTML for current comment
$widget_content .= "\n" . '<div class="wppa-widget" style="width:' . $maxw . 'px; height:' . $maxh . 'px; margin:4px; display:inline; text-align:center; float:left;">';
$image = wppa_cache_thumb($id);
if ($image) {
$link = wppa_get_imglnk_a('comten', $id, '', '', true);
$file = wppa_get_thumb_path($id);
$imgstyle_a = wppa_get_imgstyle_a($id, $file, $maxw, 'center', 'comthumb');
$imgstyle = $imgstyle_a['style'];
$width = $imgstyle_a['width'];
$height = $imgstyle_a['height'];
$cursor = $imgstyle_a['cursor'];
$imgurl = wppa_get_thumb_url($id, '', $width, $height);
$imgevents = wppa_get_imgevents('thumb', $id, true);
$title = '';
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_COMMENTS . "` WHERE `photo` = %s ORDER BY `timestamp` DESC", $id), ARRAY_A);
if ($comments) {
$first_comment = $comments['0'];
foreach ($comments as $comment) {
$title .= $comment['user'] . ' ' . __('wrote', 'wp-photo-album-plus') . ' ' . wppa_get_time_since($comment['timestamp']) . ":\n";
$title .= $comment['comment'] . "\n\n";
}
}
$title = esc_attr(strip_tags(trim($title)));
$album = '0';
$display = 'thumbs';
$widget_content .= wppa_get_the_widget_thumb('comten', $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents);
} else {
$widget_content .= __('Photo not found.', 'wp-photo-album-plus');
}
$widget_content .= "\n\t" . '<span style="font-size:' . wppa_opt('fontsize_widget_thumb') . 'px; cursor:pointer;" title="' . esc_attr($first_comment['comment']) . '" >' . $first_comment['user'] . '</span>';
$widget_content .= "\n" . '</div>';
}
} else {
$widget_content .= 'There are no commented photos (yet).';
}
$widget_content .= '<div style="clear:both"></div>';
$widget_content .= "\n" . '<!-- WPPA+ comment Widget end -->';
echo "\n" . $before_widget;
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
echo $widget_content . $after_widget;
wppa('in_widget', false);
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:71,代码来源:wppa-comment-widget.php
示例12: wppa_get_potd
function wppa_get_potd()
{
global $wpdb;
$image = '';
switch (wppa_opt('widget_method')) {
case '1':
// Fixed photo
$id = wppa_opt('widget_photo');
if ($id != '') {
$image = $wpdb->get_row($wpdb->prepare("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s LIMIT 0,1", $id), ARRAY_A);
wppa_dbg_q('Q-Potd');
wppa_cache_photo('add', $image);
}
break;
case '2':
// Random
$album = wppa_opt('widget_album');
if ($album == 'topten') {
$images = wppa_get_widgetphotos($album);
if (count($images) > 1) {
// Select a random first from the current selection
$idx = rand(0, count($images) - 1);
$image = $images[$idx];
}
} elseif ($album != '') {
$images = wppa_get_widgetphotos($album, "ORDER BY RAND() LIMIT 0,1");
$image = $images[0];
}
break;
case '3':
// Last upload
$album = wppa_opt('widget_album');
if ($album == 'topten') {
$images = wppa_get_widgetphotos($album);
if ($images) {
// fid last uploaded image in the $images pool
$temp = 0;
foreach ($images as $img) {
if ($img['timestamp'] > $temp) {
$temp = $img['timestamp'];
$image = $img;
}
}
}
} elseif ($album != '') {
$images = wppa_get_widgetphotos($album, "ORDER BY timestamp DESC LIMIT 0,1");
$image = $images[0];
}
break;
case '4':
// Change every
$album = wppa_opt('widget_album');
if ($album != '') {
$per = wppa_opt('widget_period');
$photos = wppa_get_widgetphotos($album);
if ($per == '0') {
if ($photos) {
$image = $photos[rand(0, count($photos) - 1)];
} else {
$image = '';
}
} elseif ($per == 'day-of-week') {
$image = '';
if ($photos) {
$d = date_i18n("w");
$d -= get_option('wppa_potd_offset', '0');
while ($d < '1') {
$d += '7';
}
foreach ($photos as $img) {
if ($img['p_order'] == $d) {
$image = $img;
}
}
}
} elseif ($per == 'day-of-month') {
$image = '';
if ($photos) {
$d = strval(intval(date_i18n("d")));
$d -= get_option('wppa_potd_offset', '0');
while ($d < '1') {
$d += '31';
}
foreach ($photos as $img) {
if ($img['p_order'] == $d) {
$image = $img;
}
}
}
} elseif ($per == 'day-of-year') {
$image = '';
if ($photos) {
$d = strval(intval(date_i18n("z")));
$d -= get_option('wppa_potd_offset', '0');
while ($d < '0') {
$d += '366';
}
foreach ($photos as $img) {
if ($img['p_order'] == $d) {
$image = $img;
//.........这里部分代码省略.........
开发者ID:lchen01,项目名称:STEdwards,代码行数:101,代码来源:wppa-widget-functions.php
示例13: wppa_zoom_in
function wppa_zoom_in($id)
{
if ($id === false) {
return '';
}
if (wppa_switch('show_zoomin')) {
if (wppa_opt('magnifier')) {
return __('Zoom in', 'wp-photo-album-plus');
} else {
return esc_attr(stripslashes(wppa_get_photo_name($id)));
}
} else {
return '';
}
}
开发者ID:msayagh,项目名称:Quercus-source-code-Maven,代码行数:15,代码来源:wppa-functions.php
示例14: wppa_numberbar
function wppa_numberbar($opt = '')
{
// A single image slideshow needs no navigation
if (wppa('is_single')) {
return;
}
if (is_feed()) {
return;
}
$do_it = false;
if (wppa_switch('show_slideshownumbar') && !wppa('is_slideonly')) {
$do_it = true;
}
if (wppa('numbar_on')) {
$do_it = true;
}
if (!$do_it) {
return;
}
// get the data
$thumbs = wppa_get_thumbs();
if (empty($thumbs)) {
return;
}
// get the sizes
$size_given = is_numeric(wppa_opt('fontsize_numbar'));
if ($size_given) {
$size = wppa_opt('fontsize_numbar');
if (wppa_in_widget()) {
$size /= 2;
}
} else {
$size = wppa_in_widget() ? '9' : '12';
}
if ($size < '9') {
$size = '9';
}
$size_2 = floor($size / 2);
$size_4 = floor($size_2 / 2);
$size_32 = floor($size * 3 / 2);
// make the numbar style
$style = 'position:absolute; bottom:' . $size . 'px; right:0; margin-right:' . $size_2 . 'px; ';
// start the numbar
wppa_out('<div class="wppa-numberbar" style="' . $style . '">');
$numid = 0;
// make the elementstyles
$style = 'display:block;' . 'float:left;' . 'padding:0 ' . $size_4 . 'px;' . 'margin-right:' . $size_2 . 'px;' . 'font-weight:' . wppa_opt('fontweight_numbar') . ';';
if (wppa_opt('fontfamily_numbar')) {
$style .= 'font-family:' . wppa_opt('fontfamily_numbar') . ';';
}
if (wppa_opt('fontcolor_numbar')) {
$style .= 'color:' . wppa_opt('fontcolor_numbar') . ';';
}
if ($size_given) {
$style .= 'font-size:' . $size . 'px;line-height:' . $size_32 . 'px;';
}
$style_active = $style;
if (wppa_opt('bgcolor_numbar')) {
$style .= 'background-color:' . wppa_opt('bgcolor_numbar') . ';';
}
if (wppa_opt('bgcolor_numbar_active')) {
$style_active .= 'background-color:' . wppa_opt('bgcolor_numbar_active') . ';';
}
if (wppa_opt('bcolor_numbar')) {
$style .= 'border:1px solid ' . wppa_opt('bcolor_numbar') . ';';
}
if (wppa_opt('bcolor_numbar_active')) {
$style_active .= 'border:1px solid ' . wppa_opt('bcolor_numbar_active') . ';';
}
// if the number of photos is larger than a certain number, only the active ph displays a number, other are dots
$count = count($thumbs);
$high = wppa_opt('numbar_max');
// do the numbers
foreach ($thumbs as $tt) {
$title = sprintf(__('Photo %s of %s', 'wp-photo-album-plus'), $numid + '1', $count);
wppa_out('<a' . ' id="wppa-numbar-' . wppa('mocc') . '-' . $numid . '"' . ' title="' . $title . '"' . ' ' . ($numid == 0 ? ' class="wppa-numbar-current" ' : '') . ' style="' . ($numid == 0 ? $style_active : $style) . '"' . ' onclick="wppaGotoKeepState(' . wppa('mocc') . ',' . $numid . ');return false;"' . ' >' . ($count > $high ? '.' : $numid + 1) . '</a>');
$numid++;
}
wppa_out('</div>');
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:80,代码来源:wppa-slideshow.php
示例15: wppa_bcitem
function wppa_bcitem($value = '', $href = '', $title = '', $class = '', $ajax = '')
{
static $sep;
// Convert url to pretty
$href = wppa_convert_to_pretty($href);
// Has content?
if (!$value) {
return;
}
// No content
if ($href) {
wppa_out('<a' . ($ajax && wppa_switch('allow_ajax') ? ' onclick="wppaDoAjaxRender(' . wppa('mocc') . ', \'' . $ajax . '\', \'' . $href . '\' );"' : ' href="' . $href . '"') . ' class="wppa-nav-text ' . $class . '"' . ' style="' . __wcs('wppa-nav-text') . '"' . ' title="' . esc_attr($title) . '" >' . $value . '</a>');
} else {
// No link, its the last item
wppa_out('<span' . ' id="bc-pname-' . wppa('mocc') . '"' . ' class="wppa-nav-text ' . $class . '"' . ' style="' . ($title ? 'cursor:pointer;' : '') . __wcs('wppa-nav-text') . '"' . ' title="' . esc_attr($title) . '"' . ' >' . $value . '</span>');
return;
}
// Add seperator
if (!$sep) {
// Compute the seperator
$temp = wppa_opt('bc_separator');
switch ($temp) {
case 'url':
$size = wppa_opt('fontsize_nav');
if ($size == '') {
$size = '12';
}
$style = 'height:' . $size . 'px;';
$sep = ' ' . '<img' . ' src="' . wppa_opt('bc_url') . '"' . ' class="no-shadow"' . ' style="' . $style . '"' . ' />' . ' ';
break;
case 'txt':
$sep = ' ' . html_entity_decode(stripslashes(wppa_opt('bc_txt')), ENT_QUOTES) . ' ';
break;
default:
$sep = ' &' . $temp . '; ';
}
}
wppa_out('<span' . ' class="wppa-nav-text ' . $class . '"' . ' style="' . __wcs('wppa-nav-text') . '"' . ' >' . $sep . '</span>');
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:39,代码来源:wppa-breadcrumb.php
示例16: __wcs
function __wcs($class)
{
global $wppa;
if (!wppa_switch('wppa_inline_css')) {
return '';
// No inline styles
}
$opt = '';
$result = '';
switch ($class) {
case 'wppa-box':
$opt = wppa_opt('wppa_bwidth');
if ($opt > '0') {
$result .= 'border-style: solid; border-width:' . $opt . 'px; ';
}
$opt = wppa_opt('wppa_bradius');
if ($opt > '0') {
$result .= 'border-radius:' . $opt . 'px; ';
$result .= '-moz-border-radius:' . $opt . 'px; ';
$result .= '-khtml-border-radius:' . $opt . 'px; ';
$result .= '-webkit-border-radius:' . $opt . 'px; ';
}
$opt = wppa_opt('wppa_box_spacing');
if ($opt != '') {
$result .= 'margin-bottom:' . $opt .
|
请发表评论