Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by doddsey_65

  1. Thats alot of errors. Fortunatly I have fixed them all. The login was a problem in chrome due to a BOM error. And there were a few things in the javascript that FF didnt mind but Chrome kicked off, so i fixed them too. As for the friend request error. Thats a work in progress. For some reason empty friend requests are sent to users. I dont know when or why this happens but it needs more looking into. Thanks for the help Corey
  2. I wouldnt like to create a mod for SMF as a whole, there would be alot of do's and don'ts and i dont fancy reading there guidelines and best practices guides to mods. However I would create a PhpFreaks specific mod. Ive made a few for another forum ( albeit a PhpBB forum ) . Heck even if no one is interested I may make it anyway just to delve into SMF's code.
  3. What about a restriction imposed system? Likes can only be given out by the OP ( rather than "likes" it would be a "best answer" or "more helpful" sort of thing ). And only active and "old" members can dish these out. Like users that have been registered more than 1 month and have more than 50 posts ( just random numbers ). although this would probably have to be coded from scratch to tailor to the specific requirements.
  4. well that depends what is within your htaccess file to rewrite the url. Its essentially just a get parameter so it would be something like $article_name = $_GET['article']; What's not safe about it. How else are you going to redirect back to the page. There are several ways to grab url path. That just happens to be the one I use.
  5. in your next page use something like <table> <tbody> <tr> <td> <?php echo $_POST['first_name']; ?> </td> the rest should be self explanitory.
  6. $_SERVER['SCRIPT_NAME'] will return the path of the script. You can just save that to a session to redirect after a login. As for the ID. Php can only work with what you give it. You have only given it an article name so theres no way to get the id of the article. If the articles are being pulled from the database then you can query the database with the name of the article to pull the id of said article.
  7. this is my last shot then. You have a variable appended to the end of the url link ( just noticed it ). if you include variables in quotes in php they need to be within double quotes so php can parse them.
  8. Im not sure but the inclusion of the <html><head> <title> and <body> tags may be an issue. Remove them and just use basic html tags like <p> and headings.
  9. decode the url and then query the database for the id, given the name of the article?
  10. when the user clicks a link, the browser is going to go there. There is no way to halt this in php so you can run another script/process first. The only way to do this would be to halt the process with javascript/jquery, run your code, and then continue to the page in question: This is the jquery way: $('a.myLink').click(function(e){ e.preventDefault(); //run your code here // then continue to go to the page document.location = $(this).attr('href'); });
  11. I have had the same issue. I was using only one $message variable to hold the whole message and it wasnt displaying the html in the message. Try seperating the message and using multiple $message instances. $message = '<html><head>'; $message .= '<title>Your New Account - Activation Required</title>'; $message .= '</head><body>'; $message .= '<p>Please click on the link below to continue with activating your account:</p>'; $message .= '<a href"http://www.mywebsite.com/verify?activationCode=$activationKey">Click here to activate your account.</a>'; $message .= '<p>If you have received this message in error, please ignore this.</p>'; $message .= '</body></html>';
  12. Im assuming this is for an email. have you included the required headers? Can you show us the full code?
  13. is 'itemType' the weight? have you tried typecasting? Not sure if it would help but its one of the debugging steps i would try $totalweight = ((int)$info['count'] * (int)$info['itemType']);
  14. header("Location: test_admin_panel.php?user_id=".$main_id.""); I cant see where you have defined $main_id. Is it defined earlier in the script? if so does it return the correct id. also you dont need .""); at the end of your header redirect header("Location: test_admin_panel.php?user_id=".$main_id);
  15. you want to carry the user id to the next page after they login? You could append it to the url when redirecting after the login: www.mysite.com/?user_id=1 or you could save it to a session to be called later session_start(); $_SESSION['user_id'] = $user_id;
  16. ive never come across your method: $totalweight = ($info['count' * 'itemtype']); but im pretty sure thats not gonna work. Try $totalweight = $info['count'] * $info['itemtype'];
  17. Okay it is back up now and hopefully most things should have been fixed including all of the above errors. The only thing that i know doesnt work is the avatar cropper within the user center. That is a work in progress module. http://www.asimpleforum.co.uk/forum/
  18. *sigh* The preferences i changed seem only to apply to newly created documents. Ive changed the encoding for the current document and everything appears fine now. Thanks for the help
  19. ive changed the save type to utf 8 without BOM but still get the same issue. Ive since deleted the language files and resaved them to make sure this new encoding was being saved but no joy there. It still only happens with profiles_lang.php. I thought it may be the encoding of the profiles.php page which calls the file but ive tested it on the index which had no issues calling common_lang.php and I get the same thing when calling profiles_lang.php
  20. Thanks for the help anyway then. If it happened with each included language file then i may be able to understand. But the fact it only happens on this one included file. If i change the file to login_lang.php the space disapears and everything works fine.
  21. this is profiles_lang.php <?php /* ASF A Simple Forum * (c) ASF A Simple Forum 2010 - 2011 * * @licence http://www.asimpleforum.co.uk/licence * * $page languages/en/login_lang.php * $author Carl Markham * $created 27/07/2011 */ $l = array( 'WALL_FEED_DELETED' => 'Your wall feed has been deleted', 'USER_STATISTICS' => 'User Statistics', ); and this is login_lang.php <?php /* ASF A Simple Forum * (c) ASF A Simple Forum 2010 - 2011 * * @licence http://www.asimpleforum.co.uk/licence * * $page languages/en/login_lang.php * $author Carl Markham * $created 27/07/2011 */ $l = array( 'FILL_ALL_DETAILS' => 'Please fill in all details', 'NO_USER' => 'No user was found matching your data', 'WRONG_SECRET_QUESTION' => 'You entered an incorrect secret question or secret answer', 'LOGGED_IN' => 'You have now been logged in', 'LOGIN' => 'Log me in', 'FORGOT_PASS' => 'Forgot password', 'USERNAME' => 'Username', 'PASSWORD' => 'Password', 'AUTO_LOGIN' => 'Auto Login', 'USERNAME_LOGIN_INFO' => 'Enter the username you logged in with', 'PASSWORD_LOGIN_INFO' => 'The password you chose when you registered', 'AUTO_LOGIN_INFO' => 'Choose to be logged in automatically each visit', ); As i said there is no difference apart from the content of the array.
  22. I have a class which loads language files and adds the content(which is an array) into a phrases array. It's performed perfectly when i included common_lang.php and login_lang.php. However when i include common_lang.php and profiles_lang.php something weird happens. I have a blank space at the top of the profile pages. And firebug reports that the content of <head> is now empty and its shifted all of it to the <body>. Like i say this only happens when including profiles_lang.php but works with other files like login_lang.php. The content of each language file is the same apart from the data in the array. $l = array( 'USERNAME' => 'Username', ); this is the language class which is being called in profiles.php like Asf_Language::loadFile('profiles'); The same call is used in other pages replacing 'profiles' with the name of the language file to call. <?php /* ASF A Simple Forum * (c) ASF A Simple Forum 2010 - 2011 * * @licence http://www.asimpleforum.co.uk/licence * * $page includes/languageClass.php * $author Carl Markham * $created 14/06/2011 */ class Asf_Language { public static $lang; public static $phrases = array(); public static $loaded_langs = array(); public function __construct($default) { $this->setLang($default); self::loadFile('common'); } public static function setLang($lang) { self::$lang = $lang; } public static function getLang() { return $lang; } public static function loadFile($file) { $include = dirname(dirname(dirname(__FILE__))).'/languages/'.self::$lang.'/'.$file.'_lang.php'; if(file_exists($include)) { include($include); self::$loaded_langs[] = $file; foreach($l as $key => $val) { self::$phrases[$key] = $val; } } else { echo 'File '.$include.' does not exist'; } return; } public static function getLoadedLanguages() { return implode(', ',self::$loaded_langs); } } Anyone have any ideas why the head is being emptied when this file is being included?
  23. Due to the amout of errors i have shut the live version down. It wont be back up until it is fully fixed. Thanks for the testing.
  24. ive removed the error but i dont know why it's being caused. Im using a UNION query to get the amount of posts, topics, forums and users. $sql = "SELECT COUNT(*) FROM ".Db_Pdo::$Tbl_Prefix."forums f UNION SELECT COUNT(*) FROM ".Db_Pdo::$Tbl_Prefix."topics t UNION SELECT COUNT(*) FROM ".Db_Pdo::$Tbl_Prefix."posts p UNION SELECT COUNT(*) FROM ".Db_Pdo::$Tbl_Prefix."users u WHERE u.u_confirmed = 1"; $result = $db->query($sql) or die($db->printError($sql)); $row = $result->fetchAll(); // add out stats into an associative array for calling later $stats['forums'] = $row[0][0]; $stats['topics'] = $row[1][0]; $stats['posts'] = $row[2][0]; $stats['users'] = $row[3][0]; the error is caused by this line $stats['users'] = $row[3][0]; dont know why it happens so I will look into it. It only seems to happen when there is a new user.
×
×
  • 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.