Advertisement
fireball82

test

Jul 6th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.32 KB | None | 0 0
  1. <?
  2. /********************************************************************************
  3. * Erweiterte Status Navbox von KC-Cracky - edited by Proggi                     *
  4. * Version 1.1                                                                   *
  5. * Datiert: 10.02.2009                                                           *
  6. * Website http://www.kit-coding.de                                              *
  7. * Hergestellt für PHPKIT Version 1.6.03 und 1.6.1                               *
  8. * Weiterverbreitung durch Fremde (auch in modifizierter Form) ist nicht erlaubt *
  9. * Entfernen oder unsichbar machen des Copyrights, wenn vorhanden                *
  10. * ist nicht erlaubt                                                             *
  11. * Support erhalten Sie ausschliesslich unter folgenden Adressen:                *
  12. *              http://www.kit-coding.de - http://www.kit-spiele.de              *
  13. *********************************************************************************/
  14.    
  15.  
  16.  
  17. #Config ANFANG
  18. // Breite der Navigationsbox - Pixel oder Prozentwerte
  19. $width              = '100%';
  20.  
  21. // Sollen Downloadinfos angezeigt werden? 1 = Ja | 0 = Nein
  22. $showdltable        = "0";
  23.  
  24. // Sollen Artikelinfos angezeigt werden? 1 = Ja | 0 = Nein
  25. $showarttable       = "0";
  26.  
  27. // Sollen Linkinfos angezeigt werden? 1 = Ja | 0 = Nein
  28. $showlnktable       = "0";
  29.  
  30. // Sollen Newsinfos angezeigt werden? 1 = Ja | 0 = Nein
  31. $shownstable        = "0";
  32.  
  33. // Sollen Foreninformationen angezeigt werden? 1 = Ja | 0 = Nein
  34. $showforumstable    = "0";
  35.  
  36. // Soll die Anzahl der GB-Eintraege angezeigt werden? 1 = Ja | 0 = Nein
  37. $showgbstable       = "0";
  38.  
  39. // Soll der Neueste User angezeigt werden? 1 = Ja | 0 = Nein
  40. $shownewuser        = "1";
  41.  
  42. // Soll das Neueste Mitglied angezeigt werden? 1 = Ja | 0 = Nein
  43. $shownewmember      = "1";
  44.  
  45. // Highlightcolor als 6-stelliger HEX-Code
  46. $highlightcolor     = "BABC89";
  47.  
  48. // Wie lange darf ein Username hoechstens sein - Anzahl in Zeichen
  49. $userNameCut        = 16;
  50.  
  51. // Sollen die Seitenzugriffe angezeigt werden? 1 = Ja | 0 = Nein
  52. $showPageImpressions = "1";
  53.  
  54. // Ende Konfiguration
  55.  
  56. ##    Ab hier bitte nichts mehr aendern    ##
  57.  
  58. $phpkit_status = phpkitstatus();
  59.  
  60. if (is_array($phpkit_status['online_user'])) {
  61.     unset($online_list);
  62.     $k=1;
  63.     foreach($phpkit_status['online_user'] as $userinfo) {
  64.         if ($config['user_ghost']!=1 || ($config['user_ghost']==1 && $userinfo['user_ghost']!=1)) {
  65.             if ($k>1) $online_list.=', ';
  66.         $k++;
  67.         }
  68.     }
  69.     if (isset($online_list)) $online_list.=" ".$lang['and']." ";
  70. }
  71.  
  72.  
  73. // Robots-Anzeige von Dooki auf KNW
  74. //---> Gäste by Dooki inkl. Robots
  75.  
  76. unset($online_robots);
  77. if ($phpkit_status['online_guests']>0) {
  78.     if ($phpkit_status['online_guests']==1) {
  79.         $online_list.=$phpkit_status['online_guests']." ".$lang['guest'].".";
  80.     }else{
  81.         $online_list.=$phpkit_status['online_guests']." ".$lang['guests'].".";
  82.     }
  83.     $online_robots = function_robots_anzeigen($phpkit_status['guests_hash']);
  84.     if($online_robots != "") $online_robots = '<b>Aktive Robots:</b><br>'.$online_robots;
  85. }else{
  86.     $online_list.=$lang['no']." ".$lang['guests'].".";
  87. }
  88.  
  89. //---> Gäste by Dooki inkl. Robots
  90.  
  91.  
  92. #Newest USER
  93. if (intval($shownewuser) === 1) {
  94.     $userinfo = $DB->fetch_array(
  95.                     $DB->query("SELECT
  96.                                     user_id,
  97.                                     user_nick,
  98.                                     logtime
  99.                                 FROM
  100.                                     ".$sqlprefix."_user
  101.                                 ORDER by
  102.                                     user_id DESC
  103.                                 LIMIT
  104.                                     1
  105.                                     "));
  106.     $user_name = cutstring(htmlentities($userinfo['user_nick']), $userNameCut);
  107.    
  108.     // Der User ist zwar registriert, aber noch nicht aktiviert
  109.     if($userinfo['logtime'] == 0)
  110.         $user_name='<span style="color:#cc0000;">'.$user_name.'</span>';
  111.    
  112.     eval ("\$listnewuser= \"".templateinclude("navigation/extnbst/newest_user")."\";");
  113. }
  114.  
  115. #Newest Member
  116. if (intval($shownewmember) === 1) {
  117.     $userinfo2 = $DB->fetch_array(
  118.                     $DB->query("SELECT
  119.                                     user_id,
  120.                                     user_nick,
  121.                                     logtime,
  122.                                     user_status
  123.                                 FROM
  124.                                     ".$sqlprefix."_user
  125.                                 WHERE
  126.                                     user_status = 'member'
  127.                                 ORDER by
  128.                                     user_id DESC
  129.                                 LIMIT
  130.                                     1
  131.                                     "));
  132.     $user_name2 = cutstring(htmlentities($userinfo2['user_nick']), $userNameCut);
  133.     if($userinfo2['logtime']==0)
  134.             $user_name2 = '<span style="color:#cc0000;">'.$user_name2.'</span>';
  135.            
  136.     eval ("\$listnewmember= \"".templateinclude("navigation/extnbst/newest_member")."\";");
  137. }
  138. #Begrüßung
  139. if(intval($USER['id']) > 0) {
  140.     $since = number_format(((time()-$USER['logtime'])/60),0,",",".");
  141.     $time = formattime($USER['logtime'],'','time');
  142.     $usernick = htmlentities(cutstring($USER['nick'], 15));
  143.     eval ("\$gruss= \"".templateinclude("navigation/extnbst/gruss")."\";");
  144. }else{
  145.     $gruss = '';
  146. }
  147.  
  148. #Zugriffe
  149. if(intval($showPageImpressions) === 1) {
  150.     $piCountToday = $DB->fetch_assoc(
  151.                         $DB->query("SELECT
  152.                                         calender_id,
  153.                                         calender_date,
  154.                                         calender_picount
  155.                                     FROM
  156.                                         ".$sqlprefix."_calender
  157.                                     WHERE
  158.                                         calender_id != 1
  159.                                     ORDER BY
  160.                                         calender_id DESC
  161.                                     LIMIT
  162.                                         1
  163.                                         "));
  164.     $piCountToday = number_format($piCountToday['calender_picount'],0,",",".");
  165.     //$yesterdayID = $DB->num_rows($DB->query("SELECT calender_id FROM ".$sqlprefix."_calender"));
  166.     //$yesterdayID = $yesterdayID-1;
  167.    
  168.     $counter_t = $DB->fetch_assoc(
  169.                     $DB->query("SELECT
  170.                                     calender_counter,
  171.                                     calender_id,
  172.                                     calender_picount
  173.                                 FROM
  174.                                     ".$sqlprefix."_calender
  175.                                 WHERE
  176.                                     calender_id!='1'
  177.                                 ORDER by
  178.                                     calender_id DESC
  179.                                 LIMIT
  180.                                     1
  181.                                     "));
  182.     $counter_y = $DB->fetch_assoc(
  183.                     $DB->query("SELECT
  184.                                     calender_id,
  185.                                     calender_counter,
  186.                                     calender_picount
  187.                                 FROM
  188.                                     ".$sqlprefix."_calender
  189.                                 WHERE
  190.                                     calender_id<'$counter_t[calender_id]'
  191.                                     and
  192.                                     calender_id!='1'
  193.                                 ORDER by
  194.                                     calender_id DESC
  195.                                 LIMIT
  196.                                     1
  197.                                     "));
  198.    
  199.     $piCountYesterday = $DB->fetch_assoc(
  200.                             $DB->query("SELECT
  201.                                             calender_id,
  202.                                             calender_counter,
  203.                                             calender_picount
  204.                                         FROM
  205.                                             ".$sqlprefix."_calender
  206.                                         WHERE
  207.                                             calender_id = '".$counter_y['calender_id']."'
  208.                                         LIMIT
  209.                                             1
  210.                                             "));
  211.     $piCountYesterday = number_format($piCountYesterday['calender_picount'],0,",",".");
  212.     $allcounter = $DB->fetch_array(
  213.                     $DB->query("SELECT
  214.                                     SUM(calender_picount)
  215.                                 FROM
  216.                                     ".$sqlprefix."_calender
  217.                                     "));
  218.     $allcounter = number_format($allcounter[0],0,",",".");
  219.     $rekord = $DB->fetch_array(
  220.                 $DB->query("SELECT
  221.                                 MAX(calender_counter)
  222.                             FROM
  223.                                 ".$sqlprefix."_calender
  224.                             WHERE
  225.                                 calender_id != '1'
  226.                             ORDER by
  227.                                 calender_id DESC
  228.                                 "));
  229.     $rekord = number_format($rekord[0],0,",",".");
  230.     eval ("\$pageImpressions= \"".templateinclude("navigation/extnbst/page_impressions")."\";");
  231. }
  232. // Ende Pageimpressions
  233.  
  234. #Pfeilgrafik UP & DOWN im Vergleich gestern zu heute
  235. if ($phpkit_status['counter_today'] > $phpkit_status['counter_yesterday'])
  236.     $difftoyes='<span class="small"><b>'.number_format($phpkit_status['counter_today'],0,",",".").'</b></span>';
  237. else
  238.     $difftoyes='<span class="small"><b>'.number_format($phpkit_status['counter_today'],0,",",".").'</b></span>';
  239.  
  240. $phpkit_status['counter_yesterday'] = number_format($phpkit_status['counter_yesterday'],0,",",".");
  241. $phpkit_status['counter_total'] = number_format($phpkit_status['counter_total'],0,",",".");
  242. $phpkit_status['user_counter'] = number_format($phpkit_status['user_counter'],0,",",".");
  243.  
  244. # Liste alle Seiteninfos auf
  245. eval ("\$boxlinks[1]= \"".getTemplate("navigation/extnbst/sitemaininfos")."\";");
  246.  
  247.  
  248. $getuserinfo = $DB->query("SELECT
  249.                                 user_nick,
  250.                                 user_id,
  251.                                 logtime,
  252.                                 user_status
  253.                             FROM
  254.                                 ".$db_tab['user']."
  255.                             WHERE
  256.                                 user_activate=1
  257.                             ORDER by
  258.                                 logtime DESC
  259.                             LIMIT
  260.                                 5
  261.                                 ");
  262.  
  263. while ($userinfo = $DB->fetch_array($getuserinfo)) {
  264.     if (isonline($userinfo['user_id'])) $onlinestatus = '<img src="images/extnbst/bullet_green.png" width="12" height="12" alt="Online" title="Online"
  265.  
  266. border="0" />';
  267.     else $onlinestatus = '<img src="images/extnbst/bullet_red.png" width="12" height="12" alt="'.htmlentities($userinfo['user_nick']).' ist offline"
  268.  
  269. title="'.htmlentities($userinfo['user_nick']).' ist offline" border="0" />';
  270.    
  271.     $usernick=cutstring(htmlentities($userinfo['user_nick']), $userNameCut);
  272.     $userlogtime = date("H:i", $userinfo['logtime']);
  273.    
  274.     if($userinfo['user_status'] == 'admin') {
  275.         $fontStyle = 'color:#BB0000;';
  276.     }elseif($userinfo['user_status'] == 'mod') {
  277.         $fontStyle = 'color:#000080;';
  278.     }elseif($userinfo['user_status'] == 'member') {
  279.         $fontStyle = 'color:#006400;';
  280.     }elseif($userinfo['user_status'] == 'vip') {
  281.         $fontStyle = 'color:#8f8f8f;';
  282.     }else{
  283.         $fontStyle = '';
  284.     }
  285.     eval ("\$zonline_row.= \"".templateinclude("navigation/extnbst/zonline_row")."\";");
  286. }
  287. eval ("\$zonline= \"".templateinclude("navigation/extnbst/zonline")."\";");
  288.  
  289. if (is_array($phpkit_status['online_user'])) {
  290.     unset($online_user);
  291.     $online_usercount=count($phpkit_status['online_user']);
  292.     foreach($phpkit_status['online_user'] as $userinfo) {
  293. $getava = $DB->fetch_array($DB->query("SELECT user_avatar FROM ".$db_tab['user']." where user_id='".intval($userinfo['user_id'])."' LIMIT 1"));
  294.  if($getava['user_avatar']=="") {
  295.   $Avatar = '';
  296.  }
  297.  else {
  298.   $Avatar = '<img src="images/avatar/'.$getava['user_avatar'].'" alt="" title="" width="20" height="20" border="0" />';
  299.  }
  300.  
  301.  
  302.    
  303. $info_group=reUserGroup('Test', $userinfo['user_groupid']);
  304.  
  305.  
  306.  
  307.         if ($online_user) $online_user.=', ';
  308. if ($userinfo['user_status'] == 'admin' ) {
  309.             $admin.='<tr><td style="text-align:left; width:100%;"><a class="small" style="color: #BB0000;" href="include.php?
  310.  
  311. path=login/userinfo.php&amp;id='.$userinfo['user_id'].'"><b>'.$userinfo['user_nick'].'</b></a>'.$userinfo['user_groupid'].'</td><td nowrap="nowrap">'.
  312.  
  313. $Avatar.'</td></tr>';
  314.         }elseif ($userinfo['user_status']=='mod'){
  315.             $mod.='<tr><td style="text-align:left; width:100%;"><a class="small" style="color: #000080;" href="include.php?
  316.  
  317. path=login/userinfo.php&amp;id='.$userinfo['user_id'].'"><b>'.$userinfo['user_nick'].'</b></a></td><td nowrap="nowrap">'.$Avatar.'</td></tr>';
  318.         }elseif ($userinfo['user_status']=='member'){
  319.             $member.='<tr><td style="text-align:left; width:100%;"><a class="small" style="color: #006400;" href="include.php?
  320.  
  321. path=login/userinfo.php&amp;id='.$userinfo['user_id'].'"><b>'.$userinfo['user_nick'].'</b></a></td><td nowrap="nowrap">'.$Avatar.'</td></tr>';
  322.         }
  323.         //VIP Status erweiterung muss installiert sein, sonst nicht aktivieren! ANFANG
  324.         #elseif ($userinfo['user_status']=='vip'){
  325.         #   $VIP.='<a class="small" href="include.php?path=login/userinfo.php&amp;id='.$userinfo['user_id'].'"><b>'.$userinfo
  326.  
  327. ['user_nick'].'</b></a><br />';
  328.         #}
  329.         //VIP Status erweiterung muss installiert sein, sonst nicht aktivieren! ENDE
  330.         else{
  331.             $user.='<a class="small" style="color: #8f8f8f;" href="include.php?path=login/userinfo.php&amp;id='.$userinfo['user_id'].'"><b>'.
  332.  
  333. $userinfo['user_nick'].'</b></a><br />';
  334.         }
  335.        
  336.     }
  337. }
  338. if($phpkit_status['online_guests'] == 0) {
  339.     $guestsOnline = 'Keine';
  340. }elseif($phpkit_status['online_guests'] == 1) {
  341.     $guestsOnline = 'Einer';
  342. }else{
  343.     $guestsOnline = $phpkit_status['online_guests'];
  344. }
  345. eval ("\$boxlinks[2]= \"".getTemplate("navigation/extnbst/online_row")."\";");
  346.  
  347. #Forum anzeige
  348. if ($config['forum_eod'] == 1 && $showforumstable == "1") {
  349.     $counter_post = $DB->fetch_row(
  350.                         $DB->query("SELECT
  351.                                         COUNT(*)
  352.                                     FROM
  353.                                         ".$sqlprefix."_forumpost
  354.                                         "));
  355.     $counter_post[0] = number_format($counter_post[0],0,",",".");
  356.     $counter_themen = $DB->fetch_row(
  357.                         $DB->query("SELECT
  358.                                         COUNT(*)
  359.                                     FROM
  360.                                         ".$sqlprefix."_forumthread
  361.                                         "));
  362.     $counter_themen[0] = number_format($counter_themen[0],0,",",".");
  363.    
  364.     $counter_views_complete = $DB->fetch_assoc(
  365.                                 $DB->query("SELECT
  366.                                                 SUM(forumthread_viewcount) as forumthread_viewcount
  367.                                             FROM
  368.                                                 ".$sqlprefix."_forumthread
  369.                                                 "));
  370.     $counter_views_complete['forumthread_viewcount'] = number_format($counter_views_complete['forumthread_viewcount'],0,",",".");
  371.    
  372.     eval ("\$listforum= \"".templateinclude("navigation/extnbst/listforum")."\";");
  373. }
  374.  
  375. #Artikel anzeige
  376. if ($showarttable=="1"){
  377.     $art_count = $DB->fetch_row(
  378.                     $DB->query("SELECT
  379.                                     COUNT(*)
  380.                                 FROM
  381.                                     ".$sqlprefix."_content
  382.                                 WHERE
  383.                                     content_option = '1'
  384.                                     AND
  385.                                     content_status = '1'
  386.                                     AND
  387.                                     (content_expire > ".time()." || content_expire = '0')
  388.                                     "));
  389.     $art_count[0] = number_format($art_count[0],0,",",".");
  390.     $art_klicks = $DB->fetch_row(
  391.                     $DB->query("SELECT
  392.                                     SUM(content_views)
  393.                                 FROM
  394.                                     ".$sqlprefix."_content
  395.                                 WHERE
  396.                                     content_option = '1'
  397.                                     AND
  398.                                     content_status = '1'
  399.                                     AND
  400.                                     (content_expire > ".time()." || content_expire = '0')
  401.                                     "));
  402.     $art_klicks[0] = number_format($art_klicks[0],0,",",".");
  403.     eval ("\$listart= \"".templateinclude("navigation/extnbst/listartikel")."\";");
  404.  
  405. }
  406.  
  407. #News anzeigen
  408. if ($shownstable=="1"){
  409.     $news_count = $DB->fetch_row(
  410.                     $DB->query("SELECT
  411.                                     COUNT(*)
  412.                                 FROM
  413.                                     ".$sqlprefix."_content
  414.                                 WHERE
  415.                                     content_option = '2'
  416.                                     AND
  417.                                     content_status = '1'
  418.                                     AND
  419.                                     (content_expire > ".time()." || content_expire = '0')
  420.                                     "));
  421.     $news_count[0] = number_format($news_count[0],0,",",".");
  422.     $news_klicks = $DB->fetch_row(
  423.                     $DB->query("SELECT
  424.                                     SUM(content_views)
  425.                                 FROM
  426.                                     ".$sqlprefix."_content
  427.                                 WHERE
  428.                                     content_option = '2'
  429.                                     AND
  430.                                     content_status = '1'
  431.                                     AND
  432.                                     (content_expire > ".time()." || content_expire = '0')
  433.                                     "));
  434.     $news_klicks[0] = number_format($news_klicks[0],0,",",".");
  435.     eval ("\$listns= \"".templateinclude("navigation/extnbst/listnews")."\";");
  436. }
  437.  
  438. #Links anzeigen
  439. if ($showlnktable=="1"){
  440.     $link_count = $DB->fetch_row(
  441.                     $DB->query("SELECT
  442.                                     COUNT(*)
  443.                                 FROM
  444.                                     ".$sqlprefix."_content
  445.                                 WHERE
  446.                                     content_option = '3'
  447.                                     AND
  448.                                     content_status = '1'
  449.                                     AND
  450.                                     (content_expire > ".time()." || content_expire = '0')
  451.                                     "));
  452.     $link_count[0] = number_format($link_count[0],0,",",".");
  453.     $link_klicks = $DB->fetch_row(
  454.                     $DB->query("SELECT
  455.                                     SUM(content_views)
  456.                                 FROM
  457.                                     ".$sqlprefix."_content
  458.                                 WHERE
  459.                                     content_option = '3'
  460.                                     AND
  461.                                     content_status = '1'
  462.                                     AND
  463.                                     (content_expire > ".time()." || content_expire = '0')
  464.                                     "));
  465.     $link_klicks[0] = number_format($link_klicks[0],0,",",".");
  466.     eval ("\$listlnk= \"".templateinclude("navigation/extnbst/listlinks")."\";");
  467. }
  468.  
  469. #Downloads anzeigen
  470. if ($showdltable=="1"){
  471.     $down_count = $DB->fetch_row(
  472.                     $DB->query("SELECT
  473.                                     COUNT(*)
  474.                                 FROM
  475.                                     ".$sqlprefix."_content
  476.                                 WHERE
  477.                                     content_option = '4'
  478.                                     AND
  479.                                     content_status = '1'
  480.                                     AND
  481.                                     (content_expire > ".time()." || content_expire = '0')
  482.                                     "));
  483.     $down_count[0] = number_format($down_count[0],0,",",".");
  484.     $down_klicks = $DB->fetch_row(
  485.                     $DB->query("SELECT
  486.                                     SUM(content_views)
  487.                                 FROM
  488.                                     ".$sqlprefix."_content
  489.                                 WHERE
  490.                                     content_option = '4'
  491.                                     AND
  492.                                     content_status = '1'
  493.                                     AND
  494.                                     (content_expire > ".time()." || content_expire = '0')
  495.                                     "));
  496.     $down_klicks[0] = number_format($down_klicks[0],0,",",".");
  497.     eval ("\$listdl= \"".templateinclude("navigation/extnbst/listdownloads")."\";");
  498. }
  499.  
  500. #Gästebuch anzeigen
  501. if ($config['gbook_eod']==1 && $showgbstable=="1") {
  502.     $counter_3 = $DB->fetch_row(
  503.                     $DB->query("SELECT
  504.                                     COUNT(*)
  505.                                 FROM
  506.                                     ".$sqlprefix."_gbook
  507.                                     "));
  508.     $counter_3[0] = number_format($counter_3[0],0,",",".");
  509.     eval ("\$listgb= \"".templateinclude("navigation/extnbst/listgbook")."\";");
  510. }
  511.  
  512. if($online_robots != "") {
  513.     eval ("\$listbots= \"".templateinclude("navigation/extnbst/listrobots")."\";");
  514. }
  515.  
  516. eval ("\$boxlinks[3]= \"".getTemplate("navigation/extnbst/contentstats")."\";");
  517.  
  518. return $boxlinks;
  519. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement