Форум » Система построения сайтов » Установка, настройка и использование » хак "Количество скачиваний файла для приаттаченых файлов"
Открыть Ответить

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

0.00

0.00

1
03.04.2010 14:29:59

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

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

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


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

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

# Format attach<br /> function encode_attach($sourse, $mod) {<br /> include("config/config_uploads.php");<br /> $match_count = preg_match_all("#\[attach=([a-zA-Zа-яА-Я0-9\_\-\. ]+) align=([a-zA-Zа-яА-Я0-9\_\-\.\"\ ]+) title=([a-zA-Zа-яА-Я0-9\_\-\.\"\ ]+)\]#si", $sourse, $date);<br /> $con = explode("|", $confup[$mod]);<br /> $file = "";<br /> for ($i = 0; $i < $match_count; $i++) {<br /> $file = "uploads/".$mod."/".$date[1][$i]."";<br /> $tfile = "uploads/".$mod."/thumb/".$date[1][$i]."";<br /> $dtfile = "uploads/".$mod."/thumb";<br /> if ($mod != "" && file_exists($file) && !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[] = "<img src=\"".$timg."\" width=\"".$con[6]."\" align=\"".$date[2][$i]."\" style=\"cursor: pointer;\" OnMouse Over=\"Tip('<img src=&quot;".$img."&quot; width=&quot;".$imgwidth."&quot;>')\" OnClick=\"CaricaFoto('".$img."')\">";<br /> $text = preg_replace($date[0], $cont, $sourse);<br /> }<br /> $sourse = preg_replace("#\[(.*&#063;)\]#", "\\1", $text);<br /> return $sourse;<br /> }


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


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



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


function show_files()



в ней находим

<img src=\"".img_find("editor/export")."\" border=\"0\" align=\"center\" style=\"cursor: pointer;\" onclick=\"InsertCode('attach', '".$path."".$entry[1]."', '', '', '".$id."')\" alt=\""._EIMG."\" title=\""._EIMG."\">



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

".$path."

Группа
Клиент
Пункты
2121
Регистрация
02.11.2008
Пол
Мужчина
Из
Пермь
Предупреждения
Нет
ra55551
ra55551
3.75

3.75

Открыть Ответить
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

Поделиться
QR-код