Add add and fix lots of minor staff: topic watching, a:target thingie, etc

This commit is contained in:
Aleksei Miheev
2012-12-18 01:27:36 +04:00
parent eb5c3e7480
commit 52fc76145e
7 changed files with 65 additions and 21 deletions

View File

@@ -645,6 +645,25 @@ function Display()
// Set the callback. (do you REALIZE how much memory all the messages would take?!?)
$context['get_message'] = 'prepareDisplayContext';
// Check if the topic is been watched by user
if ($user_info['is_guest']) {
$context['is_watched'] == false;
} else {
$result = db_query("
SELECT watch FROM {$db_prefix}watch_topics
WHERE
ID_MEMBER='{$ID_MEMBER}' AND
ID_TOPIC='{$topic}'",
__FILE__, __LINE__);
if(mysql_num_rows($result) == 0) {
$context['is_watched'] = false;
} else {
list($w) = mysql_fetch_row($result);
$context['is_watched'] = (bool) $w;
}
}
// Basic settings.... may be converted over at some point.
$context['allow_hide_email'] = !empty($modSettings['allow_hideEmail']) || ($user_info['is_guest'] && !empty($modSettings['guest_hideContacts']));