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.

HTML Staff Page

View previous topic View next topic Go down

Solved HTML Staff Page

Post by APE on July 3rd 2015, 10:11 pm

I have been making a staff Page that tells you all the data of the staff members like this
as you can see right now i have to add all the Avatars by hand by clicking one the ones i want and dragging it to the right place on a new page using the ACP

What i would like is for this to change every time the member makes a change in there profile

I did use this code but it just don't change is a member updates there Profile.
Code:
<span class="lastpost-avatar"><img src="http://i59.servimg.com/u/f59/12/23/10/57/noaval11.png" alt="" /></span>     


also i would like that if i change the rank of a member of staff the rank would change on that page on its own without me having to change it by hand

Not sure that can be done thou Sad any help will be great Thanks

APE





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: HTML Staff Page

Post by Ange Tuteur on July 4th 2015, 12:09 am

@APE you want the list to automatically be updated, correct ?

The only solution I can think of would be to send multiple requests to different pages in order to retrieve the necessary data. It could be a bit... heavy, but utilizing storage and timing everything correctly could work. Smile

I think it would take less requests with the simple profile compared to advanced. blackeye

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: HTML Staff Page

Post by APE on July 4th 2015, 12:13 am

Yes @Ange Tuteur That is what i wanted Wink is there away i can say make a forum that just has say 1 post of each of my staff in and it then look in to that part of the forum for the info you need ? or it just look in the staff profiles for that data ?
I only need it to update say once a day tops





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: HTML Staff Page

Post by Ange Tuteur on July 4th 2015, 12:02 pm

Could I have a look at the staff list code to see what I can do ? Also, the fields you want auto updated are just the rank and avatar ?

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: HTML Staff Page

Post by APE on July 4th 2015, 2:11 pm

@Ange Tuteur The code is way to long to post in here can i just give you the admin account of my forum bot it has full admin rights

and yes just the rank and avatar Please





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: HTML Staff Page

Post by Ange Tuteur on July 4th 2015, 7:16 pm

Add this script anywhere you want on the HTML page :
Code:
<script type="text/javascript">//<![CDATA[
$(function() {
  var storage = window.localStorage;
 
  $('.team a.profile-icon').each(function() {
    var t = this,
        row = $(t).parentsUntil('TBODY'),
        id = t.href.replace(/.*?\/(u\d+).*/, '$1'),
        ava = row.find('.lastpost-avatar img')[0],
        rang = row.find('td:eq(2) img')[0],
        img;
   
   
    if (storage && storage['staffAva_' + id] && storage['staffRang_' + id] && storage['staffDataExp_' + id] > 24*60*60*1000 - +new Date) {
      ava.src = storage['staffAva_' + id];
      rang.src = storage['staffRang_' + id];
    }
    else $.get(t.href, function(d) {
      img = $('#profile-advanced-right .module:first img', d);
     
      ava.src = img[0].src;
      rang.src = img[1].src;
     
      if (storage) {
        storage['staffAva_' + id] = img[0].src;
        storage['staffRang_' + id] = img[1].src;
        storage['staffDataExp_' + id] = +new Date;
      }
    });
  });
});
//]]></script>

That should automatically set the ava and rang + cache the data for 24h. It gets the user URL from the profile link in the contact area, so make sure that's update date with the correct profile link. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: HTML Staff Page

Post by APE on July 5th 2015, 3:32 am

Thank you @Ange Tuteur its worked like a charm Wink here is a beer and a pizza just for you LOL this is now solved thank you buddy


Ange Tuteur Rocks





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: HTML Staff Page

Post by APE on July 5th 2015, 3:33 am

Topic solved and archived





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

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