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


PHP SmrMySqlDatabase::nf方法代码示例

本文整理汇总了PHP中SmrMySqlDatabase::nf方法的典型用法代码示例。如果您正苦于以下问题:PHP SmrMySqlDatabase::nf方法的具体用法?PHP SmrMySqlDatabase::nf怎么用?PHP SmrMySqlDatabase::nf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SmrMySqlDatabase的用法示例。


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

示例1: addbyte

    $file .= addbyte(sqrt($db->f("num_sec")));
}
//planet definitions (num of, [size of name, name])
$file .= addbyte(2);
$file .= addbyte(8);
$file .= "Friendly";
$file .= addbyte(5);
$file .= "Enemy";
//done with all header info
$db2 = new SmrMySqlDatabase();
$db3 = new SmrMySqlDatabase();
$db->query("SELECT * FROM sector WHERE game_id = {$game_id} ORDER BY sector_id");
while ($db->next_record()) {
    $sector_id = $db->f("sector_id");
    $db2->query("SELECT * FROM player_visited_sector WHERE sector_id = {$sector_id} AND game_id = {$game_id} AND account_id = {$player->account_id} LIMIT 1");
    if ($db2->nf() > 0) {
        $CurrByte = 3;
        $up = $db->f("link_up");
        $db2->query("SELECT * FROM player_visited_sector WHERE sector_id = {$up} AND game_id = {$game_id} AND account_id = {$player->account_id} LIMIT 1");
        if ($db2->nf() == 0 && $up != 0) {
            $CurrByte += 128;
        }
        $right = $db->f("link_right");
        $db2->query("SELECT * FROM player_visited_sector WHERE sector_id = {$right} AND game_id = {$game_id} AND account_id = {$player->account_id} LIMIT 1");
        if ($db2->nf() == 0 && $right != 0) {
            $CurrByte += 64;
        }
        $down = $db->f("link_down");
        $db2->query("SELECT * FROM player_visited_sector WHERE sector_id = {$down} AND game_id = {$game_id} AND account_id = {$player->account_id} LIMIT 1");
        if ($db2->nf() == 0 && $down != 0) {
            $CurrByte += 32;
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:mgu_create.php

示例2: addbyte

 if ($db->f("link_left") > 0) {
     $CurrByte += 16;
 }
 //do we have a planet here?
 $db2->query("SELECT * FROM planet WHERE game_id = {$game_id} AND sector_id = {$sector_id}");
 if ($db2->next_record()) {
     $CurrByte += 8;
 }
 //do we have a port here?
 $db2->query("SELECT * FROM port WHERE game_id = {$game_id} AND sector_id = {$sector_id}");
 if ($db2->next_record()) {
     $CurrByte += 4;
 }
 //sector friendliness
 $db2->query("SELECT * FROM sector_has_forces WHERE sector_id = {$sector_id} AND mines > 0 AND owner_id IN {$alliance}");
 if ($db2->nf() > 0) {
     //we want a green "friendly" sector
     $CurrByte += 1;
 } else {
     //we want a blue "neutral" sector
     $CurrByte += 0;
 }
 $file .= addbyte($CurrByte);
 $db2->query("SELECT * FROM port WHERE game_id = {$game_id} AND sector_id = {$sector_id}");
 $race = 0;
 $has_port = FALSE;
 if ($db2->next_record()) {
     $has_port = TRUE;
     $race = $db2->f("race_id");
     if ($race == 1) {
         $race = 9;
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:mgu_create_full.php

示例3: get_file_loc

include get_file_loc("council.inc");
include get_file_loc('menue.inc');
print_topic("RULING COUNCIL OF {$player->race_name}");
print_council_menue($player->race_id, getPresident($player->race_id));
print "<table border=\"0\" class=\"standard\" cellspacing=\"0\" align=\"center\" width=\"50%\">";
print "<tr>";
print "<th>Race</th>";
print "<th>Treaty</th>";
print "</tr>";
$db2 = new SmrMySqlDatabase();
$db->query("SELECT * FROM race " . "WHERE race_id != {$player->race_id} AND " . "race_id > 1");
while ($db->next_record()) {
    $race_id = $db->f("race_id");
    $race_name = $db->f("race_name");
    $db2->query("SELECT * FROM race_has_voting " . "WHERE game_id = {$player->game_id} AND " . "race_id_1 = {$player->race_id} AND " . "race_id_2 = {$race_id}");
    if ($db2->nf() > 0) {
        continue;
    }
    print "<tr>";
    print "<td align=\"center\">" . $player->get_colored_race($race_id) . "</td>";
    $container = array();
    $container["url"] = "council_embassy_processing.php";
    $container["race_id"] = $race_id;
    print_form($container);
    print "<td align=\"center\">";
    print_submit("Peace");
    print "&nbsp;";
    print_submit("War");
    print "</td>";
    print "</form>";
    print "</tr>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:council_embassy.php

示例4: date

        }
        print "<td nowrap=\"nowrap\" align=\"center\">";
        if ($voted_for == "YES") {
            print_submit_style("Yes", "background-color:green;");
        } else {
            print_submit("Yes");
        }
        print "&nbsp;";
        if ($voted_for == "NO") {
            print_submit_style("No", "background-color:green;");
        } else {
            print_submit("No");
        }
        if ($president->account_id == $player->account_id) {
            print "&nbsp;";
            print_submit("Veto");
        }
        print "</td>";
        // get 'yes' votes
        $db2->query("SELECT * FROM player_votes_pact " . "WHERE game_id = {$player->game_id} AND " . "race_id_1 = {$player->race_id} AND " . "race_id_2 = {$race_id_2} AND " . "vote = 'YES'");
        $yes_votes = $db2->nf();
        // get 'no' votes
        $db2->query("SELECT * FROM player_votes_pact " . "WHERE game_id = {$player->game_id} AND " . "race_id_1 = {$player->race_id} AND " . "race_id_2 = {$race_id_2} AND " . "vote = 'NO'");
        $no_votes = $db2->nf();
        print "<td align=\"center\">{$yes_votes} / {$no_votes}</td>";
        print "<td nowrap=\"nowrap\"align=\"center\">" . date("n/j/Y", $end_time) . "<br>" . date("g:i:s A", $end_time) . "</td>";
        print "</form>";
        print "</tr>";
    }
    print "</table>";
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:council_vote.php

示例5: while

    $db->query("SELECT * FROM alliance WHERE game_id = {$player->game_id} ORDER BY alliance_kills DESC, alliance_name LIMIT 5");
    while ($db->next_record()) {
        $alliance_vs[] = $db->f("alliance_id");
    }
    //print("emtpy $alliancer");
} else {
    $alliance_vs = $alliancer;
}
$alliance_vs[] = 0;
foreach ($alliance_vs as $key => $id) {
    // get current alliance
    $curr_alliance_id = $id;
    if ($id > 0) {
        $curr_alliance = new SMR_ALLIANCE($id, SmrSession::$game_id);
        $db2->query("SELECT * FROM player WHERE alliance_id = {$id} AND game_id = " . SmrSession::$game_id);
        if ($db2->nf() == 0) {
            $out = TRUE;
        } else {
            $out = FALSE;
        }
        print "<td width=15% valign=\"top\"";
        if ($player->alliance_id == $curr_alliance_id) {
            print " style=\"font-weight:bold;\"";
        }
        print ">";
        /*$container = array();
        		$container["url"]             = "skeleton.php";
        		$container["body"]             = "alliance_roster.php";
        		$container["alliance_id"]    = $curr_alliance_id;
        		print_link($container, "$curr_alliance->alliance_name");*/
        print "<select name=alliancer[] style=width:105>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:rankings_alliance_vs_alliance.php

示例6: SmrMySqlDatabase

<?php

$db = new SmrMySqlDatabase();
$db->query("SELECT * FROM account, announcement " . "WHERE account_id = " . SmrSession::$old_account_id . " AND " . "last_login < time");
$container = array();
// do we have announcements?
if ($db->nf() != 0) {
    $container["url"] = "skeleton.php";
    $container["body"] = "announcements.php";
} else {
    $container["url"] = "logged_in.php";
}
forward($container);
开发者ID:smrealms,项目名称:smrv2.0,代码行数:13,代码来源:announcements_check.php

示例7: made

 print_link(create_container("skeleton.php", "galactic_post_view_article.php"), "View the articles");
 print "<br>";
 print_link(create_container("skeleton.php", "galactic_post_make_paper.php"), "Make a paper");
 print "<br>";
 print_link(create_container("skeleton.php", "galactic_post_view_members.php"), "View Members");
 print "<br>";
 $db->query("SELECT * FROM galactic_post_paper WHERE game_id = {$player->game_id}");
 if ($db->nf()) {
     print "The following papers are already made (note papers must have 3-8 articles to go to the press)";
 }
 while ($db->next_record()) {
     $paper_name = $db->f("title");
     $paper_id = $db->f("paper_id");
     print "<font color=red>***</font><i>{$paper_name}</i>";
     $db2->query("SELECT * FROM galactic_post_paper_content WHERE paper_id = {$paper_id} AND game_id = {$player->game_id}");
     print " which contains <font color=red> " . $db2->nf() . " </font>articles. ";
     if ($db2->nf() > 2 && $db2->nf() < 9) {
         $container = array();
         $container["url"] = "galactic_post_make_current.php";
         $container["id"] = $paper_id;
         print_link($container, "<b>HIT THE PRESS!</b>");
     }
     print "<br>";
     $container = array();
     $container["url"] = "skeleton.php";
     $container["body"] = "galactic_post_delete_confirm.php";
     $container["paper"] = "yes";
     $container["id"] = $paper_id;
     print_link($container, "Delete {$paper_name}");
     print "<br>";
     $container = array();
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:galactic_post.php

示例8: SmrMySqlDatabase

if (!isset($var["folder_id"])) {
    print_topic("VIEW MESSAGES");
    include get_file_loc('menue.inc');
    print_message_menue();
    print "<p>Please choose your Message folder!</p>";
    print "<p>";
    print "<table border=\"0\" class=\"standard\" cellspacing=\"0\" cellpadding=\"3\">";
    print "<tr>";
    print "<th>Folder</th>";
    print "<th>Messages</th>";
    print "<th>&nbsp;</th>";
    print "</tr>";
    $db2 = new SmrMySqlDatabase();
    include get_file_loc("council.inc");
    $db2->query("SELECT * FROM message WHERE account_id = {$player->account_id} AND message_type_id = " . MSG_POLITICAL . " AND game_id = {$player->game_id}");
    if (onCouncil($player->race_id) || $db2->nf()) {
        $db->query("SELECT * FROM message_type " . "WHERE message_type_id < 8 " . "ORDER BY message_type_id");
    } else {
        $db->query("SELECT * FROM message_type " . "WHERE message_type_id != 5 " . "ORDER BY message_type_id");
    }
    while ($db->next_record()) {
        $message_type_id = $db->f("message_type_id");
        $message_type_name = $db->f("message_type_name");
        // do we have unread msges in that folder?
        $db2->query("SELECT * FROM message " . "WHERE account_id = " . SmrSession::$old_account_id . " AND " . "game_id = " . SmrSession::$game_id . " AND " . "message_type_id = {$message_type_id} AND " . "msg_read = 'FALSE'");
        $msg_read = $db2->nf();
        // get number of msges
        $db2->query("SELECT count(message_id) as message_count FROM message " . "WHERE account_id = " . SmrSession::$old_account_id . " AND " . "game_id = " . SmrSession::$game_id . " AND " . "message_type_id = {$message_type_id}");
        if ($db2->next_record()) {
            $message_count = $db2->f("message_count");
        }
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:message_view.php

示例9: SmrMySqlDatabase

print_bar_menue();
$db = new SmrMySqlDatabase();
$db->query("SELECT message_id FROM bar_wall WHERE sector_id = {$sector->sector_id} AND game_id = " . SmrSession::$game_id . " ORDER BY message_id DESC");
if ($db->next_record()) {
    $amount = $db->f("message_id") + 1;
} else {
    $amount = 1;
}
$time_now = time();
$db2 = new SmrMySqlDatabase();
$wall = $_REQUEST['wall'];
if (isset($wall)) {
    $db2->query("INSERT INTO bar_wall (sector_id, game_id, message_id, message, time) VALUES ({$sector->sector_id}, " . SmrSession::$game_id . ", {$amount},  " . format_string($wall, true) . " , {$time_now})");
}
$db->query("SELECT * FROM bar_wall WHERE game_id = {$player->game_id} AND sector_id = {$player->sector_id} ORDER BY time DESC");
if ($db->nf()) {
    print "<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" class=\"standard\">";
    print "<tr>";
    print "<th align=\"center\">Time written</th>";
    print "<th align=\"center\">Message</th>";
    print "</tr>";
    while ($db->next_record()) {
        $time = $db->f("time");
        $message_on_wall = stripslashes($db->f("message"));
        print "<tr>";
        print "<td align=\"center\"><b> " . date("n/j/Y g:i:s A", $time) . " </b></td>";
        print "<td align=\"center\"><b>{$message_on_wall}</b></td>";
        print "</tr>";
    }
    print "</table>";
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:bar_read_wall.php

示例10: SmrMySqlDatabase

print_topic("GALACTIC POST");
$db2 = new SmrMySqlDatabase();
$db3 = new SmrMySqlDatabase();
$db->query("SELECT * FROM galactic_post_online WHERE game_id = {$player->game_id}");
if ($db->nf()) {
    $db->next_record();
    $paper_id = $db->f("paper_id");
    $db2->query("SELECT * FROM galactic_post_paper WHERE game_id = {$player->game_id} AND paper_id = {$paper_id}");
    $db2->next_record();
    $paper_name = stripslashes($db2->f("title"));
    print_topic("READING <i>GALACTIC POST</i> EDITION : {$paper_name}");
    include get_file_loc('menue.inc');
    print_galactic_post_menue();
    $db2->query("SELECT * FROM galactic_post_paper_content WHERE paper_id = {$paper_id} AND game_id = {$player->game_id}");
    if (floor($db2->nf() / 2) == $db2->nf() / 2) {
        $even = "yes";
    } else {
        $even = "no";
    }
    $curr_position = 0;
    print "<table align=\"center\" spacepadding=\"20\" cellspacing=\"20\">";
    if ($even == "yes") {
        $amount = $db2->nf();
    } else {
        $amount = $db2->nf() + 1;
    }
    while ($curr_position + 1 <= $amount) {
        $curr_position += 1;
        if ($db2->nf() + 1 == $curr_position && $even != "yes") {
            print "<td>&nbsp;</td>";
开发者ID:smrealms,项目名称:smrv2.0,代码行数:30,代码来源:galactic_post_read.php


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