Example #1
0
 public function pages()
 {
     $this->load->module('core')->set_meta_tags(lang('Search', 'filter'));
     // Удалим из строки запроса /filter/pages
     $segments = array_slice($this->uri->segment_array(), 2);
     // Парсим строку запроса сгенерированную http_build_query обратно в массив.
     $search_data = $this->parse_url($segments);
     // Получаем ID страниц, которые подходят критериям поиска,
     $ids = $this->search_items($search_data);
     // если ничего не найдено, выводим соответствующее сообщение.
     if (!$ids) {
         $this->no_pages_found();
     }
     //exit
     // Получаем данные страниц
     $query = $this->_filter_pages($ids, $search_data);
     // Сделаем пагинацию
     $this->load->library('Pagination');
     $config['base_url'] = site_url('filter/pages/' . http_build_query($search_data, '', '/'));
     $config['total_rows'] = $this->_filter_pages($ids, $search_data, TRUE);
     $config['per_page'] = $this->items_per_page;
     $config['uri_segment'] = $this->uri->total_segments();
     $config['first_link'] = lang("The first", 'filter');
     $config['last_link'] = lang("Last", 'filter');
     $config['cur_tag_open'] = '<span class="active">';
     $config['cur_tag_close'] = '</span>';
     $this->pagination->num_links = 5;
     $this->pagination->initialize($config);
     $pagination = $this->pagination->create_links();
     if ($query->num_rows() > 0) {
         $tpl = $this->default_tpl;
         $pages = $query->result_array();
         // Продублируем здесь хук core_return_category_pages,
         // чтобы подключить к найденным страницам поля cfcm.
         ($hook = get_hook('core_return_category_pages')) ? eval($hook) : NULL;
         // Если поиск производится по одной категории,
         // то используем ее шаблон.
         if (isset($search_data['category']) and count((array) $search_data['category']) == 1) {
             $category = $this->lib_category->get_category($search_data['category']);
             if ($category['tpl'] == '') {
                 $tpl = 'category';
             } else {
                 $tpl = $category['tpl'];
             }
         }
         $data = array('pages' => $pages, 'pagination' => $pagination, 'category' => $category);
         if ($tpl == 'search') {
             $data['items'] = $data['pages'];
         }
         $this->template->add_array($data);
         $this->template->show($tpl);
     } else {
         $this->no_pages_found();
     }
 }
Example #2
0
function om_friends_del_friend($friend_id)
{
    global $forum_db, $forum_user;
    $result = ($hook = get_hook('om_friends_fn_del_friend_start')) ? eval($hook) : null;
    if ($result) {
        return;
    }
    $query = array('DELETE' => 'om_friends', 'WHERE' => 'user_id = ' . $forum_user['id'] . ' AND friend_id = ' . $friend_id);
    ($hook = get_hook('om_friends_fn_add_friend_qr_add_friend')) ? eval($hook) : null;
    $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
}
Example #3
0
function om_move_posts_load_cache()
{
    ($hook = get_hook('om_move_posts_fn_load_cache_start')) ? eval($hook) : null;
    if (!defined('OM_MOVE_POSTS_CACHE_LOADED') && file_exists(FORUM_CACHE_DIR . 'cache_om_move_posts.php')) {
        include FORUM_CACHE_DIR . 'cache_om_move_posts.php';
    }
    // Regenerate cache only if it not exists
    if (!defined('OM_MOVE_POSTS_CACHE_LOADED')) {
        om_move_posts_generate_cache();
        require FORUM_CACHE_DIR . 'cache_om_move_posts.php';
    }
    return $om_move_posts_max;
}
function get_new_password()
{
    global $settings;
    if ($settings['admin_username'] == $_REQUEST['user'] && $settings['admin_password'] == $_REQUEST['old_pw']) {
        $new_password = random_key(8, true);
        $query = array('UPDATE' => 'settings', 'SET' => 'value="' . openld_hash($new_password) . '"', 'WHERE' => 'title="admin_password"');
        ($hook = get_hook('admin_login_get_password_settings_sql')) ? eval($hook) : null;
        $db->query_build($query);
        generate_settings_cache();
        echo NEW_PASSWORD . ":" . $new_password;
    } else {
        error("Invalid password request");
    }
}
 function index()
 {
     //        $this->cms_admin->get_langs();
     //cp_check_perm('cp_site_settings');
     $settings = $this->cms_admin->get_settings();
     unset($settings['siteinfo']);
     $locale = $this->db->select('identif')->where('default', 1)->get('languages')->row_array();
     $this->load->library('SiteInfo', $locale['identif']);
     $siteinfo = $siteinfo = $this->siteinfo->getSiteInfoData(TRUE);
     if (is_array($siteinfo)) {
         $this->template->add_array($siteinfo);
     }
     $this->template->add_array($settings);
     $this->template->assign('templates', $this->_get_templates());
     $this->template->assign('template_selected', $settings['site_template']);
     // Передає змінну статусу роботів
     $this->template->assign('robots_settings_status', $settings['robots_settings_status']);
     $this->template->assign('robots_settings', $settings['robots_settings']);
     $this->template->assign('robots_status', $settings['robots_status']);
     $this->template->assign('work_values', array('yes' => lang("Yes", "admin"), 'no' => lang("No", "admin")));
     $this->template->assign('site_offline', $settings['site_offline']);
     $this->config->set_item('cur_lang', $this->load->module('core')->def_lang[0]['id']);
     $this->template->assign('tree', $this->lib_category->build());
     $this->template->assign('parent_id', $settings['main_page_cat']);
     $this->template->assign('id', 0);
     ///++++++++++++++++++++
     $langs = $this->db->get('languages')->result_array();
     $lang_meta = array();
     foreach ($langs as $lang) {
         $meta = $this->db->where('lang_ident', $lang['id'])->limit(1)->get('settings_i18n')->result_array();
         if (count($meta) > 0) {
             $lang_meta[$lang['id']] = $meta[0];
         } else {
             $lang_meta[$lang['id']] = null;
         }
     }
     $this->template->assign('langs', $langs);
     $this->template->assign('meta_langs', $lang_meta);
     //++++++++++++++++++++
     ($hook = get_hook('admin_show_settings_tpl')) ? eval($hook) : NULL;
     // Load modules list
     $notAvailableModules = array('mainsaas', 'saas');
     $this->template->assign('modules', $this->db->where_not_in('name', $notAvailableModules)->get('components')->result_array());
     $this->template->show('settings_site', FALSE);
 }
Example #6
0
 static function fields()
 {
     $return = ($hook = get_hook('ch_fn_generate_fields_cache_start')) ? eval($hook) : null;
     if ($return != null) {
         return;
     }
     $query = array('SELECT' => 'f. *', 'FROM' => 'fields AS f', 'ORDER BY' => 'f.id');
     ($hook = get_hook('ch_fn_generate_fields_cache_get_fields')) ? eval($hook) : null;
     $result = App::$forum_db->query_build($query) or error(__FILE__, __LINE__);
     $output = array();
     while ($cur_row = App::$forum_db->fetch_assoc($result)) {
         $output[] = $cur_row;
     }
     // Output fields list as PHP code
     $fh = @fopen(FORUM_CACHE_DIR . 'cache_fields.php', 'wb');
     if (!$fh) {
         error('Unable to write fields cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
     }
     fwrite($fh, '<?php' . "\n\n" . 'define(\'FORUM_FIELDS_LOADED\', 1);' . "\n\n" . '$forum_fields = ' . var_export($output, true) . ';' . "\n\n" . '?>');
     fclose($fh);
 }
function forum_mail($to, $subject, $message, $reply_to_email = '', $reply_to_name = '')
{
    global $forum_config, $lang_common;
    // Default sender address
    $from_name = sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']);
    $from_email = $forum_config['o_webmaster_email'];
    ($hook = get_hook('em_fn_forum_mail_start')) ? eval($hook) : null;
    // Do a little spring cleaning
    $to = forum_trim(preg_replace('#[\\n\\r]+#s', '', $to));
    $subject = forum_trim(preg_replace('#[\\n\\r]+#s', '', $subject));
    $from_email = forum_trim(preg_replace('#[\\n\\r:]+#s', '', $from_email));
    $from_name = forum_trim(preg_replace('#[\\n\\r:]+#s', '', str_replace('"', '', $from_name)));
    $reply_to_email = forum_trim(preg_replace('#[\\n\\r:]+#s', '', $reply_to_email));
    $reply_to_name = forum_trim(preg_replace('#[\\n\\r:]+#s', '', str_replace('"', '', $reply_to_name)));
    // Set up some headers to take advantage of UTF-8
    $from = "=?UTF-8?B?" . base64_encode($from_name) . "?=" . ' <' . $from_email . '>';
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    $headers = 'From: ' . $from . "\r\n" . 'Date: ' . gmdate('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: text/plain; charset=utf-8' . "\r\n" . 'X-Mailer: PunBB Mailer';
    // If we specified a reply-to email, we deal with it here
    if (!empty($reply_to_email)) {
        $reply_to = "=?UTF-8?B?" . base64_encode($reply_to_name) . "?=" . ' <' . $reply_to_email . '>';
        $headers .= "\r\n" . 'Reply-To: ' . $reply_to;
    }
    // Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
    $message = str_replace(array("\n", ""), array("\r\n", ''), forum_linebreaks($message));
    ($hook = get_hook('em_fn_forum_mail_pre_send')) ? eval($hook) : null;
    if ($forum_config['o_smtp_host'] != '') {
        smtp_mail($to, $subject, $message, $headers);
    } else {
        // Change the linebreaks used in the headers according to OS
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
            $headers = str_replace("\r\n", "\r", $headers);
        } else {
            if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
                $headers = str_replace("\r\n", "\n", $headers);
            }
        }
        mail($to, $subject, $message, $headers);
    }
}
function validate_search_action($action)
{
    // A list of valid actions (extensions can add their own actions to the array)
    $valid_actions = array('search', 'show_new', 'show_recent', 'show_user_posts', 'show_user_topics', 'show_subscriptions', 'show_forum_subscriptions', 'show_unanswered');
    $return = ($hook = get_hook('sf_fn_validate_actions_start')) ? eval($hook) : null;
    if ($return != null) {
        return $return;
    }
    return in_array($action, $valid_actions);
}
Example #9
0
<?php 
        ($hook = get_hook('ark_pre_edit_cur_rank_fieldset_end')) ? eval($hook) : null;
        ?>
				</fieldset>
<?php 
        ($hook = get_hook('ark_edit_cur_rank_fieldset_end')) ? eval($hook) : null;
    }
    ?>
			</fieldset>
		</form>
	</div>
<?php 
} else {
    ?>
		<div class="frm-form">
			<div class="ct-box">
				<p><?php 
    echo $lang_admin_ranks['No ranks'];
    ?>
</p>
			</div>
		</div>
	</div>
<?php 
}
($hook = get_hook('ark_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT . 'footer.php';
    move_link($req_id, $req_page, $_REQUEST['move_link_sql'], $_REQUEST['to_new_parent']);
} elseif (isset($_REQUEST['edit_cat_sql'])) {
    edit_a_category($req_id, $req_page, $_REQUEST['cat_id']);
} elseif (isset($_REQUEST['edit_link_sql'])) {
    edit_a_link($req_id, $req_page, $_REQUEST['edit_link_sql']);
} elseif (isset($_REQUEST['add_a_link'])) {
    add_a_link($req_id);
} elseif (isset($_REQUEST['add_a_category'])) {
    add_a_category($req_id);
} elseif (isset($_REQUEST['unaccept'])) {
    unaccept_category($_REQUEST['unaccept']);
} elseif (isset($_REQUEST['unaccept_link'])) {
    unaccept_link($_REQUEST['unaccept_link']);
}
($hook = get_hook('admin_browse_after_sql_ops')) ? eval($hook) : null;
//Now Dig for categories which content we will display later
$query = array('SELECT' => 'id, title, description', 'FROM' => 'categories', 'WHERE' => 'father_id=' . intval($req_id) . OPENLD_IF_ACTIVE_CATS);
($hook = get_hook('admin_browse_categories_sql_parent')) ? eval($hook) : null;
$categories_result = $db->query_build($query) or error(__FILE__, __LINE__);
//Dig for links
$query = array('SELECT' => '*', 'FROM' => 'links', 'WHERE' => 'category_id=' . $req_id . OPENLD_IF_ACTIVE_LINKS);
($hook = get_hook('admin_browse_sql_categories')) ? eval($hook) : null;
$links_result = $db->query_build($query) or error("can't dig links", __FILE__, __LINE__);
$start_limit = $settings['number_of_links_per_page'] * (intval($req_page) > 0 ? intval($req_page) - 1 : 0);
$query['ORDER BY'] = 'type DESC, "' . $settings['links_sorting_by'] . '"';
$query['LIMIT'] = $start_limit . ', ' . $settings['number_of_links_per_page'];
($hook = get_hook('admin_browse_sql_limit_categories')) ? eval($hook) : null;
//bad hook-name
$result_limit = $db->query_build($query) or error("can't dig links with result_limit", __FILE__, __LINE__);
$page = 'admin/admin_browse.php';
require OPENLD_ROOT . 'admin_footer.php';
						<label for="fld<?php 
    echo ++$forum_page['fld_count'];
    ?>
"><span><?php 
    echo 'Cleartext';
    ?>
</span></label><br />
						<span class="fld-input"><input type="text" id="fld<?php 
    echo $forum_page['fld_count'];
    ?>
" name="req_CLEARTEXT" size="10" required /></span>
					</div>
				</div>
			<?php 
}
?>
			<div class="frm-buttons">
				<span class="submit primary"><input type="submit" name="login" value="<?php 
echo $lang_login['Login'];
?>
" /></span>
			</div>
		</form>
	</div>
<?php 
($hook = get_hook('li_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT . 'footer.php';
Example #12
0
if (!isset($base_url)) {
    // Make an educated guess regarding base_url
    $base_url_guess = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . preg_replace('/:80$/', '', $_SERVER['HTTP_HOST']) . str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
    if (substr($base_url_guess, -1) == '/') {
        $base_url_guess = substr($base_url_guess, 0, -1);
    }
    $base_url = $base_url_guess;
}
// Verify that we are running the proper database schema revision
if (defined('PUN') || !isset($forum_config['o_database_revision']) || $forum_config['o_database_revision'] < FORUM_DB_REVISION || version_compare($forum_config['o_cur_version'], FORUM_VERSION, '<')) {
    error('Your PunBB database is out-of-date and must be upgraded in order to continue.<br />Please run <a href="' . $base_url . '/admin/db_update.php">db_update.php</a> in order to complete the upgrade process.');
}
// Load hooks
if (file_exists(FORUM_CACHE_DIR . 'cache_hooks.php')) {
    include FORUM_CACHE_DIR . 'cache_hooks.php';
}
if (!defined('FORUM_HOOKS_LOADED')) {
    if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
        require FORUM_ROOT . 'include/cache.php';
    }
    generate_hooks_cache();
    require FORUM_CACHE_DIR . 'cache_hooks.php';
}
require FORUM_ROOT . 'include/flash_messenger.php';
$forum_flash = new FlashMessenger();
// A good place to add common functions for your extension
($hook = get_hook('es_essentials')) ? eval($hook) : null;
if (!defined('FORUM_MAX_POSTSIZE_BYTES')) {
    define('FORUM_MAX_POSTSIZE_BYTES', 65535);
}
define('FORUM_ESSENTIALS_LOADED', 1);
Example #13
0
 function run($module)
 {
     $this->checkPerm($module);
     $func = $this->uri->segment(5);
     if ($func == FALSE) {
         $func = 'index';
     }
     ($hook = get_hook('admin_run_module_admin')) ? eval($hook) : NULL;
     $this->load->module('core/core');
     $args = $this->core->grab_variables(6);
     $this->template->assign('SELF_URL', site_url('admin/components/cp/' . $module));
     echo modules::run($module . '/admin/' . $func, $args);
 }
function redirect($destination_url, $message)
{
    global $forum_db, $forum_config, $lang_common, $forum_user, $base_url, $forum_loader;
    define('FORUM_PAGE', 'redirect');
    ($hook = get_hook('fn_redirect_start')) ? eval($hook) : null;
    // Prefix with base_url (unless it's there already)
    if (strpos($destination_url, 'http://') !== 0 && strpos($destination_url, 'https://') !== 0 && strpos($destination_url, '/') !== 0) {
        $destination_url = $base_url . '/' . $destination_url;
    }
    // Do a little spring cleaning
    $destination_url = preg_replace('/([\\r\\n])|(%0[ad])|(;[\\s]*data[\\s]*:)/i', '', $destination_url);
    // If the delay is 0 seconds, we might as well skip the redirect all together
    if ($forum_config['o_redirect_delay'] == '0') {
        header('Location: ' . str_replace('&amp;', '&', $destination_url));
    }
    // Send no-cache headers
    header('Expires: Thu, 21 Jul 1977 07:30:00 GMT');
    // When yours truly first set eyes on this world! :)
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: post-check=0, pre-check=0', false);
    header('Pragma: no-cache');
    // For HTTP/1.0 compability
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    // Load the redirect template
    if (file_exists(FORUM_ROOT . 'style/' . $forum_user['style'] . '/redirect.tpl')) {
        $tpl_path = FORUM_ROOT . 'style/' . $forum_user['style'] . '/redirect.tpl';
    } else {
        $tpl_path = FORUM_ROOT . 'include/template/redirect.tpl';
    }
    ($hook = get_hook('fn_redirect_pre_template_loaded')) ? eval($hook) : null;
    $tpl_redir = forum_trim(file_get_contents($tpl_path));
    ($hook = get_hook('fn_redirect_template_loaded')) ? eval($hook) : null;
    // START SUBST - <!-- forum_local -->
    $tpl_redir = str_replace('<!-- forum_local -->', 'xml:lang="' . $lang_common['lang_identifier'] . '" lang="' . $lang_common['lang_identifier'] . '" dir="' . $lang_common['lang_direction'] . '"', $tpl_redir);
    // END SUBST - <!-- forum_local -->
    // START SUBST - <!-- forum_head -->
    $forum_head['refresh'] = '<meta http-equiv="refresh" content="' . $forum_config['o_redirect_delay'] . ';URL=' . str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) . '" />';
    $forum_head['title'] = '<title>' . $lang_common['Redirecting'] . $lang_common['Title separator'] . forum_htmlencode($forum_config['o_board_title']) . '</title>';
    ob_start();
    // Include stylesheets
    require FORUM_ROOT . 'style/' . $forum_user['style'] . '/' . $forum_user['style'] . '.php';
    $head_temp = forum_trim(ob_get_contents());
    $num_temp = 0;
    foreach (explode("\n", $head_temp) as $style_temp) {
        $forum_head['style' . $num_temp++] = $style_temp;
    }
    ob_end_clean();
    ($hook = get_hook('fn_redirect_head')) ? eval($hook) : null;
    $tmp_head = implode("\n", $forum_head) . $forum_loader->render_css();
    $tpl_redir = str_replace('<!-- forum_head -->', $tmp_head, $tpl_redir);
    unset($forum_head, $tmp_head);
    // END SUBST - <!-- forum_head -->
    // START SUBST - <!-- forum_redir_main -->
    ob_start();
    ?>
<div id="brd-main" class="main basic">

	<div class="main-head">
		<h1 class="hn"><span><?php 
    echo $message . $lang_common['Redirecting'];
    ?>
</span></h1>
	</div>

	<div class="main-content main-message">
		<p><?php 
    printf($lang_common['Forwarding info'], $forum_config['o_redirect_delay'], intval($forum_config['o_redirect_delay']) == 1 ? $lang_common['second'] : $lang_common['seconds']);
    ?>
<span> <a href="<?php 
    echo $destination_url;
    ?>
"><?php 
    echo $lang_common['Click redirect'];
    ?>
</a></span></p>
	</div>

</div>
<?php 
    $tpl_temp = "\t" . forum_trim(ob_get_contents());
    $tpl_redir = str_replace('<!-- forum_redir_main -->', $tpl_temp, $tpl_redir);
    ob_end_clean();
    // END SUBST - <!-- forum_redir_main -->
    // START SUBST - <!-- forum_debug -->
    if (defined('FORUM_SHOW_QUERIES')) {
        $tpl_redir = str_replace('<!-- forum_debug -->', get_saved_queries(), $tpl_redir);
    }
    // End the transaction
    $forum_db->end_transaction();
    // END SUBST - <!-- forum_debug -->
    // START SUBST - <!-- forum_include "*" -->
    while (preg_match('#<!-- ?forum_include "([^/\\\\]*?)" ?-->#', $tpl_redir, $cur_include)) {
        if (!file_exists(FORUM_ROOT . 'include/user/' . $cur_include[1])) {
            error('Unable to process user include &lt;!-- forum_include "' . forum_htmlencode($cur_include[1]) . '" --&gt; from template redirect.tpl.<br />There is no such file in folder /include/user/.');
        }
        ob_start();
        include FORUM_ROOT . 'include/user/' . $cur_include[1];
        $tpl_temp = ob_get_contents();
        $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
        ob_end_clean();
    }
    // END SUBST - <!-- forum_include "*" -->
    // Close the db connection (and free up any result data)
    $forum_db->close();
    exit($tpl_redir);
}
							<li>
								<?php 
echo $db_version;
?>
							</li>
							<li>
								<?php 
echo ROWS_LABEL;
?>
								<?php 
echo strval($total_records);
?>
							</li>
							<li>
								<?php 
echo SIZE_LABEL;
?>
								<?php 
echo $total_size;
?>
							</li>
						</ul>
					</li>
				</ol>
			</fieldset>
		</div>
		<?php 
($hook = get_hook('admin_information_footer')) ? eval($hook) : null;
?>
	</div>
</div>
Example #16
0
	</div>
</div>
<?php 
} elseif (isset($_GET['term']) && $db->num_rows($search_results) == 0) {
    ?>
<div class="openld-block openld-form">
	<h2>
		<span>
			<?php 
    echo SERCHED_FOR_LABEL;
    ?>
 "<?php 
    echo openld_htmlspecialchars($_GET['term']);
    ?>
"
		</span>
	</h2>
	<div class="openld-content">
		<?php 
    ($hook = get_hook('search_no_results_header')) ? eval($hook) : null;
    ?>
		<?php 
    echo NO_MATCHES;
    ?>
		<?php 
    ($hook = get_hook('search_no_results_footer')) ? eval($hook) : null;
    ?>
	</div>
</div>
<?php 
}
Example #17
0
				<a href="admin_links.php?unaccept_link=<?php 
            echo $links['id'];
            ?>
'&amp;page=<?php 
            echo $req_page;
            ?>
"><?php 
            echo UNACCEPT_LABEL;
            ?>
</a>
				<?php 
            ($hook = get_hook('admin_links_row_footer')) ? eval($hook) : null;
            ?>
			</td>
			<?php 
            ($hook = get_hook('admin_links_row_tbody_tr_footer')) ? eval($hook) : null;
            ?>
		</tr>
		<?php 
        }
        ?>
	</tbody>
</table>
<?php 
        echo link_pagination($links_result, $req_page, 'admin_links.php?page=#p');
    } else {
        echo NO_LINKS_HERE;
        ($hook = get_hook('admin_links_no_links')) ? eval($hook) : null;
    }
    ($hook = get_hook('admin_links_after_sql_if')) ? eval($hook) : null;
}
 /**
  * captcha check
  * @param type $code
  * @return boolean
  */
 function captcha_check($code)
 {
     ($hook = get_hook('auth_captcha_check')) ? eval($hook) : NULL;
     if (!$this->dx_auth->captcha_check($code)) {
         return FALSE;
     } else {
         return TRUE;
     }
 }
function pun_repository_check_dependencies($inst_exts, $dependencies)
{
    ($hook = get_hook('pun_repository_check_dependencies_start')) ? eval($hook) : null;
    if (empty($dependencies)) {
        return false;
    }
    //print_r($dependencies);
    if (isset($dependencies['dependency']) && is_string($dependencies['dependency'])) {
        $dependencies = array($dependencies['dependency']);
    } else {
        $dependencies = reset($dependencies);
        if (isset($dependencies['dependency']) && is_string($dependencies['dependency'])) {
            $dependencies = array($dependencies['dependency']);
        } else {
            $dependencies = $dependencies['dependency'];
        }
    }
    $unresolved = array();
    foreach ($dependencies as $dependency) {
        $dependency = preg_replace('~[^\\w_]~', '', $dependency);
        // Add the dependency to the list of unresolved ones
        if (!isset($inst_exts[$dependency])) {
            $unresolved[] = $dependency;
        }
    }
    ($hook = get_hook('pun_repository_check_dependencies_end')) ? eval($hook) : null;
    return compact('dependencies', 'unresolved');
}
Example #20
0
function output_xml($feed)
{
    global $lang_common, $forum_config;
    // Send XML/no cache headers
    header('Content-Type: application/xml; charset=utf-8');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
    echo '<source>' . "\n";
    echo "\t" . '<url>' . $feed['link'] . '</url>' . "\n";
    ($hook = get_hook('ex_add_new_xml_info')) ? eval($hook) : null;
    $forum_tag = $feed['type'] == 'posts' ? 'post' : 'topic';
    foreach ($feed['items'] as $item) {
        echo "\t" . '<' . $forum_tag . ' id="' . $item['id'] . '">' . "\n";
        echo "\t\t" . '<title><![CDATA[' . escape_cdata($item['title']) . ']]></title>' . "\n";
        echo "\t\t" . '<link>' . $item['link'] . '</link>' . "\n";
        echo "\t\t" . '<content><![CDATA[' . escape_cdata($item['description']) . ']]></content>' . "\n";
        echo "\t\t" . '<author>' . "\n";
        echo "\t\t\t" . '<name><![CDATA[' . escape_cdata($item['author']['name']) . ']]></name>' . "\n";
        if (isset($item['author']['email'])) {
            echo "\t\t\t" . '<email><![CDATA[' . escape_cdata($item['author']['email']) . ']]></email>' . "\n";
        }
        if (isset($item['author']['uri'])) {
            echo "\t\t\t" . '<uri>' . $item['author']['uri'] . '</uri>' . "\n";
        }
        echo "\t\t" . '</author>' . "\n";
        echo "\t\t" . '<posted>' . gmdate('r', $item['pubdate']) . '</posted>' . "\n";
        ($hook = get_hook('ex_add_new_xml_item_info')) ? eval($hook) : null;
        echo "\t" . '</' . $forum_tag . '>' . "\n";
    }
    echo '</source>' . "\n";
}
 /**
  * Select all categories
  *
  * @access public
  * @return array
  */
 public function get_categories()
 {
     //        $this->db->cache_on();
     $this->db->order_by('position', 'ASC');
     $query = $this->db->get('category');
     if ($query->num_rows() > 0) {
         $categories = $query->result_array();
         ($hook = get_hook('cmsbase_return_categories')) ? eval($hook) : NULL;
         return $categories;
     }
     //        $this->db->cache_on();
     return FALSE;
 }
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

************************************************************************/
define('OPENLD_ROOT', './');
require OPENLD_ROOT . 'admin_header.php';
$req_page = isset($_REQUEST['page']) ? is_numeric($_REQUEST['page']) ? $_REQUEST['page'] : '1' : '1';
$req_id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '0';
$req_cat = isset($_REQUEST['category']) ? $_REQUEST['category'] : '';
//SQL Operations
if (isset($_REQUEST['delete_link'])) {
    delete_link($_REQUEST['delete_link']);
} elseif (isset($_REQUEST['move_link_sql'])) {
    move_link(0, $req_page, $_REQUEST['move_link_sql'], $_REQUEST['to_new_parent']);
} elseif (isset($_REQUEST['edit_link_sql'])) {
    edit_a_link(0, $req_page, $_REQUEST['edit_link_sql']);
} elseif (isset($_REQUEST['accept_link'])) {
    accept_link($_REQUEST['accept_link']);
}
($hook = get_hook('admin_accept_links_after_sql_ops')) ? eval($hook) : null;
$query = array('SELECT' => '*', 'FROM' => 'links', 'WHERE' => 'active=0');
($hook = get_hook('admin_accept_links_sql')) ? eval($hook) : null;
$result = $db->query_build($query) or error("can't dig links", __FILE__, __LINE__);
$start_limit = $settings['number_of_links_per_page'] * (intval($req_page) > 0 ? intval($req_page) - 1 : 0);
$query['ORDER BY'] = 'type DESC, ' . $settings['links_sorting_by'];
$query['LIMIT'] = $start_limit . ", " . $settings['number_of_links_per_page'];
($hook = get_hook('admin_accept_links_sql_limit')) ? eval($hook) : null;
$result_limit = $db->query_build($query) or error("can't dig links with result_limit", __FILE__, __LINE__);
$page = 'admin/admin_accept_links.php';
require OPENLD_ROOT . 'admin_footer.php';
Example #23
0
function generate_ext_versions_cache($inst_exts, $repository_urls, $repository_url_by_extension)
{
    $forum_ext_last_versions = array();
    $forum_ext_repos = array();
    foreach (array_unique(array_merge($repository_urls, $repository_url_by_extension)) as $url) {
        //Get repository timestamp
        $remote_file = get_remote_file($url . '/timestamp', 2);
        $repository_timestamp = empty($remote_file['content']) ? '' : forum_trim($remote_file['content']);
        unset($remote_file);
        if (!is_numeric($repository_timestamp)) {
            continue;
        }
        if (!isset($forum_ext_repos[$url]['timestamp'])) {
            $forum_ext_repos[$url]['timestamp'] = $repository_timestamp;
        }
        if ($forum_ext_repos[$url]['timestamp'] <= $repository_timestamp) {
            foreach ($inst_exts as $ext) {
                $remote_file = get_remote_file($url . '/' . $ext['id'] . '/lastversion', 2);
                $version = empty($remote_file['content']) ? '' : forum_trim($remote_file['content']);
                unset($remote_file);
                if (empty($version) || !preg_match('~^[0-9a-zA-Z\\. +-]+$~u', $version)) {
                    continue;
                }
                $forum_ext_repos[$url]['extension_versions'][$ext['id']] = $version;
                //If key with current extension exist in array, compare it with version in rep-ry
                if (!isset($forum_ext_last_versions[$ext['id']]) || version_compare($forum_ext_last_versions[$ext['id']]['version'], $version, '<')) {
                    $forum_ext_last_versions[$ext['id']] = array('version' => $version, 'repo_url' => $url);
                    $remote_file = get_remote_file($url . '/' . $ext['id'] . '/lastchanges', 2);
                    $last_changes = empty($remote_file['content']) ? '' : forum_trim($remote_file['content']);
                    unset($remote_file);
                    if (!empty($last_changes)) {
                        $forum_ext_last_versions[$ext['id']]['changes'] = $last_changes;
                    }
                }
            }
            //Write timestamp to cache
            $forum_ext_repos[$url]['timestamp'] = $repository_timestamp;
        }
    }
    if (array_keys($forum_ext_last_versions) != array_keys($inst_exts)) {
        foreach ($inst_exts as $ext) {
            if (!in_array($ext['id'], array_keys($forum_ext_last_versions))) {
                $forum_ext_last_versions[$ext['id']] = array('version' => $ext['version'], 'repo_url' => '', 'changes' => '');
            }
        }
    }
    ($hook = get_hook('ch_generate_ext_versions_cache_check_repository')) ? eval($hook) : null;
    // Output config as PHP code
    $fh = @fopen(FORUM_CACHE_DIR . 'cache_ext_version_notifications.php', 'wb');
    if (!$fh) {
        error('Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'.', __FILE__, __LINE__);
    }
    fwrite($fh, '<?php' . "\n\n" . 'if (!defined(\'FORUM_EXT_VERSIONS_LOADED\')) define(\'FORUM_EXT_VERSIONS_LOADED\', 1);' . "\n\n" . '$forum_ext_repos = ' . var_export($forum_ext_repos, true) . ';' . "\n\n" . ' $forum_ext_last_versions = ' . var_export($forum_ext_last_versions, true) . ";\n\n" . '$forum_ext_versions_update_cache = ' . time() . ";\n\n" . '?>');
    fclose($fh);
}
Example #24
0
</a></li>
					<li><a href="<?php 
echo $suggest_id;
?>
"><?php 
echo SUGGEST_CATEGORY_LABEL;
?>
</a></li>
					<li><a href="<?php 
echo $settings['domain'];
?>
/search.php">Advanced <?php 
echo SEARCH_LABEL;
?>
</a></li>
					<?php 
($hook = get_hook('navigation_menu_footer')) ? eval($hook) : null;
?>
				</ul>
			</div>
	<div class="openld-page openld-user" >
	<div id="openldbb-isolate">
		<div class="openld-common">
			<div id="openldbb-description">
				<?php 
echo $settings['description'];
?>
			</div>
		</div>
	</div>
	<div id="openldbb-main" class="openld-main">
            ($hook = get_hook('admin_links_row_tbody_tr_footer')) ? eval($hook) : null;
            ?>
					</tr>
					<?php 
            ($hook = get_hook('admin_browse_links_row')) ? eval($hook) : null;
        }
        ?>
				</tbody>
			</table>
			<?php 
        echo link_pagination($links_result, $req_page, 'admin_browse.php?id=' . $req_id . '&amp;page=#p');
    } else {
        echo NO_LINKS_HERE;
        ($hook = get_hook('admin_browse_no_links')) ? eval($hook) : null;
    }
    ($hook = get_hook('admin_browse_after_sql_if')) ? eval($hook) : null;
    ?>
		<br />
		<a href="admin_browse.php?add_link=<?php 
    echo $req_id;
    ?>
&amp;category=<?php 
    echo isset($_REQUEST['category']) ? openld_htmlspecialchars($_REQUEST['category']) : 'root';
    ?>
"><?php 
    echo ADD_LINK_LABEL;
    ?>
</a>
	</div>
</div>
<?php 
"<?php 
    echo $cat['id'] == (isset($_REQUEST['id']) ? $_REQUEST['id'] : "0") ? ' selected="selected"' : '';
    ?>
>
									<?php 
    echo openld_htmlspecialchars($cat['title']);
    ?>
									</option>
								<?php 
}
?>
							</select>
							<br />
							<?php 
echo $error->get_warning('category_warning');
?>
						</td>
					</tr>
					<?php 
($hook = get_hook('suggest_category_footer')) ? eval($hook) : null;
?>
				</table>
				<input type="submit" value="<?php 
echo SUGGEST_A_CATEGORY;
?>
" />
			</div>
		</form>
	</div>
</div>
Example #27
0
				</select>
				<?php 
} elseif (sizeof($openld_bans) == 0) {
    echo NO_IP_BANS;
}
?>
				<?php 
($hook = get_hook('admin_bans_after_sql_if')) ? eval($hook) : null;
?>
				</ br>
				<?php 
$error->get_warning('remove_ban_error');
?>
			</td>
			<td>
				<input type="submit" class="button" name="remove_ban" value="<?php 
echo UNBAN;
?>
" />
				<input type="submit" class="button" value="<?php 
echo INFO;
?>
" onclick="window.open('http://whois.domaintools.com/'+document.forms[0].unban.options[document.forms[0].unban.selectedIndex].text,'info')" />
			</td>
		</tr>
	</table>
	<?php 
($hook = get_hook('admin_bans')) ? eval($hook) : null;
?>
</form>
 /**
  * Set default language
  */
 function set_default()
 {
     //cp_check_perm('lang_edit');
     $lang_id = $this->input->post('lang');
     ($hook = get_hook('admin_change_def_language')) ? eval($hook) : NULL;
     $this->cache->delete('main_site_langs');
     $this->cms_admin->set_default_lang($lang_id);
     $lang = $this->cms_admin->get_lang($lang_id);
     $this->lib_admin->log(lang("Specified a language or selected a language", "admin") . " " . $lang['lang_name'] . " " . lang("by default", "admin"));
     showMessage(lang("The language has been installed by default", "admin") . ' <b> ' . $lang['lang_name'] . ' </b>');
 }
Example #29
0
    $forum_page['online_info'] = array();
    $forum_page['online_info']['guests'] = $forum_page['num_guests'] == 0 ? $lang_index['Guests none'] : sprintf($forum_page['num_guests'] == 1 ? $lang_index['Guests single'] : $lang_index['Guests plural'], forum_number_format($forum_page['num_guests']));
    $forum_page['online_info']['users'] = $forum_page['num_users'] == 0 ? $lang_index['Users none'] : sprintf($forum_page['num_users'] == 1 ? $lang_index['Users single'] : $lang_index['Users plural'], forum_number_format($forum_page['num_users']));
    ($hook = get_hook('in_users_online_pre_online_info_output')) ? eval($hook) : null;
    ?>
<div id="brd-online" class="gen-content">
	<h3 class="hn"><span><?php 
    printf($lang_index['Currently online'], implode($lang_index['Online stats separator'], $forum_page['online_info']));
    ?>
</span></h3>
<?php 
    if (!empty($users)) {
        ?>
	<p><?php 
        echo implode($lang_index['Online list separator'], $users);
        ?>
</p>
<?php 
    }
    ($hook = get_hook('in_new_online_data')) ? eval($hook) : null;
    ?>
</div>
<?php 
    ($hook = get_hook('in_users_online_end')) ? eval($hook) : null;
}
($hook = get_hook('in_info_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_info -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_info -->
require FORUM_ROOT . 'footer.php';
Example #30
0
<?php 
} else {
    ?>
		<div class="ct-box">
			<p><strong><?php 
    echo $lang_om_warnings['No warnings found'];
    ?>
</strong></p>
		</div>
<?php 
}
?>
	</div>
	<div class="main-foot">
<?php 
if (!empty($forum_page['main_foot_options'])) {
    echo "\n\t\t\t" . '<p class="options">' . implode(' ', $forum_page['main_foot_options']) . '</p>';
}
?>
		<h2 class="hn"><span><?php 
echo $forum_page['items_info'];
?>
</span></h2>
	</div>
<?php 
($hook = get_hook('om_warnings_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT . 'footer.php';