Jump to content

This topic is 8108 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

hi,

I have 2 related db's that share info over the web. All works fine, th eonly thing I dont get working is a list of the most frequent users. I want to see a list of the 5 frequent users when I open the main page with -findall. How do I set up a calc/sum field to 'count' records per users, and remembering the best 5. So it will be like a top 5 on the mainpage.

The trick to do this (wich I don't get) is to make FM to calculate something without a fixed username (since anyone can signup and become a user).

Anyone familiar with this?

Thx smirk.gif

Posted

Hey there. I've done something similar, except that I had one db with users names and info, and one db for logging in. For our sake, we could call them DB's 1 and 2.

Now, DB1 has the names of the people and stuff about them, like their first and last names and their bio stuff like social security number etc.

DB2's only responsibility is to log people in and out. DB2 should have the same exact field names as DB1 like first_name and last_name for searching the records and counting the times they logged in. The relationship between the two DB's could be like last_name, first_name, or a unique identifier like social security number.

Now if you go view information on people in DB1, you can "lift that same info" and create a record in DB2 by creating a script using the info in DB1. If you put a field in DB2 that is a running total, you can search the names of people on one report using a [fmp-inlineaction] tag for a defined period of time and compare their times. Hope I helped!!

Posted

Hmm... I think you'll need some kind of tracking/counting system like Kittrick says rather than have FMP count on the fly. I would then sort (descending) user records by that field and just display the first 5 using -max; (assuming there's no ties for 5th or 3 for 4th, etc.)

Also, you said you want it to appear on your main page... if this is your first page, I don't think you'll be able to do it. As far as I know, it is always necessary to perform an ACTION before displaying results. What people do is create splash/leading pages before their main pages with META refresh CDML links. You *might* be able to cheat using frames but I haven't tried it yet.

Hope it helps.

Eagles fan

Posted

I have a real-time sign in system that tracks who's logged in to work at our tutoring center via CDML. The results of who's at work was created along this line of reasoning:

1) If a record has a time in and no time out, then you are logged in. Print your name to a field.

2) Make a value list based on that field that has names of those who are logged in.

3)Insert the value list on the webpage. Count the amount of people logged in on the valuelist using CDML tag [fmp-Currentfoundcount].

You could do the same exact thing except that you could modify the list to put the people with the most logins or whatever instead of whether or not they are logged in.

As for the results on the first page idea, I have this valuelist of who's looged in on my first page. It is totally possible, and is refreshed every 30 seconds via meta tags like you had suggested. The kewl thing about web served databases (especially FM ones) is that you are really only limited by your imagination.

I'm thinking of trying the new prototype in IE for the next generation of my database using .HTA . Have you ever heard of it?? it supposedly will give your webpage the same freedom as a .exe application, but I heard it has a lot of limitations. Ok, thanks!!

Posted

thanks for the swift replies!

sktajiri , I have no problems to get the info on the mainpage: I have the mainpage opened in a single-frame window, with a fmp-path (-findall) as a link to the startpage. All other summaryfunctions are done with inlineactions. Thats all working fine.

However, I have a selfrelationship that counts all the codes: All 'A' codes are counted, all 'B' codes are counted etc. I can do a search with inlineactions using that info and I get a nice result (with -max=5)... But it shows ALL 'A' codes in the <<top 5 ranking>> instead of putting a single 'A' on the first position, a single 'B' on the second etc. So I need to - somehow- omit the duplicates or something. I just don't get it.

What I want it to look like is:

Position:

| 1 | A (counted 10 times)

| 2 | C (counted 8 times)

| 3 | K (counted 2 times)

etc..

Kittrik, THANKS! (and no, i havent heard of .HTA, I'm on a mac and try to avoid anything ending with .exe smile.gif )

Greetings

JP

Posted

You can solve this problem if you had the two identical databases I talked about. Use one (DB1) for counting the logins and the other for actually taking in the logins (DB2). You can search the data in DB2 using the data in DB1 through related fields and have DB1 compare the login totals.

Posted

Hi, again..

(1st page) yeah, sorry... I didn't know about your CDML link to that page but that's kinda what I meant anyway. I guess Kittrick/Diaz got his to work OK but when I tried the self-refresh, I hadn't liked how it worked. BTW, I remember moderator Vaughan recommending a -findany vs. a -findall in cases like this cuz it's a little quicker.

(top 5) I haven't used self-relationships so maybe you know better than I but I still think you need either a 2nd db like Diaz says with a single field tracking each user's record count. I follow your calc idea but can't think of how to do it that way because those counts aren't stored and I currently don't know how to display them. As you know, you're getting all A's cuz it's displaying A's records.

Maybe one of the forum's "heavyweights" will offer a better tip if Kittrick/Diaz's doesn't help. Sorry. frown.gif

Posted

Heya sktajiri , no need to be sorry about anything - any help I can get on this is welcome. I'm still searching and testing myself and I've ruined a few db's with some script now - hehe - but I'm still not there.

Its one of those things you see on almost every other PHP/ASP powered (auction)site and it looks soooo darn simple. But I guess it's not wink.gif

Any helpful hints are still welcome smile.gif

Thanks

Posted

Heya,

me again. I've fixed the problem and have my 'top-5' (or 10 or whatever) working. And is was as simple as I thought it would be - however I was creating difficult calc and stuff while it's just ONE related link between my db's... go figure.

This is how: (I'll try to explain as clearly as I possibly can ok).

I have 2 DB's: SignUp and Tickets. In order to add records in 'tickets' users have to signup. I use the name they enter as a login and I do a count in 'tickets' of all records they have created (the selfrelationship). In 'signup' I've made a lookup to the countingfield in the 'ticket' DB, and placed that (related) field on my 'signup' DB.

It will only show ONE number since there is only ONE user in there with that loginname.

An inlineaction to the SignUp DB and sorting on the lookup field makes a nice top 5 list, or 10, or 20.....

Thank you all for helping me smile.gif

JP

This topic is 8108 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.