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.

There was a post from a user asking about an error

Fatal error: Call to undefined function sqlite_escape_string() in /home/whitegau/_domains/durangedesign.com/public_html/thumbsup/thumbsup/core/thumbsup.php on line

I found out that if you have the following it tosses this error, why do you think that is?

magic_quotes_gpc = Off

I would be surprised if turning a PHP setting like magic_quotes_gpc on or off, would result in the fatal error you quoted. No, it just happened those buyers didn’t have SQLite support. You should check this yourself before buying. Ask your host to be sure.

<?php var_dump(function_exists('sqlite_escape_string'));

Hi Geert,

I followed the instructions and still cant seem to get this to work.

I get the following:

Warning: include() [function.include]: Failed opening ’/thumbsup/core/thumbsup.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/kipsfree/public_html/testing.php on line 4

Fatal error: Call to a member function setup() on a non-object in /home/kipsfree/public_html/testing.php on line 11

Any ideas on what could be wrong?

Thanks, Mandy

Yeah, something is going wrong with the inclusion of the thumbsup script. You just have to focus on the first warning. The fatal error will go away automatically. Please double-check the path you are using to point to the thumbsup script. Contact me via e-mail if you need further assistance. Thank you.

Hi GeertDD

How do i add variable as a name. I want to use ThumbsUp for dynamic content. I tried {$thumbsup->setup(’$pic’, ‘mini-thumbs’)>render()} and {$thumbsup>setup(’” . $pic . ”’, ‘mini-thumbs’)->render()} within a ECHO , where $pic is the name of a picture.

Thanks, Andretti

Hi Andretti

It looks like you’re making it more complicated than it is. ;-)

$thumbsup->setup($pic, 'mini-thumbs')->render(); or $thumbsup->setup('prefix_'.$pic, 'mini-thumbs')->render();

Also see the PHP manual on variables. Thanks.

Ow jah trouwens,

Ik krijg ook alleen systeem knoppen, en niet die mooie knoppen die jij hebt. Ik weet niet waar in jouw code ik moet checken of de link naar je image wel goed staat.

Latess,

Sadesh

Het lijkt mij dat er een probleem is met je THUMBSUP_WEBROOT als ik dat hoor. Daardoor worden waarschijnlijk de javascript en de stylesheets niet geladen. Double-check de broncode en config.php even. Contacteer mij via mail als je specifiekere hulp nodig hebt.

Bedankt. :-)

Hallo Geert

Ik neem aan dat je een nederlander bent dus doe ik dit in het nederlands. Ik heb jouw script pasgeleden gekocht, maar ik heb moeite om hem te implementeren op mijn website.

Echter dat is niet mijn vraag. Ik vroeg me eerder af of jij mij een stukje code kan sturen als voorbeeld van hoe je meerdere thumbs up icoontjes op 1 pagina kan krijgen. Je zou dat dan m.b.v. unieke ids moeten doen.

Ik hoop snel van je te horen.

Mvg,

Sadesh

Dag Sadesh

Ik ben geen Nederlander, wel Nederlandstalig. ;-)

Meerdere ThumbsUp items op één pagina kan zolang je elk item maar een unieke naam geeft. PHP kan dit vergemakkelijken als je bijvoorbeeld IDs hebt opgeslagen van bepaalde data.

<?php $thumbsup->setup('prefix_'.$some_id, 'mini-thumbs')->render() ?>

I see that you have a tutorial on integrating Thumbs Up into Wordpress. Do you have a tutorial out there for integrating into Magento? I am hoping I can use this in my Magento site. Thanks.

I’m sorry, I have no tutorial for Magento integration. You should get hold of somebody with Magento experience. Thanks.

Hi there,

I have a site that lists different types of Widgets.

Each page lists x10 different Widgets.

Question: Can I put an instance of the Thumbs Up/Down for EACH Widget? (ie. x10 Thumbs Up / Down per page)

Or is it only x1 Thumbs Up/Down per page?

Thanks, Jay.

Hi Jay. You can have lots ThumbsUp items on a single page. Have a look the live demo, for example. All you need to make sure is you give each item a unique name. Let me know if you have any more questions. Thanks.

Nevermind, I have it working.

I changed the CHMOD of the folder ‘database’ and not the file within this directory. If you do the folder it may not work.

Great script! very happy with it.

Alright, glad you figured it out yourself already. :-)

Hi,

I’m having a slight problem in getting the script to work.

As soon as this function is called:

<?php $thumbsup->setup('Name1', 'mini-thumbs')->render() ?>

No more html appears after it and no thumbs are appearing. It also is not appearing to display any error message. I think it may be somthing to do with my host settings as when I upload the demo straight to the server that does the same thing.

I have PHP5 enabled and CHMOD is 666 for the database folder and all its contents.

Please help, thanks.

GeertDD

Just like to say thanks for your help and answering everyones questions.

I’d recommend everyone to buy this script.

Hopefully Geert will bring out some more styles etc as I am more than happy to buy more…

Thank you, Ian. :-)

@bobbyrocket

I have been playing with this most of the day, and it does work on a straight .php file off the root. I am still trying to see whether I can get it to work on subdomains which seems a lot more tricky. Should in theory get it to work on .html via enabling in .htaccess http://php.about.com/od/advancedphp/p/html_php.htm (Although when I play with .htaccess it propogates and destroys the whole site!)

I’d suggest you just set up www.yourdomain.com/test.php file and as a proof of concept get it to work.

*Ooops, seems you have got it already to work.

For some reason I can’t login to the admin section. I changed the config file and followed the instructions but still no luck. Any help would be great. Thank you.

You did SHA -1 encode the passwords in the config file, did you? Please contact me via email if you want me to look at the real site. It’s hard to tell what is going wrong like this.

Hi I’m also having a problem with this script running on my server. I keep getting this error:

Fatal error: Call to undefined function sqlite_escape_string() in /home/xyz/public_html/thumbsup/core/thumbsup.php on line 264

I made sure SQLite is enabled:

PDO Driver for SQLite 3.x => enabled SQLite Library => 3.3.7 SQLite SQLite support => enabled SQLite Library => 2.8.17 SQLite Encoding => iso8859

I made sure PHP 5 is installed:

PHP 5 .2.12 (cli) (built: Feb 2 2010 15:47:56) Copyright© 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright© 1998-2009 Zend Technologies

I have no idea what to do now. I tested my files on a shared hosting server and everything worked good. So all my paths are correct.

Please help!

Thanks!

sqlite_escape_string is a native PHP SQLite function. If that function is undefined, the problem is somehow related to the installation of SQLite.

hi, i’ve a question:

does it only stores the IP to prevent an user to vote twice ? or do you have more sofisticated mechanism (such as cookies ? ...)

Thanks

Hi Tristan,

By default ThumbsUp always uses cookies to prevent double votes. If you want an extra validation on top of that, simply enable IP check in the config file.

Ok, I just set up a test .php file on the root and managed to get it functionally working. So probably best to disregard the above two comments unless you can easily say the issues arising across subdomains.

Anyway, is it definitely the case that this script cannot be imbedded into html files? only .php?

Also, I cannot for the life of me to get the images to show as just the basic system buttons show. earlier you have said its issues with the config file. Well I’ve done all sorts of path changes everything from the http long code through to using elements of the server path (home/xcf/public_html.. etc) still no joy. I am beginning to think it is in the coding and declarations so everything works, css etc)

However, there is one major issue and that is that in IE8 your demonstration page http://codecanyon.net/item/thumbsup/full_screen_preview/50411 does not show the buttons skinned, they just show the default system buttons, its ok in Opera but not IE8 !

Is that page working ok for everyone else in IE8 ??

You need to embed the script into a PHP file. That is a requirement. Pasting PHP code in plain HTML files will not work.

As for the images, double-check the source code. There should be <script> in the document <head> with a src pointing to “thumbsup/core/thumbsup.js.php”. Try inserting the URL you see there directly into your browser’s address bar. If that file doesn’t get loaded, neither will the ThumbsUp stylesheets and images. (I have no access to IE8 currently.)

Hmm… Hostgator.com can’t say for definite they have done all thats required to ensure that SQlite on their php5.2.9 install works. You have to get your website whitelisted on image resizer software so they have some sorts of security going on.

The only other angle I can think of is that I am doing the thumbs up web insert (icon presented) on a subdomain while the folder sits on the root. Nothing seems to indicate that it should be an issue as everything is called from the thumbsup folder on the root….

I am stumped…

That sounds really complicated. However, for all I understand, SQLite could be installed and work just fine. Running phpinfo() may be helpful too.

Hmmm.. I am having some problems and I don’t know for definite if its the host or me.

I am trying to CHMOD the database folder to 666 but it reverts to 766 which seems a higher and more open level of read/write access so I think that isn’t the issue.

My host said that SQlite is supported as they have 5.2.9 PHP , could that could be different to having it enabled?

What is happening is that the code I place to insert the thumbs up is simply showing on the screen. (I’ve tried the echo code version and it doesn’t fix the problem).

Step 1 configer – thumsup folder (Incl the folder) On root hence ’/’ ok. Timezone and password key ok. Step 2 Upload – ok, folder on root. CHMOD database folder 766, database itself and .htaccess at 666. Step 3 Include – first php code has been placed at the top of the body below the end. (I’ve tried it all over the place, makes no difference). The other 2 lines of code are in the section The 1st of these path has been changed to direct to the /thumbsup/admin/javascript/jquery-1.3.2.min.js file. Hence all seems ok. The 2nd of these 2 lines does not require any change. Step 4 Create – Just a simple cut and past of the same code you have as an example placed in the page code should therefore bring up the required icon.

But it doesn’t > The actual display is just the code. in fact just this portion exactly setup(‘Name1’, ‘digg-thumbs’)>render() ?>

???? (The create isn’t inside any other open script section its just inserted in text. Just just maybe there isn’t sufficient closed brackets and it thinks its text.. don’t think so though).

Those are a lot of questions, maybe it would be easier if you contacted me via mail so I can have a look at your actual site.

SQLite is enabled by default in PHP5 . If it isn’t you would probably get some “undefined function” errors. Doesn’t look like that’s a problem.

If the ThumbsUp code snippet shows up literally, the problem is that the page isn’t parsed as PHP and thus the code is treated like regular HTML .

do you think it can work with textpattern?

I guess so, but I can’t tell how easy or hard it would be to implement since I don’t have experience with Textpattern. No guarantees here, sorry.

Hello,

We were looking at some sample implementation of thumbs up/down. In one of the websotes, we noticed that when you click the THUMBS UP , the THUMBS DOWN becomes (-) negative.

Let say THUMBS UP becomes 25, and THUMBS DOWN becomes -24.

Is this a bug?

Please let us know as this is an important feature that we would like to implement prior to purchasing it.

Thanks.

This looks like a bug, not a feature. Feel free to send me the site where this is happening. If you look at the demo, you’ll see everything working fine, though.

Hello,

Is there a way to edit the database?

Thanks.

Sure. All votes and items are stored in a simple SQLite database. You can edit the location of where to store the database if you wish. It is just one file.

You can do whatever you want with the database. Nothing has been obfuscated there. You’ll need some PHP skills if you want to extend the functionality of the script, of course.

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