Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Website rules, cant fin one file... :(

Asked Modified Viewed 2,014 times
D
diadingo
D
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Hi, i have website rules(warning) when you enter the site, but it have to show rules one time for one computer per day, for that to do it requests php AJAX script(i think) so there is the request code:

function accept_warning() {
    $.ajax({
        type: "GET",
        url: addr + "accept_vert.php",
        dataType: "script"
    });


And full script:

var addr = "/";

var warning;
var warning_opacity = 1;
var do_show = true;
var warning_data = '<table width="540" cellSpacing="0" cellPadding="0" border="0" class="tbTransparentmb" bgcolor="#FFFFFF" style="border: 3px solid #000000">    <tr>        <td bgcolor="#FFFFFF" width="10"></td>        <td  class="tbTransparentCell" bgcolor="#FFFFFF" align="left"><!-- content -->    <p><font color="#000000" style="font-size: 16pt; " face="Century Gothic"><b>    <br>    Demesio!</b></font>        </p>    <p><font face="Verdana" size="2">Warning</font>    </p><br/>    <p>        <a href="javascript:accept_warning();" style="background:#000000; margin:5px; padding:5px; font-weight:bold; font-size:14px; color:#FFFFFF;">Patvirtinu</a></p>&nbsp;    <!-- content  end-->        </td>        <td bgcolor="#FFFFFF" width="10"> </td>    </tr>    </table>';
var warning_table;



function display_warning() {
    jQuery('object').css('display', 'none');
    jQuery('embed').attr('wmode', 'opaque');
    // Nei pazymeti, nei pascrollinti... :D
    document.body.style.overflow = "hidden";
    document.documentElement.style.overflow = "hidden";
    document.body.onselectstart = function () { return false; }

    warning = document.createElement("DIV");
    document.body.appendChild(warning);

    $(warning).css("width", screen.width);
    $(warning).css("height", screen.height);
    $(warning).css("position", "absolute");
    $(warning).css("zindex", "9998");

    $(warning).css("left", 0);
    $(warning).css("top", (document.all)?document.body.scrollTop:window.pageYOffset);
    $(warning).css("background", "#000000");
    $(warning).attr("id", "awarning_table");

    warning_table = document.createElement("DIV");
    document.body.appendChild(warning_table);
    $(warning_table).attr("id", "warning_table");
    $(warning_table).css("width", "100%");
    $(warning_table).css("height", "100%");
    $(warning_table).css("position", "absolute");
    $(warning_table).css("left", 0);
    $(warning).css("zindex", "9999");
    $(warning_table).css("top", (document.all)?document.body.scrollTop:window.pageYOffset);

    $(warning_table).attr("innerHTML", '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="middle">'+warning_data+'</td></tr></table>');
    $(warning).hide();
    $(warning_table).hide();

    $("#warning_table").fadeTo("fast", 0);
    $(warning).css("opacity", 0);
    $(warning).show();
    $(warning).fadeTo("slow", 0.75, function () {
        $("#warning_table").show();
        $("#warning_table").fadeTo("normal", 1);
    });
}

function accept_warning() {
    $.ajax({
        type: "GET",
        url: addr + "accept_vert.php",
        dataType: "script"
    });
    $("#warning_table").fadeTo("slow", 0, function () {
        $(this).hide();

        $("#awarning_table").fadeTo("slow", 0, function () {
            $(this).hide();

            // Atstatome;)
            document.body.style.overflow = "auto";
            document.documentElement.style.overflow = "auto";
            jQuery('object').css('display', 'block');
            document.body.onselectstart = function () { return true; }
        });
    });
}

$(document).ready(function () {
    display_warning();
});



so maybe anyone knows just what to do?, because i searched everywhere but found nothing ;(
Edited by diadingo on 13-03-2009 22:22,
0 replies

1 post

D
diadingo
D
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

I found script, maybe it can work with this?

function GetCookie (name) { 
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;

  while (i < clen) {
    var j = i + alen;

   if (document.cookie.substring(i, j) == arg)
       return getCookieVal (j);

      i = document.cookie.indexOf(" ", i) + 1;

 if (i == 0) break;

}

return null;

}

function SetCookie (name, value) {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");

}

function DeleteCookie (name) {
  var exp = new Date();
  exp.setTime (exp.getTime() - 1);
  var cval = GetCookie (name);
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){
  var count = GetCookie('count')
   
  if(count == null) {
    SetCookie('count','1')
    return 1
} else {
   var newcount = parseInt(count) + 1;
   DeleteCookie('count')
   SetCookie('count',newcount,exp)
return count

}

}

function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
     endstr = document.cookie.length;
     return unescape(document.cookie.substring(offset, endstr));
}



function checkCount() {
  var count = GetCookie('count');
  if (count == null) {
    count=1;
    SetCookie('count', count, exp);
    window.open(page, "", windowprops);
  } else {
    count++;
    SetCookie('count', count, exp);
  }

}
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 1 member

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet