Posted on : 2021-11-08 22:54:08 View Type: public
Sam Smith

How can I make the subscriber dashboard look like the admin panel? number of notes etc.
How can I make the subscriber dashboard look like the admin panel? number of notes etc.
subscriber dashboard page is created as subscriber.php in which top line authenticate_user funciton taking argument as "subscriber" user level.
So you can customize that page as per your requirements.
Please check in top header file where we are bringing # of notes count
This is how we brought that from Notes object
<?php $notes_obj->notes_count(); ?>
You can check dashboard.php if you want to adopt styling of admin dashboard pane in your subscriber.php file.
There is a function in notes object >> Which you can use to get the <li> items of the admin notes limit is 3 in funciton if you want more notes kindly refer notes.php file where we are listing all notes.
$note_obj->notes_widget();
Please make sure you use <ul></ul> around this otherwise that would only return <li elements for each note with heading of note.
Thank you. can i show the last three notes on the dashboard?
Yes please see how we are showing the notes in notes page and you can make same function
just add LIMIT 3 in your notes query.
<div class="container mywidget wc_data" id="wc_data">
<div class="row">
<?php $notes_obj->list_notes(); ?>
</div>
</div>
I think you are talking about this. How can add limit? I dont know php :)
Please go to $notes object in lib >> classes >> notes.php
and copy the function list_notes()
now make its duplicate function with name.
list_limited_notes()
Then in that new function with your Query of SELECT * FROM `notes`
at end of this line you need to add LIMIT 3
that's it... Then where you want to load 3 notes. use this method
$notes_obj->list_limited_notes()
I would recommend you to hire a PHP developer this script is just a base of a project thanks.
$query = 'SELECT * from notes LIMIT 3 WHERE user_id="'.$_SESSION['user_id'].'" ORDER by note_id DESC';
This is wrong
Try following.
$query = 'SELECT * from `notes` WHERE `user_id`="'.$_SESSION['user_id'].'" ORDER by `note_id` DESC LIMIT 3';
Also please check syntax online if you find these type of issues you can find a lot of help online thanks.