本文整理汇总了PHP中generate_board_url函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_board_url函数的具体用法?PHP generate_board_url怎么用?PHP generate_board_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_board_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: install_bbcode
public function install_bbcode()
{
$sql = 'SELECT bbcode_id FROM ' . $this->table_prefix . 'bbcodes WHERE LOWER(bbcode_tag) = \'image\'';
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if (!$row) {
// Create new BBCode
$sql = 'SELECT MAX(bbcode_id) AS max_bbcode_id FROM ' . $this->table_prefix . 'bbcodes';
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if ($row) {
$bbcode_id = $row['max_bbcode_id'] + 1;
// Make sure it is greater than the core BBCode ids...
if ($bbcode_id <= NUM_CORE_BBCODES) {
$bbcode_id = NUM_CORE_BBCODES + 1;
}
} else {
$bbcode_id = NUM_CORE_BBCODES + 1;
}
$url = generate_board_url() . '/';
if ($this->config['enable_mod_rewrite']) {
$url .= 'gallery/image/';
} else {
$url .= 'app.php/gallery/image/';
}
if ($bbcode_id <= BBCODE_LIMIT) {
$this->db->sql_query('INSERT INTO ' . $this->table_prefix . 'bbcodes ' . $this->db->sql_build_array('INSERT', array('bbcode_tag' => 'image', 'bbcode_id' => (int) $bbcode_id, 'bbcode_helpline' => 'GALLERY_HELPLINE_ALBUM', 'display_on_posting' => 1, 'bbcode_match' => '[image]{NUMBER}[/image]', 'bbcode_tpl' => '<a href="' . $url . '{NUMBER}"><img src="' . $url . '{NUMBER}/mini" alt="{NUMBER}" /></a>', 'first_pass_match' => '!\\[image\\]([0-9]+)\\[/image\\]!i', 'first_pass_replace' => '[image:$uid]${1}[/image:$uid]', 'second_pass_match' => '!\\[image:$uid\\]([0-9]+)\\[/image:$uid\\]!s', 'second_pass_replace' => '<a href="' . $url . '${1}"><img src="' . $url . '${1}/mini" alt="${1}" /></a>')));
}
}
}
开发者ID:here-we-go,项目名称:phpbbgallery,代码行数:32,代码来源:release_1_2_0_add_bbcode.php
示例2: path
public static function path($directory = 'gallery')
{
if (!self::$loaded) {
self::init();
}
switch ($directory) {
case 'gallery':
return self::$phpbb_root_path . self::$phpbb_gallery_path;
case 'phpbb':
return self::$phpbb_root_path;
case 'admin':
return self::$phpbb_admin_path;
case 'relative':
return self::$phpbb_gallery_path;
case 'full':
return generate_board_url() . '/' . self::$phpbb_gallery_path;
case 'board':
return generate_board_url();
case 'images':
return self::$phpbb_root_path . self::$phpbb_gallery_path . self::IMAGE_PATH;
case 'upload':
return self::$phpbb_root_path . self::$phpbb_gallery_path . self::IMAGE_PATH . self::UPLOAD_PATH;
case 'upload_noroot':
// stupid phpbb-upload class prepends the rootpath itself.
return self::$phpbb_gallery_path . self::IMAGE_PATH . self::UPLOAD_PATH;
case 'thumbnail':
return self::$phpbb_root_path . self::$phpbb_gallery_path . self::IMAGE_PATH . self::THUMBNAIL_PATH;
case 'medium':
return self::$phpbb_root_path . self::$phpbb_gallery_path . self::IMAGE_PATH . self::MEDIUM_PATH;
case 'import':
return self::$phpbb_root_path . self::$phpbb_gallery_path . self::IMAGE_PATH . self::IMPORT_PATH;
}
return false;
}
开发者ID:phpbbgallery,项目名称:phpbb-gallery,代码行数:34,代码来源:url.php
示例3: main
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template, $phpbb_container;
if (!$config['allow_password_reset']) {
trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'));
}
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
$sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
FROM ' . USERS_TABLE . "\n\t\t\t\tWHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'\n\t\t\t\t\tAND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$user_row) {
trigger_error('NO_EMAIL_USER');
}
if ($user_row['user_type'] == USER_IGNORE) {
trigger_error('NO_USER');
}
if ($user_row['user_type'] == USER_INACTIVE) {
if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL) {
trigger_error('ACCOUNT_DEACTIVATED');
} else {
trigger_error('ACCOUNT_NOT_ACTIVATED');
}
}
// Check users permissions
$auth2 = new \phpbb\auth\auth();
$auth2->acl($user_row);
if (!$auth2->acl_get('u_chgpasswd')) {
trigger_error('NO_AUTH_PASSWORD_REMINDER');
}
$server_url = generate_board_url();
// Make password at least 8 characters long, make it longer if admin wants to.
// gen_rand_string() however has a limit of 12 or 13.
$user_password = gen_rand_string_friendly(max(8, mt_rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
// For the activation key a random length between 6 and 10 will do.
$user_actkey = gen_rand_string(mt_rand(6, 10));
// Instantiate passwords manager
$passwords_manager = $phpbb_container->get('passwords.manager');
$sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_newpasswd = '" . $db->sql_escape($passwords_manager->hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'\n\t\t\t\tWHERE user_id = " . $user_row['user_id'];
$db->sql_query($sql);
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger(false);
$messenger->template('user_activate_passwd', $user_row['user_lang']);
$messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user_row['username']), 'PASSWORD' => htmlspecialchars_decode($user_password), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_row['user_id']}&k={$user_actkey}"));
$messenger->send($user_row['user_notify_type']);
meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
$message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
trigger_error($message);
}
$template->assign_vars(array('USERNAME' => $username, 'EMAIL' => $email, 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword')));
$this->tpl_name = 'ucp_remind';
$this->page_title = 'UCP_REMIND';
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:60,代码来源:ucp_remind.php
示例4: generate_forum_link
/**
* Generate the SEO link for a forum
*
* @param int $forum_id The ID of the forum
* @param string $forum_name The title of the forum
* @param int $start Optional start parameter
* @param bool $full Return the full URL
* @return string The SEO URL
* @access private
*/
public function generate_forum_link($forum_id, $forum_name, $start = 0, $full = false)
{
if ($full) {
return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
}
return $this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
}
开发者ID:tas2580,项目名称:seourls,代码行数:17,代码来源:base.php
示例5: get_bookmarks
public function get_bookmarks($ext_mode = '', $forums = array())
{
define('POSTS_BOOKMARKS_TABLE', $this->table_prefix . 'posts_bookmarks');
$start = $this->request->variable('start', 0);
$sql = 'SELECT COUNT(post_id) as posts_count
FROM ' . POSTS_BOOKMARKS_TABLE . '
WHERE user_id = ' . $this->user->data['user_id'];
$result = $this->db->sql_query($sql);
$posts_count = (int) $this->db->sql_fetchfield('posts_count');
$this->db->sql_freeresult($result);
$sql_where = $sql_fields = '';
if ($ext_mode != 'find') {
$sql_where = 'LEFT JOIN ' . USERS_TABLE . ' u ON (p.poster_id = u.user_id)';
$sql_fields = ', p.post_time, u.user_id, u.username, u.user_colour';
}
$pagination_url = append_sid("{$this->phpbb_root_path}postbookmark", "mode=find");
$this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $posts_count, $this->config['topics_per_page'], $start);
$sql = 'SELECT b.post_id AS b_post_id, b.user_id, b.bookmark_time, b.bookmark_desc, p.post_id, p.forum_id, p.topic_id, p.poster_id, p.post_subject, t.topic_title ' . $sql_fields . '
FROM ' . POSTS_BOOKMARKS_TABLE . ' b
LEFT JOIN ' . POSTS_TABLE . ' p ON( b.post_id = p.post_id)
LEFT JOIN ' . TOPICS_TABLE . ' t ON( t.topic_id = p.topic_id)
' . $sql_where . '
WHERE b.user_id = ' . $this->user->data['user_id'] . '
ORDER BY b.bookmark_time ASC';
$result = $this->db->sql_query_limit($sql, $this->config['topics_per_page'], $start);
while ($row = $this->db->sql_fetchrow($result)) {
$topic_author = $sql_where ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '';
$post_time = $sql_where ? $this->user->format_date($row['post_time']) : '';
// Send vars to template
$this->template->assign_block_vars('postrow', array('POST_ID' => $row['b_post_id'], 'POST_TIME' => $post_time, 'BOOKMARK_TIME' => $this->user->format_date($row['bookmark_time']), 'BOOKMARK_DESC' => $row['bookmark_desc'], 'TOPIC_AUTHOR' => $topic_author, 'POST_TITLE' => $row['post_subject'] ? $row['post_subject'] : $row['topic_title'], 'U_VIEW_POST' => append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "p=" . $row['post_id'] . "#p" . $row['post_id'] . ""), 'S_DELETED_TOPIC' => !$row['topic_id'] ? true : false, 'S_DELETED_POST' => !$row['post_id'] ? true : false, 'U_POST_BOOKMARK' => '[url=' . generate_board_url() . '/viewtopic.' . $this->php_ext . '?p=' . $row['post_id'] . '#p' . $row['post_id'] . ']' . ($row['post_subject'] ? $row['post_subject'] : $row['topic_title']) . '[/url]'));
}
$this->db->sql_freeresult($result);
$this->template->assign_vars(array('TOTAL_BOOKMARKS' => $this->user->lang('TOTAL_BOOKMARKS', (int) $posts_count), 'PAGE_NUMBER' => $this->pagination->on_page($posts_count, $this->config['topics_per_page'], $start)));
}
开发者ID:AlexSheer,项目名称:phpbb3.1-PostBookmark,代码行数:34,代码来源:helper.php
示例6: ucp_register_user_row_after
public function ucp_register_user_row_after($event)
{
if ($this->config['require_activation'] != USER_ACTIVATION_ADMIN) {
// Grab an array of user_id's with a_user permissions ... these users can activate a user
$admin_ary = $this->auth->acl_get_list(false, 'a_user', false);
$admin_ary = !empty($admin_ary[0]['a_user']) ? $admin_ary[0]['a_user'] : array();
// Also include founders
$where_sql = ' WHERE user_type = ' . USER_FOUNDER;
if (sizeof($admin_ary)) {
$where_sql .= ' OR ' . $this->db->sql_in_set('user_id', $admin_ary);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . ' ' . $where_sql;
$result = $this->db->sql_query($sql);
$data = array('username' => $this->request->variable('username', '', true), 'email' => strtolower($this->request->variable('email', '')), 'user_regdate' => time(), 'user_ip' => $this->user->ip, 'lang' => basename($this->request->variable('lang', $this->user->lang_name)));
while ($row = $this->db->sql_fetchrow($result)) {
if (!class_exists('messenger')) {
include $this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext;
}
$messenger = new \messenger(false);
$server_url = generate_board_url();
$messenger->template('@dmzx_notifyadmin/admin_notify_registered', $data['lang']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'USER_MAIL' => $data['email'], 'USER_REGDATE' => date($this->config['default_dateformat'], $data['user_regdate']), 'USER_IP' => $data['user_ip']));
$messenger->send(NOTIFY_EMAIL);
}
$this->db->sql_freeresult($result);
}
}
开发者ID:alhitary,项目名称:notifyadmin,代码行数:30,代码来源:listener.php
示例7: add_page_header_data
public function add_page_header_data($event)
{
$display = 'small';
$display2 = 'panel';
$fields = 'first_name,last_name,email';
$optional = 'bdate,country,photo,city';
$providers = 'vkontakte,odnoklassniki,facebook,mailru';
$hidden = 'other';
$redirect_uri = urlencode(generate_board_url() . '/ulogin/login?redirect=' . urlencode(generate_board_url(true) . '/' . $this->user->page['page']));
$callback = 'uloginCallback';
if (!$this->config['ulogin_id1']) {
$data_ulogin1 = "display={$display}&fields={$fields}&optional={$optional}&providers={$providers}&hidden={$hidden}&redirect_uri={$redirect_uri}&callback={$callback}";
$data_uloginid1 = '';
} else {
$data_ulogin1 = "redirect_uri={$redirect_uri}&callback={$callback}";
$data_uloginid1 = $this->config['ulogin_id1'];
}
if (!$this->config['ulogin_id2']) {
$data_ulogin2 = "display={$display2}&fields={$fields}&optional={$optional}&providers={$providers}&hidden={$hidden}&redirect_uri={$redirect_uri}&callback={$callback}";
$data_uloginid2 = '';
} else {
$data_ulogin2 = "redirect_uri={$redirect_uri}&callback={$callback}";
$data_uloginid2 = $this->config['ulogin_id2'];
}
$this->template->assign_vars(array('DATA_ULOGIN1' => $data_ulogin1, 'DATA_ULOGIN2' => $data_ulogin2, 'DATA_ULOGINID1' => $data_uloginid1, 'DATA_ULOGINID2' => $data_uloginid2));
$this->template->assign_vars(array('ULOGIN_MESSAGE' => $this->request->variable('msg', '', false, \phpbb\request\request_interface::REQUEST)));
}
开发者ID:mike-a-b,项目名称:crossfit,代码行数:27,代码来源:listener.php
示例8: get_board_url
/**
* Run links through append_sid(), prepend generate_board_url() and remove session id
*/
public function get_board_url()
{
static $board_url;
if (empty($board_url)) {
$board_url = generate_board_url();
}
return $board_url;
}
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:11,代码来源:helper.php
示例9: get_template_side
/**
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
//doing the easy way ;)
$u_link = generate_board_url();
// Assign specific vars
$this->template->assign_vars(array('LINK_US_TXT' => sprintf($this->user->lang['LINK_US_TXT'], $this->config['sitename']), 'U_LINK_US' => '<a href="' . $u_link . '" ' . ($this->config['site_desc'] ? 'title="' . $this->config['site_desc'] . '"' : '') . '>' . ($this->config['sitename'] ? $this->config['sitename'] : $u_link) . '</a>'));
return 'link_us_side.html';
}
开发者ID:alhitary,项目名称:Board3-Portal,代码行数:11,代码来源:link_us.php
示例10: createAkismet
public function createAkismet()
{
if (empty($this->akismet_api_key)) {
$this->log->add('critical', ANONYMOUS, $this->user->data['session_ip'], 'AKISMET_LOG_NO_KEY_CONFIGURED');
return false;
} else {
return new \TijsVerkoyen\Akismet\Akismet($this->akismet_api_key, generate_board_url());
}
}
开发者ID:alhitary,项目名称:phpbb-ext-akismet,代码行数:9,代码来源:akismet_factory.php
示例11: main
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template;
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
$submit = isset($_POST['submit']) ? true : false;
if ($submit) {
$sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
FROM ' . USERS_TABLE . "\n\t\t\t\tWHERE user_email = '" . $db->sql_escape($email) . "'\n\t\t\t\t\tAND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$user_row) {
trigger_error('NO_EMAIL_USER');
}
if ($user_row['user_type'] == USER_IGNORE) {
trigger_error('NO_USER');
}
if ($user_row['user_type'] == USER_INACTIVE) {
if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL) {
trigger_error('ACCOUNT_DEACTIVATED');
} else {
trigger_error('ACCOUNT_NOT_ACTIVATED');
}
}
// Check users permissions
$auth2 = new auth();
$auth2->acl($user_row);
if (!$auth2->acl_get('u_chgpasswd')) {
trigger_error('NO_AUTH_PASSWORD_REMINDER');
}
$server_url = generate_board_url();
$key_len = 54 - strlen($server_url);
$key_len = max(6, $key_len);
// we want at least 6
$key_len = $config['max_pass_chars'] ? min($key_len, $config['max_pass_chars']) : $key_len;
// we want at most $config['max_pass_chars']
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
$user_password = gen_rand_string(8);
$sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'\n\t\t\t\tWHERE user_id = " . $user_row['user_id'];
$db->sql_query($sql);
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger(false);
$messenger->template('user_activate_passwd', $user_row['user_lang']);
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->im($user_row['user_jabber'], $user_row['username']);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user_row['username']), 'PASSWORD' => htmlspecialchars_decode($user_password), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_row['user_id']}&k={$user_actkey}"));
$messenger->send($user_row['user_notify_type']);
meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
$message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
trigger_error($message);
}
$template->assign_vars(array('USERNAME' => $username, 'EMAIL' => $email, 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword')));
$this->tpl_name = 'ucp_remind';
$this->page_title = 'UCP_REMIND';
}
开发者ID:jvinhit,项目名称:php,代码行数:57,代码来源:ucp_remind.php
示例12: get_tapatlk_location
function get_tapatlk_location()
{
global $user, $phpbb_root_path;
$location = $user->extract_current_page($phpbb_root_path);
$param_arr = array();
switch ($location['page_name']) {
case "viewforum.php":
if (!empty($_GET['f'])) {
$param_arr['fid'] = $_GET['f'];
}
$param_arr['location'] = 'forum';
break;
case "index.php":
case '':
$param_arr['location'] = 'index';
break;
case "ucp.php":
if (!empty($_GET['i']) && $_GET['i'] == "pm") {
$param_arr['location'] = 'message';
if (!empty($_GET['p'])) {
$param_arr['mid'] = $_GET['p'];
}
}
if (!empty($_GET['mode']) && $_GET['mode'] == 'login') {
$param_arr['location'] = 'login';
}
break;
case "search.php":
$param_arr['location'] = "search";
break;
case "viewtopic.php":
if (!empty($_GET['t'])) {
//$param_arr['fid'] = $parameters['fid'];
$param_arr['location'] = 'topic';
$param_arr['tid'] = $_GET['t'];
}
break;
case "memberlist.php":
if (!empty($_GET['mode']) && $_GET['mode'] == "viewprofile" && !empty($_GET['u'])) {
$param_arr['location'] = 'profile';
$param_arr['uid'] = $_GET['u'];
}
break;
case "viewonline.php":
$param_arr['location'] = 'online';
break;
default:
$param_arr['location'] = 'index';
break;
}
$queryString = http_build_query($param_arr);
$url = generate_board_url() . '/?' . $queryString;
$url = preg_replace('/^(http|https)/isU', 'tapatalk', $url);
return $url;
}
开发者ID:danielgospodinow,项目名称:GamingZone,代码行数:55,代码来源:function_hook.php
示例13: redirect
public function redirect()
{
$url_root = generate_board_url();
$rewrite_prefix = !empty($this->config['enable_mod_rewrite']) ? '' : 'app.php/';
$redirects = array(array(append_sid($this->root_path . 'index.' . $this->php_ext), 'index.php'), array(append_sid($this->root_path . 'foo/bar/index.' . $this->php_ext), 'foo/bar/index.php'), array(append_sid($this->root_path . 'tests/index.' . $this->php_ext), 'tests/index.php'), array($this->helper->route('foo_index_controller'), $rewrite_prefix . 'index'), array($this->helper->route('foo_tests_index_controller'), $rewrite_prefix . 'tests/index'));
foreach ($redirects as $redirect) {
$this->template->assign_block_vars('redirects', array('URL' => redirect($redirect[0], true)));
$this->template->assign_block_vars('redirects_expected', array('URL' => $this->path_helper->clean_url($url_root . '/' . $redirect[1])));
}
return $this->helper->render('redirect_body.html');
}
开发者ID:MrAdder,项目名称:phpbb,代码行数:11,代码来源:controller.php
示例14: set_javascript_data
/**
* Set data used in javascript
*/
public function set_javascript_data($route, $style_id)
{
$board_url = generate_board_url();
$ajax_url = $board_url . (!$this->config['enable_mod_rewrite'] ? '/app.' . $this->php_ext : '');
$is_default_route = $u_default_route = false;
if ($this->config['sitemaker_default_layout']) {
$is_default_route = $this->config['sitemaker_default_layout'] === $route ? true : false;
$u_default_route .= $board_url . '/' . $this->config['sitemaker_default_layout'];
$u_default_route = reapply_sid($u_default_route);
}
$this->template->assign_vars(array('S_IS_DEFAULT' => $is_default_route, 'PAGE_URL' => build_url(array('style')), 'UA_ROUTE' => $route, 'UA_AJAX_URL' => $ajax_url, 'UA_BOARD_URL' => $board_url, 'UA_STYLE_ID' => $style_id, 'U_VIEW_DEFAULT' => $u_default_route));
}
开发者ID:BogusCurry,项目名称:phpBB-ext-sitemaker,代码行数:15,代码来源:admin_bar.php
示例15: submit_post_vk
public function submit_post_vk($event)
{
$mode = $event['mode'];
if ($mode == 'post' && !isset($_POST['vkrepost']) && !empty($this->config['vk_repost_group']) && !empty($this->config['vk_token'])) {
$data = $event['data'];
if (!$this->exclude_forum($data['forum_id'], $this->config['vk_repost_forum'])) {
include_once $this->phpbb_root_path . 'includes/bbcode.' . $this->php_ext;
$text = $data['message'];
strip_bbcode($text);
$this->vkRepost($text, generate_board_url() . '/viewtopic.' . $this->php_ext . '?t=' . $data['topic_id'], $event['subject']);
}
}
}
开发者ID:bb3mobi,项目名称:vkRepost,代码行数:13,代码来源:listener.php
示例16: main
function main($id, $mode)
{
global $cache, $config, $db, $phpbb_log, $request, $template, $user, $phpbb_root_path, $phpEx, $phpbb_container;
$this->cache = $cache;
$this->config = $config;
$this->config_text = $phpbb_container->get('config_text');
$this->db = $db;
$this->log = $phpbb_log;
$this->request = $request;
$this->template = $template;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
$this->phpbb_container = $phpbb_container;
// Add the board rules ACP lang file
$this->user->add_lang_ext('darkdiesel/pagescroller', 'pagescroller_acp');
$this->tpl_name = 'pagescroller';
$this->page_title = $user->lang('ACP_PAGESCROLLER_SETTINGS');
add_form_key('darkdiesel/pagescroller');
/** @var \darkdiesel\pagescroller\event\main_listener $listener */
$listener = $this->phpbb_container->get('darkdiesel.pagescroller.listener');
$scroller_styles = $listener->get_images('.svg', 'chevron-up-style');
if ($this->request->is_set_post('submit')) {
if (!check_form_key('darkdiesel/pagescroller')) {
$this->user->add_lang('acp/common');
trigger_error('FORM_INVALID');
}
$this->config->set('darkdiesel_pagescroller_horizontal_pos', $this->request->variable('darkdiesel_pagescroller_horizontal_pos', 'right'));
$this->config->set('darkdiesel_pagescroller_vertical_pos', $this->request->variable('darkdiesel_pagescroller_vertical_pos', 'bottom'));
$this->config->set('darkdiesel_pagescroller_style_type', $this->request->variable('darkdiesel_pagescroller_style_type', '1'));
$this->config->set('darkdiesel_pagescroller_style_hide_btns', $this->request->variable('darkdiesel_pagescroller_style_hide_btns', 'false'));
$this->config->set('darkdiesel_pagescroller_style_bgcolor', $this->request->variable('darkdiesel_pagescroller_style_bgcolor', '#0076b1'));
$this->config->set('darkdiesel_pagescroller_style_chevroncolor', $this->request->variable('darkdiesel_pagescroller_style_chevroncolor', '#FFFFFF'));
$this->config->set('darkdiesel_pagescroller_scroll_up_speed', $this->request->variable('darkdiesel_pagescroller_scroll_up_speed', '800'));
$this->config->set('darkdiesel_pagescroller_scroll_down_speed', $this->request->variable('darkdiesel_pagescroller_scroll_down_speed', '800'));
$this->config->set('darkdiesel_pagescroller_animation_hideshow_enable', $this->request->variable('darkdiesel_pagescroller_animation_hideshow_enable', 'false'));
$this->config->set('darkdiesel_pagescroller_animation_hideshow_duration_show', $this->request->variable('darkdiesel_pagescroller_animation_hideshow_duration_show', '200'));
$this->config->set('darkdiesel_pagescroller_animation_hideshow_duration_hide', $this->request->variable('darkdiesel_pagescroller_animation_hideshow_duration_hide', '500'));
$this->config->set('darkdiesel_pagescroller_animation_hideshow_visible_part', $this->request->variable('darkdiesel_pagescroller_animation_hideshow_visible_part', '20'));
$this->config->set('darkdiesel_pagescroller_animation_hideshow_distance_to_page', $this->request->variable('darkdiesel_pagescroller_animation_hideshow_distance_to_page', '0'));
trigger_error($user->lang('ACP_PAGESCROLLER_SETTING_SAVED') . adm_back_link($this->u_action));
}
$this->template->assign_vars(array('U_ACTION' => $this->u_action, 'DARKDIESEL_PAGESCROLLER_HORIZONTAL_POS' => $this->config['darkdiesel_pagescroller_horizontal_pos'], 'DARKDIESEL_PAGESCROLLER_VERTICAL_POS' => $this->config['darkdiesel_pagescroller_vertical_pos'], 'DARKDIESEL_PAGESCROLLER_STYLE_TYPE' => $this->config['darkdiesel_pagescroller_style_type'], 'DARKDIESEL_PAGESCROLLER_STYLE_HIDE_BTNS' => $this->config['darkdiesel_pagescroller_style_hide_btns'], 'DARKDIESEL_PAGESCROLLER_STYLE_BGCOLOR' => $this->config['darkdiesel_pagescroller_style_bgcolor'], 'DARKDIESEL_PAGESCROLLER_STYLE_CHEVRONCOLOR' => $this->config['darkdiesel_pagescroller_style_chevroncolor'], 'DARKDIESEL_PAGESCROLLER_SCROLL_UP_SPEED' => $this->config['darkdiesel_pagescroller_scroll_up_speed'], 'DARKDIESEL_PAGESCROLLER_SCROLL_DOWN_SPEED' => $this->config['darkdiesel_pagescroller_scroll_down_speed'], 'DARKDIESEL_PAGESCROLLER_ANIMATION_HIDESHOW_ENABLE' => $this->config['darkdiesel_pagescroller_animation_hideshow_enable'], 'DARKDIESEL_PAGESCROLLER_ANIMATION_HIDESHOW_DURATION_SHOW' => $this->config['darkdiesel_pagescroller_animation_hideshow_duration_show'], 'DARKDIESEL_PAGESCROLLER_ANIMATION_HIDESHOW_DURATION_HIDE' => $this->config['darkdiesel_pagescroller_animation_hideshow_duration_hide'], 'DARKDIESEL_PAGESCROLLER_ANIMATION_HIDESHOW_VISIBLE_PART' => $this->config['darkdiesel_pagescroller_animation_hideshow_visible_part'], 'DARKDIESEL_PAGESCROLLER_ANIMATION_HIDESHOW_DISTANCE_TO_PAGE' => $this->config['darkdiesel_pagescroller_animation_hideshow_distance_to_page'], 'S_DARKDIESEL_PAGESCROLLER' => true));
for ($i = 0; $i < count($scroller_styles); $i++) {
$img = 'pagescroller/styles/all/theme/assets/images/' . 'chevron-up-style' . ($i + 1) . '.svg';
$img_url = isset($scroller_styles['ext/' . $img]) ? '/ext/darkdiesel/' . $img : '';
$this->template->assign_block_vars('style_images', array('STYLE' => $i + 1, 'IMAGE' => generate_board_url() . $img_url));
}
}
开发者ID:darkdiesel,项目名称:phphBB-PageScroller,代码行数:49,代码来源:page_scroller_module.php
示例17: phpbb_com_titania_page_header
/**
* .com custom header and footer
*/
function phpbb_com_titania_page_header($hook, $page_title)
{
if (defined('TEST_INSTALLATION')) {
return;
}
phpbb::$template->assign_vars(array('S_BODY_CLASS' => 'customise customisation-database', 'S_IS_WEBSITE' => true));
global $auth, $phpEx, $template, $user;
$root_path = TITANIA_ROOT . '../../';
$base_path = generate_board_url(true) . '/';
include $root_path . 'vars.' . PHP_EXT;
// Setup the phpBB.com header
phpbb::$template->set_custom_template(TITANIA_ROOT . '../../template/', 'website');
phpbb::$template->set_filenames(array('phpbb_com_header' => 'overall_header.html'));
phpbb::$template->assign_display('phpbb_com_header', 'PHPBB_COM_HEADER', false);
titania::set_custom_template();
}
开发者ID:Gfksx,项目名称:customisation-db,代码行数:19,代码来源:_hook_phpbb.com.php
示例18: index
public function index()
{
header('Content-Type: application/xml');
$board_url = generate_board_url();
$sql = 'SELECT forum_id, forum_name, forum_last_post_time
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . (int) FORUM_POST . '
ORDER BY left_id ASC';
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) {
if ($this->auth->acl_get('f_list', $row['forum_id'])) {
$this->template->assign_block_vars('forumlist', array('URL' => $board_url . '/seositemap-' . $row['forum_id'] . '.xml', 'TIME' => gmdate('Y-m-d\\TH:i:s+00:00', (int) $row['forum_last_post_time'])));
}
}
return $this->helper->render('sitemap_index.html');
}
开发者ID:nivit,项目名称:seourls,代码行数:16,代码来源:sitemap.php
示例19: run
/**
* Runs this cron task.
*
* @return null
*/
public function run()
{
$time = $this->user->create_datetime();
$now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
// Display birthdays of 29th february on 28th february in non-leap-years
$leap_year_birthdays = '';
if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L')) {
$leap_year_birthdays = ' OR user_birthday LIKE "' . $this->db->sql_escape(sprintf("%2d-%2d-", 29, 2)) . '%"';
}
$sql = 'SELECT user_id, username, user_email, user_lang,
YEAR(CURRENT_TIMESTAMP) - YEAR(str_to_date(user_birthday, "%d-%m-%Y")) AS age
FROM ' . USERS_TABLE . '
WHERE user_birthday <> " 0- 0- 0" AND user_birthday <> "" AND
(user_birthday LIKE "' . $this->db->sql_escape(sprintf("%2d-%2d-", $now["mday"], $now["mon"])) . '%"' . $leap_year_birthdays . ') AND
email_on_birthday + 15778463 < UNIX_TIMESTAMP(now())';
$result = $this->db->sql_query($sql);
$msg_list = array();
while ($row = $this->db->sql_fetchrow($result)) {
$msg_list[] = array('user_id' => $row['user_id'], 'name' => $row['username'], 'email' => $row['user_email'], 'lang' => $row['user_lang'], 'age' => $this->convertNumber($row['age']) . $this->text_number($row['age']), 'time' => time());
}
if (sizeof($msg_list)) {
if ($this->config['email_enable']) {
if (!class_exists('messenger')) {
include $this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext;
}
$server_url = generate_board_url();
$messenger = new \messenger(false);
foreach ($msg_list as $key => $value) {
$messenger->template('@forumhulp_emailonbirthday/emailonbirthday', $value['lang']);
$messenger->to($value['email'], $value['name']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $this->config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $value['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $value['name']);
$messenger->headers('X-AntiAbuse: User IP - ' . '127.0.0.1');
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($value['name']), 'BIRTHDAY' => $value['age'], 'SITENAME' => $this->config['sitename']));
$messenger->send(NOTIFY_EMAIL);
$sql = 'UPDATE ' . USERS_TABLE . ' SET email_on_birthday = ' . time() . ' WHERE user_id = ' . $value['user_id'];
$this->db->sql_query($sql);
}
$userlist = array_map(function ($entry) {
return $entry['name'];
}, $msg_list);
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['session_ip'], 'BIRTHDAYSEND', false, array(implode(', ', $userlist)));
}
}
$this->config->set('email_on_birthday_last_gc', time());
}
开发者ID:Galixte,项目名称:emailonbirthday,代码行数:52,代码来源:birthday.php
示例20: idea
/**
* Controller for /idea/{idea_id}
*
* @param $idea_id int The ID of the requested idea, maybe?
* @throws http_exception
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
*/
public function idea($idea_id)
{
if (!$this->is_available()) {
throw new http_exception(404, 'IDEAS_NOT_AVAILABLE');
}
$this->data = $this->ideas->get_idea($idea_id);
if (!$this->data) {
throw new http_exception(404, 'IDEA_NOT_FOUND');
}
$mode = $this->request->variable('mode', '');
if ($this->request->is_ajax() && !empty($mode)) {
$result = call_user_func(array($th
|
请发表评论