Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Metrics on a front end page
- This topic has 12 replies, 3 voices, and was last updated 4 years, 11 months ago by logan.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
November 25, 2019 at 6:47 am #234570nitwayneParticipantHi, We would like to design a webpage that displays the number of student or people registrations, student registrations based on different dates/months, based on different colleges. Also, the number of students who have finished particular courses and other things. This is an immediate requirement for us to show it to people about all our stats so far. And we want this to get updated in real-time. Please helpNovember 25, 2019 at 7:00 am #234574nitwayneParticipantThis reply has been marked as private.November 25, 2019 at 12:55 pm #234648Anshuman SahuKeymasterWell please tell about the colleges ? We have course system not college system. We can make sure of location taxonomy for that? and can bring the stats based on this . About live stats for this we would need to run an api call from server which will fetch the details from databsae in loop. this would need a strong server as the queries would be bit heavy .November 25, 2019 at 1:02 pm #234651nitwayneParticipantThis reply has been marked as private.November 26, 2019 at 3:02 pm #234809Anshuman SahuKeymasterWell writing the query to fetch the desired is the whole job actually. It cannot be done with single query it will require many queries and code which would take time . Provide time to write that code for you .December 3, 2019 at 12:27 pm #235673nitwayneParticipantThis reply has been marked as private.December 4, 2019 at 12:57 pm #235827loganMemberno. of registrations SELECT COUNT(*) FROM wp_users where user_registered BETWEEN '2019-10-01 07:15:57' AND '2019-10-09 12:41:34' no. of registrations based on the location or college $location = "JAKARTA"; $db_query = “SELECT COUNT(user_id) FROM wp_bp_xprofile_data WHERE field_id = 33 AND value = "" .$location ."""; buddypress profile fields . no. of students who have completed different courses: what do you mean different here, is it a group of courses? no. of unique users who has taken courses SELECT COUNT(DISTINCT(u.user_id)) FROM wp_usermeta as u LEFT JOIN wp_posts as p ON p.ID = u.meta_key WHERE p.post_type = 'course' AND p.post_status= 'publish'December 4, 2019 at 7:42 pm #235861nitwayneParticipantThis reply has been marked as private.December 5, 2019 at 8:05 am #235917loganMemberDear friend, this is direct SQL codes to your database, if you are ignorant of these codes then you can hire a freelancer to achieve your desires. good luckDecember 10, 2019 at 11:44 am #236465nitwayneParticipantI'm aware of the SQL codes or queries. I wanted to know how I can display it on the front end of the page. Should I use PHP code snippets or code shortcodes on the frontend page to display or what do you suggest? Because I don't want to go to PHPMyAdmin every time to run the SQL queries.December 11, 2019 at 7:47 am #236548loganMemberHello, the shortcode is the best idea. it will become the reusable snippet. you can use this anywhere in post/pages/course/ quiz etc.December 12, 2019 at 9:55 am #236675nitwayneParticipantThis reply has been marked as private.December 13, 2019 at 8:00 am #236783loganMemberHello, this is direct SQL queries. you need to make the database connection then use it in the php codes. or use WordPress codex about the database: https://developer.wordpress.org/reference/classes/wpdb/ if we will write the codes it will come under the customization request for a nominal cose of 79$. this is a complex query and it will take time and debugging.
-
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘Metrics on a front end page’ is closed to new replies.