The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Exchange word - mobile problem

3 posters

Go down

Solved Exchange word - mobile problem

Post by tester2 August 14th 2020, 11:48 am

Technical Details


Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome, Other
Who the problem concerns : All members
When the problem appeared : Few days ago
Forum link : https://testyyyforum.forumpolish.com/t1-your-first-subject

Description of problem

Hello. I have problem with this code:
Code:
if(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){
$(function(){
$(".post-section .post-content").each(function(){
var _1=$(this).html();
var _2=_1.replace(/gazeta/gi,"<a target='blank' rel='nofollow' href='gazeta.pl'>GAZETA</a>");
$(this).html(_2);
var _1=$(this).html();
var _2=_1.replace(/Soccer/gi,"<a target='blank' rel='nofollow' href='https://www.meczyki.pl/'>Soccer</a>");
$(this).html(_2);
});
});
}

Few days ago everything was be ok, but now, when I use this code members can't see pictures on mobile phone :/ Can you exchange me this code? This code changes the text to a link on mobile if you don't know. Thanks for help Wink

Screen:
Exchange word - mobile problem  Screen10


Last edited by tester2 on August 19th 2020, 1:19 pm; edited 1 time in total
tester2
tester2
New Member

Posts : 3
Reputation : 1
Language : ENG / PL

https://testyyyforum.forumpolish.com/

Back to top Go down

Solved Re: Exchange word - mobile problem

Post by tester2 August 18th 2020, 12:37 pm

Nobody knows? :/ Bump.
tester2
tester2
New Member

Posts : 3
Reputation : 1
Language : ENG / PL

https://testyyyforum.forumpolish.com/

Back to top Go down

Solved Re: Exchange word - mobile problem

Post by tikky August 18th 2020, 4:57 pm

Hello @tester2,

Welcome to Forumotion Support Forum! Change your code to:
Code:
(function($) {
    'use strict';
 
    $(function() {
 
        if (!_userdata.tpl_mobile) return;
 
 
        $('.post-content').each(function() {
 
            var $this = $(this);
 
 
            $this
                .html($this.html().replace(/gazeta/g, '<a target="blank" rel="nofollow" href="gazeta.pl">GAZETA</a>').replace(/soccer/g, '<a target="blank" rel="nofollow" href="https://www.meczyki.pl/">Soccer</a>'));
 
            $('img').each(function() {
                var $data = $(this);
 
                $data
                  .attr('src', $data.attr('data-src'))
                  .css('height', 'auto');
               
 
            });
 
        });
 
 
 
 
    });
 
})(jQuery);
tikky
tikky
Forumember

Posts : 922
Reputation : 160
Language : 🇵🇹

https://www.forumotion.com/create-forum/modernbb

TonnyKamper and tester2 like this post

Back to top Go down

Solved Re: Exchange word - mobile problem

Post by tester2 August 19th 2020, 1:18 pm

Now it's working! Thanks! Smile Solved
tester2
tester2
New Member

Posts : 3
Reputation : 1
Language : ENG / PL

https://testyyyforum.forumpolish.com/

Back to top Go down

Solved Re: Exchange word - mobile problem

Post by skouliki August 19th 2020, 6:42 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 15355
Reputation : 1705
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum