Name:		Contentspy V1.2
Datum:		01-08-2009
Author: 	Crack
Homepage:	www.kit-coding.de
Email: 		webadmin@kit-coding.de


---------------------------------------------------------------------------------------------------
INSTALL HowTo Contentspy V1.2
---------------------------------------------------------------------------------------------------

 1. Lade alle Ordner unter Beibehaltung der Ordnerstruktur hoch. Dabei werden keine Dateien berschrieben ;)
 2. Fhren Sie die install.php aus. Sie mssen Adminrechte besitzen!!! z.b. -> http://www.deineurl.de/include.php?path=install
 3. ndere nun folgende 10 Dateien 

/pkinc/cfg/sqltables.php
/pkinc/etc/sql.php
/pkinc/public/userinfo.php
/pkinc/publictpl/userinfo.htm
/pkinc/public/article.php
/pkinc/public/download.php
/pkinc/public/news.php
/pkinc/public/link.php
/pkinc/func/user.php
Adminbereich -> Konfiguration -> Meta-Angaben -> Eigene Headerangaben

Einbindung:

Aufgerufen wird das Addon ber folgenden Link http://www.deineurl.de/include.php?path=contentspy


=======================================================================

/pkinc/cfg/sqltables.php

Suche:

'pkSQLTAB_USER_PROFILEFIELDS'		=> 'profilefields',			#1.6.5 $db_tab use removed

Fge darunter ein:

/*Contentspy ANFANG */
'pkSQLTAB_CONTENTSPY'				=> 'content_spy',
/*Contentspy ENDE */

=======================================================================

/pkinc/etc/sql.php

Suche:

?>

Fge DARBER ein:

/*Contentspy ANFANG */
define('pkSQLTAB_CONTENTSPY',pkSQLPREFIX.'_content_spy');
define('pkSQLTAB_CONTENTSPYUSER',pkSQLPREFIX.'_content_spy_user');
/*Contentspy ENDE */


=======================================================================

/pkinc/public/userinfo.php

Suche:

if($config['forum_eod']==1)
	{
	$info_userposts=($userinfo['user_posts']+$userinfo['user_postdelay']);


Fge DARBER ein:


list($spycontents)=$SQL->fetch_row($SQL->query("SELECT COUNT(*) FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE ct_user_id=".$userinfo['user_id']." "));
list($spycounter)=$SQL->fetch_row($SQL->query("SELECT SUM(counter) FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE ct_user_id=".$userinfo['user_id']." "));



=======================================================================

/pkinc/publictpl/userinfo.htm


Suche:

<td>&nbsp;</td>
	  <td width="25%" valign="top">$avatar_eod</td>
	 </tr>
	</table>
  </td>
 </tr>

Fge darunter ein:

<!-- Contentspy by www.kit-coding.de ANFANG -->
 <tr> 
  <td class="heads" colspan="3" align="center">Spionagebericht</td> 
 </tr> 
 <tr>
  <td class="standard" colspan="3" width="100%" valign="middle"> 
   <table cellpadding="2" cellspacing="0" width="100%"> 
    <tr>
     <td><img src="images/contentspy/zoom.png" width="13" height="13" align="left" alt="" /><a href="?path=contentspy&amp;uid=$_GET[id]">Bisher ausspioniertes Material anzeigen</a></td>
     <td><img src="images/contentspy/search.png" align="left" alt="" />Erfasste Eintr&auml;ge: <b>$spycontents</b></td>
     <td><img src="images/contentspy/search.png" align="left" alt="" />Inhaltsaufrufz&auml;hler: <b>$spycounter</b></td>
    </tr>
   </table>
  </td> 
 </tr>
 <!-- Contentspy by www.kit-coding.de ENDE -->



=======================================================================

/pkinc/public/article.php


Suche:

$suggest_url=urlencode('path=article&contentid='.$contentinfo['content_id'].'&page='.$page);

Fge darunter ein:

#Contentspy by www.kit-coding.de ANFANG
		if(pkgetuservalue('id')){
			$spy=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPY."` WHERE cts_user='".pkgetuservalue('id')."' LIMIT 1 "));  
						
			$cts_ctids=$spy['cts_ctids'];
			$cts_ctids=$contentid."\n".$cts_ctids;
						
			$doupdate=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."'  LIMIT 1"));
			if (empty($doupdate)){
				$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPYUSER."` (`ct_user_id`,`ct_content_ids`,`counter`) VALUES ('".pkgetuservalue('id')."','".$contentid."','1')");	
			}else{
				$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPYUSER."` set `counter`=counter+1 WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."' limit 1");
			}
							
			if (empty($spy)){
				$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPY."` (`cts_user`,`cts_ctids`) VALUES ('".pkgetuservalue('id')."','".$cts_ctids."')");	
			}else{
				if (!preg_match("#".$contentid."\n#is",$spy['cts_ctids'])){
					$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPY."` set cts_ctids='".$cts_ctids."' WHERE cts_user='".pkgetuservalue('id')."' ");	
				}
			}
		}
		#Contentspy by www.kit-coding.de ENDE



=======================================================================

/pkinc/public/download.php

Suche:

if($download && $download!=$config['content_downloadpath'].'/')
	{

Fge Darunter ein:

#Contentspy by www.kit-coding.de ANFANG
						if(pkgetuservalue('id')){
							$spy=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPY."` WHERE cts_user='".pkgetuservalue('id')."' LIMIT 1 "));  
						
							$cts_ctids=$spy['cts_ctids'];
							$cts_ctids=$contentid."\n".$cts_ctids;
						
							$doupdate=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."'  LIMIT 1"));
							if (empty($doupdate)){
								$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPYUSER."` (`ct_user_id`,`ct_content_ids`,`counter`) VALUES ('".pkgetuservalue('id')."','".$contentid."','1')");	
							}else{
								$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPYUSER."` set `counter`=counter+1 WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."' limit 1");
							}
							
							if (empty($spy)){
								$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPY."` (`cts_user`,`cts_ctids`) VALUES ('".pkgetuservalue('id')."','".$cts_ctids."')");	
							}else{
								if (!preg_match("#".$contentid."\n#is",$spy['cts_ctids'])){
									$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPY."` set cts_ctids='".$cts_ctids."' WHERE cts_user='".pkgetuservalue('id')."' ");	
								}
							}
						}
						#Contentspy by www.kit-coding.de ENDE
=======================================================================

/pkinc/public/news.php

Suche:

else
			{
			$sqlcommand="SELECT user_nick, user_id FROM ".pkSQLTAB_USER." WHERE user_id='".$contentinfo['content_autorid']."'";
			}
		}
	}

Fge darunter ein:

#Contentspy by www.kit-coding.de ANFANG
if ($_GET['contentid']){
if(pkgetuservalue('id')){
	$spy=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPY."` WHERE cts_user='".pkgetuservalue('id')."' LIMIT 1 "));  
						
	$cts_ctids=$spy['cts_ctids'];
	$cts_ctids=$contentid."\n".$cts_ctids;
						
	$doupdate=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."'  LIMIT 1"));
	if (empty($doupdate)){
		$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPYUSER."` (`ct_user_id`,`ct_content_ids`,`counter`) VALUES ('".pkgetuservalue('id')."','".$contentid."','1')");	
	}else{
		$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPYUSER."` set `counter`=counter+1 WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."' limit 1");
	}
							
	if (empty($spy)){
		$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPY."` (`cts_user`,`cts_ctids`) VALUES ('".pkgetuservalue('id')."','".$cts_ctids."')");	
	}else{
		if (!preg_match("#".$contentid."\n#is",$spy['cts_ctids'])){
			$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPY."` set cts_ctids='".$cts_ctids."' WHERE cts_user='".pkgetuservalue('id')."' ");	
		}
	}
}
}
#Contentspy by www.kit-coding.de ENDE


=======================================================================

/pkinc/public/link.php

Suche:

$SQL->query("UPDATE ".pkSQLTAB_CONTENT." 
	SET content_views=content_views+1
	WHERE content_id='".$contentid."'");

Fge darunter ein:

#Contentspy by www.kit-coding.de ANFANG
if(pkgetuservalue('id')){
	$spy=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPY."` WHERE cts_user='".pkgetuservalue('id')."' LIMIT 1 "));  
						
	$cts_ctids=$spy['cts_ctids'];
	$cts_ctids=$contentid."\n".$cts_ctids;
						
	$doupdate=$SQL->fetch_array($SQL->query("SELECT * FROM `".pkSQLTAB_CONTENTSPYUSER."` WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."'  LIMIT 1"));
	if (empty($doupdate)){
		$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPYUSER."` (`ct_user_id`,`ct_content_ids`,`counter`) VALUES ('".pkgetuservalue('id')."','".$contentid."','1')");	
	}else{
		$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPYUSER."` set `counter`=counter+1 WHERE `ct_user_id`='".pkgetuservalue('id')."' AND ct_content_ids='".$contentid."' limit 1");
	}
							
	if (empty($spy)){
		$SQL->query("Insert Into `".pkSQLTAB_CONTENTSPY."` (`cts_user`,`cts_ctids`) VALUES ('".pkgetuservalue('id')."','".$cts_ctids."')");	
	}else{
		if (!preg_match("#".$contentid."\n#is",$spy['cts_ctids'])){
			$SQL->query("UPDATE `".pkSQLTAB_CONTENTSPY."` set cts_ctids='".$cts_ctids."' WHERE cts_user='".pkgetuservalue('id')."' ");	
		}
	}
}
#Contentspy by www.kit-coding.de ENDE

=======================================================================

/pkinc/func/user.php

Suche:

$SQL->query("DELETE FROM ".pkSQLTAB_FORUM_FAVORITE." WHERE forumfav_userid='".$id."'");	

fge darunter ein:

#Contentspy by www.kit-coding.de ANFANG
	$SQL->query("DELETE FROM ".pkSQLTAB_CONTENTSPY." WHERE cts_user='".$id."'");
	$SQL->query("DELETE FROM ".pkSQLTAB_CONTENTSPYUSER." WHERE ct_user_id='".$id."'");
#Contentspy by www.kit-coding.de ENDE


=======================================================================

Adminbereich -> Konfiguration -> Meta-Angaben -> Eigene Headerangaben


Fge in das Feld folgendes ein und klicken Sie auf speichern:
Dieses Script darf nur 1 mal in dem Ganzen Feld vorkommen!


<script type="text/javascript"> 
 function oeffne(welches) { 
   if(document.getElementById(welches).style.display == 'none') { 
     document.getElementById(welches).style.display = ''; 
     document.getElementById('img'+welches).src = 'images/minus.gif'; 
   }else{ 
     document.getElementById(welches).style.display = 'none'; 
     document.getElementById('img'+welches).src = 'images/plus.gif'; 
   } 
 } 
 </script>

=======================================================================


Das war es auch schon.

Juhu


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

Support & Fragen: 

Support gebe ich gerne im FORUM unter www.kit-coding.de 
PNS oder ICQ werden gnadenlos ignoriert!!!
