Не нравятся результаты поиска? Попробуйте другой поиск!
DLE FAQ » Все вопросы » Модули » Доработка модуля музыки DLE Track (лицензия)

Доработка модуля музыки DLE Track (лицензия)


     11.01.2014    Все вопросы » Модули    3568

вопрос
Здравствуйте, давно покупал этот модуль, сейчас понадобился. В нем есть функция ссылки на информацию об исполнителе. Просто в админке при добавлении исполнителя есть строчка куда пишешь ссылку и она должна выводится в шаблоне, но она не выводится.

Ссылка должна выводится тегом {info_link} но на странице выводит как просто текст. Как бы в модуле все запросы, настройки присутствуют, но вот на странице вставляется просто текстом {info_link}.

Вот основной файл модуля, в котором весь основной код.

<?php
/*
=====================================================
DleTrack (Module for CMS DataLife Engine)
-----------------------------------------------------
Copyright (c) 2011, 2012 Alexander Ahminenko
=====================================================
Данный код защищен авторскими правами
-----------------------------------------------------
E-Mail: a.ahminenko@gmail.com | ICQ: 681216
=====================================================
*/
if (! defined ( 'DATALIFEENGINE' )) {
    die ( "Hacking attempt!" );
}
define( 'DLETRACK_DIR', ENGINE_DIR . '/modules/dletrack' );

include ENGINE_DIR . '/data/dletrack.php';
include ENGINE_DIR . '/modules/dletrack/classes/dletrack.class.php';

$dletrack = new DleTrack( ROOT_DIR, $config, $dletrack_config, $db );
$dletrack->metatagAdd( $dletrack_config['main_name'] );

$_content = $dletrack->incCssAndJs( true, false );
$_title = $dletrack_config['main_name'];
$_action = $_REQUEST['act'];

$_hometype = $_COOKIE['dt_hometype'] ? -1 : $dletrack_config['home_type'];
if ( $_hometype == -1 ) {
    switch ( $_COOKIE['dt_hometype'] ) {
        default : $_hometype = $dletrack_config['home_type']; break;
        case 'artist' : $_hometype = 'artist'; break;
        case 'album' : $_hometype = 'album'; break;
        case 'track' : $_hometype = 'track'; break;
    }
}
if ( $_REQUEST['viewby'] ) {
    $viewby = false;
    switch ( $_REQUEST['viewby'] ) {
        case 'artist' : $viewby = true; break;
        case 'album' : $viewby = true; break;
        case 'track' : $viewby = true; break;
    }
    if ( $viewby ) {
        $_hometype = $_REQUEST['viewby'];
        set_cookie( 'dt_hometype', $_REQUEST['viewby'], 365 );
    }
}

if ( $dletrack_config['offline'] == 'yes' ) {
    $_offline = true;
    if ( $is_logged and $member_id['user_group'] == 1 ) {
        $_title .= ' (offline режим)';
        $_offline = false;
    } else {
        $tpl->load_template( 'dletrack/main.tpl' );
        $tpl->set( '{description}', $_title );
        $tpl->set( '{content}', $_content . $dletrack->infoBox( $dletrack_config['offline_reason'] ) );
        $tpl->compile( 'content' );
    }
}

$tpl->load_template( 'dletrack/navigation.tpl' );

$tpl->set( '{link-artists}', $dletrack->parseUrl( '?do=music&viewby=artist', 'music/by-artist' ) );
$tpl->set( '{link-albums}', $dletrack->parseUrl( '?do=music&viewby=album', 'music/by-album' ) );
$tpl->set( '{link-tracks}', $dletrack->parseUrl( '?do=music&viewby=track', 'music/by-track' ) );
$tpl->set( '{link-top}', $dletrack->parseUrl( '?do=music&act=top', 'music/top/' ) );
$tpl->set( '{link-search}', $dletrack->parseUrl( '?do=music&act=search', 'music/search/' ) );
$tpl->set( '{link-addtrack}', $dletrack->parseUrl( '?do=music&act=addtrack', 'music/addtrack/' ) );
$tpl->set( '{link-genres}', $dletrack->parseUrl( '?do=music&act=genres', 'music/genres/' ) );

if ( $_hometype == 'artist' ) $tpl->set_block( "'\\[active-artist\\](.*?)\\[/active-artist\\]'si", "\\1" ); else $tpl->set_block( "'\\[active-artist\\](.*?)\\[/active-artist\\]'si", "" );
if ( $_hometype == 'album' ) $tpl->set_block( "'\\[active-album\\](.*?)\\[/active-album\\]'si", "\\1" ); else $tpl->set_block( "'\\[active-album\\](.*?)\\[/active-album\\]'si", "" );
if ( $_hometype == 'track' ) $tpl->set_block( "'\\[active-track\\](.*?)\\[/active-track\\]'si", "\\1" ); else $tpl->set_block( "'\\[active-track\\](.*?)\\[/active-track\\]'si", "" );
if ( $is_logged and $user_group[$member_id['user_group']]['dt_add_track'] == 1 ) $tpl->set_block( "'\\[allowed-track-add\\](.*?)\\[/allowed-track-add\\]'si", "\\1" ); else $tpl->set_block( "'\\[allowed-track-add\\](.*?)\\[/allowed-track-add\\]'si", "" );
if ( $dletrack_config['genres'] == 'yes' ) $tpl->set_block( "'\\[genres\\](.*?)\\[/genres\\]'si", "\\1" ); else $tpl->set_block( "'\\[genres\\](.*?)\\[/genres\\]'si", "" );

$tpl->compile( 'dletrack-navigation' );
$_content .= $tpl->result['dletrack-navigation'];

if ( $dletrack_config['genres'] == 'yes' ) {
    $dletrack_genres = get_vars( 'dletrack-genres' );
    if ( ! is_array( $dletrack_genres ) ) {
        $dletrack_genres = array( );
        $db->query( "SELECT * FROM " . PREFIX . "_dt_genres ORDER BY name ASC" );
        while ( $row = $db->get_row( ) ) {
            $dletrack_genres[$row['id']] = array( );
            foreach ( $row as $key => $value ) $dletrack_genres[$row['id']][$key] = stripslashes( $value );
        }
        set_vars( 'dletrack-genres', $dletrack_genres );
        $db->free( );
    }
    $dletrack->genreSet( $dletrack_genres );
} else $dletrack_genres = array( );

switch ( $_action ) {
    default :
        $page = intval( $_REQUEST['page'] );
        $page = ( $page <= 0 ) ? 1 : $page;
        $i = 0;
        
        if ( $_hometype == 'artist' ) {
            $limit_hometype = $dletrack_config['artist_topage'];
            $max = ( integer ) $dletrack_config['artist_tostr'];
            $limit = ( $page * $limit_hometype ) - $limit_hometype;
            if ( $dletrack_config['artist_sort'] == 2 ) $sort_sql = 'name DESC';
            elseif ( $dletrack_config['artist_sort'] == 3 ) $sort_sql = 'lastupdate DESC';
            elseif ( $dletrack_config['artist_sort'] == 4 ) $sort_sql = 'rating DESC';
            else $sort_sql = 'name ASC';
            $sql = $db->query( "SELECT id, name, image_cover, rating, info_link, biography FROM " . PREFIX . "_dt_artists ORDER BY {$sort_sql} LIMIT " . $limit . ',' . $limit_hometype );
            $sql_total = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_dt_artists" );
        } elseif ( $_hometype == 'album' ) {
            $limit_hometype = $dletrack_config['album_topage'];
            $max = ( integer ) $dletrack_config['album_tostr'];
            $limit = ( $page * $limit_hometype ) - $limit_hometype;
            if ( $dletrack_config['album_sort'] == 2 ) $sort_sql = 'title DESC';
            elseif ( $dletrack_config['album_sort'] == 3 ) $sort_sql = 'lastupdate DESC';
            elseif ( $dletrack_config['album_sort'] == 4 ) $sort_sql = 'rating DESC';
            else $sort_sql = 'title ASC';
            $sql = $db->query( "SELECT id, title, artist, image_cover, rating, info_link FROM " . PREFIX . "_dt_albums ORDER BY {$sort_sql} LIMIT " . $limit . ',' . $limit_hometype );
            $sql_total = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_dt_albums" );
        } elseif ( $_hometype == 'track' ) {
            $limit_hometype = $dletrack_config['track_topage'];
            $max = ( integer ) $dletrack_config['track_tostr'];
            $limit = ( $page * $limit_hometype ) - $limit_hometype;
            if ( $dletrack_config['track_sort'] == 2 ) $sort_sql = 'title DESC';
            elseif ( $dletrack_config['track_sort'] == 3 ) $sort_sql = 'upload_time DESC';
            elseif ( $dletrack_config['track_sort'] == 4 ) $sort_sql = 'rating DESC';
            else $sort_sql = 'title ASC';
            $sql = $db->query( "SELECT id, title, artist, image_cover, rating, tags_time FROM " . PREFIX . "_dt_tracks ORDER BY {$sort_sql} LIMIT " . $limit . ',' . $limit_hometype );
            $sql_total = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_dt_tracks" );
        }
        
        $width = round( 100 / $max, 0 ) . '%';
        $count = $sql_total['count'];
        $total_pages = ceil( $count / $limit_hometype );
        
        if ( $_hometype == 'artist' ) {
            if ( $db->num_rows( $sql ) > 0 ) {
                $favorite = explode( ',', $member_id['dt_favorite_artist'] );
                $tpl->result['dletrack-artists'] = '';
                while ( $row = $db->get_row( $sql ) ) {
                    if ( $i == $max ) {
                        $tpl->result['dletrack-artists'] .= '</tr><tr><td colspan="' . $max . '" style="padding-top:5px;"></td></tr><tr>';
                        $i = 1;
                    } else $i ++;
                    $tpl->load_template( 'dletrack/block-artist.tpl' );
                    $tpl->set( '{table-width}', $width );
                    $tpl->set( '{artist}', stripslashes( ( ( dle_strlen( $row['name'], $config['charset'] ) > $dletrack_config['artist_max_len'] ) ? dle_substr( $row['name'], 0, $dletrack_config['artist_max_len'], $config['charset'] ) . '...' : $row['name'] ) ) );
                    $tpl->set( '{cover-url}', ( empty( $row['image_cover'] ) ? $config['http_home_url'] . 'uploads/dletrack/default/artist.png' : $config['http_home_url'] . 'uploads/dletrack/' . $row['image_cover'] ) );
                    $tpl->set( '{artist-id}', $row['id'] );
                    $tpl->set( '{rating}', $row['rating'] );
                    if ( $dletrack_config['biography'] == 'yes' and $row['biography'] == 1 ) {
                        $tpl->set( '{biography-link}', $dletrack->parseUrl( '?do=music&act=biography&artist_id=' . $row['id'], 'music/biography/' . $row['id'] . '-' . totranslit( $row['name'] ) . '.html' ) );
                        $tpl->set_block( "'\\[biography\\](.*?)\\[/biography\\]'si", "\\1" );
                    } else $tpl->set_block( "'\\[biography\\](.*?)\\[/biography\\]'si", "" );
                    if ( $is_logged and $dletrack_config['favorite_artist'] == 'yes' ) {
                        $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "\\1" );
                        if ( in_array( $row['id'], $favorite ) ) {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_del'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-del.png' );
                        } else {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_add'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-add.png' );
                        }
                    } else $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "" );
                    if ( $dletrack_config['short_rate_artist'] == 'yes' ) $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "\\1" );
                    else $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "" );
                    if ( $dletrack_config['artist_next_act'] == 'albums' ) $tpl->set( '{link}', $dletrack->parseUrl( '?do=music&act=albums&artist_id=' . $row['id'], 'music/albums/' . $row['id'] . '-' . totranslit( $row['name'] ) . '/' ) );
                    elseif ( $dletrack_config['artist_next_act'] == 'tracks' ) $tpl->set( '{link}', $dletrack->parseUrl( '?do=music&act=tracks&artist_id=' . $row['id'], 'music/tracks/' . $row['id'] . '-' . totranslit( $row['name'] ) . '/' ) );
                    if ( $dletrack_config['allow_infolink'] == 'yes' and substr_count( $row['info_link'], 'http' ) > 0 ) {
                        $tpl->set( '{info-link}', $row['info_link'] );
                        $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "\\1" );
                    } else $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "" );
                    $tpl->compile( 'dletrack-artists' );
                }
                $_content .= $dletrack->letters( 'artists' );
                $_content .= '<table width="100%"><tr>' . $tpl->result['dletrack-artists'] . '</tr></table>';
            } else {
                $_content .= $dletrack->infoBox( $dletrack_lang['not_artists'] );
            }
        } elseif ( $_hometype == 'album' ) {
            if ( $db->num_rows( $sql ) > 0 ) {
                $favorite = explode( ',', $member_id['dt_favorite_album'] );
                $tpl->result['dletrack-albums'] = '';
                while ( $row = $db->get_row( $sql ) ) {
                    if ( $i == $max ) {
                        $tpl->result['dletrack-albums'] .= '</tr><tr><td colspan="' . $max . '" style="padding-top:5px;"></td></tr><tr>';
                        $i = 1;
                    } else $i ++;
                    $tpl->load_template( 'dletrack/block-album.tpl' );
                    $tpl->set( '{table-width}', $width );
                    $tpl->set( '{artist}', stripslashes( ( ( dle_strlen( $row['artist'], $config['charset'] ) > $dletrack_config['artist_max_len'] ) ? dle_substr( $row['artist'], 0, $dletrack_config['artist_max_len'], $config['charset'] ) . '...' : $row['artist'] ) ) );
                    $tpl->set( '{title}', stripslashes( ( ( dle_strlen( $row['title'], $config['charset'] ) > $dletrack_config['album_max_len'] ) ? dle_substr( $row['title'], 0, $dletrack_config['album_max_len'], $config['charset'] ) . '...' : $row['title'] ) ) );
                    $tpl->set( '{cover-url}', ( empty( $row['image_cover'] ) ? $config['http_home_url'] . 'uploads/dletrack/default/album.png' : $config['http_home_url'] . 'uploads/dletrack/' . $row['image_cover'] ) );
                    $tpl->set( '{link}', $dletrack->parseUrl( '?do=music&act=tracks&album_id=' . $row['id'], 'music/tracks/' . totranslit( $row['artist'] ) . '/' . $row['id'] . '-' . totranslit( $row['title'] ) . '/' ) );
                    $tpl->set( '{album-id}', $row['id'] );
                    $tpl->set( '{rating}', $row['rating'] );
                    if ( $is_logged and $dletrack_config['favorite_album'] == 'yes' ) {
                        $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "\\1" );
                        if ( in_array( $row['id'], $favorite ) ) {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_del'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-del.png' );
                        } else {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_add'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-add.png' );
                        }
                    } else $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "" );
                    if ( $dletrack_config['short_rate_album'] == 'yes' ) $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "\\1" );
                    else $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "" );
                    if ( $dletrack_config['allow_infolink'] == 'yes' and substr_count( $row['info_link'], 'http' ) > 0 ) {
                        $tpl->set( '{info-link}', $row['info_link'] );
                        $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "\\1" );
                    } else $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "" );
                    $tpl->compile( 'dletrack-albums' );
                }
                $_content .= $dletrack->letters( 'albums' );
                $_content .= '<table width="100%"><tr>' . $tpl->result['dletrack-albums'] . '</tr></table>';
            } else {
                $_content .= $dletrack->infoBox( $dletrack_lang['not_albums'] );
            }
        } elseif ( $_hometype == 'track' ) {
            if ( $db->num_rows( $sql ) > 0 ) {
                $favorite = explode( ',', $member_id['dt_favorite_track'] );
                $tpl->result['dletrack-tracks'] = '';
                while ( $row = $db->get_row( $sql ) ) {
                    if ( $i == $max ) {
                        $tpl->result['dletrack-tracks'] .= '</tr><tr><td colspan="' . $max . '" style="padding-top:5px;"></td></tr><tr>';
                        $i = 1;
                    } else $i ++;
                    $tpl->load_template( 'dletrack/block-track.tpl' );
                    $tpl->set( '{table-width}', $width );
                    $tpl->set( '{artist}', stripslashes( ( ( dle_strlen( $row['artist'], $config['charset'] ) > $dletrack_config['artist_max_len'] ) ? dle_substr( $row['artist'], 0, $dletrack_config['artist_max_len'], $config['charset'] ) . '...' : $row['artist'] ) ) );
                    $tpl->set( '{title}', stripslashes( ( ( dle_strlen( $row['title'], $config['charset'] ) > $dletrack_config['track_max_len'] ) ? dle_substr( $row['title'], 0, $dletrack_config['track_max_len'], $config['charset'] ) . '...' : $row['title'] ) ) );
                    $tpl->set( '{cover-url}', ( empty( $row['image_cover'] ) ? $config['http_home_url'] . 'uploads/dletrack/default/album.png' : $config['http_home_url'] . 'uploads/dletrack/' . $row['image_cover'] ) );
                    $tpl->set( '{link}', $dletrack->parseUrl( '?do=music&act=track&track_id=' . $row['id'], 'music/track/' . totranslit( $row['artist'] ) . '/' . $row['id'] . '-' . totranslit( $row['title'] ) . '/' ) );
                    $tpl->set( '{time}', $dletrack->parseTime( $row['tags_time'], 'm:ss' ) );
                    $tpl->set( '{track-id}', $row['id'] );
                    $tpl->set( '{rating}', $row['rating'] );
                    if ( $is_logged and $dletrack_config['favorite_track'] == 'yes' ) {
                        $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "\\1" );
                        if ( in_array( $row['id'], $favorite ) ) {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_del'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-del.png' );
                        } else {
                            $tpl->set( '{favorite-title}', $dletrack_lang['favorite_add'] );
                            $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-add.png' );
                        }
                    } else $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "" );
                    if ( $dletrack_config['short_rate_track'] == 'yes' ) $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "\\1" );
                    else $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "" );
                    $tpl->compile( 'dletrack-tracks' );
                }
                $_content .= $dletrack->letters( 'tracks' );
                $_content .= '<table width="100%"><tr>' . $tpl->result['dletrack-tracks'] . '</tr></table>';
            } else {
                $_content .= $dletrack->infoBox( $dletrack_lang['not_tracks'] );
            }
        }
        
        if ( $count > $limit_hometype ) {
            if ( $page <= $total_pages and $page > 1 ) $dletrack->metatagAdd( $dletrack_lang['text_page'] . ' #' . $page );
            $tpl->load_template( 'navigation.tpl' );
            if ( $page > 1 ) {
                $tpl->set( '[prev-link]', '<a href="' . ( $dletrack->parseUrl( '?do=music&page=' . ( $page - 1 ), 'music/page-' . ( $page - 1 ) . '.html' ) ) . '">' );
                $tpl->set( '[/prev-link]', '</a> ' );
            } else {
                $tpl->set( '[prev-link]', '<span>' );
                $tpl->set( '[/prev-link]', '</span>' );
            }
            $enpages_count = $total_pages;
            $pages = '';
            $cstart = $page;
            if ( $enpages_count <= 10 ) {
                for ( $j = 1; $j <= $enpages_count; $j ++ ) {
                    if ( $j != $cstart ) $pages .= "<a href=\"" . ( $dletrack->parseUrl( '?do=music&page=' . $j, 'music/page-' . $j . '.html' ) ) . "\">$j</a> ";
                    else $pages .= "<span>$j</span> ";
                }
            } else {
                $start = 1;
                $end = 10;
                $nav = '<span>...</span>';
                if ( $cstart > 0 ) {
                    if ( $cstart > 6 ) {
                        $start = $cstart - 4;
                        $end = $start + 8;
                        if ( $end >= $enpages_count ) {
                            $start = $enpages_count - 9;
                            $end = $enpages_count - 1;
                            $nav = '';
                        } else $nav = '<span>...</span>';
                    }
                }
                if ( $start >= 2 ) $pages .= "<a href=\"" . ( $dletrack->parseUrl( '?do=music&page=1', 'music/page-1.html' ) ) . "\">1</a> <span>...</span> ";
                for ( $j = $start; $j <= $end; $j ++ ) {
                    if ( $j != $cstart ) $pages .= "<a href=\"" . ( $dletrack->parseUrl( '?do=music&page=' . $j, 'music/page-' . $j . '.html' ) ) . "\">$j</a> ";
                    else $pages .= "<span>$j</span> ";
                }
                if ( $cstart != $enpages_count ) $pages .= "$nav <a href=\"" . ( $dletrack->parseUrl( '?do=music&page=' . $enpages_count, 'music/page-' . $enpages_count . '.html' ) ) . "\">$enpages_count</a> ";
                else $pages .= "<span>$enpages_count</span> ";
            }
            $tpl->set( '{pages}', $pages );
            if ( $page != $total_pages ) {
                $tpl->set( '[next-link]', ' <a href="' . ( $dletrack->parseUrl( '?do=music&page=' . ( $page + 1 ), 'music/page-' . ( $page + 1 ) . '.html' ) ) . '">' );
                $tpl->set( '[/next-link]', '</a>' );
            } else {
                $tpl->set( '[next-link]', '<span>' );
                $tpl->set( '[/next-link]', '</span>' );
            }
            $tpl->compile( 'navigation' );
            $_content .= '<br />' . $tpl->result['navigation'];
        }
        break;
    case 'albums' :
        $artist_id = intval( $_REQUEST['artist_id'] );
        
        $page = intval( $_REQUEST['page'] );
        $page = ( $page <= 0 ) ? 1 : $page;
        $i = 0;
        
        $limit_hometype = $dletrack_config['album_topage'];
        $max = ( integer ) $dletrack_config['album_tostr'];
        $limit = ( $page * $limit_hometype ) - $limit_hometype;
        if ( $dletrack_config['album_sort'] == 2 ) $sort_sql = 'title DESC';
        elseif ( $dletrack_config['album_sort'] == 3 ) $sort_sql = 'lastupdate DESC';
        elseif ( $dletrack_config['album_sort'] == 4 ) $sort_sql = 'rating DESC';
        else $sort_sql = 'title ASC';
        $sql = $db->query( "SELECT id, title, artist, image_cover, rating, info_link FROM " . PREFIX . "_dt_albums WHERE artist_id = '$artist_id' ORDER BY {$sort_sql} LIMIT " . $limit . ',' . $limit_hometype );
        $sql_total = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_dt_albums WHERE artist_id = '$artist_id'" );
        
        $width = round( 100 / $max, 0 ) . '%';
        $count = $sql_total['count'];
        $total_pages = ceil( $count / $limit_hometype );
        
        if ( $db->num_rows( $sql ) > 0 ) {
            $favorite = explode( ',', $member_id['dt_favorite_album'] );
            $tpl->result['dletrack-albums'] = '';
            while ( $row = $db->get_row( $sql ) ) {
                $artist = stripslashes( $row['artist'] );
                if ( $i == $max ) {
                    $tpl->result['dletrack-albums'] .= '</tr><tr><td colspan="' . $max . '" style="padding-top:5px;"></td></tr><tr>';
                    $i = 1;
                } else $i ++;
                $tpl->load_template( 'dletrack/block-album.tpl' );
                $tpl->set( '{table-width}', $width );
                $tpl->set( '{artist}', stripslashes( ( ( dle_strlen( $row['artist'], $config['charset'] ) > $dletrack_config['artist_max_len'] ) ? dle_substr( $row['artist'], 0, $dletrack_config['artist_max_len'], $config['charset'] ) . '...' : $row['artist'] ) ) );
                $tpl->set( '{title}', stripslashes( ( ( dle_strlen( $row['title'], $config['charset'] ) > $dletrack_config['album_max_len'] ) ? dle_substr( $row['title'], 0, $dletrack_config['album_max_len'], $config['charset'] ) . '...' : $row['title'] ) ) );
                $tpl->set( '{cover-url}', ( empty( $row['image_cover'] ) ? $config['http_home_url'] . 'uploads/dletrack/default/album.png' : $config['http_home_url'] . 'uploads/dletrack/' . $row['image_cover'] ) );
                $tpl->set( '{link}', $dletrack->parseUrl( '?do=music&act=tracks&album_id=' . $row['id'], 'music/tracks/' . totranslit( $row['artist'] ) . '/' . $row['id'] . '-' . totranslit( $row['title'] ) . '/' ) );
                $tpl->set( '{album-id}', $row['id'] );
                $tpl->set( '{rating}', $row['rating'] );
                if ( $is_logged and $dletrack_config['favorite_album'] == 'yes' ) {
                    $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "\\1" );
                    if ( in_array( $row['id'], $favorite ) ) {
                        $tpl->set( '{favorite-title}', $dletrack_lang['favorite_del'] );
                        $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-del.png' );
                    } else {
                        $tpl->set( '{favorite-title}', $dletrack_lang['favorite_add'] );
                        $tpl->set( '{favorite-image}', '{THEME}/dletrack/images/favorite-add.png' );
                    }
                } else $tpl->set_block( "'\\[favorite\\](.*?)\\[/favorite\\]'si", "" );
                if ( $dletrack_config['short_rate_album'] == 'yes' ) $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "\\1" );
                else $tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "" );
                if ( $dletrack_config['allow_infolink'] == 'yes' and substr_count( $row['info_link'], 'http' ) > 0 ) {
                    $tpl->set( '{info-link}', $row['info_link'] );
                    $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "\\1" );
                } else $tpl->set_block( "'\\[info-link\\](.*?)\\[/info-link\\]'si", "" );
                $tpl->compile( 'dletrack-albums' );
            }
            if ( $dletrack_config['metaadd'] == 'yes' ) $metatags['keywords'] .= ', ' . $artist;
            $dletrack->metatagAdd( $artist );
            $_title .= ' &raquo; ' . $artist;
            $_content .= '<table width="100%"><tr>' . $tpl->result['dletrack-albums'] . '</tr></table>';
        } else {
            $_content .= $dletrack->infoBox( $dletrack_lang['not_albums'] );
        }
        
        if ( $count > $limit_hometype ) {
            if ( $page <= $total_pages and $page > 1 ) $dletrack->metatagAdd( $dletrack_lang['text_page'] . ' #' . $page );
 &n

Ответа пока нет


5 комментариев

Artyom91
Юзер

Artyom91 - 11 января 2014 15:52 -

Блин, не вместился :) что делать?

Artyom91
Юзер

Artyom91 - 11 января 2014 15:55 -

Функция в шаблон вставляется тегом

{info-link}


а не

{info_link}

Artyom91
Юзер

Artyom91 - 11 января 2014 15:56 -

Функция в шаблон вставляется тегом

{info-link}


а не

{info_link}

nambo1
Юзер

nambo1 - 11 января 2014 22:17 -

Уберите код в теги что-ли.... а то зашёл на главную

Artyom91
Юзер

Artyom91 - 12 января 2014 06:02 -

К сожалению нет прав на редактирование, так бы сделал по другому.

Чтобы комментировать - войдите или зарегистрируйтесь на сайте

Похожие вопросы

наверх