Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/top.php
<?php

/**********************************************************
*  ______   ______   ___      _______  ___ ___  _______   *
* |   _  \ |   _  \ |   |    |   _   ||   Y   ||   _   |  *
* |.  |   \|.  |   \|.  |    |.  1___||.      ||   1___|  *
* |.  |    |.  |    |.  |___ |.  |___ |. \_/  ||____   |  *
* |:  1    |:  1    |:  1   ||:  1   ||:  |   ||:  1   |  *
* |::.. . /|::.. . /|::.. . ||::.. . ||::.|:. ||::.. . |  *
* `------' `------' `-------'`-------'`--- ---'`-------'  *
*                                _______        _______   *
*                    .--.--.    |   _   |      |       |  *
*                    |  |  |    |___|   |  __  |___|   |  *
*                     \___/      _(__   | |__|  /  ___/   *
*                               |:  1   |      |:  1  \   *
*                               |::.. . |      |::.. . |  *
*                               `-------'      `-------'  *
*                                                         *
*                                   Script: DDLCMS v3.2   *
*                                 Author: Little Dragon   *
*                              Email: hide@address.com   *
*                        Website: http://www.ddlcms.com   *
*                                                         *
*    Please direct bug reports, suggestions or feedback   *
*                                 to the DDLCMS forums:   *
*                                                         *
*                          http://www.ddlcms.com/forums   *
*                                                         *
*    DDLCMS is a commercial grade content management      *
*    system for DDL site owners. It is provided free      *
*    of charge, provided:                                 *
*                                                         *
*    1. You keep the linkback to http://www.ddlcms.com    *
*       in the footer.                                    *
*                                                         *
*    2. You keep the sponsored links to Sharingzone.net   *
*       on your site.                                     *
*                                                         *
*    By using this script, you agree that you will not    *
*    modify, remove, or replace any encoded parts of      *
*    this script. All encoded parts MUST remain intact    *
*    for your site to remain in good standing.            *
*                                                         *
**********************************************************/

	define('WWWROOT', dirname(__FILE__) . '/');
	define('BASEDIR', substr(WWWROOT, 0, ##BASEDIR##));
	require(BASEDIR . 'funcs.inc');
	require(BASEDIR . 'config.php');
	# Add || here to check within categories
	if(checkURLQuery('top.php', $_GET) !== TRUE)
	{
		require(WWWROOT . 'skins/' . $skin . '/header.php');
?>
<!-- BEGIN BODY -->
<table border="0" width="90%">
	<tr>
		<td align="left">

			An error occurred.

		</td>
	</tr>
</table>
<!-- END BODY -->
<?php
	require(WWWROOT . 'skins/' . $skin . '/footer.php');

	}
	else
	{
		$toptype = $_GET['toptype']; 
		require(WWWROOT . 'skins/' . $skin . '/header.php');
	?>


<!-- BEGIN BODY -->
<table border="0" width="100%">
	<tr>
		<td width="100%">

									<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php
		if($toptype == 'Xxx')
		{
			include(WWWROOT . 'edit/adblock3.php');
		}
		elseif($showSponsoredLinks == 1)
		{
?>
										<tr valign="top">
											<td colspan="2" class="h4">
												<h4>Sponsored Links:</h4>
											</td>
											<td colspan="3" class="h4fade"></td>
										</tr>
										<tr>
											<td width="50" align="left" style="padding-left: 5px"><b>Type</b></td>
											<td width="*" align="left">&nbsp; <b>Download Name + Rating (1 - 5)</b></td>
											<td width="120" align="center"><b>Date</b></td>
<?php
			if($arrowsForProvider == 1)
			{
?>
											<td width="150" align="center"> <b>Provider</b> &nbsp;</td>
<?php
			}
			else
			{
?>
											<td width="150" align="left"> <b>Provider</b> &nbsp;</td>
<?php
			}
?>
											<td width="30" align="right"><b>Views</b></td>
										</tr>
										<tr><td colspan="5" height="10"></td></tr>
<?php
			for($i = 0; $i < 3; $i++)
			{
				require(WWWROOT . 'edit/extraline.php');
			}
?>
										<tr><td colspan="5" height="20"></td></tr>
<?php
		}
?>
										<tr valign="top">
											<td colspan="2" class="h4">
												<h4>Top <?php echo $topdownloads . ' ' . $toptype; ?> Downloads:</h4>
											</td>
											<td colspan="3" class="h4fade"></td>
										</tr>
										<tr>
											<td width="50" align="left" style="padding-left: 5px"><b>Type</b></td>
											<td width="*" align="left">&nbsp; <b>Download Name</b></td>
											<td width="120" align="center"><b>Date</b></td>
<?php
		if($arrowsForProvider == 1)
		{
?>
											<td width="150" align="center"> <b>Provider</b> &nbsp;</td>
<?php
		}
		else
		{
?>
											<td width="150" align="left"> <b>Provider</b> &nbsp;</td>
<?php
		}
?>
											<td width="30" align="right"><b>Views</b></td>
										</tr>
										<tr><td colspan="5" height="10"></td></tr>
<?php
		if($toptype)
		{
			$getit = dbcom("SELECT id, type, title, url, sname, surl, UNIX_TIMESTAMP(date) AS theDate, email, views, reports, rating, ip FROM downloads WHERE type = '$toptype' AND views > 0 ORDER BY views DESC LIMIT 0,$topdownloads;");
		}
		else
		{
			$getit = dbcom("SELECT id, type, title, url, sname, surl, UNIX_TIMESTAMP(date) AS theDate, email, views, reports, rating, ip FROM downloads WHERE type <> 'Xxx' AND views > 0 ORDER BY views DESC LIMIT 0,$topdownloads;");
		}
		$lastSURL = '';
		$counter = 0;
		while($row = mysql_fetch_array($getit))
		{
			$counter++;
			$title = str_replace(array("'", '"', ';'), '', $row['title']);
			$titlet = $title;
			$title = substr($titlet, 0, 60);
			# Corrections in case files were submitted to the site using an offsite Autosubmitter:
			$type = capitalize($row['type']);
			if($type == 'Ebook' || $type == 'EBook')
			{
				$type = 'eBook';
			}
			if($type == 'XXX')
			{
				$type = 'Xxx';
			}
			if(!in_array($type, $categories))
			{
				# It's not a part of our allowed types
				$type = 'Other';
			}
?>
										<tr onmouseover="this.style.backgroundColor='<?php echo $hovercolor; ?>'; window.status='<?php echo $title; ?>'; return true;" onmouseout="this.style.backgroundColor=''; window.status=''">
											<td align="left" style="padding-left: 5px"><?php echo $type; ?></td>
<?php
			if(strtoupper($type) == 'XXX')
			{
?>
											<td align="left">&nbsp; <a href="http://<?php echo $cbusername; ?>.sharingzone.net?x=<?php echo $title; ?>" target="_blank"><img src="skins/<?php echo $skin; ?>/dl.gif" height="11" width="11" alt="<?php echo $keywords; ?>" border="0" /></a> <?php echo $counter; ?>. <a href="<?php echo $site_url; ?>/free-xxx-direct-download-<?php echo $row['id']; ?>-<?php echo str_replace(' ', '.', $title); ?>.htm" target="_blank" title="Download <?php echo $title; ?>"><?php echo $title; ?></a> 
<?php
			}
			else
			{
?>
											<td align="left">&nbsp; <a href="http://<?php echo $cbusername; ?>.sharingzone.net?q=<?php echo $title; ?>" target="_blank"><img src="skins/<?php echo $skin; ?>/dl.gif" height="11" width="11" alt="<?php echo $keywords; ?>" border="0" /></a> <?php echo $counter; ?>. <a href="<?php echo $site_url; ?>/free-direct-download-<?php echo $row['id']; ?>-<?php echo str_replace(' ', '.', $title); ?>.htm" target="_blank" title="Download <?php echo $title; ?>"><?php echo $title; ?></a> 
<?php
			}
			$unrating = 5;
			for($i = 0; $i < $row['rating'] && $i < 5; $i++)
			{
												echo '<img src="skins/' . $skin . '/star.gif" height="10" width="10" border="0" alt="Download Rating" />';
				$unrating--;
			}
			for($i = 0; $i < $unrating && $i < 5; $i++)
			{
												echo '<img src="skins/' . $skin . '/unstar.gif" height="10" width="10" border="0" alt="Download Rating" />';
			}
?>
											</td>
<?php
			if(date($date_format, $row['theDate']) == date($date_format, time()))
			{
?>
											<td align="center">Today</td>
<?php
			}
			else
			{
?>
											<td align="center"><?php echo date($date_format, $row['theDate']); ?></td>
<?php
			}
			$isVIP = FALSE;
			$vipQuery = dbcom('SELECT url FROM whitelist WHERE vip = 1;');
			while($vipArray = mysql_fetch_array($vipQuery))
			{
				if(stristr($row['url'], $vipArray['url']))
				{
					$isVIP = TRUE;
					break;
				}
			}
			if($arrowsForProvider == 1)
			{
				if($lastSURL == $row['surl'])
				{
?>
											<td align="center"> <span style="color: gray">^</span></td>
<?php
				}
				else
				{
					if($isVIP === TRUE)
					{
?>
											<td align="center"><span style="color: gray"><a href="<?php echo $site_url; ?>/site/<?php echo str_replace(array('https', 'http', ':', '/'), '', $row['surl']); ?>" title="VIP Site: <?php echo $row['sname']; ?>" target="_self"><?php echo $row['sname']; ?></a></span> <img src="<?php echo $site_url; ?>/skins/<?php echo $skin; ?>/vip.gif" alt="VIP Site" />
<?php
					}
					else
					{
?>
											<td align="center"><span style="color: gray"><a href="<?php echo $site_url; ?>/site/<?php echo str_replace(array('https', 'http', ':', '/'), '', $row['surl']); ?>" title="VIP Site: <?php echo $row['sname']; ?>" target="_self"><?php echo $row['sname']; ?></a></span> </td>
<?php
					}
				}
			}
			else
			{
				if($isVIP === TRUE)
				{
?>
											<td align="left"><span style="color: gray"><a href="fwd.php?url=<?php echo $row['surl']; ?>" title="VIP Site: <?php echo $row['sname']; ?>" target="_blank"><?php echo $row['sname']; ?></a></span> <img src="<?php echo $site_url; ?>/skins/<?php echo $skin; ?>/vip.gif" alt="VIP Site" />
<?php
				}
				else
				{
?>
											<td align="left"><span style="color: gray"><a href="fwd.php?url=<?php echo $row['surl']; ?>" title="VIP Site: <?php echo $row['sname']; ?>" target="_blank"><?php echo $row['sname']; ?></a></span> </td>
<?php
				}
			}
			$lastSURL = $row['surl'];
?>
											<td align="right"><?php echo $row['views']; ?> &nbsp;</td>
										</tr>
<?php
		}
?>
							<tr><td colspan="5" height="10"></td></tr>
						</table>

		</td>
	</tr>
</table>
<!-- END BODY -->
<?php
	require(WWWROOT . 'skins/' . $skin . '/footer.php');
	}
?>
Return current item: DDL CMS