Advertisement:

Author Topic: redirect boards  (Read 1019 times)

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
redirect boards
« 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.

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,494
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: redirect boards
« Reply #1 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.

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Re: redirect boards
« Reply #2 on: January 10, 2019, 06:42:34 AM »
That sounds like a great idea.

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Re: redirect boards
« Reply #3 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.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: redirect boards
« Reply #4 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:
Code: [Select]
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">

replace with:
Code: [Select]
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '" target="_blank">

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: redirect boards
« Reply #5 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.

 

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: redirect boards
« Reply #6 on: January 24, 2019, 10:12:14 AM »

This will work a bit better as a replacement:
Code: [Select]
<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
Simple Portal Support

Request politely & demand nothing.

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Re: redirect boards
« Reply #7 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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,554
  • Gender: Male
    • Kindred-999 on GitHub
Re: redirect boards
« Reply #8 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Re: redirect boards
« Reply #9 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. :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,554
  • Gender: Male
    • Kindred-999 on GitHub
Re: redirect boards
« Reply #10 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Sesquipedalian

  • The Mad Doctor
  • On Hiatus
  • Sr. Member
  • *
  • Posts: 970
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: redirect boards
« Reply #11 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.
I promise you nothing.

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

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,693
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: redirect boards
« Reply #12 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.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"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

Online Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,990
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Re: redirect boards
« Reply #13 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) :)