Skip to Content
It is currently April 21st, 2019, 10:31 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 6th, 2019, 2:25 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 93
On my site I've installed a working voting system using a thumbs-up or thumbs-down and vote count and it seems to be working, BUT, it asks for the ID of the data to vote on, and when I put either "songID", "$songID", "ID", or "$ID", it doesn't know what that is because when I look at my SQL data it shows that the ID is set to the word "ID", and not the ID number of the song.

For example, the song playing right now has an ID of 12907, but when I vote on this song, I can go back to my SQL and find the vote, but the ID says "ID" instead of the number.

When I look at the "songlist" table I can clearly see the song's ID under the ID column but I can't use it.

What parameter can I pass to the script where SQL will recognize the ID of the song that is currently being played and place that into the ID column in my database? That way it will allow unique voting for each song (I think).

I've contacted the author of the script, but he/she (?) hasn't responded yet.

Here is the webpage: https://coursesweb.net/php-mysql/voting ... _php-mysql

Dan

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: April 6th, 2019, 3:01 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 93
I got it! The code is:

Code:
<div class="vot_mp2" data-vote_id="<?php echo $currentSong->ID; ?>"></div>

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: April 18th, 2019, 12:21 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 93
I've been able to tell the voting script to display the vote results for each track, and also to lock the votes after the song has moved out of the Currently Playing box.

The author of the script has updated it to include a parameter to lock the votes once they're in the recently played box or in your playlist.

Here's a link to the newest script: https://coursesweb.net/php-mysql/rating ... jax-php_s2

To have a look at it, please visit my site by clicking on the link below.

Cheers,
Dan

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
PostPosted: April 18th, 2019, 12:35 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7822
Location: Aachen (Germany)
Interesting take on the concept.
You only allow voting on the currently playing song? Will the votes reset once the song is playing again or are the votes accumulating whenever a track is played again?

I've only ever seen this with ratings possible all over the place.
We built that using the jrating jQuery Plugin: https://www.jqueryscript.net/other/Flex ... ating.html
Sadly the station where we implemented that is no longer online.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group