Post by Thesealion on Jun 25, 2010 8:16:44 GMT -8
So i wrote a code for fun a month ago. it was my first code ever so i was just playing with it and this is what i got
<script type="text/javascript">
// Delete Forum Trick by Nightwalker
// Do not repost or claim for your own
// This header MUST stay intact
function show_confirm()
{
var r=confirm("Are you sure you want to do this?"); // question about deleting the forum
if (r==true)
{
window.location = "http://www.proboards.com"; //url you go to if you delete the forum
alert("The forum has been deleted"); //pops up if you delete the board
}
else
{
alert("Forum has been deleted");
window.location = "http://www.proboards.com";
}
}
</script>
you can see that it uses the window.location twice and i was told by someone on here that that would be the best way to send people to another page. I was writing another code yesterday and decided to use the same thing so i did this.
<script type="text/javascript">
// Alert Before Reporting by Nightwalker
// header must stay intact
if (location.href.match(/action=reportpost/)) {
var r=confirm("This feature is used for reporting posts that do not follow the rules of the forum or the proboards TOS. If you use this feature for any other purpose you will be warned or banned. To proceed click ok, otherwise click cancel.");
}
if (r!=true)
{
window.location = "http://www.joemaggio.proboards.com";
}
</script>
as soon as i posted this in my headers the board got deleted and i had to have staff put it back up. They said it had to do with the window.location not letting the adds load but i was wondering what the difference between the two codes was? if the first one was ok why did the second one fail? Well when i looked at the code i think i put one of the }s in the wrong spot so i moved it. <script type="text/javascript">
// Alert Before Reporting by Nightwalker
// header must stay intact
if (location.href.match(/action=reportpost/)) {
var r=confirm("This feature is used for reporting posts that do not follow the rules of the forum or the proboards TOS. If you use this feature for any other purpose you will be warned or banned. To proceed click ok, otherwise click cancel.");
if (r!=true)
{
window.location = "http://www.joemaggio.proboards.com";
}
}
</script>
when i tested this on the w3school's try it yourself page it worked but i don't want to put it on my board for fear it gets deleted again. Is there a way i can use the window.location without not letting the adds load or does it just not work? And what did i do rite in the delete forum code that i did wrong in the other one?
<script type="text/javascript">
// Delete Forum Trick by Nightwalker
// Do not repost or claim for your own
// This header MUST stay intact
function show_confirm()
{
var r=confirm("Are you sure you want to do this?"); // question about deleting the forum
if (r==true)
{
window.location = "http://www.proboards.com"; //url you go to if you delete the forum
alert("The forum has been deleted"); //pops up if you delete the board
}
else
{
alert("Forum has been deleted");
window.location = "http://www.proboards.com";
}
}
</script>
you can see that it uses the window.location twice and i was told by someone on here that that would be the best way to send people to another page. I was writing another code yesterday and decided to use the same thing so i did this.
<script type="text/javascript">
// Alert Before Reporting by Nightwalker
// header must stay intact
if (location.href.match(/action=reportpost/)) {
var r=confirm("This feature is used for reporting posts that do not follow the rules of the forum or the proboards TOS. If you use this feature for any other purpose you will be warned or banned. To proceed click ok, otherwise click cancel.");
}
if (r!=true)
{
window.location = "http://www.joemaggio.proboards.com";
}
</script>
as soon as i posted this in my headers the board got deleted and i had to have staff put it back up. They said it had to do with the window.location not letting the adds load but i was wondering what the difference between the two codes was? if the first one was ok why did the second one fail? Well when i looked at the code i think i put one of the }s in the wrong spot so i moved it. <script type="text/javascript">
// Alert Before Reporting by Nightwalker
// header must stay intact
if (location.href.match(/action=reportpost/)) {
var r=confirm("This feature is used for reporting posts that do not follow the rules of the forum or the proboards TOS. If you use this feature for any other purpose you will be warned or banned. To proceed click ok, otherwise click cancel.");
if (r!=true)
{
window.location = "http://www.joemaggio.proboards.com";
}
}
</script>
when i tested this on the w3school's try it yourself page it worked but i don't want to put it on my board for fear it gets deleted again. Is there a way i can use the window.location without not letting the adds load or does it just not work? And what did i do rite in the delete forum code that i did wrong in the other one?