Custom Concrete5 User Reports

Permalink
Hi, folks.

I've been trying to develop some custom reports regarding user edits, and I've gotten some good advice and assistance from several people here. Jordan pointed me to Andrew's tutorial regarding custom reports.

http://andrewembler.com/posts/custom-concrete5-user-reports/...

It's a pretty clear tutorial, even for a guy like me who has zero coding knowledge, and so I've been trying to implement his example just to make sure I can get it up and going before I try to modify it to fit my own custom reporting needs.

Based on Andrew's tutorial, I created a single page for my custom user report. I also added a controller and the custom UserVisitedPageList class in the models directory. I'm pretty sure I followed the instructions in Andrew's tutorial to the letter. Once I added the new single page in my site, I went to the page to see if I'd managed to replicate what I saw in Andrew's example. Apparently, I did not. I ended up with a jumble of text that looks like this:

label('pageID', 'Filter by Page')?> selectBird('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 pretty much up against a wall here. I haven't been able to find any help on this type of issue in the forums, and I don't see it in the documentation anywhere. So I'm hoping someone will have the time or inclination to give this a glance and see if they can spot what I'm doing wrong. I've attached each of the files I created as .txt files.

Thanks.

3 Attachments

campbell
 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Looks like you're using php short tags in your code ("<?" and "<?=" instead of "<?php" and "<?php echo "). Change all of the "<?" to "<?php ", and all of the "<?=" to "<?php echo " and it should work.
Also, I'd suggest getting in touch with Andrew and letting him know that using short tags in tutorial code is a bad idea for this exact reason, and kindly suggest he update the tutorial code to use normal php tags -- will save others a lot of trouble in the future.
campbell replied on at Permalink Reply
campbell
Okay, that helped, Jordan.

When I selected a page, entered dates, and clicked "submit," however, I received the following:

Fatal error: Class 'UserList' not found in C:\wamp\www\concrete\models\user_visited_page_list.php on line 4

Any ideas why that might have happened? The UserVisitedPageList class extends UserList...
jordanlev replied on at Permalink Reply
jordanlev
Try adding:
Loader::model('user_list');

above your class definition (just thinking off the top of my head -- I haven't read this tutorial or know how it works exactly).
campbell replied on at Permalink Reply
campbell
Heh, well, that took care of the fatal error, so that's a step in the right direction.

Unfortunately, the output ended up being just a checkbox in the footer of my page. Very odd.

Anyhow, thanks for your help again, Jordan. I know you're pretty busy, so I'm hoping that Andrew will be able to respond on his tutorial page.