Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
issyrocks12 committed Apr 25, 2017
0 parents commit 7a3aa50
Show file tree
Hide file tree
Showing 43 changed files with 3,145 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/vendor
composer.phar
.DS_Store
Thumbs.db
node_modules
bower_components
.idea/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 ReFlar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Gamification by ReFlar

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ReFlar/gamification/blob/master/LICENSE) [![Latest Stable Version](https://img.shields.io/packagist/v/reflar/gamification.svg)](https://github.com/ReFlar/gamification)

A [Flarum](http://flarum.org) extension that adds upvotes, downvotes, and ranks to your Flarum Community!

Upvote and downvote posts anonymously, and reward active users with ranks, and sort posts by hotness.

### Usage

- Just click upvote or downvote
- Posts can be sorted by "Hotness"

### Installation

Install it with composer:

```bash
composer require reflar/gamification
```

Then login and enable the extension.

You can optionally convert your likes into upvotes, as well as calculate the hotness of all previous discussions.

### Developer Guide

You have 2 events to listen for "PostWasUpvoted" as well as "PostWasDownvoted" which both contain the post, post's user, and the upvoter/downvoter.

### To Do

- Add ranking page
- Add notifications
- Requests?

### Issues

- [Open an issue on Github](https://github.com/ReFlar/gamification/issues)

### Links

- [on github](https://github.com/ReFlar/gamification)
- [on packagist](https://packagist.org/packages/ReFlar/gamification)
26 changes: 26 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
*
* This file is part of reflar/gamification.
*
* Copyright (c) ReFlar.
*
* http://reflar.io
*
* For the full copyright and license information, please view the license.md
* file that was distributed with this source code.
*
*/

namespace Reflar\gamification;

use Illuminate\Contracts\Events\Dispatcher;

return function (Dispatcher $events) {
$events->subscribe(Listeners\AddApiAttributes::class);
$events->subscribe(Listeners\AddRelationships::class);
$events->subscribe(Listeners\EventHandlers::class);
$events->subscribe(Listeners\AddClientAssets::class);
$events->subscribe(Listeners\SaveVotesToDatabase::class);
$events->subscribe(Listeners\FilterDiscussionListByHotness::class);
};
49 changes: 49 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "reflar/gamification",
"description": "Manage your users with style",
"keywords": [
"misc",
"settings",
"flarum",
"reflar",
"points",
"gamification"
],
"type": "flarum-extension",
"license": "MIT",
"authors": [
{
"name": "Christian Lopez",
"email": "[email protected]",
"homepage": "https://reflar.io"
},

{
"name": "Charlie K",
"email": "[email protected]",
"homepage": "https://reflar.io"
}
],
"support": {
"issues": "https://github.com/ReFlar/gamification/issues",
"source": "https://github.com/ReFlar/gamification"
},
"require": {
"flarum/core": "^0.1.0-beta.6"
},
"autoload": {
"psr-4": {
"Reflar\\gamification\\": "src/"
}
},
"extra": {
"flarum-extension": {
"title": "ReFlar Gamification",
"icon": {
"name": "thumbs-up",
"backgroundColor": "#263238",
"color": "#fff"
}
}
}
}
9 changes: 9 additions & 0 deletions js/admin/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var gulp = require('flarum-gulp');

gulp({
modules: {
'Reflar/gamification': [
'src/**/*.js'
]
}
});
Loading

0 comments on commit 7a3aa50

Please sign in to comment.