本文整理汇总了PHP中block_end函数的典型用法代码示例。如果您正苦于以下问题:PHP block_end函数的具体用法?PHP block_end怎么用?PHP block_end使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了block_end函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
function test()
{
spl_autoload_call('FormKit\\ResponseUtils');
block_start('level-1');
?>
Block 1<?php
$content = block_end();
is('Block 1', $content);
$content = FormKit\Block::getContent('level-1');
is('Block 1', $content);
}
示例2: comment_form
function comment_form()
{
global $comment, $id, $cid;
block_begin(NEW_COMMENT);
$comment = str_replace('\\r\\n', "\n", $comment);
?>
<center>
<form enctype='multipart/form-data' name='comment' method='post'>
<input type='hidden' name='info_hash' value='<?php
echo $id;
?>
' />
<table class='lista' border='0' cellpadding='10'>
<tr>
<tr><td align='left' class='header'><?php
echo USER_NAME;
?>
:</td><td class='lista' align='left'><input name='user' type='text' value='<?php
echo security::html_safe($_GET["usern"]);
?>
' size='20' maxlength='100' disabled; readonly></td></tr>
<tr><td align='left' class='header'><?php
echo COMMENT_1;
?>
:</td><td class='lista' align='left'><?php
textbbcode("comment", "comment", security::html_safe(unesc($comment)));
?>
</td></tr>
<tr><td class='header' colspan='2' align='center'><input type='submit' name='confirm' value='<?php
echo FRM_CONFIRM;
?>
' /> <input type='submit' name='confirm' value='<?php
echo FRM_PREVIEW;
?>
' /></td></tr>
</table>
</form>
</center>
<?php
block_end();
}
示例3: _torrenttable
function _torrenttable($res, $frame_caption, $speed = "false")
{
global $db;
block_begin($frame_caption, 'center');
begin_table();
$num = 0;
while ($a = $res->fetch_assoc()) {
++$num;
if ($a["leechers"] > 0) {
$r = (int) $a["seeds"] / (int) $a["leechers"];
$ratio = number_format($r, 2);
} else {
$ratio = INFINITE;
}
if (!isset($menu)) {
$menu = "";
}
if ($menu != "1") {
echo "<tr>" . "<table width='100%' class='lista'>" . "<td class='header' align='center'>" . USER_LEVEL . "</td>" . "<td class='header'>" . FILE . "</td>";
if ($speed != "true") {
echo "<td class='header' align='center'>" . FINISHED . "</td>" . "<td class='header' align='center'>" . SEEDERS . "</td>" . "<td class='header' align='center'>" . LEECHERS . "</td>" . "<td class='header' align='center'>" . PEERS . "</td>" . "<td class='header' align='center'>" . RATIO . "</td>";
} else {
echo "<td class='header' align='right'>" . SPEED . "</td>";
}
echo "</tr>";
$menu = 1;
}
print "<tr><td class='lista' align='center'>" . $num . "</td><td class='lista' align='left'>";
print "<a href='" . "details.php?id=" . $a['hash'] . "'>" . "<b>";
print security::html_safe($a["name"]) . "</b></a></td>";
if ($speed != "true") {
print "<td class='lista' align='center' width='10%' ><a href='torrent_history.php?id=" . $a["hash"] . "'>" . number_format((int) $a["finished"]) . "</a></td><td class='lista' align='center' width='10%' ><a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"] + (int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%'>" . $ratio . "</td>\n";
} else {
print "<td class='lista' align='center'>" . misc::makesize((int) $a["speed"]) . "/s" . "\n";
}
}
end_table();
block_end();
}
示例4: while
print "<td align='center' class='header'>" . UPLOADED . "</td>\n";
print "<td align='center' class='header'>" . RATIO . "</td>\n";
print "<td align='center' class='header'>" . FINISHED . "</td></tr>\n";
while ($row = $res->fetch_array(MYSQLI_BOTH)) {
print "<tr><td align='center' class='lista'>" . "<a href='userdetails.php?id=" . (int) $row["uid"] . "'>" . security::html_safe(unesc($row["username"])) . "</a></td>" . "<td align='center' class='lista'><a href='usercp.php?do=pm&action=edit&uid=" . user::$current['uid'] . "&what=new&to=" . urlencode(unesc($row["username"])) . "'>" . image_or_link($STYLEPATH . "/pm.png", "", "PM") . "</a></td>";
if ($row["flagpic"] != "") {
print "<td align='center' class='lista'><img src='images/flag/" . $row["flagpic"] . "' alt='" . security::html_safe($row["country"]) . "' /></td>";
} else {
print "<td align='center' class='lista'><img src='images/flag/unknown.gif' alt='" . UNKNOWN . "' /></td>";
}
print "<td align='center' class='lista'>" . $row["active"] . "</td>";
print "<td align='center' class='lista'>" . security::html_safe($row["agent"]) . "</td>";
$dled = misc::makesize((int) $row["downloaded"]);
$upld = misc::makesize((int) $row["uploaded"]);
print "<td align='center' class='lista'>" . $dled . "</td>";
print "<td align='center' class='lista'>" . $upld . "</td>";
if (intval($row["downloaded"]) > 0) {
$ratio = number_format((int) $row["uploaded"] / (int) $row["downloaded"], 2);
} else {
$ratio = "∞";
}
print "<td align='center' class='lista'>" . $ratio . "</td>";
print "<td align='center' class='lista'>" . get_elapsed_time($row["date"]) . " ago</td></tr>";
}
if ($res->num_rows == 0) {
print "<tr><td align='center' colspan='9' class='lista'>No history to display</td></tr>";
}
print "</table>";
print "</div><br /><br /><center><a href='javascript: history.go(-1);'>" . BACK . "</a>";
block_end();
stdfoot();
示例5: insert_compose_frame
function insert_compose_frame($id, $newtopic = true, $quote = false)
{
global $maxsubjectlength, $db;
MCached::connect();
if ($newtopic) {
$arr = MCached::get('forums::name::' . $id);
if ($arr === MCached::NO_RESULT) {
$res = $db->query("SELECT name FROM forums WHERE id = " . $id) or sqlerr(__FILE__, __LINE__);
$arr = $res->fetch_assoc() or die(BAD_FORUM_ID);
MCached::add('forums::name::' . $id, $arr, 9600);
}
$forumname = security::html_safe(unesc($arr["name"]));
block_begin(WORD_NEW . " " . TOPIC . " " . IN . " <a href='?action=viewforum&forumid=" . $id . "'>" . $forumname . "</a> " . FORUM);
} else {
$arr = MCached::get('quick::jump::topics::' . $id);
if ($arr === MCached::NO_RESULT) {
$res = $db->query("SELECT * FROM topics WHERE id = " . $id) or sqlerr(__FILE__, __LINE__);
$arr = $res->fetch_assoc() or stderr(ERROR, FORUM_ERROR . TOPIC_NOT_FOUND);
MCached::add('quick::jump::topics::' . $id, $arr, 9600);
}
$subject = security::html_safe(unesc($arr["subject"]));
block_begin(REPLY . " " . TOPIC . ": <a href='?action=viewtopic&topicid=" . $id . "'>" . $subject . "</a>");
}
begin_frame();
print "<form method='post' name='compose' action='?action=post'>\n";
if ($newtopic) {
print "<input type='hidden' name='forumid' value='" . $id . "'>\n";
} else {
print "<input type='hidden' name='topicid' value='" . $id . "'>\n";
}
begin_table();
if ($newtopic) {
print "<tr><td class='header'>" . SUBJECT . "</td>" . "<td class='lista' align='left' style='padding: 0px'><input type='text' size='50' maxlength='" . $maxsubjectlength . "' name='subject' " . "style='border: 0px; height: 19px'></td></tr>\n";
}
if ($quote) {
$postid = 0 + (int) $_GET["postid"];
if (!is_valid_id($postid)) {
die;
}
$res = $db->query("SELECT posts.*, users.username FROM posts INNER JOIN users ON posts.userid = users.id WHERE posts.id = " . $postid) or sqlerr(__FILE__, __LINE__);
if ($res->num_rows != 1) {
stderr(ERROR, ERR_NO_POST_WITH_ID . "" . $postid);
}
$arr = $res->fetch_assoc();
}
print "<tr><td class='header'>" . BODY . "</td><td class='lista' align='left' style='padding: 0px'>";
textbbcode("compose", "body", $quote ? "[quote=" . security::html_safe($arr["username"]) . "]" . security::html_safe(unesc($arr["body"])) . "[/quote]" : "");
print "<tr><td colspan='2' align='center'><input type='submit' class='btn' value='" . FRM_CONFIRM . "'></td></tr>\n";
print "</td></tr>";
end_table();
print "</form>\n";
end_frame();
//------ Get 10 last posts if this is a reply
if (!$newtopic) {
$postres = $db->query("SELECT * FROM posts WHERE topicid = " . $id . " ORDER BY id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
begin_frame(LAST_10_POSTS, true);
while ($post = $postres->fetch_assoc()) {
//-- Get poster details
$userres = $db->query("SELECT * FROM users WHERE id = " . (int) $post["userid"] . " LIMIT 1") or sqlerr(__FILE__, __LINE__);
$user = $userres->fetch_assoc();
$avatar = $user["avatar"] && $user["avatar"] != "" ? security::html_safe($user["avatar"]) : "";
begin_table(true);
print "<tr valign='top'><td width='150' align='center' style='padding: 0px'>#" . (int) $post["id"] . " by " . security::html_safe($user["username"]) . "<br />" . get_date_time($post["added"]) . ($avatar != "" ? "<br /><img width='80' src='" . $avatar . "'>" : "") . "</td><td class='lista'>" . format_comment(unesc($post["body"])) . "</td></tr><br>\n";
end_table();
}
end_frame();
}
if (!isset($forumid)) {
$forumid = 0;
}
insert_quick_jump_menu($forumid);
block_end();
}
示例6: block_begin
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
////////////////////////////////////////////////////////////////////////////////////
// CyBerFuN.ro & xList.ro
// xList .::. Last Member Block
// http://tracker.cyberfun.ro/
// http://www.cyberfun.ro/
// http://xlist.ro/
// Modified By CyBerNe7
global $CURUSER, $btit_settings;
if (!$CURUSER || $CURUSER["view_users"] == "no") {
// do nothing
} else {
//lastest member
block_begin("Latest Member");
$a = get_result("SELECT id,username FROM {$TABLE_PREFIX}users WHERE id_level<>1 AND id_level<>2 ORDER BY id DESC LIMIT 1", true, $btit_settings['cache_duration']);
if ($a) {
$a = $a[0];
if ($CURUSER["view_users"] == "yes") {
$latestuser = "<a href=\"index.php?page=userdetails&id=" . $a["id"] . "\">" . $a["username"] . "</a>";
} else {
$latestuser = $a['username'];
}
echo " <div align=\"center\"><table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" > <tr><td class=\"blocklist\" align=\"center\">" . $language["WELCOME_LASTUSER"] . "<br /><b>{$latestuser}</b>!</td></tr></table></div>\n";
}
block_end("");
}
// end if user can view
//end
示例7: aggiungiutente
function aggiungiutente()
{
global $DBDT, $INVITATIONSON, $VALID_INV, $SITENAME, $SITEEMAIL, $BASEURL, $VALIDATION, $USERLANG, $USE_IMAGECODE, $TABLE_PREFIX, $XBTT_USE, $language, $THIS_BASEPATH, $FORUMLINK, $db_prefix, $btit_settings;
$dobdate = $_POST["datepicker"];
$parts = explode('-', $dobdate);
$dobday = $parts[0];
$dobmonth = $parts[1];
$dobyear = $parts[2];
$utente = mysqli_real_escape_string($DBDT, $_POST["user"]);
$pwd = mysqli_real_escape_string($DBDT, $_POST["pwd"]);
$pwd1 = mysqli_real_escape_string($DBDT, $_POST["pwd1"]);
$email = mysqli_real_escape_string($DBDT, $_POST["email"]);
if (isset($_POST["language"])) {
$idlangue = intval($_POST["language"]);
} else {
$idlangue = max(1, $btit_settings["default_language"]);
}
if (isset($_POST["style"])) {
$idstyle = intval($_POST["style"]);
} else {
$idstyle = max(1, $btit_settings["default_style"]);
}
$idflag = intval($_POST["flag"]);
$timezone = intval($_POST["timezone"]);
$heard = mysqli_real_escape_string($DBDT, $_POST["heardaboutus"]);
// Dt Referral
if ($btit_settings["ref_on"] == true) {
$rid = intval($_POST["refa"]);
}
// Dt Referral
if (strtoupper($utente) == strtoupper("Guest")) {
err_msg($language["ERROR"], $language["ERR_GUEST_EXISTS"]);
stdfoot();
exit;
}
if ($pwd != $pwd1) {
err_msg($language["ERROR"], $language["DIF_PASSWORDS"]);
stdfoot();
exit;
}
if ($VALIDATION == "none") {
$idlevel = 3;
} else {
$idlevel = 2;
}
//begin invitation system by dodge
if ($INVITATIONSON == "true") {
if ($VALID_INV == "true") {
$idlevel = 2;
} else {
$idlevel = 3;
}
}
//end invitation system
# Create Random number
$floor = 100000;
$ceiling = 999999;
srand((double) microtime() * 1000000);
$random = rand($floor, $ceiling);
if ($utente == "" || $pwd == "" || $email == "") {
return -1;
exit;
}
$res = do_sqlquery("SELECT email FROM {$TABLE_PREFIX}users WHERE email='{$email}'", true);
if (mysqli_num_rows($res) > 0) {
return -2;
exit;
}
// valid email check - by vibes
$regex = '/\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b/i';
if (!preg_match($regex, $email)) {
return -3;
exit;
}
// valid email check end
//Function changed by fatepower so now the variable checks the right data.
//Added the image also. Cheers boys
// check if IP is already in use
if ($btit_settings["dupip"] == "true") {
$ip = getip();
$i = @mysqli_fetch_row(@mysqli_query($GLOBALS["___mysqli_ston"], "SELECT count(*) FROM {$TABLE_PREFIX}users WHERE cip='{$ip}'")) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
if ($i[0] != 0) {
err_msg(ERROR, "[" . $ip . "]<br /><img src=\"images/shared_ip.gif\" border=\"0\" alt=\"\" />");
block_end();
stdfoot();
exit;
}
}
// duplicate username
$res = do_sqlquery("SELECT username FROM {$TABLE_PREFIX}users WHERE username='{$utente}'", true);
if (mysqli_num_rows($res) > 0) {
return -4;
exit;
}
// duplicate username
if (strpos(mysqli_real_escape_string($DBDT, $utente), " ") == true) {
return -7;
exit;
}
if ($btit_settings["gcsw"] == false) {
//.........这里部分代码省略.........
示例8: endOutput
function endOutput()
{
global $BASEURL, $user_id, $TRACKER_ANNOUNCEURLS;
?>
</center>
<?php
echo "<center>" . INSERT_DATA . "<br /><br />";
echo " " . ANNOUNCE_URL . "<br /><b>";
foreach ($TRACKER_ANNOUNCEURLS as $taurl) {
echo $taurl . '<br />';
}
echo "</b><br /></center>";
?>
<form name='upload' method='post' enctype='multipart/form-data'>
<table class='lista' align='center'>
<tr>
<td class='header'><?php
echo TORRENT_FILE;
?>
</td>
<td class='lista' align='left'>
<?php
if (function_exists("sha1")) {
echo "<input type='file' name='torrent'>";
} else {
echo "<i>" . NO_SHA_NO_UP . "</i>";
}
?>
</td>
</tr>
<?php
echo "<tr><td class='header'>" . CATEGORY_FULL . "</td><td class='lista' align='left'>";
categories($category[0]);
echo "</td></tr>";
?>
<tr>
<td class='header'><?php
echo FILE_NAME;
?>
</td>
<td class='lista' align='left'><input type='text' name='filename' size='50' maxlength='200' /></td>
</tr>
<tr>
<td class='header' valign='top'><?php
echo DESCRIPTION;
?>
</td>
<td class='lista' align='left'><?php
textbbcode("upload", "info");
?>
</td>
</tr>
<?php
print "<tr>\n <td colspan='2'><input type='hidden' name='user_id' size='50' value='" . $user_id . "' /></td>\n </tr>";
print "<tr>\n <td class='header'>" . TORRENT_ANONYMOUS . "</td>\n <td class='lista'> " . NO . "<input type='radio' name='anonymous' value='false' checked /> " . YES . "<input type='radio' name='anonymous' value='true' /></td>\n </tr>";
if (function_exists("sha1")) {
echo "<tr>\n <td class='lista' align='center' colspan='2'><input type='checkbox' name='autoset' value='enabled' disabled checked />" . TORRENT_CHECK . "</td>\n </tr>";
}
?>
<tr>
<td align='right'><input type='submit' value='<?php
echo FRM_SEND;
?>
' /></td>
<td align='left'><input type='reset' value='<?php
echo FRM_RESET;
?>
' /></td>
</tr>
</table>
</form>
<?php
print "</td></tr></table>";
block_end();
}
示例9: modificautente
function modificautente()
{
global $db;
$utente = security::html_safe($db->real_escape_string($_POST["user"]));
$oldname = security::html_safe($db->real_escape_string($_POST["username"]));
if (trim($utente) == "") {
err_msg(ERROR, INSERT_USERNAME);
block_end();
stdfoot();
exit;
} elseif (utf8::strtoupper($utente) == utf8::strtoupper("Guest")) {
err_msg(ERROR, ERR_GUEST_EXISTS . "<br />\n");
block_end();
stdfoot();
exit;
}
// duplicate username
$res = $db->query("SELECT username FROM users WHERE username = '" . $utente . "' AND id <> " . intval($_POST["uid"]));
if ($res->num_rows > 0) {
err_msg(ERROR, ERR_USER_ALREADY_EXISTS . "<br />\n");
block_end();
stdfoot();
exit;
}
if (isset($_POST["pwd"])) {
$pwd = $db->real_escape_string($_POST["pwd"]);
} else {
$pwd = "";
}
// now in $_POST["level"] there is the level name, we need to select the id_level to know if current user
// is allowed to modify the requested user
$rlev = $db->query("SELECT id, id_level FROM users_level WHERE level = '" . $db->real_escape_string(unesc($_POST["level"])) . "'");
$reslev = $rlev->fetch_assoc();
if (user::$current["id_level"] >= $reslev["id_level"]) {
$level = intval($reslev["id"]);
} else {
$level = 0;
}
$idlangue = intval($_POST["language"]);
$idstyle = intval($_POST["style"]);
$idflag = intval($_POST["flag"]);
$timezone = intval($_POST["timezone"]);
if (isset($_POST["email"])) {
$email = $db->real_escape_string($_POST["email"]);
} else {
$email = "";
}
$set = array();
if ($email != "") {
$set[] = "email='{$email}'";
}
if ($level > 0) {
$set[] = "id_level='{$level}'";
}
if ($idlangue > 0) {
$set[] = "language={$idlangue}";
}
if ($idstyle > 0) {
$set[] = "style={$idstyle}";
}
if ($pwd != "") {
$set[] = "password='" . md5($pwd) . "'";
}
if ($idflag > 0) {
$set[] = "flag={$idflag}";
}
if ($timezone >= -12) {
$set[] = "time_offset={$timezone}";
}
// username
$set[] = "username='{$utente}'";
$updateset = implode(",", $set);
if ($updateset != "") {
@$db->query("UPDATE users SET " . $updateset . " WHERE username = '" . $oldname . "'");
}
write_log("Modified User " . $utente . "", "modify");
}