本文整理匯總了PHP中Gallery::randompic方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::randompic方法的具體用法?PHP Gallery::randompic怎麽用?PHP Gallery::randompic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::randompic方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: while
<tr bgcolor="' . $bgcat . '">
<td width="100"> </td>
<td width="100"><b>' . $_language->module['date'] . '</b></td>
<td><b>' . $_language->module['name'] . '</b></td>
<td width="80"><b>' . $_language->module['pictures'] . '</b></td>
</tr>';
if ($usergalleries) {
if (mysql_num_rows($galleries)) {
$n = 1;
while ($ds = mysql_fetch_array($galleries)) {
$n % 2 ? $bg = BG_1 : ($bg = BG_2);
$piccount = mysql_num_rows(safe_query("SELECT * FROM " . PREFIX . "gallery_pictures WHERE galleryID='" . $ds['galleryID'] . "'"));
$commentcount = mysql_num_rows(safe_query("SELECT * FROM " . PREFIX . "comments WHERE parentID='" . $ds['galleryID'] . "' AND type='ga'"));
$gallery['date'] = date("d.m.Y", $ds['date']);
$gallery['title'] = cleartext($ds['name']);
$gallery['picture'] = $galclass->randompic($ds['galleryID']);
$gallery['galleryID'] = $ds['galleryID'];
$gallery['count'] = mysql_num_rows(safe_query("SELECT picID FROM `" . PREFIX . "gallery_pictures` WHERE galleryID='" . $ds['galleryID'] . "'"));
eval("\$profile = \"" . gettemplate("profile_galleries") . "\";");
echo $profile;
$n++;
}
} else {
echo '<tr>
<td colspan="4" bgcolor="' . BG_1 . '">' . $_language->module['no_galleries'] . '</td>
</tr>';
}
} else {
echo '<tr>
<td colspan="4" bgcolor="' . BG_1 . '">' . $_language->module['usergalleries_disabled'] . '</td>
</tr>';
示例2: eval
} else {
echo '</tr><tr>';
}
$i++;
}
echo '<td> </td></tr>';
eval("\$gallery = \"" . gettemplate("gallery_group_foot") . "\";");
echo $gallery;
} else {
$_language->read_module('gallery');
$galclass = new Gallery();
eval("\$gallery = \"" . gettemplate("title_gallery") . "\";");
echo $gallery;
//latest gallery
$ds = mysql_fetch_array(safe_query("SELECT galleryID FROM " . PREFIX . "gallery WHERE userID='0' ORDER BY galleryID DESC LIMIT 0, 1"));
$latest = $galclass->showthumb($galclass->randompic($ds['galleryID']));
//random
$random = $galclass->showthumb($galclass->randompic());
//top comments
$ds = mysql_fetch_array(safe_query("SELECT parentID, COUNT(parentID) as max FROM " . PREFIX . "comments WHERE type='ga' GROUP BY parentID ORDER BY max DESC LIMIT 0, 1"));
if (!$ds['parentID']) {
$ds['parentID'] = $galclass->randompic();
}
$most_comments = $galclass->showthumb($ds['parentID']);
$bg1 = BG_1;
$bg2 = BG_2;
eval("\$gallery = \"" . gettemplate("gallery_content_head") . "\";");
echo $gallery;
$ergebnis = safe_query("SELECT * FROM " . PREFIX . "gallery_groups ORDER BY sort");
while ($ds = mysql_fetch_array($ergebnis)) {
$groupID = $ds['groupID'];
示例3: array
$title = $ds['name'];
if (mb_strlen($title) > 65) {
$title = mb_substr($title, 0, 65);
$title .= '...';
}
$gallerys = mysql_num_rows(safe_query("SELECT galleryID FROM " . PREFIX . "gallery WHERE galleryID='" . $ds['galleryID'] . "'"));
$pics = mysql_num_rows(safe_query("SELECT picID FROM " . PREFIX . "gallery as gal, " . PREFIX . "gallery_pictures as pic WHERE gal.galleryID='" . $ds['galleryID'] . "' AND gal.galleryID=pic.galleryID"));
$gallery = mysql_fetch_array(safe_query("SELECT * FROM " . PREFIX . "gallery WHERE galleryID='" . $ds['galleryID'] . "' ORDER BY galleryID DESC LIMIT 0,5"));
//Datum ausgabe
$monate = array(1 => "Januar", 2 => "Februar", 3 => "März", 4 => "April", 5 => "Mai", 6 => "Juni", 7 => "Juli", 8 => "August", 9 => "September", 10 => "Oktober", 11 => "November", 12 => "Dezember");
$monat = date("n", $gallery['date']);
$day = date("d.", $gallery['date']);
$ger_monat = $monate[$monat];
$year = date("Y", $gallery['date']);
//Datum ausgabe ende
$gallery['picID'] = $galclass->randompic($gallery['galleryID']);
//Bilder ausgabe thumb
$dir = 'images/gallery/';
$gallery['pic'] = $dir . 'thumb/' . $gallery['picID'] . '.jpg';
//Bilder ausgabe thumb ende
//views ausgabe geht leider nur von einem pic,
$views = safe_query("SELECT * FROM " . PREFIX . "gallery_pictures WHERE galleryID='" . $gallery['galleryID'] . "'");
if (mysql_num_rows($views)) {
$view = array();
while ($ds = mysql_fetch_array($views)) {
$view[] = $ds['views'];
}
$views = array_sum($view);
}
//views ausgabe ende
eval("\$sc_gallery = \"" . gettemplate("sm_gallery") . "\";");
示例4: Clanpackage
/*
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Free Content / Management System #
# / #
# #
# #
# Copyright 2005-2011 by webspell.org #
# #
# visit webSPELL.org, webspell.info to get webSPELL for free #
# - Script runs under the GNU GENERAL PUBLIC LICENSE #
# - It's NOT allowed to remove this copyright-tag #
# -- http://www.fsf.org/licensing/licenses/gpl.html #
# #
# Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
# Far Development by Development Team - webspell.org #
# #
# visit webspell.org #
# #
##########################################################################
*/
$galclass = new Gallery();
$_language->read_module('sc_potm');
$randomid = $galclass->randompic();
if ($randomid) {
echo '<a href="index.php?site=gallery&picID=' . $randomid . '"><img src="images/gallery/thumb/' . $randomid . '.jpg" border="0" alt="' . $_language->module['random_picture'] . '" /></a>';
}