Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Open web link in new browser window?
1 2
Davidmcc3
Posted on 13 Aug 2009, 11:22:21

Access: Member
Total Posts: 20
Joined: 2009-08-13

Hi

Got N13 working quite easily (unlike many other php scripts), and have customised a simple template.

I've put it in an iFrame as the php include wouldn't work for me (?)

Now I've put a web link into a story, but want it to open in a new browser window, NOT the iFrame.

Can this be done? What code do I have to put in the news item?

Many thanks

David
#726
Chris
Posted on 13 Aug 2009, 11:28:25

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

This is quite easy to do.

Edit the bbparser.php file, on line 156~ you'll see this

Code:
$bb2html = preg_replace("/\[url=(\W?)(.*?)(\W?)\](.*?)\[\/url\]/", '<a href="$2">$4</a>', $bb2html);

simply change it to

Code:
$bb2html = preg_replace("/\[url=(\W?)(.*?)(\W?)\](.*?)\[\/url\]/", '<a target="_NEW" href="$2">$4</a>', $bb2html);

Save and upload, now any links you put in your news posts will open in a new window.
#727
Davidmcc3
Posted on 13 Aug 2009, 11:53:00

Access: Member
Total Posts: 20
Joined: 2009-08-13

Hi Chris

Thanks for the quick response. Copied & pasted new line into file, saved, uploaded ... but now the links in the news items don't do anything!

I can use html, but not php ... so I'm in your hands, here.

Regards

David
#728
Chris
Posted on 13 Aug 2009, 12:01:43

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I'm think this is you right?

I took a look at the code that "Download the news release here" links is using,

it's being outputted like this

Code:
<a target="_NEW" href=""http://www.word-right.co.uk/press-releases.htm"">download the news release here</a>

Notice the 2 double quotes around the link, it means something went wrong in the bbparser.php file.

First edit the news post that has that link within it, and check to see you haven't accidentally added those extra quotes.


If that doesn't work, try this instead, download this file, extract it, and replace your own copy of bbparser.php with this new one.
#729
Last edited by Chris at 2009-08-13 12:06:16 Reason:
Davidmcc3
Posted on 13 Aug 2009, 12:35:30

Access: Member
Total Posts: 20
Joined: 2009-08-13

Hi Chris

Yes, you got the website right.

Checked the news item ... it's OK ... only a single set of quotes showing on all links.

Downloaded new php file, put it on website ... still links don't open. I've looked at the source code for the frame ... it shows only single set of quotes on all links.

?

David
#730
Chris
Posted on 13 Aug 2009, 12:38:34

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I looked at it again, tried clicking the links, the seem to work as expected for me now. Open in a new window/tab. Maybe try clearing your cache and try again to see if it works?
#731
Chris
Posted on 13 Aug 2009, 12:43:29

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Ah I think I see what is happening, instead of target="_NEW" it should be target="_BLANK"

Download this file, extract and replace your own copy.

This should hopefully fix the problem.
#732
Last edited by Chris at 2009-08-13 12:43:53 Reason:
Davidmcc3
Posted on 13 Aug 2009, 13:11:34

Access: Member
Total Posts: 20
Joined: 2009-08-13

Hi Chris

Installed new file ok.

Clearing cache didn't work (Firefox 3.0.5). Decided to close it down completely.

And it now works, with links opening into a new browser tab!

Thank you so much for your support.

We're new to creating websites ... only 2 paying clients so far (our mainstream activity is copywriting and marketing). Twin Peaks is a freebee for some friends. We hope to have some more paying sites over the next few months ... and we'll use N13 for future News listings - and make a donation each time.

Many thanks.

David
#733
Ccs9623
Posted on 14 Aug 2009, 04:38:28

Access: Member
Total Posts: 16
Joined: 2009-07-10

What would I need to change to get this same function when NOT using iFrames?
#737
Chris
Posted on 14 Aug 2009, 10:23:40

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You simply need to use a php include, for example

Code:
<?php
include 'news/index.php';
?>
#738
1 2
Network-13.com © 2013