Здравствуте, уважаемые пользователи. Прошу помощи. Есть модкль comment upload. Хочу сделать так, что бы только автор комментария и админ или модератор видели вложение к комментарию, а все остальные только текст комментария. Готов заплатить за решение. Спасибо
Комментарии
Покопайтесь в правах.
Как-то так, поиграть с префиксом функции,.
global $user;
$file = array_pop($variables['files'])
$comment = _comment_load($file['cid'])
if(user_access('access administration pages') || $user->uid == $comment->uid)
{
$row = 0;
$variables['images'] = array();
$variables['attachments'] = array();
foreach ($variables['files'] as $fid => $file) {
if ($file['list'] && empty($file['remove'])) {
$text = $file['description'] ? $file['description'] : $file['filename'];
if ($variables['display_images'] && strpos($file['filemime'], 'image/') === 0) {
if ($variables['preset']) {
$variables['images'][$fid]['image'] = theme('imagecache', $variables['preset'], file_create_path($file['filepath']), $text, $text);
}
else {
$variables['images'][$fid]['image'] = theme('image', file_create_path($file['filepath']), $text, $text);
}
$variables['images'][$fid]['url'] = check_url(file_create_url($file['filepath']));
}
else {
$variables['attachments'][$fid]['zebra'] = $row % 2 == 0 ? 'odd' : 'even';
$variables['attachments'][$fid]['text'] = check_plain($text);
$variables['attachments'][$fid]['url'] = check_url(file_create_url($file['filepath']));
$variables['attachments'][$fid]['size'] = format_size($file['filesize']);
$row++;
}
}
}
}
}
<code>
Пишет.
Parse error: syntax error, unexpected T_VARIABLE in /home/perfect/blog-sveta.ru/www/sites/all/themes/pixture_reloaded/template.php on line 289
RxB
У Вас есть icq?