Добавлено:
Кнопки "Опубликовать" в Facebook и ВКонтакте.
В файле Display.Template.php ищем строку:
// Show the lower breadcrumbs.
Перед ней добавляем:
echo '<div style="float:left; width:140px;margin:0; padding:0; vertical-align: middle;">
<script type="text/javascript" src="http://vkontakte.ru/js/api/share.js?9" charset="utf8"></script><script type="text/javascript"><!--
document.write(VK.Share.button(false,{type: "round", text: "Опубликовать"}));
--></script></div>';
echo '<div style="float:left;">
<iframe src="http://www.facebook.com/plugins/like.php?href=', $scripturl, '?topic=', $context['current_topic'], '&layout=button_count&show_faces=false&width=150&action=like&font=trebuchet+ms&colorscheme=light&height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:30px;" allowTransparency="true"></iframe></div>';
UPD: переделано с помощью сервиса http://www.addthis.com ;)
Добавлено: отправка сообщений по Ctrl+Enter
Open GenericControls.template.php, find:
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols=" ', $context['browser']['is_ie8'] ? '600' : $editor_context['columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="width: ', $editor_context['width'], '; height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '">', $editor_context['value'], '</textarea>
replace with:
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" rows="', $editor_context['rows'], '" cols=" ', $context['browser']['is_ie8'] ? '600' : $editor_context['columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="width: ', $editor_context['width'], '; height: ', $editor_context['height'], '; ', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '" onkeypress="if(event.keyCode==10 || (event.ctrlKey && event.keyCode==13)) {submit();}">', $editor_context['value'], '</textarea>
Then open Display.template.php, find:
<textarea cols="75" rows="7" style="', $context['browser']['is_ie8'] ? 'max-width: 100%; min-width: 100%' : 'width: 100%', '; height: 100px;" name="message" tabindex="', $context['tabindex']++, '"></textarea>
replace with:
<textarea cols="75" rows="7" style="', $context['browser']['is_ie8'] ? 'max-width: 100%; min-width: 100%' : 'width: 100%', '; height: 100px;" name="message" tabindex="', $context['tabindex']++, '" onkeypress="if(event.keyCode==10 || (event.ctrlKey && event.keyCode==13)) {submit();}"></textarea>
Open Modifications.english.php and paste to end:
// Ctrl+Enter for Quick/Full reply form
$txt['shortcuts'] = 'shortcuts: hit ctrl+enter to submit/post or alt+p to preview';
$txt['shortcuts_firefox'] = 'shortcuts: hit ctrl+enter to submit/post or shift+alt+p to preview';
Open Post.english.php and paste to end too:
// Ctrl+Enter for Quick/Full reply form
$txt['shortcuts'] = 'shortcuts: hit ctrl+enter to submit/post or alt+p to preview';
$txt['shortcuts_firefox'] = 'shortcuts: hit ctrl+enter to submit/post or shift+alt+p to preview';
Взято отсюда - http://www.simplemachines.org/community/index.php?topic=412538.0
http://www.simplemachines.ru/index.php?topic=44.msg95245#msg95245
Auto Merge Double Posts
Updated: 29 Ноябрь 2011, 23:56:37
Вот так ^^^
Удалено нафиг.
Сделано руками:
Основная задача - объединять идущие подряд сообщения одного пользователя в теме, если разница между их написанием меньше определенного строка. Объединение происходит при добавлении сообщения.
Для организации мода нужно добавить в /Sources/Post.php после:
// No need!
$context['robot_no_index'] = true;
Добавить:
//Auto-merge doublepost
// $vars = print_r($_POST,TRUE);
// $fh = fopen('debug.txt', 'w');
// fwrite($fh, $vars);
// fclose($fh);
if (!isset($_POST['additional_options']) && !$_POST['preview']){
$request = $smcFunc['db_query']('', '
SELECT id_member, poster_time, id_msg, icon, body
FROM {db_prefix}messages
WHERE id_topic = ' . intval($_REQUEST['topic']) . '
ORDER BY id_msg DESC
LIMIT 1'
);
$row_last = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
if ($user_info['id'] == $row_last['id_member'] and (time() - $row_last['poster_time']) < 84600){
$row_last['body'] = str_replace("<br />", "\n", $row_last['body']);
$_REQUEST['msg'] = $row_last['id_msg'];
$_POST['message'] = un_htmlspecialchars($row_last['body']) . "\n\n[hr][size=1][color=green][b]Updated: " . date("d F Y, H:i:s") . "[/b][/color][/size][hr]\n\n" . $_POST['message'];
$_POST['icon'] = $row_last['icon'];
}
}
Быстрое java цитирование
Display.Template.php
// Can they reply? Have they turned on quick reply?
if ($context['can_quote'] && !empty($options['display_quick_reply']))
echo '
<li class="quote_button"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');">', $txt['quote'], '</a> <img src="', $settings['images_url'], '/quote2.png" alt="Quote" style="cursor:pointer; cursor:hand;" onclick="quote_selection(\'', $message['member']['name'], '\', \'', 'topic=', $context['current_topic'],'.msg', $message['id'],'#msg', $message['id'], '\', \'', time(), '\')" /></li>';
script.js bottom
// quote
function quote_selection(char_name, post_link, post_date)
{
selection = document.getSelection ? document.getSelection() : document.selection.createRange().text;
if (selection != '')
{
document.postmodify.message.value += '[quote author=' + char_name + ' ' + 'link=' + post_link + ' ' + 'date=' + post_date + ']' + selection + '[/quote]\n';
}
else
{
alert('Select text on the page and try again');
return;
}
window.location.hash = '#quickreply';
}
Встраивание coub
В display.template.php после // Show the post itself, finally! добавить
$message['body'] = preg_replace('/<a.*?>http:\/\/(?:www\.|)coub\.com\/view\/(\w )<\/a>/i', '<iframe src="http://coub.com/embed/$1?muted=false&autostart=false&originalSize=false&hideTopBar=false&noSiteButtons=false&startWithHD=false" allowfullscreen="true" frameborder="0" width="640" height="400"></iframe>', $message['body']);