OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?

MediaLibrary Modules Support

Go to bottom Favoured: 0

Title / Artist

Grego606 (Visitor)
Posts: 0
graphgraph
User Offline
Title / Artist 12 Years, 9 Months ago
Karma: 0  
How do I create a heading for "Artist" on this page: pageindex.php?option=com_medialibrary&task=showCategory&catid=5

I see that "_medialibrary_music.artist" is not included in the search query, and my attempts to modify it have failed.


TX
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Title / Artist 12 Years, 9 Months ago
Karma: 101  
Hello,

Please give more details where and how you do search. For me search for music artist in Media Library free work good

Thanks,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Grego606 (Visitor)
Posts: 0
graphgraph
User Offline
Re:Title / Artist 12 Years, 9 Months ago
Karma: 0  
medialibrary.php lines 409-424. I attempted to ad the code in Italics but it didn't work.
Code:

 $query = "SELECT library.id, library.media_type, library.media_id," .
     " library.hits, library.checked_out, library.catid, ".
     " library.fk_lendid,library.date," .
     " other_table.id as media_type_id, other_table.title as title, [i]other_table.artist as artist[/i], other_table.rating as rating, " .
     " other_table.URL as URL, other_table.imageURL as imageURL " .
     " FROM #__medialibrary AS library " .
     " LEFT JOIN (SELECT id,title,rating,URL,imageURL,'game' as type FROM #__medialibrary_game ".
     " UNION all SELECT id,title,artist,rating,URL,imageURL,'music' as type FROM #__medialibrary_music " .
     " UNION all SELECT id,title,rating,URL,imageURL,'book' as type FROM #__medialibrary_book " .
     " UNION all SELECT id,title,rating,URL,imageURL,'video' as type FROM #__medialibrary_video) " .
     " AS other_table ON other_table.id = library.media_id and other_table.type = library.media_type" .
 " WHERE library.id IN (" .  $bids . ") AND fk_lendid = 0" .
 " ORDER BY library.catid, ordering";

$database->setQuery( $query );
$medias = $database->loadObjectList();

Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Title / Artist 12 Years, 9 Months ago
Karma: 101  
You haven't so field in yours other_table - because that - that not work

You need use some like below and for artist use ext1 column
Code:


$selectstring = "SELECT library.id, library.media_type, library.media_id," .
  "cc.title AS category, library.published, library.hits, library.checked_out, library.catid, ".
  " library.informationFrom, l.id as lendid, l.lend_from as lend_from, " .
  " l.lend_return as lend_return, other_table.ext1 as artist " .
  " l.lend_until as lend_until ," .
  " u.name AS editor, " .
  " other_table.id as media_type_id,  other_table.title as title  " .
  " FROM #__medialibrary AS library " .
  " left join #__categories AS cc on cc.id = library.catid "  .
  " left join #__medialibrary_lend AS l on library.fk_lendid = l.id  " .
  " left join #__users AS u on u.id = library.checked_out, " .
    "  LEFT JOIN (SELECT id, title, 'game' as type, comment, studio as ext1, binding as ext2, platform as ext3 FROM #__medialibrary_game ".
    " UNION all SELECT id, title, 'music' as type, comment,artist as ext1, label as ext2, tracklist as ext3 FROM #__medialibrary_music " .
    " UNION all SELECT id, title, 'book' as type,comment,authors as ext1, manufacturer as ext2, edition as ext3 FROM #__medialibrary_book " .
    " UNION all SELECT id, title, 'video' as type, comment,actors as ext1, producers as ext2, format as ext3 FROM #__medialibrary_video) " .
  " AS other_table ON other_table.id = library.media_id and other_table.type = library.media_type" .
 " WHERE library.id IN (" .  $bids . ") AND fk_lendid = 0" .
 " ORDER BY library.catid, ordering";



But you need check that query, I not checked it

Thanks,
OrdaSof team
Logged Logged
The administrator has disabled public write access.
Grego606 (Visitor)
Posts: 0
graphgraph
User Offline
Re:Title / Artist 12 Years, 9 Months ago
Karma: 0  
I'm not sure where all that code goes. The only "$selectstring" I found was commented out.

I replaced the code on line 416 of the code block in medialibrary.php with existing code...
Code:

" UNION all SELECT id, title, 'music' as type, comment,artist as ext1, label as ext2, tracklist as ext3 FROM #__medialibrary_music " .



I added the code: print_r($book); and didn't see [artist] or [ext1] on my page.

Here is one record:
Code:

stdClass Object ( 
[id] => 61 
[media_type] => music 
[media_id] => 55 
[hits] => 0 
[checked_out] => 62 
[catid] => 5 
[fk_lendid] => 0 
[date] => 2011-06-07 01:17:47 
[media_type_id] => 55 
[title] => Miles and Coltrane 
[rating] => 0 
[URL] => http://www.amazon.com/Miles-Coltrane-Davis/etc 
[imageURL] => http://ecx.images-amazon.com/images/I/51es3RHGDWL._SL160_.jpg ) 



Thank you.
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Title / Artist 12 Years, 9 Months ago
Karma: 101  
Please open file:

{yours site }/administrator/components/com_medialibrary/admin.medialibrary.php

and find in it "artist" and "ext1"
And check SQL query

All look like you add "ext1" to UNion - but not added to main select

Thanks,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Go to top
»