示例#1
0
function include_tribe_text()
{
    include_once 'inc/functions/tribe.php';
    require_once 'inc/classes/clsGame.php';
    $objGame = new clsGame();
    $strSwitch = $objGame->get_game_switch('update_button');
    $objSrcUser =& $GLOBALS['objSrcUser'];
    $arrSrcStats = $objSrcUser->get_stats();
    $arrSrcUsers = $objSrcUser->get_user_infos();
    $objSrcAlli = $objSrcUser->get_alliance();
    //==========================================================================
    // Elder Message
    //==========================================================================
    if (isset($objSrcAlli) && !empty($objSrcAlli)) {
        echo get_eldermessage_text($objSrcAlli);
    }
    //==========================================================================
    // Free update button
    // 1st case, change for classic oop testing ## 2nd case: devork 1008 updates
    //==========================================================================
    if ($strSwitch == ON && $_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME) {
        $iHours = $arrSrcUsers[HOURS];
        if (isset($_POST['update']) && $iHours >= 0 && $iHours < PROTECTION_HOURS) {
            require_once 'inc/functions/update_script.php';
            generate_updates($objSrcUser, 1);
            $iHours++;
        }
        if ($iHours >= 0 && $iHours < PROTECTION_HOURS) {
            echo '<form id="center" action="main.php?cat=game&amp;page=tribe" method="post">' . '<input type="submit" name="update" value="Update Me" />' . '</form>';
        }
    } elseif ($strSwitch == ON && $_SERVER['SERVER_NAME'] == DEV_SERVER_NAME) {
        $iHours = $arrSrcUsers[HOURS];
        if (isset($_POST['update']) && $iHours >= 0 && $iHours < 1008) {
            require_once 'inc/functions/update_script.php';
            generate_updates($objSrcUser, 1);
            $iHours++;
        }
        if ($iHours >= 0 && $iHours < 1008) {
            echo '<form id="center" action="main.php?cat=game&amp;page=tribe" method="post">' . '<input type="submit" name="update" value="Update Me" />' . '</form>';
        }
    }
    //==========================================================================
    // Show Self Vision
    //==========================================================================
    // Link to Tribe News
    $dtLastNews = $arrSrcUsers[LAST_NEWS];
    $strNewsLink = '<br /><a href="main.php?cat=game&amp;page=news"';
    if ($dtLastNews == 0) {
        $strNewsLink .= '>Tribe News</a>';
    } else {
        $strNewsLink .= ' class = "check_new">Our Tribe Has News!</a>';
    }
    echo '<div class="tableLinkMedium">' . $strNewsLink . ' | ' . '<a href="main.php?cat=game&amp;page=advisors">Internal Affairs</a>' . '</div>';
    echo get_tribe_table($objSrcUser);
    //==========================================================================
    // Area with text below tribe table
    //==========================================================================
    $strText = '<div id="textMedium" style="clear: both;">' . '<h2>' . 'Your head advisor greets you:' . '</h2>';
    // Check First 3 Logins prior to verification
    $strVerificationCode = $objSrcUser->get_preference(EMAIL_ACTIVATION);
    if ($arrSrcUsers[LOGINS] < 3 && $strVerificationCode != 'verified') {
        if ($arrSrcUsers[LOGINS] == 1) {
            $strText .= '<p>Welcome to ORKFiA! You may login once more before you need to <a href="main.php?cat=game&amp;page=verify">verify your email address</a>.</p>';
        } elseif ($arrSrcUsers[LOGINS] == 2) {
            $strText .= '<p>Welcome to ORKFiA! Next time you login you will need to <a href="main.php?cat=game&amp;page=verify">verify your email address</a>.</p>';
        }
    }
    // Check Protection Hours Remaining
    $strText .= '<p>' . obj_check_protection($objSrcUser, 'status') . '</p>';
    // Manual Session handler (warns 20 minutes prior to being logged out)
    $fourHoursAgo = date('Y-m-d H:i:s', strtotime('-4 hours 20 minutes'));
    if ($arrSrcUsers[LAST_LOGIN] < $fourHoursAgo) {
        $strText .= '<p>' . "... Less than 20 minutes before you are required to login again" . " ..." . '</p>';
    }
    // frost: added "accept truce" for elder
    // Martel: recoded to use objects
    $arrSrcWar = $objSrcAlli->get_wars();
    if ($arrSrcWar[TARGET] != 0) {
        $objTrgAlli = new clsAlliance($arrSrcWar[TARGET]);
        $arrTrgWar = $objTrgAlli->get_wars();
        if ($arrTrgWar[TRUCE_OFFER] == 1) {
            $strText .= '<p>' . 'The enemy alliance (#' . $objTrgAlli->get_allianceid() . ') has offered us a ' . '<a href="main.php?cat=game&page=war_alliance">truce</a>.' . '</p>';
        } elseif ($arrSrcWar[TRUCE_OFFER] == 1) {
            $strText .= '<p>' . 'News from our war with alliance (#' . $objTrgAlli->get_allianceid() . '): Our alliance diplomats have been sent to negotiate a truce with the enemy.' . '</p>';
        }
    }
    // If account is paused
    if ($arrSrcUsers[PAUSE_ACCOUNT] > 1 && $arrSrcUsers[PAUSE_ACCOUNT] <= 48) {
        $strText .= '<p>' . 'Your account is currently paused, it will be ' . 'accessible for play in ' . ($arrSrcUsers[PAUSE_ACCOUNT] - 1) . ' updates.' . '<br />' . '(You may remain paused for longer if you so wish.)' . '</p>';
    } elseif ($arrSrcUsers[PAUSE_ACCOUNT] > 1 && $arrSrcUsers[PAUSE_ACCOUNT] > 48) {
        $strText .= '<p>' . 'Your tribe is currently entering vacation mode, it will be ' . 'fully protected in ' . ($arrSrcUsers[PAUSE_ACCOUNT] - 49) . ' updates.' . '<br />' . '(Until then you can be attacked by other players.)' . '</p>';
    } elseif ($arrSrcUsers[PAUSE_ACCOUNT] == 1) {
        $strText .= '<p>' . 'Your account is currently paused but is accessible for ' . 'play now. If you wish to leave protection go to Options -> ' . '<a href="main.php?cat=game&page=preferences&task=pause_account">' . 'Pause Account</a>.' . '</p>';
    }
    $strText .= '<div style="float: left; margin: 0 0 10px 10px; text-align: center; overflow: hidden; border: 3px double #444; background: #FFF; height: 42px; width: 154px; ">' . '<a style="border: 0; display: block; color: #444; font: 15px Georgia, Times, serif; line-height: 17px; padding: 4px 0;" href="http://www.orkfiantimes.co.uk/" target="_blank">The Orkfian Times<br /><span style="font-size: 10px; border-top: #444 3px double; letter-spacing: 0.1pt;">A New Issue Every Week!</span></a>' . '</div>' . '<div style="float: left; margin: 0 0 10px 10px; text-align: center; overflow: hidden; border: 3px double #444; background: #FFF; height: 42px; width: 154px; ">' . '<a style="border: 0; display: block; color: #444; font: italic 16px \'Times new roman\'; line-height: 42px;" href="http://www.orkfiantimes.co.uk/faces.html" target="_blank">The Faces of ORKFiA</a>' . '</div>' . '<hr class="clear" style="visibility: hidden;">';
    echo $strText;
    // Voting Portal Links for ORKFiA
    $voteStatus = '';
    $check = md5($arrSrcStats['id'] . $arrSrcStats[RACE] . date('d'));
    if ($_SERVER['SERVER_NAME'] == 'orkfia.phpsupport.se') {
        $week = date('W', strtotime('-12 hours'));
        if ($arrSrcUsers[HOURS] >= PROTECTION_HOURS) {
            $iBonus = $objSrcUser->get_build(LAND) * 1000;
        } else {
            $iBonus = 100000;
        }
        if ($arrSrcStats[RACE] == "Dragon") {
            $iBonus = floor($iBonus / 2);
        }
        $strBonus = number_format($iBonus);
        if ($arrSrcStats[TWG_VOTE] == $week) {
            $voteStatus = ' (already voted)';
        } else {
            $voteStatus = ' (<strong>' . $strBonus . ' cr</strong>).';
        }
    }
    $strVoteLinks = '<p>Vote for us @ ' . '<a href="http://apexwebgaming.com/in/518" target="_blank">' . 'Apex Web Gaming</a>' . ' and ' . '<a href="http://www.topwebgames.com/in.asp?id=744&amp;vuser='******'&amp;check=' . $check . '" target="_blank">' . 'TWG' . '</a>' . $voteStatus . '</p>';
    echo $strVoteLinks;
    include_once 'inc/functions/forums.php';
    if ($_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME && get_sponsor_badge($arrSrcStats[ID]) == '') {
        ?>

        <hr />
        <h2>Become a Dragon - ORKFiA Classic</h2>
        <hr />

        <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin-left: auto; margin-right: auto; text-align: center;">
            <input type="hidden" name="cmd" value="_xclick" />
            <input type="hidden" name="business" value="*****@*****.**" />
            <input type="hidden" name="undefined_quantity" value="1" />
            <input type="hidden" name="item_name" value="One Week Sponsorship" />
            <input type="hidden" name="item_number" value="Classic Dragon" />
            <input type="hidden" name="amount" value="2.00" />
            <input type="hidden" name="shipping" value="0.00" />
            <input type="hidden" name="no_shipping" value="1" />
            <input type="hidden" name="return" value="<?php 
        echo HOST;
        ?>
main.php?cat=main&amp;page=sponsors&amp;thankyou" />
            <input type="hidden" name="cn" value="Message to admin" />
            <input type="hidden" name="currency_code" value="USD" />
            <input type="hidden" name="tax" value="0.00" />
            <input type="hidden" name="lc" value="SE" />
            <input type="hidden" name="bn" value="PP-BuyNowBF" />
            <table class="small" cellspacing="0" cellpadding="0">
                <tr class="header">
                    <th colspan="3">Become a Classic Dragon</th>
                </tr>
                <tr class="data">
                    <th>Rank 4:</th>
                    <td><span class="elder">Classic Dragon</span></td>
                    <td rowspan="3"><img src="<?php 
        echo HOST_PICS;
        ?>
dragon_classic.gif" alt="Dragon" /></td>
                </tr>
                <tr class="data">
                    <th>Donation:</th>
                    <td>$2 / week</td>
                </tr>
                <tr class="data">
                    <th><input type="hidden" name="on0" value="Login nick" /><label for="i4">Login nick:</label></th>
                    <td><input type="text" name="os0" id="i4" maxlength="60" value="<?php 
        echo $arrSrcUsers[USERNAME];
        ?>
" /></td>
                </tr>
            </table>
            <input type="submit" name="submit" value="Sponsor ORKFiA for 1 week" />
        </form>
        <p>Help us advertise and reduce the server costs. <a href="main.php?cat=game&amp;page=sponsors">Become a Dragon</a> to support ORKFiA Classic.</p>

<?php 
    } elseif ($_SERVER['SERVER_NAME'] != DINAH_SERVER_NAME && get_sponsor_badge($arrSrcStats[ID]) == '') {
        include_once 'inc/pages/sponsors.inc.php';
        echo show_sponsor_options($arrSrcUsers[USERNAME]);
    } elseif (($strBadge = get_sponsor_badge($arrSrcStats[ID])) != '') {
        echo '<hr />' . '<h2>Thank you for supporting ORKFiA!</h2>' . '</hr />' . '<div class="center">' . $strBadge . '</div>';
    }
    echo '</div>';
    //==========================================================================
    // Admin Message (message of the day)
    //==========================================================================
    $iStatus = $arrSrcUsers[STATUS];
    if ($iStatus == 2) {
        echo '<br /><br />';
        include_once 'inc/pages/motd.inc.php';
        include_motd_text();
    } else {
        echo '<br />' . '<div class="center">' . '<a href="main.php?cat=game&amp;page=motd">' . 'View Admin Message' . '</a></div>';
    }
    //==========================================================================
    // Species5618: added a safety-mechanism for the doubleclickprotection on
    // magic, switch will be set to free whenever a tribe looks at the tribepage
    //==========================================================================
    $objSrcUser->set_spell(CASTING_NOW, "'free'");
    //==========================================================================
    // Empty Database from Deleted Tribes (These are "moved" to alliance #0)
    //==========================================================================
    include_once 'inc/classes/clsAlliance.php';
    $objTmpAlliance = new clsAlliance(0);
    $objTmpAlliance->delete_users();
}
示例#2
0
function include_register2_text()
{
    $arrRegister = $_POST['register'];
    $arrRegister['login'] = addslashes(strip_tags(trim($arrRegister['login'])));
    $arrRegister['realname'] = addslashes(strip_tags(trim($arrRegister['realname'])));
    $arrRegister['country'] = addslashes(strip_tags(trim($arrRegister['country'])));
    $arrRegister['password'] = trim($arrRegister['password']);
    $arrRegister['verify'] = trim($arrRegister['verify']);
    $arrRegister['email'] = addslashes(strip_tags(trim($arrRegister['email'])));
    $arrRegister['tribe'] = addslashes(str_replace("'", "", strip_tags(trim($arrRegister['tribe']))));
    $arrRegister['alias'] = addslashes(strip_tags(trim($arrRegister['alias'])));
    $arrRegister['race'] = addslashes(strip_tags(trim($arrRegister['race'])));
    $arrRegister['bootcamp'] = addslashes(strip_tags(trim($arrRegister['bootcamp'])));
    $arrRegister['scriptstop'] = intval(str_replace(" ", "", $arrRegister['scriptstop']));
    echo '<div id="textMedium"><h2>Registration Report</h2><p>';
    $strDivReport = '';
    //==========================================================================
    // Verify that all fields are filled in
    //==========================================================================
    $cont = 'yes';
    if (!$arrRegister['login']) {
        $strDivReport .= "You need to fill in the login name.<br />";
        $cont = "no";
    }
    if (!$arrRegister['realname']) {
        $strDivReport .= "You need to supply your real name.<br />";
        $cont = "no";
    }
    if (!$arrRegister['country']) {
        $strDivReport .= "You need to supply your countries name.<br />";
        $cont = "no";
    }
    if (!$arrRegister['password']) {
        $strDivReport .= "You need to fill in the password field.<br />";
        $cont = "no";
    }
    if (!$arrRegister['verify']) {
        $strDivReport .= "You need to fill in the verify field.<br />";
        $cont = "no";
    }
    if ($arrRegister['password'] != $arrRegister['verify']) {
        $strDivReport .= "Your passwords do not match<br />";
        $cont = "no";
    }
    if (!$arrRegister['tribe']) {
        $strDivReport .= "You need to name your tribe.<br />";
        $cont = "no";
    }
    if (!$arrRegister['alias']) {
        $strDivReport .= "You need to give yourself a name.<br />";
        $cont = "no";
    }
    if (!$arrRegister['email']) {
        $strDivReport .= "You need to enter a valid email address<br />";
        $cont = "no";
    }
    if (!$arrRegister['race']) {
        $strDivReport .= "You must choose a race.<br />";
        $cont = "no";
    }
    if (!$arrRegister['CoC']) {
        $strDivReport .= "You need to agree to the code of conduct to play ORKFiA.<br />";
        $cont = "no";
    }
    //==========================================================================
    // Something was missing
    //==========================================================================
    if ($cont == "no") {
        // Vay: changed "Complete" to "Completed"
        $strDivReport .= "<br /><br />";
        $strDivReport .= "Your registration could not be completed.<br /><br />";
        $strDivReport .= "Fill in all of the required fields and try again.<br /><br />";
        $strDivReport .= "<a href=\"javascript: history.go(-1)\">Back</a>";
        $strDivReport .= "</p></div>";
        echo $strDivReport;
        include_main_down();
        exit;
    }
    //==========================================================================
    // Captcha test (fill in numbers shown in a "picture")
    //==========================================================================
    $ip = $_SERVER['REMOTE_ADDR'];
    $long = ip2long($ip);
    $check = mysql_query("SELECT * FROM reg_check WHERE id = {$arrRegister['reg_check']} AND ip = {$long}");
    $check = @mysql_fetch_array($check);
    if ($arrRegister['scriptstop'] != $check['reg_value']) {
        $strDivReport .= "You need to fill in the solution to the formula into the box " . "below it.</p><p>If you repeatedly get this message you should go " . "back using your browser and try to hit 'refresh', that might " . "save your entered information.</p><p>If this do not work then please " . "close your browser and try sign up again. Thanks!</p><p>";
        $strDivReport .= "<a href=\"javascript: history.go(-1)\">Back</a>";
        $strDivReport .= "</p></div>";
        echo $strDivReport;
        include_main_down();
        exit;
    }
    mysql_query("DELETE FROM reg_check WHERE id = {$arrRegister['reg_check']}");
    //==========================================================================
    // Catch mass-registrations
    //==========================================================================
    if ($_SERVER['SERVER_NAME'] != 'development.orkfia.org') {
        $recent = date('YmdHis', strtotime('-4 hours'));
        $get = mysql_query("SELECT * FROM gamestats WHERE signup_ip = '{$arrRegister['ip']}' AND signup_time > {$recent}");
        $tribe = array();
        while ($arrtribe = mysql_fetch_array($get, MYSQL_ASSOC)) {
            $tribe[$arrtribe["id"]] = $arrtribe;
        }
        $counter = 0;
        $found = '';
        foreach ($tribe as $strKey => $value) {
            $grab = mysql_query("select * from user where id = {$value['id']}");
            $grab = @mysql_fetch_array($grab);
            if ($grab['username']) {
                $found = 'yes';
            }
            $counter++;
        }
        if ($counter > 10) {
            $strDivReport .= "Too many people from this IP have signed up in the last 4 " . "hours, you will have to wait to join up.";
            $strDivReport .= "</p></div>";
            echo $strDivReport;
            include_main_down();
            exit;
        }
    } else {
        $found = '';
    }
    //==========================================================================
    // Check email. (Same is used in preferences.inc.php)   Martel, May 31, 2006
    //==========================================================================
    if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+' . '@' . '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $arrRegister['email'])) {
        $strDivReport .= "You need to enter a valid email address!<br />";
        $strDivReport .= "</p></div>";
        echo $strDivReport;
        include_main_down();
        exit;
    }
    //==========================================================================
    // Set activation code
    //==========================================================================
    $arrRegister['code'] = "";
    if ($_SERVER['SERVER_NAME'] != 'development.orkfia.org') {
        for ($i = 0; $i < 12; $i++) {
            $arrRegister['code'] .= substr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", rand(0, 61), 1);
        }
    } else {
        $arrRegister['code'] = 'verified';
    }
    //==========================================================================
    // Check race
    //==========================================================================
    $cont = check_race($arrRegister['race'], $cont);
    // Verifies alliance creation & join friends input and secures it
    $cont = fmat_kingdom($arrRegister, $cont);
    //==========================================================================
    // User ID (+1)
    // Updated to use gamestats table, which records all tribes ever created
    //                                                            - AI 07/10/06
    // (It only does for SUCCESSFUL signups, meaning errors may slip trough!)
    // New code - safe with blank DB and works correct  February 12, 2008 Martel
    //==========================================================================
    $strSql = "SELECT players FROM gamestats WHERE id = 1";
    if ($arrRes = mysql_fetch_array(mysql_query($strSql))) {
        $iNewUid = $arrRes['players'] + 1;
    } elseif (mysql_num_rows(mysql_query("SELECT * FROM user")) > 0) {
        $iNewUid = mysql_query("SELECT id FROM user SORT BY id DESC LIMIT 1");
        $iNewUid = mysql_fetch_row($iNewUid);
        $iNewUid = $iNewUid[0];
    } else {
        $iNewUid = 1;
    }
    // The welcome-msg tribe
    //==========================================================================
    // Alliance ID
    //==========================================================================
    switch ($arrRegister['alliance_type']) {
        case "new":
            // frost: changed below to 3 to enable free spot for APC alli
            // 5618: changed to 11, for various staff(-related) allis
            // Martel: added a more flexible upper limit that we can change easier
            $iNewAid = check_empty_alliances();
            if ($iNewAid == 0) {
                $strDivReport .= "There is no room for another alliance inside Orkfia, try to " . "join a random instead.<br /><br />";
                $cont = 'no';
            }
            break;
        case "existing":
            $iNewAid = $arrRegister['ex_id'];
            break;
        case "random":
            $iNewAid = '';
            break;
        default:
            $strDivReport .= "Your selected alliance type is not supported. <br /><br />";
            $iNewAid = '';
            $cont = "no";
    }
    //==========================================================================
    // Avoid duplicate entries in the DB
    //==========================================================================
    $cont = check_taken($arrRegister, $cont);
    //==========================================================================
    // Something was missing (second check)
    //==========================================================================
    if ($cont == "no") {
        // Vay: changed "Complete" to "Completed"
        $strDivReport .= "<br /><br />";
        $strDivReport .= "Your registration could not be completed.<br /><br />";
        $strDivReport .= "Fill in all of the required fields and try again.<br /><br />";
        $strDivReport .= "<a href=\"javascript: history.go(-1)\">Back</a>";
        $strDivReport .= "</p></div>";
        echo $strDivReport;
        include_main_down();
        exit;
    }
    //==========================================================================
    // Proceed with registration
    //==========================================================================
    $timestamp = date('YmdHis');
    // Alliance placement (and/or alliance creation)
    $alliance_num = alliance_placement($iNewAid, $arrRegister);
    // Game stats: last registered userid
    update_registration($iNewUid);
    // Create user tables
    make_user_data($iNewUid, md5("t1r1p0d4" . "{$arrRegister['login']}"), $arrRegister);
    make_army_data($iNewUid, $arrRegister['race']);
    if ($arrRegister['race'] == "Oleg Hai" || $arrRegister['race'] == "Mori Hai") {
        make_army_mercs_data($iNewUid);
    }
    make_build_data($iNewUid, $arrRegister['race']);
    make_goods_data($iNewUid, $arrRegister['race']);
    make_kills_data($iNewUid);
    make_milreturn_data($iNewUid);
    make_preferences_data($iNewUid, $arrRegister['code'], $arrRegister['email']);
    make_spell_data($iNewUid, $arrRegister['race']);
    make_pop_data($iNewUid, $arrRegister['race']);
    make_stats_data($iNewUid, $alliance_num, $arrRegister);
    make_thievery_data($iNewUid);
    make_online_data($iNewUid, $timestamp);
    make_news_data($iNewUid, $alliance_num, $arrRegister);
    make_ranking_data($iNewUid, $alliance_num, $arrRegister);
    make_mail_data($iNewUid, $arrRegister);
    make_design($iNewUid);
    // Activation email sent to all new players
    mail("{$arrRegister['email']}", "ORKFiA Verification", "Welcome to ORKFiA =) \n\nHere is your verification code: {$arrRegister['code']} \nUsername: {$arrRegister['login']} \nPassword: {$arrRegister['password']}\n" . HOST . "\n\nIt is recommended you tend to your tribe at least once per day. If you require help or this is your first time playing ORKFiA, you may find the forums and the guide useful. \n\nWe hope you enjoy your stay in ORKFiA =)" . SIGNED_ORKFIA, "From: ORKFiA <" . EMAIL_REGISTRATION . ">\r\nX-Mailer: PHP/" . phpversion() . "\r\nX-Priority: Normal");
    // Catch mass registrations notice
    if ($found == 'yes') {
        $strDivReport .= "<br /><br />";
        $strDivReport .= "The Law & Order Resort (found in alliance #2) has been notified " . "of this account's creation and will investigate it within the " . "near future." . "<br /><br />" . "An account was recorded as being created recently from this IP, " . "If you have more than one account you must delete all extras, " . "one account is the maxium each player can control. If you do " . "not you will lose all your accounts. If you have not created " . "more than one account it is likely you are on a proxy IP and " . "you should use the \"report sharing computers\" function found " . "in-game stating this." . "<br /><br />" . "If you have friends or family that play from your computer you " . "should also contact the staff in alliance #2 stating the situation.";
        $strDivReport .= "</p>";
        // Check if the report thread exists, otherwise create it
        $search = mysql_query("Select * from forum where poster_kd = 2 and parent_id  = 0 and title = 'To be investigated' and type = 0");
        $search = @mysql_fetch_array($search);
        if ($search['poster_kd'] != 2) {
            $insert = mysql_query("INSERT INTO forum VALUES ('', '0', '0','2', '0', 'To be investigated','Automated report thread', '{$timestamp}', '{$timestamp}','Reporter', 'Reporter','0', '0', '0', '0')") or die("insert:" . mysql_error());
        }
        // Find the report thread's id
        $search = mysql_query("Select * from forum where poster_kd = 2 and parent_id  = 0 and title = 'To be investigated' and type = 0");
        $search = @mysql_fetch_array($search);
        // Create post
        $strPost = 'Account creation warning, more than one user from ' . $arrRegister['ip'] . ' has created in the last 4 hours.' . '<br /><br />' . 'Id: ' . $iNewUid . '<br /><br />' . 'Username: '******'login'] . '<br /><br />' . 'Tribe name: ' . $arrRegister['tribe'] . '<br /><br />' . 'Alliance: ' . $alliance_num . '<br /><br />';
        // Post it
        mysql_query("INSERT INTO forum (poster_id,type,poster_kd,parent_id,post,date_time,updated,poster_name,poster_tribe,level) VALUES (0, 0, 2, {$search['post_id']}, '{$strPost}', '{$timestamp}', '{$timestamp}', '<span class=\"player\">Reporter</span>', 'Reporter', 0)") or die('mysql error: ' . mysql_error());
        mysql_query("UPDATE forum SET updated = '{$timestamp}' WHERE post_id = {$search['post_id']}") or die('mysql error: ' . mysql_error());
        mysql_query("UPDATE user,stats SET allianceforum = allianceforum + 1 WHERE user.id = stats.id AND kingdom = 2") or die('mysql error: ' . mysql_error());
    }
    // Add ip number and signup date to the gamestats table
    mysql_query("INSERT INTO gamestats (id, signup_time, signup_ip) VALUES ({$iNewUid}, '{$timestamp}', '{$arrRegister['ip']}')");
    echo $strDivReport;
    include_once 'inc/functions/forums.php';
    if ($_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME && get_sponsor_badge($iNewUid) == '') {
        ?>

    <hr />
    <h2>Classic ORKFiA Sponsorship</h2>
    <hr />

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="center">
        <input type="hidden" name="cmd" value="_xclick" />
        <input type="hidden" name="business" value="*****@*****.**" />
        <input type="hidden" name="undefined_quantity" value="1" />
        <input type="hidden" name="item_name" value="Three Months Sponsorship" />
        <input type="hidden" name="item_number" value="Classic Dragon" />
        <input type="hidden" name="amount" value="42.00" />
        <input type="hidden" name="shipping" value="0.00" />
        <input type="hidden" name="no_shipping" value="1" />
        <input type="hidden" name="return" value="<?php 
        echo HOST;
        ?>
main.php?cat=main&amp;page=sponsors&amp;thankyou" />
        <input type="hidden" name="cn" value="Message to admin" />
        <input type="hidden" name="currency_code" value="USD" />
        <input type="hidden" name="tax" value="0.00" />
        <input type="hidden" name="lc" value="SE" />
        <input type="hidden" name="bn" value="PP-BuyNowBF" />
        <table class="small" cellspacing="0" cellpadding="0">
            <tr class="header">
                <th colspan="3">Become a Classic Dragon</th>
            </tr>
            <tr class="data">
                <th>Rank 2:</th>
                <td><span class="elder">Classic Dragon</span></td>
                <td rowspan="3"><img src="<?php 
        echo HOST_PICS;
        ?>
dragon_classic.gif" alt="Dragon" /></td>
            </tr>
            <tr class="data">
                <th>Donation:</th>
                <td>$42 / 3 months</td>
            </tr>
            <tr class="data">
                <th><input type="hidden" name="on0" value="Login nick" /><label for="i1">Login nick:</label></th>
                <td><input type="text" name="os0" id="i1" maxlength="60" value="<?php 
        stripslashes($arrRegister[LOGIN]);
        ?>
" /></td>
            </tr>
        </table>
        <input type="submit" name="submit" value="Sponsor ORKFiA for 3 months" />
    </form>
    <p class="center">This dragon will soar next to your name in the forums
    for 2 normal ages (1 age is 6 weeks). You could also consider
    <a href="main.php?cat=game&amp;page=sponsors">the other dragons</a>
    for a shorter period of time. The blue dragon is only <strong>$1 / week</strong> and you
    still help us out =) Thank you!</p>

<?php 
    } elseif ($_SERVER['SERVER_NAME'] != DINAH_SERVER_NAME && get_sponsor_badge($iNewUid) == '') {
        include_once 'inc/pages/sponsors.inc.php';
        echo show_sponsor_options(stripslashes($arrRegister['login']));
    } elseif (($strBadge = get_sponsor_badge($iNewUid)) == '') {
        echo '<hr />' . '<h2>Thank you for supporting ORKFiA!</h2>' . '</hr />' . '<div class="center">' . $strBadge . '</div>';
    }
    echo "</p></div>";
}
示例#3
0
function show_posts($posttype, $set, $postid, $start, $finish)
{
    global $cat;
    if (!has_read_access($posttype)) {
        echo '<div id="textSmall">' . "<p>Sorry, you don't have access to read this topic.</p>" . '</div>';
        include_game_down();
        exit;
    }
    $start = max(0, $start);
    $finish = max(FORUM_POSTS_PER_PAGE, $finish);
    if (isset($GLOBALS["objSrcUser"])) {
        $objSrcUser =& $GLOBALS["objSrcUser"];
        $userid = $objSrcUser->get_userid();
        $arrStats = $objSrcUser->get_stats();
    }
    // dynamic stuff is sooooooo much cooler, isn't that what loops and
    // functions were invented for?
    $strSQL = "SELECT post_id FROM forum WHERE type = {$posttype} AND parent_id = {$postid}";
    $num = mysql_num_rows(mysql_query($strSQL));
    $strPages = 'Page ';
    $postcounter = 0;
    do {
        $counternext = $postcounter + FORUM_POSTS_PER_PAGE;
        $page = $postcounter / FORUM_POSTS_PER_PAGE + 1;
        if ($start != $postcounter) {
            $strPages .= "<a class='forum' href='main.php?cat={$cat}&amp;page=forums&amp;set={$set}&amp;postid={$postid}&amp;mode=posts&amp;start={$postcounter}&amp;finish={$counternext}'>";
        }
        $strPages .= "{$page}";
        if ($start != $postcounter) {
            $strPages .= "</a>";
        }
        $strPages .= "&nbsp;";
        $postcounter = $counternext;
    } while ($postcounter < $num);
    $posts = mysql_query("SELECT * FROM forum WHERE type = {$posttype} AND post_id = {$postid}") or die(mysql_error());
    $posts = mysql_fetch_array($posts);
    if (trim($posts['title']) != '') {
        $posts['title'] = cleanHTML($posts['title']);
    } else {
        $posts['title'] = "No subject";
    }
    // Species 5618, 30-3-2004
    // Checks to see wether the tribe is in the same alli as the post belongs to
    // This was an exploit before i fixed, by manipulating the url, players could read any post in the game.
    if ($posttype == 0 && $arrStats[ALLIANCE] != $posts['poster_kd']) {
        if (isset($posts['poster_kd'])) {
            echo '<div class="center">' . 'The topic/post you requested can\'t be accessed.' . '</div>';
            include_game_down();
            exit;
        } else {
            echo '<div class="center">' . "The topic/post you requested doesn't exist anymore.</div>";
            include_game_down();
            exit;
        }
    }
    echo "<br />";
    // Back button table
    echo "<div class='tableLinkBig'><a name='top' href='#bottom'>To The Bottom</a> :: ";
    echo "<a href=\"main.php?cat={$cat}&amp;page=forums&amp;set={$set}&amp;mode=threads\">Back To Overview</a>";
    echo "</div>";
    $colspan = '2';
    if ((mod_access($posttype) && isset($arrStats) && $arrStats[LEVEL] >= 5 || $posttype == 0 || $posttype == 4 || $posttype == 5) && $cat != 'main') {
        $colspan = '3';
    }
    // Table Header
    echo '<table cellpadding="0" cellspacing="0" class="big">' . '<form id="center" name="forum" action="main.php?cat=' . $cat . '&amp;page=forums&amp;set=' . $set . '&amp;mode=threads&amp;action=moderation" method="post">' . '<tr class="header">' . '<th colspan="' . $colspan . '">Topic: ' . $posts['title'] . '</th>' . '</tr>' . '<tr class="subheader">' . '<th colspan="' . $colspan . '" class="right">' . $strPages . '</th>' . '</tr>';
    if ($start == 0) {
        // FIRST POST OF A THREAD
        // NO DELETION ALLOWED
        $posts['post'] = cleanHTML($posts['post']);
        echo "<tr class=\"data\">";
        echo "<td class='left'><br />";
        // Hide id on WF - AI 31/10/06 M: enable on alliance, lno, ops, + admins
        if ((mod_access($posttype) && isset($arrStats) && $arrStats[LEVEL] >= 5 || $posttype == 0 || $posttype == 4 || $posttype == 5) && $cat != 'main') {
            $alliance = mysql_query("SELECT " . ALLIANCE . " FROM stats WHERE id = {$posts['poster_id']}");
            $alliance = mysql_fetch_array($alliance);
            echo "<a href=\"main.php?cat=game&amp;page=mail&amp;set=compose&amp;replyid={$posts['poster_id']}&amp;kingdom={$alliance['kingdom']}\" title=\"{$posts['poster_tribe']} (#" . $alliance[ALLIANCE] . ")\">{$posts['poster_name']}</a> ";
        } else {
            echo "<strong>{$posts['poster_name']}</strong> ";
        }
        echo $posts['date_time'] . " ";
        if ($posts['date_time'] != $posts['updated']) {
            echo " edited ";
        }
        if ($cat == 'game' && $posts['poster_id'] == $userid && $posts['close_option'] != 1) {
            echo "<a href=\"main.php?cat={$cat}&amp;page=forums&amp;set={$set}&amp;postid={$postid}&amp;edit_id={$posts['post_id']}&amp;mode=edit\">edit</a>";
        }
        echo "<br /><br /></td>";
        $strSponsorBadge = get_sponsor_badge($posts['poster_id']);
        echo '<td rowspan="2" class="center bsdown" width="45">' . '<a href="main.php?cat=' . $cat . '&amp;page=sponsors" title="Dragon Sponsor">' . $strSponsorBadge . '</a>' . '</td>';
        if (mod_access($posttype)) {
            echo "<td rowspan='2' align='center' class=\"center bsdown bsleft\" width=\"45\"> X </td>";
        }
        echo "</tr><tr class='data'><td colspan='1' valign='top' class=\"left bsdown\" style='padding-left: 1em;'><div>" . $posts['post'] . "<br /><br /></div></td></tr>";
    }
    @($result = mysql_query("SELECT * from forum where type ='{$posttype}' and parent_id='{$postid}' ORDER BY date_time ASC ")) or die(mysql_error());
    $i = 0;
    while ($forum = mysql_fetch_array($result)) {
        if ($i >= $start && $i < $finish) {
            if ($forum['date_time']) {
                $forum['post'] = cleanHTML($forum['post']);
                echo "<tr class=\"data\">";
                echo "<td class='left'><br />";
                // Hide ID on WF - AI 31/10/06
                if ((mod_access($posttype) && isset($arrStats) && $arrStats[LEVEL] >= 5 || $posttype == 0 || $posttype == 4 || $posttype == 5) && $cat != 'main') {
                    $alliance = mysql_query("SELECT " . ALLIANCE . " FROM stats WHERE id = {$forum['poster_id']}");
                    $alliance = mysql_fetch_array($alliance);
                    echo "<a href=\"main.php?cat=game&amp;page=mail&amp;set=compose&amp;replyid={$forum['poster_id']}&amp;kingdom={$alliance['kingdom']}\" title=\"{$forum['poster_tribe']} (#" . $alliance[ALLIANCE] . ")\">{$forum['poster_name']}</a> ";
                } else {
                    echo "<strong>{$forum['poster_name']}</strong> ";
                }
                echo $forum['date_time'] . " ";
                if ($forum['date_time'] != $forum['updated']) {
                    echo " edited ";
                }
                if ($cat == 'game' && $forum['poster_id'] == $userid && $posts['close_option'] != 1) {
                    echo "<a href=\"main.php?cat={$cat}&amp;page=forums&amp;set={$set}&amp;postid={$postid}&amp;edit_id={$forum['post_id']}&amp;mode=edit\">edit</a> ";
                }
                echo "<br /><br /></td>";
                $strSponsorBadge = get_sponsor_badge($forum['poster_id']);
                echo '<td rowspan="2" class="center bsdown" width="45">' . '<a href="main.php?cat=' . $cat . '&amp;page=sponsors" title="Dragon Sponsor">' . $strSponsorBadge . '</a>' . '</td>';
                if (mod_access($posttype)) {
                    echo "<td rowspan='2' align='center' class=\"center bsdown bsleft\"><input name='posts[]' type='checkbox' value='{$forum['post_id']}' /></td>";
                }
                echo "</tr><tr class=\"data\"><td colspan='1' class=\"left bsdown\" valign='top' style='padding-left: 1em;'>";
                echo "<div>" . $forum['post'] . "<br /><br /></div></td>";
                echo "</tr>";
            }
        }
        $i++;
    }
    echo "<tr class='subheader'><th colspan='{$colspan}' class='right' style='border: 0;'>{$strPages}</th></tr>";
    echo "</table>";
    echo '<div class="center"><br />';
    if (mod_access($posttype)) {
        echo "| <a href='#' onclick=\"var posts=document.getElementsByName('forum')[0]['posts[]']; for(var i=0,len=posts.length;i<len;i++) posts[i].checked=true;\">Check All</a>";
        echo " | <a href='#' onclick=\"var posts=document.getElementsByName('forum')[0]['posts[]']; for(var i=0,len=posts.length;i<len;i++) posts[i].checked=false;\">Uncheck All</a> ";
    }
    echo "| <a href=\"main.php?cat={$cat}&amp;page=forums&amp;set={$set}&amp;mode=threads\">Back To Overview</a> |";
    echo " <a name=\"bottom\" href='#top'>To The Top</a> |";
    if (mod_access($posttype)) {
        echo "<br /><br />";
        echo "<input type='submit' name='delete' value='Delete' /> ";
    }
    echo '</div>';
    echo "</form>";
    // Adding in open close option for threads
    //close at 120 posts
    if ($num >= FORUM_MAX_PAGES * FORUM_POSTS_PER_PAGE && $arrStats[ALLIANCE] > 10) {
        $posts['close_option'] = 2;
    }
    if ($posts['close_option'] == 0 && $cat != 'main') {
        $strReplyToTopicForm = '<div id="textMedium">' . '<h2>Reply To Topic</h2>' . '<form action="main.php?cat=game&amp;page=forums&amp;set=' . $set . '&amp;mode=posts&amp;action=post" method="post">' . '<label for="1">Your Reply</label>: ' . '<br /><textarea name="text" rows="8" cols="44" id="1"></textarea>' . '<br /><br />' . '<input type="submit" value="Post your reply" />' . '<br /><br />' . '<input type="checkbox" name="formatted" value="yes" id="2" /> ' . '<label for="2">With Tabs</label> (Sometimes this can make a copied table look great.)' . '<input type="hidden" name="postid" value="' . $postid . '" />' . '</form>' . '</div>';
        echo $strReplyToTopicForm;
    } elseif ($posts['close_option'] == 2 && $arrStats[ALLIANCE] > 10) {
        echo '<div class="center"><br />' . "It seems this was a very popular topic! It is now full, but you may create a new one.</div>";
    } elseif ($posts['close_option'] == 1) {
        echo '<div class="center"><br />' . "This topic has been closed, you can't reply to it.</div>";
    }
}