dynamic bootstrap star rating with codeigniter.
UPDATED !!: From many days ago I decided to update all my tutorials with demos and full download link projects , I found this is really helpful ,also found that making this tutorials more descriptive will help to understanding code well so if you see this tutorial be sure that you see the latest updated version of bootstrap star rating with CodeIgniter tutorial.
Note: bootstrap star rating is a part of krajee plugins if you want to read the full documentation or Bootstrap Star Rating Plugin Examples you can show it from here
Installation:
1- Download the project from the bottom link page and extract it in localhost
2- Create new database, name it as (demo)
3- Import tables from application/tables
4- Go to the URL http://localhost/bootstrap_star_rating_codeigniter/
Project structure:
In this app we have
1- Rating controller
In this controller we have two methods Index to show news table with rating and create_rate to insert new rate and Clear_user_rating to delete user rates
2- Rating model
We have :
get_one() This function To select our news by news_id and
get_rate_numbers() This function check if user has rated specfic item or not
get_item_rate() This function get ratings related to specfic item id
insert_rate() This function insert ratings with news_id and user id
update_rate() This function update ratings with news_id and user id
delete_user_rating() This function delete ratings of new from all tables by news_id and user_id
5- Global folder
Contains assets file like bootstrap 3 main framework and starter theme with JavaScript , HTML , CSS files also contains /rating directory which has all bootstrap rating files
6- Views folder
Which contains views file for our layout templates with header and footer and content
Why I use bootstrap star rating because it was easy to customize and compatible with bootstrap the most popular design framework and it has wonderful documentation to do everything
Also, it was very light ,it uses glyph-icon.
-
Tapfuma ManhangaThe download did not contain the css and js filesReply
-
adminwebeaystep@gmail.comhi Tapfuma yes, because you can download it from their website,just click on the the link in the first line in the articleReply
-
-
Tapfuma ManhangaThank you admin!Reply
-
HassanHi, i can't seem to access the localhost URL to download the file. Can i download the project file through other means?Reply
-
admininfo@webeasystep.comHi , Hassan download link is at end of tutorial,you can download full code exampleReply
-
-
pinkhey..i want to setup this file in to my existing project, ya i have done it but its showing me error like this (Unable to load the requested language file: language/english/rating_lang.php) please please tell me how to fix this.Reply
-
admininfo@webeasystep.comHey pink,you are welcome your error is very easy to fix ,this error because you forgot to copy language file from my project so to fix this go to this path language/english/rating_lang.php and copy this file to language path into your project,after this be sure that you call this lang file with correct path like i do on my controller thanksReply
-
-
pinkThanks a lot Admin..its working Thanks again.Reply
-
Rushi PurohitHow can i do rating for javascript validationReply
-
amri have an erroe rror Number: 1055 Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'demo.ci_news_rating.nrt_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by SELECT * FROM ci_news LEFT JOIN ci_news_rating ON ci_news.ne_id = ci_news_rating.nrt_item_id WHERE ne_id='38' GROUP BY ne_id Filename: models/Rating_model.php Line Number: 21Reply
-
admininfo@webeasystep.comit is about your server configuration,try to fix this by your server adminReply
-
-
ManuHi, I downloaded your code and I would like to know how I can reverse the rating stars selection ? Thks a lot and good tutorialReply