本文整理汇总了PHP中scrub_out函数的典型用法代码示例。如果您正苦于以下问题:PHP scrub_out函数的具体用法?PHP scrub_out怎么用?PHP scrub_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scrub_out函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format
/**
* format
* This formats a video object so that it is human readable
*/
public function format()
{
$this->f_title = scrub_out($this->title);
$this->f_link = scrub_out($this->title);
$this->f_codec = $this->video_codec . ' / ' . $this->audio_codec;
$this->f_resolution = $this->resolution_x . 'x' . $this->resolution_y;
$this->f_tags = '';
$this->f_length = floor($this->time / 60) . ' ' . T_('minutes');
}
示例2: arrayToJSON
function arrayToJSON($array)
{
$json = '{ ';
foreach ($array as $key => $value) {
$json .= '"' . $key . '" : ';
if (is_array($value)) {
$json .= arrayToJSON($value);
} else {
// Make sure to strip backslashes and convert things to
// entities in our output
$json .= '"' . scrub_out(str_replace('\\', '', $value)) . '"';
}
$json .= ' , ';
}
$json = rtrim($json, ', ');
return $json . ' }';
}
示例3: foreach
?>
">
<table cellpadding="3" cellspacing="0" class="tabledata">
<?php
foreach ($fields as $key => $field) {
?>
<tr>
<td><?php
echo $field['description'];
?>
</td>
<td><input type="text" name="<?php
echo $key;
?>
" value="<?php
echo scrub_out($instance[$key]);
?>
" /></td>
</tr>
<?php
}
?>
</table>
<div class="formValidation">
<input type="submit" value="<?php
echo T_('Update Instance');
?>
" />
</div>
</form>
<?php
示例4: T_
" /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Copyright');
?>
</td>
<td><input type="text" name="copyright" value="<?php
echo scrub_out($libitem->copyright);
?>
" /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Website');
?>
</td>
<td><input type="text" name="website" value="<?php
echo scrub_out($libitem->website);
?>
" /></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php
echo $libitem->id;
?>
" />
<input type="hidden" name="type" value="podcast_row" />
</form>
</div>
示例5: T_
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Random');
?>
</td>
<td><input type="checkbox" name="random" value="1" <?php
if ($libitem->random) {
echo "checked";
}
?>
/></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Item Limit (0 = unlimited)');
?>
</td>
<td><input type="text" name="limit" value="<?php
echo scrub_out($libitem->limit);
?>
" /></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php
echo $libitem->id;
?>
" />
<input type="hidden" name="type" value="search_row" />
</form>
</div>
示例6: get
/**
* get
* This functions returns an array containing information about
* The songs that vlc currently has in it's playlist. This must be
* done in a standardized fashion
* Warning ! if you got files in vlc medialibary those files will be sent to the php xml parser
* to, not to your browser but still this can take a lot of work for your server.
* The xml files of vlc need work, not much documentation on them....
*/
public function get()
{
/* Get the Current Playlist */
$list = $this->_vlc->get_tracks();
if (!$list) {
return array();
}
$counterforarray = 0;
// here we look if there are song in the playlist when media libary is used
if ($list['node']['node'][0]['leaf'][$counterforarray]['attr']['uri']) {
while ($list['node']['node'][0]['leaf'][$counterforarray]) {
$songs[] = htmlspecialchars_decode($list['node']['node'][0]['leaf'][$counterforarray]['attr']['uri'], ENT_NOQUOTES);
$songid[] = $list['node']['node'][0]['leaf'][$counterforarray]['attr']['id'];
$counterforarray++;
}
// if there is only one song look here,and media libary is used
} elseif ($list['node']['node'][0]['leaf']['attr']['uri']) {
$songs[] = htmlspecialchars_decode($list['node']['node'][0]['leaf']['attr']['uri'], ENT_NOQUOTES);
$songid[] = $list['node']['node'][0]['leaf']['attr']['id'];
} elseif ($list['node']['node']['leaf'][$counterforarray]['attr']['uri']) {
while ($list['node']['node']['leaf'][$counterforarray]) {
$songs[] = htmlspecialchars_decode($list['node']['node']['leaf'][$counterforarray]['attr']['uri'], ENT_NOQUOTES);
$songid[] = $list['node']['node']['leaf'][$counterforarray]['attr']['id'];
$counterforarray++;
}
} elseif ($list['node']['node']['leaf']['attr']['uri']) {
$songs[] = htmlspecialchars_decode($list['node']['node']['leaf']['attr']['uri'], ENT_NOQUOTES);
$songid[] = $list['node']['node']['leaf']['attr']['id'];
} else {
return array();
}
$counterforarray = 0;
foreach ($songs as $key => $entry) {
$data = array();
/* Required Elements */
$data['id'] = $songid[$counterforarray];
// id number of the files in the vlc playlist, needed for other operations
$data['raw'] = $entry;
$url_data = $this->parse_url($entry);
switch ($url_data['primary_key']) {
case 'oid':
$data['oid'] = $url_data['oid'];
$song = new Song($data['oid']);
$song->format();
$data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;
$data['link'] = $song->f_link;
break;
case 'demo_id':
$democratic = new Democratic($url_data['demo_id']);
$data['name'] = T_('Democratic') . ' - ' . $democratic->name;
$data['link'] = '';
break;
case 'random':
$data['name'] = T_('Random') . ' - ' . scrub_out(ucfirst($url_data['type']));
$data['link'] = '';
break;
default:
/* If we don't know it, look up by filename */
$filename = Dba::escape($entry);
$sql = "SELECT `name` FROM `live_stream` WHERE `url`='{$filename}' ";
$db_results = Dba::read($sql);
if ($row = Dba::fetch_assoc($db_results)) {
//if stream is known just send name
$data['name'] = htmlspecialchars(substr($row['name'], 0, 50));
} elseif (strncmp($entry, 'http', 4) == 0) {
$data['name'] = htmlspecialchars("(VLC stream) " . substr($entry, 0, 50));
} else {
$getlast = explode("/", $entry);
$lastis = count($getlast) - 1;
$data['name'] = htmlspecialchars("(VLC local) " . substr($getlast[$lastis], 0, 50));
}
// end if loop
break;
}
// end switch on primary key type
$data['track'] = $key + 1;
$counterforarray++;
$results[] = $data;
}
// foreach playlist items
return $results;
}
示例7: T_
<td class="edit_dialog_content_header"><?php
echo T_('Stream Type');
?>
</td>
<td><input type="text" name="stream_type" value="<?php
echo scrub_out($libitem->stream_type);
?>
" /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Bitrate');
?>
</td>
<td><input type="text" name="bitrate" value="<?php
echo scrub_out($libitem->bitrate);
?>
" /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Genre');
?>
</td>
<td><input type="text" name="edit_tags" id="edit_tags" value="<?php
echo Tag::get_display($libitem->tags);
?>
" /></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php
示例8: T_
?>
<th class="cel_agent"><?php
echo T_('Agent');
?>
</th>
<?php
}
?>
</tr>
</tfoot>
</table>
<div id="recent_more">
<?php
$user_id_a = '';
if (isset($user_id) && !empty($user_id)) {
$user_id_a = "&user_id=" . scrub_out($user_id);
}
?>
<a href="<?php
echo AmpConfig::get('web_path');
?>
/stats.php?action=recent<?php
echo $user_id_a;
?>
"><?php
echo T_('More');
?>
</a>
</div>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
示例9: scrub_out
?>
<tr class="<?php
echo UI::flip_class();
?>
">
<td class="cel_preference"><?php
echo scrub_out(T_($preference['description']));
?>
</td>
<td class="cel_level">
<?php
$level_name = "is_" . $preference['level'];
${$level_name} = 'selected="selected"';
?>
<select name="prefs[<?php
echo scrub_out($preference['name']);
?>
]">
<option value="5" <?php
echo $is_5;
?>
><?php
echo T_('Guest');
?>
</option>
<option value="25" <?php
echo $is_25;
?>
><?php
echo T_('User');
?>
示例10: T_
*
*/
?>
<div>
<form method="post" id="edit_playlist_<?php
echo $libitem->id;
?>
" class="edit_dialog_content">
<table class="tabledata" cellspacing="0" cellpadding="0">
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Name');
?>
</td>
<td><input type="text" name="name" value="<?php
echo scrub_out($libitem->name);
?>
" autofocus /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Type');
?>
</td>
<td>
<?php
$name = 'select_' . $libitem->type;
?>
<?php
${$name} = ' selected="selected"';
?>
示例11: T_
</option>
<option value="system" title="System"><?php
echo T_('Ampache');
?>
</option>
</select>
</td>
</tr>
<tr>
<td><?php
echo T_('Subject');
?>
:</td>
<td colspan="3">
<input name="subject" value="<?php
echo scrub_out($_POST['subject']);
?>
" />
</td>
</tr>
<tr>
<td valign="top"><?php
echo T_('Message');
?>
:</td>
<td>
<textarea class="input" name="message" rows="10" cols="70"></textarea>
</td>
</tr>
</table>
<div class="formValidation">
示例12: scrub_out
?>
">
<td class="cel_name"><?php
echo scrub_out($plugin->_plugin->name);
?>
</td>
<td class="cel_description"><?php
echo scrub_out($plugin->_plugin->description);
?>
</td>
<td class="cel_version"><?php
echo scrub_out($plugin->_plugin->version);
?>
</td>
<td class="cel_iversion"><?php
echo scrub_out($installed_version);
?>
</td>
<td class="cel_action"><?php
echo $action;
?>
</td>
</tr>
<?php
}
if (!count($plugins)) {
?>
<tr class="<?php
echo UI::flip_class();
?>
">
示例13: get
/**
* get_songs
* This functions returns an array containing information about
* the songs that MPD currently has in its playlist. This must be
* done in a standardized fashion
*/
public function get()
{
// If we don't have the playlist yet, pull it
if (!isset($this->_mpd->playlist)) {
$this->_mpd->RefreshInfo();
}
/* Get the Current Playlist */
$playlist = $this->_mpd->playlist;
foreach ($playlist as $entry) {
$data = array();
/* Required Elements */
$data['id'] = $entry['Pos'];
$data['raw'] = $entry['file'];
$url_data = $this->parse_url($entry['file']);
switch ($url_data['primary_key']) {
case 'oid':
$data['oid'] = $url_data['oid'];
$song = new Song($data['oid']);
$song->format();
$data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;
$data['link'] = $song->f_link;
break;
case 'demo_id':
$democratic = new Democratic($url_data['demo_id']);
$data['name'] = T_('Democratic') . ' - ' . $democratic->name;
$data['link'] = '';
break;
case 'random':
$data['name'] = T_('Random') . ' - ' . scrub_out(ucfirst($url_data['type']));
$data['link'] = '';
break;
default:
/* If we don't know it, look up by filename */
$filename = Dba::escape($entry['file']);
$sql = "SELECT `id`,'song' AS `type` FROM `song` WHERE `file` LIKE '%{$filename}' " . "UNION ALL " . "SELECT `id`,'live_stream' AS `type` FROM `live_stream` WHERE `url`='{$filename}' ";
$db_results = Dba::read($sql);
if ($row = Dba::fetch_assoc($db_results)) {
$media = new $row['type']($row['id']);
$media->format();
switch ($row['type']) {
case 'song':
$data['name'] = $media->f_title . ' - ' . $media->f_album . ' - ' . $media->f_artist;
$data['link'] = $media->f_link;
break;
case 'live_stream':
$frequency = $media->frequency ? '[' . $media->frequency . ']' : '';
$site_url = $media->site_url ? '(' . $media->site_url . ')' : '';
$data['name'] = "{$media->name} {$frequency} {$site_url}";
$data['link'] = $media->site_url;
break;
}
// end switch on type
} else {
$data['name'] = T_('Unknown');
$data['link'] = '';
}
break;
}
// end switch on primary key type
/* Optional Elements */
$data['track'] = $entry['Pos'] + 1;
$results[] = $data;
}
// foreach playlist items
return $results;
}
示例14: show_playlist_select
/**
* show_playlist_select
* This one is for playlists!
*/
function show_playlist_select($name, $selected = '', $style = '')
{
echo "<select name=\"{$name}\" style=\"{$style}\">\n";
echo "\t<option value=\"\">" . T_('None') . "</option>\n";
$sql = "SELECT `id`,`name` FROM `playlist` ORDER BY `name`";
$db_results = Dba::read($sql);
$nb_items = Dba::num_rows($db_results);
$index = 1;
$already_selected = false;
while ($row = Dba::fetch_assoc($db_results)) {
$select_txt = '';
if (!$already_selected && ($row['id'] == $selected || $index == $nb_items)) {
$select_txt = 'selected="selected"';
$already_selected = true;
}
echo "\t<option value=\"" . $row['id'] . "\" {$select_txt}>" . scrub_out($row['name']) . "</option>\n";
++$index;
}
// end while users
echo "</select>\n";
}
示例15: T_
<td class="edit_dialog_content_header"><?php
echo T_('Name');
?>
</td>
<td><input type="text" name="name" value="<?php
echo scrub_out($libitem->name);
?>
" autofocus /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php
echo T_('Description');
?>
</td>
<td><input type="text" name="description" value="<?php
echo scrub_out($libitem->description);
?>
" /></td>
</tr>
<tr>
<td class="edit_dialog_content_header"></td>
<td><input type="checkbox" name="private" value="1" <?php
echo $libitem->is_private ? 'checked' : '';
?>
/> <?php
echo T_('Authentication Required');
?>
</td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php