当前位置: 首页>>代码示例>>PHP>>正文


PHP Misc::display_array方法代码示例

本文整理汇总了PHP中Misc::display_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::display_array方法的具体用法?PHP Misc::display_array怎么用?PHP Misc::display_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Misc的用法示例。


在下文中一共展示了Misc::display_array方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: explode

    ?>
						</td>
					</tr>
<?php 
}
if ($ExtraIDs) {
    ?>
					<tr>
						<td class="label">Relevant other torrents:</td>
						<td colspan="3">
<?php 
    $First = true;
    $Extras = explode(' ', $ExtraIDs);
    foreach ($Extras as $ExtraID) {
        $DB->query("\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\ttg.Name,\n\t\t\t\t\t\t\t\t\ttg.ID,\n\t\t\t\t\t\t\t\t\tCASE COUNT(ta.GroupID)\n\t\t\t\t\t\t\t\t\t\tWHEN 1 THEN aa.ArtistID\n\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN '0'\n\t\t\t\t\t\t\t\t\t\tELSE '0'\n\t\t\t\t\t\t\t\t\tEND AS ArtistID,\n\t\t\t\t\t\t\t\t\tCASE COUNT(ta.GroupID)\n\t\t\t\t\t\t\t\t\t\tWHEN 1 THEN aa.Name\n\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN ''\n\t\t\t\t\t\t\t\t\t\tELSE 'Various Artists'\n\t\t\t\t\t\t\t\t\tEND AS ArtistName,\n\t\t\t\t\t\t\t\t\ttg.Year,\n\t\t\t\t\t\t\t\t\tt.Time,\n\t\t\t\t\t\t\t\t\tt.Remastered,\n\t\t\t\t\t\t\t\t\tt.RemasterTitle,\n\t\t\t\t\t\t\t\t\tt.RemasterYear,\n\t\t\t\t\t\t\t\t\tt.Media,\n\t\t\t\t\t\t\t\t\tt.Format,\n\t\t\t\t\t\t\t\t\tt.Encoding,\n\t\t\t\t\t\t\t\t\tt.Size,\n\t\t\t\t\t\t\t\t\tt.HasCue,\n\t\t\t\t\t\t\t\t\tt.HasLog,\n\t\t\t\t\t\t\t\t\tt.LogScore,\n\t\t\t\t\t\t\t\t\tt.UserID AS UploaderID,\n\t\t\t\t\t\t\t\t\tuploader.Username\n\t\t\t\t\t\t\t\tFROM torrents AS t\n\t\t\t\t\t\t\t\t\tLEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID\n\t\t\t\t\t\t\t\t\tLEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID AND ta.Importance = '1'\n\t\t\t\t\t\t\t\t\tLEFT JOIN artists_alias AS aa ON aa.AliasID = ta.AliasID\n\t\t\t\t\t\t\t\t\tLEFT JOIN users_main AS uploader ON uploader.ID = t.UserID\n\t\t\t\t\t\t\t\tWHERE t.ID = '{$ExtraID}'\n\t\t\t\t\t\t\t\tGROUP BY tg.ID");
        list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime, $ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
        if ($ExtraGroupName) {
            $ExtraRemasterDisplayString = Reports::format_reports_remaster_info($ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear);
            if ($ArtistID == 0 && empty($ArtistName)) {
                $ExtraLinkName = "<a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid={$ExtraID}&amp;groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)';
            } elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
                $ExtraLinkName = "Various Artists - <a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid={$ExtraID}&amp;groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)';
            } else {
                $ExtraLinkName = "<a href=\"artist.php?id={$ExtraArtistID}\">{$ExtraArtistName}</a> - <a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid={$ExtraID}&amp;groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)';
            }
            ?>
								<?php 
            echo $First ? '' : '<br />';
            ?>
								<?php 
            echo $ExtraLinkName;
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:ajax_new_report.php

示例2: to_array

 function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true)
 {
     $Return = array();
     while ($Row = mysqli_fetch_array($this->QueryID, $Type)) {
         if ($Escape !== false) {
             $Row = Misc::display_array($Row, $Escape);
         }
         if ($Key !== false) {
             $Return[$Row[$Key]] = $Row;
         } else {
             $Return[] = $Row;
         }
     }
     mysqli_data_seek($this->QueryID, 0);
     return $Return;
 }
开发者ID:Kufirc,项目名称:Gazelle,代码行数:16,代码来源:mysql.class.php

示例3: audiobook_form

    function audiobook_form()
    {
        $Torrent = $this->Torrent;
        ?>
		<table cellpadding="3" cellspacing="1" border="0" class="layout border slice" width="100%">
<?php 
        if ($this->NewTorrent) {
            ?>
			<tr id="title_tr">
				<td class="label">Author - Title:</td>
				<td>
					<input type="text" id="title" name="title" size="60" value="<?php 
            echo display_str($Torrent['Title']);
            ?>
" />
					<p class="min_padding">Should only include the author if applicable.</p>
				</td>
			</tr>
<?php 
        }
        ?>
			<tr id="year_tr">
				<td class="label">Year:</td>
				<td><input type="text" id="year" name="year" size="5" value="<?php 
        echo display_str($Torrent['Year']);
        ?>
" /></td>
			</tr>
			<tr>
				<td class="label">Format:</td>
				<td>
					<select name="format" onchange="Format()">
						<option value="">---</option>
<?php 
        foreach (Misc::display_array($this->Formats) as $Format) {
            echo "\t\t\t\t\t\t<option value=\"{$Format}\"";
            if ($Format == $Torrent['Format']) {
                echo ' selected="selected"';
            }
            echo '>';
            echo $Format;
            echo "</option>\n";
        }
        ?>
					</select>
				</td>
			</tr>
			<tr>
				<td class="label">Bitrate:</td>
				<td>
					<select id="bitrate" name="bitrate" onchange="Bitrate()">
						<option value="">---</option>
<?php 
        if (!$Torrent['Bitrate'] || $Torrent['Bitrate'] && !in_array($Torrent['Bitrate'], $this->Bitrates)) {
            $OtherBitrate = true;
            if (substr($Torrent['Bitrate'], strlen($Torrent['Bitrate']) - strlen(' (VBR)')) == ' (VBR)') {
                $Torrent['Bitrate'] = substr($Torrent['Bitrate'], 0, strlen($Torrent['Bitrate']) - 6);
                $VBR = true;
            }
        } else {
            $OtherBitrate = false;
        }
        foreach (Misc::display_array($this->Bitrates) as $Bitrate) {
            echo "\t\t\t\t\t\t<option value=\"{$Bitrate}\"";
            if ($Bitrate == $Torrent['Bitrate'] || $OtherBitrate && $Bitrate == 'Other') {
                echo ' selected="selected"';
            }
            echo '>';
            echo $Bitrate;
            echo "</option>\n";
        }
        ?>
					</select>
					<span id="other_bitrate_span"<?php 
        if (!$OtherBitrate) {
            echo ' class="hidden"';
        }
        ?>
>
						<input type="text" name="other_bitrate" size="5" id="other_bitrate"<?php 
        if ($OtherBitrate) {
            echo ' value="' . display_str($Torrent['Bitrate']) . '"';
        }
        ?>
 onchange="AltBitrate()" />
						<input type="checkbox" id="vbr" name="vbr"<?php 
        if (isset($VBR)) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="vbr"> (VBR)</label>
					</span>
				</td>
			</tr>
<?php 
        if ($this->NewTorrent) {
            ?>
			<tr>
				<td class="label">Tags:</td>
				<td>
//.........这里部分代码省略.........
开发者ID:Kufirc,项目名称:Gazelle,代码行数:101,代码来源:torrent_form.class.php

示例4: foreach

<?php 
$GenreTags = $Cache->get_value('genre_tags');
if (!$GenreTags) {
    $DB->query('
			SELECT Name
			FROM tags
			WHERE TagType = \'genre\'
			ORDER BY Name');
    $GenreTags = $DB->collect('Name');
    $Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
}
?>
						<select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;">
							<option>---</option>
<?php 
foreach (Misc::display_array($GenreTags) as $Genre) {
    ?>
							<option value="<?php 
    echo $Genre;
    ?>
"><?php 
    echo $Genre;
    ?>
</option>
<?php 
}
?>
						</select>
						<input type="text" id="tags" name="tags" size="45" value="<?php 
echo !empty($Tags) ? display_str($Tags) : '';
?>
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:new_edit.php


注:本文中的Misc::display_array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。