• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

[SOLVED] Duplicated entries in Search Results

Started by unpetru, August 06, 2018, 01:36:31 PM

unpetru

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?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

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.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

Can you recommend another solution for online requests, one that isn't that hard to implement?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

We released a script recently that isn't difficult to setup or customise etc...
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/

Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

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

DJ Garybaldy

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
$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.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

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

DJ Garybaldy

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

<?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.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

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

unpetru

Ok. I got it working so far. Thanks. I will be back if I encounter problems.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

You should have a "Test Request" in your RadioDJ....  :cool:
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

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:

<?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

DJ Garybaldy

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.

$req_event = '0'; // showing how many minutes between requests will be played in event. 0 = don't show
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

94 minutes to go... Doesnt change the 120 min wait time...
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

unpetru

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