Exemple #1
0
//  +------------------------------------------------------------------------+
//  | O!MPD, Copyright © 2015 Artur Sierzant		                         |
//  | http://www.ompd.pl           		                                     |
//  |                                                                        |
//  |                                                                        |
//  | This program is free software: you can redistribute it and/or modify   |
//  | it under the terms of the GNU General Public License as published by   |
//  | the Free Software Foundation, either version 3 of the License, or      |
//  | (at your option) any later version.                                    |
//  |                                                                        |
//  | This program is distributed in the hope that it will be useful,        |
//  | but WITHOUT ANY WARRANTY; without even the implied warranty of         |
//  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          |
//  | GNU General Public License for more details.                           |
//  |                                                                        |
//  | You should have received a copy of the GNU General Public License      |
//  | along with this program.  If not, see <http://www.gnu.org/licenses/>.  |
//  +------------------------------------------------------------------------+
error_reporting(-1);
ini_set("display_errors", 1);
require_once 'include/initialize.inc.php';
global $cfg, $db;
$offset = is_numeric($_POST['offset']) ? $_POST['offset'] : die;
$postnumbers = is_numeric($_POST['number']) ? $_POST['number'] : die;
$run = mysql_query("SELECT * FROM album WHERE 1 LIMIT " . $postnumbers . " OFFSET " . $offset);
while ($row = mysql_fetch_array($run)) {
    draw_tile(100, $row);
    //$content = $row['album'];
    //echo '<h1><a href="'.$row['artist'].'">'.$row['artist'].'</a></h1><hr />';
    //echo '<p>'.$content.'...</p><hr />';
}
Exemple #2
0
					FROM (
						SELECT album.artist, album.artist_alphabetic, album.album, album.image_id, album.album_id, q.last_time, q.counter
						FROM album
						LEFT JOIN (
							SELECT counter.album_id, max(counter.time) as last_time , count( counter.album_id ) AS counter
							FROM counter
							GROUP BY counter.album_id						
						)q ON album.album_id = q.album_id						
					)a
					WHERE a.last_time < ' . $time4months . ' or a.last_time IS NULL
					');
}					
//$query = mysql_query('call suggested'); 
//mysql_query('UPDATE');
$query = mysql_query("SELECT * FROM suggested 
WHERE album_id NOT IN 
	(SELECT album_id FROM counter WHERE time > " . $modTime  . ")
ORDER BY RAND() LIMIT 10"); 
*/
//$date = date('m/d/Y', time());
$query = mysql_query("SELECT UPDATE_TIME\n\t\tFROM   information_schema.tables\n\t\tWHERE  TABLE_SCHEMA = '" . $cfg['mysql_db'] . "'\n\t\t\t\tAND TABLE_NAME = 'counter' LIMIT 1");
$suggested = mysql_fetch_assoc($query);
$modTime = strtotime($suggested['UPDATE_TIME']);
$time4months = $modTime - 60 * 60 * 24 * 7 * 12;
$query = mysql_query("SELECT * FROM album \n\tWHERE album_id NOT IN \n\t\t(SELECT album_id FROM counter WHERE time > " . $time4months . ")\n\tORDER BY RAND() LIMIT 10");
while ($album = mysql_fetch_assoc($query)) {
    draw_tile($size, $album);
}
?>
	
Exemple #3
0
function album_title()
{
    global $cfg, $db, $size, $search_string, $group_found, $match_found;
    $query = mysql_query('SELECT album_id, image_id, album, artist_alphabetic FROM album WHERE album like "%' . mysql_real_escape_string($search_string) . '%" ORDER BY artist_alphabetic');
    $rows = mysql_num_rows($query);
    if ($rows > 0) {
        $match_found = true;
        if ($group_found == 'none') {
            $group_found = 'AT';
        }
        ?>
	<h1 onclick='toggleSearchResults("AT");' class="pointer"><i id="iconSearchResultsAT" class="fa fa-chevron-circle-down icon-anchor"></i> Album title (<?php 
        if ($rows > 1) {
            echo $rows . " matches found";
        } else {
            $album = mysql_fetch_assoc($query);
            echo $rows . " match found: " . $album['album'];
        }
        ?>
)
	</h1>
	
	<div class="search_artist" id="searchResultsAT">
	<?php 
        $query = mysql_query('SELECT album_id, image_id, album, artist_alphabetic FROM album WHERE album like "%' . mysql_real_escape_string($search_string) . '%" ORDER BY artist_alphabetic');
        while ($album = mysql_fetch_assoc($query)) {
            draw_tile($size, $album);
        }
        ?>
	</div>
	<?php 
    }
}
Exemple #4
0
function viewNew()
{
    global $cfg, $db;
    global $base_size, $spaces, $scroll_bar_correction;
    authenticate('access_media');
    // formattedNavigator
    $nav = array();
    $nav['name'][] = 'Library';
    $nav['url'][] = 'index.php';
    $nav['name'][] = 'New';
    require_once 'include/header.inc.php';
    //$size = get('size');
    //$size = $cfg['thumbnail_size'];
    $i = 0;
    //$colombs	= floor((cookie('netjukebox_width') - 20) / ($size + 10));
    /*$base		= (cookie('netjukebox_width') - 20) / ($base_size + 10);
    	$colombs	= floor($base);
    	$aval_width = (cookie('netjukebox_width') - 20 - $scroll_bar_correction) - ($colombs - 1) * $spaces;
    	$size = floor($aval_width / $colombs);
    	*/
    //$sort_url	= $url;
    //$size_url	= $url . '&amp;order=' . $order . '&amp;sort=' . $sort;
    $query = mysql_query('SELECT COUNT(*) AS counter
		FROM album
		WHERE album_add_time');
    $items_count = mysql_fetch_assoc($query);
    $cfg['items_count'] = $items_count['counter'];
    $page = get('page');
    $max_item_per_page = $cfg['max_items_per_page'];
    $query = mysql_query('SELECT *
		FROM album
		WHERE album_add_time
		ORDER BY album_add_time DESC
		LIMIT ' . ($page - 1) * $max_item_per_page . ',' . $max_item_per_page);
    //$colombs * 20);
    ?>


<h1>
new albums
</h1>


<div class="albums_container">
<?php 
    while ($album = mysql_fetch_assoc($query)) {
        if ($album) {
            if ($tileSizePHP) {
                $size = $tileSizePHP;
            }
            draw_tile($size, $album);
        }
    }
    ?>
</div>

<table cellspacing="0" cellpadding="0" class="border">

<tr class="<?php 
    echo $class;
    ?>
 smallspace"><td colspan="<?php 
    echo $colombs + 2;
    ?>
"></td></tr>
<tr class="line"><td colspan="<?php 
    echo $colombs + 2;
    ?>
"></td></tr>
<?php 
    //$query = mysql_query('SELECT artist FROM album ' . $filter_query . ' GROUP BY artist');
    if (mysql_num_rows($query) < 2) {
        $album = mysql_fetch_assoc($query);
        if ($album['artist'] == '') {
            $album['artist'] = $artist;
        }
        $query = mysql_query('SELECT album_id from track where artist = "' . mysql_real_escape_string($album['artist']) . '"');
        $tracks = mysql_num_rows($query);
        ?>

<tr class="footer">
	<td></td>
	<td colspan="<?php 
        echo $colombs;
        ?>
"><a href="index.php?action=view3all&amp;artist=<?php 
        echo rawurlencode($album['artist']);
        ?>
&amp;order=title">View all <?php 
        echo $tracks . ($tracks == 1 ? ' track from ' : ' tracks from ') . html($album['artist']);
        ?>
</a></td>
	<td></td>
</tr>
<?php 
    }
    ?>

</table>


<?php 
    require_once 'include/footer.inc.php';
}