Jump to content
xt:Commerce Community Forum

Zugriffz?hler


heiko228

Recommended Posts

Der OSC counter ist nach wie vor drinne und l??t sich einfach wieder aktivieren.

Die whos_online.php verwendet (noch) die PHP-Funktion "session_decode". Session decode ?berschreibt grunds?tzlich die current-session - was zu ungewollten Seiteneffekten f?hrt - hat (wie schon so oft gepostet) mit der Serverkonfiguration rein gar nichts zu tun.

Link to comment
Share on other sites

naja, f?r was doppelt moppeln ? sehe wenig sinn darin. da webstats gute erbegnisse liefert, und wer profesionelle auswertungen will, der kommt ?ber ne Log analyse mit bestimmten Programmen eh nicht raus.

eine aussagekr?ftige logginstatistik zu machen w?re zu komplex, und wozu das rad nochmals erfinden wenn es bereits dinge gibt die das perfekt spielen.

jedes zus?tzliches loggin verbraucht resourcen.

Link to comment
Share on other sites

Wer den counter reaktivieren will, um beim Admin-Login einen kurzen ?berblick ?ber seine visits zu haben, dem habe ich eine kurze Anleitung mit der Hilfe auf Vollst?ndigkeit. W?rde mich freuen, wenn Sie Euch genauso hilfreich ist, wie mir.

Wer wegen der Performance bedenken hat und damit nicht leben kann, sollte sich ?berlegen einen JavaSkript basierten Shop zu verwenden :)

Viel Spa? damit!

In der RC-1.2 reaktivierst Du den Counter

STEP-1: includes/counter.php anlegen

Dateinhalt:


<?php

/* -----------------------------------------------------------------------------------------

  $Id: counter.php,v 1.1 2003/09/06 22:13:53 fanta2k Exp $  


  XT-Commerce - community made shopping

  http://www.xt-commerce.com


  Copyright (c) 2003 XT-Commerce

  -----------------------------------------------------------------------------------------

  based on: 

  (c) 2000-2001 The Exchange Project (earlier name of osCommerce)

  (c) 2002-2003 osCommerce(counter.php,v 1.5 2003/02/10); [url]www.oscommerce.com[/url] 

  (c) 2003 nextcommerce (counter.php,v 1.6 2003/08/13); [url]www.nextcommerce.org[/url] 


  Released under the GNU General Public License 

  ---------------------------------------------------------------------------------------*/


 $counter_query = xtc_db_query("select startdate, counter from " . TABLE_COUNTER);

 if ($_SESSION['counter_count'] != 1) {

  if (!xtc_db_num_rows($counter_query)) {

   $date_now = date('Ymd');

   xtc_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')");

   $counter_startdate = $date_now;

   $counter_now = 1;

   $_SESSION['counter_count'] = 1;

  } else {

   $counter = xtc_db_fetch_array($counter_query);

   $counter_startdate = $counter['startdate'];

   $counter_now = ($counter['counter'] + 1);

   xtc_db_query("update " . TABLE_COUNTER . " set counter = '" . $counter_now . "'");

   $_SESSION['counter_count'] = 1;

  }

  $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4)));

 } else {

  $counter = xtc_db_fetch_array($counter_query);

  $counter_startdate = $counter['startdate'];

  $counter_now = $counter['counter'];

  $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4)));

 }

?>

STEP-2: counter.php in index.php einbinden Modifiziere index.php

...

...

...


   } else {

    $category_depth = 'products'; // category has no products, but display the 'no products' message

   }

  }

 }



 require(DIR_WS_INCLUDES . 'header.php');

 include(DIR_WS_MODULES . 'default.php');



//START-MOD

 include(DIR_WS_INCLUDES . 'counter.php'); 

//END-MOD




 $smarty->assign('language', $_SESSION['language']);


 $smarty->caching = 0;

 $smarty->display(CURRENT_TEMPLATE . '/index.html');


 $c_string='Powered by XT-Commerce';



 echo $modified;


 ?>

] STEP-3: counter in Admin-Box ausgeben Modifiziere file: /templates/blabla/source/boxes/admin.php


<?php

/* -----------------------------------------------------------------------------------------

  $Id: admin.php,v 1.4 2004/04/21 17:56:34 fanta2k Exp $  


  XT-Commerce - community made shopping

  http://www.xt-commerce.com


  Copyright (c) 2003 XT-Commerce

  -----------------------------------------------------------------------------------------

  based on: 

  (c) 2000-2001 The Exchange Project (earlier name of osCommerce)

  (c) 2002-2003 osCommercebased on original files from OSCommerce CVS 2.2 2002/08/28 02:14:35 [url]www.oscommerce.com[/url] 

  (c) 2003 nextcommerce (admin.php,v 1.12 2003/08/13); [url]www.nextcommerce.org[/url]


  Released under the GNU General Public License 

  ---------------------------------------------------------------------------------------*/


// reset var

$box_smarty = new smarty;

$box_content='';

$flag='';

$box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); 


 $orders_contents = '';

 $orders_status_query = xtc_db_query("select orders_status_name, orders_status_id from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$_SESSION['languages_id'] . "'");

 while ($orders_status = xtc_db_fetch_array($orders_status_query)) {

  $orders_pending_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");

  $orders_pending = xtc_db_fetch_array($orders_pending_query);

  $orders_contents .= '<a href="' . xtc_href_link_admin(FILENAME_ORDERS, 'selected_box=customers&status=' . $orders_status['orders_status_id'], 'SSL') . '">' . $orders_status['orders_status_name'] . '</a>: ' . $orders_pending['count'] . '<br>';

 }

 $orders_contents = substr($orders_contents, 0, -4);


//MOD-START

 $counter_query = xtc_db_query("select startdate, counter from " . TABLE_COUNTER);

 $counter = xtc_db_fetch_array($counter_query);

//MOD-ENDE


 $customers_query = xtc_db_query("select count(*) as count from " . TABLE_CUSTOMERS);

 $customers = xtc_db_fetch_array($customers_query);

 $products_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");

 $products = xtc_db_fetch_array($products_query);

 $reviews_query = xtc_db_query("select count(*) as count from " . TABLE_REVIEWS);

 $reviews = xtc_db_fetch_array($reviews_query);

 $admin_image = '<a href="' . xtc_href_link_admin(FILENAME_START,'', 'SSL').'">' . xtc_image(DIR_WS_IMAGES.'admin_button.gif') .'</a>';

 if ($cPath != '' && $product_info['products_id'] != '') {

  $admin_link='<a href="' . xtc_href_link_admin(FILENAME_EDIT_PRODUCTS, 'cPath=' . $cPath . '&pID=' . $product_info['products_id']) . '&action=new_product' . '" target="_blank">' . xtc_image(DIR_WS_ICONS . 'edit_product.gif') . '</a>';

 }


 $box_content= '<b>' . BOX_TITLE_STATISTICS . '</b><br>' . $orders_contents . '<br>' .

                     BOX_ENTRY_CUSTOMERS . ' ' . $customers['count'] . '<br>' .

                     BOX_ENTRY_PRODUCTS . ' ' . $products['count'] . '<br>' .

                     BOX_ENTRY_REVIEWS . ' ' . $reviews['count'] .'<br>' .

//MOD-START

                     BOX_ENTRY_COUNTER . ' ' . $counter['counter'] .'<br>' .

//MOD-ENDE

                     $admin_image . '<br>' .$admin_link;


  if ($flag==true) define('SEARCH_ENGINE_FRIENDLY_URLS',true);

  $box_smarty->assign('BOX_CONTENT', $box_content);


  $box_smarty->caching = 0;

  $box_smarty->assign('language', $_SESSION['language']);

  $box_admin= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_admin.html');

  $smarty->assign('box_ADMIN',$box_admin);


?>


STEP-4: Sprachdateien ?ndern In "lang/german/german.php" folgende Zeile einf?gen

define('BOX_ENTRY_COUNTER','Besucher: ');

In "lang/german/english.php" folgende Zeile einf?gen

define('BOX_ENTRY_COUNTER','Visits: ');

That's it. Falls ich was vergessen habe... PM. Danke.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...