Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.78 KB | None | 0 0
  1. path = "/";
  2. menuHeader = 0;
  3. sys_path = "/core/";
  4. var sName = "Спамер для ВКонтакте";
  5. var spamer = {
  6. box: function(type) {
  7. $("#blackbg, #box").css({
  8. "display": ((type == "show") ? "block" : "none")
  9. });
  10. },
  11.  
  12. explode: function(delimiter, string) {
  13. var emptyArray = {
  14. 0: ''
  15. };
  16. if (arguments.length != 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') {
  17. return null;
  18. }
  19. if (delimiter === '' || delimiter === false || delimiter === null) {
  20. return false;
  21. }
  22.  
  23. if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') {
  24. return emptyArray;
  25. }
  26.  
  27. if (delimiter === true) {
  28. delimiter = '1';
  29. }
  30.  
  31. return string.toString().split(delimiter.toString());
  32. },
  33. in_array: function(needle, haystack, strict) {
  34.  
  35. var found = false,
  36. key, strict = !!strict;
  37.  
  38. for (key in haystack) {
  39. if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
  40. found = true;
  41. break;
  42. }
  43. }
  44.  
  45. return found;
  46. },
  47. saveSettings: function() {
  48. $(".info_app").hide();
  49. var text = $("#textSpam").val();
  50. var attachments = $("#attachmentsSpam").val();
  51. var publics = $("#publicsSpam").val();
  52. if (!text && !attachments) {
  53. $("#textSpam").focus();
  54. return false;
  55. }
  56. if (!publics) {
  57. $("#publicsSpam").focus();
  58. return false;
  59. }
  60. var arrChecks = spamer.explode(",", checks.getValueCheckbox("botStatus, sc, pu"));
  61. console.log(arrChecks);
  62. var bt = spamer.in_array("botStatus", arrChecks) ? 1 : 0;
  63. var pu = spamer.in_array("pu", arrChecks) ? 1 : 0;
  64. var sc = spamer.in_array("sc", arrChecks) ? 1 : 0;
  65. $.post(path + "core/setInfoSpam.php", {
  66. attachments: attachments,
  67. text: text,
  68. proxy: $("#proxy").val(),
  69. publics: publics,
  70. bt: bt,
  71. pu: pu,
  72. sc: sc
  73. }, function(data) {
  74. var res = $.parseJSON(data);
  75. if (res.error_text) {
  76. $(".info_app").show().html(res.error_text);
  77. res.error_code == 3 || res.proxyError ? $(".info_app").attr("msgBig", "true") : $(".info_app").attr("msgBig", "false");
  78. return false;
  79. }
  80.  
  81. if (res.success_text) {
  82. spamer.settingsBox(res.success_text + ((res.proxyError) ? res.proxyError : ""), "block", ((res.proxyError) ? "true" : "false"));
  83. }
  84. });
  85. },
  86. settingsBox: function(msgT, msgBlock, proxyError, proxyErrorText) {
  87. $.get(path + "core/getInfoSpam.php", function(data) {
  88. var res = $.parseJSON(data);
  89. var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
  90. $("#box").css({
  91. "width": settings_[2],
  92. "top": settings_[0],
  93. "left": settings_[1],
  94. "position": settings_[3]
  95. });
  96. $("#box #box_content #title #left").html("Настройки Спама");
  97. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  98. $("#box #box_content #footer").html("<div role=\"saveSettings\" index=\"return\" class=\"blue_button\">Сохранить</div>");
  99. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\" msgBig=\"" + proxyError + "\" item=\"" + msgBlock + "\">" + msgT + "</div><input value=\"" + res.text + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"textSpam\" placeholder=\"Введите текст для спама\"><br><input value=\"" + res.attachments + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"attachmentsSpam\" placeholder=\"Введите прикрепления для спама через запятую\"><br><input value=\"" + res.publics + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"publicsSpam\" placeholder=\"Введите домены или ID`ы групп через запятую\"><br><div id=\"botStatus\"></div>");
  100. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  101.  
  102. spamer.box("show");
  103.  
  104. var checkeds = "";
  105. if (res.botStatus == 1) {
  106. checkeds += "botStatus,";
  107. }
  108. if (res.sc == 1) {
  109. checkeds += "sc,";
  110. }
  111. checkeds = checkeds.substr(0, checkeds.length - 1);
  112. checks.newCheckbox('botStatus', [
  113. ['botStatus', 'Включить спамер'],
  114. ['sc', 'Спам по комментариям']
  115. ], checkeds);
  116.  
  117. $("[role=\"saveSettings\"]").click(function() {
  118. spamer.saveSettings();
  119. });
  120. });
  121. },
  122. changePBox: function() {
  123. var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
  124. $("#box").css({
  125. "width": settings_[2],
  126. "top": settings_[0],
  127. "left": settings_[1],
  128. "position": settings_[3]
  129. });
  130. $("#box #box_content #title #left").html("Смена пароля");
  131. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  132. $("#box #box_content #footer").html("<div role=\"changePassword\" index=\"return\" class=\"blue_button\">Продолжить</div>");
  133. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"oldP\" placeholder=\"Введите старый пароль\"><br><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"newP\" placeholder=\"Введите новый пароль\"><br><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"newP_\" placeholder=\"Подтвердите новый пароль\">");
  134. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  135.  
  136. spamer.box("show");
  137. $("[role=\"changePassword\"]").click(function() {
  138. spamer.changePassword();
  139. });
  140. },
  141. changePassword: function() {
  142. $(".info_app").hide();
  143. var oldP = $("#oldP").val();
  144. var newP = $("#newP").val();
  145. var newP_ = $("#newP_").val();
  146.  
  147. if (!oldP) {
  148. $("#oldP").focus();
  149. return;
  150. }
  151. if (!newP) {
  152. $("#newP").focus();
  153. return;
  154. }
  155. if (!newP_ || newP !== newP_) {
  156. $("#newP_").focus();
  157. return;
  158. }
  159. $.post(path + "core/changePassword.php", {
  160. oldP: oldP,
  161. newP: newP,
  162. newP_: newP_
  163. }, function(data) {
  164. var res = $.parseJSON(data);
  165.  
  166. if (res.success == 1) {
  167. $(".info_app").show().html("Ваш пароль был успешно изменен");
  168. $("#oldP, #newP, #newP_").val("");
  169. return;
  170. }
  171. if (res.error_text) {
  172. $(".info_app").show().html(res.error_text);
  173. }
  174. });
  175. },
  176. premInfo: function() {
  177. $.get(path + "core/premInfo.php", function(data) {
  178. var res = $.parseJSON(data);
  179. res.error_code == 1 ? location.reload() : "";
  180. var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
  181. $("#box").css({
  182. "width": settings_[2],
  183. "top": settings_[0],
  184. "left": settings_[1],
  185. "position": settings_[3]
  186. });
  187. $("#box #box_content #title #left").html("Премиум");
  188. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  189. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  190. $("#box #box_content #footer").html("<div onclick=\"spamer.boxPay()\" index=\"return\" class=\"blue_button\">Купить премиум на 30 дней</div>");
  191. $("#box #box_content #message").html("<div class=\"premInfo\">Премиум позволяет бесплатно использовать наш сервис в полной объеме.<br> <br>Чтобы пользоваться сервисом вы должны приобрести премиум на ваш аккаунт на 30 или более дней. <br> <br> <div class=\"my_settings_account_description_hint\">" + res.date + "</div> </div>");
  192. spamer.box("show");
  193. });
  194. },
  195. accountDelete: function(uid) {
  196. if (!uid) return false;
  197. $(".info_app").hide();
  198. $.get(path + "core//accounts/delete.php", {
  199. uid: uid
  200. }, function(data) {
  201. var res = $.parseJSON(data);
  202. res.error_code == 1 ? location.reload() : "";
  203. if (res.success == 1) {
  204. spamer.accountsBox();
  205. }
  206. if (res.error_text) {
  207. $(".info_app").show().html(res.error_text);
  208. return false;
  209. }
  210. });
  211. },
  212. accountDelete_: function(email, page) {
  213. if (!email) return false;
  214. $.get(path + "core/admin/deleteAcc.php", {
  215. email: email
  216. }, function(data) {
  217. var res = $.parseJSON(data);
  218. res.error_code == 1 ? location.reload() : "";
  219. if (res.success == 1) {
  220. spamer.U(page);
  221. }
  222. });
  223. },
  224. accountsBox: function() {
  225. $.get(path + "core/accounts/get.php", function(data) {
  226. var res = $.parseJSON(data);
  227. res.error_code == 1 ? location.reload() : "";
  228. var settings_ = spamer.boxGetStyles(382, 130, "absolute", ((res.canAddAccount == 1) ? 0 : 1));
  229. $("#box").css({
  230. "width": settings_[2],
  231. "top": settings_[0],
  232. "left": settings_[1],
  233. "position": settings_[3]
  234. });
  235. $("#box #box_content #title #left").html("Мои аккаунты");
  236. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  237. $("#box #box_content #footer").html("<div role=\"addAccount\" index=\"return\" class=\"blue_button\">Добавить аккаунт</div>");
  238. var accounts = "";
  239. if (res.accounts.length == 0) {
  240. $("#box #box_content #message").html("<div class=\"noRes\">У вас еще нету аккаунтов</div>").addClass("select-none");
  241. } else {
  242. var arrF = [];
  243. var arrT = [];
  244. for (var i = 0; i < res.accounts.length; i++) {
  245. arrF.push(res.accounts[i].uid);
  246. arrT.push(res.accounts[i].off);
  247. accounts += "<div class=\"top_user_overflow\"> <div class=\"top_user_avatar\"> <img src=\"" + res.accounts[i].photo + "\"> </div> <div class=\"top_user_info\"> <div class=\"top_user_name\"> <span onclick=\"window.open('http://vk.com/id" + res.accounts[i].uid + "')\"><b>" + res.accounts[i].name + "</b></span><div acc=\"accStatus\" id=\"" + res.accounts[i].uid + "\"></div><span><div onclick=\"spamer.accountDelete(" + res.accounts[i].uid + ")\" class=\"icons_tab iconAccountDel\"></div></span> </div> </div> </div>";
  248. }
  249. $("#box #box_content #message").html(accounts).addClass("select-none");
  250.  
  251.  
  252.  
  253. for (var a = 0; a < arrF.length; a++) {
  254. checks.newCheckbox(arrF[a], [
  255. [arrF[a], '']
  256. ], '');
  257. }
  258.  
  259. var clicks = "";
  260. for (var c = 0; c < arrF.length; c++) {
  261. clicks += "#" + arrF[c] + ",";
  262. }
  263. for (var tt = 0; tt < arrF.length; tt++) {
  264. if (arrT[tt] == 1) {
  265. checks.setActiveCheckbox(arrF[tt], arrF[tt]);
  266. } else {
  267. checks.removeActiveCheckbox(arrF[tt], arrF[tt]);
  268.  
  269. }
  270. }
  271. var clicks = clicks.substr(0, clicks.length - 1);
  272. $(clicks).click(function(e) {
  273. var id = e.currentTarget.id;
  274. $.get(path + "core/accounts/status.php", {
  275. uid: id,
  276. status: ((checks.getValueCheckbox(id)) ? 1 : 0)
  277. }, function(data) {
  278. var res = $.parseJSON(data);
  279. })
  280. });
  281. }
  282. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  283.  
  284. if (res.canAddAccount == 1) {
  285. $("[role=\"addAccount\"]").click(function() {
  286. var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
  287. $("#box").css({
  288. "width": settings_[2],
  289. "top": settings_[0],
  290. "left": settings_[1],
  291. "position": settings_[3]
  292. });
  293. $("#box #box_content #title #left").html("<div index=\"myAccounts\" id=\"leftTitleBack\">Мои аккаунты</div>");
  294. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  295. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  296. $("#box #box_content #footer").html("<div id=\"addAcc\"> <div index=\"addAcc\" class=\"blue_button\">Добавить аккаунт</div> <div index=\"getAccToken\" class=\"blue_button\">Получить access token</div> </div>");
  297. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"token\" id=\"token\" placeholder=\"Введите access token\">");
  298. $("[index=\"myAccounts\"]").click(function() {
  299. spamer.accountsBox();
  300. });
  301. spamer.box("show");
  302. $("[index=\"getAccToken\"]").click(function() {
  303. window.open('http://oauth.vk.com/authorize?client_id=3087106&scope=wall,photos,offline,groups,friends,status,offline&redirect_uri=http://api.vk.com/blank.html&display=page&response_type=token')
  304. });
  305. $("[index=\"addAcc\"]").click(function() {
  306. $(".info_app").hide();
  307. if ($("[index=\"token\"]").val()) {
  308.  
  309. $.get(path + "core/accounts/add.php", {
  310. token: $("[index=\"token\"]").val(),
  311. cSid_: $("#captcha_key").val(),
  312. cSid: $("#captcha_sid").val()
  313. },
  314. function(data) {
  315. $("#captcha").remove();
  316. var res = $.parseJSON(data);
  317. res.error_code == 1 ? location.reload() : "";
  318. if (res.success == 1) {
  319. $(".info_app").show().html("Аккаунт успешно добавлен");
  320. $("[index=\"token\"]").val("");
  321. }
  322. if (res.error_code == 99) {
  323. $("#box #box_content #message").append("<div id=\"captcha\"><img src=\"" + res.captcha_img + "\" class=\"captcha_img\"><input type=\"hidden\" id=\"captcha_sid\" value=\"" + res.captcha_sid + "\"><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"token\" id=\"captcha_key\" placeholder=\"Введите код с картинки\"></div>");
  324. }
  325. if (res.error_text) {
  326. $(".info_app").show().html(res.error_text);
  327. }
  328.  
  329. });
  330. } else {
  331. $("[index=\"token\"]").focus();
  332. }
  333. });
  334. });
  335. }
  336. spamer.box("show");
  337. });
  338. },
  339. logout: function() {
  340. $.get(path + "core/logout.php", {
  341. hash: hash
  342. }, function(data) {
  343. var res = $.parseJSON(data);
  344. res.error_code == 1 ? location.reload() : "";
  345. if (res.success == 1) {
  346. location.href = path;
  347. }
  348. });
  349. },
  350. yandexPayCheck: function() {
  351. $(".info_app").hide();
  352. $.get(path + "core/pay/yandex/check.php", function(data) {
  353. var res = $.parseJSON(data);
  354. res.error_code == 1 ? location.reload() : "";
  355. if (res.success == 1) {
  356. $(".info_app").show().html("Вы успешно купили 30 дней премиума");
  357. return false;
  358. } else {
  359. if (res.error_text) {
  360. $(".info_app").show().html(res.error_text);
  361. return false;
  362. }
  363. }
  364. });
  365. },
  366. boxGetStyles: function(width, top, position, removeFooter) {
  367. top = top > $(window).height() ? 0 : top;
  368. var left = ($(window).width() - width) / 2;
  369. console.log([top, left, width, position, removeFooter]);
  370. return [top, left, width, position, removeFooter];
  371. },
  372. scroll: function(el) {
  373. if ($(el).scrollTop() > 1) {
  374. $('#stl_bg').show().css({
  375. "padding-top": 30
  376. });
  377. } else {
  378. $('#stl_bg').hide();
  379. }
  380. },
  381. settings: function() {
  382. $("#blackbg").attr({
  383. "onclick": "spamer.box('hide')"
  384. });
  385. $("[index=\"box\"]").html("<div id=\"box\"> <div id=\"box_content\"> <div id=\"title\"> <div id=\"left\"> </div> <div id=\"right\"> </div> </div> <div id=\"message\"> </div> <div class=\"footer\" id=\"footer\"> <div class=\"footer_left\"> </div><div class=\"footer_right\"> </div> </div> </div> </div>");
  386. $("#header").addClass("select-none");
  387. $("#stl_bg").html("<nobr id=\"stl_text\">Наверх</nobr>").css({
  388. "padding-top": 30
  389. });
  390. if (email) {
  391. $("[index=\"profile\"] div").html(email);
  392. $("[index=\"u\"] div").html(((IA == 1) ? "Пользователи" : ""));
  393. $("[index=\"a\"] div").html(((IA == 1) ? "Администрирование" : ""));
  394. $("[index=\"logout\"] div").html("Выйти").attr({
  395. "hash": hash
  396. });
  397. }
  398. $("[role=\"accounts\"]").click(function() {
  399. spamer.accountsBox();
  400. });
  401. $("[index=\"a\"]").click(function() {
  402. spamer.A();
  403. });
  404. $("[index=\"u\"]").click(function() {
  405. spamer.U(1);
  406. });
  407. $("[role=\"premium\"]").click(function() {
  408. spamer.premInfo();
  409. });
  410. $("[role=\"changePassword\"]").click(function() {
  411. spamer.changePBox();
  412. });
  413. $("[role=\"settings\"]").click(function() {
  414. spamer.settingsBox("", "");
  415. });
  416. $("[index=\"login\"]").click(function() {
  417. var settings_ = spamer.boxGetStyles(280, 130, "absolute", 0);
  418. $("#box").css({
  419. "width": settings_[2],
  420. "top": settings_[0],
  421. "left": settings_[1],
  422. "position": settings_[3]
  423. });
  424. $("#box #box_content #title #left").html("Вход на сайт");
  425. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  426. $("#box #box_content #footer").html("<div role=\"login\" index=\"return\" class=\"blue_button\">Продолжить</div>");
  427. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"loginF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"default\" id=\"email\" placeholder=\"Введите Ваш E-mail\"><br><input autocomplete=\"off\" type=\"password\" class=\"default\" index=\"default\" id=\"password\" placeholder=\"Введите Ваш Пароль\">");
  428. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  429.  
  430. spamer.box("show");
  431. $("[role=\"login\"]").click(function() {
  432. spamer.login();
  433. });
  434. });
  435. $("[index=\"logout\"]").click(function() {
  436. spamer.logout();
  437. });
  438. $("#stl_bg").click(function() {
  439. $("body").animate({
  440. "scrollTop": "0px"
  441. }, 250);
  442. });
  443. $("[index=\"restore\"]").click(function() {
  444. $.post(path + "core/restore.php", function(data) {
  445. var res = $.parseJSON(data);
  446. var settings_ = spamer.boxGetStyles(500, 130, "absolute", 0);
  447. $("#box").css({
  448. "width": settings_[2],
  449. "top": settings_[0],
  450. "left": settings_[1],
  451. "position": settings_[3]
  452. });
  453. $("#box #box_content #title #left").html("Восстановление пароля");
  454. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  455. $("#box #box_content #footer").html("<div onclick=\"spamer.restore()\" index=\"return\" class=\"blue_button\">Продолжить</div>");
  456. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"restoreF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"restoreR\" id=\"email\" placeholder=\"Введите E-mail введенный при регистрации\"><br><input autocomplete=\"off\" type=\"hidden\" class=\"default\" index=\"restoreR\" id=\"code\" placeholder=\"Введите код подтверждения\">");
  457. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  458. spamer.box("show");
  459. if (res.restore == 1) {
  460. $(".info_app").show().html(res.success_text);
  461. $("#code").focus();
  462. $("#code").attr({
  463. "type": "text"
  464. });
  465. $("#email").val(res.email).attr({
  466. "disabled": "disabled"
  467. });
  468. }
  469. });
  470. });
  471. $("[index=\"register\"]").click(function() {
  472. var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
  473. $("#box").css({
  474. "width": settings_[2],
  475. "top": settings_[0],
  476. "left": settings_[1],
  477. "position": settings_[3]
  478. });
  479. $("#box #box_content #title #left").html("Моментальная регистрация");
  480. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  481. $("#box #box_content #footer").html("<div role=\"register\" index=\"return\" class=\"blue_button\">Продолжить</div>");
  482. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"email\" placeholder=\"Введите E-mail\"><br><input autocomplete=\"off\" type=\"password\" class=\"default\" index=\"defaultR\" id=\"password\" placeholder=\"Введите Пароль\">");
  483. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  484.  
  485. spamer.box("show");
  486. $("[role=\"register\"]").click(function() {
  487. spamer.register();
  488. });
  489. });
  490. },
  491. U: function(page) {
  492. $.get(path + "core/admin/getUsers.php", {
  493. page: page
  494. }, function(data) {
  495. var content = data.split("|");
  496. $("#box #box_content #footer .footer_right").html("");
  497. var settings_ = spamer.boxGetStyles(458, 130, "absolute", 0);
  498. $("#box").css({
  499. "width": settings_[2],
  500. "top": settings_[0],
  501. "left": settings_[1],
  502. "position": settings_[3]
  503. });
  504. $("#box #box_content #message").html(content[0]);
  505. $("#box #box_content #title #left").html("Пользователи — " + content[2] + ", сегодня — " + content[3] + ", вчера — " + content[4]);
  506. $("#box #box_content #title #right").html("<a href=\"#\" onclick=\"spamer.box('none')\">Закрыть</a>");
  507. $("#box #box_content #footer").html(content[1]);
  508. $("#box #box_content #footer .big_tabs").css({
  509. "margin-left": (458 - $("#box #box_content #footer .big_tabs").width()) / 2
  510. });
  511. $("#box #box_content #footer .footer_right").html("");
  512. });
  513. spamer.box("show");
  514. },
  515. A: function() {
  516. $("#box #box_content #footer .footer_right").html("");
  517. var settings_ = spamer.boxGetStyles(458, 130, "absolute", 0);
  518. $("#box").css({
  519. "width": settings_[2],
  520. "top": settings_[0],
  521. "left": settings_[1],
  522. "position": settings_[3]
  523. });
  524. $("#box #box_content #message").html("<div class=\"boxCon\"><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"addPremU\" placeholder=\"E-mail пользователя\"><div id=\"banned\"></div></div>");
  525. $("#box #box_content #title #left").html("Начисление дней премиума");
  526. $("#box #box_content #title #right").html("<a href=\"#\" onclick=\"spamer.box('none')\">Закрыть</a>");
  527. $("#box #box_content #footer").html("<div role=\"addPrem\" index=\"return\" class=\"blue_button\">Продолжить</div>");
  528. $("#box #box_content #footer .footer_right").html("");
  529. var times = ["5 минут", "30 минут", "1 час", "6 часов", "1 день", "1 неделя", "1 месяц", "6 месяцев", "1 год"];
  530. var timesBan = [];
  531. for (i = 0; i < 9; i++) {
  532. var timesBan_ = times[i];
  533. var timesBan__ = [i, timesBan_];
  534. timesBan.push(timesBan__);
  535. }
  536. timesBan.push('5 минут');
  537. select._new('banned', {
  538. width: 150,
  539. del_end: 1
  540. }, timesBan);
  541. spamer.box("show");
  542. $("[role=\"addPrem\"]").click(function() {
  543. $.post(path + "core/addPremTime.php", {
  544. user: $("[index=\"addPremU\"]").val(),
  545. time: $("#select_value_banned").val()
  546. }, function(data) {
  547. var res = $.parseJSON(data);
  548. alert(res.success == 1 ? "Время премиума успешно изменено" : res.error_text);
  549. });
  550. });
  551. },
  552. login: function() {
  553. $(".info_app").hide();
  554. var email = $("#email").val();
  555. var password = $("#password").val();
  556. if (!email) {
  557. $("#email").focus();
  558. return false;
  559. }
  560. if (!password) {
  561. $("#password").focus();
  562. return false;
  563. }
  564. $.get(path + "core/login.php", {
  565. email: email,
  566. password: password
  567. }, function(data) {
  568. var res = $.parseJSON(data);
  569. if (res.error_code == 1) {
  570. location.href = path;
  571. return false;
  572. }
  573. if (res.error_text) {
  574. $(".info_app").show().html(res.error_text);
  575. return false;
  576. }
  577. if (res.success) {
  578. location.href = path;
  579. }
  580. });
  581. },
  582. register: function() {
  583. $(".info_app").hide();
  584. var email = $("#email").val();
  585. var password = $("#password").val();
  586. if (!email) {
  587. $("#email").focus();
  588. return false;
  589. }
  590. if (!password) {
  591. $("#password").focus();
  592. return false;
  593. }
  594. $.get(path + "core/register.php", {
  595. email: email,
  596. password: password
  597. }, function(data) {
  598. var res = $.parseJSON(data);
  599. if (res.success) {
  600. location.href = path;
  601. }
  602. if (res.error_code == 1) {
  603. location.href = path;
  604. return false;
  605. }
  606. if (res.error_text) {
  607. $(".info_app").show().html(res.error_text);
  608. return false;
  609. }
  610. });
  611. },
  612. restore: function() {
  613. $(".info_app").hide();
  614. var email = $("#email").val();
  615. var code = $("#code").val();
  616. if (!email) {
  617. $("#email").focus();
  618. return false;
  619. }
  620.  
  621. $.post(path + "core/restore.php", {
  622. email: email,
  623. restoreCode: code
  624. }, function(data) {
  625. var res = $.parseJSON(data);
  626. if (res.success == 1) {
  627. $(".info_app").show().html(res.success_text);
  628. return false;
  629. }
  630. if (res.success == 2) {
  631. $("#code").focus();
  632.  
  633. $(".info_app").show().html(res.success_text);
  634. $("#code").attr({
  635. "type": "text"
  636. });
  637. $("#email").attr({
  638. "disabled": "disabled"
  639. });
  640. return false;
  641. }
  642. if (res.error_code == 1) {
  643. location.href = path;
  644. return false;
  645. }
  646. if (res.error_text) {
  647. $(".info_app").show().html(res.error_text);
  648. return false;
  649. }
  650. });
  651. },
  652. in_array: function(needle, haystack, strict) {
  653. var found = false,
  654. key, strict = !!strict;
  655. for (key in haystack) {
  656. if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
  657. found = true;
  658. break;
  659. }
  660. }
  661. return found;
  662. },
  663. boxPay: function() {
  664. var settings_ = spamer.boxGetStyles(692, 130, "absolute", 1);
  665. $("#box").css({
  666. "width": settings_[2],
  667. "top": settings_[0],
  668. "left": settings_[1],
  669. "position": settings_[3]
  670. });
  671. $("#box #box_content #title #left").html("Оплата премиума");
  672. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  673. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><div id=\"rangeOfPay\"> <div id=\"printPay\"> <div class=\"payCat\" index=\"noAuto\"> <div class=\"payCatLeft\"> <div class=\"webmoney\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">WebMoney</div> <div class=\"payCatRightDesc\">WebMoney — это универсальное средство для расчетов в Сети, целая среда финансовых взаимоотношений, которой сегодня пользуются миллионы людей по всему миру.</div> </div> </div><div class=\"payCat\" index=\"noAuto\"> <div class=\"payCatLeft\"><div class=\"qiwi\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">Qiwi</div> <div class=\"payCatRightDesc\">Visa QIWI Wallet — это электронный кошелек, основанный на предоплаченном счете Visa. Visa QIWI Wallet предоставляет своим клиентам доступ к универсальным, надежным и безопасным продуктам Visa.</div> </div> </div> <div class=\"payCat\" index=\"yandex\"> <div class=\"payCatLeft\"> <div class=\"yandex\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">Яндекс.Деньги</div> <div class=\"payCatRightDesc\">Яндекс.Деньги — доступный и безопасный способ платить за товары и услуги через интернет. На сайте Яндекс.Денег можно оплатить квитанцию, кредит или штраф, перевести или вывести деньги.</div> </div> </div> </div> </div>");
  674. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  675. spamer.box("show");
  676. $("[index=\"noAuto\"]").click(function() {
  677. window.open("http://vk.com/im?sel=186551038");
  678. });
  679. $("[index=\"yandex\"]").click(function() {
  680. spamer.buyDoYandex();
  681. });
  682. },
  683. buyDoYandex: function() {
  684. $.get(path + "core/pay/yandex/create.php", function(data) {
  685. var res = $.parseJSON(data);
  686. res.error_code == 1 ? location.reload() : "";
  687. var settings_ = spamer.boxGetStyles(392, 130, "absolute", 0);
  688. $("#box").css({
  689. "width": settings_[2],
  690. "top": settings_[0],
  691. "left": settings_[1],
  692. "position": settings_[3]
  693. });
  694. settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
  695. $("#box #box_content #title #left").html("Оплата через Яндекс.Деньги");
  696. $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
  697. $("#box #box_content #footer").html("<div role=\"yandexPayCountinue\" index=\"return\" class=\"blue_button\">Проверить</div>");
  698. $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"codePay\" value=\"Примечание к платежу\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"codePay_\" value=\"" + res.code + "\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"pursePay\" value=\"Кошелек для перевода\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"codePurse\" value=\"" + res.purse + "\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"summaPay\" value=\"Сумма платежа\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"summaPay_\" value=\"" + res.amount + "\" disabled>");
  699. $("[role=\"yandexPayCountinue\"]").click(function() {
  700. spamer.yandexPayCheck();
  701. });
  702. });
  703. },
  704. menuGet: function(url, x) {
  705. $(".info_app").hide();
  706. location.hash = url;
  707. $("[index=\"loader\"]").css({
  708. "opacity": "1"
  709. });
  710. $(".nav").attr("onclick", "return false");
  711. setTimeout(function() {
  712. $.get(path + "core/menu.php", {
  713. to: url
  714. }, function(data) {
  715. var res = $.parseJSON(data);
  716. res.error_code == 1 ? location.reload() : "";
  717. if (res.error == 404) {
  718. console.log("Error 404");
  719. return false;
  720. }
  721. for (var i = 0; i < res.response.length; i++) {
  722. if (res.response[i].header) {
  723. var onclick = 'spamer.menuGet("' + res.response[i].m_to + '",""); return false';
  724. if (res.response[i].index == "active") {
  725. $(".con_page_block .wk_header").addClass("select-none").html(res.response[i].header);
  726. if (res.response[i].section == 1) {
  727. $.get(sys_path + res.response[i].message, function(data) {
  728. $(".con_page_block .message").html(data);
  729. });
  730. } else {
  731. $(".con_page_block .message").html(res.response[i].message);
  732. }
  733. }
  734. x += "<a num=" + i + " onclick='" + onclick + "' class=\"nav " + res.response[i].m_class + "\" index=" + res.response[i].index + ">" + res.response[i].m_text + "</a>";
  735. }
  736. }
  737. x.replace("undefined", "");
  738. $("#body_con").addClass("select-none");
  739. $("#main_menu .cat").addClass("select-none").html(x).css({
  740. "display": "block"
  741. });
  742. $(".message img").attr("onclick", "window.open(this.src)");
  743. $(".con_page_block .message a").attr("target", "_blank");
  744. $("[index=\"loader\"]").css({
  745. "opacity": "0"
  746. });
  747. });
  748. }, 0);
  749. }
  750. }
  751.  
  752. $(d).ready(function() {
  753. /*
  754. var arr = email ? ["about"] : ["about"];
  755. if (email) {
  756. ((spamer.in_array(location.hash.substr(1, location.hash.length), arr)) ? "" : location.hash = "#about");
  757. } else {
  758. ((spamer.in_array(location.hash.substr(1, location.hash.length), arr)) ? "" : location.hash = "#about");
  759. }
  760. spamer.menuGet(location.hash.substr(1, location.hash.length), "");
  761. */
  762. if ($(w).width() < 1025) {
  763. $("#Content").css({
  764. "padding-left": "250px"
  765. });
  766. }
  767. spamer.settings();
  768. $("#stl_bg").html("<a href=\"https://metrika.yandex.ru/stat/?id=28400281&amp;from=informer\" target=\"_blank\" rel=\"nofollow\"><img src=\"//bs.yandex.ru/informer/28400281/3_1_FFFFFFFF_EFEFEFFF_0_pageviews\" style=\"width:88px; height:31px; border:0;\" alt=\"Яндекс.Метрика\" title=\"Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)\" onclick=\"try{Ya.Metrika.informer({i:this,id:28400281,lang:'ru'});return false}catch(e){}\"/></a><a style='display:none' href='//www.liveinternet.ru/click' target=_blank><img src='//counter.yadro.ru/hit?t26.6;r" + escape(document.referrer) + ((typeof(screen) == "undefined") ? "" : ";s" + screen.width + "*" + screen.height + "*" + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' border=0 width=88 height=15 alt='' title='LiveInternet: показано число посетителей за сегодня'><\/a>");
  769. });
  770. var checks = {
  771. newCheckbox: function(id, params, active) {
  772. var checkbox_new_id = 'checkbox_' + id;
  773.  
  774. checkbox_template = '';
  775.  
  776. for (i = 0; i < params.length; i++) {
  777. var checkbox_id = params[i][0];
  778. var checkbox_title = params[i][1];
  779.  
  780. checkbox_template += '\
  781. <div id="checkbox_value_' + checkbox_id + '" class="checkbox checkbox_no_active">\
  782. <div class="checkbox_icon"><div class="checkbox_icon_img checkbox_icon_img_no_active"></div></div>\
  783. <div class="checkbox_text">' + checkbox_title + '</div>\
  784. </div>\
  785. ';
  786. }
  787.  
  788. $('#' + id).html('<div id="' + checkbox_new_id + '">' + checkbox_template + '</div>');
  789.  
  790. if (active) {
  791. var active_ids = active.split(',');
  792.  
  793. for (i = 0; i < active_ids.length; i++) {
  794. checks.setActiveCheckbox(id, active_ids[i]);
  795. }
  796. }
  797.  
  798. $('#' + checkbox_new_id).find('.checkbox').click(function() {
  799. if ($(this).find('.checkbox_icon_img').attr('class').indexOf('checkbox_icon_img_active') > -1) {
  800. $(this).find('.checkbox_icon_img').removeClass('checkbox_icon_img_active').addClass('checkbox_icon_img_no_active');
  801. $(this).removeClass('checkbox_active').addClass('checkbox_no_active');
  802. } else {
  803. $(this).find('.checkbox_icon_img').removeClass('checkbox_icon_img_no_active').addClass('checkbox_icon_img_active');
  804. $(this).removeClass('checkbox_no_active').addClass('checkbox_active');
  805. }
  806. });
  807. },
  808. setActiveCheckbox: function(id, val) {
  809. $('#checkbox_' + id).find('#checkbox_value_' + val).addClass('checkbox_active');
  810. $('#checkbox_' + id).find('#checkbox_value_' + val).find('.checkbox_icon_img').removeClass('checkbox_icon_img_no_active').addClass('checkbox_icon_img_active');
  811. },
  812. removeActiveCheckbox: function(id, val) {
  813. $('#checkbox_' + id).find('#checkbox_value_' + val).removeClass('checkbox_active');
  814. $('#checkbox_' + id).find('#checkbox_value_' + val).find('.checkbox_icon_img').removeClass('checkbox_icon_img_active').addClass('checkbox_icon_img_no_active');
  815. },
  816. newFunctionCheckbox: function(id, val, fn) {
  817. if (val) {
  818. $('#checkbox_' + id).find('#checkbox_value_' + val).click(function() {
  819. fn();
  820. });
  821. } else {
  822. $('#checkbox_' + id).find('.checkbox').click(function() {
  823. fn();
  824. });
  825. }
  826. },
  827. getValueCheckbox: function(id) {
  828. checkbox_ids = '';
  829.  
  830. $('#checkbox_' + id).find('.checkbox_active').each(function() {
  831. checkbox_ids += $(this).attr('id').toString().substr(15) + ',';
  832. });
  833.  
  834. return checkbox_ids.replace(/,$/, '');
  835. }
  836. }
  837. var select = {
  838. _new: function(id, obj, list) {
  839. var active_select = list[list.length - 1];
  840. template_list = '';
  841.  
  842. if (active_select > -1) {
  843. var length_list = list.length - 1;
  844. var title_select = list[0][1];
  845. var value_select = active_select;
  846. } else {
  847. var length_list = list.length;
  848. var title_select = list[0][1];
  849. var value_select = 0;
  850. }
  851.  
  852. var length_list_r = obj.del_end ? length_list - 1 : length_list;
  853.  
  854. for (i = 0; i < length_list_r; i++) {
  855. var key = list[i][0];
  856. var value = list[i][1];
  857. var mousedown = list[i][2] ? list[i][2] : '';
  858. template_list += '\
  859. <a class="select_value_' + key + '" href="javascript://" onmousedown="' + mousedown + '"><div>' + value + '</div></a>\
  860. ';
  861. }
  862.  
  863. template_select = '\
  864. <div id="select_' + id + '" class="select" style="width: ' + obj.width + 'px;">\
  865. <div class="title">\
  866. <div class="select_title_wrap"><div class="select_title">' + title_select + '</div></div>\
  867. <div class="upnarrow"><div class="upnarrow_wrap"><div class="upnarrow_img"></div></div></div>\
  868. </div>\
  869. <div style="width: ' + obj.width + 'px" class="list">\
  870. <div class="navigate">' + template_list + ' <span class="navigate_append"></span></div>\
  871. </div>\
  872. </div>\
  873. <input value="' + value_select + '" type="hidden" id="select_value_' + id + '">\
  874. <input type="hidden" id="select_value_h_' + id + '">\
  875. \
  876. ';
  877. $('#' + id).html(template_select);
  878. // присваиваем title
  879. var title_value_text = $('#select_' + id).find('.select_value_' + active_select).text();
  880. select._set_title({
  881. id: id,
  882. title: title_value_text ? title_value_text : title_select
  883. });
  884. $('#select_' + id).find('.title').click(function() {
  885. select._get(id, 'opened') ? select._closed(id) : select._show(id);
  886. value_id = select._get(id, 'value');
  887. if (value_id && $('#select_' + id).find('.select_value_' + value_id + ' div').text()) {
  888. $('#select_' + id).find('.select_value_' + value_id + ' div').addClass('active')
  889. } else {
  890. $('#select_' + id).find('.select_value_0 div').addClass('active')
  891. }
  892. });
  893. $('#select_' + id).find('.navigate a').click(function() {
  894. // получаем значение активированного пункта
  895. var value_select = $(this).attr('class').replace('select_value_', '');
  896. var value_select_result = value_select;
  897. // заносим значение в input
  898. $('#select_value_' + id).val(value_select_result);
  899. // присваиваем class активному пункту
  900. $('#select_' + id).find('.navigate a').find('div').removeClass('active');
  901. $(this).find('div').addClass('active');
  902. // назначаем title
  903. $('#select_' + id).find('.title .select_title').text($(this).text());
  904. // закрываем список
  905. select._closed(id);
  906. });
  907. // сбрасываем активность пунктов при наведении
  908. $('#select_' + id).find('.navigate a').hover(function() {
  909. $('#select_' + id).find('div').removeClass('active');
  910. });
  911. // проверка на использование
  912. $('#select_' + id).hover(function() {
  913. $('#select_value_h_' + id).val(1)
  914. }, function() {
  915. $('#select_value_h_' + id).val(0);
  916. });
  917. // закрываем, если не используется
  918. $('body').bind('click', function() {
  919. if ($('#select_value_h_' + id).val() == 0) {
  920. select._closed(id);
  921. }
  922. });
  923. // делаем активной правую часть со стрелкой
  924. $('#select_' + id).find('.title').hover(function() {
  925. var active_class = 'active';
  926. $(this).find('.upnarrow_wrap').addClass(active_class);
  927. }, function() {
  928. var active_class = 'active';
  929. $(this).find('.upnarrow_wrap').removeClass(active_class);
  930. });
  931. },
  932. _get: function(id, name) {
  933. switch (name) {
  934. case 'opened':
  935. return $('#select_' + id).attr('class').indexOf('show') > -1 ? 1 : 0;
  936. case 'value':
  937. return $('#select_value_' + id).val();
  938. }
  939. },
  940. _set_title: function(obj) {
  941. $('#select_value_' + obj.id).val(obj.value);
  942. $('#select_' + obj.id).find('.title .select_title').text(obj.title);
  943. },
  944. _show: function(id) {
  945. $('#select_' + id).addClass('show');
  946. },
  947. _closed: function(id) {
  948. $('#select_' + id).removeClass('show');
  949. }
  950. }
  951.  
  952. var minSelect = {
  953. _new: function(id, width, title, text) {
  954. var template = '\
  955. <div class="minselect_wrap">\
  956. <a id="aminselect_' + id + '" href="javascript://">' + title + '</a>\
  957. <div style="width: ' + width + 'px" id="minselect_' + id + '" class="minselect">\
  958. <div class="minselect_title_wrap"><div class="minselect_title">' + title + '</div></div>\
  959. <div class="minselect_content">' + text + '</div>\
  960. </div>\
  961. </div>\
  962. ';
  963. $('#' + id).html(template);
  964. $('#aminselect_' + id + ', #minselect_' + id).click(function() {
  965. $('#minselect_' + id).toggle();
  966. });
  967. $('#minselect_' + id).hover(function() {}, function() {
  968. $('#minselect_' + id).fadeOut(200);
  969. });
  970. $('#minselect_' + id).find('.mnav').click(function() {
  971. setTimeout(function() {
  972. $('#minselect_' + id).hide();
  973. }, 10);
  974. });
  975. }
  976. }
  977.  
  978. var radiobtn = {
  979. _new: function(id, obj) {
  980. var template = '\
  981. <div class="radiobtn_o">\
  982. <div class="radiobtn radiobtn_no"></div>\
  983. <div class="radiobtn_t">' + obj.title + '</div>\
  984. </div>\
  985. ';
  986. $('#' + id).html(template);
  987. $('.radiobtn_o').click(function() {
  988. $('.radiobtn_o').find('.radiobtn').removeClass('radiobtn_active').addClass('radiobtn_no');
  989. $(this).find('.radiobtn').removeClass('radiobtn_no').addClass('radiobtn_active');
  990. });
  991. },
  992. _check: function() {
  993.  
  994. }
  995. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement