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.

How do I remove this text?

5 posters

Go down

Solved How do I remove this text?

Post by Friendly Toucan May 8th 2023, 2:48 am

Hello,

I just added some special ranks to the forum. When visiting the profile page of a member with a special rank, the rank appears as this:

Rank: (Name of rank in text)

How can I remove "Rank:", which is there by default?

phpBB3

Thanks.


Last edited by Friendly Toucan on May 20th 2023, 9:30 am; edited 1 time in total
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by skouliki May 8th 2023, 7:30 am

hello

replace the word Rank with &nbsp
;

Misread the question


Last edited by skouliki on May 8th 2023, 9:10 pm; edited 1 time in total
skouliki
skouliki
Manager
Manager

Female Posts : 15209
Reputation : 1700
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Razor12345 May 8th 2023, 10:13 am

Good afternoon!

AP - Modules - Javascript codes management
Title: any
Placement: In all the pages
Javascript Code:

Code:
$(document).ready(function(){
  let profileBody = $('div#profile-advanced-right div.module:first-child div.inner div.h3 + div');
  profileBody.html(profileBody.html().replace('Rank:', ''));
});

Submit

Result:

How do I remove this text? Scree131

There is no other way, as the text "Rank:" does not have a tag
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1491
Reputation : 262
Language : Ukr, Rus, Eng
Location : Ukraine

sivastar, Niko, TonnyKamper and كونان2000 like this post

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 8th 2023, 9:37 pm

Didn't work. "Rank:" is still there. :/

I can add that I only use text, and not an image, in the ranks.

What could be the problem? Anything else you need to know?
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by SLGray May 8th 2023, 10:47 pm

Do you have JavaScript Management activated?


How do I remove this text? Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51516
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 8th 2023, 11:00 pm

Dear @Friendly Toucan

if you are using the simple profile, you can go to ACP > Display > Templates > Profile and edit the template profile_view_body
Look for this string and remove it, then save and publish the template Add
Code:
{L_RANK}:

If you are using the advanced profile, this cannot be done via templates - so, let me know so we can look for a solution Wink

Am I using the simple or advanced profile?:
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 9th 2023, 12:48 am

SLGray wrote:Do you have JavaScript Management activated?

Yes...

@Niko Yes, I am using the Advanced Profile... :/
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 9th 2023, 1:16 am

Is this your forum @Friendly Toucan ?
https://cerulean-blues.forumotion.com/login

Can you put it public so I can see the profiles as guest? Otherwise I have to register to check the forum Embarassed
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Razor12345 May 9th 2023, 9:50 am

This module (AP - Modules - Javascript codes management) collects all available scripts into one and runs them. It is possible that my code conflicts with other code you already have installed.

This cannot be determined without access to the forum. Open the forum to guests or provide an account on your forum.


How do I remove this text? Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1491
Reputation : 262
Language : Ukr, Rus, Eng
Location : Ukraine

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 9th 2023, 11:35 am

@Friendly Toucan I received the test account credentials, but I can't find any rank in your forum Embarassed
can you provide me a link where I can see the Rank: you want to be removed?

Thanks :rose:
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 9th 2023, 9:36 pm

@Friendly Toucan - URL example received, thanks Wink

Here you a script code you can use to solve the issue and remove "Rank" Wink
Code:
$(function() {
(function ($) {
  $.fn.replaceText = function (a) {
      var c = $.extend({}, a);
      return this.each(function (a, f) {
        $(this).html(function () {
            var b = this.innerHTML;
            $.each(Object.keys(c), function (a, d) {
              var e = RegExp(d.replace(/("|\'|\(|\)|\[|\]|\.|\*|\!|\?|\$|\||\+|\^|\/|\,|\;)/g, "\\$1"), "gi");
              b = b.replace(e, c[d])
            });
            return b
        })
      })
  };
}(jQuery));

$("div#profile-advanced-right div.module").replaceText({
    "Rank:": ''
});

});
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

sivastar, TonnyKamper and Friendly Toucan like this post

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 21st 2023, 2:22 pm

I just noticed a slight problem. In threads, how can I reduce the space between the ranks and whatever is below them?

Thanks.
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 22nd 2023, 8:16 pm

You probably need to edit the separator type for the first field you have in messages Wink

Go to ACP > Users & Groups > Users > Profiles > Profile fields, edit the first profile field visible in threads for what concerns this option:
How do I remove this text? Scree121
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 22nd 2023, 9:15 pm

I tried, but that only reduced the space below, and not the space above. :/
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 23rd 2023, 9:55 am

Can you mark me the space you mean in a screenshot?
also, a link I can follow to check the issue live ☺

edit: I think the extra space is given by this line of code
Code:
<dd><br></dd>

At the moment you have
Code:
<br>
which represents a "go to new line" - probably because you do not have any image set for the rank.
Try using https://2img.net/i/fa/empty.gif as image (it is an empty image file)
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

TonnyKamper likes this post

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 23rd 2023, 10:55 am

Just tried adding the image, but I think it made the space grow even more... :/
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 23rd 2023, 1:33 pm

@Friendly Toucan Oh I see..
can you remove the image and leave the field empty? So I can re-check?

Also, could you provide me your template General > Viewtopic_body between
Code:
<div class="postprofile" id="profile{postrow.displayed.U_POST_ID}">
and
Code:
<!-- BEGIN switch_likes_active -->
?

Thanks :rose:
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Niko May 23rd 2023, 4:50 pm

@Friendly Toucan - thanks for the template - received by PM :rose:

If you are never going to have an image for your ranks, can you try to remove
Code:
{postrow.displayed.RANK_IMAGE}
from the template, save and publish? Wink

Otherwise, let me know Wink
Niko
Niko
Helper
Helper

Male Posts : 3111
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 23rd 2023, 4:59 pm

I unfortunately plan to use images for some ranks as well... :/
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

Back to top Go down

Solved Re: How do I remove this text?

Post by Friendly Toucan May 24th 2023, 4:59 pm

I just solved it. cheers

I went from using this:

Code:
<b><font color="#FF0000"><p style="font-size: 12px;">TEST</p></font></b>
(This code was added to the actual name of the profile rank.)

Now I use this as the name:

Code:
<em class="new-rank">TEST</em>

... And this in the CSS:

Code:
.new-rank {
color: #FF0000;
font-size: 12px;
font-weight: normal;
font-style: normal;
}

Doing it this way instead, somehow made the extra space disappear.

Thanks to everyone who helped. Marking this as "solved". Very Happy
Friendly Toucan
Friendly Toucan
Forumember

Posts : 243
Reputation : 4
Language : English

https://cerulean-blues.forumotion.com

BlackScorpion and Niko like this post

Back to top Go down

Solved Re: How do I remove this text?

Post by skouliki May 24th 2023, 7:43 pm

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

Female Posts : 15209
Reputation : 1700
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