Чтение RSS каналов

Форум

Открыть Ответить

Фиксим баг с отображением счетчиков Hits и Hosts в Опера

0

0
1
02.01.2010 05:43:0202.01.2010 05:44:17

Отображение счетчиков Hits и Hosts в Опера, лечим следующим образом:

1. Открываем файл function/user.php

2. Находим код:

switch(isset($_GET[&#039;hit&#039;])) {<br /> case &quot;1&quot;:<br /> $img = (intval($_GET[&#039;img&#039;])) &#063; &quot;_&quot;.$_GET[&#039;img&#039;].&quot;&quot; : &quot;&quot;;<br /> $count_hit = &quot;config/counter/hits.txt&quot;;<br /> $hits = file($count_hit);<br /> $hit = explode(&quot;|&quot;, trim($hits[0]));<br /> if (date(&quot;Ymd&quot;) &gt; $hit[1]) {<br /> unlink($count_hit);<br /> $wco = &quot;1|&quot;.date(&quot;Ymd&quot;).&quot;&quot;;<br /> } else {<br /> $wco = &quot;&quot;.intval($hit[0]+1).&quot;|&quot;.intval($hit[1]).&quot;&quot;;<br /> }<br /> $fpc = fopen($count_hit, &quot;wb&quot;);<br /> fwrite($fpc, $wco);<br /> fclose($fpc);<br /> if (rename($count_hit, $count_hit) == false) {<br /> # unlink ($count_hit);<br /> # rename ($count_hit, $count_hit);<br /> }<br /> $image = ImageCreateFromGif(&quot;images/banners/hits&quot;.$img.&quot;.gif&quot;);<br /> $color = ImageColorAllocate($image, 255, 255, 255);<br /> ImageString($image, 1, 40, 4, $hit[0], $color);<br /> Header(&quot;Content-type: image/gif&quot;);<br /> ImageGif($image, &quot;&quot;, 100);<br /> ImageDestroy($image);<br /> exit;<br /> break;<br /> }<br /> switch(isset($_GET[&#039;host&#039;])) {<br /> case &quot;1&quot;:<br /> $img = (intval($_GET[&#039;img&#039;])) &#063; &quot;_&quot;.$_GET[&#039;img&#039;].&quot;&quot; : &quot;&quot;;<br /> $count_host = &quot;config/counter/hosts.txt&quot;;<br /> $check = ($_SESSION[&#039;host&#039;] == date(&quot;d&quot;)) &#063; false : true;<br /> if ($check) {<br /> $hosts = file($count_host);<br /> $con = explode(&quot;|&quot;, trim($hosts[0]));<br /> if (date(&quot;Ymd&quot;) &gt; $con[1]) {<br /> unlink($count_host);<br /> $wc = &quot;1|&quot;.date(&quot;Ymd&quot;).&quot;&quot;;<br /> } else {<br /> $wc = &quot;&quot;.intval($con[0]+1).&quot;|&quot;.intval($con[1]).&quot;&quot;;<br /> }<br /> $fph = fopen($count_host, &quot;wb&quot;);<br /> fwrite($fph, $wc);<br /> fclose($fph);<br /> unset($_SESSION[&#039;host&#039;]);<br /> $_SESSION[&#039;host&#039;] = date(&quot;d&quot;);<br /> } else {<br /> $hosts = file($count_host);<br /> $con = explode(&quot;|&quot;, trim($hosts[0]));<br /> }<br /> $image = ImageCreateFromGif(&quot;images/banners/hosts&quot;.$img.&quot;.gif&quot;);<br /> $color = ImageColorAllocate($image, 255, 255, 255);<br /> ImageString($image, 1, 40, 4, $con[0], $color);<br /> Header(&quot;Content-type: image/gif&quot;);<br /> ImageGif($image, &quot;&quot;, 100);<br /> ImageDestroy($image);<br /> exit;<br /> break;<br /> }

3. Удаляем его

4. Прописываем вместо него код:
IF (isset($_GET[&quot;hit&quot;])) {<br /> $img = (intval($_GET[&#039;img&#039;])) &#063; &quot;_&quot;.$_GET[&#039;img&#039;].&quot;&quot; : &quot;&quot;;<br /> $count_hit = &quot;config/counter/hits.txt&quot;;<br /> $hits = file($count_hit);<br /> $hit = explode(&quot;|&quot;, trim($hits[0]));<br /> if (date(&quot;Ymd&quot;) &gt; $hit[1]) {<br /> unlink($count_hit);<br /> $wco = &quot;1|&quot;.date(&quot;Ymd&quot;).&quot;&quot;;<br /> } else {<br /> $wco = &quot;&quot;.intval($hit[0]+1).&quot;|&quot;.intval($hit[1]).&quot;&quot;;<br /> }<br /> $fpc = fopen($count_hit, &quot;wb&quot;);<br /> fwrite($fpc, $wco);<br /> fclose($fpc);<br /> if (rename($count_hit, $count_hit) == false) {<br /> # unlink ($count_hit);<br /> # rename ($count_hit, $count_hit);<br /> }<br /> $image = ImageCreateFromGif(&quot;images/banners/hits&quot;.$img.&quot;.gif&quot;);<br /> $color = ImageColorAllocate($image, 255, 255, 255);<br /> ImageString($image, 1, 40, 4, $hit[0], $color);<br /> Header(&quot;Content-type: image/gif&quot;);<br /> ImageGif($image, &quot;&quot;, 100);<br /> ImageDestroy($image);<br /> }<br /> IF (isset($_GET[&quot;host&quot;])) {<br /> $img = (intval($_GET[&#039;img&#039;])) &#063; &quot;_&quot;.$_GET[&#039;img&#039;].&quot;&quot; : &quot;&quot;;<br /> $count_host = &quot;config/counter/hosts.txt&quot;;<br /> $check = ($_SESSION[&#039;host&#039;] == date(&quot;d&quot;)) &#063; false : true;<br /> if ($check) {<br /> $hosts = file($count_host);<br /> $con = explode(&quot;|&quot;, trim($hosts[0]));<br /> if (date(&quot;Ymd&quot;) &gt; $con[1]) {<br /> unlink($count_host);<br /> $wc = &quot;1|&quot;.date(&quot;Ymd&quot;).&quot;&quot;;<br /> } else {<br /> $wc = &quot;&quot;.intval($con[0]+1).&quot;|&quot;.intval($con[1]).&quot;&quot;;<br /> }<br /> $fph = fopen($count_host, &quot;wb&quot;);<br /> fwrite($fph, $wc);<br /> fclose($fph);<br /> unset($_SESSION[&#039;host&#039;]);<br /> $_SESSION[&#039;host&#039;] = date(&quot;d&quot;);<br /> } else {<br /> $hosts = file($count_host);<br /> $con = explode(&quot;|&quot;, trim($hosts[0]));<br /> }<br /> $image = ImageCreateFromGif(&quot;images/banners/hosts&quot;.$img.&quot;.gif&quot;);<br /> $color = ImageColorAllocate($image, 255, 255, 255);<br /> ImageString($image, 1, 40, 4, $con[0], $color);<br /> Header(&quot;Content-type: image/gif&quot;);<br /> ImageGif($image, &quot;&quot;, 100);<br /> ImageDestroy($image);<br /> }

5. Радуемся жизни...

3.92

3.92
2
29.03.2010 19:04:04

Не лечится. Версия системы 4.3.2
С капчей вылечил. Со счетчиками не помогло!

Сайт в подписи!

4.32

4.32
3
30.03.2010 10:45:17

GRAFLEKX, я б на вашем месте требовал бы неплохие премиальные Смайл - 13

3.91

3.91
4
30.03.2010 14:17:0630.03.2010 14:21:16

GRAFLEKX, я б на вашем месте требовал бы неплохие премиальные Смайл - 13



sam07 Я бы на Вашем месте не флудил! Создавайте отдельные темы и туда выкладывайте свои бредовые идеи и бесполезные теории!

4.32

4.32
5
30.03.2010 17:15:03

Artem21, а вы вобще кто?

3.91

3.91
6
30.03.2010 23:21:49

Artem21, стало быть пойдем другим путем Смайл - 13
1. откройте файл: function/security.php
2. найдите в нем код:

# GZip<br /> if (strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;compatible&#039;) || strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;Gecko&#039;)) {<br /> if (extension_loaded(&#039;zlib&#039;)) ob_start(&#039;ob_gzhandler&#039;);<br /> } else {<br /> if (strstr($HTTP_SERVER_VARS[&#039;HTTP_ACCEPT_ENCODING&#039;], &#039;gzip&#039;)) {<br /> if (extension_loaded(&#039;zlib&#039;)) {<br /> $do_gzip_compress = true;<br /> ob_start();<br /> ob_implicit_flush(0);<br /> header(&#039;Content-Encoding: gzip&#039;);<br /> }<br /> }<br /> }

3. замените его на этот код:
# GZip<br /> if ((!isset($_GET[&#039;captcha&#039;])) &amp;&amp; (!isset($_GET[&#039;hit&#039;])) &amp;&amp; (!isset($_GET[&#039;host&#039;]))) {<br /> if (strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;compatible&#039;) || strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;Gecko&#039;)) {<br /> if (extension_loaded(&#039;zlib&#039;)) ob_start(&#039;ob_gzhandler&#039;);<br /> } else {<br /> if (strstr($HTTP_SERVER_VARS[&#039;HTTP_ACCEPT_ENCODING&#039;], &#039;gzip&#039;)) {<br /> if (extension_loaded(&#039;zlib&#039;)) {<br /> $do_gzip_compress = true;<br /> ob_start();<br /> ob_implicit_flush(0);<br /> header(&#039;Content-Encoding: gzip&#039;);<br /> }}}}

Надеюсь проблема решена.....

GRAFLEKX, я б на вашем месте требовал бы неплохие премиальные


sam07, наверное надо подумать на эту тему Смайл - 13

3.92

3.92
7
31.03.2010 06:51:0631.03.2010 06:56:28

GRAFLEKX

Благодарю. Проблема решена. Приятно иметь дело
с грамотными, профессиональными людьми!


sam07

Я твои кошмары. Снившиеся тебе по ночам! Смайл - 13


Не все делается за деньги. Такими темпами мы скоро и пукнуть за бесплатно соглашаться не будем! Я тоже выкладывал платные разработки, которые заказывал для себя. Модуль знакомства для Pro версии мой. Я заказывал его переделку за деньги. После выложил в паблик. Хотя мог рубить деньги за это. Я написал ЧПУ для модуля СМС, Грабера СМС, Модуля Фото от Джеймса. Все выложил в паблик, притом бесплатно.

4.32

4.32
8
06.05.2010 10:48:20

А если это:

if (strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;compatible&#039;) || strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;Gecko&#039;))


заменить на это:
if (strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;compatible&#039;) || strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;Gecko&#039;) || strstr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;Presto&#039;))


С новой Оперой работает. Но вопрос - правильно ли так?

PS Опера с версии 9.6 в User_Agent добавляет Presto



Версия системы: SLAED CMS 2.6 Lite
Версия PHP: PHP 4
Сервер: Локальный сервер
9
06.05.2010 10:56:49

ifahr, да, тоже как вариант, подходит...

3.92

3.92
Открыть Ответить
Хотите опробовать SLAED CMS в действии?

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

  • D-49179, Deutschland
    Ostercappeln, Im Siek 6
  • +49 176 61966679

  • https://slaed.net
Идеи и предложения
Обратная связь