News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom action for redirect board

Started by HunterP, April 08, 2018, 05:55:34 AM

Previous topic - Next topic

HunterP

Thanks Pipke, it's an external URL so it shouldn't be making any difference. Also, there are about 25 different redirects with sub URLS of the same website.

For example :

https://monitor.p2kflex.nl/index.php?regio=R1
https://monitor.p2kflex.nl/index.php?regio=R2
https://monitor.p2kflex.nl/index.php?regio=R3

And so on...

Basically I don't really want to know the exact URL, but the redirect in general. Judging upon the url column in log_online, I'm more than convinced that this is possible, but at that point I'm not exactly sure how to achieve this :)

Pipke

on wich board on your forum you have the redirect links? can i see them as guest? otherwise post the links you see when you hover over the redirect board name? infact i need the board(s) link(s) ;)

ps. je mag mij ook een prive bericht sturen als je verder wilt spreken in nederlands.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

HunterP


Pipke, thanks, I will contact you privately :)

Kindred

Quote from: HunterP on April 10, 2018, 04:27:59 PM
Thanks for the reply, but once again; there is no action. That is the main problem. I'm trying to deal with a default SMF option which does not set an action I would like to force SMF to make it into an action.

and I have told you several times that the system is not designed to do that.
Сл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."

Pipke

This is solved:


$boardnumber = array('6', '7');
$Region = array('R1', 'R2');
$City = array('Groningen', 'Friesland');

foreach ($context['members'] as $member)
{
if (in_array($member['query']['board'], $boardnumber)) {
$Region_output = str_replace($boardnumber, $Region, $member['query']['board']);
$City_output = str_replace($boardnumber, $City, $member['query']['board']);
$member['action'] = 'The user is redirected to: <a href="https://monitor.p2kflex.nl/index.php?regio='.$Region_output.'">'.$City_output.'</a>';
         }

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Advertisement: