var username; var postid; function QuoteJump(post) { var hash = "#post" + post; if($(hash).raw() != null) { window.location.hash = hash; } else { window.open("forums.php?action=viewthread&postid="+post, '_self'); } } function Quote(post, user) { Quote(post, user, false) } function Quote(post, user, link) { username = user; postid = post; ajax.get("?action=get_post&post=" + postid, function(response){ if ($('#quickpost').raw().value !== '') { $('#quickpost').raw().value = $('#quickpost').raw().value + "\n\n"; } $('#quickpost').raw().value = $('#quickpost').raw().value + "[quote="+username + (link == true ? "|" + post : "") + "]" + //response.replace(/(img|aud)(\]|=)/ig,'url$2').replace(/\[url\=(https?:\/\/[^\s\[\]<>"\'()]+?)\]\[url\](.+?)\[\/url\]\[\/url\]/gi, "[url]$1[/url]") html_entity_decode(response) + "[/quote]"; resize('quickpost'); }); } function Edit_Form(post,key) { $('#reply_box').toggle(); postid = post; if (location.href.match(/torrents\.php/) || location.href.match(/artist\.php/)) { boxWidth="50"; } else { boxWidth="80"; } $('#bar' + postid).raw().cancel = $('#content' + postid).raw().innerHTML; $('#bar' + postid).raw().oldbar = $('#bar' + postid).raw().innerHTML; $('#content' + postid).raw().innerHTML = "
"; $('#bar' + postid).raw().innerHTML = ""; ajax.get("?action=get_post&post=" + postid, function(response){ $('#editbox' + postid).raw().value = html_entity_decode(response); resize('editbox' + postid); }); } function Cancel_Edit(postid) { $('#reply_box').toggle(); $('#bar' + postid).raw().innerHTML = $('#bar' + postid).raw().oldbar; $('#content' + postid).raw().innerHTML = $('#bar' + postid).raw().cancel; } function Preview_Edit(postid) { $('#bar' + postid).raw().innerHTML = ""; ajax.post("ajax.php?action=preview","form" + postid, function(response){ $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } function Cancel_Preview(postid) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = ""; $('#editbox' + postid).show(); } function Save_Edit(postid) { $('#reply_box').toggle(); if (location.href.match(/forums\.php/)) { ajax.post("forums.php?action=takeedit","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } else if (location.href.match(/collages?\.php/)) { ajax.post("collages.php?action=takeedit_comment","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } else if (location.href.match(/requests\.php/)) { ajax.post("requests.php?action=takeedit_comment","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } else if (location.href.match(/artist\.php/)) { ajax.post("artist.php?action=takeedit_post","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } else { ajax.post("torrents.php?action=takeedit_post","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; $('#editbox' + postid).hide(); }); } } function Delete(post) { postid = post; if (confirm('Are you sure you wish to delete this post?') == true) { if (location.href.match(/forums\.php/)) { ajax.get("forums.php?action=delete&auth=" + authkey + "&postid=" + postid, function () { $('#post' + postid).hide(); }); } else if (location.href.match(/collages?\.php/)) { ajax.get("collages.php?action=delete_comment&auth=" + authkey + "&postid=" + postid, function () { $('#post' + postid).hide(); }); } else if (location.href.match(/requests\.php/)) { ajax.get("requests.php?action=delete_comment&auth=" + authkey + "&postid=" + postid, function () { $('#post' + postid).hide(); }); } else if (location.href.match(/artist\.php/)) { ajax.get("artist.php?action=delete_comment&auth="+authkey+ "&postid=" + postid, function (){ $('#post' + postid).hide(); }); } else { ajax.get("torrents.php?action=delete_post&auth=" + authkey + "&postid=" + postid, function () { $('#post' + postid).hide(); }); } } } function Quick_Preview() { var quickreplybuttons; $('#post_preview').raw().value = "Make changes"; $('#post_preview').raw().preview = true; ajax.post("ajax.php?action=preview","quickpostform", function(response){ $('#quickreplypreview').show(); $('#contentpreview').raw().innerHTML = response; $('#quickreplytext').hide(); }); } function Quick_Edit() { var quickreplybuttons; $('#post_preview').raw().value = "Preview"; $('#post_preview').raw().preview = false; $('#quickreplypreview').hide(); $('#quickreplytext').show(); } function Newthread_Preview(mode) { $('#newthreadpreviewbutton').toggle(); $('#newthreadeditbutton').toggle(); if(mode) { // Preview ajax.post("ajax.php?action=preview","newthreadform", function(response){ $('#contentpreview').raw().innerHTML = response; }); $('#newthreadtitle').raw().innerHTML = $('#title').raw().value; var pollanswers = $('#answer_block').raw(); if(pollanswers && pollanswers.children.length > 4) { pollanswers = pollanswers.children; $('#pollquestion').raw().innerHTML = $('#pollquestionfield').raw().value; for(var i=0; i