Results 1 to 1 of 1
-
9th Apr 2011, 05:34 AM #1OP(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comSnippets & Random Crap (Linkify text links included)
Linkify text links on page load using JQuery:
Code:$(function() { var sexyregex = /^http:\/\/(hotfile\.com|rapidshare\.com|megaupload\.com)\/[\S]+$/; $('body *').contents().filter(function() { return this.nodeType == 3 && $(this).text().trim() !== '' && $(this).text().trim().match(sexyregex); }).each(function() { $(this).replaceWith('<a href="' + $(this).text().trim() + '" target="_blank" rel="bitches_dont_know_bout_my_regex">' + $(this).text().trim() + '</a>'); }); });
One Liner'ing Stuff
Code:if($x == 'abc') { somefunc(); return false; }
Code:if($x == 'abc') return !(somefunc() || true);
I see people str_replace'ing special characters and such to turn 'abc def (2005)' into 'abc-def-2005', but there's an easier way:
Code:function jmzseo($s, $b='-') { return preg_replace('#[\W]+#', $b, $s); } // use as such: jmzseo('abc def (2003)') to return 'abc-def-2003' // also can change seperator // jmzseo('abc def (2003)', '+') = 'abc+def+2003'
JmZ Reviewed by JmZ on . Snippets & Random Crap (Linkify text links included) Linkify text links on page load using JQuery: $(function() { var sexyregex = /^http:\/\/(hotfile\.com|rapidshare\.com|megaupload\.com)\/+$/; $('body *').contents().filter(function() { return this.nodeType == 3 && $(this).text().trim() !== '' && $(this).text().trim().match(sexyregex); }).each(function() { $(this).replaceWith('<a href="' + Rating: 5Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Random Text & Images In Signatures
By zac2613 in forum phpBBReplies: 0Last Post: 10th Jan 2012, 06:36 AM -
[Selling] Text links (10$)
By fahadzaman66 in forum Completed TransactionsReplies: 0Last Post: 9th Apr 2011, 11:48 AM -
[Selling] Text Links / Banner Links / Signature Spaces
By Th3Kill33r in forum Completed TransactionsReplies: 0Last Post: 12th Nov 2010, 04:51 AM -
Another one of my infamous code snippets
By SplitIce in forum Tutorials and GuidesReplies: 4Last Post: 1st Nov 2009, 10:24 PM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...