1 of 2
1
NEW - Neat Links Plugin…
Posted: 31 January 2008 02:06 PM   [ Ignore ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

[EDIT]- I meant to mention that along with this plugin you will also need to turn off the :

Admin->Weblog Administration->Weblog Management->Edit Preferences->Weblog Posting Preferences-Automatically turn URLs and email addresses into links?

in order for this plugin to work correctly.

Hiya,

Another one for anyone who’s interested!

This plugin was created due to a need that Jan had over in this thread.

If you ever have users / clients entering links into fields but have no control over whether or not they are adding in the http:// bit or not then if you try to make a link with one that doesn’t have the http:// bit then you will end up with a totally messed up link as ExpressionEngine will rightly put your site link in front of it. Not very nice at all! grin

So that’s why I made this plugin.

Neat Link - Usage

{exp:neat_link link_title="Title for link" link_text="Yahoo.com" link="www.yahoo.com"}

You can also use custom fields instead of hard-coding the values which is really what the plugin is all about! grin

{exp:neat_link link_title="{link_title}" link_text="{link_text}" link="{link}"}

Note that the custom fields {link_title}, {link_text} and {link} all need to have their formatting set to none or this plugin will not work

Other custom parameters that you can pass to the plugin are as follows :

class=“flashy-css-style” rel=“external” id=“my-css-id”

You can specify one or all of these. None of the parameters above are required though. Obviously you probably wouldn’t use the id and class at the same time though! grin

Anyway hope it helps some people out.

Best wishes,

Mark

File Attachments
pi.neat_link.php_v1.0.2.zip  (File Size: 2KB - Downloads: 140)
 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 31 January 2008 02:20 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

Mark Bowen is making plugins smile !!!! JEEJ

Don’t forget the id=”“  clas=”“ attributes smile and rel=”“

Keep it up my friend !

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 31 January 2008 02:32 PM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

Oops I knew I would miss something. Will add them in now and re-upload after I have made my tea!! grin

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 31 January 2008 02:43 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  316
Joined  04-11-2006

It works exactly as it says on the tin grin

Three cheers for Mark!

 Signature 

OakenPage website works - doing simple things well

Profile
 
 
Posted: 31 January 2008 02:45 PM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

Plugin updated and new version attached to top thread. I have also updated the instructions as well.

Should hopefully all work.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 31 January 2008 03:23 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  987
Joined  01-24-2006

Nice one mark.

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More ExpressionEngine Extensions

Profile
 
 
Posted: 31 January 2008 03:39 PM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006
Leevi Graham - 31 January 2008 03:23 PM
Nice one mark.

Why thank you kind sir! grin

Nothing quite as fantastic as the work that you are doing at the moment but I am learning at least. I need to neat-en up the code-base in this plugin as I’m sure there are neater ways of writing some of what I have done in there.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 01 February 2008 06:15 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1486
Joined  08-02-2006

Nice! I might have use for this now actually. smile

 Signature 

Deron Sizemore
Random Jabber - My Blog
Sizcons - My Icon Set
Nice Stylesheet - Fresh CSS Inspiration
Kentucky Golfing - Kentucky’s Online Golf Resource

Profile
 
 
Posted: 01 February 2008 06:16 PM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

Hi Deron,

Thanks for the comment. Hope it does well for you. Any problems just give a shout. I’m pretty sure it should work fine but I have only tested it myself so the more people that do test it will definitely help wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 01 February 2008 06:26 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  987
Joined  01-24-2006
Mark Bowen - 31 January 2008 03:39 PM
I’m sure there are neater ways of writing some of what I have done in there.

You could use some shorthand like:

$id = $TMPL->fetch_param('id') ? "id='" . $TMPL->fetch_param('id') . "'" : '';
$class = $TMPL->fetch_param('class') ? "class='" . $TMPL->fetch_param('class') . "'" : '';
$rel = $TMPL->fetch_param('id') ? "rel='" . $TMPL->fetch_param('rel') . "'" : '';

to set the default values smile

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More ExpressionEngine Extensions

Profile
 
 
Posted: 01 February 2008 06:29 PM   [ Ignore ]   [ # 10 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

There’s always one isn’t there wink grin wink

Thanks Leevi. I had seen this type of coding before in plugins but never really understand it so was going to look it up. I know what it is doing but I just think that the ? and other such stuff confuses me.

Don’t suppose you would be kind enough just to talk me through what it means syllable by syllable as it were?

Thanks.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 03 February 2008 07:16 AM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

Just to notify of a small plugin update. No functionality additions but a mention to my learned friend Leevi!! wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 18 February 2008 11:46 PM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  35
Joined  03-21-2006

Mark! Awesome work w/ Neat Link. I modified it a bit to make it a tad more flexible. The first time I went to test it it didn’t work, because someone (okay okay, it was me) had entered in a website like this: expressionengine.com

So I changed the plugin like this and it worked great.

if (substr($url, 0, 4) != "http"){
        $url
= "http://" . $url;
        
}

That seems to catch more instances of a link, be it expressionengine.com, www. expressionengine.com or http://expressionengine.com. What do you think?

 Signature 

Brian Warren // Be Good Not Bad // BeGoodNotBad.com

Profile
 
 
Posted: 27 February 2008 06:22 AM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

HI there Brian,

Absolutely makes sense! wink

Thanks for picking up on that deliberate error that I made wink wink

Sorry I didn’t even think about URLs without the www when I made this so your modification is definitely a much needed one. I have now updated the plugin to have your code instead and have re-uploaded it to the first post. If you open up the plugin you will see some thanks to yourself in the update list wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 27 February 2008 11:25 AM   [ Ignore ]   [ # 14 ]  
Grad Student
Avatar
Rank
Total Posts:  35
Joined  03-21-2006

Brilliant!

The reason I happened to notice is the exact first time I tested the plugin it was on a url that happened to not have the www in there.

I have another change for you that I made, probably another deliberate error…

I changed this:

$rel = $TMPL->fetch_param('id') ? "rel='" . $TMPL->fetch_param('rel') . "'" : '';

to this:

$rel = $TMPL->fetch_param('rel') ? "rel='" . $TMPL->fetch_param('rel') . "'" : '';

I had some specific “rel” needs for my links, and so I wanted that as its own parameter.

Also I noticed the pi_version is still at 1.0.1.

All really MINOR stuff. I’m just the nitpicky guy who tweaks all your awesome ninja work. Thanks for the plugin!

 Signature 

Brian Warren // Be Good Not Bad // BeGoodNotBad.com

Profile
 
 
Posted: 27 February 2008 11:31 AM   [ Ignore ]   [ # 15 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006

Oops.

Sorry about that. Must have made a typo on that one. Have now updated the plugin with the correct item in there. Was meant to work but I must have rushed and not tested thoroughly enough so sorry about that.

No worries on picking. I like the fact that people are using these things and letting me know how to improve them. A nice community spirit is always a good thing grin

Thanks again.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 06 March 2008 05:05 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  987
Joined  01-24-2006

I think that one was my fault…

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More ExpressionEngine Extensions

Profile
 
 
Posted: 06 March 2008 05:15 PM   [ Ignore ]   [ # 17 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5579
Joined  04-15-2006
Leevi Graham - 06 March 2008 05:05 PM
I think that one was my fault…

Well yes but I couldn’t very well admit to just copying and pasting now could I? wink wink


Best wishes,

Mark

P.S. Whilst you’re on I think you have some wrong words in your LG Restrict Access Plugin documentation. In a few places it says respond_to but I think you might mean restrict_to?

 Signature 

Full List Of Plugins Here!!
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 06 March 2008 05:18 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  987
Joined  01-24-2006

I was going to pull you up on it…. but you code you learn smile

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More ExpressionEngine Extensions

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62440 Total Logged-in Users: 21
Total Topics: 76709 Total Anonymous Users: 13
Total Replies: 414412 Total Guests: 556
Total Posts: 491121    
Members ( View Memberlist )