The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Changing inbuilt text

View previous topic View next topic Go down

Solved Changing inbuilt text

Post by BloodDrunk on May 2nd 2017, 7:35 pm

Hello,
Firstly, I know I could somehow accomplish what I want using jQuery, but I'm wondering if it's possible to edit the text that appears in the screenshot? I just want to access the numbers, and members, and simply re-write the text?


Last edited by BloodDrunk on May 12th 2017, 12:44 pm; edited 1 time in total
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 4:37 pm

I'll take this as "not possible", so you may throw this into garbage lel..
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by skouliki on May 9th 2017, 5:12 pm

hello

what text exactly do you want to change?
avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 2897
Reputation : 440
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 5:45 pm

All of these, but only texts. I was thinking of somewhat grabbing the global variables, and just put my own text and add those variables to the text.

But here's how I want it to be like:

Forum Members
Registered members: <list all online registered members here>

Birthdays today: <variable>
Upcoming birthdays (in 30 days): <variable>

Total online: <variable> users[Members:<#ofonlinemembers>, Guests:<#ofonlineguests>, Robots:<#ofonlinerobots>]
Record online users: <variable>

Forum Statistics
Total posts: <variable>
Registered users: <variable>
Newest member: <variable>
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by skouliki on May 9th 2017, 6:00 pm

i do not know sorry maybe someone else can help you
avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 2897
Reputation : 440
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by Justice™ on May 9th 2017, 6:25 pm

In your index_body template, add this script anywhere:
Code:
$(function(){
var totalposts='{TOTAL_POSTS}'.match(/\d+/);
var totalmembers='{TOTAL_USERS}'.match(/\d+/);
var lastuserurl='{NEWEST_USER}'.match(/\/u\d+/);
var lastusername='{NEWEST_USER}'.split("strong")[2].match(/[^><\/]/g).join("");
var totalon='{TOTAL_USERS_ONLINE}'.match(/>\d+\</).join("").match(/\d+/).join("");
var onregistred='{TOTAL_USERS_ONLINE}'.match(/\d+\ Registered/).join("").match(/\d+/).join("");
var onvisitors='{TOTAL_USERS_ONLINE}'.match(/\d+\ Guest/).join("").match(/\d+/).join("");
var onhidden='{TOTAL_USERS_ONLINE}'.match(/\d+\ Hidden/).join("").match(/\d+/).join("");
var recordonline='{RECORD_USERS}'.match(/>\d+\</).join("").match(/\d+/).join("");
var userliston='{LOGGED_IN_USER_LIST}'.split("Registered Users: ")[1];
})

You will now be able to use the following js variables:
totalposts-Total number of posts on your forum
totalmembers-Total number of members on your forum
lastuserurl-Link to the last registered user's profile
lastusername-Name of the last registered user
totalon-Number of users online now(Registered+Hidden+Visitors)
onregistered-Number of registered users online now
onvisitors-Number of visitors online now
onhidden-Number of hidden users online now
recordonline-Most users online at the same moment
userliston-The list of online users

How to use


Let's say that the element you want to contain the number of posts has the id #posts. Than to display the total number of posts there, you would have to add this code after
Code:
$(function(){
in the code above:
Code:
$("#posts").html(totalposts)
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 6:59 pm

Thank you, Wolfuryo

I know how to use it, I just needed to know the way to access the variables, didn't know I can access them through js and assign variables to em Very Happy
I will see how this'll work out
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by Luiz~ on May 9th 2017, 7:27 pm

Can you please activate my test account in your forum?
I need it to create the JS for you. Wink

o/
avatar
Luiz~
New Member

Male Posts : 16
Reputation : 7
Language : PT
Location : Brazil

http://ajuda.forumeiros.com/

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 8:02 pm

Wolfuryo wrote:In your index_body template, add this script anywhere:
Code:
$(function(){
var totalposts='{TOTAL_POSTS}'.match(/\d+/);
var totalmembers='{TOTAL_USERS}'.match(/\d+/);
var lastuserurl='{NEWEST_USER}'.match(/\/u\d+/);
var lastusername='{NEWEST_USER}'.split("strong")[2].match(/[^><\/]/g).join("");
var totalon='{TOTAL_USERS_ONLINE}'.match(/>\d+\</).join("").match(/\d+/).join("");
var onregistred='{TOTAL_USERS_ONLINE}'.match(/\d+\ Registered/).join("").match(/\d+/).join("");
var onvisitors='{TOTAL_USERS_ONLINE}'.match(/\d+\ Guest/).join("").match(/\d+/).join("");
var onhidden='{TOTAL_USERS_ONLINE}'.match(/\d+\ Hidden/).join("").match(/\d+/).join("");
var recordonline='{RECORD_USERS}'.match(/>\d+\</).join("").match(/\d+/).join("");
var userliston='{LOGGED_IN_USER_LIST}'.split("Registered Users: ")[1];
})

You will now be able to use the following js variables:
totalposts-Total number of posts on your forum
totalmembers-Total number of members on your forum
lastuserurl-Link to the last registered user's profile
lastusername-Name of the last registered user
totalon-Number of users online now(Registered+Hidden+Visitors)
onregistered-Number of registered users online now
onvisitors-Number of visitors online now
onhidden-Number of hidden users online now
recordonline-Most users online at the same moment
userliston-The list of online users

How to use


Let's say that the element you want to contain the number of posts has the id #posts. Than to display the total number of posts there, you would have to add this code after
Code:
$(function(){
in the code above:
Code:
$("#posts").html(totalposts)
Hey, I tried adding the script wrapped in <script></script> tag, but when I try to use the variable in js, it doesn't actually do anything.
I even tried creating the "posts" div to see if it'll work, but it doesn't.
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by Justice™ on May 9th 2017, 8:28 pm

Post your index_body template here.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 8:53 pm

Code:
{JAVASCRIPT}

<script>
$(function(){
  var totalposts='{TOTAL_POSTS}'.match(/\d+/);
  var totalmembers='{TOTAL_USERS}'.match(/\d+/);
  var lastuserurl='{NEWEST_USER}'.match(/\/u\d+/);
  var lastusername='{NEWEST_USER}'.split("strong")[2].match(/[^><\/]/g).join("");
  var totalon='{TOTAL_USERS_ONLINE}'.match(/>\d+\</).join("").match(/\d+/).join("");
  var onregistred='{TOTAL_USERS_ONLINE}'.match(/\d+\ Registered/).join("").match(/\d+/).join("");
  var onvisitors='{TOTAL_USERS_ONLINE}'.match(/\d+\ Guest/).join("").match(/\d+/).join("");
  var onhidden='{TOTAL_USERS_ONLINE}'.match(/\d+\ Hidden/).join("").match(/\d+/).join("");
  var recordonline='{RECORD_USERS}'.match(/>\d+\</).join("").match(/\d+/).join("");
  var userliston='{LOGGED_IN_USER_LIST}'.split("Registered Users: ")[1];
})
</script>

<br class="clear" />

<!-- BEGIN message_admin_index -->
   <div class="panel introduction">
      <div class="inner"><span class="corners-top"><span></span></span>
   <!-- BEGIN message_admin_titre -->
      <div class="h3">{message_admin_index.message_admin_titre.MES_TITRE}</div>
   <!-- END message_admin_titre -->

   <!-- BEGIN message_admin_txt -->
      <div class="mes-txt">{message_admin_index.message_admin_txt.MES_TXT}</div>
   <!-- END message_admin_txt -->
      <span class="corners-bottom"><span></span></span></div>
   </div>
<!-- END message_admin_index -->

{CHATBOX_TOP}
{BOARD_INDEX}

<div class="div-right">
<div class="profile_view">
  <div class="heading3"><a href="">PROFILE</a></div>
  <a href="" class="image-link"><img src="" class="image" /></a>
  <p></p>
</div>
<div class="total_users_online">
<!-- BEGIN disable_viewonline -->

   <!-- BEGIN switch_viewonline_link -->
   <div class="heading3"><a href="{U_VIEWONLINE}" rel="nofollow">USERS CURRENTLY ONLINE</a></div>
   <!-- END switch_viewonline_link -->

   <!-- BEGIN switch_viewonline_nolink -->
   <div class="heading3">{L_WHO_IS_ONLINE}</div>
   <!-- END switch_viewonline_nolink -->

<img src="{L_ONLINE_IMG}" id="i_whosonline" alt="{L_WHO_IS_ONLINE}" class="img-whois" />
<p>
{LOGGED_IN_USER_LIST}
{L_ONLINE_USERS}

{L_CONNECTED_MEMBERS}<br />
{L_WHOSBIRTHDAY_TODAY}{L_WHOSBIRTHDAY_WEEK}

{TOTAL_USERS_ONLINE}<br />
{RECORD_USERS}
<br />

</p>
</div>

<div class="forum_statistics">
   <div class="clear"></div>
                                                             
   <!-- BEGIN switch_statistics_link -->
   <div class="heading3"><a href="{U_STATISTICS}" rel="nofollow">FORUM STATISTICS</a></div>
   <!-- END switch_statistics_link -->
                                                             
   <!-- BEGIN switch_statistics_nolink -->
   <div class="heading3">{L_STATISTICS}</div>
   <!-- END switch_statistics_nolink -->
                                 
   <p class="page-bottom">
   {TOTAL_POSTS}
   </p>
   <p class="page-bottom">
   {TOTAL_USERS}
   </p>
   <p class="page-bottom">
   {NEWEST_USER}
   </p>
</div>
</div>

   <!-- BEGIN switch_chatbox_activate -->
   <div class="h3"><a href="{S_JOIN_CHAT}" target="ChatBox">{CHATBOX_NAME}</a></div>
   <div class="page-bottom">
   {TOTAL_CHATTERS_ONLINE}&nbsp;:&nbsp;
   {CHATTERS_LIST}<br />
   </div>
      <!-- BEGIN switch_chatbox_popup -->
      <div id="chatbox_popup"></div>
      <script type="text/javascript">
      insertChatBoxPopup('{disable_viewonline.switch_chatbox_activate.switch_chatbox_popup.U_FRAME_CHATBOX}', '{L_CLICK_TO_JOIN_CHAT}');
      </script>
      <!-- END switch_chatbox_popup -->
   <!-- END switch_chatbox_activate -->
<!-- END disable_viewonline -->

{CHATBOX_BOTTOM}

<br style="clear:both" />

<!-- BEGIN switch_legend -->
<ul id="picture_legend">
   <li><img src="{FORUM_NEW_IMG}" alt="{L_NEW_POSTS}" />{L_NEW_POSTS}</li>
   <li><img src="{FORUM_IMG}" alt="{L_NO_NEW_POSTS}" />{L_NO_NEW_POSTS}</li>
   <li><img src="{FORUM_LOCKED_IMG}" alt="{L_FORUM_LOCKED}" />{L_FORUM_LOCKED}</li>
</ul>
<!-- END switch_legend -->

{AUTO_DST}
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by Justice™ on May 9th 2017, 9:44 pm

As I have already told you, you have to make an element on the page:
Code:
<div id="totalposts"></div>
Than in the JS code, after
Code:
$(function(){
, add
Code:
$("#totalposts").html(totalposts);
Send me a PM with the founder username and password if you're still having troubles.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 9th 2017, 10:19 pm

Wolfuryo wrote:As I have already told you, you have to make an element on the page:
Code:
<div id="totalposts"></div>
Than in the JS code, after
Code:
$(function(){
, add
Code:
$("#totalposts").html(totalposts);
Send me a PM with the founder username and password if you're still having troubles.
Yes, I am aware of that, but there already exists an element whose text I want to change with these variables, and I did exactly the same thing you just said (twice); refered to an element
Code:
$('div.forum_statistics p:contains("blablablabla")').html("Total posts" + totalposts);
But it fails to do so.
Even tried calling totalposts in alert to see if it returns something, but alert didn't even run then.

I'll try again!
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by Draxion on May 10th 2017, 1:52 am

Did you actually test this, @Wolfuryo? I tested this on my site and not even I got it to work.


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Changing inbuilt text

Post by Justice™ on May 10th 2017, 5:53 am

Matter of fact, yes, I tested it for a few months. I am using it on my forum and it works perfectul. Anyway, I'm waiting for a PM with founder username and password from BloodDrunk.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 10th 2017, 3:01 pm

Okay now, it works to some point. I managed to change the text, but when I call variables, it returns "undefined".
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by BloodDrunk on May 12th 2017, 12:44 pm

Solved!
avatar
BloodDrunk
Forumember

Posts : 122
Reputation : 4
Language : English

http://www.nfssecrets.tk/

Back to top Go down

Solved Re: Changing inbuilt text

Post by SLGray on May 12th 2017, 6:42 pm

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40203
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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