The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How can I create ban hammer javascript?

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Solved How can I create ban hammer javascript?

Post by Van-Helsing on July 28th 2015, 12:34 pm

Hello,
How can I create a ban hammer javascript? The ban hammer javascript redirects all banned users(usergroup Banned), IPs and e-mails to a custom page.


Last edited by Black-Shadow on August 30th 2015, 5:55 pm; edited 1 time in total

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on July 29th 2015, 1:05 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on July 30th 2015, 2:03 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on July 31st 2015, 2:05 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 1st 2015, 2:31 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 2nd 2015, 4:30 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 4th 2015, 1:01 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 5th 2015, 1:12 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 6th 2015, 2:42 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 7th 2015, 9:49 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 9th 2015, 1:25 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 10th 2015, 2:44 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 11th 2015, 9:37 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 12th 2015, 11:42 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 13th 2015, 12:41 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 14th 2015, 3:46 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 15th 2015, 5:13 pm

bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 16th 2015, 8:09 pm

Bump.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 18th 2015, 10:41 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 20th 2015, 5:32 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 21st 2015, 5:51 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 26th 2015, 10:26 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Hagoromo Otsutsuki on August 28th 2015, 1:44 am

Wow you been bumping this each day......also you should tag a Coding staff.

Hagoromo Otsutsuki
Forumember

Male Posts : 514
Reputation : 21
Language : English
Location : Heaven

http://naruto-omniverse.forumotion.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Ange Tuteur on August 28th 2015, 1:44 pm

I apologize for not getting to this sooner. I have a question you have a usergroup that's for pseudo-banned user's correct ?

If that's the case you should be able to send a request to the group page, although this can be a bit delayed. Create a new script in all the pages with the following content :
Code:
$(function() {
  var group_url = '/g1-administrators',
      redir_url = '/h1-my-html-page',
      cookie = true;

  if (cookie && my_getcookie('faRedirected') == 'true') return;

  if (!_userdata.user_level && _userdata.session_logged_in) {
    $.get('/groups', function(d) {
      if ($('a[href="' + group_url + '"]', d)[0]) {
        if (cookie) my_setcookie('faRedirected', 'true');
        window.location.pathname = redir_url;
      }
    });
  }
});

group_url : The path to your group
redir_url : The path you'll be redirected to
cookie : Set to true if you only want the user to be redirected once. ( recommended ) Otherwise, set it to false.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 28th 2015, 5:54 pm

Hello @Ange Tuteur,
Its seems working, but when I am trying to redirect to external page and it is added to forum link.

Etc. http://www.forumurl.com/www.google.gr and it is displaying a white page with message "Return to index"

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Ange Tuteur on August 28th 2015, 6:09 pm

If you want a whole link you need to replace pathname in window.location.pathname by href.

pathname is only for changing the local directory.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 30th 2015, 4:50 pm

Hello @Ange Tuteur,
Must I change the window.location.pathname = redir_url; with href = redir_url; ?

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Ange Tuteur on August 30th 2015, 5:01 pm

Black-Shadow wrote:Hello @Ange Tuteur,
Must I change the window.location.pathname = redir_url; with href = redir_url; ?
Just replace pathname by href.

So it looks like this :
Code:
window.location.href = redir_url;

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Van-Helsing on August 30th 2015, 5:05 pm

@Ange Tuteur I have changed the code but its not redirecting

Code:

$(function() {
  var group_url = '/g8-group',
      redir_url = 'http://google.gr',
      cookie = true;

  if (cookie && my_getcookie('faRedirected') == 'true') return;

  if (!_userdata.user_level && _userdata.session_logged_in) {
    $.get('/groups', function(d) {
      if ($('a[href="' + group_url + '"]', d)[0]) {
        if (cookie) my_setcookie('faRedirected', 'true');
        window.location.href = redir_url;
      }
    });
  }
});

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I create ban hammer javascript?

Post by Ange Tuteur on August 30th 2015, 5:15 pm

Turn cookie to false. I'm assuming a cookie has already be set in your browser.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum