////////////////////////////////////////////
// Loop through feed items
////////////////////////////////////////////
$items = $feed->get_items(0, $max);
// Request all feed items in parallel (if supported)
$urls_sanitized = array();
$urls = array();
foreach ($items as $key => $item) {
    $permalink = htmlspecialchars_decode($item->get_permalink());
    // Colons in URL path segments get encoded by SimplePie, yet some sites expect them unencoded
    $permalink = str_replace('%3A', ':', $permalink);
    // simplepie already sanitizes URLs so let's not do it again here.
    if ($permalink && !is_cached($permalink)) {
        $urls_sanitized[] = $permalink;
    }
    $urls[$key] = encodeURI($permalink);
}
debug('--------');
debug('Fetching feed items');
$http->fetchAll($urls_sanitized);
// count number of items added to full feed
$item_count = 0;
foreach ($items as $key => $item) {
    debug('--------');
    $do_content_extraction = true;
    debug('Processing feed item ' . sprintf('%02d', $item_count + 1) . '.');
    $extraction_successful = false;
    $text_sample = null;
    $permalink = $urls[$key];
    debug("Item URL: {$permalink}");
    $extracted_title = '';
 /**
 * Emmulate GNU diff's format.
 * Header: @@ -382,8 +481,9 @@
 * Indicies are printed as 1-based, not 0-based.
 * @return {string} The GNU diff string.
 */
 function toString()
 {
     if ($this->length1 === 0) {
         $coords1 = $this->start1 . ',0';
     } elseif ($this->length1 == 1) {
         $coords1 = $this->start1 + 1;
     } else {
         $coords1 = $this->start1 + 1 . ',' . $this->length1;
     }
     if ($this->length2 === 0) {
         $coords2 = $this->start2 . ',0';
     } elseif ($this->length2 == 1) {
         $coords2 = $this->start2 + 1;
     } else {
         $coords2 = $this->start2 + 1 . ',' . $this->length2;
     }
     $text = array('@@ -' . $coords1 . ' +' . $coords2 . " @@\n");
     // Escape the body of the patch with %xx notation.
     for ($x = 0; $x < count($this->diffs); $x++) {
         switch ($this->diffs[$x][0]) {
             case DIFF_INSERT:
                 $op = '+';
                 break;
             case DIFF_DELETE:
                 $op = '-';
                 break;
             case DIFF_EQUAL:
                 $op = ' ';
                 break;
         }
         $text[$x + 1] = $op . encodeURI($this->diffs[$x][1]) . "\n";
     }
     return implode('', $text);
 }
Beispiel #3
0
}

$(document).ready(function(){
  $("#jquery_jplayer_1").jPlayer({
    ready: function () {
      $(this).jPlayer("setMedia", { 
<?php 
    $audio = trim($audio);
    if (strcasecmp(substr($audio, -4), '.mp3') == 0) {
        echo 'mp3: ' . prepare_textdata_js(encodeURI($audio));
    } elseif (strcasecmp(substr($audio, -4), '.ogg') == 0) {
        echo 'oga: ' . prepare_textdata_js(encodeURI($audio)) . ",\n" . 'mp3: ' . prepare_textdata_js(encodeURI($audio));
    } elseif (strcasecmp(substr($audio, -4), '.wav') == 0) {
        echo 'wav: ' . prepare_textdata_js(encodeURI($audio)) . ",\n" . 'mp3: ' . prepare_textdata_js(encodeURI($audio));
    } else {
        echo 'mp3: ' . prepare_textdata_js(encodeURI($audio));
    }
    ?>
      });
    },
    swfPath: "js",
  });
  
  $("#jquery_jplayer_1").bind($.jPlayer.event.timeupdate, function(event) { 
  	$("#playTime").text(Math.floor(event.jPlayer.status.currentTime));
	});
  
  $("#backbutt").click(click_back);
  $("#forwbutt").click(click_forw);
  $("#do-single").click(click_single);
  $("#do-repeat").click(click_repeat);
 function createJsonIndex($filename, $files = '', $parent = '')
 {
     if (!$files) {
         $files = $this->files;
     }
     $data = array();
     $data["albums"] = array();
     $folders_count = $parent ? 1 : 0;
     foreach ($files as $file) {
         if (isset($file['files']) && count($file['files']) && !isset($file['md5'])) {
             ++$folders_count;
         }
     }
     if ($folders_count > 0) {
         $data["albums"]["folder"] = array();
         if ($parent) {
             $data["albums"]["folder"][] = array("title" => "..", "url" => encodeURI($this->remote . '/' . $parent, false));
         }
         foreach ($files as $file) {
             if (isset($file['files']) && count($file['files']) && !isset($file['md5'])) {
                 $pos = strpos($filename, '.');
                 $extension = $pos > 0 ? substr($filename, $pos) : "";
                 $child = str_replace("/", "_", $file['fullpath']) . $extension;
                 if ($this->createJsonIndex($child, $file['files'], $filename)) {
                     $data["albums"]["folder"][] = array("title" => $file['title'], "url" => encodeURI($this->remote . '/' . $child, false));
                 }
             }
         }
     }
     $i = 0;
     $files_count = 0;
     foreach ($files as $file) {
         if (isset($file['md5']) && $file['md5']) {
             ++$files_count;
         }
     }
     if ($files_count > 0) {
         $data["albums"]["album"] = array();
         foreach ($files as $file) {
             if (isset($file['md5']) && $file['md5']) {
                 $data["albums"]["album"][] = array("title" => $file['title'], "filename" => $file['filename'], "size" => $file['size'], "thumbnail" => $this->remote . '/' . $file['thumbnail'], "url" => encodeURI($this->remote . '/' . $file['fullpath'], false));
             }
         }
     }
     $f = fopen($filename, "w");
     if (!$f) {
         return false;
     }
     fwrite($f, json_encode($data));
     fclose($f);
     return true;
 }
function makeAudioPlayer($audio)
{
    if ($audio != '') {
        $playerskin = "jplayer.blue.monday.modified";
        $repeatMode = getSettingZeroOrOne('currentplayerrepeatmode', 0);
        ?>
<link type="text/css" href="css/jplayer_skin/<?php 
        echo $playerskin;
        ?>
.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<table class="width99pc" cellspacing="0" cellpadding="3">
<tr>
<td class="width45pc">&nbsp;</td>
<td class="center borderleft" style="padding-left:10px;">
<span id="do-single" class="click<?php 
        echo $repeatMode ? '' : ' hide';
        ?>
"><img src="icn/arrow-repeat.png" alt="Toggle Repeat (Now ON)" title="Toogle Repeat (Now ON)" style="width:24px;height:24px;" /></span><span id="do-repeat" class="click<?php 
        echo $repeatMode ? ' hide' : '';
        ?>
"><img src="icn/arrow-norepeat.png" alt="Toggle Repeat (Now OFF)" title="Toggle Repeat (Now OFF)" style="width:24px;height:24px;" /></span>
</td>
<td class="center bordermiddle">&nbsp;</td>
<td class="bordermiddle">
<div id="jquery_jplayer_1" class="jp-jplayer">
</div>
<div id="jp_container_1" class="jp-audio">
	<div class="jp-type-single">
		<div class="jp-gui jp-interface">
			<ul class="jp-controls">
				<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
				<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
				<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
				<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
				<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
			</ul>
			<div class="jp-progress">
				<div class="jp-seek-bar">
					<div class="jp-play-bar"></div>
				</div>
			</div>
			<div class="jp-volume-bar">
				<div class="jp-volume-bar-value"></div>
			</div>
			<div class="jp-time-holder">
				<div class="jp-current-time"></div>
				<div class="jp-duration"></div>
			</div>
		</div>
	</div>
</div>
</td>
<td class="center bordermiddle">&nbsp;</td>
<td class="center borderright" style="padding-right:10px;">
<?php 
        $currentplayerseconds = getSetting('currentplayerseconds');
        if ($currentplayerseconds == '') {
            $currentplayerseconds = 5;
        }
        ?>
<select id="backtime" name="backtime" onchange="{do_ajax_save_setting('currentplayerseconds',document.getElementById('backtime').options[document.getElementById('backtime').selectedIndex].value);}"><?php 
        echo get_seconds_selectoptions($currentplayerseconds);
        ?>
</select><br />
<span id="backbutt" class="click"><img src="icn/arrow-circle-225-left.png" alt="Rewind n seconds" title="Rewind n seconds" /></span>&nbsp;&nbsp;<span id="forwbutt" class="click"><img src="icn/arrow-circle-315.png" alt="Forward n seconds" title="Forward n seconds" /></span>
<span id="playTime" class="hide"></span>
</td>
<td class="width45pc">&nbsp;</td>
</tr>
<script type="text/javascript">
//<![CDATA[

function new_pos(p) {
	$("#jquery_jplayer_1").jPlayer("playHead", p);
}

function click_single() {
	$("#jquery_jplayer_1").unbind($.jPlayer.event.ended + ".jp-repeat");
	$("#do-single").addClass('hide');
	$("#do-repeat").removeClass('hide');
	do_ajax_save_setting('currentplayerrepeatmode','0');
	return false;
}

function click_repeat() {
	$("#jquery_jplayer_1").bind($.jPlayer.event.ended + ".jp-repeat", function(event) { 
		$(this).jPlayer("play"); 
	});
	$("#do-repeat").addClass('hide');
	$("#do-single").removeClass('hide');
	do_ajax_save_setting('currentplayerrepeatmode','1');
	return false;
}

function click_back() {
	var t = parseInt($("#playTime").text(),10);
	var b = parseInt($("#backtime").val(),10);
	var nt = t - b;
	if (nt < 0) nt = 0;
	$("#jquery_jplayer_1").jPlayer("play", nt);
}

function click_forw() {
	var t = parseInt($("#playTime").text(),10);
	var b = parseInt($("#backtime").val(),10);
	var nt = t + b;
	$("#jquery_jplayer_1").jPlayer("play", nt);
}

$(document).ready(function(){
  $("#jquery_jplayer_1").jPlayer({
    ready: function () {
      $(this).jPlayer("setMedia", { <?php 
        $audio = trim($audio);
        if (strcasecmp(substr($audio, -4), '.mp3') == 0) {
            echo 'mp3: ' . prepare_textdata_js(encodeURI($audio));
        } elseif (strcasecmp(substr($audio, -4), '.ogg') == 0) {
            echo 'oga: ' . prepare_textdata_js(encodeURI($audio)) . ", " . 'mp3: ' . prepare_textdata_js(encodeURI($audio));
        } elseif (strcasecmp(substr($audio, -4), '.wav') == 0) {
            echo 'wav: ' . prepare_textdata_js(encodeURI($audio)) . ", " . 'mp3: ' . prepare_textdata_js(encodeURI($audio));
        } else {
            echo 'mp3: ' . prepare_textdata_js(encodeURI($audio));
        }
        ?>
 });
    },
    swfPath: "js",
    noVolume: {ipad: /^no$/, iphone: /^no$/, ipod: /^no$/, android_pad: /^no$/, android_phone: /^no$/, blackberry: /^no$/, windows_ce: /^no$/, iemobile: /^no$/, webos: /^no$/, playbook: /^no$/}
  });
  
  $("#jquery_jplayer_1").bind($.jPlayer.event.timeupdate, function(event) { 
  	$("#playTime").text(Math.floor(event.jPlayer.status.currentTime));
	});
  
  $("#backbutt").click(click_back);
  $("#forwbutt").click(click_forw);
  $("#do-single").click(click_single);
  $("#do-repeat").click(click_repeat);
  
  <?php 
        echo $repeatMode ? "click_repeat();\n" : '';
        ?>
});
//]]>
</script>
<?php 
    }
    // if (isset($audio))
}
Beispiel #6
0
<?php

if (count($_GET) < 1) {
    exit;
}
function encodeURI($s)
{
    return urlencode($s);
}
$file = encodeURI($_GET['q']);
$url = "http://" . $_SERVER['HTTP_HOST'];
$p = parse_url($url);
$port = '';
if ($p['port']) {
    $port = ":{$p['port']}";
} else {
    $port = '';
}
$img_link = "{$p['scheme']}://{$p['host']}{$port}/private/s/?q={$file}";
?>
<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <meta name="robots" content="noindex,nofollow">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <title>認証</title>

  <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
  <style>
  body {