News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

redirect boards

Started by Bigguy, January 09, 2019, 08:48:27 PM

Previous topic - Next topic

Bigguy

Are these supposed to be iurl  ??? I thought maybe it would make more sense as url instead of iurl.

lurkalot

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.

Bigguy

That sounds like a great idea.

Bigguy

Does anyone know where I can change this. I won't use redirects the way it is.

Chen Zhen


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">


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen

Actually that will redirect every link as a new page so that is not what you want.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen


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.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Bigguy

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.

Kindred

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
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Bigguy

You could make an option in the profile for each user and one in the admin panel. :)

Kindred

we REMOVED a bunch of useless options in 2.1 - why would we add more back in? :P
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sesquipedalian

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.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bigguy

@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) :)

Advertisement: