Shorten your forum link
Posted October 17th 2011, 7:30pm
Example: Your forum link be changed from www.example.com/123 to .../123

It has only one step :lol: Change the .post-entry a if you use other board rather than punBB (If someone can help me to that, it will be great :) )
ACP >> Modues >> Javascript Management >> Create New Javascript >> Set "In all the pages" then put the script in >> Save
var CopyrightNotice='Shorten your forum link. Copyright ©  by PlanetZ. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from Zero (robot_body2018@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';

$(function(){
$(".post-entry a").each(function(){
if ($(this).text().indexOf("yourforumlink")== 0){
$(this).replaceWith('<a href="'+$(this).attr('href')+'">'+'...'+$(this).attr('href')+'</a>');
};
});
});


[align=right]Written by Zero[/align]
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Shorten your forum link
Posted October 17th 2011, 7:33pm
So if I post a forum link it's shorter right?
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 17th 2011, 7:37pm
Your code will work unmodified on IPB2/Invision boards.

For phpBB3 boards, use ".content.clearfix a".
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Shorten your forum link
Posted October 17th 2011, 7:39pm
Do I edit the part that says "yourforumlink"
because it doesn't seem to work and I'm using PunBB
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 17th 2011, 7:45pm
Yes, you change it to YOUR forum link.

I'm not quite sure i understand the purpose of this code?
Basically it shortens (as an example) www.myforumlink.com/123 to /123 ..?

But you can just simply put /123, and the link works and is even shorter?
Or is the purpose of it to change the link if anyone else posts it?
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Shorten your forum link
Posted October 17th 2011, 8:54pm
@Raze: Yes right :P
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Shorten your forum link
Posted October 18th 2011, 2:02pm
Oh it only edits one link dang.
I was hoping that it would edit all the links like
.../t8393
.../t8392
Ect where it edits all the forum links that would be cool if it did that.
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 18th 2011, 2:16pm
@Raze:All of your forum links in the topic will be shorten, it doesn't work in the homepage or anywhere else :cry:
φ
Posts: 209
Joined: September 10th 2011, 11:00pm
Location: SC, USA
Likes Given: 8
Likes Received: 8
Shorten your forum link
Posted October 18th 2011, 3:19pm
I'm using PunBB and tried the code and it didn't change my forum links D:
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 18th 2011, 3:21pm
Nevermind I got it to work :D
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 18th 2011, 3:45pm
You don't want it working in the homepage or on topics. Because then USERNAMES would get shortened too .../u1 instead of their name.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Shorten your forum link
Posted October 21st 2011, 9:57pm
I don't get it...how does it change the forum URL exactly? Does it remove the ".forumotion" that is in your forum's URL or something?
φ
Posts: 280
Joined: October 2nd 2011, 11:00pm
Likes Given: 27
Likes Received: 4
Shorten your forum link
Posted October 21st 2011, 10:12pm
@David B: for example on here if you posted this
http://www.diondesigns.org/t8393-shorten-your-forum-link
it would come out as
.../t8393-shorten-your-forum-link
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Shorten your forum link
Posted October 22nd 2011, 9:17am
OH! Okay...I get it now.
φ
Posts: 280
Joined: October 2nd 2011, 11:00pm
Likes Given: 27
Likes Received: 4
Post a reply
14 posts

Who is online

Users browsing this forum: No registered users and 0 guests