MyBB Community Forums

Full Version: Fade out Popup notification, like the login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Firstly, sorry if this is the wrong place, as it's not technically an issue, but is relating to MyBB 1.8, I'm just a novice web dev.

I want to know how I could go about creating a greeting prompt that fades out and has a popup, similar to the fade out popup you get when you click "Log in".

Can anyone point me in the right direction, pretty clueless unless its changing some fonts, images or tables around.
Are you looking specifically for this within MyBB, or just general websites?
For reference: If it's for MyBB, you're in the right spot. If it's for general stuff, look at the Web Development/Administration section toward the bottom.

Either way, http://community.mybb.com/thread-117646.html is how it was done in MyBB 1.6 before 1.8 had modal boxes in its core. The code edits might help you understand the components to it all.
It's for For my MyBB 1.8 webpage

How can I get the above to load as the page loads?

I see how the login one works as an onclick

I see the login button on the quest welcome is:
<a href="http://www.terraria.tls.id.au/member.php?action=login" class="login">Login</a>

I want to take this:
onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;"

change it to onload, add it to the body of the portal page, but have it load regardless of if they are a guest or logged in but also not the quick_login box, I want to define a new one

I just cant find where quick_login is defined and/or change it to anything else.

Further to that, anything i seem to place #quick_login with, other variables or template names, I cant even seem to get a popup at all.

I guess im missing required code somewhere, but cant figure outwhere else apart from header_welcome_guest the #quick_login points
Quote: just cant find where quick_login is defined

In the same template. It's just a div with that ID which is supposed to be the modal. You can add a div with different ID to the portal template.
I was trying to make a new template in global templates called popup and then created the div in there, but I couldn't get the popup to work.

Should this work:
onclick="$('#popup').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) });
No, because your global template is not included in portal, unless you use something like this: http://community.mybb.com/thread-140152-...pid1008111 Either that or you need to add the modal <div> to the portal template as I said in my previous post.
Ok, but won't the div show up on the page somewhere as well if I put it into the portal template?

Can I made a new template under the Portal Template group and then call it?

Ok, so I put the code for the div in the portal template, outside the body and html tag, is that ok?
I put the div outside the html tag on the poral template, not sure if that's right but it works.