Get help with forum features or suggest new functionality.
User avatar
By St0ney
#68158
Ryan: one thing I added a few years back, was when folks click on a link it opens in a new browser tab,
instead of the same window/tab they're viewing the forum in.

If one forgets to hit the (Back) button their pretty much leaving the forum when they close the window.

I forget what and where the page is to edit, (But the code is a simple) " target="V

It works great for when folks click a video link etc....

The Video will load in a new browser tab, and after watching the clip, they just close the tab, and their where they left off,
Never leaving the board.
#68173
RavensDestiny wrote:This would be a great feature to have here. Every time I click a link I forget it opens in the same tab and I always end up closing it.

IE solved that problem years back, however, I hardly use it anymore. Other browsers tend to use the following theory:

The person will right click, click on "open in new tab", and you're set.

I hate this philosophy but what can yah do?
User avatar
By Kayo
#68175
i dont know what your talking about all the links open in new tabs for me. maybe its because i use safari and have different browser settings. try checking if yours has the option i know firefox does because every time i mess with my roommates computer i get confused.
User avatar
By St0ney
#68177
Kayo wrote:i dont know what your talking about all the links open in new tabs for me. maybe its because i use safari and have different browser settings. try checking if yours has the option i know firefox does because every time i mess with my roommates computer i get confused.
if it's set in the browser, it will do this for every link clicked on everywhere
Most of the time I don't need 20 tabs opened at once.

but if it's programmed in the Forum, it will work just here.

On Websites not Forums, Most want the page to load in the window they are in.

Example after you read page one you click read page 2 and you have yet another tab open.
When after you already read page one, it's not needed any more.
Last edited by St0ney on Fri Sep 21, 2012 9:11 pm, edited 1 time in total.
#68178
Individual browser settings aside, links on the web can be made to open a new tab (or window) with by using a "target" in the link code. Generally, when clicking a link to an outside side, I think people these days probably expect it to launch a new tab. That's how I had it working on the previous version of this forum. But the default setting for this new forum software is to have all links open in the same window. I haven't gotten around to changing the function to match what it did before, but I'll get around to it.
User avatar
By St0ney
#68179
Zombie Pumpkins! wrote:Individual browser settings aside, links on the web can be made to open a new tab (or window) with by using a "target" in the link code. Generally, when clicking a link to an outside side, I think people these days probably expect it to launch a new tab. That's how I had it working on the previous version of this forum. But the default setting for this new forum software is to have all links open in the same window. I haven't gotten around to changing the function to match what it did before, but I'll get around to it.
Agree: That's why I placed it in the Suggestions,

It's not pre-coded in phpbb 3+ it has to be added (mod / code tweak)

I only thought of it because I just clicked a link to that cool Video projected house, after watching it , I closed the window.
which closed the browser.
User avatar
By Kayo
#68181
St0ney wrote:
Kayo wrote:i dont know what your talking about all the links open in new tabs for me. maybe its because i use safari and have different browser settings. try checking if yours has the option i know firefox does because every time i mess with my roommates computer i get confused.
if it's set in the browser, it will do this for every link clicked on everywhere
Most of the time I don't need 20 tabs opened at once.

but if it's programmed in the Forum, it will work just here.

On Websites not Forums, Most want the page to load in the window they are in.

Example after you read page one you click read page 2 and you have yet another tab open.
When after you already read page one, it's not needed any more.
yeah my browser is still set up for school research so I've come accustomed to closing every tab behind me if i'm sure i'm not going to use it. its really fun on Facebook :roll: so i get your point
User avatar
By mesmark
#68182
You can add this code to the veiwtopic.php file around line 1390
Code: Select all
  $message = preg_replace('/(class="postlink")/','class="postlink" target="_blank"',$message);
just under
Code: Select all
	$message = bbcode_nl2br($message);
	$message = smiley_text($message);
However, that will make all links in a post open in a new tab
User avatar
By St0ney
#68186
mesmark wrote:You can add this code to the veiwtopic.php file around line 1390
Code: Select all
  $message = preg_replace('/(class="postlink")/','class="postlink" target="_blank"',$message);
just under
Code: Select all
	$message = bbcode_nl2br($message);
	$message = smiley_text($message);
However, that will make all links in a post open in a new tab
Yea I think that code will open ALL links in new tabs,
which would cause more problems - when folks post a link to a Post or thread.

A Good Alternative is this MOD

It's Called: Prime Links (1.3.0)
Modifies links within posts so that local links are correctly classified as such. It can also apply a target to external links (e.g. to open in a new window) and prepend links (e.g. to apply an anonymizer).

It's been Cleared as a good working MOD by the folks at PHPBB

The Download Link is Here https://www.phpbb.com/customise/db/mod/prime_links/

Takes about 2 minutes to install.
#69853
mesmark wrote:You can add this code to the veiwtopic.php file around line 1390
Code: Select all
  $message = preg_replace('/(class="postlink")/','class="postlink" target="_blank"',$message);
just under
Code: Select all
	$message = bbcode_nl2br($message);
	$message = smiley_text($message);
However, that will make all links in a post open in a new tab
You can take this 1 step further, open links to external sites in new windows, this site same window. Using preg_match_all you can search $message for all links, see if they contain this domain name ($_SERVER['SERVER_NAME']) and if they do, set target to _SELF, if they do not set it to _BLANK

I can make a working example if need be... I havn't worked with phpBB since they took my code and added it to the core, but i dont mind helping yall out :)