*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 01:43:20 AM


Login with username, password and session length

Author Topic: mod for showing artist in 4 rows on viewartists.php page  (Read 3716 times)
Support
Administrator
Sr. Member
*****
Offline Offline

Posts: 468


View Profile
« on: October 05, 2008, 07:46:26 PM »

mod for showing artist in 4 rows on viewartists.php page

open viewartists.php and empty the code and replace with the below code

Quote
<?
/*
--------------------------------------------------------------------------
|   Musicbox Version 2.3.7
|   ========================================
|   by Shalwan
|   (c) 2008 Shalwan Enterprises LLC
|   http://www.shalwan.com
|   ========================================
|   Web: http://www.musicboxv2.com 
|   Email: products@shalwan.com
|   Licence Info: http://www.shalwan.com/license
--------------------------------------------------------------------------- 
*/
 @include("sources/session.php");
 @include("sources/functions.php");
 $sql="select * from config where id=3";
 $rs=mysql_query($sql) or die(mysql_error());

 $row=mysql_fetch_array($rs);
 
 ob_start();
 @include("template/header2.php");
 
 define('ITEMS_PER_PAGE', 40);
 
 
  function getTotalArtists()
  {
     $query = "select count(*) as 'total' from artist where 1";
     $results = mysql_query($query);
     $row = mysql_fetch_assoc($results); 
     
     return $row['total'];     
 }
 
 function getAlbumCount($artistId)
 {
    $query = "select count(*) as 'total' from album where artist_id = '$artistId'";
    $results = mysql_query($query);
    $row = mysql_fetch_assoc($results); 
    
    return $row['total'];     
 }
 
  function getSongCount($artistId)
  {
     $query = "select count(*) as 'total' from song where artist_id = '$artistId'";
     $results = mysql_query($query);
     $row = mysql_fetch_assoc($results); 
     
     return $row['total'];     
 }
 
 
 $genre_id = $_GET['id'];   
 
 $items = ITEMS_PER_PAGE;
 
 if(isset($_GET['page']))
 {
    $offset = $_GET['page'];
    $offset *= $items;
    $query = "select id, name, artist_photo from artist limit $offset,$items";
 }
 else 
 {
   $query = "select id, name, artist_photo from artist";
 }

 $allArtists = mysql_query($query);
 
 echo "<table class='moduletable' cellpadding = '0' cellspacing = '0'><tr><th>All Artists</th></tr></table>";
 
 if(!allArtists) 
 {
    echo 'There are no artists in database';
 }
 else
 {
    while($artist = mysql_fetch_assoc($allArtists))
    {
       $artistPhoto = $artist['artist_photo'];
       $artistName = $artist['name'];
       print("<table class ='albumbox'><tr><td><table class='albumbox2'><tr><td><a href='index.php?action=artist&id=".$artist['id']."'><img src='$artistPhoto' /></a></td>");
       print("<td valign='top'>"); 
       print("<b><a href='index.php?action=artist&id=".$artist['id']."'>$artistName</a></b><br />");
       print("Total Albums: ".getAlbumCount($artist['id']).'<br />');
       print("Total Songs: ".getSongCount($artist['id']).'<br />');
       print("</td></tr></table></td></tr></table>");     
    }
 }

 mysql_free_result($allArtists);
 $artistCount = getTotalArtists(); //mysql_num_rows($allArtists);
 
 // Paginate
 
 $numPages = floor($artistCount / ITEMS_PER_PAGE);   
 
if($numPages > 0 )
{
    print('<table class="moduletable" align="left"><tr><td><center>Pages[');
    for($i = 0; $i < $numPages; $i++)
    {
      print("<a href='?id=$genre_id&page=$i'> ".($i+1).' </a>');     
    }
   print(']</center></td></tr></table>');
}

 include("template/header_bottom.php");
 ob_end_flush();

?>

now open musicboxv2.css from template folder and paste the below code

Quote
table.albumbox {

  width            : 33%;

  /*table-layout      : auto; */

  float: left; /*modified*/

}

.three_column_table {



  width: 100%;       
 
« Last Edit: October 06, 2008, 06:13:16 PM by Support » Logged
tdk
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #1 on: October 06, 2008, 12:16:17 PM »

css code is incorrect.
Logged
farid
Newbie
*
Offline Offline

Posts: 18


View Profile
« Reply #2 on: October 10, 2008, 09:02:12 AM »

HuhHuh?
have any print screen ?
Logged
Support
Administrator
Sr. Member
*****
Offline Offline

Posts: 468


View Profile
« Reply #3 on: October 10, 2008, 07:44:07 PM »

print screen ? what do you mean farid ?
Logged
farid
Newbie
*
Offline Offline

Posts: 18


View Profile
« Reply #4 on: December 18, 2008, 12:53:57 AM »

i tried this . but it did nt work for me
Logged
Support
Administrator
Sr. Member
*****
Offline Offline

Posts: 468


View Profile
« Reply #5 on: December 18, 2008, 06:23:40 AM »

try with the latest version it will work
Logged
farid
Newbie
*
Offline Offline

Posts: 18


View Profile
« Reply #6 on: April 04, 2009, 12:29:20 AM »

its still not working . should i pm u my ftp info
Logged
Support
Administrator
Sr. Member
*****
Offline Offline

Posts: 468


View Profile
« Reply #7 on: May 11, 2009, 06:07:36 AM »

it will definetly work
Logged
Pages: [1]
Jump to:  

Copyright © 2010 MusicboxV2.com - Shalwan Enterprises