vote

How can I use PHP and JavaScript to make an image clickable, and increment a counter stored as a flat file?

笑着哭i 提交于 2020-01-24 00:22:08
问题 Im trying to find a php/js script that will let me take an image, and when clicked, increase the number in a flat file, and save that file. I know how to include the file to get the vote total. Im going insane trying to find this to plug and play into my website. Id love to have ip logging, and a cool fade in/out refresh update thing. But at this point ill settle for basics. Id like to avoid using MySQL, but if its necessary i can work with it. 回答1: Your best bet is to use the AJAX support in

Vote for the best protocol for the given scenario

北战南征 提交于 2020-01-01 02:40:14
问题 I have a design decision to make. I need your advice. Requirements: A server and a client. client is typically a mobile phone. Connected through the Internet. Server and client want to talk to each other. Exchange of text, multimedia between the client and the server. Text would be some standard format. that is predecided. Real time requirements Session would typically last for 5-15 minutes. In some cases for under a minute. assume 5 minutes as the session duration. The protocol should adhere

Storing “votes” in a database

北城余情 提交于 2019-12-20 09:58:24
问题 I'm writing what will be an intranet application, and one of its features is roughly analogous to content voting - not unlike what SO, Amazon, and many other sites do. Assuming each votable piece of content has a unique ID, and each user (they're authenticated) has a unique ID, the easiest way would seem to be to have a "votes" table... ContentID int UserID int VoteValue int But this creates one row per vote - with millions of pieces of content and tens of thousands of users, that table's

Making a database-voting app

↘锁芯ラ 提交于 2019-12-13 17:40:46
问题 I'm a amateur in Java programming and also in Android Studio and my knowledge about databases isn't that good, too. Now the question. How can I make an app where the users can vote about an event. They can choose between the "yes" and "no" buttons. Below the two buttons there are two TextViews which shows the average of the users choices. Here is the layout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout

Rails survey style application - Show all answers on option

人走茶凉 提交于 2019-12-12 17:26:25
问题 I'm a new guy to ruby on rails and working on my first in-depth application. It has four tables: Questions , Options , Answers and Users . There's a list of questions and a user can vote for a unique option (stored in the Answers join table), I'm trying to get my head around table associations. This is how I've setup my individual RB files: class Question < ActiveRecord::Base has_many :options has_many :answers, :through => :options end class Option < ActiveRecord::Base belongs_to :question

How to register a user's vote on a poll?

江枫思渺然 提交于 2019-12-12 03:17:52
问题 I'm developing a page (facebook.com/genericco) for testing reasons and to learn how to develop for facebook apps. In this page I'm developing I made a custom layout for a question I created in facebook. I was able through the graph api to retrieve my own accounts questions and then the options, however I still don't know how would I register a vote when the user votes through my 'customized question'. anyone can help me? pretty please? I'll show you a picture of me with my shirt off. 回答1: The

How to check if somebody wrote a review to my Android App

China☆狼群 提交于 2019-12-11 18:05:19
问题 In my Android App i want a popup do show up with a button that links to my app in the market. The popup is showing currectly, but if somebody has already wrote a review for my app, i dont want it to show up. Is it possible to check if the person has already wrote a review or gave stars? Sorry for my bad english. I hope you did understand my problem.^^ 回答1: not really. You can have your app remember that the specific user has pressed your pop-up button before to be taken to the market. But you

jquery individual mouseenter for elements

本小妞迷上赌 提交于 2019-12-11 14:37:13
问题 I'm working on a "up, down" voting script. When the user for example hovers over the "Up" button a tooltip should fadeIn over that respective button and say "You like this post" or whatnot. The tooltip however fades in on all buttons.. The script is longer but here is the tooltip part. $(document).ready(function() { $('.vote').mouseenter(function(e) { var vote_status = $(this).attr("name"); $('.tooltip').fadeIn(200); if( vote_status = "up" ) { $('.tooltip').html('You like this post'); } if (

Limit Meteor Vote Once Per Day

梦想与她 提交于 2019-12-10 12:12:50
问题 I'm following the MeteorJS example for a leaderboard here: https://www.meteor.com/examples/leaderboard I want to limit the votes to once per day (per IP address). What's the best way to do this? 回答1: The following solution assumes you are starting with a clean version of the leaderboard example. Step one: Declare a new collection to hold IP address and date information. This can be added just below the definition of Players . IPs = new Meteor.Collection('ips'); Step two: Replace the increment

A voting system with jQuery, PHP and Smarty

青春壹個敷衍的年華 提交于 2019-12-08 09:31:26
I have made a voting feature to my website using only PHP and Smarty. This's the HTML part of it: <p>{$vote} <a href="vote.php?q_vote=vote_up&question_id={$qid}"><i class="icon-thumbs-up"></i></a> <a href="vote.php?q_vote=vote_down&question_id={$qid}"><i class="icon-thumbs-down"></i></a></p> The PHP part of the code takes the vote and refreshes the same page. I want to do the same thing using jQuery so that it won't need to refresh the page. Here is what I wrote in the HTML : $("#q_upvote").click(function() { var vote = "vote_up"; var votedata = ""; votedata = "vote= " + vote; $.ajax({ type: