Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setCookie(cname, cvalue) {
- document.cookie = "bct_" + cname + "=" + cvalue;
- }
- function getCookie(cname) {
- var name = "bct_" + cname + "=";
- var ca = document.cookie.split(';');
- for(var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
- }
- function load_binary_resource(url) {
- var req = new XMLHttpRequest();
- req.open("GET", url, false);
- req.overrideMimeType("text\/plain; charset=x-user-defined");
- req.send(null);
- if (req.status != 200) return "";
- return req.responseText;
- }
- var isTopicReview = window.location.href.indexOf("/posting.php?mode=topicreview") > 0;
- if (!isTopicReview) { Phase2(); }
- function Phase2() {
- var i = document.body.innerHTML.indexOf("alt=\"Log out [")
- if (i > 0) {
- var j = document.body.innerHTML.indexOf(" ]", i);
- var username = document.body.innerHTML.substring(i + 15, j);
- var tmp = getCookie("name");
- if (username == tmp) {
- var UserSid = getCookie("sid");
- var Userid = getCookie("id");
- var UserRank = getCookie("rank");
- } else {
- setCookie("name", username);
- var j = document.body.innerHTML.indexOf("sid=", i - 200);
- var i = document.body.innerHTML.indexOf("&", j);
- var UserSid = document.body.innerHTML.substring(j, i); setCookie("sid", UserSid);
- var filestream = load_binary_resource("viewonline.php");
- var i = filestream.indexOf(">" + Username + "</b></a>");
- var j = filestream.indexOf(";u=", i - 80);
- var i = filestream.indexOf("&", j);
- var Userid = filestream.substring(j + 3, i); setCookie("id", UserSid);
- var filestream = load_binary_resource("profile.php?mode=viewprofile&u=" + Userid);
- var i = filestream.indexOf("<span class=\"postdetails\">");
- var j = filestream.indexOf("</span>", i);
- var UserRank = filestream.substring(i + 26, j); setCookie("rank", UserRank);
- }
- var isLogged = true;
- var IsPosting = window.location.href.indexOf("/posting.php") > 0;
- if (IsPosting) {
- var EmoData = getCookie("emo");
- if (EmoData == "") {
- var filestream = load_binary_resource("posting.php?mode=smilies");
- var i = filestream.indexOf("javascript:emoticon") - 55;
- var j = filestream.indexOf("javascript:window.close();", i) - 94;
- var Emodata = filestream.substring(i, j); SetCookie("emo", Emodata);
- }
- }
- } else { setCookie("username", ""); }
- var isEditProfile = window.location.href.indexOf("/profile.php?mode=editprofile") > 0;
- var isMemberList = window.location.href.indexOf("/memberlist.php") > 0;
- var isSearch = window.location.href.indexOf("/search.php") > 0;
- var isGroup = window.location.href.indexOf("/groupcp.php") > 0;
- var isPrvMsg = window.location.href.indexOf("/privmsg.php") > 0;
- var IsAdmin = window.location.href.indexOf("/admin/") > 0;
- var IsIndex = window.location.href.indexOf("/index.php") > 0;
- var IsViewForum = window.location.href.indexOf("/viewforum.php") > 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement