0
Would it be possible to get the "Artist Name" included in the Search Results ? It would be nice if after doing a search such as this , the "Artist Name" was included in the results so that users could then click the artist to get more info. Having the "Album Name" there is good but it would be better to also include the "Artist Name". Thanks.
Responses (3)
-
Accepted Answer
0it is not very difficult to do, but you'll have to add some code on certain files...
open /components/com_muscol/models/serch.php
on line 115 aprox you find this:
$this->query = ' SELECT s.id,s.name,s.album_id,s.filename,al.name as album_name FROM #__muscol_songs as s '.
' LEFT JOIN #__muscol_albums as al ON al.id = s.album_id ' .
$where_clause .
' ORDER BY s.artist_id, al.year, al.month, al.id, s.disc_num,s.num '
;
you have to replace it with:
$this->query = ' SELECT s.id,s.name,s.album_id,s.filename,al.name as album_name,s.artist_id,ar.artist_name FROM #__muscol_songs as s '.
' LEFT JOIN #__muscol_albums as al ON al.id = s.album_id ' .
' LEFT JOIN #__muscol_artists as ar ON ar.id = s.artist_id ' .
$where_clause .
' ORDER BY s.artist_id, al.year, al.month, al.id, s.disc_num,s.num '
;
(with this we are getting the artist data from the database. now we only have to display it:
open /components/com_muscol/views/search/tmpl/songs.php
around line 68 is where the table results header is written. add a "td" element and write Artist in it.
then go to line 78 (aprox) and add the following sentence:
$link_artist = JRoute::_('index.php?option=com_muscol&view=artist&id='. $this->songs[$i]->artist_id . $itemid);
the go a few lines below and add a new "td" element (in the same place where you added the previous header one)
you can add the code that prints the album link and replace the href element for:
echo $link_artist;
and the "a" element text for
echo $this->songs[$i]->artist_name;
and that will be all.
hope you understand!
oh, and as usual, since this involves making some changes on the code, I will say what I always say... USE AT YOUR OWN RISK!!! I suggest you to write somewhere the files you modified, in the case some upcoming updates may overwrite this files. would be a good idea keep a copy of the original files you modify!
Germi -
Accepted Answer
0I can't thank you enough !! Worked like a charm !! The support you give is EXCELLENT in a world in which technical support seems to get worse and worse. I am a Software Architect/Developer by trade so with your guidance, I was able to easily make the changes. Check it out .... I did backup the original files but I think this would be a great feature to add into the next release of this software. (along with the ability to sort by song, artist, and album name by clicking on the column header :-). Thanks again for your excellent work.
In due time, I am going to write a Customer Testimonial for your product because the product and the accompanying support is as good as it gets. Thanks. -
Accepted Answer
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »