Giter Site home page Giter Site logo

msoftware / awesomstar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pinceladasdaweb/awesomstar

0.0 2.0 0.0 1008 KB

Awesome (star)rating system with PHP, MySQL and pure JavaScript.

License: MIT License

JavaScript 31.48% PHP 45.76% Smarty 6.31% CSS 16.45%

awesomstar's Introduction

Awesomstar

Awesome (star)rating system with PHP, MySQL and pure JavaScript.

Getting Started

# Get the latest snapshot
$ git clone --depth=1 https://github.com/pinceladasdaweb/Awesomstar.git

Add the following javascript in your page:

<script src="path/to/awesomstar.min.js"></script>
<script>Awesomstar.init();</script>

The script depends on the following HTML markup:

<span class="rating" data-rating-id="1" data-rating-val="3">
    <input class="star" type="radio" name="star" id="star-1" value="1"><label for="star-1">1</label>
    <input class="star" type="radio" name="star" id="star-2" value="2"><label for="star-2">2</label>
    <input class="star" type="radio" name="star" id="star-3" value="3"><label for="star-3">3</label>
    <input class="star" type="radio" name="star" id="star-4" value="4"><label for="star-4">4</label>
    <input class="star" type="radio" name="star" id="star-5" value="5"><label for="star-5">5</label>
</span>

The values below are sent from the database for the JavaScript to update the status of the rating of each element:

Value Description
data-rating-id The id of the element in the database.
data-rating-val The average value of the vote.

After the user clicks the value of the desired rating, is sent via POST to the back end the following values:

Value Description
id The id of the element in the database.
rating The value of the rating ranges from 1 to 5.

Contributing

Check CONTRIBUTING.md for more information.

History

Check Releases for detailed changelog.

License

MIT

awesomstar's People

Contributors

pinceladasdaweb avatar

Watchers

Michael jentsch avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.