attach link automatic to some words in the posts
3 posters
Page 1 of 1
attach link automatic to some words in the posts
Last edited by PE!N on November 21st 2011, 7:54 pm; edited 1 time in total
Re: attach link automatic to some words in the posts
Hi,
Here is a JavaScript...
Add it to your forum via javascript code management for all pages.
Edit this line as per your requirement...
Hope it helps
Here is a JavaScript...
- Code:
$(function(){
$('.post .postbody').each(function(){
var str = $(this).html();
var newStr = str.replace(/TEXT_TO_REPLACE/gi, "REPLACE WITH THIS");
$(this).html(newStr);
});
});
Add it to your forum via javascript code management for all pages.
Edit this line as per your requirement...
- Code:
var newStr = str.replace(/TEXT_TO_REPLACE/gi, "REPLACE WITH THIS");
Hope it helps
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Re: attach link automatic to some words in the posts
Where did you add the script?
Also post the full code that you added.
Also post the full code that you added.
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Re: attach link automatic to some words in the posts
- Code:
$(function(){
$('.post .postbody').each(function(){
var str = $(this).html();
var newStr = str.replace(/TEXT_TO_REPLACE/gi, "REPLACE WITH THIS");
$(this).html(newStr);
});
});
that is the code and it is added in javascript code management for all pages
Re: attach link automatic to some words in the posts
In above post, I had asked you to edit this line in the code...
For example...
- Code:
var newStr = str.replace(/TEXT_TO_REPLACE/gi, "REPLACE_WITH_THIS");
For example...
- Code:
var newStr = str.replace(/forum/gi, "<a href='http://forumotion.com/'>Forumotion</a>");
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Re: attach link automatic to some words in the posts
thanx sir .. it worked now when i deleted other java codes.
Re: attach link automatic to some words in the posts
Since this thread appears to be solved, I will archive this thread.
Sanket
Sanket
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Similar topics
» Automatic Attach Signature
» Removing share link in posts
» [Forum Hacked] Automatic Link Redirection
» i want add code adsense In the Middle nside Posts how ? manualy or automatic
» "My posts" link
» Removing share link in posts
» [Forum Hacked] Automatic Link Redirection
» i want add code adsense In the Middle nside Posts how ? manualy or automatic
» "My posts" link
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum