Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 Replacing Text (Edit Profile)
#
A while back I asked for some help on changing something in the edit profile section. At that time John also pointed me to a thread for replacing text in this post here:


https://forum.jcink.com/index.php?showtopic...ndpost&p=158005


Unfortunately, I can no longer access that thread. It say I don't have permission to view it.


What I am looking to do is to change the text in the Edit Profile Information section that says:


YOUR PERSONAL PROFILE, THIS SECTION IS OPTIONAL


Also if I could change the text for the standard Date of Birth field as well. I'd like to be able to make that specifically refer to the user and not their character. Or possibly hiding that Date of Birth field as well would work.



PM
#
Here is the content of the replacing text post that I linked, it should help explain it further:

Purpose: This explains how to replace text in various areas of the forum.
Preview: No preview necessary, self explanatory.
Instructions: ACP -> Skins & Templates -> Board Wrappers -> In the footer, below <% COPYRIGHT %>

So, you find a piece of text you want to replace but you're not sure how to change it. Changing text is simpler than it seems and only requires a few lines of jQuery.

Base code:

CODE
<script>
replace_str = $('ELEMENT').html().replace(/Text To Replace/gi,'Replacement Text');
$('ELEMENT').html(replace_str);
</script>


How can we use this to replace text? Below are a few simple examples:

Replace "Logged in as:" with "Account:"

Step #1: Identify the element that contains the text you're trying to replace. In our case, the text "Logged in as:" appears in the user links bar. The element we're looking for then, is #userlinksbar.

How can you find element names? Simple, check the CSS Guide.

Step #2: Replace ELEMENT in the code with the name:

CODE
<script>
replace_str = $('#userlinks').html().replace(/Text To Replace/gi,'Replacement Text');
$('#userlinks').html(replace_str);
</script>


Step #3: Add the text we want to replace exactly as shown, and exactly what we want to replace it with:

CODE
<script>
replace_str = $('#userlinks').html().replace(/Logged in as:/gi,'Account:');
$('#userlinks').html(replace_str);
</script>


You're done!

You can now place this in board wrappers to get the replacement you need. You can do this for any other element within the forum.

Here are a few other examples:

CODE
<script>
// Change board statistics text
replace_str = $('#boardstats').html().replace(/Board Statistics/gi,'Forum Stats');
$('#boardstats').html(replace_str);
</script>


CODE
<script>
// Change left profile column text
replace_str = $('.profile-left').html().replace(/Personal Photo/gi,'My Photo');
$('.profile-left').html(replace_str);
</script>


CODE
<script>
// Remove subforums text
replace_str = $('.subforums').html().replace(/Subforums:/gi,'');
$('.subforums').html(replace_str);
</script>

signature
email: admin@jcink.com :: blog: John C.
#
Thanks for supplying that information.


I am not getting it to work for some reason.

This is what I'm trying to change here:

CODE
<div class="pformstrip">Your personal profile, this section is optional</div>



This is the code I tried to put in and it didn't work. I placed it at the very body of the wrappers after some of the other scripts. I also tried higher up in the code in the javascript area.


CODE
<script>
// Change pformstrip
replace_str = $('.pformstrip').html().replace(/Your personal profile, this section is optional/gi,'all the words i want to put go here does it matter how many there are?');
$('.pformstrip').html(replace_str);
</script>


This post has been edited by Faith: Aug 13 2017, 12:20 AM
PM
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll