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

Форум

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

хак "Количество скачиваний файла для приаттаченых файлов"

0

0
1
03.04.2010 14:29:59

Количество скачиваний файла для приаттаченых файлов
Для open slaed

Так же исправлено отображение для файлов неявляющимися картинками.

Заливаем все из архива. хак "Количество скачиваний файла для приаттаченых файлов"


Установка
открываем файл function/function/php

находим функцию

# Format attach<br /> function encode_attach($sourse, $mod) {<br /> include(&quot;config/config_uploads.php&quot;);<br /> $match_count = preg_match_all(&quot;#&#092;[attach=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;. ]+) align=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;.&#092;&quot;&#092; ]+) title=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;.&#092;&quot;&#092; ]+)&#092;]#si&quot;, $sourse, $date);<br /> $con = explode(&quot;|&quot;, $confup[$mod]);<br /> $file = &quot;&quot;;<br /> for ($i = 0; $i &lt; $match_count; $i++) {<br /> $file = &quot;uploads/&quot;.$mod.&quot;/&quot;.$date[1][$i].&quot;&quot;;<br /> $tfile = &quot;uploads/&quot;.$mod.&quot;/thumb/&quot;.$date[1][$i].&quot;&quot;;<br /> $dtfile = &quot;uploads/&quot;.$mod.&quot;/thumb&quot;;<br /> if ($mod != &quot;&quot; &amp;&amp; file_exists($file) &amp;&amp; !file_exists($tfile)) {<br /> if (!file_exists($dtfile)) mkdir($dtfile);<br /> $thumb = create_img_gd($file, $tfile, $con[6]);<br /> $timg = ($thumb) &#063; $tfile : $file;<br /> } else {<br /> $timg = $tfile;<br /> }<br /> $img = $file;<br /> if (file_exists($img)) list($imgwidth, $imgheight) = getimagesize($img);<br /> $cont[] = &quot;&lt;img src=&#092;&quot;&quot;.$timg.&quot;&#092;&quot; width=&#092;&quot;&quot;.$con[6].&quot;&#092;&quot; align=&#092;&quot;&quot;.$date[2][$i].&quot;&#092;&quot; style=&#092;&quot;cursor: pointer;&#092;&quot; OnMouseOver=&#092;&quot;Tip(&#039;&lt;img src=&amp;quot;&quot;.$img.&quot;&amp;quot; width=&amp;quot;&quot;.$imgwidth.&quot;&amp;quot;&gt;&#039;)&#092;&quot; OnClick=&#092;&quot;CaricaFoto(&#039;&quot;.$img.&quot;&#039;)&#092;&quot;&gt;&quot;;<br /> $text = preg_replace($date[0], $cont, $sourse);<br /> }<br /> $sourse = preg_replace(&quot;#&#092;[(.*&#063;)&#092;]#&quot;, &quot;&#092;&#092;1&quot;, $text);<br /> return $sourse;<br /> }


заменяем на эту


# Format attach<br /> function encode_attach($sourse, $mod) {<br /> include(&quot;config/config_uploads.php&quot;);<br /> $match_count = preg_match_all(&quot;#&#092;[attach=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;. ]+) align=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;.&#092;&quot;&#092; ]+) title=([a-zA-Zа-яА-Я0-9&#092;_&#092;-&#092;.&#092;&quot;&#092; ]+)&#092;]#si&quot;,$sourse, $date);<br /> $con = explode(&quot;|&quot;, $confup[$mod]);<br /> $file = &quot;&quot;;<br /> for ($i = 0; $i &lt; $match_count; $i++) {<br /> $file = &quot;uploads/&quot;.$mod.&quot;/&quot;.$date[1][$i].&quot;&quot;;<br /> $tfile = &quot;uploads/&quot;.$mod.&quot;/thumb/&quot;.$date[1][$i].&quot;&quot;;<br /> $dtfile = &quot;uploads/&quot;.$mod.&quot;/thumb&quot;;<br /> <br /> $type = substr(strtolower(end(explode(&quot;.&quot;, $date[1][$i]))), 0, 5);<br /> <br /> if ($type == &quot;gif&quot; || $type == &quot;jpg&quot; || $type == &quot;jpeg&quot; || $type == &quot;png&quot; || $type == &quot;bmp&quot;) {<br /> <br /> list($imgwidth, $imgheight) = getimagesize($file);<br /> <br /> if ($mod != &quot;&quot; &amp;&amp; file_exists($file) &amp;&amp; !file_exists($tfile) &amp;&amp; $imgwidth &gt; $con[6]) {<br /> if (!file_exists($dtfile)) mkdir($dtfile);<br /> $thumb = create_img_gd($file, $tfile, $con[6]);<br /> $timg = ($thumb) &#063; $tfile : $file;<br /> } else {<br /> $timg = $tfile;<br /> }<br /> <br /> <br /> <br /> $img = $file;<br /> if($imgwidth &gt; $con[6]){<br /> $cont[] = &quot;&lt;img src=&#092;&quot;&quot;.$timg.&quot;&#092;&quot; width=&#092;&quot;&quot;.$con[6].&quot;&#092;&quot; align=&#092;&quot;&quot;.$date[2][$i].&quot;&#092;&quot; style=&#092;&quot;cursor: pointer;&#092;&quot; OnMouseOver=&#092;&quot;Tip(&#039;&lt;img src=&amp;quot;&quot;.$img.&quot;&amp;quot; width=&amp;quot;&quot;.$imgwidth.&quot;&amp;quot;&gt;&#039;)&#092;&quot; OnClick=&#092;&quot;CaricaFoto(&#039;&quot;.$img.&quot;&#039;)&#092;&quot;&gt;&quot;;<br /> }else{<br /> $cont[] = &quot;&lt;img src=&#092;&quot;$file&#092;&quot; align=&#092;&quot;&quot;.$date[2][$i].&quot;&#092;&quot; title=&#092;&quot;&quot;.$date[3][$i].&quot;&#092;&quot;&gt;&lt;/a&gt;&quot;;}<br /> }else{<br /> $data = unserialize(file_get_contents(&quot;schet.txt&quot;));<br /> $cont[] = &quot;&lt;a href=&#092;&quot;download.php&#063;mod=$mod&amp;name=&quot;.basename($file).&quot;&#092;&quot; align=&#092;&quot;&quot;.$date[2][$i].&quot;&#092;&quot; title=&#092;&quot;&quot;.$date[3][$i].&quot;&#092;&quot;&gt;&quot;.basename($file).&quot;&lt;/a&gt; (&quot;.files_size(filesize($file)).&quot;, &quot;.$data[basename($file)].&quot;) &quot;;}<br /> $text = preg_replace($date[0], $cont, $sourse);<br /> }<br /> $sourse = preg_replace(&quot;#&#092;[(.*&#063;)&#092;]#is&quot;, &quot;&#092;&#092;1&quot;, $text);<br /> return $sourse;<br /> }



находим функцию


function show_files()



в ней находим

&lt;img src=&#092;&quot;&quot;.img_find(&quot;editor/export&quot;).&quot;&#092;&quot; border=&#092;&quot;0&#092;&quot; align=&#092;&quot;center&#092;&quot; style=&#092;&quot;cursor: pointer;&#092;&quot; onclick=&#092;&quot;InsertCode(&#039;attach&#039;, &#039;&quot;.$path.&quot;&quot;.$entry[1].&quot;&#039;, &#039;&#039;, &#039;&#039;, &#039;&quot;.$id.&quot;&#039;)&#092;&quot; alt=&#092;&quot;&quot;._EIMG.&quot;&#092;&quot; title=&#092;&quot;&quot;._EIMG.&quot;&#092;&quot;&gt;



В этом коде удаляем

&quot;.$path.&quot;

3.74

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

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

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

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