TinyPortal

Development => Block Codes => Topic started by: bioemm.com on December 19, 2008, 04:29:02 PM

Title: [Block] Last Upload Block for DL Center of TP
Post by: bioemm.com on December 19, 2008, 04:29:02 PM
Hi

can any one change article block
http://www.tinyportal.net/index.php/topic,26124.0.html

for usage of Last Upload Block???

thx
Title: Re: Last Upload Block for DL Center of TP
Post by: IchBin on December 19, 2008, 05:14:12 PM
Pulled right from the TP functions that Bloc already has. This is assuming you are using at least TP 1.x I think. Put this in a phpbox type of block.

global $txt;

$it=array();
$it=dl_recentitems('1','date','array');
if(sizeof($it)>0){
foreach($it as $item){
echo '
<img src="'.$item['icon'].'" align="right" style="margin-left: 4px; " alt="" />
<a href="'.$item['href'].'"><b>'.$item['name'].'</b></a>
<p class="smalltext">'.$txt['tp-uploadedby'].' <b>'.$item['author'].'</b> <br />( '.$item['date'].')<br />
'.$txt['tp-downloads'].'/'.$txt['tp-itemviews'].': <b>'.$item['downloads'].' / '.$item['views'].'</b></p>';
}
}
Title: Re: Last Upload Block for DL Center of TP
Post by: bioemm.com on December 19, 2008, 06:30:38 PM
thank u IchBinâ,,¢

the code work very good
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: Maddog452 on December 19, 2008, 11:43:52 PM
Sorry to hijack a thread, but is it possible to limit the category from where it takes the latest upload?? For Example, the latest upload from "dl=cat6"

Cheers
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: IchBin on December 20, 2008, 06:20:18 PM
Not with the code I gave. The code I posted uses a built in function for grabing the entry. You'd have to modify the actual function in TP to grab a specific category or something. Unless you write a different code snippet.
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: Maddog452 on December 21, 2008, 02:33:55 AM
Bugger.  Thanks anyway IchBin
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: UkGangsta on February 26, 2009, 12:41:28 AM
nice code ichbin but is there anyway to make this scroll the items u want to show and stop on mouse over ?
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: UkGangsta on March 02, 2009, 09:50:19 PM
guess there isnt then !!   >:(
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: IchBin on March 02, 2009, 10:03:15 PM
Is there any reason you couldn't try it? I don't mean to be rude, but google has thousands of pages that can show you how to scroll HTML using the marquee tag, and then how to start/stop something using javascript. Any reason you can't try it out yourself instead getting all impatient on me here?
Title: Re: [Block] Last Upload Block for DL Center of TP
Post by: UkGangsta on March 12, 2009, 08:43:45 PM
im not impatient sorry if u thought otherwise i have used google and found a wealth of information thxs