Commit ab73e782 by Phạm Văn Đoan

cập nhật ảnh nghệ sĩ ở chức năng thống kê BXH

parent 37a01966
...@@ -508,5 +508,7 @@ $config['apiKey'] = 'No9OIh0vOPBRzUYeRYHPuQoclfzx69MX'; ...@@ -508,5 +508,7 @@ $config['apiKey'] = 'No9OIh0vOPBRzUYeRYHPuQoclfzx69MX';
*/ */
$config['allow_get_array'] = TRUE; $config['allow_get_array'] = TRUE;
$config['vmusicchart_url'] = 'http://vmusicchart.vn/';
/* End of file config.php */ /* End of file config.php */
/* Location: ./application/config/config.php */ /* Location: ./application/config/config.php */
\ No newline at end of file
...@@ -760,6 +760,24 @@ class MyHelper ...@@ -760,6 +760,24 @@ class MyHelper
return self::genKeyCode(time().$user_agent); return self::genKeyCode(time().$user_agent);
} }
/**
* Tính toán đường dẫn ảnh của bài hát tương ứng với ca sĩ thể hiện bài hát đó
* Nếu không tìm thấy ảnh thì lấy giá trị mặc định
*
* @param $art
*
* @return string
*/
public static function getArtByTrack($art)
{
$CI = &get_instance();
$default_image = base_url('images/track.png');
if ($art) {
$default_image = $CI->config->item('vmusicchart_url') . str_replace('%w', 200, $art);
}
return $default_image;
}
} }
/* End */ /* End */
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<tr> <tr>
<td style="text-align: center"><?php echo ($key+1+$offset); ?></td> <td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
<td style="text-align: center">#<?php echo $data['id']; ?></td> <td style="text-align: center">#<?php echo $data['id']; ?></td>
<td style="text-align: center"><img src="<?php echo base_url($data['art']); ?>"></td> <td style="text-align: center"><img style="max-width: 50px" src="<?php echo MyHelper::getArtByTrack($data['art']); ?>"></td>
<td style="text-align: left"><?php echo $data['name_song']; ?></td> <td style="text-align: left"><?php echo $data['name_song']; ?></td>
<td style="text-align: left"><?php echo $data['all_name']; ?></td> <td style="text-align: left"><?php echo $data['all_name']; ?></td>
<td style="text-align: right"><?php echo number_format($data['total_point'], 0, ',', '.'); ?></td> <td style="text-align: right"><?php echo number_format($data['total_point'], 0, ',', '.'); ?></td>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<tr> <tr>
<td style="text-align: center"><?php echo ($key+1+$offset); ?></td> <td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
<td style="text-align: center">#<?php echo $data['id']; ?></td> <td style="text-align: center">#<?php echo $data['id']; ?></td>
<td style="text-align: center"><img src="<?php echo base_url($data['art']); ?>"></td> <td style="text-align: center"><img style="max-width: 50px" src="<?php echo MyHelper::getArtByTrack($data['art']); ?>"></td>
<td style="text-align: left"><?php echo $data['name_song']; ?></td> <td style="text-align: left"><?php echo $data['name_song']; ?></td>
<td style="text-align: left"><?php echo $data['all_name']; ?></td> <td style="text-align: left"><?php echo $data['all_name']; ?></td>
<td style="text-align: right"><?php echo number_format($data['total_point'], 0, ',', '.'); ?></td> <td style="text-align: right"><?php echo number_format($data['total_point'], 0, ',', '.'); ?></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment