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.

How to get certain custom profile field value from all members?

View previous topic View next topic Go down

Solved How to get certain custom profile field value from all members?

Post by Amy Cool on January 23rd 2012, 10:25 pm

Hello Forumotion. I'm not the person who asks much for help regarding the forum I administrate but this time any hints you give me would be highly appreciated.

The forum is card game oriented. Point system is arranged so that you earn Points by playing the card game against other members and posting your results so you could earn Points.

Recently I've added a new system to motivate members more. The system is a Ranking Table which shows rankings of members according to their wins in a html page I created for that purpose. Since I cannot access the forum's database itself, I use a post to store the data in the table manually and then using "iframe" html tag and javascript I display that table in my html page. Problem is that the moderators who do the job on table must edit the post every single time and input data manually which makes it very annoying task to do.

So, my plan is this:

1. Create a custom profile field called like "wins/loses/draws/played" and store their score in this field. This will save so much time for mods.
2. Create a script in my html page to get the custom profile field data from all members, sort them according to the data and display in the table top 20 or so.

Of course the problem starts in number 2 scratch

I know how to sort the data and display the data but my main problem is how to get certain custom profile field value from all members in my forum?

I think I know a solution but I'm not sure if this will work or will it be a good solution. Lets go through it.

0. create a html page. cheers

1. Get the number of registered users of my forum via 'FORUMCOUNTUSER' variable. lets say its 4000.
2. Profile page for a user, for the sake of example lets say user no. 4000, is 'www.myforum.com/u4000'. Now, to get access to that certain custom profile field I need access to that page first. This will be using 'iframe' html tag with display:none style of course.
3. Now, with a loop using javascript I will change the 'src' of the iframe from 'www.myforum.com/u1' to 'www.myforum.com/u4000' to get data from each member with that iframe and not only one.
4. Every time script changes the 'src' of the iframe i will make additional code to grab the username and my custom profile field data of that user. For username I could use 'document.getElementByTagName("title")' since title tag has the username in innerHTML. For custom profile field I could use 'document.getElementById' since custom profile fields have an id attribute in their tag.

So, now its a theory still since I have not implemented it yet but I would like someone that has experience with coding in forumotion to tell me would this be possible to do or is there a better way to do it?

In case someone needs to see the Ranking table to get a visual view on what I was talking about: http://www.duelacademy.net/h10-league


Thanks in advance. bye





Last edited by Amy Cool on February 2nd 2012, 1:01 am; edited 2 times in total

Amy Cool
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

Solved Re: How to get certain custom profile field value from all members?

Post by LGforum on January 23rd 2012, 10:31 pm

Even if you only had 5 users, loading an iframe is loading another page. So when you load that league/rank table your loading many pages... and if you do have 4000 members... your browsers will likely crash.

If you have an external server for any reason, I can provide a way of doing this by storing the data elsewhere.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: How to get certain custom profile field value from all members?

Post by Amy Cool on January 23rd 2012, 10:43 pm

That's what I was fearing :/

I do have a free site on 000webhost.com and I can use that free server they give me for the site if that is what I need. I don't have much experience with MySQL though but if you could provide that way you mentioned I would appreciate it and see what I can do about it.

Thanks for your support Smile

Amy Cool
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

Solved Re: How to get certain custom profile field value from all members?

Post by LGforum on January 24th 2012, 1:21 am

That would be possible, and would provide a way for doing what you want.
It will require writing a small amount of PHP, and creating a small database. Which is no problem.

However, you'll need to read through the terms of 000webhost.com because most free hosts that provide a database often don't allow you to use the database for external uses, only for the site in which you create through their service.

Either way, this subject is something i'd rather take to PM. And since its not about Forumotion anymore, I think that iwll be better.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.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