We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
A Like based Reputation system with Leaderboard
Topic Started: Feb 19 2016, 12:54 PM (1,577 Views)
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
Preview Link: http://s4.zetaboards.com/EpModz3/index/

This code will add a leader board at the bottom of the index page telling you the top ten users. (Who has been liked the most.)
You can like/dislike each post in a topic by clicking the links beneath each post.
You can view each user's total rep in their post details in topics and in profiles.

Admin CP -> Board Template -> Above the copyright:

In the beginning of the following code at the beginning you will see CSS with descriptions that you can change to give unique style to the new sections for liking/disliking. Also if you are going to host the PHP after this code (the next spoiler) then you will need to change where it says (also near the beginning of the code) var linktoexscripttv = 'http://epsilekt.netai.net/ltp1.php'; to say the link to your external PHP file instead of mine. The code will operate just fine if you continue to use my server, but if you'd rather your own change that. Edit var liketexttv = '(Like)'; and var disliketexttv = '(Dislike)'; (also at the beginning of the code) to change (Like) and (Dislike) to buttons for liking disliking. <img src="http://www.imagehost.com/yourlikebutton.png" /> is what you would replace (Like) with for example. Also as an added note at the bottom of this code you will see where it has an iFrame linking to my server. You can remove the iFrame if you want to. That only loads on the index page of your forum to keep the free host from closing due to inactivity. It's just a blank page that lets the webhost know that at least 10 users have used my website within 30 days.

Spoiler: click to toggle

The next spoiler contains the PHP code for the script. You do not need to worry about this if you are not going to be using your own server. At the beginning of this code change where you see the parts in all caps (there are four) to the correspoding information. The good thing about using your own server is that it will allow you to customize the code even further if there are things you would rather change.

Spoiler: click to toggle
Edited by Epsilekt, Feb 29 2016, 12:28 PM.
Offline Profile Quote Post Goto Top
 
ERI619
Member Avatar
Member
[ *  * ]
Thank You Sir for your efforts,i see that you have registered on our forum,please be active :)

Also i tried what you said,but the dislike button isn't going anywhere.Also is there anyway to make the leaderboard on the top just below the shoutbox?Whever i tried to add a like button image,the code stops working,could please post an example code?

I dont want the option marked in red,also the thanks button should appear instead of the field marked in green.Also these buttons need to be moved to the rightside of the post.Also i want to change the text from Leader Board to Top Contributors.I also noticed something else,the leaderboard is showing more than 5 guys,its actually supposed to show top 5 contributors.

Posted Image
Edited by ERI619, Feb 20 2016, 11:17 AM.
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
Yeah I like I said my free hosting server sucks apparently I just overwent my bandwidth. Damn.

I don't know what to do unless somebody knows a better free hosting service.
Edited by Epsilekt, Feb 20 2016, 08:57 PM.
Offline Profile Quote Post Goto Top
 
ERI619
Member Avatar
Member
[ *  * ]
there is hostinger.com,you should try it out.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Just pay for a hosting service, seriously. I pay 40 USD per year and have done for the last 7 years to host AiO/ AiO 2/ Dynamo etc. It really works out in the long run.
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
I found a free service with unlimited bandwidth that does not automatically add crap to the end of PHP files but every time I try to access the MySQL database it just returns a blank page. If I take out the mysqli_connect function then it works again. I'll try to wait a few days to see if it fixes itself given that I just created the account. But it was working before for a second and then all the sudden stopped. Anybody have any ideas?

Edit: Oh no it went back to adding that stupid stuff again.
Edit: Okay I found a new host and everything seems to be working well. It was an older host that I was using before but for some reason forgot about. I think there was a mod I was trying to develop and all of the sudden it would only load a blank page no matter what I typed in but it seems it's fixed now. :) My original post has been updated for the new code (it will only change the file that the JS points to).
Edited by Epsilekt, Feb 29 2016, 12:20 PM.
Offline Profile Quote Post Goto Top
 
momahami
Member
[ * ]
I tried installing it on my own webhost but can't get it to work. I've PMed you the details.
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
All of my endings are waiting to begin.
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
For those of us with... shall we say "size issues" on our board templates... is there a way to store most if not all of this code and then call it?

Like the following, maybe?
Code:
 
<iframe style="width:1px;height:1px;border:0px;" frameborder="no" id="isfiltp1"></iframe>
<style type="text/css">

// DIV that contains all the rating information in the post (not including Like/Dislike buttons)
.tvrating { font-size: 10px!important; }
.tvrating DIV { display: inline; font-size: 10px; }

// DIV for liked user list
.tvrating0 { display: inline; }

// DIV for disliked user list
.tvrating1 { display: inline; }

// DIV for number that post rate value is in
.rifdivtv { display: inline; }

// DIV for where it says Rating:
.ratetitletv { font-size: 10px; display: inline; }

</style>
<script type="text/javascript" src="FILENAME/ADDRESS.js"></script>


Where FILENAME/ADDRESS.js is the web-address of the hosted file that contains the rest of the code
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
While trying to locate other bugs on my forum, I decided to give this code a try in my "test kitchen"... can't get it to work even if it's the only code on my board template.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply