aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-05-31 18:00:10 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-05-31 18:00:10 +0000
commit2c470e4b27f4e5df4c996d6755ebbb1f7306d86a (patch)
tree3a8748f72fcba6da3ba2bc9e0fbc047c71deadd7 /phpBB/includes
parent6aa42b69abe798388aad4f7e6bf943dfb608e896 (diff)
downloadforums-2c470e4b27f4e5df4c996d6755ebbb1f7306d86a.tar
forums-2c470e4b27f4e5df4c996d6755ebbb1f7306d86a.tar.gz
forums-2c470e4b27f4e5df4c996d6755ebbb1f7306d86a.tar.bz2
forums-2c470e4b27f4e5df4c996d6755ebbb1f7306d86a.tar.xz
forums-2c470e4b27f4e5df4c996d6755ebbb1f7306d86a.zip
- added delete cookies link
- fixed global announcement links in viewforum - do not display redirects in link forums as posts in forum overview git-svn-id: file:///svn/phpbb/trunk@4904 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php5
-rw-r--r--phpBB/includes/functions_display.php7
-rw-r--r--phpBB/includes/functions_messenger.php9
-rw-r--r--phpBB/includes/session.php8
-rw-r--r--phpBB/includes/ucp/ucp_profile.php4
-rw-r--r--phpBB/includes/ucp/ucp_register.php2
6 files changed, 26 insertions, 9 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 9b399312c7..19d72bf919 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -660,7 +660,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false)
$tracking[$f_id][0] = base_convert($current_time - $config['board_startdate'], 10, 36);
}
- setcookie($config['cookie_name'] . '_track', serialize($tracking), time() + 31536000, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
+ $user->set_cookie('track', serialize($tracking), time() + 31536000);
unset($tracking);
}
break;
@@ -720,7 +720,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false)
{
$tracking[$forum_id][base_convert($topic_id, 10, 36)] = base_convert($current_time - $config['board_startdate'], 10, 36);
- setcookie($config['cookie_name'] . '_track', serialize($tracking), time() + 31536000, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
+ $user->set_cookie('track', serialize($tracking), time() + 31536000);
}
unset($tracking);
}
@@ -1645,6 +1645,7 @@ function page_header($page_title = '')
'U_SEARCH_SELF' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=egosearch",
'U_SEARCH_NEW' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=newposts",
'U_SEARCH_UNANSWERED' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=unanswered",
+ 'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=delete_cookies",
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 1932e2d2df..6140bd500a 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -129,7 +129,12 @@ function display_forums($root_data = '', $display_moderators = TRUE)
// Include subforum topic/post counts in parent counts
$forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
- $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts'];
+
+ // Do not list redirects in LINK Forums as Posts.
+ if ($row['forum_type'] != FORUM_LINK)
+ {
+ $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts'];
+ }
if (isset($forum_rows[$parent_id]) && $row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time'])
{
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index cf500b4f51..71c775864f 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -428,6 +428,13 @@ class queue
set_config('last_queue_run', time());
+ // Delete stale lock file
+ if (file_exists($this->cache_file . '.lock') && !file_exists($this->cache_file))
+ {
+ @unlink($this->cache_file . '.lock');
+ return;
+ }
+
if (!file_exists($this->cache_file) || (file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval']))
{
return;
@@ -1158,7 +1165,7 @@ function mail_encode($str, $encoding)
// define start delimimter, end delimiter and spacer
$end = "?=";
- $start = "=?$this->encoding?B?";
+ $start = "=?$encoding?B?";
$spacer = "$end\r\n $start";
// determine length of encoded text within chunks and ensure length is even
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index aa7e02fc4f..4708cd0e1a 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -31,7 +31,8 @@ class session
$this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI'];
// Generate Valid URL
- $this->cur_page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1.' . $phpEx . '?\2', htmlspecialchars($this->page));
+ // TODO: need another one with sid for normal redirects
+ $this->cur_page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1.' . $phpEx . '?\2', str_replace('&amp;', '&', htmlspecialchars($this->page)));
$this->page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1\2', $this->page);
$this->page .= (isset($_POST['f'])) ? 'f=' . intval($_POST['f']) : '';
@@ -740,11 +741,14 @@ class user extends session
return;
}
- $sql = 'SELECT * FROM ' . CUSTOM_PROFILE_DATA . "
+ // TODO: think about adding this to the session code too?
+ // Grabbing all user specific options (all without the need of special complicate adding to the sql query) might be useful...
+ $sql = 'SELECT * FROM ' . PROFILE_DATA_TABLE . "
WHERE user_id = $user_id";
$result = $db->sql_query_limit($sql, 1);
$user->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
+ $db->sql_freeresult($result);
}
function img($img, $alt = '', $width = false, $suffix = '')
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 0ac721b1be..afa9acf81c 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -277,7 +277,7 @@ class ucp_profile extends module
// Update Custom Fields
if (sizeof($cp_data))
{
- $sql = 'UPDATE ' . CUSTOM_PROFILE_DATA . '
+ $sql = 'UPDATE ' . PROFILE_DATA_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
@@ -288,7 +288,7 @@ class ucp_profile extends module
$db->return_on_error = true;
- $sql = 'INSERT INTO ' . CUSTOM_PROFILE_DATA . ' ' . $db->sql_build_array('INSERT', $cp_data);
+ $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
$db->sql_query($sql);
$db->return_on_error = false;
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 70be8ffb8a..7b3f4477c5 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -200,7 +200,7 @@ class ucp_register extends module
if (sizeof($cp_data))
{
$cp_data['user_id'] = (int) $user_id;
- $sql = 'INSERT INTO ' . CUSTOM_PROFILE_DATA . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
+ $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
$db->sql_query($sql);
}