本文整理汇总了PHP中sanitize_flagname函数的典型用法代码示例。如果您正苦于以下问题:PHP sanitize_flagname函数的具体用法?PHP sanitize_flagname怎么用?PHP sanitize_flagname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sanitize_flagname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flag_skin_options
function flag_skin_options()
{
$flag_options = get_option('flag_options');
$act_skin = isset($_GET['skin']) ? urlencode($_GET['skin']) : $flag_options['flashSkin'];
$act_skin = sanitize_flagname($act_skin);
$settings = $flag_options['skinsDirURL'] . $act_skin . '/settings';
$settingsXML = $flag_options['skinsDirABS'] . $act_skin . '/settings/settings.xml';
$fp = fopen($settingsXML, "r");
if (!$fp) {
echo '<p style="color:#ff0000;"><b>Error! The configuration file not be found. You need to reinstall this skin.</b></p>';
} else {
$cPanel = FLAG_URLPATH . "lib/cpanel.swf";
$constructor = FLAG_URLPATH . "lib/";
$swfObject = FLAG_URLPATH . "admin/js/swfobject.js?ver=2.2";
?>
<div id="skinOptions">
<script type="text/javascript" src="<?php
echo $swfObject;
?>
"></script>
<script type="text/javascript">
var flashvars = {
path : "<?php
echo $settings;
?>
",
constructor : "<?php
echo $constructor;
?>
",
skin : "<?php
echo $act_skin;
?>
"
};
var params = {
wmode : "transparent",
scale : "noScale",
saling : "lt",
allowfullscreen : "false",
menu : "false"
};
var attributes = {};
swfobject.embedSWF("<?php
echo $cPanel;
?>
", "myContent", "600", "550", "9.0.0", "<?php
echo FLAG_URLPATH;
?>
skins/expressInstall.swf", flashvars, params, attributes);
</script>
<div id="myContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
<p>This page requires Flash Player version 10.1.52 or higher.</p>
</div>
</div>
<?php
}
fclose($fp);
}
示例2: flag_playlist_order
function flag_playlist_order($playlist = 'deprecated')
{
global $wpdb;
//this is the url without any presort variable
$base_url = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
$flag_options = get_option('flag_options');
$filename = sanitize_flagname($_GET['playlist']);
$playlistPath = $flag_options['galleryPath'] . 'playlists/' . $filename . '.xml';
$playlist = get_playlist_data(ABSPATH . $playlistPath);
$items_a = $playlist['items'];
$items = implode(',', $playlist['items']);
?>
<script type="text/javascript" src="<?php
echo FLAG_URLPATH;
?>
admin/js/jquery.tablednd_0_5.js"></script>
<script type="text/javascript" src="<?php
echo FLAG_URLPATH;
?>
admin/js/jquery.tablesorter.js"></script>
<div class="flag-wrap">
<h2><?php
_e('Sort Gallery', 'flash-album-gallery');
?>
</h2>
<div class="alignright tablenav" style="margin-bottom: -36px;">
<a href="<?php
echo esc_url($base_url . "&playlist=" . $filename . '&mode=edit');
?>
" class="button-secondary action"><?php
_e('Back to playlist', 'flash-album-gallery');
?>
</a>
</div>
<form id="sortPlaylist" method="POST" action="<?php
echo esc_url($base_url . "&playlist=" . $filename . '&mode=edit');
?>
" accept-charset="utf-8">
<div class="alignleft tablenav">
<?php
wp_nonce_field('flag_update');
?>
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php
_e('Update Sort Order', 'flash-album-gallery');
?>
" />
</div>
<br clear="all" />
<input type="hidden" name="playlist_title" value="<?php
echo esc_html($playlist['title']);
?>
" />
<input type="hidden" name="skinname" value="<?php
echo sanitize_flagname($playlist['skin']);
?>
" />
<input type="hidden" name="skinaction" value="<?php
echo sanitize_flagname($playlist['skin']);
?>
" />
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php
echo esc_html($playlist['description']);
?>
</textarea>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(document).ready(function($) {
// Initialise the table
jQuery("#listitems").tableDnD({
onDragClass: "myDragClass",
onDrop: function() {
jQuery("#listitems tr:even").addClass('alternate');
jQuery("#listitems tr:odd").removeClass('alternate');
}
});
$("#flag-listitems").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
1: {
// disable it by setting the property sorter to false
sorter: false
}
}
});
$("#flag-listitems").bind("sortEnd",function() {
jQuery("#listitems tr:even").addClass('alternate');
jQuery("#listitems tr:odd").removeClass('alternate');
});
});
/*]]>*/
</script>
<table id="flag-listitems" class="widefat fixed flag-table" cellspacing="0" >
<thead>
<tr>
<th class="header" width="54"><p style="margin-right:-10px;"><?php
_e('ID', 'flash-album-gallery');
//.........这里部分代码省略.........
示例3: flag_playlist_edit
function flag_playlist_edit()
{
global $wpdb;
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
$all_playlists = get_playlists();
$flag_options = get_option('flag_options');
$playlistPath = $flag_options['galleryPath'] . 'playlists/' . sanitize_flagname($_GET['playlist']) . '.xml';
$playlist = get_playlist_data(ABSPATH . $playlistPath);
$items_a = $playlist['items'];
$items = implode(',', $playlist['items']);
?>
<script type="text/javascript">
//<![CDATA[
function checkAll(form)
{
jQuery(form).find(':checkbox').each(function(){this.checked = !this.checked});
return false;
}
function getNumChecked(form)
{
var num = 0;
for (i = 0, n = form.elements.length; i < n; i++) {
if(form.elements[i].type == "checkbox") {
if(form.elements[i].name == "doaction[]")
if(form.elements[i].checked == true)
num++;
}
}
return num;
}
// this function check for a the number of selected images, sumbmit false when no one selected
function checkSelected() {
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
if(numchecked < 1) {
alert('<?php
echo esc_js(__("No items selected", "flag"));
?>
');
return false;
}
actionId = jQuery('#bulkaction').val();
switch (actionId) {
case "delete_items":
return confirm('<?php
echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.", 'flag')), "' + numchecked + '");
?>
');
break;
}
return confirm('<?php
echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.", 'flag')), "' + numchecked + '");
?>
');
}
function showDialog( windowId, height ) {
var form = document.getElementById('updatePlaylist');
var elementlist = "";
for (i = 0, n = form.elements.length; i < n; i++) {
if(form.elements[i].type == "checkbox") {
if(form.elements[i].name == "doaction[]")
if(form.elements[i].checked == true)
if (elementlist == "")
elementlist = form.elements[i].value;
else
elementlist += "," + form.elements[i].value;
}
}
jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
jQuery("#" + windowId + "_playlist").val(elementlist);
tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
}
var current_image = '';
function send_to_editor(html) {
var source = html.match(/src=\".*\" alt/);
source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
jQuery('#mp3thumb-'+actInp).attr('value', source);
jQuery('#thumb-'+actInp).attr('src', source);
tb_remove();
}
jQuery(document).ready(function(){
jQuery('.del_thumb').click(function(){
var id = jQuery(this).attr('data-id');
jQuery('#mp3thumb-'+id).attr('value', '');
jQuery('#thumb-'+id).attr('src', '<?php
echo site_url() . "/wp-includes/images/crystal/audio.png";
?>
');
return false;
});
jQuery('#skinname').change(function(){
var skin = jQuery(this).val();
jQuery('#skinOptions').attr("href","<?php
//.........这里部分代码省略.........
示例4: flag_banner_wp_media_lib
function flag_banner_wp_media_lib($added = false)
{
global $wpdb;
// same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
if ($added !== false) {
$added = preg_replace('/[^\\d,]+/', '', $added);
$filepath .= '&playlist=' . sanitize_flagname($_GET['playlist']) . '&mode=save';
$flag_options = get_option('flag_options');
$playlistPath = $flag_options['galleryPath'] . 'playlists/banner/' . sanitize_flagname($_GET['playlist']) . '.xml';
$playlist = get_b_playlist_data(ABSPATH . $playlistPath);
$exclude = explode(',', $added);
$exclude = array_filter($exclude, 'intval');
} else {
$items_array_default = isset($_COOKIE['bannerboxplaylist_default']) ? preg_replace('/[^\\d,]+/', '', $_COOKIE['bannerboxplaylist_default']) : '';
$exclude = explode(',', $items_array_default);
$exclude = array_filter($exclude, 'intval');
}
if (isset($_GET['playlist'])) {
$playlist_cookie = sanitize_flagname($_GET['playlist']);
} else {
$playlist_cookie = 'default';
}
$filepath = esc_url($filepath);
?>
<script type="text/javascript">
<!--
jQuery(document).ready(function(){
var storedData = getStorage('bannerboxplaylist_');
<?php
if (isset($_POST['items'])) {
?>
storedData.set('<?php
echo $playlist_cookie;
?>
', '<?php
echo preg_replace('/[^\\d,]+/', '', $_POST['items']);
?>
');
<?php
}
?>
jQuery('.cb :checkbox').click(function(){
var cur, arr, del;
if(jQuery(this).is(':checked')){
cur = jQuery(this).val();
arr = jQuery('#items_array').val();
if(arr){ del = ','; } else{ del = ''; }
jQuery('#items_array').val(arr + del + cur);
jQuery(this).closest('tr').addClass('already-added');
} else{
cur = jQuery(this).val();
arr = jQuery('#items_array').val().split(',');
arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
jQuery('#items_array').val(arr);
jQuery(this).closest('tr').removeClass('already-added');
}
storedData.set('<?php
echo $playlist_cookie;
?>
', jQuery('#items_array').val());
});
jQuery('.clear_selected').click(function(){
jQuery('#items_array').val('');
jQuery('.cb :checkbox').each(function(){
jQuery(this).prop('checked', false).closest('tr').removeClass('already-added');
});
storedData.set('<?php
echo $playlist_cookie;
?>
', jQuery('#items_array').val());
});
});
function getStorage(key_prefix){
return {
set: function(id, data){
document.cookie = key_prefix + id + '=' + encodeURIComponent(data);
},
get: function(id, data){
var cookies = document.cookie, parsed = {};
cookies.replace(/([^=]+)=([^;]*);?\s*/g, function(whole, key, value){
parsed[key] = decodeURIComponent(value);
});
return parsed[key_prefix + id];
}
};
}
function checkAll(form){
for(i = 0, n = form.elements.length; i < n; i++){
if(form.elements[i].type == "checkbox"){
if(form.elements[i].name == "doaction[]"){
if(form.elements[i].checked == true){
form.elements[i].checked = false;
} else{
form.elements[i].checked = true;
}
jQuery(form.elements[i]).closest('tr').toggleClass('already-added');
}
}
//.........这里部分代码省略.........
示例5: flag_playlist_delete
function flag_playlist_delete($playlist)
{
$playlist = sanitize_flagname($playlist);
$flag_options = get_option('flag_options');
$playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/' . $playlist . '.xml';
if (file_exists($playlistXML)) {
if (unlink($playlistXML)) {
flagGallery::show_message("'" . $playlist . ".xml' " . __('deleted', 'flag'));
}
}
}
示例6: flag_video_wp_media_lib
function flag_video_wp_media_lib($added = false)
{
global $wpdb;
// same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
if ($added !== false) {
$added = preg_replace('/[^\\d,]+/', '', $added);
$filepath .= '&playlist=' . sanitize_flagname($_GET['playlist']) . '&mode=save';
$flag_options = get_option('flag_options');
$playlistPath = $flag_options['galleryPath'] . 'playlists/video/' . sanitize_flagname($_GET['playlist']) . '.xml';
$playlist = get_v_playlist_data(ABSPATH . $playlistPath);
$exclude = explode(',', $added);
$exclude = array_filter($exclude, 'intval');
}
$filepath = esc_url($filepath);
?>
<script type="text/javascript">
<!--
jQuery(document).ready(function(){
jQuery('.cb :checkbox').click(function() {
var cur, arr, del;
if(jQuery(this).is(':checked')){
cur = jQuery(this).val();
arr = jQuery('#items_array').val();
if(arr) { del = ','; } else { del = ''; }
jQuery('#items_array').val(arr+del+cur);
jQuery(this).closest('tr').css('background-color','#DDFFBB').next().css('background-color','#DDFFBB');
} else {
cur = jQuery(this).val();
arr = jQuery('#items_array').val().split(',');
arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
jQuery('#items_array').val(arr);
jQuery(this).closest('tr').removeAttr('style').next().removeAttr('style');
}
});
jQuery('.del_thumb').click(function(){
var id = jQuery(this).attr('data-id');
jQuery('#flvthumb-'+id).attr('value', '');
jQuery('#thumb-'+id).attr('src', '<?php
echo site_url() . "/wp-includes/images/crystal/video.png";
?>
');
return false;
})
});
function checkAll(form) {
for (i = 0, n = form.elements.length; i < n; i++) {
if(form.elements[i].type == "checkbox") {
if(form.elements[i].name == "doaction[]") {
if(form.elements[i].checked == true)
form.elements[i].checked = false;
else
form.elements[i].checked = true;
}
}
}
var arr = jQuery('.cb input:checked').map(function(){return jQuery(this).val();}).get().join(',');
jQuery('#items_array').val(arr);
}
// this function check for a the number of selected images, sumbmit false when no one selected
function checkSelected() {
if(!jQuery('.cb input:checked')) {
alert('<?php
echo esc_js(__('No items selected', 'flag'));
?>
');
return false;
}
actionId = jQuery('#bulkaction').val();
switch (actionId) {
case "new_playlist":
showDialog('new_playlist', 160);
return false;
break;
}
}
function showDialog( windowId, height ) {
jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
jQuery("#" + windowId + "_flvid").val(jQuery('#items_array').val());
tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
}
var current_image = '';
function send_to_editor(html) {
var source = html.match(/src=\".*\" alt/);
source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
jQuery('#flvthumb-'+actInp).attr('value', source);
jQuery('#thumb-'+actInp).attr('src', source);
tb_remove();
}
//-->
</script>
<div class="wrap">
<?php
if ($added === false) {
?>
<?php
if (current_user_can('FlAG Import folder')) {
//.........这里部分代码省略.........
示例7: flagShowVPlayer
echo flagShowVPlayer($file, $width, $height, $wmode = 'opaque');
} else {
_e("Can't find playlist");
}
}
?>
<?php
if (isset($_GET['mv'])) {
$height = isset($_GET['h']) ? intval($_GET['h']) : '';
$width = '100%';
$mv = intval($_GET['mv']);
echo flagShowVmPlayer($mv, $width, $height, $autoplay = 'true');
}
?>
<?php
if (isset($_GET['b'])) {
$file = sanitize_flagname($_GET['b']);
$playlistpath = $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
if (file_exists($playlistpath)) {
echo flagShowBanner($file, $width = '', $height = '', $wmode = 'opaque');
} else {
_e("Can't find playlist");
}
}
?>
</div>
</body>
</html>
示例8: create_gallery
/**
* create a new gallery & folder
*
* @class flagAdmin
* @param string $gallery
* @param string $defaultpath
* @param bool $output if the function should show an error messsage or not
* @return bool|int
*/
static function create_gallery($gallery, $defaultpath, $output = true)
{
global $wpdb, $user_ID;
// get the current user ID
get_currentuserinfo();
$description = '';
$status = 0;
if (is_array($gallery)) {
$gallerytitle = $gallery['title'];
$description = $gallery['description'];
$status = intval($gallery['status']);
} else {
$gallerytitle = $gallery;
}
//cleanup pathname
$galleryname = sanitize_flagname($gallerytitle);
$galleryname = apply_filters('flag_gallery_name', $galleryname);
$galleryname = preg_replace('/[^\\w\\._-]+/', '', $galleryname);
if (!$galleryname) {
$galleryname = date('y-m-j_h-i-s');
}
$flagpath = $defaultpath . $galleryname;
$flagRoot = WINABSPATH . $defaultpath;
$txt = '';
// No gallery name ?
if (empty($galleryname)) {
if ($output) {
flagGallery::show_error(__('No valid gallery name!', 'flag'));
}
return false;
}
// check for main folder
if (!is_dir($flagRoot)) {
if (!wp_mkdir_p($flagRoot)) {
$txt = __('Directory', 'flag') . ' <strong>' . $defaultpath . '</strong> ' . __('didn\'t exist. Please create first the main gallery folder ', 'flag') . '!<br />';
$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flag') . ' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
if ($output) {
flagGallery::show_error($txt);
}
return false;
}
}
// check for permission settings, Safe mode limitations are not taken into account.
if (!is_writeable($flagRoot)) {
$txt = __('Directory', 'flag') . ' <strong>' . $defaultpath . '</strong> ' . __('is not writeable !', 'flag') . '<br />';
$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flag') . ' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
if ($output) {
flagGallery::show_error($txt);
}
return false;
}
// 1. Create new gallery folder
if (!is_dir(WINABSPATH . $flagpath)) {
if (!wp_mkdir_p(WINABSPATH . $flagpath)) {
$txt = __('Unable to create directory ', 'flag') . $flagpath . '!<br />';
}
}
// 2. Check folder permission
if (!is_writeable(WINABSPATH . $flagpath)) {
$txt .= __('Directory', 'flag') . ' <strong>' . $flagpath . '</strong> ' . __('is not writeable !', 'flag') . '<br />';
}
// 3. Now create "thumbs" folder inside
if (!is_dir(WINABSPATH . $flagpath . '/thumbs')) {
if (!wp_mkdir_p(WINABSPATH . $flagpath . '/thumbs')) {
$txt .= __('Unable to create directory ', 'flag') . ' <strong>' . $flagpath . '/thumbs !</strong>';
}
}
if (SAFE_MODE) {
$help = __('The server setting Safe-Mode is on !', 'flag');
$help .= '<br />' . __('If you have problems, please create directory', 'flag') . ' <strong>' . $flagpath . '</strong> ';
$help .= __('and the thumbnails directory', 'flag') . ' <strong>' . $flagpath . '/thumbs</strong> ' . __('with permission 777 manually !', 'flag');
if ($output) {
flagGallery::show_message($help);
}
}
// show an error message
if (!empty($txt)) {
if (SAFE_MODE) {
// for safe_mode , better delete folder, both folder must be created manually
@rmdir(WINABSPATH . $flagpath . '/thumbs');
@rmdir(WINABSPATH . $flagpath);
}
if ($output) {
flagGallery::show_error($txt);
}
return false;
}
$result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
if ($result) {
if ($output) {
flagGallery::show_error(_n('Gallery', 'Galleries', 1, 'flag') . ' <strong>' . $galleryname . '</strong> ' . __('already exists', 'flag'));
//.........这里部分代码省略.........
示例9: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/flag-config.php';
if (!is_user_logged_in()) {
die('-1');
}
// check for correct FlAG capability
if (!current_user_can('FlAG Change skin')) {
die('-1');
}
$flashPost = file_get_contents("php://input");
// parse properties_skin
$arr = array();
parse_str($flashPost, $arr);
$settingsXML = str_replace("\\", "/", dirname(dirname(dirname(__FILE__))) . '/flagallery-skins/' . sanitize_flagname($arr['skin_name']) . '/settings/settings.xml');
if (isset($arr['properties_skin']) && !empty($arr['properties_skin'])) {
$fp = fopen($settingsXML, "r");
if (!$fp) {
exit("2");
//Failure - not read;
}
$mainXML = '';
while (!feof($fp)) {
$mainXML .= fgetc($fp);
}
$fp = fopen($settingsXML, "w");
if (!$fp) {
exit("0");
}
//Failure
$arr['properties_skin'] = str_replace(array('=', '?', '"', '$'), '', $arr['properties_skin']);
示例10: flagShowWidgetBanner
function flagShowWidgetBanner($xml, $width, $height, $skin)
{
require_once dirname(__FILE__) . '/class.swfobject.php';
require_once dirname(dirname(__FILE__)) . '/admin/banner.functions.php';
$flag_options = get_option('flag_options');
$galleryPath = trim($flag_options['galleryPath'], '/');
$xml = sanitize_flagname($xml);
$playlistPath = $galleryPath . '/playlists/banner/' . $xml . '.xml';
$playlist_data = get_b_playlist_data(ABSPATH . $playlistPath);
if (!$skin) {
$skin = $playlist_data['skin'];
}
$skin = sanitize_flagname($skin);
$items = $playlist_data['items'];
$skinpath = str_replace("\\", "/", WP_PLUGIN_DIR) . '/flagallery-skins/' . $skin;
include_once $skinpath . '/' . $skin . '.php';
if (isset($flag_options['license_key'])) {
$lkey = $flag_options['license_key'];
} else {
$lkey = '';
}
$args = array('xml' => $xml, 'skin' => $skin, 'lkey' => $lkey, 'items' => $items, 'width' => $width, 'height' => $height);
$out = apply_filters('flagShowWidgetBannerSkin', $args);
// Replace doubled spaces with single ones (ignored in HTML any way)
// Remove single and multiline comments, tabs and newline chars
//$out = preg_replace('@(\s){2,}@', '\1', $out);
//$out = preg_replace(
// '@(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|((?<!:)//.*)|[\t\r\n]@i',
// '',
// $out
//);
return $out;
}
示例11: __
flagGallery::show_message(__('Can\'t find skin directory ', 'flash-album-gallery') . ' \'' . $delskin . '\' ' . __('. Try delete it manualy via ftp', 'flash-album-gallery'));
}
}
} else {
flagGallery::show_message(__('Can\'t find skin directory ', 'flash-album-gallery') . ' \'' . $delskin . '\' ' . __('. Try delete it manualy via ftp', 'flash-album-gallery'));
}
} else {
flagGallery::show_message(__('You need activate another skin before delete it', 'flash-album-gallery'));
}
} else {
wp_die(__('You do not have sufficient permissions to delete skins of Grand Flagallery.'));
}
}
if (isset($_GET['skin'])) {
check_admin_referer('set_default_skin');
$set_skin = sanitize_flagname($_GET['skin']);
if ($flag_options['flashSkin'] != $set_skin) {
$aValid = array('-', '_');
if (!ctype_alnum(str_replace($aValid, '', $set_skin))) {
die('try again');
}
$active_skin = $flag_options['skinsDirABS'] . $set_skin . '/' . $set_skin . '.php';
if (!file_exists($active_skin)) {
die('try again');
}
$flag_options['flashSkin'] = $set_skin;
include_once $active_skin;
update_option('flag_options', $flag_options);
flagGallery::show_message(__('Skin', 'flash-album-gallery') . ' \'' . $set_skin . '\' ' . __('activated successfully. Optionally it can be overwritten with shortcode parameter.', 'flash-album-gallery'));
}
}
示例12: fileinfo
/**
* Slightly modfifed version of pathinfo(), clean up filename & rename jpeg to jpg
*
* @param string $name The name being checked.
* @return array containing information about file
*/
static function fileinfo($name)
{
//Sanitizes a filename replacing whitespace with dashes
$name = sanitize_flagname($name);
//get the parts of the name
$filepart = pathinfo(strtolower($name));
if (empty($filepart)) {
return false;
}
// required until PHP 5.2.0
if (empty($filepart['filename'])) {
$filepart['filename'] = substr($filepart['basename'], 0, strlen($filepart['basename']) - (strlen($filepart['extension']) + 1));
}
$filepart['filename'] = sanitize_title_with_dashes($filepart['filename']);
//extension jpeg will not be recognized by the slideshow, so we rename it
$filepart['extension'] = $filepart['extension'] == 'jpeg' ? 'jpg' : $filepart['extension'];
//combine the new file name
$filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension'];
return $filepart;
}
示例13: flag_v_playlist_order
/**
* @author Sergey Pasyuk
* @copyright 2009
*/
function flag_v_playlist_order($playlist = 'deprecated')
{
global $wpdb;
//this is the url without any presort variable
$base_url = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
$flag_options = get_option('flag_options');
$filename = sanitize_flagname($_GET['playlist']);
$playlistPath = $flag_options['galleryPath'] . 'playlists/video/' . $filename . '.xml';
$playlist = get_v_playlist_data(ABSPATH . $playlistPath);
$items_a = $playlist['items'];
$items = implode(',', $playlist['items']);
?>
<script type="text/javascript" src="<?php
echo FLAG_URLPATH;
?>
admin/js/jquery.tablednd_0_5.js"></script>
<script type="text/javascript" src="<?php
echo FLAG_URLPATH;
?>
admin/js/jquery.tablesorter.js"></script>
<div class="flag-wrap">
<h2><?php
_e('Sort Gallery', 'flag');
?>
</h2>
<div class="alignright tablenav" style="margin-bottom: -36px;">
<a href="<?php
echo esc_url($base_url . "&playlist=" . $filename . '&mode=edit');
?>
" class="button-secondary action"><?php
_e('Back to playlist', 'flag');
?>
</a>
</div>
<form id="sortPlaylist" method="POST" action="<?php
echo esc_url($base_url . "&playlist=" . $filename . '&mode=edit');
?>
" accept-charset="utf-8">
<div class="alignleft tablenav">
<?php
wp_nonce_field('flag_update');
?>
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php
_e('Update Sort Order', 'flag');
?>
" />
</div>
<br clear="all" />
<input type="hidden" name="playlist_title" value="<?php
echo esc_html($playlist['title']);
?>
" />
<input type="hidden" name="skinname" value="<?php
echo sanitize_flagname($playlist['skin']);
?>
" />
<input type="hidden" name="skinaction" value="<?php
echo sanitize_flagname($playlist['skin']);
?>
" />
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php
echo esc_html($playlist['description']);
?>
</textarea>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(document).ready(function($) {
// Initialise the table
jQuery("#listitems").tableDnD({
onDragClass: "myDragClass",
onDrop: function() {
jQuery("#listitems tr:even").addClass('alternate');
jQuery("#listitems tr:odd").removeClass('alternate');
}
});
$("#flag-listitems").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
1: {
// disable it by setting the property sorter to false
sorter: false
}
}
});
$("#flag-listitems").bind("sortEnd",function() {
jQuery("#listitems tr:even").addClass('alternate');
jQuery("#listitems tr:odd").removeClass('alternate');
});
});
/*]]>*/
</script>
<table id="flag-listitems" class="widefat fixed flag-table" cellspacing="0" >
//.........这里部分代码省略.........
示例14: header
<?php
// Create XML output
header("content-type:text/xml;charset=utf-8");
// look up for the path
require_once str_replace("\\", "/", dirname(dirname(__FILE__)) . "/flag-config.php");
/** @var $wpdb wpdb */
global $wpdb;
$siteurl = get_option('siteurl');
// get the gallery id
$gID = explode('_', $_GET['gid']);
$gID = array_filter($gID, 'intval');
$skin = sanitize_flagname($_GET['skinName']);
$flag_options = get_option('flag_options');
$file = str_replace("\\", "/", dirname(dirname(dirname(__FILE__))) . '/flagallery-skins/' . $skin . '/settings/settings.xml');
$url_plug = plugins_url() . '/' . FLAGFOLDER . '/';
$mainXML = "";
$fp = fopen($file, "r");
if (!$fp) {
exit("0");
//Failure - not read;
}
while (!feof($fp)) {
$mainXML .= fgetc($fp);
}
if (isset($flag_options['license_key'])) {
$lkey = $flag_options['license_key'];
} else {
$lkey = '';
}
$propertiesXML = substr($mainXML, strpos($mainXML, "<properties>"), strpos($mainXML, "</properties>") - strpos($mainXML, "<properties>"));
示例15: flagSave_bPlaylistSkin
function flagSave_bPlaylistSkin($file)
{
$file = sanitize_flagname($file);
$flag_options = get_option('flag_options');
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
// Save options
$title = esc_html($_POST['playlist_title']);
$descr = esc_html($_POST['playlist_descr']);
$items = get_b_playlist_data($playlistPath);
$data = $items['items'];
flagSave_bPlaylist($title, $descr, $data, $file, $skinaction = 'update');
}