RadioDJ - Free Radio Automation Software Forum

[SOLVED] Duplicated entries in Search Results

[SOLVED] Duplicated entries in Search Results
« on: August 06, 2018, 01:36:31 PM »
Hi,

If I request a song from my db, the next time I search for it there will be 2 entries for it. Now I have 5 entries for the same song. Is this a bug?
« Last Edit: August 07, 2018, 09:43:36 AM by unpetru »
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #1 on: August 06, 2018, 01:48:55 PM »
If it is a bug there will be no way of fixing it, either way the developer of the WP Plugin isn't around anymore. Haven't used the WP plugin for a couple of years now.
USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #2 on: August 06, 2018, 01:49:57 PM »
Can you recommend another solution for online requests, one that isn't that hard to implement?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #3 on: August 06, 2018, 02:07:05 PM »
We released a script recently that isn't difficult to setup or customise etc...
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/

USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #4 on: August 06, 2018, 02:12:23 PM »
Could you give more information on how to install it? I have my own server for icecast and radio dj and I have the website hosted at a datacenter. Where should I put this script exactly and how would I be able to embed it in my website?

Thanks a lot man.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #5 on: August 06, 2018, 02:36:18 PM »
Edit the details in config.php to point to your RadioDJ database on your computer from Your webserver... Its not much different to the WP plugin it still requires port 3306.
You can place it wherever you want it on your website/server you would just need a PHP require statement in a page for it to show up. Or call the pages directly

Example http://mysiterocks.com/script location/index.php
Code: [Select]
$dataip = "127.0.0.1"; //  Your external IP address
$database = "admin_radiodj"; // Your Databse name
$username = "admin_radiodj";  // Your database user name
$userpass = "Mysupersecretpassword"; // Your database password
That's literally the 4 things you have to fill in.
USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #6 on: August 06, 2018, 02:39:57 PM »
error 500 :))

I am very bad at coding, so I need a step by step help in integrating the script, if you want to help a fellow radio enthuziast. :)

1. Where do I put the script on my server through FTP? Do I create a folder anywhere and copy the files there?
2. The php require statement - what is that?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #7 on: August 06, 2018, 03:05:14 PM »
Yes create a folder and upload the files in there, Make sure you edit the details in config.php to match the connection details you used in the WP plugin before you upload as FTP.
A PHP require statement is as simple as this

Code: [Select]
<?php require('somefile.php'); ?>
You edit the somefile.php bit to match the location of the request script.

Re download the package I've just updated config.php to be a bit clearer where you edit your database settings.
USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #8 on: August 06, 2018, 03:09:56 PM »
I have config.php, functions.php, index.php and the css file. Which one is the request script? :)

Where do I put that line for require statement?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Re: Duplicated entries in Search Results
« Reply #9 on: August 06, 2018, 03:19:42 PM »
Ok. I got it working so far. Thanks. I will be back if I encounter problems.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #10 on: August 06, 2018, 03:37:42 PM »
You should have a "Test Request" in your RadioDJ....  :cool:
USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #11 on: August 06, 2018, 03:40:11 PM »
Cant find the test request, but I got into one problem.

Sorry, you'll have to wait 117 more minutes before you can make another request.
Press F5 to re-submit this request

I set it up with 1 minute wait between requests and it remains at 120 minutes...

My config looks like this:

Code: [Select]
<?php
/*
Request script with wait time between selects.
Made by: Jhonny
Date: 12-21-2016
Updated by: Monkey
Date:03/03/2018
*/
########### edit settings #########
$dataip "#######"// IP address
$database "#####"// Databse name
$username "######";  //database user name
$userpass "########"// database password
$dataport "3306";  // database port number
$timezone "Europe/London";  // Your time zone http://php.net/manual/en/timezones.php
$reqLimit '20'// Request limit per day
$req_wait '1'// waiting minutes between requests
$req_event '1'// showing how many minutes between requests will be played in event. 0 = don't show
$reqsubcat ''// exclude subcats use id numbers like 1,2,3  Empty for show all
$page_limit '4000'// How many tracks showing in the page
$track_repeat '240'// Same track can't play in minutes.
$artist_repeat '120'// Same artist can't play in minutes
$random_seed rand(1,100000); // Generate random number (Used in combo with SQL Rand) / Edge fix
$random_limit '20'//Sets the limit and button
###### End Edit settings #######

##### Standard #####
$adjacents '5'// paginations blocks
#### language part ########
$lang = array();
$lang['ALT_REQ']= "Select song";
$lang['GO_BACK']= "Go Back";
$lang['COL_NUM']= "#";
$lang['COL_ARTIST']= "Artist name";
$lang['COL_DURATION']= "Duration";
$lang['COL_REQ']= "&nbsp;";
$lang['COL_TITLE']= "Track title";
$lang['ERROR_FIND']= "Didn't find what you were looking for? Search again!";
$lang['ERROR_LIMITREACHED']= "Sorry, but you've reached the request limit for one day.";
$lang['ERROR_LIMITREACHED2']= "You've now reached the request limit for today.";
$lang['ERROR_REQUEST']= "The song can't be requested it's already played recently.";
$lang['ERROR_SONGREQ']= "The selected song is already requested.<br />Please try again later, or select another song!";
$lang['ERROR_TRACKID']= "Please select a song in order to send a request!";
$lang['ERROR_TRACKREQ']= "Sorry, this track is already in the request list and hasn't played yet.";
$lang['ERROR_UNKNOWN']= "Unknown error occurred! Try again ...";
$lang['ERROR_USERNAME']= "Please enter your name in order to send a request!";
$lang['ERROR_TRACKREQ_TIME']= "Sorry, you'll have to wait ";
$lang['ERROR_TRACKREQ_TIME2']= " more minutes before you can make another request.<br />Press F5 to re-submit this request";
$lang['MSG_NORESULTS']= "No results to display, on your search...";
$lang['MSG_REQSUCCESS']= "Your request for this song, was successfully placed";
$lang['REQ_BUTTON']= "Send request";
$lang['REQ_DESCRIPTION']= "Please enter your request details below";
$lang['REQ_MESSAGE']= "Message (Optional):";
$lang['REQ_NAME']= "Your name (required)";
$lang['REQ_PLAYED']= "This song is played or requested, before your selection, sorry.";
$lang['REQ_PLAYNO']= "This track can't be selected now, please try it later.";
$lang['REQ_RANDOM']= "Random";
$lang['REQ_RANDOM2']= "Another random";
$lang['REQ_SELECT']= "Select Song";
$lang['REQ_SELECTED']= "You've selected:";
$lang['REQUEST_DIS']= "You can request a song to put in the top playlist of the station";
$lang['REQ_A_TRACK']= "Track Requests";
$lang['REQUEST']= "Request a song";
$lang['SEARCH_BUTTON']= "Search";
$lang['SEARCH_TXT']= "Search for an artist or title";
$lang['SEE_RULS_A']= "Select rules: no more than";
$lang['SEE_RULS_B']= "per day on IP address";
$lang['NAV_NEXT']= "Next";
$lang['NAV_PREV']= "Previous";
$lang['COL_YEAR']= "Year";
$lang['MSG_REQSUCCESS_MADE'] = "You made a total request of ";
$lang['MSG_REQSUCCESS_TOT'] =  "of the ";
$lang['MSG_REQSUCCESS_DAY'] = "limited per day.";
$lang['WAIT'] = "You'll have to wait ";
$lang['WAIT2'] = " min. before you can make a new request.";
$lang['REQ_LISTED'] = "Track is in the request list and not played yet.";
$lang['SELECTED'] = "Is selected";
$lang['REQ_EVENT'] = "Every ";
$lang['REQ_EVENT2'] = "minutes a request is played!";
$lang['REQUESTED_TRACK_LIMITS'] ="Requests are limited to ";
$lang['REQUESTED_TRACK_LIMITS1'] =" per day and ";
$lang['REQUESTED_TRACK_LIMITS2'] =" minutes between.";
$lang['NOREQ'] = "Unavailable";
$lang['OFFLINE'] = "The station is currently offline";
########### Don't edit billow ##########
date_default_timezone_set($timezone);
 
### Connection ###
$conn mysqli_connect($dataip,$username,$userpass,$database,$dataport);
?>

Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Offline DJ Garybaldy

  • *****
  • 3978
  • Never Get Angry At the Stupid People (Erasure)
    • DJ Garybaldy
Re: Duplicated entries in Search Results
« Reply #12 on: August 06, 2018, 04:02:25 PM »
Not sure why it's doing that TBH try setting the request limit to 5 minutes between and see if that makes a difference.
Set Req event back to zero I'm not even sure what that's supposed to be doing i will investigate.

Code: [Select]
$req_event = '0'; // showing how many minutes between requests will be played in event. 0 = don't show
USER of RadioDJ since 2010

Useful RadioDJ information : https://djgarybaldy.co.uk/category/radiodj/

I cannot give help and support via Private message!

I'm not as scary as I look Honest!

My little pet project: https://t.co/YyVaPOBYBK

Re: Duplicated entries in Search Results
« Reply #13 on: August 06, 2018, 04:05:17 PM »
94 minutes to go... Doesnt change the 120 min wait time...
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Re: Duplicated entries in Search Results
« Reply #14 on: August 06, 2018, 07:35:11 PM »
Another error:

Your request for this song, was successfully placed 5 of the 20
You've now reached the request limit for today.

Even if the request limit is set to 20
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com