Name:		Traffic Rechner Addon 1.2.1 final
Datum:		01-02-2009
Author: 	Crack
Homepage:	www.kit-coding.de
Email: 		Info@kit-coding.de

---------------------------------------------------------------------------------------------------
INSTAL HowTo 
---------------------------------------------------------------------------------------------------
Infos: Nach dem modifizieren der Dateien wird der Trafficverbrauch ausgerechnet und bei dem jeweiligen Download angezeigt.

Installation
============================

Zu editierende Dateien:

/pkinc/public/download.php
/pkinc/publictpl/content/download.htm


Einbindung:

Erstellen Sie einen Navbox Link und geben Sie als Link ?path=traffic an
oder
ber die Startseite(Konfiguration-> Startseite -> Feld Startseite):

traffic

eintragen -> fertig

=======================================================================
pkinc/public/download.php

suche:

if($file_size=='' || $file_size=="0")
	$file_size='&nbsp; - &nbsp;'; 
	

fge darunter ein:

########## Trafficrechner by Cracky www.kit-coding.de##########
 
 if($file_size=='&nbsp; - &nbsp;'){
	 $traffic = '<font style="color: #ff3333;">Linked File!</font>';
 }
 elseif($file_size>0)
 {
  $convert=FileSizeExt($config['content_downloadpath'].'/'.$d,"B");

  $convert=preg_replace('/,/','.',$convert);
  $convert=preg_replace('/KB/','',$convert);
  $convert=preg_replace('/MB/','',$convert);
  $convert=preg_replace('/GB/','',$convert);
  $convert=preg_replace('/TB/','',$convert);
  
  $trafficunit=(trim($convert)*$contentinfo['content_views']);
  
	if ($contentinfo['content_views']==0)
		$traffic='<font style="color: #ff3333;">0,00 KB</font>';
	elseif ($trafficunit==0){
		$traffic='<font style="color: #ff3333;">File Error!</font>';
	}
	else
	{
		$math=$contentinfo['content_filesize'] * $contentinfo['content_views'];

	if ($math >=  1073741824){
       $ext= " TB";
	}
	elseif ($math >= 1048576){
       $ext= " GB";
	}
	elseif ($math >= 1024){
	   $ext= " MB";
	}
	
	if($math < 1024){
	   $ext= " KB";
	}
	
	$traffic1= number_format($trafficunit,2,",", ".").$ext;
	
	if (strstr($traffic1,'.'))
	{
		$trafficunit=$trafficunit/1000;
		$traffic= number_format($trafficunit,2,",", ".").$ext;
		
	}
	else
	$traffic= number_format($trafficunit,2,",", ".").$ext;
	
  }
	
 }
 
########## Trafficrechner by Cracky www.kit-coding.de##########


=======================================================================
pkinc/publictpl/content/download.htm

Suche:

<tr>
 <td><font class="small"><b>Downloads</b></font></td>
 <td align="right"><font class="small">$contentinfo[content_views]</font></td>
</tr>

fge darunter ein:

<tr>
 <td><font class="small"><b>Traffic</b></font></td>
 <td align="right"><font class="small">$traffic</font></td>
</tr>

=======================================================================
Das war es auch schon. Ich hoffe es gefllt Euch ;)


Support:
============================

Support & Fragen: 

Support gebe ich gerne unter www.kit-coding.de


