ryplittle
Forum Replies Created
-
Forum: Plugins
In reply to: [YOP Poll] Make "Other" values available for votesactually, I just realized that the above code does something messed up because of the backticks in the SQL query, so do not use the above code. Instead, find it here: https://gist.github.com/ryplittle/6805319
Forum: Plugins
In reply to: [YOP Poll] Make "Other" values available for votesI’m not sure that this is 100% correct, but I checked the database and things look good, and behave perfectly, as far as I can see. There is a lot of code in this plugin, but I found that this works for a quick fix.
Forum: Plugins
In reply to: [YOP Poll] Make "Other" values available for votesHey,
I was searching for the same thing and had to change the inc/yop_poll_model.php file to get this to work the way I wanted.
Make this edit around line 2805, and again around 2850
/*** add the "other" entry to answers - rlittle ***/ // $answer['other_answer_value'] = $request['yop_poll_other_answer']; global $wpdb; $wpdb->query( " INSERT INTO <code>". $wpdb->yop_poll_answers . "</code> (<code>poll_id</code>, <code>answer</code>, <code>type</code>, <code>votes</code>, <code>status</code>) VALUES ('" . $poll_id . "', '" . $request['yop_poll_other_answer'] . "', 'default', 1, 'active') " ); // if you want the "other" value to return to zero $wpdb->query( " UPDATE $wpdb->yop_poll_answers SET votes = -1 WHERE poll_id = $poll_id AND answer = 'Other' " ); /*** end edit ***/
Make sure you comment out
$answer['other_answer_value'] = $request['yop_poll_other_answer'];
like I have in the above code.It adds the “other” entry to the answers, which you can see in the admin for the poll settings, and if you don’t want the value of “other” to return to zero, you can comment out or remove that second wpdb query.
Forum: Plugins
In reply to: [Facebook Comments] set "post to facebook" as defaultNow, it seems that this is the default behavior… Can it be un-checked by default?