Jump to content
MakeWebGames

Markku

Recommended Posts

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! ^_^

1751349643_MCCodes-v2-0-5b2014-05-0200-47-31.thumb.png.fc80443c1b6fe099330a0c65733c559b.png

1413759790_MCCodes-v2-0-5b2014-05-0200-51-41.thumb.png.a0749721c09d4c3e4553674ec116af09.png

1082201968_MCCodes-v2-0-5b2014-05-0200-52-52.thumb.png.11fd8d2a5cdb8d17decdf5e6f04efba6.png

2128578904_MCCodes-v2-0-5b2014-05-0200-53-57.thumb.png.ac83cc51981eb01337d52e14dc2dea42.png

1616444375_MCCodes-v2-0-5b2014-05-0200-54-37.thumb.png.cd586d9849d765bf5ca1a628307a5c5f.png

1078901413_MCCodes-v2-0-5b2014-05-0202-26-04CLEAR.thumb.png.683be860ca78e0e96c6d866a352c25d0.png

745474728_MCCodes-v2-0-5b2014-05-0202-27-07Arch.png.bf7d698d8a086bab9d18ea3a5b8c64b0.png

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ^_^

Link to comment
Share on other sites

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. ^_^

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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. ^_^

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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 ^_^

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...