Пример #1
0
function print_file($sid, $showlink = 0, $includeabsolute = 0, $f2 = false, $smarksid = -1)
{
    global $u_cookieid, $setctl, $cfg, $marksid;
    if (!$f2) {
        $f2 = new file2($sid, true);
    }
    $inf = $f2->getid3();
    $title = $f2->gentitle(array('title', 'album'));
    echo '<tr><td><input type="checkbox" name="fsel[]" value="' . $sid . '"/> ';
    if ($cfg['id3editor'] && db_guinfo('u_access') == 0 && function_exists('file_id3editor')) {
        $id3link = '&amp;id3sid=' . $sid;
        echo '<a href="javascript: void(0);" onclick="' . jswin('id3editor', '?action=id3edit' . $id3link) . '">id3</a>&nbsp;';
    }
    if (ALLOWDOWNLOAD && db_guinfo('u_allowdownload')) {
        if (URLSECURITY) {
            $urlextra = '&amp;' . urlsecurity($f2->fdate, $sid);
        } else {
            $urlextra = '';
        }
        echo '<span class="file"><a href="' . PHPSELF . "?downloadfile=" . $sid . '&amp;c=' . $u_cookieid . $urlextra . '">' . '<img src="' . getimagelink('saveicon.gif') . '" alt="' . get_lang(117) . '" border="0"/></a></span> ';
    }
    if (SHOWLYRICSLINK && !empty($inf['title']) && !empty($inf['artist'])) {
        $url = parseurl($setctl->get('lyricsurl'), $inf['title'], $inf['artist'], $inf['album']);
        echo '<a class="file" onclick="' . jswin('lyrics', $url, 410, 675, true, 'newwinscroll', '') . '"';
        echo ' href="javascript: void(0);"><img border="0" src="' . getimagelink('lyrics.gif') . '" alt="' . get_lang(303) . '"/></a> ';
    }
    if (MAILMP3 && db_guinfo('allowemail') && class_exists('mailmp3')) {
        echo '<a href="javascript: void(0);" onclick="' . jswin('mp3mail', '?action=sendmail&amp;id=' . $sid . '&amp;c=' . $u_cookieid, 195, 390) . '">' . '<img src="' . getimagelink('sendmail.gif') . '" alt="' . get_lang(223) . '" border="0"/></a>&nbsp;';
    }
    if ($showlink) {
        echo '<a href="' . PHPSELF . '?pwd=' . $f2->getdir64() . '&amp;d=' . $f2->drive . '&amp;marksid=' . $smarksid . '" title="' . get_lang(116, checkchs($f2->relativepath)) . '">' . '<img src="' . getimagelink('link.gif') . '" alt="' . get_lang(116, checkchs($f2->relativepath)) . '" border="0"/></a>&nbsp;';
    }
    if (ismarked($f2->fname . $title) || $f2->sid == $marksid) {
        $useclass = 'filemarked';
    } else {
        $useclass = 'file';
    }
    $fd = new filedesc($f2->fname);
    if (WINDOWPLAYER && $fd->m3u) {
        $kpwjs = new kpwinjs();
        $link = '" onclick="javascript: ' . $kpwjs->single($f2->sid) . ' return false;';
    } else {
        $link = $f2->mklink();
    }
    echo file_parse($f2, $link, $useclass);
    echo '</td></tr>';
}