Jump to content
MakeWebGames

Recommended Posts

Posted

Sad to see this forum going so i have created this one last module its nothing special i have been playing around with Javascript and used this for a personal project but figured some might get some use out of it while the forums are still active.

JsFiddle: https://jsfiddle.net/MrDeveloperR/g7worLvu/33/

add this html code where you want it to display.

<div id='container'>
    <h2>Jquery TOS</h2>
    <p>You must accept the tos before you can continue.</p>
    <div class='rules'>
      <h3>Rules</h3>
      <p style='color: red; font-weight: bold;'>
        <small>
        If you refuse to accept these tos then we are sorry to inform you that you can not continue.
      </small>
    </p>
    <ol>
      <li>We (game name) have the right to change the tos when and as we please without informing you</li>
      <li>You are only allowed 1 account per user</li>
      <li>Selling your items / account for real money is against the rules and will provide in banning</li>
    </ol>
    <h4><p>Some Final Text....</p></h4>
    <input type='checkbox' id='finalcheck' class='checkedbox' />
    <input type='submit' id='accept' classs='bttn' value='Accept Tos' disabled/>
  </div>
  <div id='formContainer'>
  
  </div>
</div>

add this to your css file

body {
  background: #20262e;
  color: #fff;
  font-family: sans-serif, Helvetica;
}
#container {
  width: auto;
  height: auto;
  padding: 5px;
  margin: 0;
}
#container > h2 {
  font-size: 28px;
  color: red;
  text-align: center;
}
#container > p {
  font-size: 15px;
  text-align: center;
}
#container .rules > h3 {
  font-size: 22px;
  color: red;
  text-align: center;
}
#container.rules > .bttn {
  width: auto;
  height: auto;
  padding: 5px;
  background: blue;
  border: 1px solid black;
}

add the Jquery code 

$(document).ready(function() {
	$('#finalcheck').click(function() {
  	if (!$(this).is(':checked')) {
    	$('#accept').attr('disabled', 'disabled');
      $('#formContainer').hide();
    } else {
    	$('#accept').removeAttr('disabled');
    }
  });
  $('#accept').click(function() {
  	//$('#formContainer').show();
    function pageRedirect() {
    	window.location.replace("/login.php");
    }         
    setTimeout(pageRedirect(), 10000);
  });
});

I am currently working on a site to upload my modules too but if anyone needs me i am available via discord.

DISCORD: em2pro4u

  • Like 1
Posted

the forum is not going to be closed that is for sure, thanks to @FoohonPie taking over, only the marketplace and hosting service

and nice feature, to be added i might take this idea and add it to my game that force players to accept the new terms and if they refuse i log them out 😄

 

  • Like 4
Posted
16 hours ago, ags_cs4 said:

the forum is not going to be closed that is for sure, thanks to @FoohonPie taking over, only the marketplace and hosting service

and nice feature, to be added i might take this idea and add it to my game that force players to accept the new terms and if they refuse i log them out 😄

 

Woah i must of missed this post haha thanks for the information and thank you i hope this does you well if you need any help 🙂 Its nothing special i have been putting my javascript some and have not seen a Jquery one.

Yeah i got the last of my credit and my access removed from marketplace, I will still be selling my paid / free modules for

  • Mccodes v2.05b
  • GL Engine
  • Grpg & Grpg v2
  • Other custom scripts / Extensions / (ViolentMonkey / TamperMonkey) JS scripts.
Posted

Amazing good luck with the sales, @Dayo is thinking of add other engines to the new gl marketplace if there is enough demand, you can add your works then.

yeah i really like the idea, tho its little tricky on my case as i made a module to manage my extra pages from acp (rules, TOS, privacy...) so that will be tricky to edit that

 

Posted
24 minutes ago, ags_cs4 said:

Amazing good luck with the sales, @Dayo is thinking of add other engines to the new gl marketplace if there is enough demand, you can add your works then.

yeah i really like the idea, tho its little tricky on my case as i made a module to manage my extra pages from acp (rules, TOS, privacy...) so that will be tricky to edit that

 

I did a hidden div container which could accept multiple rules / tos etc. 

or with a little ajax and php you make it update database (As i am sure your holding it like `tos` int(1) NOT NULL DEFAULT 0;

Ajax would handle the request upon clicking accept tos button with a little editing.

Posted
4 minutes ago, SwiftGameR said:

I did a hidden div container which could accept multiple rules / tos etc. 

or with a little ajax and php you make it update database (As i am sure your holding it like `tos` int(1) NOT NULL DEFAULT 0;

Ajax would handle the request upon clicking accept tos button with a little editing.

Im think of adding new ajax action to manage the logic, and if page slug is rules/tos i show new html div
and instead of new db column i use timers, and compare user TOS timer vs last page edit time to show the form

  • Like 1
Posted
2 minutes ago, ags_cs4 said:

Im think of adding new ajax action to manage the logic, and if page slug is rules/tos i show new html div
and instead of new db column i use timers, and compare user TOS timer vs last page edit time to show the form

Sorry I was not clearly thinking when i wrote that either a new rule / announcement / (timer / cookie) would make them force a change.

Sounds like you have a idea of what to do if you get stuck of need help i will be glad to try help the best i can  🙂

3 hours ago, ags_cs4 said:

Im think of adding new ajax action to manage the logic, and if page slug is rules/tos i show new html div
and instead of new db column i use timers, and compare user TOS timer vs last page edit time to show the form

also i removed this from the original code if you wish to hide / show <div id='formContainer'></div>

$(document).ready(function() {
  // Hide the original contents of formContainer
  $('#formContainer').hide();
  // Once the checkbox is clicked using the .click(function())
  $('#finalcheck').click(function() {
    // If the checkbox is not ticked we disabled the button and hide the formContainer  
    if (!$(this).is(':checked')) {
      // Sets the accept button disabled
      $('#accept').attr('disabled', 'disabled');
      // Hide form container if unticked
      $('#formContainer').hide();
    } else {
      // Remove the disabled button unless unticked again
      $('#accept').removeAttr('disabled');
    }
  });
  $('#accept').click(function() {
    // User has accepted tos and clicked the button so show the formContainer
  	$('#formContainer').show();
    // Function to handle a page redirect if required.
    function pageRedirect() {
    	window.location.replace("/login.php");
    }
    // this is meant to redirect the user after 10 seconds i dunno if its because i never tested it live and on js fiddle but was instant.
    setTimeout(pageRedirect(), 10000);
  });
});

 

  • Like 1

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