function pdp_render_download($id, $data, $links, $files, $images, $old_data)
    {
        global $locale, $pdp;
        $down_link = '';
        if (!$data['can_download']) {
        } elseif (!empty($old_data['down']) || !empty($old_data['link_extern'])) {
            $down_link = array('did' => $id, 'file' => 0);
        } elseif (count($files)) {
            $latest_download = array_shift($files);
            $down_link = array('did' => $id, 'file' => $latest_download['id']);
            $old_ver = $latest_download['ver'];
            $old_size = $latest_download['size'];
            array_unshift($files, $latest_download);
        }
        if (is_array($down_link)) {
            $down_link = '
<form action="file.php" method="get">
<input type="hidden" name="did" value="' . $down_link['did'] . '" />
<input type="hidden" name="file_id" value="' . $down_link['file'] . '" />
<input type="submit" class="button" value="' . $locale['PDP201'] . '" />
</form>';
        } else {
            $down_link = parseubb($pdp->settings['download_restricted']);
            if (FUSION_VERSION != 'FF') {
                $down_link = nl2br($down_link);
            }
        }
        if (!empty($data['pic'])) {
            $pic = $data['pic'];
            $pic_id = 0;
        } elseif (count($images)) {
            $first_pic = $images[0];
            $pic = $first_pic['url'];
            $pic_id = $first_pic['id'];
        } else {
            $pic = "";
        }
        echo "<p><font size='+1'><b>" . $data['name'] . "</b></font>\n";
        echo "<hr />\n\n<table border='0' cellspacing='2' width='100%' cellpadding='0'>\n<tr>\n\t<td valign='top' colspan='2'>" . $data['desc'] . "</td>\n\t<td width='150' valign='top' rowspan='2'>\n\t<table class='tbl-border' cellspacing='1' width='100%'>";
        // version
        if (!empty($old_data['version'])) {
            echo "<tr><td class='tbl2' align='center'>" . $locale['PDP018'] . ":<br />" . $old_data['version'] . "</td>";
        }
        // homepage
        if (!empty($data['homepage'])) {
            echo "<tr><td class='tbl2' align='center'><a href='" . $data['homepage'] . "'" . " target='_blank'>" . $locale['PDP020'] . "</a></td>";
        }
        // screenshot
        if (!empty($pic)) {
            echo "<tr>\n\t<td align='center' class='tbl2'>" . "<a href='image.php?did=" . $id . "&amp;pic_id={$pic_id}'>" . $locale['PDP028'] . "</a></td>\n</tr>";
        }
        // download count
        echo "<tr>\n\t<td align='center' class='tbl2'>" . $locale['pdp_downloads'] . ":<br />" . pdpCore::format_number($data['count']) . "</td>\n</tr>";
        // FIXME TODO
        if (!empty($old_data['size'])) {
            echo "<tr><td align='center' class='tbl2'>" . $locale['PDP029'] . ":<br />" . $old_data['size'] . "</td></tr>";
        }
        if (!empty($data['license'])) {
            echo "<tr>\n\t<td align='center' class='tbl2'>" . $locale['pdp_license'] . ': ' . $data['license'] . "</td>\n</tr>";
        }
        // who posted and when.
        echo "<tr><td align='center' class='tbl2'>" . ($data['user_id'] ? "<a href='profile.php?id=" . $data['user_id'] . "'>" . $data['user_name'] . "</a><br />" : "") . showdate("shortdate", $data['mtime']) . "</td>\n</tr>\n";
        if (!empty($data['copyright'])) {
            echo "<tr>\n\t<td class='tbl2' align='center'>" . $data['copyright'] . "</td>\n</tr>\n";
        }
        if ($data['allow_notify']) {
            if ($data['can_subscribe']) {
                echo "<tr>\n\t<td class='tbl2' align='center'>" . ($data['is_subscribing'] ? "<a href='include/do_did.php?did=" . $id . "&amp;subscibe=0'>" . $locale['PDP060'] . "</a>" : "<a href='include/do_did.php?did=" . $id . "&amp;subscibe=1'>" . $locale['PDP059'] . "</a>") . "</td>\n</tr>\n";
            }
        }
        echo "</table></td>\n</tr>\n<tr>\n\t<td align='center' valign='bottom'>" . $down_link . "\n\t</td>\n</tr>\n</table>\n<hr />\n";
        // report broken downloads
        echo "<div align='right'>";
        if (iPDP_BROKEN) {
            echo "[ <a href='broken.php?did=" . $id . "'>" . $locale['PDP024'] . "</a> ]<br />";
        }
        // edit link
        if (count($links)) {
            echo "<b>" . $locale['pdp_edit'] . ":</b> [ " . implode(" | ", $links) . " ]";
        }
        echo "</div>\n";
        // files
        if (count($files)) {
            echo '<strong>' . $locale['PDP200'] . ":</strong><ul>\n";
        }
        foreach ($files as $row) {
            echo "<li>" . showdate("shortdate", $row['timestamp']) . " - <b>" . $row['ver'] . " - </b>";
            if ($data['can_download']) {
                echo " <a href='file.php?did=" . $id . "&amp;file_id=" . $row['id'] . "'" . " title='" . $row['url'] . "'>" . trimlink($row['url'], 40) . "</a>";
            } else {
                echo trimlink($row['url'], 40);
            }
            echo " (<span class='small2'>" . $row['size'] . " - " . $row['desc'] . ")</span>" . "</li>\n";
        }
        if (count($files)) {
            echo "</ul>\n";
        }
    }
Пример #2
0
<p>
	' . $locale['PDP300'] . '
</p>
<ul>';
//<table width='100%' cellspacing='0' cellpadding='0'>\n";
foreach ($downs as $data) {
    echo '
	<li><a href="' . INFUSIONS . 'pro_download_panel/download.php' . '?did=' . $data['id'] . '" title="' . $data['name'] . '">' . trimlink($data['name'], 18) . '</a></li>';
}
echo '
</ul>';
$downs = array();
pdpCore::get_downloads($get, 'dl_count DESC', 0, $pdp->settings['side_top'], true, $downs, false);
echo '
<p>
' . str_replace('%s', $pdp->settings['side_top'], $locale['PDP301']) . '
</p>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>';
foreach ($downs as $data) {
    echo '
<tr>
	<td><a href="' . INFUSIONS . 'pro_download_panel/download.php?did=' . $data['id'] . '" title="' . $data['name'] . '">' . trimlink($data['name'], 18) . '</a></td>
	<td align="right">' . pdpCore::format_number($data['downloads']) . '</td>
</tr>';
}
echo '
</tbody>
</table>';
closeside();