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


PHP begin_block函数代码示例

本文整理汇总了PHP中begin_block函数的典型用法代码示例。如果您正苦于以下问题:PHP begin_block函数的具体用法?PHP begin_block怎么用?PHP begin_block使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: begin_block

<?php

if ($CURUSER) {
    begin_block(T_("THEME") . " / " . T_("LANGUAGE"));
    $ss_r = SQL_Query_exec("SELECT * from stylesheets");
    $ss_sa = array();
    while ($ss_a = mysql_fetch_assoc($ss_r)) {
        $ss_id = $ss_a["id"];
        $ss_name = $ss_a["name"];
        $ss_sa[$ss_name] = $ss_id;
    }
    ksort($ss_sa);
    reset($ss_sa);
    while (list($ss_name, $ss_id) = each($ss_sa)) {
        if ($ss_id == $CURUSER["stylesheet"]) {
            $ss = " selected='selected'";
        } else {
            $ss = "";
        }
        $stylesheets .= "<option value='{$ss_id}'{$ss}>{$ss_name}</option>\n";
    }
    $lang_r = SQL_Query_exec("SELECT * from languages");
    $lang_sa = array();
    while ($lang_a = mysql_fetch_assoc($lang_r)) {
        $lang_id = $lang_a["id"];
        $lang_name = $lang_a["name"];
        $lang_sa[$lang_name] = $lang_id;
    }
    ksort($lang_sa);
    reset($lang_sa);
    while (list($lang_name, $lang_id) = each($lang_sa)) {
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:31,代码来源:themelang_block.php

示例2: begin_block

<?php

if (!$site_config["MEMBERSONLY"] || $CURUSER) {
    begin_block(T_("LATEST_TORRENTS"));
    $expire = 900;
    // time in seconds
    if (($latestuploadsrecords = $TTCache->Get("latestuploadsblock", $expire)) === false) {
        $latestuploadsquery = SQL_Query_exec("SELECT id, name, size, seeders, leechers FROM torrents WHERE banned='no' AND visible = 'yes' ORDER BY id DESC LIMIT 5");
        $latestuploadsrecords = array();
        while ($latestuploadsrecord = mysql_fetch_assoc($latestuploadsquery)) {
            $latestuploadsrecords[] = $latestuploadsrecord;
        }
        $TTCache->Set("latestuploadsblock", $latestuploadsrecords, $expire);
    }
    if ($latestuploadsrecords) {
        foreach ($latestuploadsrecords as $row) {
            $char1 = 18;
            //cut length
            $smallname = htmlspecialchars(CutName($row["name"], $char1));
            echo "<a href='torrents-details.php?id={$row['id']}' title='" . htmlspecialchars($row["name"]) . "'>{$smallname}</a><br />\n";
            echo "- [" . T_("SIZE") . ": " . mksize($row["size"]) . "]<br /><br />\n";
        }
    } else {
        print "<center>" . T_("NOTHING_FOUND") . "</center>\n";
    }
    end_block();
}
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:27,代码来源:latestuploads_block.php

示例3: begin_block

<?php

begin_block("Powered By");
?>

<p class="center-block"><img src="blocks/images/dev_page_badges.png" width="250px"></p>
  
<?php 
end_block();
开发者ID:nonconforme,项目名称:TorrentTrader-Bootstrap,代码行数:9,代码来源:poweredby_block.php

示例4: begin_block

<?php

if (!$CURUSER) {
    begin_block(T_("LOGIN"));
    ?>
<form method="post" action="account-login.php">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr><td>
		<tr>
<td align="center"><a href="account-login.php"><button type="button" class='btn btn-inverse'/>Login</button></a><br /><a href="account-signup.php"><button type="button" class="btn btn-success">Signup</button></a><br /><a href="account-recover.php"><button type="button" class="btn btn-warning">Recover Account</button></a></td> </tr>
	</table>
    </form> 
<?php 
    end_block();
} else {
    begin_block('Profile');
    $avatar = htmlspecialchars($CURUSER["avatar"]);
    if (!$avatar) {
        $avatar = $site_config["SITEURL"] . "/images/default_avatar.png";
    }
    $userdownloaded = mksize($CURUSER["downloaded"]);
    $useruploaded = mksize($CURUSER["uploaded"]);
    $privacylevel = T_($CURUSER["privacy"]);
    if ($CURUSER["uploaded"] > 0 && $CURUSER["downloaded"] == 0) {
        $userratio = "Inf.";
    } elseif ($CURUSER["downloaded"] > 0) {
        $userratio = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
    } else {
        $userratio = "---";
    }
    $res = SQL_Query_exec("SELECT `moodspic` FROM `moods` WHERE `id` = '{$CURUSER['moods']}'");
开发者ID:l3oncoder,项目名称:TorrentTrader,代码行数:31,代码来源:login_block.php

示例5: begin_block

<?php

if (!$site_config["MEMBERSONLY"] || $CURUSER) {
    begin_block(T_("SEEDERS_WANTED"));
    $external = "external = 'no'";
    // Uncomment below to include external torrents
    $external = 1;
    $expires = 600;
    // Cache time in seconds
    if (($rows = $TTCache->Get("seedwanted_block", $expires)) === false) {
        $res = SQL_Query_exec("SELECT id, name, seeders, leechers FROM torrents WHERE seeders = 0 AND leechers > 0 AND banned = 'no' AND {$external} ORDER BY leechers DESC LIMIT 5");
        $rows = array();
        while ($row = mysql_fetch_assoc($res)) {
            $rows[] = $row;
        }
        $TTCache->Set("seedwanted_block", $rows, $expires);
    }
    if (!$rows) {
        ?>
		<p class="text-center"><?php 
        echo T_("NOTHING_FOUND");
        ?>
</p>
	<?php 
    } else {
        foreach ($rows as $row) {
            $char1 = 20;
            //cut length
            $smallname = htmlspecialchars(CutName($row["name"], $char1));
            ?>
开发者ID:nonconforme,项目名称:TorrentTrader-Bootstrap,代码行数:30,代码来源:seedwanted_block.php

示例6: begin_block

<?php

if (($site_config["INVITEONLY"] || $site_config["ENABLEINVITES"]) && $CURUSER) {
    $invites = $CURUSER["invites"];
    begin_block(T_("INVITES"));
    ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
        <td align="center">
        <?php 
    printf(P_("YOU_HAVE_INVITES", $invites), $invites);
    ?>
        </td>
    </tr>
	<?php 
    if ($invites > 0) {
        ?>
	<tr>
        <td align="center">
        <a href="invite.php"><?php 
        echo T_("SEND_AN_INVITE");
        ?>
</a>
        </td>
    </tr>
	<?php 
    }
    ?>
	</table>
	<?php 
    end_block();
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:31,代码来源:invite_block.php

示例7: begin_block

<?php

if ($site_config['NEWSON']) {
    //check news is turned on first
    begin_block(T_("LATEST_NEWS"));
    $res = SQL_Query_exec("SELECT * FROM news ORDER BY added DESC LIMIT 10");
    ?>
	<style type="text/css">

	#marqueecontainer{
	position: relative;
	/*width: 200px; marquee width */
	height: 200px; /*marquee height */
	background-color: white;
	overflow: hidden;
	/*border: 3px solid orange;*/
	padding: 2px;
	padding-left: 4px;
	}

	</style>

	<script type="text/javascript">

	/***********************************************
	* Cross browser Marquee II- ? Dynamic Drive (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit http://www.dynamicdrive.com/ for this script and 100s more.
	***********************************************/

	var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:31,代码来源:scrollingnews_block.php

示例8: T_

		</td>
		</tr>
	<tr>
<td align="center">[<a href="account-signup.php"><?php 
    echo T_("SIGNUP");
    ?>
</a>]<br />[<a href="account-recover.php"><?php 
    echo T_("RECOVER_ACCOUNT");
    ?>
</a>]</td> </tr>
	</table>
    </form> 
<?php 
    end_block();
} else {
    begin_block($CURUSER["username"]);
    $avatar = htmlspecialchars($CURUSER["avatar"]);
    if (!$avatar) {
        $avatar = $site_config["SITEURL"] . "/images/default_avatar.png";
    }
    $userdownloaded = mksize($CURUSER["downloaded"]);
    $useruploaded = mksize($CURUSER["uploaded"]);
    $privacylevel = T_($CURUSER["privacy"]);
    if ($CURUSER["uploaded"] > 0 && $CURUSER["downloaded"] == 0) {
        $userratio = "Inf.";
    } elseif ($CURUSER["downloaded"] > 0) {
        $userratio = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
    } else {
        $userratio = "---";
    }
    print "<center><img width='80' height='80' src='{$avatar}' alt='' /></center><br />" . T_("DOWNLOADED") . ": {$userdownloaded}<br />" . T_("UPLOADED") . ": {$useruploaded}<br />" . T_("CLASS") . ": " . T_($CURUSER["level"]) . "<br />" . T_("ACCOUNT_PRIVACY_LVL") . ": {$privacylevel}<br />" . T_("RATIO") . ": {$userratio}";
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:31,代码来源:login_block.php

示例9: begin_block

<?php

if ($CURUSER["control_panel"] == "yes") {
    begin_block("AdminCP");
    ?>
       
       <select name="admin" class="form-control" onchange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }">
       <option value="-1">Navigation</option>
       <option value="admincp.php?action=usersearch">Advanced User Search</option>
       <option value="admincp.php?action=avatars">Avatar Log</option>
       <option value="admincp.php?action=backups">Backups</option>
       <option value="admincp.php?action=ipbans">Banned Ip's</option>
       <option value="admincp.php?action=bannedtorrents">Banned Torrents</option>
       <option value="admincp.php?action=blocks&amp;do=view">Blocks</option>
       <option value="admincp.php?action=cheats">Detect Possibe Cheats</option>
       <option value="admincp.php?action=emailbans">E-mail Bans</option>
       <option value="faq-manage.php">FAQ</option>
       <option value="admincp.php?action=freetorrents">Freeleech Torrents</option>
       <option value="admincp.php?action=lastcomm">Latest Comments</option>
       <option value="admincp.php?action=masspm">Mass PM</option>
       <option value="admincp.php?action=messagespy">Message Spy</option>
       <option value="admincp.php?action=news&amp;do=view">News</option>
       <option value="admincp.php?action=peers">Peers List</option>
       <option value="admincp.php?action=polls&amp;do=view">Polls</option>
       <option value="admincp.php?action=reports&amp;do=view">Reports System</option>
       <option value="admincp.php?action=rules&amp;do=view">Rules</option>
       <option value="admincp.php?action=sitelog">Site Log</option>
       <option value="teams-create.php">Teams</option>
       <option value="admincp.php?action=style">Theme Management</option>
       <option value="admincp.php?action=categories&amp;do=view">Torrent Categories</option>
       <option value="admincp.php?action=torrentlangs&amp;do=view">Torrent Languages</option>
开发者ID:nonconforme,项目名称:TorrentTrader-Bootstrap,代码行数:31,代码来源:admincp_block.php

示例10: begin_block

<?php

begin_block(T_("POLL"));
if (!function_exists("srt")) {
    function srt($a, $b)
    {
        if ($a[0] > $b[0]) {
            return -1;
        }
        if ($a[0] < $b[0]) {
            return 1;
        }
        return 0;
    }
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && $CURUSER && $_POST["act"] == "takepoll") {
    $choice = $_POST["choice"];
    if ($choice != "" && $choice < 256 && $choice == floor($choice)) {
        $res = SQL_Query_exec("SELECT * FROM polls ORDER BY added DESC LIMIT 1");
        $arr = mysql_fetch_assoc($res) or show_error_msg(T_("ERROR"), "No Poll", 1);
        $pollid = $arr["id"];
        $userid = $CURUSER["id"];
        $res = SQL_Query_exec("SELECT * FROM pollanswers WHERE pollid={$pollid} && userid={$userid}");
        $arr = mysql_fetch_assoc($res);
        if ($arr) {
            show_error_msg(T_("ERROR"), "You have already voted!", 0);
        } else {
            SQL_Query_exec("INSERT INTO pollanswers VALUES(0, {$pollid}, {$userid}, {$choice})");
            if (mysql_affected_rows() != 1) {
                show_error_msg(T_("ERROR"), "An error occured. Your vote has not been counted.", 0);
            }
开发者ID:l3oncoder,项目名称:TorrentTrader,代码行数:31,代码来源:polls_block.php

示例11: begin_block

<?php

begin_block(T_("ONLINE_USERS"));
$expires = 600;
// Cache time in seconds
if (($rows = $TTCache->Get("usersonline_block", $expires)) === false) {
    $res = SQL_Query_exec("SELECT id, username FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND privacy !='strong' AND UNIX_TIMESTAMP('" . get_date_time() . "') - UNIX_TIMESTAMP(users.last_access) <= 900");
    $rows = array();
    while ($row = mysql_fetch_assoc($res)) {
        $rows[] = $row;
    }
    $TTCache->Set("usersonline_block", $rows, $expires);
}
if (!$rows) {
    ?>
	<p class="text-center"><?php 
    echo T_("NO_USERS_ONLINE");
    ?>
</p>
<?php 
} else {
    ?>
	<?php 
    for ($i = 0, $cnt = count($rows), $n = $cnt - 1; $i < $cnt; $i++) {
        $row =& $rows[$i];
        ?>

			<a href='account-details.php?id=<?php 
        echo $row["id"];
        ?>
'><?php 
开发者ID:nonconforme,项目名称:TorrentTrader-Bootstrap,代码行数:31,代码来源:usersonline_block.php

示例12: db_conn

//database connection function
db_conn();
//Fetch Room details from database..
$rooms = @sql_query("SELECT * FROM rooms ORDER BY room_id ASC");
$HTMLOUT .= begin_block("Room_Status", $caption_t = "Room Status", $per = 98, $tdcls = "colhead5", $img = "<img src='{$TK3GRE['pic_base_url']}status.png' style=' height:28px;' alt='' title='' />", $title = 'Room stats');
if (mysql_num_rows($rooms) > 0) {
    //make table design
    $HTMLOUT .= "<table width='100%' cellspacing='0' cellpadding='5'><tr> \n        <td class=\"colhead3\"style='text-align:center;' title='Room ID'><b>Room ID</b></td> \n\t\t<td class=\"colhead3\"style='text-align:center;' title='Room Name'><b>Room Name</b></td>\n        <td class=\"colhead3\"style='text-align:center;' title='Room Type'><b>Room Type</b></td> \n\t\t<td class=\"colhead3\"style='text-align:center;' title='Room Address'><b>Room Address</b></td> \n        <td class=\"colhead3\"style='text-align:center;' title='Number of Seats'><b>Number of Seats</b></td>\n\t\t<td class=\"colhead3\"style='text-align:center;' title='Room Details'><b>Room Details</b></td></tr>";
    //populate table
    while ($room = mysql_fetch_assoc($rooms)) {
        $roomID = $room["room_id"];
        $roomName = $room["room_name"];
        $roomType = $room["type"];
        $roomAddress = $room["room_address"];
        $no_of_seats = $room["no_of_seats"];
        $room_details = "<span class='btn' title='Details for room {$roomID}'><a href='room_stat.php?room_id={$roomID}' title='Details for room {$roomID}'><font color=#FFFFFF>Details for room {$roomID}</font></a></span>";
        $HTMLOUT .= "<tr>\n\t\t\t\t\t\t<td style='text-align:center;' title='{$roomID}'><b>{$roomID}</b></td>\n\t\t\t\t\t\t<td style='text-align:center;' title='{$roomName}'><b>{$roomName}</b></td>\n\t\t\t\t\t\t<td style='text-align:center;' title='{$roomType}'>{$roomType}</td>\n\t\t\t\t\t\t<td style='text-align:center;' title='{$roomAddress}'>{$roomAddress}</td>\n\t\t\t\t\t\t<td style='text-align:center;' title='{$no_of_seats}'>{$no_of_seats}</td>\n\t\t\t\t\t\t<td style='text-align:center;'>{$room_details}</td></tr>";
    }
    $HTMLOUT .= "</table>";
} else {
    $HTMLOUT .= "No Seat info found";
}
//status of Server
$HTMLOUT .= end_block();
//Acknowledgement
$HTMLOUT .= begin_block("Acknowledgement", $caption_t = 'Acknowledgement', $per = 98, $tdcls = "colhead5", $img = "<img src='{$TK3GRE['pic_base_url']}dis.png' style=' height:28px;' alt='' title='' />", $title = 'Acknowledgement');
$HTMLOUT .= "<marquee behavior='scroll' scrollamount='4' direction='left' width='930'><fonr class='big'>\n\tWe would like to thank TK3 -  Ubiquitous / Mobile Computing group for providing our group, the opportunity to work on this final project.</font></marquee>";
$HTMLOUT .= end_block();
$HTMLOUT .= "<br />";
//Now, make the page
print stdhead('Home') . $HTMLOUT . stdfoot();
开发者ID:pranay22,项目名称:tu-darmstadt-TK3,代码行数:31,代码来源:index.php

示例13: end_block

    $HTMLOUT .= end_block();
    $HTMLOUT .= "<br />";
    //Fetch seat history details from database..
    $histories = @sql_query("SELECT * FROM history WHERE room_id={$room_id} AND seat_id={$seat_no}");
    if (mysql_num_rows($histories) > 0) {
        while ($history = mysql_fetch_assoc($histories)) {
            //recording historical data
            $recorded_status = $history["occupied"];
            $recorded_timestamp = $history["times"];
        }
    }
    //seat status of each room, no details..
    //$output = shell_exec('python ../Statistics/main.py -room_id={$room_id} -seat_id={$seat_no}');
    $output = shell_exec("python ../Statistics/main.py -room_id='{$room_id}' -seat_id='{$seat_no}'");
    //$output = shell_exec('python ../Statistics/main.py -room_id={$room_id} -seat_id={$seat_no} 2>&1');
    //$output = shell_exec("python ../Statistics/main.py -room_id='$room_id' -seat_id='$seat_no'  2>&1");
    if ($output == NULL) {
        $output = "ERROR!";
    }
    $HTMLOUT .= begin_block("Seat_History", $caption_t = "Predicted Seat Status", $per = 98, $tdcls = "colhead5", $img = "<img src='{$TK3GRE['pic_base_url']}status.png' style=' height:28px;' alt='' title='' />", $title = 'Predicted Seat Status');
    $HTMLOUT .= "According to prediction algorithm, predicted status of the seat at this point of time is ::  ";
    $HTMLOUT .= $output;
    //$HTMLOUT .= "It will show the history of seat of that particular room..";
    $HTMLOUT .= end_block();
    $HTMLOUT .= "<br />";
} else {
    $HTMLOUT = "";
    $HTMLOUT .= "<div class='notification warning2 autoWidth' style='width: 957px;'><span></span>\n         <div class='text'><p style='font-size: 12px;'><strong>Warning!</strong>Invalid room ID OR seat ID. Please go back.</p>\n         </div>\n        </div>";
}
//Now, make the page
print stdhead("Seat history for Seat no " . $room_id . " of Room no " . $room_id) . $HTMLOUT . stdfoot();
开发者ID:pranay22,项目名称:tu-darmstadt-TK3,代码行数:31,代码来源:seat_history.php

示例14: begin_block

<?php

if (!$site_config["MEMBERSONLY"] || $CURUSER) {
    begin_block(T_("BROWSE_TORRENTS"));
    $catsquery = SQL_Query_exec("SELECT distinct parent_cat FROM categories ORDER BY parent_cat");
    echo "<div id='maincats' class='bMenu'><ul>\n";
    echo "<li><a href='torrents.php'>" . T_("SHOW_ALL") . "</a></li>\n";
    while ($catsrow = mysql_fetch_assoc($catsquery)) {
        echo "<li><a href='torrents.php?parent_cat=" . urlencode($catsrow['parent_cat']) . "'>{$catsrow['parent_cat']}</a></li>\n";
    }
    echo "</ul></div>\n";
    end_block();
}
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:13,代码来源:maincats_block.php

示例15: SQL_Query_exec

<?php

if (!$site_config["MEMBERSONLY"] || $CURUSER) {
    $limit = 25;
    // Only show 25 max
    $res = SQL_Query_exec("SELECT torrents.id, torrents.name, torrents.image1, torrents.image2, categories.name as cat_name, categories.parent_cat as cat_parent FROM torrents LEFT JOIN categories ON torrents.category=categories.id WHERE banned = 'no' AND (image1 != '' OR image2 != '') AND visible = 'yes' ORDER BY id DESC LIMIT {$limit}");
    if (mysql_num_rows($res)) {
        begin_block(T_("LATEST_POSTERS"));
        print "<table align='center' cellpadding='0' cellspacing='0' width='100%' border='0'>";
        while ($row = mysql_fetch_assoc($res)) {
            $cat = htmlspecialchars("{$row['cat_parent']} - {$row['cat_name']}");
            $name = htmlspecialchars($row["name"]);
            if ($row["image1"]) {
                print "<tr><td align='center'><a href='{$site_config['SITEURL']}/torrents-details.php?id={$row['id']}' title='{$name} / {$cat}'><img border='0' src='uploads/images/{$row['image1']}' alt=\"{$name} / {$cat}\" width='100' /></a><br /></td></tr>";
            } else {
                print "<tr><td align='center'><a href='{$site_config['SITEURL']}/torrents-details.php?id={$row['id']}' title='{$name} / {$cat}'><img border='0' src='uploads/images/{$row['image2']}' alt=\"{$name} / {$cat}\" width='100' /></a><br /></td></tr>";
            }
        }
        print "</table>";
        end_block();
    }
}
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:22,代码来源:latestimages_block.php


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