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.

First off I’d just like to say I have very little experience in html, php etc so if my questions have obvious answers I apologize ahead of time.

I am having trouble finding the “database_dsn” to insert into my config.php file. Can you explain where I can find this and/or link me to a tutorial.

Also is the user/password that I use to access PhpMyadmin the same user/pass I enter into the config.php file?

Thank you for your help, it is greatly appreciated.

I have the thumbsup folder at website.com/thumbsup and have updated the config.php with the user/pass and the database dsn (mysql:dbname=freetous_thumbsup;host=localhost’,)

figured out the user/pass and was able to create a new database, However I’m still stuck as it won’t display the thumbs up items I’m not sure whats the issue.

I’m trying to use it on a blank html doc with the code to try and isolate the error

The code to my page is

<!DOCTYPE html>

<?php include ’./thumbsup/init.php’ ?> <head> <?php echo ThumbsUp::css() ?> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js”></script> </head>

<?php echo ThumbsUp::item(‘thumbs_up’)>template(‘thumbs_up’)>options(‘align=left’) ?>

Is there an error/errors in my html or is it still a problem on the databases side

Okay, you need to place <?php include ’./thumbsup/init.php’ ?> even before the doctype or before any whitespace, at the very top of the document. Also, make sure you are inserting the codes in a .php file, not a .html file.

If things still don’t work out then, try enabling debug mode in the thumbsup/config.php file. Look for that option and change FALSE to TRUE. That way, at least an error message should pop up aiding a lot while debugging.

Why did you not include a good complete example with output you only provided a guide for study for PHP coders, I dont know PHP my knowledge only is to substitute variables from examples, If I knew PHP I would write this script my self and I would have to buy it.

I want to list the results from votes

<?php $items = ThumbsUp::items()>orderby(‘votes_total’)>get() ?>

<?php $items = ThumbsUp::items(‘MyVote1’)->get(‘MyVote1’) ?> <?php echo $items ?> How do I display the values?

Hello can you tell me how this would work on your script I have written this for another voting script to output the values

<?php echo “

”; echo “”; echo “”; echo “”; include(“dbopen.php”); $result = mysql_query(“SELECT `item`, (`totalrate` / `nrrates`) AS `rank` FROM `rtgitems` WHERE item REGEXP ‘Bob’ ORDER BY (`totalrate` / `nrrates`) DESC LIMIT 10 “);

while($row=mysql_fetch_array($result))

{ echo “

”; echo “”; echo “”; echo “”; } echo “
Names/td> Ranking
” . $row[‘item’] . “” . $row[‘rank’] . “
”; ?>

that small code gives me the reults of total votes

Sorry if you didn’t find the documentation helpful. I tried to create an example for your specific needs. Some basic PHP skills are strongly recommended, though.

<?php
// Select all ThumbsUp items that contain the word "Bob" in
// their name and order them by vote count (high to low).
$items = ThumbsUp::item('Bob')->orderby('votes_total desc')->get();

// Now you need to loop over the items array in order to
// display them in whatever way you want.
foreach ($items as $item) {
    var_dump($item); // or echo $item['name'];
}
?>

I just bought it for use in a smarty template setup but its not working. Having read a few posts it doesn’t seem to be workable via a smarty setup.

Is there a defined variable and file for the thumbsup that I can call via smarty.

If I have a variable then I can smarty to assign it.

Okay nearly there

$thumbcounter = ThumbsUp::item(‘demo’)->render();

STemplate::assign(‘thumbcounter’, $thumbcounter);

Then in template {$thumbcounter}

Now because my site is dynamic I need make sure every counter is linked to its specific url or ID

done it replaced the ‘demo’ with the url ID :-)

Yeah, right, ‘demo’ was just an example. You can build your own item names using PHP variables if you want to. Good job!

PLEASE PROVIDE A QUICK CODE TO SHOW THE GRAPHICS

I ONLY GET A -1 AND +1 BUTTONS

<?php echo ThumbsUp::item(‘item_name’)>template(‘mini_thumbs’)>format(‘{+PCT_UP}%’) ?>

I WANT THE QUICK CODE FOR THUMBS GRAPHICS AND THE RESULT IN %

I JUST WANT THAT I DONT WANT TO WASTE ANYMORE TIME ON THIS THAT IS WHY I BOUGHT THE SCRIPT

please provide the code for the example in the main page where it says Support for MySQL… …and other databases. All data­base access goes through PDO. Check out the other system requirements before buying.

I WANT TO RUN THIS

<?php echo ThumbsUp::item(‘item_n2ame’)>template(‘thumbs_up_down’)>format(‘{PCT_DOWN}%’)->options(‘align=left&option1=value1’) ?>

BUT IT GIVES ME THIS ERROR 50%

Notice: Undefined offset: 1 in C:\xampp\htdocs\Thv\templates\thumbs_up_down.php on line 15

Notice: Undefined offset: 1 in C:\xampp\htdocs\Thv\templates\thumbs_up_down.php on line 17

Again, please, stop writing in capitals. I just replied to your mail.

Note that the thumbs_up_down.php template was built with two result values in mind (being up and down votes). If you only display a single value (e.g. a percentage), you may need to slightly tweak the actual template as well since there will be no $result[1] in that case.

WHAT IS THE DEFAULT ADMIN AREA USER-PASS WHY DIDNT YOU INLCUDE A GOOD README FILE WITH THIS SCRIPT

I BOUGHT IT TO SAVE TIME BUT NOW IM WATING IT TRYING IT TO MAKE IT TO WORK

ok i found it the answer is there is no default, it has to be activated in the config

It’s a PHP script. A help file is available. Beyond that I commented my code very well. If you go over thumbsup/config.php you’ll get an explanation of each item in there.

No need for writing in ALL-CAPS, is there?

Hello, I love your scripts for my site, but I can not show, only appears.

template(‘thumbs_up’) ?>

http://musicwww.com/?name=Artur_Rojek

I have reviewed from beginning to end the entire manual, but I have no positive results.

can your help plz..

Are you putting PHP code in a HTML file? In that case you’ll see the actual PHP code in the browser which is not good. You need to put it in a .php file.

yep..upps..!!!

Hi,

Can it supports the rich snippets markup formats: schema.org, Microdata, Microformats and RDFa ?

Thanks!

Mick

You can modify an existing template to match the schema.org markup. Styles may need to be updated as well then.

Is it possible to have multiple filters?

for example I have a separate database for both quotes and videos. Could I filter by video and then quote?

yes i’ve read it. I’m sorry I meant to say [video] (topic) then [quote] (topic). The topic word didn’t show up in the initial post because i put it in brackets.

Like going through two different filters (or three if neccessary)

I’m going to go ahead and buy it. i’m sure i’ll probably be able to edit the code if its already not in place, hopefully

Okay, thanks. Let me know if you need further assistance.

Hi, I uploaded this on my server, configured file correctly, I used PHPMyAdmin to place database.sql and after logged in using demo : demo all I see is just a blank page.

Server has PDO set up correctly. ‘database_dsn’ => ‘mysql:dbname=bravo120;host=localhost’,

uncommented two lines: ‘admin_users’ => array( —> An example user with username and password set to “demo”: —> ‘demo’ => ‘demo’, ),

Could you turn on debug mode? Seeing an actual error message would be helpful to pinpoint what exactly is going wrong. You can enable debug mode via the thumbsup/config.php file as well, change FALSE to TRUE.

Hi, thanks for this create little script… Worked just as the documentation explains.

Just one quick question please?

When I add a php variable to <?php echo ThumbsUp::item(’$cpslug’)->template(‘thumbs_up’) ?>

All I get in the items database is $cpref displayed in the name field – But it should read the user name… like user-name

How do I set it so the username is displayed correctly and not the php variable.. Thanks in advance…

Don’t put quotes around the PHP variable, then it will be treated as a string. That should fix it.

Hi, Thanks for your quick reply,

When I remove the quotes from around the PHP variable.

I get a thumbs up error after clicking ? But the correct username is inserted into the database.

Any ideas how to correct this error please, Thanks again.

Sounds like an ajax related problem. Make sure you only use a single (sub)domain, either with or without “www”.

Hi! I’ve got a problem with plugin. I’ve istalled it and displays on my website correcty but when i hover the thumbs up icon or thumbs down icon, the icon disappears. Also when i clicked it, it does not add the value of the vote. I’ve tried offline with WAMP and it worked fine, i dont know what im doing wrong. This is my website: www.compartiendohistorias.com . Thanks a lot!

It worked! Thanks you so much!!

I was including it a little bit above. Thanks again!

Great! :-)

is that possible to share the votes in facebook?

No direct link to Facebook sharing has been built in.

How can I get this to work with WordPress 3.8 and specifically with Headway Themes v 3.6? I host on Rackspace Cloud Sites so should be no issue with MySQL DB setup, etc. Please advise. I already purchased this awhile ago and could never get it to work properly in my WordPress. Now the link to the tutorial online for WP is no longer active. Thanks for your assistance.

Dante

It’s much like the regular install actually. Include the thumbsup/init.php file in your functions.php template file. Then add the necessary CSS and JS files to the header.php file.

Does the thumbsup_vote table ever get used? can you give an example a callback for the userid? can i use the votes table to query all the items a user has voted on? please outline that process for me. thank you =) my end goal is to use thumbsup to track a users “favorite” items. is this possible?

its a great script, for sure but it seems a lot of people are having this question. it appears many times in the comments here and there isnt a working example available. i purchased this script with this functionality as a key point and if it doesnt work I’d like my money back.

please supply a complete config with settings for the writing of uid to db ty

That function should come right after the ”<?php” part at the top of the config file. Of course, it assumes your user ID system is session based and uses the “id” key. You may have to change that to your own setup.

There is anyway to integrate this with Centova Cast 3 to create a TOP 10 songs block?

Thanks.

Uhm, no idea what that is but if it is a PHP app you should be able to integrate it most of the time.

Yes, Centova Cast is PHP, if i purchase, you can help me with the code?

No, sorry. You may be better off searching for a Centova Cast plugin. I can’t offer support for that. Hope you understand, thanks.

Hi! Im installing the script and i’ve changed “database_user” and ‘database_pass’ to admin, but when i go to the admin section it shows Notice: You need to setup an admin user first in thumbsup/config.php in order to be able to login. in C:\wamp3\www\wordpress\wp-content\plugins\thumbsup\classes\thumbsup_admin.php on line 109. I guess it must be an error on the ‘database_dsn’ which i completed with ‘mysql:dbname=mepaso;host=localhost’. Im working on WAMP if it means something.

I want to make a balance field and update it

I’ve solved the last question, i only help with the

Notice: Undefined index: woo_post_content in C:\wamp3\www\wordpress\wp-content\themes\bueno\index.php on line 25

problem

That doesn’t seem like a ThumbsUp related notice, to be honest. You can get rid of that “undefined index” notice by first checking whether $woo_options[‘woo_post_content’] exists by using isset() or empty().

As for the ordering on votes balance, updating your own column is a bit of work. Note that you can also order on vote balance by doing a calculation in the ORDER BY clause (may not be a very efficient query, though):

SELECT * FROM thumbsup_items ORDER BY (votes_up – votes_down)

I want to buy this script….but want to know if it will work on Godaddy shared hosting? Also, can I integrate it easily into Small Machines Forum as a voting system for each post?

Thank You, Lane

It should work on any host with PHP5 and a MySQL database. If you really want to be sure, ask your host. As for the custom integration in existing forum software, that may be tricky. I have no experience with Small Machines Forum.

Hi there, I want to create a new template in order to better integrate ThumbsUp into my pages. What I’d like to do is take the ‘thumbs_up’ template, keep this square layout and add a thumbs down button instead of just the thumbs up. The number appearing above the buttons would be the balance between UPs & DOWNs, proceeded by the + or – sign. The background color would be green for positive balance values and red for negative.

Is this easy to do? Is there a tutorial / guide that could help me with this?

Thx, Mike

Hi there, if the number of votes is lower than a predefined threshold I’d like instead of the actual balance to show something like “Not enough votes…” How could I do that?

Hmm, it is possible but it would require some manual tweaks to the templates and the PHP script. My code is well commented, feel free to play around with it.

Hi! Can you give an example of the code you have to put on your website for the script to work?

Can i add a balance field in thumbsup_items table? Because i want to sort the items by that value. Would that interfiere with the script in any way? Thanks

You are free to add a column to the table, no problem. However, you need to make sure you update the column yourself then.

Thanks a lot.

Is there any guide to install this on Wordpress? The guide on first page is no longer online.

No specific guide available. If you know a bit of PHP it should not be too hard. It’s almost like a regular install.

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