TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 04:59:52 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 190
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Code: CRC32, MD5, SHA-1 check in download area :)

Started by DarkWolf, July 22, 2010, 12:47:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DarkWolf

File: /Themes/default/TPdlmanager.template.php

Simply search:

'<div>' . $dlitem['description'] , '</div>

Change to:

echo
'<div>' . $dlitem['description'] , '</div>
<hr />
<div>CRC32: '.str_pad(strtoupper(dechex(crc32(file_get_contents($boarddir.'/tp-downloads/'.$dlitem['file'])))), 8, '0', STR_PAD_LEFT).'</div>
<div>MD5: '.strtoupper(md5_file($boarddir.'/tp-downloads/'.$dlitem['file'])).'</div>
<div>SHA-1: '.strtoupper(sha1_file($boarddir.'/tp-downloads/'.$dlitem['file'])).'</div>


You can see a demo here: http://darkwolf.altervista.org/tpmod/?dl=0 :)

Freddy


DarkWolf

Important fix :P
With precedent code every refresh cause an increment of 3 download in download number (it use getid).
I've fixed with this (i don't have used full url to bypass htaccess in tp_downloads) > see new code above ;)
-
I've changed: $dlitem['href'] to $boarddir.'/tp-downloads/'.$dlitem['file']