Posts by LovelessDesign

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

I haven’t changed it to the wpdb yet because it’s in a folder in the wordpress root and not really in wordpress. I want to fix the other issue before I learn the use of the wpdb function. Or Do you think my Main issue is because I don’t use wpdb?

Thank you

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Thank you for your help.

Hm I can’t get it to work. I tried to put the code everywhere in the php file. For some reason I can’t use global variables in this file – The Like Script would work anymore.

Additionally, for some reason booleans, as you mentioned, doesn’t work. Maybe because of this code in the JS file:
 $.post( this.url_server,
            { cmd: "vote", tid:this.tid, vote:v, userid:this.userid, pageid:this.pageid, buttonclick:this.buttonclick, voteaccepted:this.voteaccepted },
            function(data) { 

I’m trying to fix the problem for the whole day now. I think it’s too hard for me. I have problems with the understanding of the order the code runs and there is much code I haven’t seen before.

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Does anyone have a solution for this? The if ( $voteaccepted == ‘yes’ ) { at the bottom doesn’t work because SQL is too slow.

if ($_REQUEST['buttonclick'] == "yes" ) {
    $con = mysql_connect('mysql5.loveless.businesspage.at', 'db381825', 'rBTFTGHv');
    if (!$con)
    {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("db381825", $con);

    $userid = $_REQUEST["userid"];
    $pageid = $_REQUEST["pageid"];

    $einlesen = mysql_query("SELECT COUNT(*) FROM a1wbabs_votelock WHERE wp_id=$userid AND page_id=$pageid");
    if(mysql_result($einlesen,0)<1) { 
        $voteaccepted = "yes";
        mysql_query("INSERT INTO a1wbabs_votelock (wp_id, page_id)
        VALUES ($userid, $pageid)");
    } else {
        $voteaccepted = "no";
    }    
    mysql_close($con);            
}
// LLD END

//-- add votes
if ( $voteaccepted == 'yes' ) {
<strong>//THIS SHOULD ONLY HAPPEN ONCE but it's possible to get there a second time because the variable $voteaccepted is not set after the first time (SQL is too slow)</strong>
}
145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

I’ve tried it on my own now and I’m close to a solution. Maybe someone could help me with the final step? Maybe someone who could need it too?

So, I have a FB Login Plugin ( http://www.sociable.es/facebook-connect-wordpress-plugin-screenshots/ ) And an Ajax Like/Dislike Script ( http://www.phpkobo.com/doc.php?d=install&p=AL201-102 )

You could download all the important files with all my changes here: http://markenkampf.com/likedislike.zip

Logged in Users (via facebook) should be able to vote only once, That’s why I’m writing the user id + page id in a sql table. If the same user id wants to vote the same page id, again it doesn’t work.

My only problem that needs to be solved: If the user clears the cookies after his first vote, he could vote a second time. But NOT a third or fourth time. The problem is that the PHP code doesn’t wait until the MYSQL request is finished.

I tried to build workaround in the JS file, but I’m not very good in it and so the code looks too complex for me.

Thanks a lot.

(it also needs to be fixed that a user who isn’t logged in, can’t vote. but that’s no problem for me)

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Zilla Likes also just uses Cookies to prevent double-votes. Users just have to delete cookies to vote again.

I now want to use a facebook/twitter login plugin http://www.sociable.es/facebook-connect-wordpress-plugin-screenshots/

Users have to login with their facebook/twitter account to see the voting.

But does anyone know a detailed instruction on how to realize that every facebook/twitter account can vote only once? The HTML-Code that displays the Vote-Button could just disappear if this fb/tw account has already voted.

would be great. thank you guys.

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

ok thank you. my php skills are not so good.

do you know a specific tutorial? I haven’t found any.

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

but every cookie can be deleted by the user, right? My idea was to save variables for every post and user and just show him the like/dislike poll if the logged in user hasn’t already voted

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Hello,

I use this Ajax Like/Dislike Script: http://www.phpkobo.com/ajax_likes.php My users can register to my wordpress blog and now it would be great if every registered user can vote only once (i already realised that unregistered user don’t see the like/dislike script).

Is there an easy way / script to realize that?

thank you

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Hello,

Anyone knows this malware and know how to remove it? http://labs.sucuri.net/db/malware/mwjs-iframe-injected515?v15
145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Any Ideas?

by
by
by
by
by
by