eskafild

مشکل با آمارگیر mod_vcnt

3 پست در این موضوع

سلام

من mod_vcnt آمار گیر رو نصب کردم ولی همون تو امروز مونده بازدید هاش به دیروز وارد نمیشه و هی داره به تعداد امروز اضافه می کنه

چه کنم؟

قسمت کد زمان فک کنم اینه ببینید چشه؟

<?php
/**
* @Copyright
*
* @package		VCNT for Joomla 1.5 - helper.php
* @author		Viktor Vogel {@link http://www.kubik-rubik.de}
* @version		Version: 1.5-6 - 27-Sep-2010
* @link		Project Site {@link http://www.kubik-rubik.de/joomla-hilfe/modul-vcnt-visitorcounter-joomla-1.5}
*
*	@license GNU/GPL
*	This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined('_JEXEC') or die('Restricted access');

class mod_vcntHelper extends JObject
{
protected $db;

// Konstruktor - Datenbankobjekt setzen
function __construct() 
{
	$this->set('db', JFactory::getDbo());
}

// Funktion - Aufruf setzen
function count(&$params)
{
	$locktime 	=	$params->get('locktime', 60);
	$nobots		=	$params->get('nobots');
	$botslist	=	$params->get('botslist');
	$noip 		= 	$params->get('noip');
	$ipslist	= 	$params->get('ipslist');
	$sql		=	$params->get('sql');

	$locktime	=	$locktime * 60;
	$now		=	time();
	$ip			=	$_SERVER['REMOTE_ADDR'];

	// Bots aussperren
	$bot = 0;
	if ($nobots) 
	{
		if (isset($_SERVER['HTTP_USER_AGENT'])) 
		{
			$agent = $_SERVER['HTTP_USER_AGENT'];
			$bots_array =  explode(",", $botslist);
			foreach ( $bots_array as $e ) 
			{
				if (preg_match('/'.trim($e).'/i', $agent)) 
				{
					$bot = 1;
				}
			}
		} 
		else // Nicht zählen, wenn kein User Agent übermittelt wird
		{ 
			$bot = 1;
		}
	}

	// IP-Adressen aussperren, Abfrage zur Absicherung
	$iplock = 0;
	if ($noip) 
	{
		if (isset($_SERVER['REMOTE_ADDR'])) 
		{
			$agent = $_SERVER['REMOTE_ADDR'];
			$bots_array = explode(",", $ipslist);
			foreach ($bots_array as $e) 
			{	
				if (preg_match('/'.trim($e).'/i', $agent)) 
				{
					$iplock = 1;
				}
			}
		} 
		else // Nicht zählen, wenn keine IP übermittelt wird
		{ 
			$iplock = 1;
		}
	}

	// Prüfen, ob SQL Tabelle bereits erstellt wurde
	if ($sql) 
	{
		$query = "create table if not exists ".$this->db->nameQuote('#__vcnt')." (".$this->db->nameQuote('tm')." int not null, ip varchar(16) not null default '0.0.0.0')";
		$this->db->setQuery($query);
		$result = $this->db->query();
	}

	// Prüfen, ob IP bereits vorhanden und Reloadsperre abgelaufen
	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('ip')." = ".$this->db->quote($ip)." and (".$this->db->nameQuote('tm')." + ".$this->db->quote($locktime).") > ".$this->db->quote($now);
	$this->db->setQuery($query);
	$result = $this->db->query();
       $items = $this->db->loadResult();

	// Aufruf zählen, wenn Bedingungen erfüllt sind
	if (empty($items) AND ($bot == 0) AND ($iplock == 0)) 
	{
		$query = "insert into ".$this->db->nameQuote('#__vcnt')." (".$this->db->nameQuote('tm').", ".$this->db->nameQuote('ip').") values (".$this->db->quote($now).", ".$this->db->quote($ip).")";
		$this->db->setQuery($query);
		$result = $this->db->query();
		$e = $this->db->getErrorMsg();
	}
	return;
}

// Funktion - Aufrufe einlesen
function read(&$params)
{
	// Zeitangaben berechnen
	$date = JFactory::getDate();
	$date->setOffset(JFactory::getApplication()->getCfg('offset'));

	$day 			=	$date->toFormat('%d');
	$month			=	$date->toFormat('%m');
	$year			=	$date->toFormat('%Y');
	$daystart		=	mktime(0,0,0,$month,$day,$year);
	$monthstart		=	mktime(0,0,0,$month,1,$year);
	$weekday		=	$date->toFormat('%w');
	$weekday--;
	if ($weekday < 0) { $weekday = 7; }
	$weekday		=	$weekday * 24*60*60;
	$weekstart		=	$daystart - $weekday;
	$yesterdaystart	=	$daystart - (24*60*60);
	$preset			= 	$params->get('preset', 0);

	// Besucherzahl nach Bereinigung ermitteln
	$query = "select cnt from ".$this->db->nameQuote('#__vcnt_pc');
	$this->db->setQuery($query);
	$result = $this->db->query();
       $pre2 = $this->db->loadResult();

	// Werte einlesen
	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt');
	$this->db->setQuery($query);
	$result = $this->db->query();
	$all_visitors = $this->db->loadResult();
	$all_visitors += $preset;
	$all_visitors += $pre2;

	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm').">".$this->db->quote($daystart);
	$this->db->setQuery($query);
	$result = $this->db->query();
	$today_visitors = $this->db->loadResult();

	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm').">".$this->db->quote($yesterdaystart)." and ".$this->db->nameQuote('tm')."<".$this->db->quote($daystart);
	$this->db->setQuery($query);
	$result = $this->db->query();
	$yesterday_visitors = $this->db->loadResult();

	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm').">=".$this->db->quote($weekstart);
	$this->db->setQuery($query);
	$result = $this->db->query();
	$week_visitors = $this->db->loadResult();

	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm').">=".$this->db->quote($monthstart);
	$this->db->setQuery($query);
	$result = $this->db->query();
	$month_visitors = $this->db->loadResult();

	$ret = array($all_visitors, $today_visitors, $yesterday_visitors, $week_visitors, $month_visitors);
	return ($ret);
}

// Funktion - Datenbankbereinigung
function clean(&$params)
{	
	$sql		=	$params->get('sql');

	$date		=	JFactory::getDate();
	$date->setOffset(JFactory::getApplication()->getCfg('offset'));
	$month		=	$date->toFormat('%m');
	$year		=	$date->toFormat('%Y');
	$monthstart	=	mktime(0,0,0,$month,1,$year);

	// Prüfen, ob SQL Tabelle bereits erstellt wurde
	if ($sql) 
	{
		$query = "create table if not exists ".$this->db->nameQuote('#__vcnt_pc')." (".$this->db->nameQuote('cnt')." int not null not null default '0')";
		$this->db->setQuery($query);
		$result = $this->db->query();
	}

	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt_pc');
	$this->db->setQuery($query);
	$result = $this->db->query();
	$numrows = $this->db->loadResult();

	if (!$numrows) 
	{
		$query = "insert into ".$this->db->nameQuote('#__vcnt_pc')." values(0)";
		$this->db->setQuery($query);
		$result = $this->db->query();
	}

	$cleanstart = $monthstart - (8*24*60*60);
	$query = "select count(*) from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm')."<".$this->db->quote($cleanstart);
	$this->db->setQuery($query);
	$result = $this->db->query();
	$oldrows = $this->db->loadResult();
	if ($oldrows) 
	{
		$query = "update ".$this->db->nameQuote('#__vcnt_pc')." set ".$this->db->nameQuote('cnt')."=".$this->db->nameQuote('cnt')."+".$this->db->quote($oldrows);
		$this->db->setQuery($query);
		$result = $this->db->query();

		$query = "delete from ".$this->db->nameQuote('#__vcnt')." where ".$this->db->nameQuote('tm')."<".$this->db->quote($cleanstart);
		$this->db->setQuery($query);
		$result = $this->db->query();
	}
	return;
}

// Funktion - Popup Squeeze Box - modifizierte Version des Plugins Squeeze Them! Dimitris (http://www.joomla-guru.com/squeeze-them/squeeze-them-dimitris)
function popupSqueeze(&$params,$cwsession)
{
	$mainframe = JFactory::getApplication();
	JHTML::_('behavior.mootools');
	JHTML::_('behavior.modal');

	$cwsession		=	!$params->get('cwsession');
	$url 			= 	$params->get('squeeze_url'); // Link eingeben - URL oder Grafik
	$relativetoroot = 	$params->get('squeeze_relativetoroot');
	$width 			= 	$params->get('squeeze_width');
	$height			= 	$params->get('squeeze_height');

	$cookietime		= 	$params->get('squeeze_time'); // Cookie gesetzt für Dauer (Minuten)
	$cOverlayOpacity = 	$params->get('squeeze_opacity');
	$ckey = ''; // Letzte Änderung des Inhaltes - Format: %d-%m-%Y
	$enableonchange = 0; // Popup bei Änderungsdatum anzeigen
	$cnocookies = 0; // Anzeigen, wenn Cookies deaktiviert - 1 = ja, 0 = nein
	$cswf = 0; // SWF Film
	$cookiename = 'vcnt'; // Cookiename

	if (!$enableonchange) { $ckey = "yes";}
	if ($relativetoroot) { $url = JURI::base().$url; }

	$html = '<script type="text/javascript">
			<!--
			function getCookie(c_name)
			{
			   if (document.cookie.length>0)
			     {
			     c_start=document.cookie.indexOf(c_name + "=");
			     if (c_start!=-1)
			       {
			       c_start=c_start + c_name.length+1;
			       c_end=document.cookie.indexOf(";",c_start);
			       if (c_end==-1) c_end=document.cookie.length;
			       return unescape(document.cookie.substring(c_start,c_end));
			       }
			     }
			   return "";
			}
			function setCookie(name,value,minutes)
			{
			   if (minutes) {
			      var date = new Date();
			      date.setTime(date.getTime()+(minutes*1000*60));
			      var expires = "; expires="+date.toGMTString();
			   }
			   else var expires = "";
			   document.cookie = name+"="+value+expires+"; path=/";
			}
			function checkCookie()
			{
			   showrightpane=getCookie(\''.$cookiename.'\');
			   if ((showrightpane==null) || (showrightpane=="")) {
			     setCookie(\''.$cookiename.'\',\'no\','.$cookietime.'); //set the default cookie value here
			   }
			}
			function showV() {
				' . ($cswf?'
				var myel = new Element("div").adopt(
					new Element("div",{"id":"squeeze_swf_pop"}).adopt(
						new Element("h1").appendText("To watch this video... please get suitable Flash Player!"),
						new Element("br"),
						new Element("a",{"href":"http://www.adobe.com/go/getflashplayer"}).adopt(
							new Element ("img",{"src":"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif", "alt":"Get Adobe Flash player"})
						)
					)
				);
				' : 
				'var myel = new Element(\'a\',{\'href\':\''.$url.'\'});'
				) . '
				SqueezeBox.fromElement(myel,{
					size: {x: '.$width.', y: '.$height.'},
					overlayOpacity: ' . ((double)$cOverlayOpacity)/100.0 . ',
					handler: \''.($cswf?'adopt':'iframe').'\',
					iframePreload:true,
					onOpen: function() {
						'.($cswf?'
						swfobject.embedSWF("'.$url.'", "squeeze_swf_pop", '.$width.', '.$height.', "9.0.0");
						':'').'
						if (window.ie6) { 
						  window.scrollTo(0,0);
						  var t=$(\'sbox-btn-close\'); var g = t.getStyle(\'background-image\');
						  if (g!="none") {
						    g = g.replace("url(\"","").replace("\")","");
						    t.setStyle("filter", \'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="\' + g + \'",sizingMethod="crop")\');
						    t.setStyle("background","none");
								t.setStyle("cursor","pointer");
						  }
						}
					},
					onHide: function(){
						setCookie(\''.$cookiename.'\',\''.$ckey.'\','.$cookietime.');
					}'.($cswf?',
					onClose: function(){
						$(\'squeeze_swf_pop\').StopPlay();
					}':'').'
				});
			}
			function closeV() {
				SqueezeBox.close();
			}
			checkCookie();
						window.addEvent(\'domready\', function() {
						v = getCookie(\''.$cookiename.'\');
						' . ($cwsession ? 'showV();' : '
						if(!(' . ($cnocookies ? '' : '(v==null) || (v == "") || ') . '(v=="'.$ckey.'")))
						{
							showV();
						}
						') . '
			 });
			 //--> 
			 </script>';
	$mainframe->addCustomHeadTag($html);
}

// Funktion - Popup JS Alert
function popupJSAlert(&$params,$all_visitors,$counterwinner,$cwnumber,$cwsession)
{
	if (!isset($_SESSION['cwsessioncookie'])) 
	{
		$_SESSION['cwsessioncookie'] = 0;
	}

	if (!$cwsession) 
	{
		$_SESSION['cwsessioncookie'] = 0;
	}

	if (empty($_SESSION['cwsessioncookie'])) 
	{	
		$head = '<script type="text/javascript">alert("' . JText::_('JSALERT') . '");</script>';
		$document =& JFactory::getDocument();
		$document->addCustomTag($head);
	}

	if ($cwsession) 
	{
		$_SESSION['cwsessioncookie'] = 1;
	}
}
}

Share this post


Link to post
Share on other sites
آموزش ووکامرس قالب جوملا قالب وردپرس قالب رایگان وردپرس قالب رایگان جوملا هاست نامحدود هاست جوملا هاست لاراول هاست وردپرس هاست ارزان هاست ربات تلگرام خرید دامنه آموزش ساخت ربات تلگرام با php آموزش html و css آموزش لاراول آموزش cPanel آموزش php آموزش سئو وردپرس آموزش امنیت وردپرس آموزش وردپرس آموزش فرم ساز RSform آموزش سئو جوملا آموزش فروشگاه ساز Hikashop آموزش فروشگاه ساز ویرچومارت آموزش طراحی سایت آگهی تبلیغاتی آموزش امنیت جوملا آموزش طراحی سایت فروش فایل آموزش طراحی قالب ریسپانسیو با Helix آموزش جوملا 3 آموزش ساخت ربات دکمه ی شیشه ای آموزش ساخت ربات همکاری در فروش آموزش ساخت ربات جذب ممبر آموزش ساخت ربات ضد اسپم آموزش ساخت ربات پیوست فایل سورس ربات مدیر گروه | ربات مدیر گروه همسریابی

کلا این آمارگیر مشکل داره بهتره از استفاده ازش خودداری کنید.

در خصوص مشکل شما هم چیزی به ذهن من نمیرسه مگر باگ خود این افزونه

Share this post


Link to post
Share on other sites
کلا این آمارگیر مشکل داره بهتره از استفاده ازش خودداری کنید.

در خصوص مشکل شما هم چیزی به ذهن من نمیرسه مگر باگ خود این افزونه

شبیه این ماژول چی رو توصیه می کنید؟

امکان جالبی که این ماژول داره اینکه بعد از تعیین زمان مشخص رفرش را حساب می کنه!

مورد مشابه این؟

Share this post


Link to post
Share on other sites

برای ارسال نظر یک حساب کاربری ایجاد کنید یا وارد حساب خود شوید

برای اینکه بتوانید نظر ارسال کنید نیاز دارید که کاربر سایت شوید

ایجاد یک حساب کاربری

برای حساب کاربری جدید در انجمن ما ثبت نام کنید. عضویت خیلی ساده است !


ثبت نام یک حساب کاربری جدید

ورود به حساب کاربری

دارای حساب کاربری هستید؟ از اینجا وارد شوید


ورود به حساب کاربری