Page 1 of 1

"ReplaceString" in the old forum posts...

Posted: Tue Feb 11, 2025 12:23 pm
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:

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

Posted: Tue Feb 11, 2025 12:24 pm
by BarryG
Agreed. I often find that my Google searches go to the old domain and then I can't reply to them. :(

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

Posted: Tue Feb 11, 2025 12:51 pm
by Caronte3D
For that maybe the best solution would be to pointing (redirect?) purebasic.com to purebasic.fr

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

Posted: Tue Feb 11, 2025 3:25 pm
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;
    }
})();

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

Posted: Wed Feb 12, 2025 3:39 pm
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;}})();

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

Posted: Fri Feb 14, 2025 10:29 pm
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());

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

Posted: Sat Feb 15, 2025 2:32 am
by BarryG
.com is more professional and universal than .fr anyway, so IMO it should go back to that.