- Code:
$(function() { var points = null; var config = { forums: ["/f68-arhiva-softuri-statii-cb","/f86-akai","/f87-blaupunkt","/f88-grundig","/f89-jvc","/f90-lg","/f91-orion","/f92-panasonic","/f93-philips","/f94-samsung","/f95-sharp","/f96-sony","/f97-telefunken","/f98-toshiba","/f99-main-board-vestel","/f100-diverse","/f103-vortex","/f104-daewoo","/f105-thomson","/f107-acer","/f108-apple","/f109-asus","/f110-alienware","/f111-dell","/f112-fujitsu","/f113-hp","/f114-lenovo","/f115-msi","/f116-samsung","/f117-sony","/f118-toshiba","/f119-acer","/f120-alienware","/f121-apple","/f122-asus","/f123-dell","/f124-fujitsu","/f125-hp","/f126-lenovo","/f127-msi","/f128-samsung","/f129-sony","/f130-toshiba","/f131-diverse","/f132-diverse","/f155-aeg","/f156-ariston","/f157-beko","/f158-bosch","/f159-candy","/f160-daewoo","/f161-indesit","/f162-samsung","/f163-whirlpool","/f164-diverse","/f173-akai","/f174-beker","/f175-blaupunkt","/f176-jvc","/f177-kemwood","/f178-pionner","/f179-sony","/f180-diverse","/f181-akai","/f182-blaupunkt","/f183-diverse","/f184-grundig","/f185-lg","/f186-jvc","/f187-onkyo","/f188-philips","/f189-pionner","/f190-sharp","/f191-sony","/f192-yamaha","/f211-denon","/f212-denon","/f213-denon"], pTopic: ["\/post\?f=68&mode=newtopic","\/post\?f=86&mode=newtopic","\/post\?f=87&mode=newtopic","\/post\?f=88&mode=newtopic","\/post\?f=89&mode=newtopic","\/post\?f=90&mode=newtopic","\/post\?f=91&mode=newtopic","\/post\?f=92&mode=newtopic","\/post\?f=93&mode=newtopic","\/post\?f=94&mode=newtopic","\/post\?f=95&mode=newtopic","\/post\?f=96&mode=newtopic","\/post\?f=97&mode=newtopic","\/post\?f=98&mode=newtopic","\/post\?f=99&mode=newtopic","\/post\?f=100&mode=newtopic","\/post\?f=103&mode=newtopic","\/post\?f=104&mode=newtopic","\/post\?f=105&mode=newtopic","\/post\?f=107&mode=newtopic","\/post\?f=108&mode=newtopic","\/post\?f=109&mode=newtopic","\/post\?f=110&mode=newtopic","\/post\?f=111&mode=newtopic","\/post\?f=112&mode=newtopic","\/post\?f=113&mode=newtopic","\/post\?f=114&mode=newtopic","\/post\?f=115&mode=newtopic","\/post\?f=116&mode=newtopic","\/post\?f=117&mode=newtopic","\/post\?f=118&mode=newtopic","\/post\?f=119&mode=newtopic","\/post\?f=120&mode=newtopic","\/post\?f=121&mode=newtopic","\/post\?f=122&mode=newtopic","\/post\?f=123&mode=newtopic","\/post\?f=124&mode=newtopic","\/post\?f=125&mode=newtopic","\/post\?f=126&mode=newtopic","\/post\?f=127&mode=newtopic","\/post\?f=128&mode=newtopic","\/post\?f=129&mode=newtopic","\/post\?f=130&mode=newtopic","\/post\?f=131&mode=newtopic","\/post\?f=132&mode=newtopic","\/post\?f=155&mode=newtopic","\/post\?f=156&mode=newtopic","\/post\?f=157&mode=newtopic","\/post\?f=158&mode=newtopic","\/post\?f=159&mode=newtopic","\/post\?f=160&mode=newtopic","\/post\?f=161&mode=newtopic","\/post\?f=162&mode=newtopic","\/post\?f=163&mode=newtopic","\/post\?f=164&mode=newtopic","\/post\?f=173&mode=newtopic","\/post\?f=174&mode=newtopic","\/post\?f=175&mode=newtopic","\/post\?f=176&mode=newtopic","\/post\?f=177&mode=newtopic","\/post\?f=178&mode=newtopic","\/post\?f=179&mode=newtopic","\/post\?f=180&mode=newtopic","\/post\?f=181&mode=newtopic","\/post\?f=182&mode=newtopic","\/post\?f=183&mode=newtopic","\/post\?f=184&mode=newtopic","\/post\?f=185&mode=newtopic","\/post\?f=186&mode=newtopic","\/post\?f=187&mode=newtopic","\/post\?f=188&mode=newtopic","\/post\?f=189&mode=newtopic","\/post\?f=190&mode=newtopic","\/post\?f=191&mode=newtopic","\/post\?f=192&mode=newtopic","\/post\?f=211&mode=newtopic","\/post\?f=212&mode=newtopic","\/post\?f=213&mode=newtopic"], p_upload: 4, p_download: 2, field: "profile_field_10_1" };
var getUserPoints = function(userid, callback) { if(_userdata.session_logged_in == 0) return; $.ajax({ type: "GET", url: "/u" + userid, async: false, success: callback, error: function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(error.Message); } }); };
var setUserPoints = function(userid, pointsT, callback) { if(_userdata.session_logged_in == 0) return; $.post("/ajax_profile.forum?jsoncallback=jQuery1", { id: "1", user: userid, active: "1", content: '[["profile_field_10_1", "'+ parseInt(pointsT) +'"]]' }, "json").done(callback); };
/* Check forum url on new topic */ var topicNou = null; for(var y = 0; y < config.pTopic.length; y++) { if(window.location.href.search(new RegExp(config.pTopic[i], "ig")) !== -1) { topicNou = config.pTopic[i]; break; } } if(topicNou !== null) { $('input[name="post"]').click(function() { my_setcookie('cbHTy_Yh', 1); }); }
var FLink = $('.sub-header-path:eq(0) a.nav:last').attr('href'), checkForum = null; for(var i = 0; i < config.forums.length; i++) { if(new RegExp(config.forums[i], 'gi').test(FLink)) { checkForum = config.forums[i]; } else { return false; } } if(checkForum !== null) { $(".post #download-link a").click(function(e) { var $t = $(this); e.preventDefault(); console.log('try'); getUserPoints(_userdata.user_id, function(data) { points = $('#field_id1 dd', data).text(); console.log('execute points'); if(points < 2) return; if(points >= 2) { setUserPoints(_userdata.user_id, parseInt(points)-2, function(data) { window.open(($t.attr('data-link') != null) ? $t.attr('data-link') : $t.attr('data-href'), '_blank'); }); } }); }); }
console.log("System has been executed sucessfully."); }); |