本文整理汇总了PHP中resourceLink函数的典型用法代码示例。如果您正苦于以下问题:PHP resourceLink函数的具体用法?PHP resourceLink怎么用?PHP resourceLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resourceLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRankHtml
function getRankHtml($rankset, $rank)
{
$text = htmlspecialchars($rank["text"]);
if ($rank["image"] == "") {
return $text;
}
$img = htmlspecialchars(resourceLink("ranksets/" . $rankset . "/" . $rank["image"]));
return "<img src=\"{$img}\" alt=\"\" /> {$text}";
}
示例2: getRankHtml
function getRankHtml($rankset, $rank)
{
$text = htmlspecialchars($rank["text"]);
$img = '';
if ($rank['image']) {
$img = htmlspecialchars(resourceLink("ranksets/" . $rankset . "/" . $rank["image"]));
$img = "<img src=\"{$img}\" alt=\"\" /><br>";
}
return $img . $text;
}
示例3: loadSmilies
function loadSmilies()
{
global $smilies, $smiliesReplaceOrig, $smiliesReplaceNew;
$rSmilies = Query("select * from {smilies} order by length(code) desc");
$smilies = array();
while ($smiley = Fetch($rSmilies)) {
$smilies[] = $smiley;
}
$smiliesReplaceOrig = $smiliesReplaceNew = array();
foreach ($smilies as $smile) {
$smiliesReplaceOrig[$smile['code'][0]][] = '/\\G(?<!\\w)' . preg_quote($smile['code'], "/") . '(?![\\w\\/])/';
$smiliesReplaceNew[$smile['code'][0]][] = resourceLink("img/smilies/" . $smile['image']);
}
}
示例4: loadSmilies
function loadSmilies()
{
global $smilies, $smiliesReplaceOrig, $smiliesReplaceNew;
$rSmilies = Query("select * from {smilies} order by length(code) desc");
$smilies = array();
while ($smiley = Fetch($rSmilies)) {
$smilies[] = $smiley;
}
$smiliesReplaceOrig = $smiliesReplaceNew = array();
for ($i = 0; $i < count($smilies); $i++) {
$smiliesReplaceOrig[] = "/(?<!\\w)" . preg_quote($smilies[$i]['code'], "/") . "(?!\\w)/";
$smiliesReplaceNew[] = "<img class=\"smiley\" alt=\"\" src=\"" . resourceLink("img/smilies/" . $smilies[$i]['image']) . "\" />";
}
}
示例5: Fatal_Error
function Fatal_Error($msg, $documentationURL = '')
{
if ($GLOBALS['commandline']) {
@ob_end_clean();
print "\n" . $GLOBALS["I18N"]->get("fatalerror") . ": " . strip_tags($msg) . "\n";
@ob_start();
} else {
if (isset($GLOBALS['I18N']) && is_object($GLOBALS['I18N'])) {
print '<div align="center" class="error">' . $GLOBALS["I18N"]->get("fatalerror") . ": {$msg} ";
} else {
print '<div align="center" class="error">' . "Fatal Error: {$msg} ";
}
if (!empty($documentationURL)) {
print resourceLink($documentationURL);
}
print '</div>';
foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
$plugin->processError($msg);
}
}
# include "footer.inc";
# exit;
return 0;
}
示例6: makeBreadcrumbs
makeBreadcrumbs($crumbs);
$rPM = Query("select * from {pmsgs} left join {pmsgs_text} on pid = {pmsgs}.id where " . $whereFrom . " and deleted != {1} order by date desc limit {2u}, {3u}", $user, $deleted, $from, $ppp);
$numonpage = NumRows($rPM);
$pagelinks = PageLinks(actionLink("private", "", "{$show}{$userGet}&from="), $ppp, $from, $total);
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if (NumRows($rPM)) {
while ($pm = Fetch($rPM)) {
$rUser = Query("select * from {users} where id = {0}", isset($_GET['show']) ? $pm['userto'] : $pm['userfrom']);
if (NumRows($rUser)) {
$user = Fetch($rUser);
}
$cellClass = ($cellClass + 1) % 2;
if (!$pm['msgread']) {
$img = "<img src=\"" . resourceLink("img/status/new.png") . "\" alt=\"New!\" />";
} else {
$img = "";
}
$sender = NumRows($rUser) ? UserLink($user) : "_";
$check = $snoop ? "" : "<input type=\"checkbox\" name=\"delete[{2}]\" />";
$delLink = $snoop == "" ? "<sup> " . actionLinkTag("✘", "private", "", "del=" . $pm['id'] . $show . '&token=' . $loguser['token']) . "</sup>" : "";
$pms .= format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t" . $check . "\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t" . actionLinkTag(htmlspecialchars($pm['title']), "showprivate", $pm['id'], $snoop) . "{7}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{6}\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, $img, $pm['id'], $snoop, htmlspecialchars($pm['title']), $sender, formatdate($pm['date']), $delLink);
}
} else {
$pms = format("\n\t\t<tr class=\"cell1\">\n\t\t\t<td colspan=\"6\">\n\t\t\t\t" . __("There are no messages to display.") . "\n\t\t\t</td>\n\t\t</tr>\n");
}
write("\n\t<form method=\"post\" action=\"" . actionLink("private") . "\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 22px;\">\n\t\t\t\t<input type=\"checkbox\" id=\"ca\" onchange=\"checkAll();\" />\n\t\t\t</th>\n\t\t\t<th style=\"width: 22px;\"> </th>\n\t\t\t<th style=\"width: 75%;\">" . __("Title") . "</th>\n\t\t\t<th>{0}</th>\n\t\t\t<th style=\"min-width:120px\">" . __("Date") . "</th>\n\t\t</tr>\n\t\t{1}\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"text-align: right;\" colspan=\"6\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"multidel\" />\n\t\t\t\t<input type=\"hidden\" name=\"token\" value=\"{$loguser['token']}\" />\n\t\t\t\t<a href=\"javascript:void();\" onclick=\"document.forms[1].submit();\">" . __("delete checked") . "</a>\n\t\t\t</th>\n\t\t</tr>\n\t</table>\n\t</font>\n", isset($_GET['show']) ? __("To") : __("From"), $pms);
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
示例7: makeThemeList
}
if ($type == "theme") {
$input = makeThemeList($name, $value);
}
if ($type == "layout") {
$input = makeLayoutList($name, $value);
}
if ($type == "language") {
$input = makeLangList($name, $value);
}
$invalidicon = "";
if ($invalidsettings[$name]) {
$invalidicon = "[INVALID]";
}
if ($help) {
$help = "<img src=\"" . resourceLink("img/icons/icon4.png") . "\" title=\"{$help}\" alt=\"[!]\" />";
}
print "<tr class=\"cell{$class}\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"{$name}\">{$friendlyname}</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{$input}\n\t\t\t\t\t{$help}\n\t\t\t\t\t{$invalidicon}\n\t\t\t\t</td>\n\t\t\t</tr>";
$class = ($class + 1) % 2;
}
print "\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"_exit\" value=\"" . __("Save and Exit") . "\" />\n\t\t\t\t\t<input type=\"submit\" name=\"_action\" value=\"" . __("Save") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{31}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n";
function makeSelect($fieldName, $checkedIndex, $choicesList, $extras = "")
{
$checks[$checkedIndex] = " selected=\"selected\"";
foreach ($choicesList as $key => $val) {
$options .= format("\n\t\t\t\t\t\t<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val);
}
$result = format("\n\t\t\t\t\t<select id=\"{0}\" name=\"{0}\" size=\"1\" {1} >{2}\n\t\t\t\t\t</select>", $fieldName, $extras, $options);
return $result;
}
function prepare($text)
示例8: WriteCategoryEditContents
function WriteCategoryEditContents($cid)
{
global $loguser;
//Get all categories.
$rCats = Query("SELECT * FROM {categories}");
$cats = array();
while ($cat = Fetch($rCats)) {
$cats[$cat['id']] = $cat;
}
if (count($cats) == 0) {
$cats[0] = "No categories";
}
if ($cid != -1) {
$rCategory = Query("SELECT * FROM {categories} WHERE id={0}", $cid);
if (!NumRows($rCategory)) {
Kill("Category not found.");
}
$cat = Fetch($rCategory);
$name = htmlspecialchars($cat['name']);
$corder = $cat['corder'];
$func = "changeCategoryInfo";
$button = __("Save");
$boxtitle = __("Edit Category");
$delbutton = "\n\t\t\t<button onclick='showDeleteForum(); return false;'>\n\t\t\t\t" . __("Delete") . "\n\t\t\t</button>";
} else {
$title = __("New Category");
$corder = 0;
$func = "addCategory";
$button = __("Add");
$boxtitle = __("New Category");
$delbutton = "";
}
echo "<form method=\"post\" id=\"forumform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser["token"] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$cid}\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t{$boxtitle}\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td style=\"width: 25%;\">\n\t\t\t\t" . __("Name") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" style=\"width: 98%;\" name=\"name\" value=\"{$name}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell0\">\n\t\t\t<td>\n\t\t\t\t" . __("Listing order") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" size=\"2\" name=\"corder\" value=\"{$corder}\" />\n\t\t\t\t<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . __("Everything is sorted by listing order first, then by ID. If everything has its listing order set to 0, they will therefore be sorted by ID only.") . "\" alt=\"[?]\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell2\">\n\t\t\t<td>\n\t\t\t\t \n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<button onclick=\"{$func}(); return false;\">\n\t\t\t\t\t{$button}\n\t\t\t\t</button>\n\t\t\t\t{$delbutton}\n\t\t\t</td>\n\t\t</tr>\n\t</table></form>\n\n\t<form method=\"post\" id=\"deleteform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser["token"] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$cid}\">\n\t<div id=\"deleteforum\" style=\"display:none\">\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header1\">\n\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Delete category") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Be careful when deleting categories. Make sure there are no forums in the category before deleting it.") . "\n\t\t\t\t\t<br><br>\n\t\t\t\t\t" . __("If you still want to delete it, click below:") . "\n\t\t\t\t\t<br>\n\t\t\t\t\t<button onclick=\"deleteCategory('delete'); return false;\">\n\t\t\t\t\t\t" . __("Delete category") . "\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t</form>";
}
示例9: setcookie
setcookie("logsession", $sessionID, 0, $boardroot, "", false, true);
Query("INSERT INTO {sessions} (id, user, autoexpire) VALUES ({0}, {1}, {2})", doHash($sessionID . $salt), $user["id"], 0);
redirectAction("board");
}
}
$sexes = array(__("Male"), __("Female"), __("N/A"));
$name = "";
if (isset($_POST["name"])) {
$name = htmlspecialchars($_POST["name"]);
}
$email = "";
if (isset($_POST["email"])) {
$email = htmlspecialchars($_POST["email"]);
}
$sex = 2;
if (isset($_POST["sex"])) {
$sex = validateSex($_POST["sex"]);
}
echo "\n<script src=\"" . resourceLink('js/register.js') . "\"></script>\n<script src=\"" . resourceLink('js/zxcvbn.js') . "\"></script>\n<form action=\"" . actionLink("register") . "\" method=\"post\">\n\t<table class=\"outline margin width50\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t" . __("Register") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"un\">" . __("User name") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell0\">\n\t\t\t\t<input type=\"text\" id=\"un\" name=\"name\" value=\"{$name}\" maxlength=\"20\" style=\"width: 98%;\" class=\"required\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"pw\">" . __("Password") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t<input type=\"password\" id=\"pw\" name=\"pass\" size=\"13\" maxlength=\"32\" class=\"required\" /> / " . __("Repeat:") . " <input type=\"password\" id=\"pw2\" name=\"pass2\" size=\"13\" maxlength=\"32\" class=\"required\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"email\">" . __("Email address") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell0\">\n\t\t\t\t<input type=\"email\" id=\"email\" name=\"email\" value=\"{$email}\" style=\"width: 98%;\" maxlength=\"60\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t" . __("Sex") . "\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t" . MakeOptions("sex", $sex, $sexes) . "\n\t\t\t</td>\n\t\t</tr>";
if ($haveSecurimage) {
echo "\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t" . __("Security") . "\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t<img width=\"200\" height=\"80\" id=\"captcha\" src=\"" . actionLink("captcha", shake()) . "\" alt=\"CAPTCHA Image\" />\n\t\t\t\t<button onclick=\"document.getElementById('captcha').src = '" . actionLink("captcha", shake()) . "?' + Math.random(); return false;\">" . __("New") . "</button><br />\n\t\t\t\t<input type=\"text\" name=\"captcha_code\" size=\"10\" maxlength=\"6\" class=\"required\" />\n\t\t\t</td>\n\t\t</tr>";
}
echo "\n\t\t<tr class=\"cell2\">\n\t\t\t<td></td>\n\t\t\t<td>\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Register") . "\"/>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=\"2\" class=\"cell0 smallFonts\">\n\t\t\t\t" . __("Specifying an email address is not exactly a hard requirement, but it will allow you to reset your password should you forget it. By default, your email is not shown.") . "\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</form>";
function MakeOptions($fieldName, $checkedIndex, $choicesList)
{
$checks[$checkedIndex] = " checked=\"checked\"";
foreach ($choicesList as $key => $val) {
$result .= format("\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />\n\t\t\t\t\t\t{3}\n\t\t\t\t\t</label>", $key, $fieldName, $checks[$key], $val);
}
return $result;
}
示例10: flush
# output some stuff to make sure it's not buffered in the browser, hmm, would be nice to find a better way for this
for ($i = 0; $i < 10000; ++$i) {
print ' ' . "\n";
}
flush();
@ob_end_flush();
}
flush();
}
$dbversion = getConfig('version');
if (!$dbversion) {
$dbversion = 'Older than 1.4.1';
}
output('<p class="information">' . $GLOBALS['I18N']->get('Your database version') . ': ' . $dbversion . '</p>');
if ($GLOBALS['database_module'] == 'mysql.inc') {
print Warn(s('Please edit your config file and change "mysql.inc" to "mysqli.inc" to avoid future PHP incompatibility') . resourceLink('http://resources.phplist.com/system/mysql-mysqli-update'));
}
if ($dbversion == VERSION) {
output($GLOBALS['I18N']->get('Your database is already the correct version, there is no need to upgrade'));
print '<p>' . PageLinkAjax('upgrade&update=tlds', s('update Top Level Domains'), '', 'button') . '</p>';
print subscribeToAnnouncementsForm();
} elseif (isset($_GET['doit']) && $_GET['doit'] == 'yes') {
$success = 1;
# once we are off, this should not be interrupted
ignore_user_abort(1);
# rename tables if we are using the prefix
include dirname(__FILE__) . '/structure.php';
while (list($table, $value) = each($DBstruct)) {
set_time_limit(500);
if (isset($table_prefix)) {
if (Sql_Table_exists($table) && !Sql_Table_Exists($tables[$table])) {
示例11: crc32
$_POST['name'] = '';
$_POST['email'] = '';
$_POST['sex'] = 2;
$_POST['autologin'] = 0;
}
$kuriseed = crc32(KURIKEY . microtime());
srand($kuriseed);
$check = time();
$kurichallenge = "{$kuriseed}|{$check}|" . rand(3, 12);
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$kurichallenge = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, md5(KURIKEY . $check, true), $kurichallenge, MCRYPT_MODE_ECB, $iv);
$kurichallenge = base64_encode($kurichallenge);
$kuridata = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, md5(KURIKEY, true), "{$kuriseed}|{$check}|{$kurichallenge}", MCRYPT_MODE_ECB, $iv);
$kuridata = base64_encode($kuridata);
$fields = array('username' => "<input type=\"text\" name=\"name\" maxlength=20 size=24 value=\"" . htmlspecialchars($_POST['name']) . "\" class=\"required\">", 'password' => "<input type=\"password\" name=\"pass\" size=24 class=\"required\">", 'password2' => "<input type=\"password\" name=\"pass2\" size=24 class=\"required\">", 'email' => "<input type=\"email\" name=\"email\" value=\"" . htmlspecialchars($_POST['email']) . "\" maxlength=\"60\" size=24>", 'sex' => MakeOptions("sex", $_POST['sex'], $sexes), 'readfaq' => "<label><input type=\"checkbox\" name=\"readFaq\">" . format(__("I have read the {0}FAQ{1}"), "<a href=\"" . actionLink("faq") . "\">", "</a>") . "</label>", 'kurichallenge' => "<img src=\"" . resourceLink("kurichallenge.php?data=" . urlencode($kuridata)) . "\" alt=\"[reload the page if the image fails to load]\"><br>\n\t\t<input type=\"text\" name=\"kurichallenge\" size=\"10\" maxlength=\"6\" class=\"required\">\n\t\t<input type=\"hidden\" name=\"kuridata\" value=\"" . htmlspecialchars($kuridata) . "\">", 'autologin' => "<label><input type=\"checkbox\" checked=\"checked\" name=\"autologin\"" . ($_POST['autologin'] ? ' checked="checked"' : '') . ">" . __("Log in afterwards") . "</label>", 'btnRegister' => "<input type=\"submit\" name=\"register\" value=\"" . __("Register") . "\">");
echo "<form action=\"" . htmlentities(actionLink("register")) . "\" method=\"post\">";
RenderTemplate('form_register', array('fields' => $fields));
echo "<span style=\"display : none;\"><input type=\"checkbox\" name=\"likesCake\"> I am a robot</span></form>";
function MakeOptions($fieldName, $checkedIndex, $choicesList)
{
$checks[$checkedIndex] = " checked=\"checked\"";
foreach ($choicesList as $key => $val) {
$result .= format("\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" name=\"{1}\" value=\"{0}\"{2}>\n\t\t\t\t\t\t{3}\n\t\t\t\t\t</label>", $key, $fieldName, $checks[$key], $val);
}
return $result;
}
function IsProxy()
{
if ($_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
return true;
示例12: BuildPage
function BuildPage($page, $id)
{
global $selectedTab, $loguser;
//TODO: This should be done in JS.
//So that a user who doesn't have Javascript will see all the tabs.
$display = $id != $selectedTab ? " style=\"display: none;\"" : "";
$cellClass = 0;
$output = "<table class=\"outline margin width50 eptable\" id=\"" . $id . "\"" . $display . ">\n";
foreach ($page as $pageID => $section) {
$secClass = $section["class"];
$output .= "<tr class=\"header0 {$secClass}\"><th colspan=\"2\">" . $section['name'] . "</th></tr>\n";
foreach ($section['items'] as $field => $item) {
$output .= "<tr class=\"cell{$cellClass} {$secClass}\" >\n";
$output .= "<td>\n";
if (isset($item["fail"])) {
$output .= "[ERROR] ";
}
if ($item['type'] != "checkbox") {
$output .= "<label for=\"" . $field . "\">" . $item['caption'] . "</label>\n";
}
if (isset($item['hint'])) {
$output .= "<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . $item['hint'] . "\" alt=\"[?]\" />\n";
}
$output .= "</td>\n";
$output .= "<td>\n";
if (isset($item['before'])) {
$output .= " " . $item['before'];
}
// Yes, some cases are missing the break; at the end.
// This is intentional, but I don't think it's a good idea...
switch ($item['type']) {
case "label":
$output .= htmlspecialchars($item['value']) . "\n";
break;
case "birthday":
$item['type'] = "text";
//$item['value'] = gmdate("F j, Y", $item['value']);
$item['value'] = timestamptostring($item['value']);
case "password":
if ($item['type'] == "password") {
$item['extra'] = "/ " . __("Repeat:") . " <input type=\"password\" name=\"repeat" . $field . "\" size=\"" . $item['size'] . "\" maxlength=\"" . $item['length'] . "\" />";
}
case "passwordonce":
if (!isset($item['size'])) {
$item['size'] = 13;
}
if (!isset($item['length'])) {
$item['length'] = 32;
}
if ($item["type"] == "passwordonce") {
$item["type"] = "password";
}
case "color":
case "text":
$output .= "<input id=\"" . $field . "\" name=\"" . $field . "\" type=\"" . $item['type'] . "\" value=\"" . htmlspecialchars($item['value']) . "\"";
if (isset($item['size'])) {
$output .= " size=\"" . $item['size'] . "\"";
}
if (isset($item['length'])) {
$output .= " maxlength=\"" . $item['length'] . "\"";
}
if (isset($item['width'])) {
$output .= " style=\"width: " . $item['width'] . ";\"";
}
if (isset($item['more'])) {
$output .= " " . $item['more'];
}
$output .= " />\n";
break;
case "textarea":
if (!isset($item['rows'])) {
$item['rows'] = 8;
}
$output .= "<textarea id=\"" . $field . "\" name=\"" . $field . "\" rows=\"" . $item['rows'] . "\" style=\"width: 98%;\">" . htmlspecialchars($item['value']) . "</textarea>";
break;
case "checkbox":
$output .= "<label><input id=\"" . $field . "\" name=\"" . $field . "\" type=\"checkbox\"";
if (isset($item['negative']) && !$item['value'] || !isset($item['negative']) && $item['value']) {
$output .= " checked=\"checked\"";
}
$output .= " /> " . $item['caption'] . "</label>\n";
break;
case "select":
$disabled = isset($item['disabled']) ? $item['disabled'] : false;
$disabled = $disabled ? "disabled=\"disabled\" " : "";
$checks = array();
$checks[$item['value']] = " selected=\"selected\"";
$options = "";
foreach ($item['options'] as $key => $val) {
$options .= format("<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val);
}
$output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" {2}>\n{1}\n</select>\n", $field, $options, $disabled);
break;
case "radiogroup":
$checks = array();
$checks[$item['value']] = " checked=\"checked\"";
foreach ($item['options'] as $key => $val) {
$output .= format("<label><input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />{3}</label>", $key, $field, $checks[$key], $val);
}
break;
//.........这里部分代码省略.........
示例13: makeAnncBar
function makeAnncBar()
{
global $loguserid;
$anncforum = Settings::get('anncForum');
if ($anncforum > 0) {
$annc = Query("\tSELECT \n\t\t\t\t\t\t\tt.id, t.title, t.icon, t.poll, t.forum,\n\t\t\t\t\t\t\tt.date anncdate,\n\t\t\t\t\t\t\t" . ($loguserid ? "tr.date readdate," : '') . "\n\t\t\t\t\t\t\tu.(_userfields)\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{threads} t \n\t\t\t\t\t\t\t" . ($loguserid ? "LEFT JOIN {threadsread} tr ON tr.thread=t.id AND tr.id={1}" : '') . "\n\t\t\t\t\t\t\tLEFT JOIN {users} u ON u.id=t.user\n\t\t\t\t\t\tWHERE forum={0}\n\t\t\t\t\t\tORDER BY anncdate DESC LIMIT 1", $anncforum, $loguserid);
if ($annc && NumRows($annc)) {
$annc = Fetch($annc);
$adata = array();
$adata['new'] = '';
if (!$loguserid && $annc['anncdate'] > time() - 900 || $loguserid && $annc['anncdate'] > $annc['readdate']) {
$adata['new'] = "<div class=\"statusIcon new\"></div>";
}
$adata['poll'] = $annc['poll'] ? "<img src=\"" . resourceLink('img/poll.png') . "\" alt=\"Poll\"/> " : '';
$adata['link'] = MakeThreadLink($annc);
$user = getDataPrefix($annc, 'u_');
$adata['user'] = UserLink($user);
$adata['date'] = formatdate($annc['anncdate']);
RenderTemplate('anncbar', array('annc' => $adata));
}
}
}
示例14: resourceLink
<script type="text/javascript" src="<?php
print resourceLink("plugins/embeds/swf.js");
?>
"></script>
<link rel="stylesheet" type="text/css" href="<?php
print resourceLink("plugins/embeds/swf.css");
?>
" />
示例15: __
}
} else {
$memberList = "\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td colspan=\"8\">\n\t\t\t\t\t" . __("Nothing matched your search.") . "\n\t\t\t\t</td>\n\t\t\t</tr>";
}
echo "\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th style=\"width: 30px; \">#</th>\n\t\t\t\t<th style=\"width: 62px; \">" . __("Picture") . "</th>\n\t\t\t\t<th>" . __("Name") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Posts") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Average") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Karma") . "</th>\n\t\t\t\t<th style=\"width: 80px; \">" . __("Birthday") . "</th>\n\t\t\t\t<th style=\"width: 130px; \">" . __("Registered on") . "</th>\n\t\t\t</tr>\n\t\t\t{$memberList}";
if ($pagelinks) {
echo "\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t" . __("Page") . "\n\t\t\t\t</td>\n\t\t\t\t<td colspan=\"6\">\n\t\t\t\t\t{$pagelinks}\n\t\t\t\t</td>\n\t\t\t</tr>";
}
echo "</table>";
die;
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
makeBreadcrumbs($crumbs);
if (!$isBot) {
echo "\n\t<script type=\"text/javascript\" src=\"" . resourceLink("js/memberlist.js") . "\"></script>\n\t<table>\n\t<tr>\n\t<td id=\"userFilter\" style=\"margin-bottom: 1em; margin-left: auto; margin-right: auto; padding: 1em; padding-bottom: 0.5em; padding-top: 0.5em;\">\n\t\t<label>\n\t\t" . __("Sort by") . ":\n\t\t" . makeSelect("orderBy", array("" => __("Post count"), "id" => __("ID"), "name" => __("Name"), "karma" => __("Karma"), "reg" => __("Registration date"))) . " \n\t\t</label>\n\t\t<label>\n\t\t" . __("Order") . ":\n\t\t" . makeSelect("order", array("desc" => __("Descending"), "asc" => __("Ascending"))) . " \n\t\t</label>\n\t\t<label>\n\t\t" . __("Sex") . ":\n\t\t" . makeSelect("sex", array("" => __("(any)"), "n" => __("N/A"), "f" => __("Female"), "m" => __("Male"))) . " \n\t\t</label>\n\t\t<label>\n\t\t" . __("Power") . ":\n\t\t" . makeSelect("power", array("" => __("(any)"), -1 => __("Banned"), 0 => __("Normal"), 1 => __("Local Mod"), 2 => __("Full Mod"), 3 => __("Admin"), 4 => __("Root"), 5 => __("System"))) . "\n\t\t</label>\n\t</td>\n\t<td style=\"text-align: right;\">\n\t\t\t<form action=\"javascript:refreshMemberlist();\">\n\t\t\t\t<div style=\"display:inline-block\">\n\t\t\t\t\t<input type=\"text\" name=\"query\" id=\"query\" placeholder=\"" . __("Search") . "\" />\n\t\t\t\t\t<button id=\"submitQuery\"><i class=\"icon-search\"></i></button>\n\t\t\t\t</div>\n\t\t\t</form>\n\t</td></tr></table>";
}
echo "\n\t<div id=\"memberlist\">\n\t\t<div class=\"center\" style=\"padding: 2em;\">\n\t\t\t" . __("Loading memberlist...") . "\n\t\t</div>\n\t</div>";
//We do not need a default index.
//All options are translatable too, so no need for __() in the array.
//Name is the same as ID.
function makeSelect($name, $options)
{
$result = "<select name=\"" . $name . "\" id=\"" . $name . "\">";
$i = 0;
foreach ($options as $key => $value) {
$result .= "\n\t<option" . ($i = 0 ? " selected=\"selected\"" : "") . " value=\"" . $key . "\">" . $value . "</option>";
}
$result .= "\n</select>";
return $result;
}