|
Harvyy
|
Jan 25 2016, 04:22 PM
Post #1
|
- Posts:
- 395
- Group:
- Members
- Member
- #632,095
- Joined:
- September 11, 2015
|
I solved my own problem, I had to delete the first line in the code in note pad along with the script tags. staff can close this
Spoiler: click to toggle Im trying to make this code an external js file because it is too long but, i don't think i'm doing it right. - Code:
-
<iframe id="sfem52" name="sfem52" onload="var sfem52 = document.getElementById('sfem52');var id2v = sfem52.contentDocument || sfem52.contentWindow.document;if(id2v.location.href.match('/topic/')){window.location=forumurl+'/forum/'+safewlh.split('&sfi=')[1];}" frameborder="no" style="width:1px;height:1px;border:0px;"></iframe> <script> var forumurl=document.getElementById('nav').getElementsByTagName('li')[1].getElementsByTagName('a')[0].href;forumurl=forumurl.substring(0,forumurl.lastIndexOf('/index/'));var safewlh=window.location.href.toString(); var secrettopic = '3248956 8309057 8060240'; function fulltrim(ftstring) { return ftstring.replace(/^\s+|\s+$/g, ''); } function cbajax(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else{var cbar=new Array(new ActiveXObject('MSXML2.XMLHTTP.6.0'),new ActiveXObject('MSXML2.XMLHttp.5.0'),new ActiveXObject('MSXML2.XMLHttp.4.0'),new ActiveXObject('MSXML2.XMLHTTP.3.0'),new ActiveXObject('Microsoft.XMLHttp'));for(var m=0;m<cbar.length;m++){if(cbar[m]){return cbar[m];}}}} function print_pre(pps, ppt) { if(!ppt) { var ppt = false; } var ppr = '(\r\n'; for(var f in pps) { ppr += '[' + f + '] = ' + pps[f] + '\r\n'; } ppr += ')\r\n\r\n'; return(ppr); } function deletethisannoun(r2, hidethisid) { var newcbajax5 = cbajax(); newcbajax5.onreadystatechange = function() { if(newcbajax5.readyState == 4) { if(newcbajax5.status == 200) { var newcbajax4 = cbajax(); newcbajax4.onreadystatechange = function() { if(newcbajax4.readyState == 4) { if(newcbajax4.status == 200) { document.getElementById(hidethisid).parentNode.parentNode.style.display = 'none'; document.getElementById('sfem53').style.display = 'none'; } } } var finalpostescapeinfo = ''; var fpeisave = newcbajax5.responseText.split('<textarea cols=\'50\' rows=\'20\' name=\'post\' tabindex=\'3\' id="c_post-text">')[1].split('</textarea>')[0]; var fpei2 = fpeisave.split('newspiderexcperhashendhashperexcspidernew'); for(var x = 0;x < fpei2.length - 1;x++) { if(fpei2[x].split('newspiderexcperhashderhashperexcspidernew')[4] != r2.toString()) { finalpostescapeinfo += fpei2[x] + 'newspiderexcperhashendhashperexcspidernew'; } } var sendquery = 'mode=3&type=1&ast=' + new Date().getTime().toString().substring(0, 10) + '&f=' + secrettopic.split(' ')[0] + '&xc=' + newcbajax5.responseText.split('<input type="hidden" name="xc" value="')[1].split('"')[0] + '&t=' + secrettopic.split(' ')[1] + '&qhash=' + newcbajax5.responseText.split('<input type=\'hidden\' name=\'qhash\' value=\'')[1].split('\'')[0] + '&p=' + secrettopic.split(' ')[2] + '&pg=0&x=0&sd=1&title=hiddenannouncementdata&description=&post=' + encodeURIComponent(finalpostescapeinfo) + '&sig=1&emo=1'; newcbajax4.open('POST', forumurl + '/post/', true); newcbajax4.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); newcbajax4.send(sendquery); } } } newcbajax5.open('GET', forumurl + '/post/?mode=3&type=1&f=' + secrettopic.split(' ')[0] + '&t=' + secrettopic.split(' ')[1] + '&p=' + secrettopic.split(' ')[2], true); newcbajax5.send(); } var isadmin = false; var s = document.getElementsByTagName('a'); for(var t = 0;t < s.length;t++) { if(s[t].href.match('/admin/') && s[t].parentNode.id == 'menu_acp' && s[t].parentNode.tagName == 'LI' && s[t].className == 'modal') { isadmin = true; } } var addellink = ''; if(isadmin) { addellink = ' · <a id="adleditlink" href="javascript:void(0);">Edit</a> · <a id="adldellink3" href="javascript:void(0);">Delete</a>'; } var wtitle = 'Announcements'; if(safewlh.substring(0, forumurl.length + 7) == forumurl + '/forum/') { document.write('<div id="sfem53" name="sfem53" style="display:none;position:absolute;left:10%;top:42%;width:80%;"><table width="100%" border="0" class="topic" cellspacing="0" id="announce_viewer"><thead><tr><th colspan="2"><span id="ctvan"></span> (<a href="javascript:void(0);" onclick="document.getElementById(\'sfem53\').style.display=\'none\';">Close</a>' + addellink + ')</th></tr></thead><tr><th colspan="2"><span class="left" id="cttsd"></span></th></tr><tr><td class="c_username"><strong id="ctvans5"></strong></td><td class="c_user"><span class="left" id="cttsd2"></span></td></tr><tr><td class="c_user" rowspan="2"><dl id="cttsd3" class="user_info"></dl></td><td class="c_post" id="ctp" style="height:200px;"></td></tr></table></div>'); var cf = safewlh.substring(forumurl.length + 7, safewlh.length); if(cf.match('/')) { cf = cf.split('/')[0]; } var a = document.getElementsByTagName('a'); for(var b = 0;b < a.length;b++) { if(a[b].href == forumurl + '/announce/') { a[b].href = forumurl + '/post/?forceads=1&mode=3&type=1&f=' + secrettopic.split(' ')[0].split('t')[0] + '&t=' + secrettopic.split(' ')[1] + '&p=' + secrettopic.split(' ')[2] + '&specannou=1&sfi=' + cf; } } var newcbajax3 = cbajax(); newcbajax3.onreadystatechange = function() { if(newcbajax3.readyState == 4) { if(newcbajax3.status == 200) { var anninfo = fulltrim(newcbajax3.responseText.split('<td class="c_post">')[1].split('</td>')[0]); if(anninfo.match('<div class="editby">')) { anninfo = fulltrim(anninfo.substring(0, anninfo.lastIndexOf('<div class="editby">'))); } anninfoa = new Array(); var anninfob = anninfo.split('newspiderexcperhashendhashperexcspidernew'); var cf = safewlh.substring(forumurl.length + 7, safewlh.length); if(cf.match('/')) { cf = cf.split('/')[0]; } var finalannlist = '<table class="posts" id="announcement_list" cellspacing="0"><tr id="announcement_head"><th colspan="3">Announcements (<a href=\'' + forumurl + '/post/?forceads=1&mode=3&type=1&f=' + secrettopic.split(' ')[0].split('t')[0] + '&t=' + secrettopic.split(' ')[1] + '&p=' + secrettopic.split(' ')[2] + '&specannou=1&sfi=' + cf + '\'>New Announcement</a>)</th></tr>'; var falrc = 'row2'; for(var q = 0;q < anninfob.length - 1;q++) { var anninfoc = anninfob[q].split('newspiderexcperhashderhashperexcspidernew'); if(anninfoc[0] == cf) { if(falrc == 'row2') { falrc = 'row1'; } else { falrc = 'row2'; } anninfoc[3] = anninfoc[3].replace(/newspiderexcperhashsemicolonhashperexcspidernew/gi, ';'); anninfoa[anninfoa.length] = new Array(); for(var w = 0;w < anninfoc.length;w++) { anninfoa[anninfoa.length - 1][w] = anninfoc[w]; } var aiacusername = anninfoc[6].split('newspiderexcperhashcsephashperexcspidernew'); anninfoa[anninfoa.length - 1][6] = aiacusername[1]; anninfoa[anninfoa.length - 1][7] = '<a href="' + forumurl + '/profile/' + aiacusername[2] + '" class="member">' + unescape(aiacusername[0]) + '</a>'; var tidnew = 'ab' + new Date().getTime(); finalannlist += '<tr class="' + falrc + '"><td class="c_cat-title"><a href="javascript:void(0);" onclick="document.getElementById(\'sfem53\').style.display=\'block\';try{document.getElementById(\'ctvans5\').innerHTML=anninfoa[' + (anninfoa.length - 1) + '][7];document.getElementById(\'adleditlink\').href=\'' + forumurl + '/post/?mode=3&type=1&f=' + secrettopic.split(' ')[0].split('t')[0] + '&t=' + secrettopic.split(' ')[1] + '&p=' + secrettopic.split(' ')[2] + '&specannou=1?forceads=1&gcaid=' + anninfoc[4] + '&sfi=' + cf + '\';this.id=\''+tidnew+'\';document.getElementById(\'adldellink3\').href=\'javascript:deletethisannoun(' + anninfoc[4] + ', \\\''+tidnew+'\\\');\';}catch(errormessage){}document.getElementById(\'cttsd3\').innerHTML=unescape(anninfoa[' + (anninfoa.length - 1) + '][6]);document.getElementById(\'cttsd\').innerHTML=anninfoa[' + (anninfoa.length - 1) + '][5];document.getElementById(\'cttsd2\').innerHTML=anninfoa[' + (anninfoa.length - 1) + '][5];document.getElementById(\'ctvan\').innerHTML=unescape(anninfoa[' + (anninfoa.length - 1) + '][1]) + \'; <small>\' + unescape(anninfoa[' + (anninfoa.length - 1) + '][2]) + \'</small>\';document.getElementById(\'ctp\').innerHTML=anninfoa[' + (anninfoa.length - 1) + '][3];">' + unescape(anninfoc[1]) + '</a><div class="description">' + unescape(anninfoc[2]) + '</div></td><td class="c_cat-starter"> </td><td class="c_cat-lastpost"> </td></tr>'; } } if(anninfoa.length > 0) { var divmainann = document.getElementById('main'); var dmat = divmainann.getElementsByTagName('table')[0]; if(dmat) { var dmat2 = dmat.rows[0]; var dmat3 = document.createElement('table'); dmat.style.marginTop = null; dmat3.style.marginTop = '10px'; var dmat4 = document.createElement('div'); dmat4.innerHTML = '<br />' + finalannlist + '</table><br />'; dmat.appendChild(dmat3); dmat3.appendChild(dmat2); dmat.appendChild(dmat4); } } } } } newcbajax3.open('GET', forumurl + '/topic/' + secrettopic.split(' ')[1] + '/1/?forceads=1', true); newcbajax3.send(); } if(safewlh.match('&specannou=1')) { document.title = wtitle; var a = document.getElementById('nav').getElementsByTagName('li'); for(var b = 2;b < a.length;b++) { a[b].style.display = 'none'; } document.getElementById('nav').innerHTML += ' → <li>' + wtitle + '</li>'; var dfpt = document.forms.posting.getElementsByTagName('table')[0]; dfpt.getElementsByTagName('th')[0].innerHTML = wtitle; var newRow = dfpt.insertRow(1); var newCol = newRow.insertCell(0); newCol.className = 'c_desc'; newCol.innerHTML = 'Show announcement in section:'; var newCol = newRow.insertCell(1); newCol.id = 'flistnid'; var newcbajax = cbajax(); var flistn = '<select id="stsfs">'; newcbajax.onreadystatechange = function() { if(newcbajax.readyState == 4) { if(newcbajax.status == 200) { var ccats = newcbajax.responseText.split('<div id="cat-'); for(var g = 1;g < ccats.length;g++) { var gid = ccats[g].split('"')[0]; var cfors = ccats[g].split('<tr id="forum-'); for(var h = 1;h < cfors.length;h++) { try { var hid = cfors[h].split('"')[0]; var hna = cfors[h].split('class="c_forum">')[1].split('<strong><a href="' + forumurl + '/forum/' + hid + '/">')[1].split('</a>')[0]; var hid2 = ''; if(safewlh.match('&sfi=')) { if(safewlh.split('&sfi=')[1] == hid) { hid2 = ' selected="selected"'; } } flistn += '<option value="' + hid + '"' + hid2 + '>' + hna.replace(/\&\;/gi, '&') + '</option>'; } catch(errormessage) { } } } document.getElementById('flistnid').innerHTML = flistn + '</select>'; } } } newcbajax.open('GET', forumurl + '/index/?forceads=1&specannou=2', true); newcbajax.send(); var d = null; document.forms.posting.post_submit.innerHTML = 'Make Announcement'; cadi = new Array(); var cad = document.forms.posting.post; document.forms.posting.title.value = ''; document.forms.posting.description.value = ''; ctcs = null; if(safewlh.match('&gcaid=')) { ctcs = safewlh.split('&gcaid=')[1].split('&')[0]; } if(cad.value.length < 41) { cad.value = 'newspiderexcperhashnotendhashperexcspidernew'; } if(cad.value.substring(cad.value.length - 41, cad.value.length) != 'newspiderexcperhashendhashperexcspidernew') { cad.value = ''; } else { var saveinfonum3 = ''; try { var cadi2 = cad.value.split('newspiderexcperhashendhashperexcspidernew'); for(var c = 0;c < cadi2.length - 1;c++) { var cadic = cadi2[c].split('newspiderexcperhashderhashperexcspidernew'); if(cadic[4] == ctcs) { document.forms.posting.title.value = unescape(cadic[1]); document.forms.posting.description.value = unescape(cadic[2]); saveinfonum3 = cadic[3].replace(/newspiderexcperhashsemicolonhashperexcspidernew/gi, ';'); cadi[cadi.length] = new Array(cadic[0], unescape(cadic[1]), unescape(cadic[2]), saveinfonum3, cadic[4], cadic[5], cadic[6]); } else { cadi[cadi.length] = new Array(cadic[0], unescape(cadic[1]), unescape(cadic[2]), cadic[3], cadic[4], cadic[5], cadic[6]); } } } catch(errormessage) { } cad.value = saveinfonum3; } document.forms.posting.post_submit.onclick = function() { var cuserlink = document.getElementById('top_info').getElementsByTagName('strong')[0].getElementsByTagName('a')[0]; var cusername = cuserlink.innerHTML; cuserlink = cuserlink.href.substring(forumurl.length + 9, cuserlink.href.length - 1); var newcbajax6 = cbajax(); newcbajax6.onreadystatechange = function() { if(newcbajax6.readyState == 4) { if(newcbajax6.status == 200) { var cuserinfo = newcbajax6.responseText.split('<dl class="user_info">')[1].split('</dl>')[0]; if(cuserinfo.match('Registered with IP Address')) { cuserinfo = cuserinfo.substring(0, cuserinfo.lastIndexOf('<dt>Registered with IP Address</dt>')) + '<dd class="spacer"></dd>'; } var stsfs = document.getElementById('stsfs'); var j = false; try { for(var i = 0;i < cadi.length;i++) { if(cadi[i][4] == ctcs) { j = true; cadi[i][0] = stsfs.options[stsfs.selectedIndex].value; cadi[i][1] = escape(document.forms.posting.title.value); cadi[i][2] = escape(document.forms.posting.description.value); cadi[i][3] = document.forms.posting.post.value.replace(/\;/gi, 'newspiderexcperhashsemicolonhashperexcspidernew'); cadi[i][5] = new Date().getTime(); cadi[i][6] = escape(cusername) + 'newspiderexcperhashcsephashperexcspidernew' + escape(cuserinfo) + 'newspiderexcperhashcsephashperexcspidernew' + escape(cuserlink); } } } catch(errormessage) { } if(!j) { cadi[cadi.length] = new Array(stsfs.options[stsfs.selectedIndex].value, escape(document.forms.posting.title.value), escape(document.forms.posting.description.value), document.forms.posting.post.value.replace(/\;/gi, 'newspiderexcperhashsemicolonhashperexcspidernew'), cadi.length, new Date().getTime(), escape(cusername) + 'newspiderexcperhashcsephashperexcspidernew' + escape(cuserinfo) + 'newspiderexcperhashcsephashperexcspidernew' + escape(cuserlink)); } var cadrstr = ''; for(var k = 0;k < cadi.length;k++) { for(var l = 0;l < cadi[k].length;l++) { cadrstr += cadi[k][l]; if(l < cadi[k].length - 1) { cadrstr += 'newspiderexcperhashderhashperexcspidernew'; } } cadrstr += 'newspiderexcperhashendhashperexcspidernew'; } document.forms.posting.post.value = cadrstr; document.forms.posting.target = 'sfem52'; document.forms.posting.post_submit.onclick = null; document.forms.posting.post_submit.click(); } } } newcbajax6.open('GET', forumurl + '/profile/' + cuserlink + '/', true); newcbajax6.send(); return(false); } } </script>
So i made this but it didn't work: <script type="text/javascript" src="http://z4.ifrm.com/30629/102/0/f5079142/UnlimitedAnnouncements.js"></script> Am i missing something?
Edited by Harvyy, Jan 25 2016, 05:56 PM.
|
|
Joe
|
Jan 25 2016, 04:56 PM
Post #2
|