Recent Topics

1 Jul 25, 2008 21:53    

My b2evolution Version: 2.4.2

I want clickable links.

I got clickable links--hooray!

But I don't want visitors to navigate away and not come back.

How can I make my clickable links open a new window?

2 Jul 26, 2008 01:47

In other words, if I am inserting a link manually in html, I can include "target=_blank"--to judge by "view source," that's what makes the recently updated blogs on the right side of b2e's home page open in a new window.

BUT when the helpful software makes "www.something.com" into a link FOR me, as it does in the text of a posting, I don't have direct access to the html to add this tag.

Does anyone know where to do that? Or to configure b2e so that's the default?

4 Jul 27, 2008 05:07

Hi Afwas,

Wow--thanks!

I'm a little confused. I uploaded everything but icon-external-link--I couldn't figure out where that should go.

I uploaded _martha_link.plugin.php to blogs/plugins, martha_link.css to blogs/rsc/css, and martha_icon.js and martha_link.js to blogs/rsc/js. Result: no change in how already existing links worked, no change in how a new link worked. (Sigh.)

But somehow the tags across the top of the post box in admin had not been showing up. (I kept looking around for a place to turn them on.) When I uploaded these files, the tags showed up all of a sudden!

You can't add "_blank" to the box that the LINK tag opens, but you can add it to the code it inserts--that's visible now, whereas for the last several days all I could see in the post box was the display text.

Seeing that nothing happened, I experimentally deleted the 4 files I uploaded, which also did not seem to change anything.

Manually inserting this is OK for me. I do imagine a project later on that would involve minimally computer-savvy content collaborators, so it would be really good to get the new target window thing automated SOMETIME.

I can't see how the lack of icon-external-link.png would disable the whole process--or could it? I just guessed at the location for the other files, tho they seem reasonable guesses: maybe I guessed wrong?

Anyway--thanks so much for your efforts on my behalf.

5 Jul 27, 2008 14:26

See my site (hit the [www] button under this post). There I have the plugin instaled and working.

You should copy the entire folder and the files into the /plugins/ folder, so the structure becomes:
/plugins/martha_link_plugin/_martha_link.plugin.php
/plugins/martha_link_pluign/martha_link.js
/plugins/martha_link_plugin/martha_link.css
/plugins/martha_link_plugin/martha_icon.js
/plugins/martha_link_plugin/icon-external-link.png

Install the plugin through Global settings->plugins->install new

The plugin works by magic. The only thing you see is this in the header if you view the source of the page:

	<script type="text/javascript" src="http://www.blog.hemminga.net/rsc/js/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="/plugins/martha_link_plugin/martha_link.css" />
	<script type="text/javascript" src="/plugins/martha_link_plugin/martha_link.js"></script>

Have a nice day

6 Jul 27, 2008 15:07

Ah-hah! I DID guess wrong. Now it works perfectly! All you have to do is type www.site.com --no need for (e.g. a content collaborator) to use the link button or even type http://, much less interface with code.

Thank you so much, Afwas!

8 Apr 03, 2009 23:02

Recently I upgraded to b2evo 3.0.0 and now martha_link_plugin doesn't work anymore ?

9 Apr 04, 2009 09:16

afaik, Afwas runs it smoothly on his (3.x) blog, however
in 3.1 beta it's not working as expected for me either.. does work for some links does not for some other..cant see any reason why it should behave any different than 2.4.6

10 Apr 04, 2009 16:37

How about hacking a core file? In v246 find in file inc/_core/_misc.funcs.php the following bit:

function make_clickable_callback( & $text, $moredelim = '&amp;' )
{
	$pattern_domain = '([a-z0-9\-]+\.[a-z0-9\-.\~]+)'; // a domain name (not very strict)
	$text = preg_replace(
		array( '#(^|[\s>])(https?|mailto)://([^<>{}\s]+[^.,<>{}\s])#i',
			'#(^|[\s>])aim:([^,<\s]+)#i',
			'#(^|[\s>])icq:(\d+)#i',
			'#(^|[\s>])www\.'.$pattern_domain.'((?:/[^<\s]*)?[^.,\s])#i',
			'#(^|[\s>])([a-z0-9\-_.]+?)@'.$pattern_domain.'([^.,<\s]+)#i', ),
		array( '$1<a href="$2://$3">$2://$3</a>',
			'$1<a href="aim:goim?screenname=$2$3'.$moredelim.'message='.rawurlencode(T_('Hello')).'">$2$3</a>',
			'$1<a href="http://wwp.icq.com/scripts/search.dll?to=$2">$2</a>',
			'$1<a href="http://www.$2$3$4">www.$2$3$4</a>',
			'$1<a href="mailto:$2@$3$4">$2@$3$4</a>', ),
		$text );


Now change a line near the end of that function to this:

'$1<a href="http://www.$2$3$4" target="_blank">www.$2$3$4</a>',

Untested, but does come with a double-your-money-back guarantee ;)

11 Nov 27, 2009 20:50

I guess this is really a question for Afwas but I wondered if anyone else has any thoughts? I've tried the hack suggested by Edb and neither that, nor the Martha_Link plugin works in 3.3.1


Form is loading...