"ReplaceString" in the old forum posts...

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

"ReplaceString" in the old forum posts...

Post by Caronte3D »

Many old links pointing to incorrect url, so new users get a bad feeling.
It would be good to change each: https://www.purebasic.com/ to https://www.purebasic.fr/ :wink:
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: "ReplaceString" in the old forum posts...

Post by BarryG »

Agreed. I often find that my Google searches go to the old domain and then I can't reply to them. :(
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: "ReplaceString" in the old forum posts...

Post by Caronte3D »

For that maybe the best solution would be to pointing (redirect?) purebasic.com to purebasic.fr
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: "ReplaceString" in the old forum posts...

Post by chi »

A couple years ago I made this script for Violentmonkey (Tampermonkey, etc). I don't know if I missed something, but it works well enough for me.

Code: Select all

// ==UserScript==
// @name         PB.com Forum Redirect
// @version      1.0
// @author       chi
// @description  Redirects a .com URL to .fr domain
// @match        *://*purebasic.com/english/*
// @match        *://*purebasic.com/german/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Get the current URL
    var currentURL = window.location.href;

    // Check if the current URL contains ".com"
    if (currentURL.includes(".com")) {
        // Replace ".com" with ".fr" in the URL
        var newURL = currentURL.replace(/\.com/g, ".fr");

        // Redirect to the new URL
        window.location.href = newURL;
    }
})();
Et cetera is my worst enemy
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: "ReplaceString" in the old forum posts...

Post by Piero »

If you want, you can just make (replace the link of) a bookmark; if you put it on toolbar you will just need one click!

Code: Select all

javascript:(function() {var currentURL = window.location.href;if (currentURL.includes(".com")) {var newURL = currentURL.replace(/\.com/g, ".fr");window.location.href = newURL;}})();
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: "ReplaceString" in the old forum posts...

Post by Piero »

This other example searches the selected text on PB forums with google:

Code: Select all

javascript:window.open('https://www.google.com/search?q=site%253Apurebasic.fr%20'+document.getSelection());
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: "ReplaceString" in the old forum posts...

Post by BarryG »

.com is more professional and universal than .fr anyway, so IMO it should go back to that.
Post Reply