Ejemplo n.º 1
0
<?php

require 'public.php';
$albumId = $_GET['albumId'];
$result = selectSql('albums', 'album_cover', 'album_id=' . $albumId);
if ($result['state'] == 1) {
    $rows = mysql_fetch_assoc($result['msg']);
    $albumCover = $rows['album_cover'] == '' ? getAlbumCover($albumId, $defaultAlbumCover, $uploadImgPath) : $uploadImgPath . '75_75_' . $rows['album_cover'];
    $srcFile = $albumCover;
    $dstFile = str_replace('tmp', 'smTmp', $srcFile);
    thumbnails($srcFile, $dstFile, 75, 75);
    $albumCover = $dstFile;
}
if (!empty($albumId) && !empty($albumCover)) {
    //输出相册名
    $result = selectSql('albums', 'album_name,album_desc,user_id', 'album_id=' . $albumId);
    if ($result['state'] == 1) {
        $rows = mysql_fetch_assoc($result['msg']);
        $smarty->assign('albumName', $rows['album_name']);
        $smarty->assign('albumDesc', $rows['album_desc']);
        $authorId = $rows['user_id'];
        $smarty->assign('authorId', $authorId);
        if ($authorId == $userId) {
            $smarty->assign('isAuthor', true);
        }
        $result = selectSql('users', 'user_name,user_avatar', 'user_id=' . $authorId);
        if ($result['state'] == 1) {
            $rows = mysql_fetch_assoc($result['msg']);
            $smarty->assign('authorName', $rows['user_name']);
            $smarty->assign('authorAvatar', $rows['user_avatar'] == '' ? $defaultAvatar : $avatarPath . $rows['user_avatar']);
        }
Ejemplo n.º 2
0
<?php

require 'public.php';
$nowUserId = $_GET['userId'] == '' ? $userId : $_GET['userId'];
if (!empty($nowUserId)) {
    //获取相册信息
    $result = selectSql('albums', 'album_id,album_name,album_cover', 'user_id=' . $nowUserId);
    if ($result['state'] == 1) {
        $albumInfoArr = array();
        while ($rows = mysql_fetch_assoc($result['msg'])) {
            $srcFile = $rows['album_cover'] == '' ? getAlbumCover($rows['album_id'], $defaultAlbumCover, $uploadImgPath) : $uploadImgPath . $rows['album_cover'];
            $dstFile = $rows['album_cover'] == '' ? getAlbumCover($rows['album_id'], $defaultAlbumCover, $uploadImgPath) : $thumImgPath . '75_75_' . $rows['album_cover'];
            thumbnails(iconv('utf-8', 'gb2312', $srcFile), iconv('utf-8', 'gb2312', $dstFile), 75, 75);
            $albumInfoArr[] = array('id' => $rows['album_id'], 'name' => $rows['album_name'], 'cover' => $dstFile, 'photoNum' => getPhotoNum($rows['album_id']));
        }
    }
    if ($nowUserId == $userId) {
        $smarty->assign('isAuthor', true);
    }
    //读取相册的拥有者
    $result = selectSql('users', 'user_name,user_avatar', 'user_id=' . $nowUserId);
    if ($result['state'] == 1) {
        $rows = mysql_fetch_assoc($result['msg']);
        $smarty->assign('authorName', $rows['user_name']);
        $smarty->assign('authorAvatar', $rows['user_avatar'] == '' ? $defaultAvatar : $avatarPath . $rows['user_avatar']);
    }
    $smarty->assign('authorId', $nowUserId);
    $smarty->assign('userId', $userId);
    $smarty->assign('userName', $userName);
    $smarty->assign('albumInfoArr', $albumInfoArr);
    $smarty->assign('cssFileName', 'albumList');
Ejemplo n.º 3
0
<?php

require 'public.php';
$nowUserId = $_GET['userId'] == '' ? $userId : $_GET['userId'];
if (!empty($nowUserId)) {
    $photoInfoArr = array();
    $albumInfoArr = array();
    $result = selectSql('albums', 'album_id,album_name,album_cover', 'user_id=' . $nowUserId);
    if ($result['state'] == 1) {
        while ($rows = mysql_fetch_assoc($result['msg'])) {
            $albumId = $rows['album_id'];
            //读取所有相册信息
            $albumInfoArr[] = array('id' => $albumId, 'name' => $rows['album_name'], 'photoNum' => getPhotoNum($albumId), 'cover' => $rows['album_cover'] == '' ? getAlbumCover($albumId, $defaultAlbumCover, $uploadImgPath) : $uploadImgPath . $rows['album_cover']);
            $subResult = selectSql('photos', 'photo_id,photo_name,edit_name,photo_desc,upload_time', 'album_id=' . $albumId);
            if ($subResult['state'] == 1) {
                while ($subRows = mysql_fetch_assoc($subResult['msg'])) {
                    $srcFile = iconv('utf-8', 'gb2312', $uploadImgPath . $subRows['photo_name']);
                    $dstFile = iconv('utf-8', 'gb2312', $thumImgPath . '240_' . $subRows['photo_name']);
                    //生成缩略图
                    thumbnails($srcFile, $dstFile, 240, '');
                    //读取所有照片信息
                    $photoInfoArr[] = array('id' => $subRows['photo_id'], 'path' => iconv('gb2312', 'utf-8', $dstFile), 'name' => $subRows['edit_name'] == '' ? $subRows['photo_name'] : $subRows['edit_name'], 'description' => $subRows['photo_desc'], 'uploadTime' => $subRows['upload_time']);
                }
            }
        }
    }
    if ($nowUserId == $userId) {
        $smarty->assign('isAuthor', true);
    }
    //读取相册的拥有者
    $result = selectSql('users', 'user_name,user_avatar', 'user_id=' . $nowUserId);
Ejemplo n.º 4
0
  <h1 class="band"><?php 
$fullName = getArtistFullName($json_file);
echo $fullName;
?>
  </h1>
</div>

<div class="container">
  <?php 
$albums = findAlbums($band);
foreach ($albums as $name => $info) {
    ?>
                
      <div class="album">
        <img src="<?php 
    echo getAlbumCover($info);
    ?>
">
        <div class="description">
          <div class="text">
            <p><?php 
    echo $name;
    ?>
</p>
            <p>(<?php 
    echo getYearRecorded($info);
    ?>
)</p>
            <?php 
    $track_list = getTrackList($info);
    $track_num = 1;
Ejemplo n.º 5
0
<?php

require 'public.php';
require 'unLoginTip.php';
$albumId = $_GET['albumId'];
$result = selectSql('albums', 'album_cover', 'album_id=' . $albumId);
if ($result['state'] == 1) {
    $rows = mysql_fetch_assoc($result['msg']);
    $srcFile = $rows['album_cover'] == '' ? getAlbumCover($albumId, $defaultAlbumCover, $uploadImgPath) : $uploadImgPath . $rows['album_cover'];
    $dstFile = $rows['album_cover'] == '' ? getAlbumCover($albumId, $defaultAlbumCover, $uploadImgPath) : $thumImgPath . '240_' . $rows['album_cover'];
    thumbnails(iconv('utf-8', 'gb2312', $srcFile), iconv('utf-8', 'gb2312', $dstFile), 240, '');
}
if (!empty($albumId) && !empty($dstFile)) {
    $smarty->assign('albumId', $albumId);
    $smarty->assign('albumCover', $dstFile);
    //读取相册信息
    $result = selectSql('albums', 'album_name,album_desc', 'album_id=' . $albumId);
    if ($result['state'] == 1) {
        $rows = mysql_fetch_assoc($result['msg']);
        $smarty->assign('albumName', $rows['album_name']);
        $smarty->assign('albumDesc', $rows['album_desc']);
    }
    //读取相册中相片信息
    $result = selectSql('photos', 'photo_id,photo_name', 'album_id=' . $albumId);
    $photoInfoArr = array();
    if ($result['state'] == 1) {
        while ($rows = mysql_fetch_assoc($result['msg'])) {
            $srcFile = $uploadImgPath . $rows['photo_name'];
            $dstFile = $thumImgPath . '25_25_' . $rows['photo_name'];
            thumbnails(iconv('utf-8', 'gb2312', $srcFile), iconv('utf-8', 'gb2312', $dstFile), 25, 25);
            $photoInfoArr[] = array('id' => $rows['photo_id'], 'name' => $rows['photo_name'], 'path' => $dstFile);