The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Redirected to inlinemod.php
Moderators are being redirected to inlinemod.php when clicking on new bbcodes I have created.
It works perfectly for users who are not able to edit the thread or are not logged in, but moderators are instead redirected where a message is returned "Invalid Action Specified" Here is the BBCODE: <div style="margin: 5px;"> <div class="vod" style="margin-bottom: 2px;"> <input type="image" src="[redacted]" onmouseover="this.src = '[redacted]';" onmouseout="this.src = '[redacted]';" onclick="if(this.parentNode.parentNode.getElements ByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button"> </div> <div class="alt2" style="padding: 0px;"> <div class="spoiler" style="display: none;">{param}</div> </div></div> The function is the same as a normal spoiler tag, which works fine: <div style="margin: 5px;"> <div class="smallfont" style="margin-bottom: 2px;"> <b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElements ByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button"> </div> <div class="alt2" style="border: 1px inset; padding: 6px;"> <div class="spoiler" style="display: none;">{param}</div> </div> </div> All I have done is tried to improve the aesthetics by using an image and a hover image. Any ideas why moderators are being redirected? How can I fix it? |
#2
|
|||
|
|||
The problem is that for moderators, all the posts are inside a form (so that the checkboxes work), and you've added an <input type="image"> which has a default action of submitting the form (the original code just has <input>). You can get around that by adding "return false;" to the very end of your onClick code.
|
#3
|
|||
|
|||
Sorry, but where exactly does the "return false;" go?
|
#4
|
|||
|
|||
The line that ends in
Code:
this.value='Show'; }" change to Code:
this.value='Show'; } return false; " |
#5
|
|||
|
|||
Ok, I made that change, but it did not seem to fix the problem.
Here is what I've got now: Code:
<div style="margin: 5px;"> <div class="vod" style="margin-bottom: 2px;"> <input type="image" src="[redacted]" onmouseover="this.src = '[redacted]';" onmouseout="this.src = '[redacted]';" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline' ) { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; } return false;" type="button" > </div> <div class="alt2" style="padding: 0px;"> <div class="spoiler" style="display: none;">{param}</div> </div></div> |
#6
|
|||
|
|||
Hmm...I tried what you posted and it works for me, and if I remove the "return false" it goes to "Invalid Action". Maybe it's a browser thing? What are you using?
|
#7
|
|||
|
|||
Ah, you might be right.
It is not working on Chrome, but your fix does work on Firefox. My old version did not work on either, though. Any ideas for how to get it working on Chrome? |
#8
|
|||
|
|||
Yes, it seems returning "false" doesn't stop the form from being submitted in some browsers. Here's a link to where someone asked about this: http://stackoverflow.com/questions/2...mically-to-the
But, I think maybe the solution is to just make the tag <img instead of <input type="image" |
#9
|
|||
|
|||
Aha! It works with <img
Thanks for your help! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|