Recent Tutorials
Who is online?
In total there are 7 users online :: 1 Registered, 0 Hidden and 6 Guests :: 1 Bot

smurfavr

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Change the Path ::

View previous topic View next topic Go down

Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 1927
Points : 2308
Reputation : 55
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Sun 25 Sep 2016, 14:55

With this tutorial you can change the path separator on your forum.





Installation


Administration Panel >> Modules >> HTML and Javascript >> Javascript codes management >> Create new javascript

Title: Path Changer
Placement: In all the pages

Code:
Code:
$(function() {
  var path = '::',
 
  paths = {
    'forum' : $('p.nomargin.path'),
    'topic' : $('div.pathname-box p'),
    'mcp' : $('form div.topic-actions p'),
    'search' : $('div.topic-actions p')
  },
 
  i;

  for ( i in paths ) {
    if ( paths[i].html() ) paths[i].html(paths[i].html().replace(/::/g, path));
  }
});

Old Code:
Code:
$(function() {
  var urls = [/\/f\d+/, /\/t\d+/, /\/modcp/, /\/search/],
 
  paths = {
    'forum' : $('p.nomargin.path'),
    'topic' : $('div.pathname-box p'),
    'mcp' : $('form div.topic-actions p'),
    'search' : $('div.topic-actions p')
  },
 
  path = '::',
 
  i, j, k;
 
  for ( i = 0; i < urls.length; i++ ) {
    for ( j in paths ) {
      j == 'forum' ? k = 0 : ( j == 'topic' ? k = 1 : ( j == 'mcp' ? k = 2 : k = 3 ) );
 
      if ( i == k && urls[i].test(window.location.href) ) paths[j].html(paths[j].html().replace(/::/g, path));
    }
  }
});


Modification


Basically this is what you need to change if you want to change the path separator.

Code:
  path = '::'

Hope you guys like it..



This only works on phpbb3 forums. If you want it on another version or any bugs come up with the code, then just post the issue with your forum link below.


Last edited by Ace 1 on Mon 31 Oct 2016, 11:22; edited 2 times in total
Ace 1
Valued Member
Title :
God of Creation
Gender : Male
Age : 17
Posts : 1927
Points : 2308
Reputation : 55
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Mon 31 Oct 2016, 11:21

Updated the code. Newer version is shorter.

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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