} if (isset($required_fields)) { // Output JavaScript to validate form (make sure required fields are filled out) $js = 'reqField="' . $lang_common['required field'] . '";reqFormLang={'; while (list($elem_orig, $elem_trans) = each($required_fields)) { $js .= $elem_orig . ':"' . addslashes(str_replace(' ', ' ', $elem_trans)) . '",'; } $js = rtrim($js, ',') . '};'; JsHelper::getInstance()->addInternal($js); JsHelper::getInstance()->add(PUN_ROOT . 'js/required.js'); } if (in_array($basename, array('post.php', 'viewtopic.php', 'edit.php'))) { JsHelper::getInstance()->add(PUN_ROOT . 'js/board.js'); } if (in_array($basename, array('message_list.php', 'moderate.php'))) { JsHelper::getInstance()->add(PUN_ROOT . 'js/check.js'); } $tpl_temp = trim(ob_get_contents()); $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); ob_end_clean(); // END SUBST - <pun_head> // START SUBST - <body> if (isset($focus_element)) { $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus();', $tpl_main); $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus();">', $tpl_main); } // END SUBST - <body> if (isset($hint_box)) { $tpl_temp = $hint_box; } else { $tpl_temp = null;
function showContainer() { global $lang_poll; JsHelper::getInstance()->add(PUN_ROOT . 'js/jquery.punmodalbox.js'); JsHelper::getInstance()->add(PUN_ROOT . 'js/poll.js'); return '<fieldset><legend>' . $lang_poll['poll'] . '</legend><div class="infldset txtarea"><input type="hidden" name="has_poll" id="has_poll" value="0" /><label><a id="apcreate" class="crtpoll" href="#">' . $lang_poll['create'] . '</a></label><div id="ppreview" style="display:none;position:relative;"></div></div></fieldset><br class="clearb" />'; }
<?php if (!$pun_user['is_guest'] && $pun_user['g_pm'] == 1 && $pun_config['o_pms_enabled'] && $pun_user['messages_enable'] == 1) { include PUN_ROOT . 'lang/' . $pun_user['language'] . '/pms.php'; // Check for new messages $result_messages = $db->query('SELECT COUNT(1) FROM ' . $db->prefix . 'messages WHERE showed=0 AND owner=' . $pun_user['id']) or error('Unable to check for new messages', __FILE__, __LINE__, $db->error()); $new_msg = $db->fetch_row($result_messages); if ($new_msg[0] > 0) { $tpl_temp .= '<li class="pmlink"><strong><a href="message_list.php"> ' . $lang_pms['New messages'] . ' (' . $new_msg[0] . ')</a></strong></li>'; if ($pun_user['popup_enable'] == 1) { $result = $db->query('SELECT id FROM ' . $db->prefix . 'messages WHERE popup=0 AND owner=' . $pun_user['id'] . ' ORDER BY id DESC') or error('Unable update popup status', __FILE__, __LINE__, $db->error()); $return = $db->fetch_row($result); if ($return[0]) { JsHelper::getInstance()->addInternal('window.open("' . PUN_ROOT . 'message_popup.php?id=' . $return[0] . '","NewPM","width=760,height=200,resizable=yes,scrollbars=yes");'); $db->query('UPDATE ' . $db->prefix . 'messages SET popup=1 WHERE popup=0 AND owner=' . $pun_user['id']) or error('Unable to update popup status', __FILE__, __LINE__, $db->error()); } } } // Check if the inbox is full $result = $db->query('SELECT COUNT(1) FROM ' . $db->prefix . 'messages WHERE owner=' . $pun_user['id']) or error('Unable to test if the message-box is full', __FILE__, __LINE__, $db->error()); $count = $db->fetch_row($result); // Display error message if ($count[0] >= $pun_user['g_pm_limit']) { $tpl_temp .= '<li class="pmlink"><strong><a href="message_list.php">' . $lang_pms['Full inbox'] . '</a></strong></li>'; } }
<?php // Make sure no one attempts to run this script "directly" if (!defined('PUN')) { exit; } $footer_style = isset($footer_style) ? $footer_style : ''; $tpl_temp = trim(ob_get_contents()); $tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main); ob_end_clean(); // END SUBST - <pun_main> // JS_HELPER MOD BEGIN if (JsHelper::getInstance()->count() > 0 || JsHelper::getInstance()->countInternal() > 0) { JsHelper::getInstance()->addFirst('//code.jquery.com/jquery-1.12.0.min.js'); $tpl_main = str_replace('<pun_js_helper>', JsHelper::getInstance()->headerOut(), $tpl_main); } else { $tpl_main = str_replace('<pun_js_helper>', '', $tpl_main); } // JS_HELPER MOD END // START SUBST - <pun_footer> ob_start(); echo '<div id="brdfooter" class="block"><h2><span>' . $lang_common['Board footer'] . '</span></h2><div class="box"><div class="inbox">'; //PMS MOD BEGIN require PUN_ROOT . 'include/pms/footer_links.php'; //PMS MOD END if ($footer_style == 'index' || $footer_style == 'search') { if (!$pun_user['is_guest']) { echo '<dl id="searchlinks" class="conl"> <dt><strong>' . $lang_common['Search links'] . '</strong></dt> <dd><a href="search.php?action=show_24h">' . $lang_common['Show recent posts'] . '</a></dd> <dd><a href="search.php?action=show_unanswered">' . $lang_common['Show unanswered posts'] . '</a></dd>'; if ($pun_config['o_subscriptions'] == 1) { echo '<dd><a href="search.php?action=show_subscriptions">' . $lang_common['Show subscriptions'] . '</a></dd>'; }
Show buttons above edit and post form. This file is part of Elektra File Upload mod for PunBB. Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org) Copyright (C) 2007 artoodetoo (master@1wd.ru) Included from: edit.php, post.php Incoming variables; Outgoing variables: $attachments: array - cache of attachments records ************************************************************************/ JsHelper::getInstance()->add(PUN_ROOT . 'js/reply.js'); JsHelper::getInstance()->addInternal(' var post_form = \'' . $focus_element[0] . '\'; var txt = \'\'; var text_enter_title = \'' . $lang_fu['JS enter title'] . '\'; var text_enter_url = \'' . $lang_fu['JS enter url'] . '\'; var text_enter_url_name = \'' . $lang_fu['JS enter url name'] . '\'; var text_enter_image = \'' . $lang_fu['JS enter image'] . '\'; var text_enter_email = \'' . $lang_fu['JS enter email'] . '\'; var error_no_url = \'' . $lang_fu['JS no url'] . '\'; var error_no_title = \'' . $lang_fu['JS no title'] . '\'; var error_no_email = \'' . $lang_fu['JS no email'] . '\'; '); ?> <div id="buttonmenu"> <ul> <li><a href="#" onclick="return insert_text('[b]', '[/b]');"><strong>B</strong></a></li>
function do_hide($text, $post = 0, $matches) { global $pun_user, $lang_topic, $lang_common; include_once PUN_ROOT . 'lang/' . $pun_user['language'] . '/topic.php'; $matches[3] = intval($matches[3]); /** * Если автор указал [hide=(\d+)][/hide] с параметром, * то он ограничил читателя, в возмозможности просматривать скрытый текст, * по кол-ву написанных читателем сообщений в форум. **/ if ($pun_user['num_posts'] < $matches[3]) { return str_replace($matches[0], str_replace(array('%num_posts%', '%posts%'), array($pun_user['num_posts'], $matches[3]), $lang_common['BBCode posts']), $text); } $basename = basename($_SERVER['PHP_SELF']); if (pathinfo(dirname($_SERVER['PHP_SELF']), PATHINFO_FILENAME) == 'wap') { if ($basename == 'hide.php') { return str_replace($matches[0], '<div class="attach_list">' . $matches[4] . '</div>', $text); } return str_replace($matches[0], '<div class="attach_list"><a onclick="window.open(\'hide.php?id=' . $post . '\', \'\', \'width=420,height=230,resizable=yes,scrollbars=yes,status=yes,location=no\'); return false;" target="_blank" href="hide.php?id=' . $post . '">' . $lang_topic['Show'] . '</a></div>', $text); } if ($basename == 'viewprintable.php') { return str_replace($matches[0], '<div class="spoiler" style="display: block;"><strong>' . $lang_topic['Hide'] . '</strong><br/>' . $matches[4] . '</div>', $text); } JsHelper::getInstance()->add(PUN_ROOT . 'js/spoiler.js'); return str_replace($matches[0], '<div><input type="button" value="' . $lang_topic['Hide'] . '" onclick="spoiler(this.nextSibling);"/><div class="spoiler"><br/>' . $matches[4] . '</div></div>', $text); }
Copyright (C) 2007 artoodetoo (master@1wd.ru) Included from: edit.php, filemap.php, viewtopic.php Incoming variables: $attachments: array - cache of attachments records ************************************************************************/ if (@$attachments) { $thumb_height = $pun_config['file_thumb_height']; $thumb_width = $pun_config['file_thumb_width']; $pview_height = $pun_config['file_preview_height']; $pview_width = $pun_config['file_preview_width']; $tmp = array(); foreach ($attachments as $post_attachments) { foreach ($post_attachments as $attachment) { // generate preview images just-in-time if (preg_match('/^image\\/(.*)$/i', $attachment['mime'], $regs)) { $pview_fname = require_thumb($attachment['id'], $attachment['location'], $pview_width, $pview_height, false); $thumb_fname = require_thumb($attachment['id'], $attachment['location'], $thumb_width, $thumb_height, true); $img_size = ' (' . $regs[1] . ' ' . $attachment['image_dim'] . ')'; } else { $thumb_fname = $img_size = null; } $tmp[] = "'" . $attachment['id'] . "': [" . "'" . format_time($attachment['uploaded']) . "'," . "'" . pun_htmlspecialchars($attachment['filename']) . "'," . "'" . $lang_fu['Size'] . ': ' . round($attachment['size'] / 1024, 1) . 'kb ' . $img_size . ' ' . $lang_fu['Downloads'] . ': ' . $attachment['downloads'] . "','" . $thumb_fname . "'," . intval(isset($attachment['can_download']) ? $attachment['can_download'] : $can_download) . ']'; } } JsHelper::getInstance()->addInternal('ATTACH_DATA={' . implode(',', $tmp) . '};'); unset($tmp); } JsHelper::getInstance()->add(PUN_ROOT . 'js/pop.js'); echo '<div id="pun-popup" class="punpopup"><p id="pun-title" class="popup-title">title</p><p id="pun-desc" class="popup-desc">Description</p><p id="pun-body" class="popup-body">Body</p></div>';
} if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == 1) { if ($cur_topic['is_subscribed']) { // I apologize for the variable naming here. It's a mix of subscription and action I guess :-) $subscraction = '<p class="subscribelink clearb">' . $lang_topic['Is subscribed'] . ' - <a href="misc.php?unsubscribe=' . $id . '">' . $lang_topic['Unsubscribe'] . '</a></p>'; } else { $subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe=' . $id . '">' . $lang_topic['Subscribe'] . '</a></p>'; } } else { $subscraction = '<div class="clearer"></div>'; } $page_title = pun_htmlspecialchars($pun_config['o_board_title'] . ' / ' . $cur_topic['subject']); define('PUN_ALLOW_INDEX', 1); require_once PUN_ROOT . 'header.php'; if ($pun_config['o_show_post_karma'] == 1 || $pun_user['g_id'] < PUN_GUEST) { JsHelper::getInstance()->add(PUN_ROOT . 'js/karma.js'); } echo '<div class="linkst"><div class="inbox"> <p class="pagelink conl">' . $paging_links . '</p> <p class="postlink conr">' . $post_link . '</p> <ul><li><a href="index.php">' . $lang_common['Index'] . '</a></li><li> » <a href="viewforum.php?id=' . $cur_topic['forum_id'] . '">' . pun_htmlspecialchars($cur_topic['forum_name']) . '</a></li><li> » ' . pun_htmlspecialchars($cur_topic['subject']) . '</li></ul> <div class="clearer"></div></div></div>'; include_once PUN_ROOT . 'include/parser.php'; // hcs AJAX POLL MOD BEGIN if ($pun_config['poll_enabled'] == 1) { include_once PUN_ROOT . 'include/poll/poll.inc.php'; if ($cur_topic['has_poll']) { echo $Poll->showPoll($cur_topic['has_poll']); } } // hcs AJAX POLL MOD END