Code

Discussion on ThumbsUp

Discussion on ThumbsUp

By
Cart 1,995 sales

GeertDD supports this item

Supported

This author's response time can be up to 10 business days.

753 comments found.

How many k is the file? I’m running a site that already has a lot of js and loads slowly, so I’m only able to use this if it’s a fairly small script…

ThumbsUp has been built in such a way that only the minimal required javascript and CSS will be loaded. In short here’s how it works. You include the thumbsup.js.php file in the head of your HTML document. That file is 2.2 kB and it contains quite some comments (like all files do) to keep everything readable. Pulling it through JS Minifier only about 0.9 kB is left. And that still can be gzipped.

The thumbsup.js.php scans your HTML and looks for ThumbsUp items you’ve created. If it finds any, the corresponding javascript and CSS file will be loaded (once for each template style in use). File sizes (and images) depend on the actual template style, but for the js and CSS they’re all served gzipped at 1 kB or less (demo site results for all six templates).

Moreover, for the images used to create the ThumbsUp buttons, CSS sprites are used to limit HTTP requests.

Hello, I have a little problem. I can see the “thumbs up-down” on my page but it isn’t styled at all.

Thanks in advance

This is most probably a problem caused by a wrong setting for THUMBSUP_WEBROOT in the config file. Please have a look at that. Let me know if you need further assistance.

Yes, the problem was at defining THUMBSUP _WEBROOT in config.php. Solved now! Thank you for this script at for the assistance!

It is me who thanks you. You’re welcome. :-)

Hey i’ve just brought this, thanks for the great script but i’ve got one issue.

Most of the time you can vote up or down, but with the Digg style icons you can’t. I could probably put this in myself without too much bother, but their aren’t the necessary graphics available.

Do you have a thumbs down version of this?

http://www.geertdedeckere.be/lab/themeforest/thumbsup/thumbsup/templates/digg-thumbs/images/sprite.png

Also, the description quite clearly says that you’ve included layered photoshop files but I can’t see any in there.

Thank you. Sorry if the description is not clear, but the “layered Photoshop files” text is a link to the graphics files at GraphicRiver: http://graphicriver.net/item/thumbsup-graphics/51644

I was wondering does this prevent the same user from voting more then once, per form?

Yes, the script takes reasonable action to prevent double votes. You can never completely prevent it, though. A cookie is set containing the IDs of each item that was voted for. Also, you can turn on IP checks in the config file.

Sweet, thanks.

I’m sorry if this has already been asked—I tried to read as many comments as I could but there are just way too many.

Is there a way I can integrate this into an existing user-base so only registered users can vote? Maybe using AJAX to retrieve a bool from a php script that checks to see if the user has logged in or not?

Thanks :)

Good question, Nathan. The user floppydrivez asked this before and he was able to pull it off. You will need a bit of PHP skills, though. Please see this comment and the ones following it. Thanks.

------ Great script! five stars

Hi GeertDD,

Thanks very much for your patience. Your advice worked – I now have everything working correctly.

It’s really nice to receive such prompt support when purchasing scripts like this. This will be the first place I look for scripts in the future.

Thanks!

Thank you. :-)

I’m using mini-thumbs template, I have been edited images and added some text such as:

2 like it / 1 hate it

2 & 1 is positive_votes and negative_votes value.

I would like to update result instant, I mean, when click vote button, it will load loading images and update the votes value instant. It works same as yes-no template. I dont know how to edit the code and jquery. Could you help me with the code? Its important for me.

Thank you

Hi, tkien. I hope you understand I can’t provide the changes you request as free support. Feel free to contact me via e-mail.

Hi there,

I’m sure this will be easily fixed by someone who knows what they’re doing!

I believe I’ve followed all of the steps correctly, however I’m getting

setup(‘name’, ‘template’)->render() ?>

show up on my webpage instead of the digg thumbs up.

I’m wondering if part of the problem is that my page is .html not php. Grateful for some assistance please.

Thanks

Thanks for the reply. I’ve changed the file extension to .php, and now I’m getting the following error:

Fatal error: Uncaught exception ‘SQLiteException’ with message ‘SQLiteDatabase::__construct() [-construct’>sqlitedatabase.-construct]: unable to open database:

I’ve checked the permissions on the database file as mentioned in the guide, and it is set to 666. The error message is appearing on screen at the location where the <?php $thumbsup->setup(‘Name1’, ‘digg-thumbs’)->render() ?> call is made.

Sorry to need so much help, but I really want this to work.

Thanks!

Ok, so I’ve solved that problem, now I just can’t get the images etc to display.

I’m not getting any errors on the page, but all I’m seeing is: Votes up: 1 / Votes down: 0 in plain text, with not associated images.

Please help.

Be sure to check your THUMBSUP_WEBROOT setting in config.php. If it is wrong, the CSS and javascript files won’t be loaded, and that is why you are seeing it in plain text.

How do I add text after +1 or -1. I want to change to:

+1 -> 1 people like it -1 -> 1 people hate it

I want to use mini-thumb template.

thanks

You can edit all the templates any way you want. Navigate to the template file for the mini-thumbs, to be found at: thumbsup/templates/mini-thumbs/html.php

In there, you’ll find an element called <strong class="votes_balance">. With a bit of PHP knowledge you should be able to make the desired change quickly.

So, how to sort the rating? I mean, how to show most rated item?

This cannot be done out-of-the-box currently (please see previous comments too). The solution is to write a custom query.

Totally worthwhile purchase. The integration was amazingly simple, skinning was a breeze, the admin area is a nice bonus, SQLite was a good choice, INSANELY neat code, the list goes on and on.

Easily one of the best items I’ve purchased yet.

This just makes me smile. Thank you! :-)

Hi GeertDD, can you take a look at my comment a few posts above?

GeertDD, thank ou very much for your help, and fixing problem. It was my fault! Great mob and support, thank you very much A+++++++++ :))))

You’re welcome. :-)

Thank you for your reply GeertDD. But unfortunetly same error :( http://shop.kindermix.ru/demo.php

Does anyone have a problem with it showing up on IE till you refresh? You visit the page, its not there – refresh it is. Revisit the page, it’s not there… refresh it is.

That’s a rather weird problem, Dean. I’ve never experienced such a problem, or heard about it. It may have something to do with the way the browser’s cache settings are configured. Try playing around with those for a moment. Also, you’re not using IE6 , I hope?

No it’s IE8 . No caching settings unusual.

Dear GeertDD. Thank you very much for this add-on, it’s cool and great thing! i read all documentation, but still have some little problems with installing. I don’t want to say that it’s broken or something, maybe i just make something wrong? just say here what i made step by step: 1) Buy your ThumbsUp thing and ThumbsUp PSD with layers. 2) Download and read all documentations. 3) Read this more up-to-date readme: http://www.geertdedeckere.be/lab/themeforest/thumbsup/demo/#install 4) Edit Config.php: define(‘THUMBSUP_WEBROOT’, ’/thumbsup/’);

define(‘THUMBSUP_DATABASE’, THUMBSUP _DOCROOT.’http://shop.kindermix.ru/thumbsup/database/thumbsup.db’);

date_default_timezone_set('Europe/Moscow');
'admin' => '9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684',

(password: pass)

5) Save and Start uploading: thumbsup and demo folders. Change chmod to 666 (RW RW RW ) for /thumbsup/database/ folder

6) Next spep – Include. Open Dreamweaver, and create new .php file and save it as http://shop.kindermix.ru/demo.php

Add this: <?php include ‘http://shop.kindermix.ru/thumbsup/core/thumbsup.php’ ?> on the top of page. So now it looks something like this: <?php include ‘http://shop.kindermix.ru/thumbsup/core/thumbsup.php’ ?> <!DOCTYPE html PUBLIC ”-//W3C//DTD XHTML 1 .0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

Download jQuery (>=1.3) and upload to /javascript/jquery-1.3.2.min.js

7) so i add in the head of my http://shop.kindermix.ru/demo.php this code: thumbsup/core/thumbsup.js.php”> 8) in body, i add this code: <?php $thumbsup->setup(‘Name1’, ‘digg-thumbs’)->render() ?> 9) Reload demo.php and check ThumbsUp.

See this error: Fatal error: Call to a member function setup() on a non-object in /www/vhosts/shop.kindermix.ru/html/demo.php on line 37

Everything what i made: i made use your instruction, EXACTLY what there said, what my mistake, what i made wrong :) ? Kind Regards, Nikita.

In config.php, try defining THUMBSUP _WEBROOT to ’/’ instead of ’/thumbsup/’.

If that doesn’t work, please contact me personally via e-mail. Thanks.

I thought I would save myself some time and buy this script. It seems to function very nicely. The coding is superb, clean, organized.

I highly recommend this script to others. However, I don’t think I’ll be able to use it due to the structure. I’d like to be able to sort the votes and, after taking a quick look at the script, I don’t see a simple way of doing this the way I’d like to. The site I’m using it on has over 130,000 comments. Other than users being able to see what’s popular, I’m able to derive no use from it. It’d be nice if I were able to grab some analytics from it for myself.

Like I said, though, do not hesitate to buy this script. It’s of the highest quality. I’m sure I’ll be able to use it on one of my other projects sooner or later.

Hey, thank you for comment, mozunk! Great feedback about the code itself. Good to know some people are also looking under the hood. Quite some effort has been put into it to keep everything clean and organized. :-)

I can understand your request for sorting on popularity. Once again, though, I’d like to point to this comment I made earlier. It is quite tricky to get proper sorting. That said, since the code is readable, you are free to create your own queries to pull anything out of the database the way you like it. I could understand that would be no option for some neither since you need some PHP and SQL knowledge.

Also, not sure if you are still updating this project but ‘order by votes’ would be nice in the admin area.

good suggestion, the vote still counts so I guess it’s fine.

Thanks!

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey