Jump to content

seat183

New Members
  • Posts

    3
  • Joined

  • Last visited

seat183's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, everyone. I have tried making this for a project of mine. However I have migrated servers it used to work on the old Server and the tables are not being imported. It's basically a script to give the project new crimes every hour and create a random set of crimes into the mafia game's cities. However when I run it. No crimes are being imported into the tables and all the tables seem correct. <?php require_once('include/init.php'); $s = time(); echo '...'."\n"; Airport::generate(); echo '* Airport prices generated'."\n"; Blackjack::generate(); echo '* Blackjacks generated'."\n"; BlackMarketDealer::generate(); echo '* Black market dealer stack generated'."\n"; //Business::generate(); //echo '* Businesses generated'."\n"; Crime::generate(); echo '* Crimes generated'."\n"; DrugMarket::generate(); echo '* Drugs are now available'."\n"; House::generate(); echo '* Houses ready to be burgled'."\n"; ItemPrice::generate(); echo '* Initial item prices set'."\n"; OrganizedCrime::regenerate(); echo '* Organized crimes generated'."\n"; Population::recalculate(); echo '* Population calculated'."\n"; Property::generate(); echo '* Properties generated'."\n"; Prostitute::generate(); echo '* Prostitutes generated'."\n"; Slots::generate(); echo '* Slots generated'."\n"; $d = time() - $s; echo "\n".'** Install complete in '.$d.' seconds...'."\n"; exit(); ?> Many thanks if anyone can pinpoint my errors.
  2. Many thanks for the reply, everyone. here is the register.php I have tried myself but just end up getting a syntax error. <?php require_once('../include/init.php'); // Prepare the errors array $_errors = array(); // Registration if (Tools::getValue('register')) { require_once(APP_DIR.'lib/reCAPTCHA/recaptchalib.php'); $captcha = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, $_SERVER["REMOTE_ADDR"], Tools::getValue("recaptcha_challenge_field"), Tools::getValue("recaptcha_response_field")); if (!Tools::getValue('agree')) { $_errors []= 'Error #RG0010: '.FRONT_ERROR_RG0010; } elseif (!$captcha->is_valid) { $_errors []= 'Error #RG0015: '.FRONT_ERROR_RG0015; } else { // Initialize a new user... $account = new Account(); $_errors = $account->registration(Tools::getValue('register_username'), Tools::getValue('register_password'), Tools::getValue('repeat_password'), Tools::getValue('email')); // Register the user if there were no errors in initializing an account if (!sizeof($_errors)) { if (!$activation_token = $account->register()) $_errors []= 'Error #RG0009: '.FRONT_ERROR_RG0009; if ($ref = $session->referral) Referral::add($ref, $account->id); } } if (sizeof($_errors)) { $template = $twig->loadTemplate('index.html'); $template->display(array( 'registration_errors' => $_errors, 'recaptcha' => recaptcha_get_html(RECAPTCHA_PUBLIC_KEY), 'goto' => 'registration', 'post' => $_POST)); exit(); } else { Tools::redirect('register.php?send_activation&token='.$activation_token); } } else // Account activation if (Tools::getValue('activate', 'null') != 'null' or Tools::getValue('send_activation', 'null') != 'null') { $_errors = array(); // Initialize the activation $activation = Activation::getByField(array('token' => Tools::getValue('token'))); if (!($activation->id)) $_errors []= 'Error #RG0011: '.FRONT_ERROR_RG0011; else { $account = new Account($activation->id_account); if (!$account->id) Error::get()->report('ACT0003', 'UserID#'.$activation->id_account.' ActivationID#'.$activation->id, CRITICAL_ERROR); } $success = false; // Send activation key if (Tools::getValue('send_activation', 'null') != 'null') { if (!Mail::send($account->email, 'activation', array('activation_token' => $activation->token, 'activation_code' => $activation->getCode(), 'account' => $account))) { Error::get()->report('MAIL0001', 'UserID#'.$account->id, NOTICE_ERROR); $_errors []= 'Error #RG0013: '.FRONT_ERROR_RG0013; } else $success = true; } // Check activation key if (Tools::getValue('activate', 'null') != 'null' and Tools::getValue('activation_code', 'null') != 'null') { $activation_code = Tools::getValue('activation_code'); if ($activation_code != $activation->getCode()) { $_errors []= 'Error #RG0012: '.FRONT_ERROR_RG0012; } elseif(!$activation->success($account)) { // Activation failed $_errors []= 'Error #RG0014: '.FRONT_ERROR_RG0014; } else { // Display successfull activation prompt and mail the welcome message if (!Mail::send($account->email, 'welcome', array('account' => $account))) Error::get()->report('MAIL0003', 'UserID#'.$account->id, NOTICE_ERROR); $template = $twig->loadTemplate('activate.html'); $template->display(array( 'success' => true)); exit(); } } $template = $twig->loadTemplate('activate.html'); $template->display(array( 'activation_errors' => $_errors, 'activation_success_send' => $success, 'post' => $_POST, 'activation_token' => $activation->token, 'email' => $account->email)); exit(); } else Tools::redirect('/'); // An unknown request to this file ?>
  3. I am trying to remove this and I am a total newbie to PHP. If anyone could point me to the way to delete this from my register and forgot password link this would be great. </script> {% if account %} {% else %} <div id="registerbutton" class="grid_4 alpha omega"></div> <div id="register" class="grid_4 alpha omega"> <form method="POST" action="register.php"> <span id="grid_5" class="signup_text"><b>Username</b> (4-32 characters)</span> <input type="text" name="register_username" class="signup_input" value="{{ post.register_username }}" /> <div class="grid_4 alpha omega"> <span id="grid_5" class="signup_text"><b>Password</b> (min 6 characters)</span> <input type="password" class="signup_input" name="register_password" value="" /> </div> <div class="grid_4 alpha omega"> <span id="grid_5" class="signup_text"><b>Repeat Password</b> </span> <input type="password" class="signup_input" name="repeat_password" value="" /> </div> <div class="grid_4 alpha omega"> <span id="grid_5" class="signup_text"><b>Email Address</b> (must be valid)</span> <input type="text" class="signup_input" name="email" value="{{ post.email }}" /> </div> <div style="clear:both"></div> <div id="recaptcha_widget" style="position:relative;"> <div id="recaptcha_image" style="clear:both;display:block;position:relative;z-index:99;top:66px;left:10px"></div> <!--<div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect please try again</div> <span class="recaptcha_only_if_image">Enter the words above:</span> <span class="recaptcha_only_if_audio">Enter the numbers you hear:</span> <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" /> <div><a href="javascript:Recaptcha.reload()">Get another CAPTCHA</a></div> <div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">Get an audio CAPTCHA</a></div> <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">Get an image CAPTCHA</a></div> <div> <a href="javascript:Recaptcha.showhelp()">Help</a></div> </div>--> <script type="text/javascript" src="http://www.google.com/recaptcha/api/KEYHERE"></script> <noscript> <iframe src="http://www.google.com/recaptcha/api/noscript?k=KEYHERE" height="300" width="300" frameborder="0"></iframe> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"> </noscript> </div> <div class="grid_6 alpha omega"> <input type="checkbox" class="grid_1" name="agree" value="1" {% if post.agree %}checked="checked"{% endif %} /> I agree to the <a href="guide.php?id=1">Terms of Service</a> <br />and <a href="guide.php?id=2">Privacy Policy</a> </div> <div class="grid_4"> <br /> <input type="submit" name="register" class="signup_submit" value=" "/> {% if registration_errors %} {% for error in registration_errors %} <br /> <span id="grid_1" class="error_message">{{ error }} </span><br /> {% endfor %} {% endif %} </div> </form> </div> {% endif %} {% endblock rightbar %} I'VE put my public keys in both the above ere it says Keys HERE but it would work and just refreshes the captcha when I click Register. Is there anyway I can totally remove this from the above w ehere it does not even need the captcha? Thanking anyone if they help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.