本文整理汇总了PHP中dbrows函数的典型用法代码示例。如果您正苦于以下问题:PHP dbrows函数的具体用法?PHP dbrows怎么用?PHP dbrows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbrows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showsublinks
function showsublinks($sep = "·", $class = "")
{
$sres = dbquery("SELECT link_window, link_visibility, link_url, link_name FROM " . DB_SITE_LINKS . "\n\t\tWHERE " . groupaccess('link_visibility') . " AND link_position>='2' AND link_url!='---' ORDER BY link_order ASC");
if (dbrows($sres)) {
$i = 0;
$res = "<ul>\n";
while ($sdata = dbarray($sres)) {
$link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
$li_class = $i == 0 ? " class='first-link" . ($class ? " {$class}" : "") . "'" : ($class ? " class='{$class}'" : "");
if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
$res .= "<li" . $li_class . ">" . $sep . "<a href='" . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
} else {
$res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
}
$i++;
}
if (iMEMBER) {
$res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "setuser.php?logout=yes'><span>Logout</span></a> </li>\n";
} else {
$res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "register.php'><span>Register</span></a> </li>\n";
}
$res .= "</ul>\n";
return $res;
}
}
示例2: make_rss
function make_rss($feed_name, $feed_updfrq, $language = "all", $exists = false)
{
global $settings, $locale;
if (IF_MULTI_LANGUAGE && $language) {
$language = $language;
} else {
$language = false;
}
$feed_language = $language ? "_" . strtolower($language) : "";
if ($exists) {
$rows = true;
} else {
$result = dbquery("SELECT feed_name FROM " . DB_SS_FEEDS . " WHERE feed_name='" . $feed_name . "'");
$rows = dbrows($result);
}
if ($rows != 0) {
if (file_exists(INFUSIONS . "ss_feeds_panel/feeds/" . $feed_name . ".php")) {
include INFUSIONS . "ss_feeds_panel/feeds/" . $feed_name . ".php";
}
$rssfile = INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss";
if (file_exists($rssfile)) {
chmod($rssfile, 0777);
}
$write = false;
$file = fopen($rssfile, "w");
if (fwrite($file, $rss)) {
$write = true;
}
fclose($file);
chmod($rssfile, 0644);
return $write;
}
}
示例3: addNode
public function addNode($nodeId, $nodeName, $addInside, $nodeFields, $nodeValues)
{
// Lock table
$result = dbquery("LOCK TABLE " . $this->catTable . " WRITE");
$result = dbquery("SELECT " . $this->_getSelectFields() . " \n\t\t\tFROM " . $this->catTable . "\n\t\t\tWHERE " . $this->itemCatId . "='" . $nodeId . "'\n\t\t\tLIMIT 1");
if (dbrows($result)) {
// category_id name lft rgt
$data = dbarray($result);
// Add inside
if ($addInside == 1) {
if ($data[$this->catLeft] + 1 == $data[$this->catRight]) {
$value = $data[$this->catLeft];
} else {
$value = $data[$this->catRight] - 1;
}
// Add bellow
} else {
$value = $data[$this->catRight];
}
// Update
$this->_setNewNodeUpdate($value);
// Insert new node
$this->_setNewNodeInset($nodeName, $value, $nodeFields, $nodeValues);
}
// Unlock table
$result = dbquery("UNLOCK TABLES");
}
示例4: flood_control
function flood_control($field, $table, $where)
{
global $userdata, $settings, $locale;
$flood = false;
if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD)) {
$result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
if (dbrows($result)) {
$data = dbarray($result);
if (time() - $data['last_post'] < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_timestamp) VALUES ('" . USER_IP . "', '" . time() . "')");
if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
if (iMEMBER && $settings['flood_autoban'] == "1") {
require_once INCLUDES . "sendmail_include.php";
require_once INCLUDES . "suspend_include.php";
$result = dbquery("UPDATE " . DB_USERS . " SET user_status='4', user_actiontime='0' WHERE user_id='" . $userdata['user_id'] . "'");
suspend_log($userdata['user_id'], 4, $locale['global_440'], true);
$message = str_replace("[USER_NAME]", $userdata['user_name'], $locale['global_442']);
sendemail($userdata['user_name'], $userdata['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['global_441'], $message);
} elseif (!iMEMBER) {
$result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '', '" . $locale['global_440'] . "')");
}
}
}
}
}
return $flood;
}
示例5: GetExpeditionsCount
function GetExpeditionsCount($player_id)
{
global $db_prefix;
$query = "SELECT * FROM " . $db_prefix . "fleet WHERE (mission = 15 OR mission = 115 OR mission = 215) AND owner_id = {$player_id};";
$result = dbquery($query);
return dbrows($result);
}
示例6: Admin_Debug
function Admin_Debug()
{
global $session;
global $db_prefix;
global $GlobalUser;
if (method() === "POST") {
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT 50";
$result = dbquery($query);
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
if ($_POST["delmes" . $msg['error_id']] === "on" || $_POST['deletemessages'] === "deleteall") {
$query = "DELETE FROM " . $db_prefix . "debug WHERE error_id = " . $msg['error_id'];
dbquery($query);
}
}
}
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT 50";
$result = dbquery($query);
?>
<?php
echo AdminPanel();
?>
<table class='header'><tr class='header'><td><table width="519">
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Debug" method="POST">
<tr><td colspan="4" class="c">Сообщения</td></tr>
<tr><th>Действие</th><th>Дата</th><th>От</th><th>Браузер</th></tr>
<?php
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
$user = LoadUser($msg['owner_id']);
$from = "<a href=\"index.php?page=admin&session={$session}&mode=Users&player_id=" . $msg['owner_id'] . "\">" . $user['oname'] . "</a> [" . $msg['ip'] . "]";
$msg['text'] = str_replace("{PUBLIC_SESSION}", $session, $msg['text']);
echo "<tr><th><input type=\"checkbox\" name=\"delmes" . $msg['error_id'] . "\"/></th><th>" . date("m-d H:i:s", $msg['date']) . "</th><th>{$from} </th><th>" . $msg['agent'] . " </th></tr>\n";
echo "<tr><td class=\"b\"> </td><td class=\"b\" colspan=\"3\">" . $msg['text'] . "</td></tr>\n";
}
?>
<tr><td class="b"> </td><td class="b" colspan="3"></td></tr>
<tr><th colspan="4" style='padding:0px 105px;'></th></tr>
<tr><th colspan="4">
<select name="deletemessages">
<option value="deletemarked">Удалить выделенные сообщения</option>
<option value="deleteall">Удалить все сообщения</option>
</select><input type="submit" value="ok" /></th></tr>
<tr><td colspan="4"><center> </center></td></tr>
</form>
</table>
<?php
}
示例7: _force_auth
private function _force_auth($user_id)
{
global $locale, $settings;
$result = dbquery("\tSELECT * FROM " . DB_USERS . " WHERE user_id='" . $user_id . "' LIMIT 1");
if (dbrows($result) == 1) {
$user = dbarray($result);
ForceAuth::setUserCookie($user['user_id'], $user['user_salt'], $user['user_algo'], true, true);
}
}
示例8: load_sitelinks
/**
* Site Link Loader
* @param $link_id
* @return array
*/
public static function load_sitelinks($link_id)
{
$array = array();
if (isnum($link_id)) {
$result = dbquery("SELECT * FROM " . DB_SITE_LINKS . " " . (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : "WHERE") . " link_id='" . $_GET['link_id'] . "'");
if (dbrows($result)) {
return (array) dbarray($result);
}
}
return (array) $array;
}
示例9: move_photos
/**
* Returns all photos inside the album into an array
* @param $album_id
*/
function move_photos($album_id)
{
$result = dbquery("SELECT * FROM " . DB_PHOTOS . " WHERE album_id='" . $album_id . "'");
if (dbrows($result) > 0) {
while ($photo_data = dbarray($result)) {
rename(IMAGES . "photoalbum/album_" . $album_id . "/" . $photo_data['photo_filename'], INFUSIONS . "gallery/photos/" . $photo_data['photo_filename']);
rename(IMAGES . "photoalbum/album_" . $album_id . "/" . $photo_data['photo_thumb1'], INFUSIONS . "gallery/photos/" . $photo_data['photo_thumb1']);
rename(IMAGES . "photoalbum/album_" . $album_id . "/" . $photo_data['photo_thumb2'], INFUSIONS . "gallery/photos/" . $photo_data['photo_thumb2']);
}
}
}
示例10: forum_subcats
function forum_subcats($forum_id)
{
global $settings, $locale, $userdata, $lastvisited;
$a_result = dbquery("SELECT * FROM " . DB_FORUMS . " f LEFT JOIN " . DB_USERS . " u on f.forum_lastuser=u.user_id WHERE " . groupaccess('f.forum_access') . " AND forum_parent='" . $_GET['forum_id'] . "' ORDER BY forum_order");
if (dbrows($a_result) != 0) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'>" . $locale['401'] . "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['402'] . "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['403'] . "</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>" . $locale['404'] . "</td>\n";
echo "</tr>\n";
while ($a_data = dbarray($a_result)) {
echo "<tr>\n";
$moderators = "";
if ($a_data['forum_moderators']) {
$mod_groups = explode(".", $a_data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) {
$moderators .= ", ";
}
$moderators .= $mod_group < 101 ? "<a href='" . BASEDIR . "profile.php?group_id=" . $mod_group . "'>" . getgroupname($mod_group) . "</a>" : getgroupname($mod_group);
}
}
if ($a_data['forum_lastpost'] > $lastvisited) {
$forum_match = "\\|" . $a_data['forum_lastpost'] . "\\|" . $a_data['forum_id'];
if (iMEMBER && ($a_data['forum_lastuser'] == $userdata['user_id'] || preg_match("({$forum_match}\\.|{$forum_match}\$)", $userdata['user_threads']))) {
$fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />";
} else {
$fim = "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' />";
}
} else {
$fim = "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' />";
}
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>{$fim}</td>\n";
echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=" . $a_data['forum_id'] . "'>" . $a_data['forum_name'] . "</a><br />\n";
if ($a_data['forum_description'] || $moderators) {
echo "<span class='small'>" . $a_data['forum_description'] . ($a_data['forum_description'] && $moderators ? "<br />\n" : "");
echo ($moderators ? "<strong>" . $locale['411'] . "</strong>" . $moderators . "</span>\n" : "</span>\n") . "\n";
}
echo "</td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . $a_data['forum_threadcount'] . "</td>\n";
echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>" . $a_data['forum_postcount'] . "</td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
if ($a_data['forum_lastpost'] == 0) {
echo $locale['405'] . "</td>\n</tr>\n";
} else {
echo showdate("forumdate", $a_data['forum_lastpost']) . "<br />\n";
echo "<span class='small'>" . $locale['406'] . profile_link($a_data['forum_lastuser'], $a_data['user_name'], $a_data['user_status']) . "</span></td>\n";
echo "</tr>\n";
}
}
echo "</table>";
}
}
示例11: read_session
function read_session($session_id)
{
global $sess_read;
$result = dbquery("SELECT session_data FROM " . DB_SESSIONS . " WHERE session_id='" . valid_session($session_id) . "'");
if (dbrows($result)) {
$sess_read = dbarray($result);
return $sess_read['session_data'];
} else {
return $sess_read = "";
}
}
示例12: delusersaction
function delusersaction()
{
global $locale;
opentable($locale['urg_a_dbmgnt_106']);
if (isset($_POST['delusers']) && $_POST['delusers'] == '1') {
$sql = dbquery("SELECT * FROM " . DB_UG3 . " WHERE owner_id NOT IN (SELECT user_id FROM " . DB_USERS . ")");
if (dbrows($sql) != 0) {
//If this member doesn't exist
opentable($locale['urg_a_dbmgnt_106']);
while ($data = dbarray($sql)) {
$deluser = dbquery("DELETE FROM " . DB_UG3 . " WHERE owner_id = '" . $data['owner_id'] . "'");
if ($deluser) {
echo "<span style='color: green;'>" . sprintf($locale['urg_a_dbmgnt_109'], $data['owner_name'], $data['owner_id']) . "</span><br />\n";
} else {
echo "<span style='color: red;'>" . sprintf($locale['urg_a_dbmgnt_110'], $data['owner_name'], $data['owner_id']) . "</span><br />\n";
}
}
//end
closetable();
opentable($locale['urg_a_dbmgnt_107']);
$sql2 = dbquery("SELECT * FROM " . DB_UG3_INVENTORY . " WHERE ownerid NOT IN (SELECT user_id FROM " . DB_USERS . ")");
while ($data2 = dbarray($sql2)) {
$delinv = dbquery("DELETE FROM " . DB_UG3_INVENTORY . " WHERE ownerid = '" . $data2['ownerid'] . "'");
if ($delinv) {
echo "<span style='color: green;'>" . sprintf($locale['urg_a_dbmgnt_111'], $data2['itemname'], $data2['ownerid']) . "</span><br />\n";
} else {
echo "<span style='color: red;'>" . sprintf($locale['urg_a_dbmgnt_112'], $data2['itemname'], $data2['ownerid']) . "</span><br />\n";
}
}
//end
closetable();
opentable($locale['urg_a_dbmgnt_108']);
$sql3 = dbquery("SELECT * FROM " . DB_UG3_TRANSACTIONS . " WHERE transaction_user_id NOT IN (SELECT user_id FROM " . DB_USERS . ")");
while ($data3 = dbarray($sql3)) {
$deltrans = dbquery("DELETE FROM " . DB_UG3_TRANSACTIONS . " WHERE transaction_user_id = '" . $data3['transaction_user_id'] . "'");
if ($deltrans) {
echo "<span style='color: green;'>" . sprintf($locale['urg_a_dbmgnt_113'], $data3['transaction_id'], $data3['transaction_user_id']) . "</span><br />\n";
} else {
echo "<span style='color: red;'>" . sprintf($locale['urg_a_dbmgnt_114'], $data3['transaction_id'], $data3['transaction_user_id']) . "</span><br />\n";
}
}
//end
closetable();
} else {
opentable($locale['urg_a_dbmgnt_115']);
echo "<div>" . $locale['urg_a_dbmgnt_115'] . "</div>\n";
closetable;
}
} else {
echo "<div>" . $locale['urg_a_dbmgnt_116'] . "</div>\n";
}
closetable;
}
示例13: inGroup
function inGroup($id)
{
global $userdata;
if (iMEMBER) {
$check = dbquery("SELECT * FROM " . DB_GS_GROUP_USERS . " WHERE guser_user='" . $userdata['user_id'] . "' AND guser_group='" . $id . "'");
if (dbrows($check)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
示例14: Admin_Browse
function Admin_Browse()
{
global $session;
global $db_prefix;
global $GlobalUser;
$query = "SELECT * FROM " . $db_prefix . "browse ORDER BY date DESC LIMIT 50";
$result = dbquery($query);
AdminPanel();
$rows = dbrows($result);
echo "Последняя история переходов (50 записей):<br>";
echo "<table>\n";
while ($rows--) {
$log = dbarray($result);
$user = LoadUser($log['owner_id']);
?>
<tr><td><table>
<tr> <th> <?php
echo $user['oname'];
?>
</th> <th> <?php
echo $log['url'];
?>
</th> </tr>
<tr> <th rowspan=2>
<?php
echo $log['method'];
?>
<br>
<?php
echo date("d M Y", $log['date']);
?>
<br>
<?php
echo date("H:i:s", $log['date']);
?>
</th> <th> <?php
echo print_r(unserialize($log['getdata']));
?>
</th> </tr>
<tr> <th> <?php
echo print_r(unserialize($log['postdata']));
?>
</th> </tr>
</table></td></tr>
<?php
}
echo "</table>\n";
}
示例15: get_attachments
public static function get_attachments(array $thread_data)
{
$attachments = array();
if (self::get_attachment_permissions("can_download_attach") == TRUE) {
$a_result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE thread_id='" . intval($thread_data['thread_id']) . "' ORDER BY post_id ASC");
if (dbrows($a_result) > 0) {
while ($a_data = dbarray($a_result)) {
if (file_exists(INFUSIONS . "forum/attachments/" . $a_data['attach_name'])) {
//$this->thread_info['attachments'][$a_data['post_id']][] = $a_data;
$attachments[$a_data['post_id']][] = $a_data;
}
}
}
}
return (array) $attachments;
}