Markku Posted May 2, 2014 Share Posted May 2, 2014 Hii everyone, This is my first time working with MCCodes and I decided to update the mailbox a little as it could do with a little update :) I haven't been programming very long at all, I am new to all this but here goes. The icons used on this mailbox are from Silk Icons (free) Please note: This mailbox uses functions which are not in the standard MCCode engine, please place this into your global_func.php (Will be used on future modules) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. CSS for message boxes You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. mailbox.php Pastebin (mailbox.php) (Code placed on pastebin due to issues with <br /> on forum.) Screenshots [ATTACH=CONFIG]1402[/ATTACH][ATTACH=CONFIG]1403[/ATTACH][ATTACH=CONFIG]1404[/ATTACH][ATTACH=CONFIG]1405[/ATTACH][ATTACH=CONFIG]1406[/ATTACH] Added Screenshots [ATTACH=CONFIG]1408[/ATTACH][ATTACH=CONFIG]1409[/ATTACH] Okies, that should be all I hope, If you encounter errors/problems, post here I will try to fix. Thank you! ^_^ Quote Link to comment Share on other sites More sharing options...
wrux Posted May 2, 2014 Share Posted May 2, 2014 Looks nice. You did a good job considering you said you said you haven't been programming long :) Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 Looks nice. You did a good job considering you said you said you haven't been programming long :) Thanks :) I've been learning for around 2 months now ^_^ Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 2, 2014 Share Posted May 2, 2014 Nice work but I noticed in your functions that you are calling the global $h??? I know you said you have been programming for a short time and this module/alteration seems to show you have been doing it longer than 2 months. But let me give you an easy way to remember what globals you need to call when needing globals: For some reason in PHP when you create a method or a function sometimes they require "globals". What global does is, it will basically look for that variable that is somewhere outside your function or method. It could be inside the same script or inside an include. In your case, you are calling the $h object which instantiates the "header" class so you can use the endpage() method, which is basically like a clean kill of your HTML or like a footer if that makes sense. But your are actually not using the h object inside your functions so the global is not required. And future reference: Common globals would be $db, $h, and $userid. The only time you need to call those as globals is inside functions or methods, and if you are actually going to use them within the function. I hope this makes sense and if not sorry for confusing you more and feel free to ask and I'll try to make it clearer to you Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 Nice work but I noticed in your functions that you are calling the global $h??? I know you said you have been programming for a short time and this module/alteration seems to show you have been doing it longer than 2 months. But let me give you an easy way to remember what globals you need to call when needing globals: For some reason in PHP when you create a method or a function sometimes they require "globals". What global does is, it will basically look for that variable that is somewhere outside your function or method. It could be inside the same script or inside an include. In your case, you are calling the $h object which instantiates the "header" class so you can use the endpage() method, which is basically like a clean kill of your HTML or like a footer if that makes sense. But your are actually not using the h object inside your functions so the global is not required. And future reference: Common globals would be $db, $h, and $userid. The only time you need to call those as globals is inside functions or methods, and if you are actually going to use them within the function. I hope this makes sense and if not sorry for confusing you more and feel free to ask and I'll try to make it clearer to you Hmmm I kinda understand, I think I know what you mean... So in short, global $h; wouldn't be needed in order for those message boxes to work correctly as they do now? Thank you for your input also, Means a lot to me. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 2, 2014 Share Posted May 2, 2014 You got it!!!! If your not using the variable inside a function it doesn't need to be listed as global. Global basically tells PHP "Look for this variable for me will ya?" Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 You got it!!!! If your not using the variable inside a function it doesn't need to be listed as global. Global basically tells PHP "Look for this variable for me will ya?" Great thank you for that! I have edited my original post ^_^ Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 2, 2014 Share Posted May 2, 2014 (edited) If you really wanted you can use one function like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Usage: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited May 2, 2014 by KyleMassacre Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 If you really wanted you can use one function like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Usage: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Hmmm I see, I will try and use them like that and see which way I prefer. But I see how that way works also. Thanks for that, I did not think to use functions in that way. ^_^ Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 Urmm, I've noticed that for some reason the "mailbox.php" I added above - Has somehow lost all of it's "<br />" since adding to the forum. Anyone got any idea why this has happened? :( Thanks. Quote Link to comment Share on other sites More sharing options...
Dave Posted May 2, 2014 Share Posted May 2, 2014 This looks great! thanks for the release Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 This looks great! thanks for the release Thank you ^_^ Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 2, 2014 Share Posted May 2, 2014 Urmm, I've noticed that for some reason the "mailbox.php" I added above - Has somehow lost all of it's "<br />" since adding to the forum. Anyone got any idea why this has happened? :( Thanks. It is because of the syntax highlighter I think. It happens to me too, I use PasteBin then link it to the thread. :) Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 It is because of the syntax highlighter I think. It happens to me too, I use PasteBin then link it to the thread. :) Oooh okay, Yeah I had too use PasteBin also. ^_^ Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 2, 2014 Share Posted May 2, 2014 Kudos on using Silk, they are awesome! :D What I could suggest is, why not use a drop down menu for the usernames to make it "easier" for users to pick someone. Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 Kudos on using Silk, they are awesome! :D What I could suggest is, why not use a drop down menu for the usernames to make it "easier" for users to pick someone. Silk icons are the best! ^_^ As for the dropdown for the usernames, that's a good idea I like that. I'll try that and see if I can get something like that to work. ^_^ Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 2, 2014 Share Posted May 2, 2014 It's just a normal select and the <option></option> part Is in a while() loop. Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 It's just a normal select and the <option></option> part Is in a while() loop. Ooo okay, But what about if a game has lets say "1,000" users, Wouldn't it be selecting from a lot of users? Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 2, 2014 Share Posted May 2, 2014 True, it would be selecting lots but, hmm well I guess you're right too. Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 True, it would be selecting lots but, hmm well I guess you're right too. I'm not sure how else it could be done :/ Any ideas? Quote Link to comment Share on other sites More sharing options...
sniko Posted May 2, 2014 Share Posted May 2, 2014 I'm not sure how else it could be done :/ Any ideas? With AJAX, select usernames that are close to the users input. For example; if I input "sni", only users with "sni" characters in their name would be in the dropdown list ;) Quote Link to comment Share on other sites More sharing options...
Markku Posted May 2, 2014 Author Share Posted May 2, 2014 With AJAX, select usernames that are close to the users input. For example; if I input "sni", only users with "sni" characters in their name would be in the dropdown list ;) Oooh, I did not think of this, I'll look into doing it that way! Thank you sniko ^_^ Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 2, 2014 Share Posted May 2, 2014 If you really wanted you can use one function like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Usage: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Wish I'd thought of that when I wrote my success/warning/info/error functions haha Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 2, 2014 Share Posted May 2, 2014 Wish I'd thought of that when I wrote my success/warning/info/error functions haha It may just be me being lazy Quote Link to comment Share on other sites More sharing options...
Reecey12345 Posted May 5, 2014 Share Posted May 5, 2014 Looks good, but you should really test deep in before releasing! I found 1 error so far. When you try to reply to someone's mail you first have to add them into your Contacts otherwise it wont allow you to do reply. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.