Collecting user/editor data
Permalink
Hey, c5ers.
I'm developing a library of process documentation that will be updated regularly by the library's users. I know that there are tools like Google Analytics to track page views, but I'm wondering if there is any functionality either within c5 or an add-on that would allow me to collect the following data from my users:
1. Which pages the user has edited
2. How many times the user edited a page
3. How long the user spent editing specific pages
We are hoping to implement a bonus/reward system for users that contribute the most to our library, and having the above data would help us identify how much each user is contributing.
I'm not a coder, so I'm not even sure where to start looking for this information.
Thanks.
I'm developing a library of process documentation that will be updated regularly by the library's users. I know that there are tools like Google Analytics to track page views, but I'm wondering if there is any functionality either within c5 or an add-on that would allow me to collect the following data from my users:
1. Which pages the user has edited
2. How many times the user edited a page
3. How long the user spent editing specific pages
We are hoping to implement a bonus/reward system for users that contribute the most to our library, and having the above data would help us identify how much each user is contributing.
I'm not a coder, so I'm not even sure where to start looking for this information.
Thanks.
I think that tutorial is along the lines of what I'm looking for, but my understanding of code is limited enough that while I see what's being done there, I don't really understand yet how to modify it to give me the search form and results page I need. Let me see if I can summarize what I see in that tutorial and use that to ask the right questions (hopefully).
1. I need to create a Search form block that can be added to a single-page view. This form should be accessible only to my supervisors group, who can filter by a specific user from X date to Y date, pulling page information including name, start edit, and stop edit times for the specific user.
Example: Supervisor Jim access the Search form and selects Bob from the Filter by User field. He then sets the to/from dates to encompass the last month.
2. I need to create a Results block in this single-page view that will output the results from the search. The results should be ordered by page name and should include the edit times. The final column should display the total time spent editing the page.
Example: Column 1: Document name -> Process Document #57
Column 2: Start Edit -> 08:00
Column 3: End Edit -> 13:00
Column 4: Total Time -> 5 hours
3. I need to create a custom class that extends the PageList class and store the custom class in the models/ directory. This is where even my high-level understanding of the scenario breaks down.
4. I need to create a controller for the single-page view that references my custom class.
---
I guess my first question is whether I can use the code in that tutorial as building blocks for what I want to do, since the examples look much like the end result I'm looking for. I would obviously have to change labels and load the right helpers (the User Selector helper in the Search form, for example), etc.
The biggest stumbling block is my lack of understanding of the databases and the commands that can be used to pull information from them. I've looked through the API documentation a bit, but I'm not sure if the data I want to discover (like the timestamp for when a specific user started editing a page) is even present, much less how to access it.
I'm not wanting someone to write up the code for me by any means (primarily because I recognize that's a serious imposition on people, but also because I need to understand how to do this), but some pointers in the right direction as far as what functions/commands I should use (for example) would be greatly appreciated.
I hope that's not too much to ask.
1. I need to create a Search form block that can be added to a single-page view. This form should be accessible only to my supervisors group, who can filter by a specific user from X date to Y date, pulling page information including name, start edit, and stop edit times for the specific user.
Example: Supervisor Jim access the Search form and selects Bob from the Filter by User field. He then sets the to/from dates to encompass the last month.
2. I need to create a Results block in this single-page view that will output the results from the search. The results should be ordered by page name and should include the edit times. The final column should display the total time spent editing the page.
Example: Column 1: Document name -> Process Document #57
Column 2: Start Edit -> 08:00
Column 3: End Edit -> 13:00
Column 4: Total Time -> 5 hours
3. I need to create a custom class that extends the PageList class and store the custom class in the models/ directory. This is where even my high-level understanding of the scenario breaks down.
4. I need to create a controller for the single-page view that references my custom class.
---
I guess my first question is whether I can use the code in that tutorial as building blocks for what I want to do, since the examples look much like the end result I'm looking for. I would obviously have to change labels and load the right helpers (the User Selector helper in the Search form, for example), etc.
The biggest stumbling block is my lack of understanding of the databases and the commands that can be used to pull information from them. I've looked through the API documentation a bit, but I'm not sure if the data I want to discover (like the timestamp for when a specific user started editing a page) is even present, much less how to access it.
I'm not wanting someone to write up the code for me by any means (primarily because I recognize that's a serious imposition on people, but also because I need to understand how to do this), but some pointers in the right direction as far as what functions/commands I should use (for example) would be greatly appreciated.
I hope that's not too much to ask.
Okay, I figured that before I started worrying about how to modify the elements present in Andrew's tutorial to fit my needs, I should see if I could get his example working first and then modify from there.
Big-time failure.
I guess I don't know where each segment of code is supposed to go. Here's what my output looked like in my single page:
label('pageID', 'Filter by Page')?> selectPage('pageID', '')?> label('dt_from', 'Between')?> date('dt_from', '')?> label('dt_to', 'And')?> date('dt_to', '')?> label('num_results', '# Results')?> select('num_results', $numResults)?> submit('search', t('Search'))?>
0) { ?>
checkbox('uID[]', $ui->getUserID())?> getUserEmail()?> getAttribute('first_name')?> getAttribute('last_name')?> getLastOnline() >0 ?date('m/d/Y g:i a',$ui->getLastOnline()):'Never')?> totalVisits?>
displayPaging(); ?> No results found.
I'm not sure what I've done wrong. I created the single page .php file in the single_pages directory and added the code Andrew listed for the search functionality and the results display. I added a page controller file with the same name in the controllers/ directory and put in the code Andrew listed. Finally, I created the user_visited_page_list.php file in the models/ directory. Is there a step that wasn't mentioned in the tutorial that I missed?
EDIT: Forgot to attach the files I'm working with. They may look like the product of a monkey with a brain tumor. Just fair warning.
Big-time failure.
I guess I don't know where each segment of code is supposed to go. Here's what my output looked like in my single page:
label('pageID', 'Filter by Page')?> selectPage('pageID', '')?> label('dt_from', 'Between')?> date('dt_from', '')?> label('dt_to', 'And')?> date('dt_to', '')?> label('num_results', '# Results')?> select('num_results', $numResults)?> submit('search', t('Search'))?>
0) { ?>
checkbox('uID[]', $ui->getUserID())?> getUserEmail()?> getAttribute('first_name')?> getAttribute('last_name')?> getLastOnline() >0 ?date('m/d/Y g:i a',$ui->getLastOnline()):'Never')?> totalVisits?>
displayPaging(); ?> No results found.
I'm not sure what I've done wrong. I created the single page .php file in the single_pages directory and added the code Andrew listed for the search functionality and the results display. I added a page controller file with the same name in the controllers/ directory and put in the code Andrew listed. Finally, I created the user_visited_page_list.php file in the models/ directory. Is there a step that wasn't mentioned in the tutorial that I missed?
EDIT: Forgot to attach the files I'm working with. They may look like the product of a monkey with a brain tumor. Just fair warning.
http://andrewembler.com/posts/custom-concrete5-user-reports/...