phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Warning when settings in profile are not good


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Jan 14, 2010 8:33 am 
Post subject: Warning when settings in profile are not good

Hi,

I would like to show an "Are you sure"-message when saving the profile-settings with disabeled smilies or bbcode or other important settings.
How can I do that?! Any idea?

/Holger
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Thu Jan 14, 2010 6:19 pm 
Post subject: Re: Warning when settings in profile are not good

My first idea would be to use a javascript alert when either submitting the form or ticking a particular option to pop up a confirmation message. I can't really help you with the code, though. I have only used JS a few times and that was almost a year ago... and I wouldn't know where to do the modification(s) in phpBB's code.

Another JS option would be to have a small <div> or <span> under your sensitive options and have it display a message when they are selected. I think I have an example at hand that could inspire you if you choose this option..

Top of page:
Code:
<script type="text/JavaScript">
<!--
function toggle(section) {
   if(section.style.display == "none"){
      section.style.display = "";
   }
   else{
      section.style.display = "none";
   }
}
//-->
</script>


Near each option:
Code:
<a onClick="toggle(name)">Section Name</a> // I used it on an anchor, but you could have something like a radio button option with the same onClick action.
<br />
<span id="name">
<!-- This is the message you want displayed when the event occurs. You probably want the linebreak inside the span so that it doesn't show an empty space when the radio button or other is not selected. -->
</span>


You would probably need to have one such event/action for ticking a button and another one for ticking its opposite, each displaying and hiding the message respectively. And as such you wouldn't need the "if/else" condition in the function, just the "=none" part in one function and the opposite in the other function.

If you'd like to see an example, think about the green bar that displays on YouTube when you subscribe to a channel, or the frame that appears when you add a video to your favorites. Or check this page and click on "Géographie" in the "Ilmaril" menu box: http://salvatos.x10hosting.com/index.php


*Sigh* If only I could keep working on my own site...
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Jan 14, 2010 7:05 pm 
Post subject: Re: Warning when settings in profile are not good

Thank you! Yes, your idea is great!

Quote:
*Sigh* If only I could keep working on my own site...

LOL! I know that feeling!
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Thu Jan 14, 2010 8:40 pm 
Post subject: Re: Warning when settings in profile are not good

Glad to be of service icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0137 seconds using 15 queries. (SQL 0.0027 Parse 0.0005 Other 0.0104)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo