TinyPortal

Development => Support => Topic started by: smartmouse on August 04, 2021, 08:47:50 AM

Title: Got 404 on marquee.js
Post by: smartmouse on August 04, 2021, 08:47:50 AM
Hello,
I'm using TinyPortal 2.0.1 and I have a 404 error on my forum, referring to "/admin/tp-files/tp-plugins/javascript/jquery.marquee.js".

What is tp-plugins folder? I don't have it...
How to solve?

Thank you
Title: Re: Got 404 on marquee.js
Post by: @rjen on August 04, 2021, 07:37:06 PM
Can you explain when you see the error message?

I assume the error is related to the scrolling effect on the shoutbox.
I see that the /tp-files/tp-plugins/ folder was removed with TP2.0.0.

There is also something funny with that function: it is supposed to stop scrolling with a mouse-over: that does not work atm...

You can edit the file: source/TPShout.php

Find:

    if($context['TPortal']['shoutbox_usescroll'] > 0) {
        $context['html_headers'] .= '
        <script type="text/javascript" src="tp-files/tp-plugins/javascript/jquery.marquee.js"></script>
        <script type="text/javascript">
            $j(document).ready(function(){
if ($j("marquee")) {
$j("marquee").marquee("tp_marquee").mouseover(function () {
$j(this).trigger("stop");
}).mouseout(function () {
$j(this).trigger("start");
});
});
}
        </script>';
    }


and change this to:


    if($context['TPortal']['shoutbox_usescroll'] > 0) {
        $context['html_headers'] .= '
        <script type="text/javascript" src="Themes/default/scripts/tinyportal/jquery.marquee.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("marquee").marquee("tp_marquee").mouseover(function () {
                        $(this).trigger("stop");
                    }).mouseout(function () {
                        $(this).trigger("start");
                    });
                });
        </script>';
    }


But I would like to know where you exactly see that error...
Title: Re: Got 404 on marquee.js
Post by: tino on August 04, 2021, 09:01:35 PM
The error message will most likely be in the console log when you click on the networking tab.

I'd guess that's where it's being seen anyway.
Title: Re: Got 404 on marquee.js
Post by: @rjen on August 04, 2021, 09:31:48 PM
That's what I suspected, but checking that I do not get this error, hence the question
Title: Re: Got 404 on marquee.js
Post by: smartmouse on August 04, 2021, 09:50:37 PM
Quote from: @rjen on August 04, 2021, 07:37:06 PM
Can you explain when you see the error message?
In the network tab of DevTools:

(https://i.ibb.co/mXmJcYM/Screenshot-at-2021-08-04-22-36-29.png)

QuoteI assume the error is related to the scrolling effect on the shoutbox.
I see that the /tp-files/tp-plugins/ folder was removed with TP2.0.0.
If it has been removed, why there is still reference to that file in TP 2.0.1?

QuoteThere is also something funny with that function: it is supposed to stop scrolling with a mouse-over: that does not work atm...
Maybe it is not working due a bug in the code:

(https://i.ibb.co/JW105bz/Screenshot-at-2021-08-04-22-46-11.png)

Shouldn't it be like the following?

$j(document).ready(function(){
    if ($j("marquee")) {
$j("marquee").marquee("tp_marquee").mouseover(function () {
    $j(this).trigger("stop");
}).mouseout(function () {
    $j(this).trigger("start");
});
    }
});
Title: Re: Got 404 on marquee.js
Post by: @rjen on August 04, 2021, 10:18:42 PM
Quote from: smartmouse on August 04, 2021, 09:50:37 PM
In the network tab of DevTools:
Strange, I am not getting the 404..

QuoteIf it has been removed, why there is still reference to that file in TP 2.0.1?
That's a bug: the file was moved to another folder.

QuoteMaybe it is not working due a bug in the code:
Shouldn't it be like the following?

$j(document).ready(function(){
    if ($j("marquee")) {
$j("marquee").marquee("tp_marquee").mouseover(function () {
    $j(this).trigger("stop");
}).mouseout(function () {
    $j(this).trigger("start");
});
    }
});


Maybe, but you can just use the code I provided: that works as I have tested it.
That snippet comes from TP2.1.0, the code is cleaned up a bit...
Title: Re: Got 404 on marquee.js
Post by: smartmouse on August 05, 2021, 08:52:20 AM
Ok, solved, thank you!
Title: Re: Got 404 on marquee.js
Post by: smartmouse on November 03, 2021, 03:56:23 PM
I'm experiencing again the same error.

What could be wrong now?
Title: Re: Got 404 on marquee.js
Post by: @rjen on November 03, 2021, 07:01:13 PM
What TP version are you on now?
Title: Re: Got 404 on marquee.js
Post by: smartmouse on November 04, 2021, 08:08:32 AM
Quote from: @rjen on November 03, 2021, 07:01:13 PM
What TP version are you on now?

The same, 2.0.1.
Title: Re: Got 404 on marquee.js
Post by: @rjen on November 04, 2021, 10:01:43 AM
First upgrade to 2.1.0....