[Plugin: Runners Log] Running gear statistics
-
Posting from frold, see original thread
Further plans:
One major plan is actually the one you mention: being able to track your gear and see for how many km/miles you have used your shoes etc.But for that I need a new way to put in data.
I would like to be able to add and delete gear and have the gear eg sorted in different categories.Eg: using:
https://dev.iceburg.net/jquery/tableEditor/demo.php
with
https://tablesorter.com/docs/#DemoBut Im not sure if I have those skills…
-
I think we have breakthrough here… ??
More info will come ??
cool ?? , I’ll check the new version this evening, first have to take another exam this afternoon ??
Good lock – Im working on it right now, so please re-download the latest dev-version tonight
thanks, worked well, not as good as last week but I think the result is going to be satisfying ??
ok, the gear manager is quite cool ??
Not as fancy as the examples above, but I think that’s exactly the way it should be. And it looks quite nice!Sueggestions:
*I would just make it possible to skip some values when entering new gears, since I lack of information about the buying date of my running shoes.
*Directly accesing the table from the menu on the left would be cool (now I have to select the manager where I can add new stuff and then select the table)
*Usage of different kinds of gear and make gears available to select when entering a new blog entry (I just added this two points to get a complete list, I know we discussed it before ?? )I think the direction of developement is very good and it’s really paying off to put time in this pluin ??
Cheers Eyeless
Optional fields
Now Price and Distance is optional.Its more difficult to handle optional Boughht date. Because either but day, month and year have to be specified or non of them. Im not able to add that kind of support :S So I kept that mandatory.
Regarding Distance – that field is a little more tricky and I need to find a solution. Distance should only be editible when you add the item because after that the distance is increased every time you track the use of the item (that’s the plan). Else there should be 2 distance fields. One you can edit and one there is set to 0 from start and increased every time you use the item. In the gear-list the distance could be the sum of the 2 distances. What is the best solution?
Accessing table
I dont understand this issue… What do you want? Do you miss being able to easy access “items in use”, “item not in use”?
In my localhost you get the gear-manager table when you press the “gear manager icon” in the left. As standart you get the list of items in use.Howto integrate the gear list to the meta-box
Well Im sorry to say but I havent found a solution for that yet. One solution could be a multi-select-drop-down-menu in the meta-box. Here you have list of the “active” items in the gear list. When you select the items the item-id is stored in the data base related to the metabox. But I dont know if I have those skill, yet. And Im not sure howto handle multi values in a database field. If more items is selected how to store the data best? As a list 1,3,5 – If item with it 1 and 3 and 5 is select. Hmm we may take one thing at the time.
First I want to finish the backend ??Now Price and Distance is optional.
cool ??
Because either but day, month and year have to be specified or non of them.
I thik I don’t understand the problem here, I thought that if I know the date I add it and if not I let the three fields empty. May you describe the problem a bit ?
In the gear-list the distance could be the sum of the 2 distances. What is the best solution?
IMO this, using two distance fields!
Accessing table (…) As standart you get the list of items in use.
Sorry you are right, last night I thought the standart view was “adding a new gear”…now it’s working, maybe it was a little late sorry for that 0:-)
Howto integrate the gear list to the meta-box
(…)
First I want to finish the backend ??Sure! ??
(An idea could be to create anoter field at the gear-database aka kind like shoe, shirt etc. and for every kind a new drop-down-menu in the meta-box is added [hope you dont wear to much ?? , besides this, storing lists in single DB fields is IMO not good corresponding to runtime, since by this you may delete the advantage of using a DB ])
Cheers Eyeless
About optional bought date
Well, Im not sure to solve howto control he fields. What if the user enter a bought year and not a day and month? Howto handle that?Meta-box
I still dont know howto do this best – but a field per category was a solution but it could result in tons of fields where you have to choose item from a dropdown menu. That is a very user-unfriendly solution.Need to think a little more about that :S
If you have time I – and want to – I might need some help finishing the rest of this add-on.
Im a little stocked here :S
sure ??
didn’t get to far with the weather since my girlfriend wanted to spend the day after my exams with me, but now there is some more time!
What’s up? where get you exactly stuck? I’ll have a look at your sources tomorrow, just make your current state and the next step clear to me (as I have seen you already realized the two distance fields ?? )
Cheers Eyeless
Thanks!
Well I think the backend is pretty much done. Maybe I should add a category field, but I dont think we need that one.
I have started coding a [runners_log_gear] plugin where you specify the id like [runners_log_gear id=”2″] to set in the given gear. You find the id in the gear manager list. [runners_log_gear] should give you a list of all you gear that are IN USE. I should be able to do that part.
The problem is:
The meta box
I think the best solution would be that a select box for every item in use is added in the meta box. The user then “check” which items he have used on the course. Im not able to code that :S
The use should be stored in the database related to the meta box like the other meta box fields: pulse avg, time etc.In the gear list database we should have a new field: gear_distance_calculated. gear_distance_calculated should be the sum of the distances the item is used in wordpress. In other words this field is updated every time you use your item (when its cheked in the meta box). The total distance for the item should be: gear_distance + gear_distance_calculated. Does it make sence? In this way gear_distance is a start distance – if you item isnt brand new.
Im not able to write that mysql to update gear_distance_calculated.
Maybe I should add a category field, but I dont think we need that one.
I think it would help organizing, but I am not sure, too.
The meta box
(…) The user then “check” which items he have used on the course.Ok, I am currently trying to figure out how the Meta Box is working exactly at the weather front. As soon as I get an idea how to realize this I’ll tell you! (might be that the temperature is going to be a little bit fancy ?? ).
Anyway, for resolving the second problem I consider this as solved ??
The total distance for the item should be: gear_distance + gear_distance_calculated. Does it make sence?
Yes it does!
In the current version I am unable to create a gear table so I just can assume the available table-columns from source (gear_id|gear_brand|gear_name|gear_price|gear_distance| gear_desc|gear_dateTo|gear_isDone). I consider we have a new column gear_total_distance, that is initialy 0.
Then the SQL for the first entry should be
UPDATE wp_gear SET g.gear_total= m._rl_distance_value + g.gear_distance FROM wp_gear g, wp_postmeta m WHERE $post_id = m.meta_id AND g.gear_id = m.gear_id
after the first usage it would be
UPDATE wp_gear SET g.gear_total= m._rl_distance_value + g.gear_total_distance FROM wp_gear g, wp_postmeta m WHERE $post_id = m.meta_id AND g.gear_id = m.gear_id
…. while I am writing this it would also be ok to use just one column for the whole distance. If a new gear is entered it’s distance is set and every time the second query could be used and just one distance column would be needed. This would lack the information of the run distance before using the plugin but I don’t think that this information is so important.
Does this resolve your problem?
Cheers Eyeless
I dont understand that mysql ?? Its over my level…
First I think we need to add all the gear items in use to the meta box…
When you have a better insight in the meta box let me know ??
I think we need to distance fields in the gear database. Else there could be a problem if the user later edit the distance manually in the gear manager, wouldnt there?
btw: My idea was the way to store it in the postmeta database should be something like _rl_gear_item_$id
Where $id is the of the gear.
Ok, your miracle of the day is online, you went to bed 5 minutes too early ??
Now the gear table is added to the Metabox, have a look at the code should be quite self explaining(If not just ask ?? ).Adapt it according your needs ??
If we change the field “gear_isDone” to “gear_inUse” we could use this directly to select items that should be shown (we just need the opposite value of what we have currently).Ok, at this point I am back at the weather front ??
Cheers Eyeless
Heheh cool.
I will look deeper into this later this night…
Thanks for your help!!
Have a nice day..
- The topic ‘[Plugin: Runners Log] Running gear statistics’ is closed to new replies.