本文整理汇总了PHP中_or函数的典型用法代码示例。如果您正苦于以下问题:PHP _or函数的具体用法?PHP _or怎么用?PHP _or使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_or函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($host, $port = null)
{
$this->host = $host;
$this->ip = _or(setting('BackendServerIP', $this->host), $host);
// If the IP contains a ':' It's likely an IPv6 address so enclose it in '[]'
if (strpos($this->ip, ":") > 0) {
$this->ip = "[" . $this->ip . "]";
}
$this->port = _or($port, _or(setting('BackendServerPort', $this->host), 6543));
$this->port_http = _or(setting('BackendStatusPort', $this->host), _or(setting('BackendStatusPort'), 6544));
}
示例2: _or
// Set things as the user requested
$schedule->profile = $_POST['profile'];
$schedule->recgroup = $_POST['recgroup'];
$schedule->storagegroup = $_POST['storagegroup'];
$schedule->playgroup = $_POST['playgroup'];
$schedule->autoexpire = $_POST['autoexpire'] ? 1 : 0;
$schedule->autocommflag = $_POST['autocommflag'] ? 1 : 0;
$schedule->autouserjob1 = $_POST['autouserjob1'] ? 1 : 0;
$schedule->autouserjob2 = $_POST['autouserjob2'] ? 1 : 0;
$schedule->autouserjob3 = $_POST['autouserjob3'] ? 1 : 0;
$schedule->autouserjob4 = $_POST['autouserjob4'] ? 1 : 0;
$schedule->autometadata = $_POST['autometadata'] ? 1 : 0;
$schedule->maxnewest = $_POST['maxnewest'] ? 1 : 0;
$schedule->inactive = $_POST['inactive'] ? 1 : 0;
$schedule->dupin = _or($_POST['dupin'] + $_POST['dupin2'], dupsin_all);
$schedule->dupmethod = _or($_POST['dupmethod'], 6);
$schedule->recpriority = intval($_POST['recpriority']);
$schedule->maxepisodes = intval($_POST['maxepisodes']);
$schedule->startoffset = intval($_POST['startoffset']);
$schedule->endoffset = intval($_POST['endoffset']);
$schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
$schedule->transcoder = $_POST['transcoder'];
$schedule->prefinput = $_POST['prefinput'];
$schedule->inetref = $_POST['inetref'];
$schedule->season = intval($_POST['season']);
$schedule->episode = intval($_POST['episode']);
// Keep track of the parent recording for overrides
if ($_POST['record'] == rectype_override) {
$schedule->parentid = $schedule->recordid;
}
// Search schedules saved here will create a new standard schedule,
示例3: _or
}
echo $schedule->channel->name;
?>
</td>
<td nowrap><?php
echo _or($schedule->profile, ' ');
?>
</td>
<td nowrap>
<?php
global $Transcoders;
echo _or($Transcoders[$schedule->transcoder], ' ');
?>
</td>
<td nowrap><?php
echo _or($schedule->recgroup, ' ');
?>
</td>
<td nowrap><?php
echo $schedule->texttype;
?>
</td>
</tr><?php
$prev_group = $cur_group;
}
?>
</table>
<?php
// Print the page footer
require 'modules/_shared/tmpl/' . tmpl . '/footer.php';
示例4: header
case 'mp3':
$mime = 'audio/mpeg';
break;
case 'ogg':
$mime = 'application/ogg';
break;
case 'm4a':
$mime = 'audio/mp4a-latm';
break;
default:
$mime = 'application/octet-stream';
}
header('Content-Type: ' . $mime);
// Send the filename
header('Content-Disposition: filename="' . $fname . '"');
// Base music path
$basepath = setting('MusicLocation', hostname);
// Local file?
if (file_exists("{$basepath}/{$path}/{$fname}")) {
header('Content-Length: ' . filesize("{$basepath}/{$path}/{$fname}"));
readfile("{$basepath}/{$path}/{$fname}");
} else {
$Master_Host = setting('MasterServerIP');
$port = _or(get_backend_setting('BackendStatusPort', $Master_Host), get_backend_setting('BackendStatusPort'));
if (stripos($Master_Host, ':') !== false) {
$Master_Host = '[' . $Master_Host . ']';
}
readfile("http://{$Master_Host}:{$port}/{$xml_command}?Id=" . $xml_id);
}
// Nothing else to do
exit;
示例5: __construct
public function __construct($data)
{
global $db;
// This is a mythbackend-formatted program - info about this data structure is stored in libs/libmyth/programinfo.cpp
if (!isset($data['chanid']) && isset($data[0])) {
// Load the remaining info we got from mythbackend
$this->title = trim($data[0]);
# program name/title
$this->subtitle = $data[1];
# episode name
$this->description = $data[2];
# episode description
$this->season = $data[3];
$this->episode = $data[4];
$this->total_episodes = $data[5];
$this->syndicatedepisodenumber = $data[6];
$this->category = $data[7];
$this->chanid = $data[8];
# mysql chanid
$this->channum = $data[9];
$this->callsign = $data[10];
$this->channame = $data[11];
$this->filename = $data[12];
$this->filesize = $data[13];
$this->starttime = $data[14];
# show start-time
$this->endtime = $data[15];
# show end-time
$this->findid = $data[16];
$this->hostname = $data[17];
$this->sourceid = $data[18];
$this->cardid = $data[19];
$this->inputid = $data[20];
$this->recpriority = $data[21];
$this->recstatus = $data[22];
$this->recordid = $data[23];
$this->rectype = $data[24];
$this->dupin = $data[25];
$this->dupmethod = $data[26];
$this->recstartts = $data[27];
# ACTUAL start time (also maps to recorded.starttime)
$this->recendts = $data[28];
# ACTUAL end time
$this->progflags = $data[29];
$this->recgroup = $data[30];
$this->outputfilters = $data[31];
$this->seriesid = $data[32];
$this->programid = $data[33];
$this->inetref = $data[34];
$this->lastmodified = $data[35];
$this->stars = $data[36];
$this->airdate = $data[37];
$this->playgroup = $data[38];
$this->recpriority2 = $data[39];
$this->parentid = $data[40];
$this->storagegroup = $data[41];
$this->audioproperties = $data[42];
$this->videoproperties = $data[43];
$this->subtitletype = $data[44];
$this->year = $data[45];
$this->partnumber = $data[46];
$this->parttotal = $data[47];
$this->category_type = $data[48];
$this->recordedid = $data[49];
// Is this a previously-recorded program?
if (!empty($this->filename)) {
$this->url = video_url($this);
// get download info
}
// Assign the program flags
$this->has_commflag = $this->progflags & 0x1 ? true : false;
// FL_COMMFLAG = 0x00000001
$this->has_cutlist = $this->progflags & 0x2 ? true : false;
// FL_CUTLIST = 0x00000002
$this->auto_expire = $this->progflags & 0x4 ? true : false;
// FL_AUTOEXP = 0x00000004
$this->is_editing = $this->progflags & 0x8 ? true : false;
// FL_EDITING = 0x00000008
$this->bookmark = $this->progflags & 0x10 ? true : false;
// FL_BOOKMARK = 0x00000010
$this->is_recording = $this->progflags & 0x100000 ? true : false;
// FL_INUSERECORDING = 0x00100000
$this->is_playing = $this->progflags & 0x200000 ? true : false;
// FL_INUSEPLAYING = 0x00200000
$this->is_transcoded = $this->progflags & 0x100 ? true : false;
// FL_TRANSCODED = 0x00000100
$this->is_watched = $this->progflags & 0x200 ? true : false;
// FL_WATCHED = 0x00000200
// Can be deleted?
$this->can_delete = !$this->is_recording && !$this->is_playing || $this->recgroup != 'LiveTV';
// Add a generic "will record" variable, too
$this->will_record = $this->rectype && $this->rectype != rectype_dontrec ? true : false;
} else {
if (in_array($data['airdate'], array('0000-00-00', '0000', '1900-01-01'))) {
$this->airdate = $data['originalairdate'];
} else {
$this->airdate = $data['airdate'];
}
$this->category = _or($data['category'], t('Unknown'));
$this->category_type = _or($data['category_type'], t('Unknown'));
//.........这里部分代码省略.........
示例6: custom_error
.' create a symlink to your Coverart storage directory at'
.' data/video_covers in order to use the video artwork portions'
.' of MythWeb.');
}
$ret = @symlink($artwork_dir, 'data/video_covers');
if (!$ret) {
custom_error("Could not create a symlink to $dir, the local MythVideo artwork"
.' directory for this hostname ('.hostname.'). Please create a'
.' symlink to your MythVideo directory at data/video_covers in order to'
.' use the video artwork portions of MythWeb.');
}
}
}
*/
define('video_img_height', _or(setting('web_video_thumbnail_height', hostname), 140));
define('video_img_width', _or(setting('web_video_thumbnail_width', hostname), 94));
// Load a custom page
switch ($Path[1]) {
case 'edit':
require_once 'modules/video/edit.php';
exit;
//// this is probably doing bad things
// case 'imdb':
// require_once 'modules/video/imdb.php';
// exit;
//// this is broken, so disable it
// case 'scan':
// require_once 'modules/video/scan.php';
// exit;
//// new stuff
//// this is probably doing bad things
示例7: _or
?>
</td>
<td class="x-type"><?php
echo $schedule->texttype;
?>
</td>
<td class="x-sgroup"><?php
echo _or($schedule->storagegroup, ' ');
?>
</td>
<td class="x-startoffset"><?php
echo _or($schedule->startoffset, ' ');
?>
</td>
<td class="x-endoffset"><?php
echo _or($schedule->endoffset, ' ');
?>
</td>
<td class="x-lastrec"><?php
echo _or($schedule->last_record, ' ');
?>
</td>
</tr><?php
$prev_group = $cur_group;
}
?>
</table>
<?php
// Print the page footer
require 'modules/_shared/tmpl/' . tmpl . '/footer.php';
示例8: _or
<td class="small tv_Unknown" colspan="<?php
echo _or($timeslots_used, 1);
?>
" valign="top"><?php
echo t('NO DATA');
?>
</td>
示例9: html_entities
<td><input type="text" name="vbitrate"
size="5" title="Video Bitrate"
value="<?php
echo html_entities(_or(setting('WebFLV_vb'), 256));
?>
" />
kbps</td>
</tr><tr>
<th><?php
echo t('Audio Bitrate');
?>
:</th>
<td><input type="text" name="abitrate"
size="5" title="Audio Bitrate"
value="<?php
echo html_entities(_or(setting('WebFLV_ab'), 64));
?>
" />
kbps</td>
</tr><tr>
<td align="right"><input type="reset" class="submit" value="<?php
echo t('Reset');
?>
"></td>
<td align="center"><input type="submit" class="submit" name="save" value="<?php
echo t('Save');
?>
"></td>
</tr>
</table>
示例10: _or
}
#path {
position: relative;
padding: 1em;
float: left;
background-color: #102923;
margin-top: 1em;
margin-left: 1em;
border: 1px solid black;
min-width: <?php
echo _or(setting('web_video_thumbnail_width', hostname), 96) + 106;
?>
px;
min-height: <?php
echo _or(setting('web_video_thumbnail_height', hostname), 140) + 28;
?>
px;
}
#path .active {
color: yellow;
}
#window {
position: fixed;
left: 35%;
right: 35%;
width: 30%;
top: 35%;
background-color: green;
示例11: details_list
//.........这里部分代码省略.........
if (preg_match('/\\S/', $this->subtitle)) {
$str .= "\t<dt>" . t('Subtitle') . ":</dt>\n" . "\t<dd>" . html_entities($this->subtitle) . "</dd>\n";
}
// Description
if (preg_match('/\\S/', $this->description)) {
$str .= "\t<dt>" . t('Description') . ":</dt>\n" . "\t<dd>" . nl2br(html_entities($this->description)) . "</dd>\n";
}
// Rating
if (preg_match('/\\S/', $this->rating)) {
$str .= "\t<dt>" . t('Rating') . ":</dt>\n" . "\t<dd>" . html_entities($this->rating) . "</dd>\n";
}
}
// Category
if (preg_match('/\\S/', $this->category)) {
$str .= "\t<dt>" . t('Category') . ":</dt>\n" . "\t<dd>" . html_entities($this->category) . "</dd>\n";
}
// Rerun?
if (!empty($this->previouslyshown)) {
$str .= "\t<dt>" . t('Repeat') . ":</dt>\n" . "\t<dd>" . t('Yes') . "</dd>\n";
}
// Will be recorded at some point in the future?
if (!empty($this->will_record)) {
$str .= "\t<dt>" . t('Schedule') . ":</dt>\n" . "\t<dd>";
switch ($this->type) {
case rectype_once:
$str .= t('rectype-long: once');
break;
case rectype_daily:
$str .= t('rectype-long: daily');
break;
case rectype_always:
$str .= t('rectype-long: always');
break;
case rectype_weekly:
$str .= t('rectype-long: weekly');
break;
case rectype_findone:
$str .= t('rectype-long: findone');
break;
case rectype_override:
$str .= t('rectype-long: override');
break;
case rectype_dontrec:
$str .= t('rectype-long: dontrec');
break;
default:
$str .= t('Unknown');
}
$str .= "</dd>\n";
}
// Which duplicate-checking method will be used
if ($this->dupmethod > 0) {
$str .= "\t<dt>" . t('Dup Method') . ":</dt>\n" . "\t<dd>";
switch ($this->dupmethod) {
case 1:
$str .= t('None');
break;
case 2:
$str .= t('Subtitle');
break;
case 4:
$str .= t('Description');
break;
case 6:
$str .= t('Subtitle and Description');
break;
case 8:
$str .= t('Subtitle then Description');
break;
case 22:
$str .= t('Sub and Desc (Empty matches)');
break;
}
$str .= "</dd>\n";
}
// Recording Priority
if (preg_match('/\\S/', $this->recpriority)) {
$str .= "\t<dt>" . t('Recording Priority') . ":</dt>\n" . "\t<dd>" . html_entities($this->recpriority) . "</dd>\n";
}
// Profile
if (preg_match('/\\S/', $this->profile)) {
$str .= "\t<dt>" . t('Profile') . ":</dt>\n" . "\t<dd>" . html_entities($this->profile) . "</dd>\n";
}
// Transcoder
if (preg_match('/\\S/', $this->transcoder)) {
global $Transcoders;
$str .= "\t<dt>" . t('Transcoder') . ":</dt>\n" . "\t<dd>" . html_entities(_or($Transcoders[$this->transcoder], ' ')) . "</dd>\n";
}
// Recording Group
if (!empty($this->recgroup)) {
$str .= "\t<dt>" . t('Recording Group') . ":</dt>\n" . "\t<dd>" . html_entities($this->recgroup) . "</dd>\n";
}
// Storage Group
if (!empty($this->storagegroup)) {
$str .= "\t<dt>" . t('Storage Group') . ":</dt>\n" . "\t<dd>" . html_entities($this->storagegroup) . "</dd>\n";
}
// Finish off the table and return
$str .= "\n</dl>";
return $str;
}
示例12: _or
if (isset($_REQUEST['RESET_TMPL'])) {
$tmpl = _or($_REQUEST['RESET_TMPL'], 'default');
} elseif (isset($_REQUEST['RESET_TEMPLATE'])) {
$tmpl = _or($_REQUEST['RESET_TEMPLATE'], 'default');
} elseif (isMobileUser()) {
$tmpl = 'wap';
} elseif (preg_match('/^(Lynx|ELinks)/i', $_SERVER['HTTP_USER_AGENT'])) {
$tmpl = 'lite';
}
if (!file_exists(modules_path . '/_shared/tmpl/' . $tmpl . '/welcome.php')) {
$tmpl = 'default';
}
// Figure out the skin
$skin = $_SESSION['skin'];
if (isset($_REQUEST['RESET_SKIN'])) {
$skin = _or($_REQUEST['RESET_SKIN'], 'default');
} elseif (isMobileUser()) {
$skin = 'wap';
}
if (!file_exists('skins/' . $skin . '/img/')) {
$skin = 'default';
}
// We do want to over-ride the template for some paths.
// We do this after setting because certain templates
// Should never be stored as the normal end-user view
if ($Path[0] == 'rss' || $Path[0] == 'ical') {
$tmpl = $Path[0];
}
// And now we define the paths
define('skin', $skin);
define('skin_url', root_url . 'skins/' . skin . '/');
示例13: _or
tv/channel/<?php
echo $channel->chanid, '/', $program->starttime;
?>
">
<?php
if ($_SESSION["show_channel_icons"] == true && !empty($channel->icon)) {
?>
<img src="<?php
echo $channel->icon;
?>
" height="30" width="30"></a>
<?php
}
?>
<span class="preferred"><?php
echo _or($_SESSION["prefer_channum"] ? $channel->channum : $channel->callsign, ' ');
?>
</span><br />
<?php
echo ($_SESSION["prefer_channum"] ? $channel->callsign : $channel->channum) . "\n";
?>
</a>
</div>
<?php
}
?>
<div id="program_title">
<h1>
<a href="<?php
echo root_url;
?>
示例14: t
<td><?php
echo t('web_video_thumbnail_width');
?>
:</td>
<td><input type="text" name="web_video_thumbnail_width" size="60" value="<?php
echo _or(setting('web_video_thumbnail_width', $_SESSION['settings']['host']), 94);
?>
"></td>
</tr>
<tr>
<td><?php
echo t('web_video_thumbnail_height');
?>
:</td>
<td><input type="text" name="web_video_thumbnail_height" size="60" value="<?php
echo _or(setting('web_video_thumbnail_height', $_SESSION['settings']['host']), 140);
?>
"></td>
</tr>
<tr>
<td><?php
echo t('Default MythVideo View');
?>
:</td>
<td><input type="text" name="DefaultMythVideoView" size="60" value="<?php
echo setting('Default MythVideo View', $_SESSION['settings']['host']);
?>
"></td>
</tr>
<tr>
示例15: array
// Load all of the known mythtv hosts
$Settings_Hosts = array('' => '- ' . t('All Hosts') . ' -');
$sh = $db->query('SELECT DISTINCT hostname FROM settings ORDER BY hostname');
while (list($host) = $sh->fetch_row()) {
if (empty($host)) {
continue;
}
$Settings_Hosts[$host] = $host;
}
$sh->finish();
// Make sure we have a valid host selected
if (!isset($Settings_Hosts[$_SESSION['settings']['host']])) {
$_SESSION['settings']['host'] = reset(array_keys($Settings_Hosts));
} elseif ($_POST['save'] && isset($_POST['host'])) {
foreach ($_POST['settings'] as $value => $data) {
setting($value, _or($_POST['host'], null), $data);
}
if (is_array($_POST['delete'])) {
foreach ($_POST['delete'] as $value => $data) {
if (!$data) {
continue;
}
if (empty($_POST['host'])) {
$sh = $db->query('DELETE FROM settings
WHERE value=? AND hostname IS NULL', $value);
} else {
$sh = $db->query('DELETE FROM settings
WHERE value=? AND hostname=?', $value, $_POST['host']);
}
}
}