Jump to content

Download Layout


Allan

Recommended Posts

You can edit download_list.tpl in your core/templates folder this is the exisitng code:

<h1>Downloads</h1>

<?php 
if(!$allcategories)
{
echo 'There are no downloads available!';
return;
}

foreach($allcategories as $category)
{
?>
<p><h2><strong><?php echo $category->name?></strong></h2></p>
<ul>

<?php	
# This loops through every download available in the category
$alldownloads = DownloadData::GetDownloads($category->id);

if(!$alldownloads)
{
	echo 'There are no downloads under this category';
	$alldownloads = array();
}

foreach($alldownloads as $download)
{
?>
<li>
	<a href="<?php echo url('/downloads/dl/'.$download->id);?>">
		<?php echo $download->name?></a><br />
      <?php echo $download->description?><br />
         <em>Downloaded <?php echo $download->hits?> times</em></li>
<?php
}
?><br />
</ul>
<?php
}
?>

Link to comment
Share on other sites

I actually liked the look of the downloads list in the admin section so I jacked that code and used it for my downloads list that the pilots see. I have to remove a bit of code such as editing the files and such, but it worked out good. So if you like the list in the admin section, copy the structure from there and use it. ;)

Link to comment
Share on other sites

Let us know if it works out for you. I had no problems with it at all. I had to rework a bit of css too. I failed to mention that to you. In the end, it looked much better then the default look. As I said, there are a few things you should omit from the code though such as editing files and all that.

If you have any issues, I could probably pastebin my code for you. Well, Nabeel's code that I simply copied and pasted.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...