Author Topic: [SOLVED] Duplicated entries in Search Results  (Read 394 times)

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3101
  • Personal Text
    Peace man. Enjoy life
    • Jhonny's RadioDJ tutorials.
Re: [SOLVED] Duplicated entries in Search Results
« Reply #60 on: August 08, 2018, 01:53:49 PM »
Search on artist name Green Day has no result.

Search on Boulevard of Broken Dreams result with the artist name Green Day.

Think you have a double track with a diverent file name.

Like green day - Boulevard of Broken Dreams.mp3
and
green  day - Boulevard of Broken Dreams.mp3 a double space in the file.

Check with the trackmanager.
R.T.F.M. means to me, Read The Fantastic Messages.
Make things simple, but don't make simple things simpler!
I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit http://dj-jhonny.nl

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #61 on: August 08, 2018, 02:09:51 PM »
Only one track there. I didnt upload your last version of index yet.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

  • Global Moderator
  • Hero Member

  • Online
  • *****
  • 3472
  • Personal Text
    I do NOT compile code for RadioDJ I'm just a USER!
    • DJ Garybaldy
Re: [SOLVED] Duplicated entries in Search Results
« Reply #62 on: August 08, 2018, 02:17:01 PM »
I've updated the website template to include Jhonny's piece of SQL query

You should only need to replace index.php


http://www.mediafire.com/file/5za6ivxeat17t2g/RDJ_Template_2.0.zip/file
Proud USER of RadioDJ since 2011

https://djgarybaldy.co.uk/maria-db-radiodj/
https://djgarybaldy.co.uk/help-cant-install-radiodj/
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/
https://www.facebook.com/DJGarybaldy/

Find my tutorials/scripts useful? https://www.paypal.me/djgarybaldy

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #63 on: August 08, 2018, 02:38:05 PM »
It still finds disabled tracks. I searched for several disabled and found them all...
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

  • Global Moderator
  • Hero Member

  • Online
  • *****
  • 3472
  • Personal Text
    I do NOT compile code for RadioDJ I'm just a USER!
    • DJ Garybaldy
Re: [SOLVED] Duplicated entries in Search Results
« Reply #64 on: August 08, 2018, 02:58:56 PM »
I know its not doing on artist but as for not showing the title when its disabled is puzzling me.... I can indeed search the track by title when its disabled but not by artist...  :bash:
The quest for this piece of code continues.
Proud USER of RadioDJ since 2011

https://djgarybaldy.co.uk/maria-db-radiodj/
https://djgarybaldy.co.uk/help-cant-install-radiodj/
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/
https://www.facebook.com/DJGarybaldy/

Find my tutorials/scripts useful? https://www.paypal.me/djgarybaldy

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #65 on: August 08, 2018, 03:01:58 PM »
I am a very good beta-tester. If you need one, just tell me.  >:D
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Dragos

  • Jr. Member

  • Offline
  • **
  • 93
  • Personal Text
    Radio addict
    • Play Radio - Ritmul Anilor Tai
Re: [SOLVED] Duplicated entries in Search Results
« Reply #66 on: August 08, 2018, 07:34:09 PM »
@Dragos, do you have any subcategory id's excluded (web user not allowed to make requests in those subcategories) for the query?

in your config.php file, line 20
$reqsubcat = ''; // exclude subcats use id numbers like 1,2,3  Empty for show all


if you do, the search query statement that is used in index.php, line 58, appears to be missing the OR to search the title data field.

if (!empty($reqsubcat)) {
                $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
                $srchpath = "&searchterm=$srch";
                $srcquery = "AND (`artist` LIKE '%$srch%') $notin "; //Search artist and title not in selected subcats
            } else {
                $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
                $srchpath = "&searchterm=$srch";
                $srcquery = "AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%')"; //Search artist and title
            }


copy and paste the segment OR (`title` LIKE '%$srch%') right before the word $notin, see if that allows you to search by title also
That DID the trick. Now search works for titles too. Thanks so much, stevewa!
Only one issue left from my side. The one with the songs in the query that can be requested again if not played. The workaround I did for now is to restrict the next request to 4 minutes.
Radio is one of the best things that happened to the world.

DJ Garybaldy

  • Global Moderator
  • Hero Member

  • Online
  • *****
  • 3472
  • Personal Text
    I do NOT compile code for RadioDJ I'm just a USER!
    • DJ Garybaldy
Re: [SOLVED] Duplicated entries in Search Results
« Reply #67 on: August 09, 2018, 01:33:39 PM »
That DID the trick. Now search works for titles too. Thanks so much, stevewa!
Only one issue left from my side. The one with the songs in the query that can be requested again if not played. The workaround I did for now is to restrict the next request to 4 minutes.
Me personally i'd restrict it to 1 every 60 minutes that way you won't get flooded with requests.
Proud USER of RadioDJ since 2011

https://djgarybaldy.co.uk/maria-db-radiodj/
https://djgarybaldy.co.uk/help-cant-install-radiodj/
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/
https://www.facebook.com/DJGarybaldy/

Find my tutorials/scripts useful? https://www.paypal.me/djgarybaldy

stevewa

  • Jr. Member

  • Offline
  • **
  • 68
Re: [SOLVED] Duplicated entries in Search Results
« Reply #68 on: August 09, 2018, 03:18:27 PM »
you are welcome drago!

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #69 on: August 09, 2018, 04:29:27 PM »
DJ Garybaldy, how can I set up a custom port for connecting the script to the db? For example: public port 33306 routed to intranet port 3306. The router can do that, but I don't know if I can configure the script...

The default port is susceptible to attacks.

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

DJ Garybaldy

  • Global Moderator
  • Hero Member

  • Online
  • *****
  • 3472
  • Personal Text
    I do NOT compile code for RadioDJ I'm just a USER!
    • DJ Garybaldy
Re: [SOLVED] Duplicated entries in Search Results
« Reply #70 on: August 09, 2018, 04:42:52 PM »
DJ Garybaldy, how can I set up a custom port for connecting the script to the db? For example: public port 33306 routed to intranet port 3306. The router can do that, but I don't know if I can configure the script...

The default port is susceptible to attacks.

Thanks.
Will you website host allow you to use that port is a bigger question.
Proud USER of RadioDJ since 2011

https://djgarybaldy.co.uk/maria-db-radiodj/
https://djgarybaldy.co.uk/help-cant-install-radiodj/
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/
https://www.facebook.com/DJGarybaldy/

Find my tutorials/scripts useful? https://www.paypal.me/djgarybaldy

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #71 on: August 09, 2018, 04:45:12 PM »
I can talk to the webhost because they are friends of mine. I just need to be able to configure the script. :)
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

stevewa

  • Jr. Member

  • Offline
  • **
  • 68
Re: [SOLVED] Duplicated entries in Search Results
« Reply #72 on: August 09, 2018, 05:08:16 PM »
in file config.php

$dataport = "3306";  // database port number (You change ports at your own risk)

DJ Garybaldy

  • Global Moderator
  • Hero Member

  • Online
  • *****
  • 3472
  • Personal Text
    I do NOT compile code for RadioDJ I'm just a USER!
    • DJ Garybaldy
Re: [SOLVED] Duplicated entries in Search Results
« Reply #73 on: August 09, 2018, 05:09:39 PM »
Someone else is going to have to come to your rescue here my knowledge on SQL and Changing ports isn't great I'm afraid i know the basics... and sticking to the default port,


I'd be looking into ways of making your SQL server as secure as it can be if you're getting attacked on port 3306.
Proud USER of RadioDJ since 2011

https://djgarybaldy.co.uk/maria-db-radiodj/
https://djgarybaldy.co.uk/help-cant-install-radiodj/
https://djgarybaldy.co.uk/radiodj-php-request-script-basic/
https://www.facebook.com/DJGarybaldy/

Find my tutorials/scripts useful? https://www.paypal.me/djgarybaldy

unpetru

  • Jr. Member

  • Offline
  • **
  • 79
    • Lounge Avenue Radio
Re: [SOLVED] Duplicated entries in Search Results
« Reply #74 on: August 09, 2018, 05:11:22 PM »
in file config.php

$dataport = "3306";  // database port number (You change ports at your own risk)

This might be it... I will test it and come back :)
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com