JavaScript code to disable certain page.
+2
Ultron's Vision
Theomest
6 posters
Page 1 of 2
Page 1 of 2 • 1, 2
JavaScript code to disable certain page.
BTW, I want to ask, Is it possible to remove Information after posting? I want it redirect to current post.
- Spoiler:
If possible, how?
If it's not possible. Thanks for reading. And I'll mark this as solved.
Ultron's Vision and Sir Chivasâ„¢ for solving the first request.
Ok, here goes:
The information after posting has been disabled, now a new problem just came out.
When I edited my test username, a page has show up. So I need to disable it.
It'll be harder than before, because It has 2 options.
I want it automatically direct to the upper link.
Solved!
Last edited by Theomest on June 3rd 2013, 9:10 am; edited 5 times in total
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
No, you cannot skip that part as forumotion itself redirects you to that link; as you do not have access to the code forumotion used to create the forum, you cannot edit it, either.
Re: JavaScript code to disable certain page.
Wow, I didn't realize someone will reply very quickly!
BTW, Thanks! It really helped me!
BTW, Thanks! It really helped me!
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Yes you can! I don't know the code, don't remember the websites, but this IS possible.
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
Re: JavaScript code to disable certain page.
Oh?! It's possible?
Thanks for letting me know. I'll search for it, if I feel I wanted to.
This is not a big problem, shouldn't put an effort to it
Thanks for letting me know. I'll search for it, if I feel I wanted to.
This is not a big problem, shouldn't put an effort to it
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
I think it's a javascript code. I use to have it, but I've not been coding lately.
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
Re: JavaScript code to disable certain page.
It's OK, I don't really mind.
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Well, there could be options on how to redirect via client-side JavaScript, but by forumotion default, the server has this redirect enabled.
Re: JavaScript code to disable certain page.
Well, is there a way to disable it?
As Nick mentioned, maybe it can be disabled using JavaScript code?
As Nick mentioned, maybe it can be disabled using JavaScript code?
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
I think what Nick might be talking about is the page won't be displayed. Simply meaning that the redirect page won't display but there will be a normal redirect.
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: JavaScript code to disable certain page.
I know that, what I mentioned before is the JavaScript.
Normal redirect is better than that page.
Normal redirect is better than that page.
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Eh, try adding this JavaScript code to your JavaScript pages (Administration Panel -> Modules -> HTML & JavaScript -> JavaScript pages management and select "in all the pages").
- Code:
var url = /\/post(?!.)/;
if(url.test(window.location.pathname)) window.location = document.referrer;
Re: JavaScript code to disable certain page.
OK, I'll try it.
I'll let you know later.
Edit:
Wooo! Thank you, thank you, oh thank you very much.
It worked!
But, when you want to delete post or anything that brings out that page. The page won't come out
I'll let you know later.
Edit:
Wooo! Thank you, thank you, oh thank you very much.
It worked!
But, when you want to delete post or anything that brings out that page. The page won't come out
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
I thought that this would happen...
The RegExp looks for all /post URLs, even if it is /post?mode=editpost etc.
I'll have a look at the RegExp syntax again and then I'll give you an update.
The RegExp looks for all /post URLs, even if it is /post?mode=editpost etc.
I'll have a look at the RegExp syntax again and then I'll give you an update.
Re: JavaScript code to disable certain page.
Yeah, I think I understand a little.
Thanks for helping, and sorry for the trouble..
Thanks for helping, and sorry for the trouble..
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Well, try this.
Edit: Fixed a syntax error.
- Code:
var url = /\/post/;
var win = window.location.pathname;
if(url.test(win) && win.indexOf("?") == -1) window.location = document.referrer;
Edit: Fixed a syntax error.
Re: JavaScript code to disable certain page.
Ok.. I'll try,
BTW, you mistype your code tag
Edit:
Nope, it's the same with the first one.
BTW, you mistype your code tag
Edit:
Nope, it's the same with the first one.
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Did you try with the updated code?
Otherwise I'll do it with RegExps again.
Otherwise I'll do it with RegExps again.
Re: JavaScript code to disable certain page.
You mean this one, right?Ultron's Vision wrote:Well, try this.
- Code:
var url = /\/post/;
var win = window.location.pathname;
if(url.test(win) && win.indexOf("?") == -1) window.location = document.referrer;
Edit: Fixed a syntax error.
I've tried it.
Still the same like the first one. Deletion page won't shows up.
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Okay, I looked through the RegExp syntax, this should work.
- Code:
var url = /\/post(?!\?[.{0,}])/;
if(url.test(window.location.pathname)) window.location = document.referrer;
Re: JavaScript code to disable certain page.
Ok, I'll try it again!
Hope it's working.
Edit:
No, It's not working.
Sorry for the trouble. I'll stick with the forumotion redirect page.
And thanks
Hope it's working.
Edit:
No, It's not working.
Sorry for the trouble. I'll stick with the forumotion redirect page.
And thanks
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
This is driving me crazy ._.
I guess I could be unmistakenly explicit with the RegExp, but, sheesh - sudden realization... pathname doesn't include query strings as far as I know.
*sigh* I got it.
I guess I could be unmistakenly explicit with the RegExp, but, sheesh - sudden realization... pathname doesn't include query strings as far as I know.
*sigh* I got it.
- Code:
var url = /\/post/;
var query = /\?[.{0,}]/;
if(url.test(window.location.pathname) && !query.test(window.location.search)) window.location = document.referrer;
Re: JavaScript code to disable certain page.
Phew, here goes..
Let's try..
Edit:
Nope.. it's not coming out
Here's the deletion link.
Let's try..
Edit:
Nope.. it's not coming out
Here's the deletion link.
- Code:
http://example.forumotion.com/post?p=12&mode=delete
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
No it isn't, a new problem has come out.Sir Chivas™ wrote:Is this solved?
Want to mark it as "In Progress", but there's no In progress mark.
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Remove the code that they provided and try this one:
Its JavaScript, make sure its marked in all pages.
- Code:
$("meta[http-equiv='refresh'][content]:first").each(function(){window.location.href=$(this).attr("content").replace(/^.*;url=/,"")});
Its JavaScript, make sure its marked in all pages.
Re: JavaScript code to disable certain page.
I'll try it.
I'll let you know if it's working.
And thanks for mark this as "In Progress"
I'll let you know if it's working.
And thanks for mark this as "In Progress"
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Oh! It worked!
Thanks for the JavaScript code, Sir.
Thanks to you too, Ultron's Vision.
Sorry for the trouble, really..
I appreciate it!
Thanks for the JavaScript code, Sir.
Thanks to you too, Ultron's Vision.
Sorry for the trouble, really..
I appreciate it!
Theomest- New Member
- Posts : 20
Reputation : 1
Language : English
Re: JavaScript code to disable certain page.
Topic Solved & Locked |
Thread reopened.
Page 1 of 2 • 1, 2
Similar topics
» Javascript or CSS Forum Design Code Request for PunBB: Allowing 100 Comments Per Page in the Blogs Only!
» Javascript Code
» Javascript- More then 1 javascript code
» Javascript code
» Javascript code
» Javascript Code
» Javascript- More then 1 javascript code
» Javascript code
» Javascript code
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum