Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Bigguy on January 09, 2019, 08:48:27 PM

Title: redirect boards
Post by: Bigguy on January 09, 2019, 08:48:27 PM
Are these supposed to be iurl  ??? I thought maybe it would make more sense as url instead of iurl.
Title: Re: redirect boards
Post by: lurkalot on January 10, 2019, 01:43:54 AM
I agree, it would be nice if people weren't taken away from your site when clicking a redirect board, but that's how it's always been even in 2.0.15.

It would be even more useful if it had a setting so you could choose, internal / external link.
Title: Re: redirect boards
Post by: Bigguy on January 10, 2019, 06:42:34 AM
That sounds like a great idea.
Title: Re: redirect boards
Post by: Bigguy on January 24, 2019, 05:48:58 AM
Does anyone know where I can change this. I won't use redirects the way it is.
Title: Re: redirect boards
Post by: Chen Zhen on January 24, 2019, 09:58:06 AM

file: ../Themes/default/BoardIndex.template.php  (or your "like" custom template file based on the default theme)

find:

<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">


replace with:

<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '" target="_blank">

Title: Re: redirect boards
Post by: Chen Zhen on January 24, 2019, 10:05:12 AM
Actually that will redirect every link as a new page so that is not what you want.

Title: Re: redirect boards
Post by: Chen Zhen on January 24, 2019, 10:12:14 AM

This will work a bit better as a replacement:

<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '"' . ($board['type'] == 'redirect' ? ' target="_blank"' : '') . '>


.. although it does not account for redirects to your own forum because the $board array does not seem to contain the final destination redirect url.
If it did then you could use strpos for your own site url.
Imo it would be nice for SMF to have a checkbox option that allows choosing between internal & external redirect (internal being default).
The selected option being stored in the $board array and then a similar change to the template as shown above.

Title: Re: redirect boards
Post by: Bigguy on January 24, 2019, 11:31:32 AM
I think that is a great idea to have in SMF 2.1 What you posted works like a charm and is exactly what I wanted. It makes more sense this way. Thank you.
Title: Re: redirect boards
Post by: Kindred on January 24, 2019, 12:11:33 PM
except, the rule of thumb for websites in the modern age is "don't open new windows/tabs" -- let the user determine the action based on their own browser settings or click (right/left click)

:P
Title: Re: redirect boards
Post by: Bigguy on January 24, 2019, 12:12:30 PM
You could make an option in the profile for each user and one in the admin panel. :)
Title: Re: redirect boards
Post by: Kindred on January 24, 2019, 01:00:05 PM
we REMOVED a bunch of useless options in 2.1 - why would we add more back in? :P
Title: Re: redirect boards
Post by: Sesquipedalian on January 24, 2019, 01:34:43 PM
It might be worthwhile to ask yourself why you would want to use something as prominent and structurally integrated as a redirect board to point to another site at all. Redirect boards are designed to be links to things that are outside of your forum itself but that are integral to what your forum is about. There can be exceptions to any rule, but in general, if having people follow a given link feels to you like sending them away from your community, then a redirect board is not the tool you should use to create that link in the first place.
Title: Re: redirect boards
Post by: Aleksi "Lex" Kilpinen on January 24, 2019, 02:10:43 PM
Now, there are always different ways of looking at the same thing. I for example have redirect boards on my forum, some visible to everyone, some to a limited audience, and each and everyone links outside of the forum. But, they are all related to the community none the less - things like a swagshop, webmails, photogallery, even some server tools, so on... some in subdomains on the same server, some in completely different locations. They are an easy to way to to offer links based on group memberships on the forum. So, in short - I'd agree, url would be better for me, but then again - iurl could be someone elses preferred option. I think that would make a good option to the actual redirect board settings, so that you could decide this by board.
Title: Re: redirect boards
Post by: Bigguy on January 24, 2019, 07:10:00 PM
@Sesquipedalian: It's an easy place to point members to. Instead of telling them to look through the links mod or posting a link in an obscure thread that not a lot of people are going to find. I find it convenient to say. Look at the redirect category, you'll find it. I understand what you are saying. It's better to use them for something that is in direct relation to your site. I think personally, if you are trying to get members to stay at your site, then opening a different websites link in a new tab does not insure they are going to stay on your site but there is better chance of it than if you open the link in the same tab.

@Lex: Deciding this on a per board bases is a good idea. You could have a mix of iurl and url. Let the admin decide for himself.

@Kindred: I get your point. There were options that should have been taken out like they were. I have no problem with that. I don't think this is as useless as you think though. Just my opinion. I'm happy with the code I got from Chen. Maybe a mod could be made for this but having it conveniently part of the core for redirect boards just means you can do more things with that aspect of the forum. :)

(Just my opinions that's all) :)