diff --git a/classes/class_cache.php b/classes/class_cache.php
index 63e79e7b..cde26a0d 100644
--- a/classes/class_cache.php
+++ b/classes/class_cache.php
@@ -43,8 +43,7 @@ class CACHE extends Memcache {
public $CanClear = false;
function __construct() {
- $this->pconnect('192.168.5.6', 11211);
-// $this->pconnect(MEMCACHED_HOST, MEMCACHED_PORT);
+ $this->pconnect(MEMCACHED_HOST, MEMCACHED_PORT);
//$this->connect('localhost', 11211);
}
diff --git a/classes/class_invite_tree.php b/classes/class_invite_tree.php
index a6ac25e8..8708322f 100644
--- a/classes/class_invite_tree.php
+++ b/classes/class_invite_tree.php
@@ -41,12 +41,10 @@ function make_tree(){
if(!$TreeID){ return; }
$TreeQuery = $DB->query("
SELECT
- it.UserID,
- Username,
- Donor,
- Warned,
+ it.UserID,
Enabled,
PermissionID,
+ Donor,
Uploaded,
Downloaded,
Paranoia,
@@ -85,7 +83,7 @@ function make_tree(){
// We store this in an output buffer, so we can show the summary at the top without having to loop through twice
ob_start();
- while(list($ID, $Username, $Donor, $Warned, $Enabled, $Class, $Uploaded, $Downloaded, $Paranoia, $TreePosition, $TreeLevel) = $DB->next_record()){
+ while(list($ID, $Enabled, $Class, $Donor, $Uploaded, $Downloaded, $Paranoia, $TreePosition, $TreeLevel) = $DB->next_record()){
// Do stats
$Count++;
@@ -116,7 +114,7 @@ function make_tree(){
}
?>
- =format_username($ID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $Class)?>
+ =format_username($ID, true, true, $Enabled != 2 ? false : true, true)?>
if(check_paranoia(array('uploaded', 'downloaded'), $Paranoia, $UserClass)) {
$TotalUpload += $Uploaded;
diff --git a/classes/class_mysql.php b/classes/class_mysql.php
index 99ebd259..c44cbc48 100644
--- a/classes/class_mysql.php
+++ b/classes/class_mysql.php
@@ -329,6 +329,10 @@ function set_query_id(&$ResultSet){
$this->QueryID = $ResultSet;
$this->Row = 0;
}
+
+ function get_query_id() {
+ return $this->QueryID;
+ }
function beginning() {
mysqli_data_seek($this->QueryID, 0);
diff --git a/classes/class_user_rank.php b/classes/class_user_rank.php
index 30542e8a..0997744e 100644
--- a/classes/class_user_rank.php
+++ b/classes/class_user_rank.php
@@ -59,7 +59,6 @@ function table_query($TableName) {
}
function get_rank($TableName, $Value) {
- return false;
if($Value == 0) { return 0; }
global $Cache, $DB;
diff --git a/classes/script_start.php b/classes/script_start.php
index d1839039..d79d9f86 100644
--- a/classes/script_start.php
+++ b/classes/script_start.php
@@ -73,7 +73,7 @@
// Get permissions
list($Classes, $ClassLevels) = $Cache->get_value('classes');
if(!$Classes || !$ClassLevels) {
- $DB->query('SELECT ID, Name, Level FROM permissions ORDER BY Level');
+ $DB->query('SELECT ID, Name, Level, Secondary FROM permissions ORDER BY Level');
$Classes = $DB->to_array('ID');
$ClassLevels = $DB->to_array('Level');
$Cache->cache_value('classes', array($Classes, $ClassLevels), 0);
@@ -260,10 +260,11 @@
// Get cached user info, is used for the user loading the page and usernames all over the site
function user_info($UserID) {
- global $DB, $Cache;
+ global $DB, $Cache, $Classes;
$UserInfo = $Cache->get_value('user_info_'.$UserID);
// the !isset($UserInfo['Paranoia']) can be removed after a transition period
if(empty($UserInfo) || empty($UserInfo['ID']) || !isset($UserInfo['Paranoia'])) {
+ $OldQueryID = $DB->get_query_id();
$DB->query("SELECT
@@ -278,9 +279,11 @@ function user_info($UserID) {
m.Enabled,
m.Title,
i.CatchupTime,
- m.Visible
+ m.Visible,
+ GROUP_CONCAT(ul.PermissionID SEPARATOR ',') AS Levels
FROM users_main AS m
INNER JOIN users_info AS i ON i.UserID=m.ID
+ JOIN users_levels AS ul ON ul.UserID = m.ID
WHERE m.ID='$UserID'");
if($DB->record_count() == 0) { // Deleted user, maybe?
$UserInfo = array('ID'=>'','Username'=>'','PermissionID'=>0,'Artist'=>false,'Donor'=>false,'Warned'=>'0000-00-00 00:00:00','Avatar'=>'','Enabled'=>0,'Title'=>'', 'CatchupTime'=>0, 'Visible'=>'1');
@@ -293,7 +296,21 @@ function user_info($UserID) {
$UserInfo['Paranoia'] = array();
}
}
+
+ if (!empty($UserInfo['Levels'])) {
+ $UserInfo['ExtraClasses'] = array_fill_keys(explode(',', $UserInfo['Levels']), 1);
+ } else {
+ $UserInfo['ExtraClasses'] = array();
+ }
+ unset($UserInfo['Levels']);
+ $EffectiveClass = $Classes[$UserInfo['PermissionID']]['Level'];
+ foreach($UserInfo['ExtraClasses'] as $Class => $Val) {
+ $EffectiveClass = max($EffectiveClass, $Classes[$Class]['Level']);
+ }
+ $UserInfo['EffectiveClass'] = $EffectiveClass;
+
$Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000);
+ $DB->set_query_id($OldQueryID);
}
if(strtotime($UserInfo['Warned']) < time()) {
$UserInfo['Warned'] = '0000-00-00 00:00:00';
@@ -337,7 +354,8 @@ function user_heavy_info($UserID) {
i.LastReadNews,
i.RestrictedForums,
i.PermittedForums,
- m.FLTokens
+ m.FLTokens,
+ m.PermissionID
FROM users_main AS m
INNER JOIN users_info AS i ON i.UserID=m.ID
WHERE m.ID='$UserID'");
@@ -348,7 +366,7 @@ function user_heavy_info($UserID) {
} else {
$HeavyInfo['CustomPermissions'] = array();
}
-
+
if (!empty($HeavyInfo['RestrictedForums'])) {
$RestrictedForums = explode(',', $HeavyInfo['RestrictedForums']);
} else {
@@ -361,6 +379,19 @@ function user_heavy_info($UserID) {
$PermittedForums = array();
}
unset($HeavyInfo['PermittedForums']);
+
+ $DB->query("SELECT PermissionID FROM users_levels WHERE UserID = $UserID");
+ $PermIDs = $DB->collect('PermissionID');
+ foreach ($PermIDs AS $PermID) {
+ $Perms = get_permissions($PermID);
+ if(!empty($Perms['PermittedForums'])) {
+ $PermittedForums = array_merge($PermittedForums,explode(',',$Perms['PermittedForums']));
+ }
+ }
+ $Perms = get_permissions($HeavyInfo['PermissionID']);
+ unset($HeavyInfo['PermissionID']);
+ $PermittedForums = array_merge($PermittedForums,explode(',',$Perms['PermittedForums']));
+
if (!empty($PermittedForums) || !empty($RestrictedForums)) {
$HeavyInfo['CustomForums'] = array();
foreach ($RestrictedForums as $ForumID) {
@@ -422,7 +453,7 @@ function get_permissions($PermissionID) {
global $DB, $Cache;
$Permission = $Cache->get_value('perm_'.$PermissionID);
if(empty($Permission)) {
- $DB->query("SELECT p.Level AS Class, p.Values as Permissions FROM permissions AS p WHERE ID='$PermissionID'");
+ $DB->query("SELECT p.Level AS Class, p.Values as Permissions, p.Secondary, p.PermittedForums FROM permissions AS p WHERE ID='$PermissionID'");
$Permission = $DB->next_record(MYSQLI_ASSOC, array('Permissions'));
$Permission['Permissions'] = unserialize($Permission['Permissions']);
$Cache->cache_value('perm_'.$PermissionID, $Permission, 2592000);
@@ -448,17 +479,14 @@ function get_permissions_for_user($UserID, $CustomPermissions = false) {
$Permissions = get_permissions($UserInfo['PermissionID']);
- // Manage 'special' inherited permissions
- if($UserInfo['Artist']) {
- $ArtistPerms = get_permissions(ARTIST);
- } else {
- $ArtistPerms = array('Permissions' => array());
- }
-
- if($UserInfo['Donor']) {
- $DonorPerms = get_permissions(DONOR);
- } else {
- $DonorPerms = array('Permissions' => array());
+ // Manage 'special' inherited permissions
+ $BonusPerms = array();
+ $BonusCollages = 0;
+ foreach ($UserInfo['ExtraClasses'] as $PermID => $Value) {
+ $ClassPerms = get_permissions($PermID);
+ $BonusCollages += $ClassPerms['Permissions']['MaxCollages'];
+ unset($ClassPerms['Permissions']['MaxCollages']);
+ $BonusPerms = array_merge($BonusPerms, $ClassPerms['Permissions']);
}
if(!empty($CustomPermissions)) {
@@ -467,10 +495,20 @@ function get_permissions_for_user($UserID, $CustomPermissions = false) {
$CustomPerms = array();
}
- $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $DonorPerms['Permissions']['MaxCollages'] + $ArtistPerms['Permissions']['MaxCollages'] + $CustomPerms['MaxCollages'];
-
+ // This is legacy donor cruft
+ if($UserInfo['Donor']) {
+ $DonorPerms = get_permissions(DONOR);
+ } else {
+ $DonorPerms = array('Permissions' => array());
+ }
+
+ $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages + $CustomPerms['MaxCollages'] + $DonorPerms['Permissions']['MaxCollages'];
//Combine the permissions
- return array_merge($Permissions['Permissions'], $DonorPerms['Permissions'], $ArtistPerms['Permissions'], $CustomPerms, array('MaxCollages' => $MaxCollages));
+ return array_merge($Permissions['Permissions'], $BonusPerms, $CustomPerms, $DonorPerms['Permissions'], array('MaxCollages' => $MaxCollages));
+
+ //$MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages + $CustomPerms['MaxCollages'];
+ //Combine the permissions
+ //return array_merge($Permissions['Permissions'], $BonusPerms, $CustomPerms, array('MaxCollages' => $MaxCollages));
}
// This function is slow. Don't call it unless somebody's logging in.
@@ -1044,21 +1082,62 @@ function make_hash($Str,$Secret) {
$Class and $Title can be omitted for an abbreviated version
$IsDonor, $IsWarned and $IsEnabled can be omitted for a *very* abbreviated version
*/
-function format_username($UserID, $Username, $IsDonor = false, $IsWarned = '0000-00-00 00:00:00', $IsEnabled = true, $Class = false, $Title = false) {
+function format_username($UserID, $Badges = false, $IsWarned = true, $IsEnabled = true, $Class = false, $Title = false) {
+ global $Classes;
+
if($UserID == 0) {
return 'System';
- } elseif($Username == '') {
+ }
+
+ $UserInfo = user_info($UserID);
+ if($UserInfo['Username'] == '') {
return "Unknown [$UserID]";
}
- $str=''.$Username.'';
- $str.=($IsDonor) ? '
' : '';
+
+ $str = '';
+
+ if ($Title) {
+ $str .= '';
+ }
+
+ $str.=''.$UserInfo['Username'].'';
+ if ($Title) {
+ $str .= '';
+ }
+
+ if ($Badges) {
+ $str.=($UserInfo['Donor'] == 1) ? '
' : '';
+ }
+ $str.=($IsWarned && $UserInfo['Warned']!='0000-00-00 00:00:00') ? '
' : '';
+ $str.=($IsEnabled && $UserInfo['Enabled'] == 2) ? '
' : '';
+
+
+ }
- $str.=($IsWarned!='0000-00-00 00:00:00') ? '
' : '';
- $str.=(!$IsEnabled) ? '
' : '';
+ $str.=($IsWarned && $UserInfo['Warned']!='0000-00-00 00:00:00') ? '
' : '';
+ $str.=($IsEnabled && $UserInfo['Enabled'] == 2) ? '
' : '';
- $str.=($Class) ? ' ('.make_class_string($Class).')' : '';
- $str.=($Title) ? ' ('.$Title.')' : '';
+ if ($Title && $Class) {
+ $str .= '';
+ }
+ $str.=($Class) ? ' ('.make_class_string($UserInfo['PermissionID']).')' : '';
+ if ($Title && $Class) {
+ $str .= '';
+ }
+ if ($Title) {
+ // Image proxy CTs
+ if(check_perms('site_proxy_images') && !empty($UserTitle)) {
+ $UserTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) {
+ return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
+ }, $UserTitle);
+ }
+
+ $str.='';
+ if ($UserInfo['Title']) {
+ $str.= ' ('.$UserInfo['Title'].')';
+ }
+ }
return $str;
}
@@ -1579,7 +1658,8 @@ function create_thread($ForumID, $AuthorID, $Title, $PostBody) {
// Check to see if a user has the permission to perform an action
function check_perms($PermissionName,$MinClass = 0) {
global $LoggedUser;
- return (isset($LoggedUser['Permissions'][$PermissionName]) && $LoggedUser['Permissions'][$PermissionName] && $LoggedUser['Class']>=$MinClass)?true:false;
+ return (isset($LoggedUser['Permissions'][$PermissionName]) && $LoggedUser['Permissions'][$PermissionName]
+ && ($LoggedUser['Class']>=$MinClass || $LoggedUser['EffectiveClass']>=$MinClass))?true:false;
}
// TODO: make stricter, e.g. on all whitespace characters or Unicode normalisation
diff --git a/design/privateheader.php b/design/privateheader.php
index 9c048343..39790cbf 100644
--- a/design/privateheader.php
+++ b/design/privateheader.php
@@ -168,7 +168,7 @@
Requests
Forums
IRC
-
+ Top 10
Rules
Wiki
Staff
diff --git a/nohup.out b/nohup.out
deleted file mode 100644
index 5e21f121..00000000
--- a/nohup.out
+++ /dev/null
@@ -1,34 +0,0 @@
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=downslayer&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=MrBillhelm&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=Fowler&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=MrBillhelm&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=mistersofty&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=oinky&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=mistersofty&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=mistersofty&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=mistersofty&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=jofwolves&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=jofwolves&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=zdeevfm&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=ulchm&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=celexicdream&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=cfstras&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=cfstras&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
-PHP Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=jofwolves&limit=1&api_key=LASTFM_API_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
- in /var/www/vhosts/what/sections/irc/index.php on line 1044
diff --git a/sections/ajax/forum/forum.php b/sections/ajax/forum/forum.php
index 5e2c506b..1d9ae165 100644
--- a/sections/ajax/forum/forum.php
+++ b/sections/ajax/forum/forum.php
@@ -43,17 +43,13 @@
t.ID,
t.Title,
t.AuthorID,
- author.Username AS AuthorUsername,
t.IsLocked,
t.IsSticky,
t.NumPosts,
t.LastPostID,
t.LastPostTime,
t.LastPostAuthorID,
- last_author.Username AS LastPostUsername
FROM forums_topics AS t
- LEFT JOIN users_main AS last_author ON last_author.ID = t.LastPostAuthorID
- LEFT JOIN users_main AS author ON author.ID = t.AuthorID
WHERE t.ForumID = '$ForumID'
ORDER BY t.IsSticky DESC, t.LastPostTime DESC
LIMIT $Limit"); // Can be cached until someone makes a new post
@@ -114,7 +110,7 @@
$JsonTopics = array();
foreach ($Forum as $Topic) {
- list($TopicID, $Title, $AuthorID, $AuthorName, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID, $LastAuthorName) = array_values($Topic);
+ list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
// handle read/unread posts - the reason we can't cache the whole page
if((!$Locked || $Sticky) && ((empty($LastRead[$TopicID]) || $LastRead[$TopicID]['PostID']<$LastID) && strtotime($LastTime)>$LoggedUser['CatchupTime'])) {
@@ -122,6 +118,10 @@
} else {
$Read = 'read';
}
+ $UserInfo = user_info($AuthorID);
+ $AuthorName = $UserInfo['Username'];
+ $UserInfo = user_info($LastAuthorID);
+ $LastAuthorName = $UserInfo['Username'];
$JsonTopics[] = array(
'topicId' => (int) $TopicID,
diff --git a/sections/ajax/forum/index.php b/sections/ajax/forum/index.php
index d16b8649..16dca4de 100644
--- a/sections/ajax/forum/index.php
+++ b/sections/ajax/forum/index.php
@@ -34,7 +34,6 @@
f.NumPosts,
f.LastPostID,
f.LastPostAuthorID,
- um.Username,
f.LastPostTopicID,
f.LastPostTime,
COUNT(sr.ThreadID) AS SpecificRules,
@@ -44,7 +43,6 @@
FROM forums AS f
JOIN forums_categories AS fc ON fc.ID = f.CategoryID
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
- LEFT JOIN users_main AS um ON um.ID=f.LastPostAuthorID
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
GROUP BY f.ID
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
diff --git a/sections/ajax/forum/main.php b/sections/ajax/forum/main.php
index 820a8fd9..5e598450 100644
--- a/sections/ajax/forum/main.php
+++ b/sections/ajax/forum/main.php
@@ -39,7 +39,7 @@
$JsonCategory = array();
$JsonForums = array();
foreach ($Forums as $Forum) {
- list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastPostAuthorName, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
+ list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead>$LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== FALSE)) {
continue;
}
@@ -63,7 +63,8 @@
} else {
$Read = 'read';
}
-
+ $UserInfo = user_info($LastAuthorID);
+
$JsonForums[] = array(
'forumId' => (int) $ForumID,
'forumName' => $ForumName,
@@ -72,7 +73,7 @@
'numPosts' => (float) $NumPosts,
'lastPostId' => (float) $LastPostID,
'lastAuthorId' => (float) $LastAuthorID,
- 'lastPostAuthorName' => $LastPostAuthorName,
+ 'lastPostAuthorName' => $UserInfo['Username'],
'lastTopicId' => (float) $LastTopicID,
'lastTime' => $LastTime,
'specificRules' => $SpecificRules,
diff --git a/sections/ajax/forum/thread.php b/sections/ajax/forum/thread.php
index 98eaac6d..24c79ef9 100644
--- a/sections/ajax/forum/thread.php
+++ b/sections/ajax/forum/thread.php
@@ -86,9 +86,7 @@
p.Body,
p.EditedUserID,
p.EditedTime,
- ed.Username
FROM forums_posts as p
- LEFT JOIN users_main AS ed ON ed.ID = p.EditedUserID
WHERE p.TopicID = '$ThreadID' AND p.ID != '".$ThreadInfo['StickyPostID']."'
LIMIT $CatalogueLimit");
$Catalogue = $DB->to_array(false,MYSQLI_ASSOC);
@@ -217,15 +215,16 @@
$JsonPosts = array();
foreach ($Thread as $Key => $Post) {
- list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
+ list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(user_info($AuthorID));
+ $UserInfo = user_info($EditedUserID);
$JsonPosts[] = array(
'postId' => (int) $PostID,
'addedTime' => $AddedTime,
'body' => $Text->full_format($Body),
'editedUserId' => (int) $EditedUserID,
'editedTime' => $EditedTime,
- 'editedUsername' => $EditedUsername,
+ 'editedUsername' => $UserInfo['Username'],
'author' => array(
'authorId' => (int) $AuthorID,
'authorName' => $Username,
diff --git a/sections/ajax/inbox/viewconv.php b/sections/ajax/inbox/viewconv.php
index b49aec47..67862840 100644
--- a/sections/ajax/inbox/viewconv.php
+++ b/sections/ajax/inbox/viewconv.php
@@ -39,15 +39,14 @@
WHERE c.ID='$ConvID' AND UserID='$UserID'");
list($Subject, $Sticky, $UnRead, $ForwardedID, $ForwardedName) = $DB->next_record();
-$DB->query("SELECT UserID, Username, PermissionID, Enabled, Donor, Warned
+$DB->query("SELECT um.ID, Username
FROM pm_messages AS pm
- JOIN users_info AS ui ON ui.UserID=pm.SenderID
JOIN users_main AS um ON um.ID=pm.SenderID
WHERE pm.ConvID='$ConvID'");
-while(list($PMUserID, $Username, $PermissionID, $Enabled, $Donor, $Warned) = $DB->next_record()) {
+while(list($PMUserID, $Username) = $DB->next_record()) {
$PMUserID = (int)$PMUserID;
- $Users[$PMUserID]['UserStr'] = format_username($PMUserID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $PermissionID);
+ $Users[$PMUserID]['UserStr'] = format_username($PMUserID, true, true, true, true);
$Users[$PMUserID]['Username'] = $Username;
}
$Users[0]['UserStr'] = 'System'; // in case it's a message from the system
diff --git a/sections/ajax/top10/index.php b/sections/ajax/top10/index.php
index f627320c..49ade612 100644
--- a/sections/ajax/top10/index.php
+++ b/sections/ajax/top10/index.php
@@ -2,7 +2,7 @@
// Already done in /sections/ajax/index.php
//enforce_login();
-if(1 || !check_perms('site_top10')){
+if(!check_perms('site_top10')){
print json_encode(array('status' => 'failure'));
die();
}
diff --git a/sections/collages/all_comments.php b/sections/collages/all_comments.php
index 68c75d3f..7b8ad680 100644
--- a/sections/collages/all_comments.php
+++ b/sections/collages/all_comments.php
@@ -74,7 +74,7 @@
#=$PostID?>
- by =format_username($AuthorID, $Username, $Donor, $Warned, $Enabled, $PermissionID)?> if ($UserTitle) { echo '('.$UserTitle.')'; }?> =time_diff($AddedTime)?> [Report Comment]
+ by =format_username($AuthorID, true, true, true, true, true)?> =time_diff($AddedTime)?> [Report Comment]
if (!$ThreadInfo['IsLocked']){ ?> - [Quote] }
if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')){ ?> - [Edit] }
if (check_perms('site_moderate_forums')){ ?> - [Delete] } ?>
diff --git a/sections/collages/browse.php b/sections/collages/browse.php
index 48f95659..07731b51 100644
--- a/sections/collages/browse.php
+++ b/sections/collages/browse.php
@@ -74,11 +74,9 @@
c.NumTorrents,
c.TagList,
c.CategoryID,
- c.UserID,
- um.Username
+ c.UserID
FROM collages AS c
$BookmarkJoin
- LEFT JOIN users_main AS um ON um.ID=c.UserID
WHERE Deleted = '0'";
if ($BookmarkView) {
@@ -271,7 +269,7 @@
$Row = 'a'; // For the pretty colours
foreach ($Collages as $Collage) {
- list($ID, $Name, $NumTorrents, $TagList, $CategoryID, $UserID, $Username) = $Collage;
+ list($ID, $Name, $NumTorrents, $TagList, $CategoryID, $UserID) = $Collage;
$Row = ($Row == 'a') ? 'b' : 'a';
$TagList = explode(' ', $TagList);
$Tags = array();
@@ -298,7 +296,7 @@
|
=(int)$NumTorrents?> |
- =format_username($UserID, $Username)?> |
+ =format_username($UserID, false, false, false)?> |
} ?>
diff --git a/sections/collages/collage.php b/sections/collages/collage.php
index e4898e03..0e7a0141 100644
--- a/sections/collages/collage.php
+++ b/sections/collages/collage.php
@@ -515,7 +515,7 @@ function compare($X, $Y){
$i++;
if($i>5) { break; }
?>
- =format_username($ID, $User['name'])?> (=$User['count']?>)
+ =format_username($ID, false, false, false)?> (=$User['count']?>)
}
?>
@@ -569,7 +569,7 @@ function compare($X, $Y){
list($CommentID, $Body, $UserID, $Username, $CommentTime) = $Comment;
?>
-
By =format_username($UserID, $Username) ?> =time_diff($CommentTime) ?>
[Report Comment]
+
By =format_username($UserID, false, false, false) ?> =time_diff($CommentTime) ?>
[Report Comment]
=$Text->full_format($Body)?>
diff --git a/sections/collages/manage.php b/sections/collages/manage.php
index d4b6717c..493c2733 100644
--- a/sections/collages/manage.php
+++ b/sections/collages/manage.php
@@ -7,12 +7,10 @@
if($CategoryID == 0 && $UserID!=$LoggedUser['ID'] && !check_perms('site_collages_delete')) { error(403); }
$DB->query("SELECT ct.GroupID,
- um.ID,
- um.Username,
+ ct.UserID,
ct.Sort
FROM collages_torrents AS ct
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
- LEFT JOIN users_main AS um ON um.ID=ct.UserID
WHERE ct.CollageID='$CollageID'
ORDER BY ct.Sort");
@@ -43,7 +41,7 @@
$Number = 0;
foreach ($TorrentList as $GroupID=>$Group) {
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists) = array_values($Group);
- list($GroupID2, $UserID, $Username, $Sort) = array_values($CollageDataList[$GroupID]);
+ list($GroupID2, $UserID, $Sort) = array_values($CollageDataList[$GroupID]);
$Number++;
@@ -74,7 +72,7 @@
=$DisplayName?>
- =format_username($UserID, $Username)?>
+ =format_username($UserID, false, false, false)?>
|
diff --git a/sections/comments/index.php b/sections/comments/index.php
index b789323e..045f716e 100644
--- a/sections/comments/index.php
+++ b/sections/comments/index.php
@@ -51,40 +51,25 @@
else {
$Conditions = "WHERE tc.AuthorID = $UserID";
$Title = 'Comments made by '.($Self?'you':$Username);
- $Header = 'Torrent comments left by '.($Self?'you':format_username($UserID, $Username)).'';
+ $Header = 'Torrent comments left by '.($Self?'you':format_username($UserID, false, false, false)).'';
if($Self) $OtherLink = 'Display comments left on your uploads';
}
$Comments = $DB->query("SELECT
SQL_CALC_FOUND_ROWS
- m.ID,
- m.Username,
- m.PermissionID,
- m.Enabled,
-
- i.Avatar,
- i.Donor,
- i.Warned,
-
+ tc.AuthorID,
t.ID,
t.GroupID,
-
tg.Name,
-
tc.ID,
tc.Body,
tc.AddedTime,
tc.EditedTime,
-
- em.ID as EditorID,
- em.Username as EditorUsername
+ tc.EditedUserID as EditorID
FROM torrents as t
JOIN torrents_comments as tc ON tc.GroupID = t.GroupID
- JOIN users_main as m ON tc.AuthorID = m.ID
- JOIN users_info as i ON i.UserID = m.ID
JOIN torrents_group as tg ON t.GroupID = tg.ID
- LEFT JOIN users_main as em ON em.ID = tc.EditedUserID
$Conditions
@@ -119,13 +104,14 @@
next_record()) {
+while(list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
+ $UserInfo = user_info($UserID);
?>
' id="post=$PostID?>">
#=$PostID?>
- by =format_username($UserID, $Username, $Donor, $Warned, $Enabled, $Class)?> =time_diff($AddedTime) ?>
+ by =format_username($UserID, true, true, true, true, false)?> =time_diff($AddedTime) ?>
on =display_artists($Artists[$GroupID])?>=$Title?>
|
@@ -136,9 +122,9 @@
?>
- if($Avatar){
+ if($UserInfo['Avatar']){
?>
-
+ ' width='150' alt="=$UserInfo['Username']?>'s avatar" />
} else { ?>
@@ -156,7 +142,7 @@
?>
Last edited by
- =format_username($EditorID, $EditorUsername) ?> =time_diff($EditedTime)?>
+ =format_username($EditorID, false, false, false) ?> =time_diff($EditedTime)?>
}
?>
diff --git a/sections/forums/ajax_get_edit.php b/sections/forums/ajax_get_edit.php
index ad01f41b..4c9cde6e 100644
--- a/sections/forums/ajax_get_edit.php
+++ b/sections/forums/ajax_get_edit.php
@@ -25,18 +25,17 @@
$Edits = $Cache->get_value($Type.'_edits_'.$PostID);
if(!is_array($Edits)) {
- $DB->query("SELECT ce.EditUser, um.Username, ce.EditTime, ce.Body
+ $DB->query("SELECT ce.EditUser, ce.EditTime, ce.Body
FROM comments_edits AS ce
- JOIN users_main AS um ON um.ID=ce.EditUser
WHERE Page = '".$Type."' AND PostID = ".$PostID."
ORDER BY ce.EditTime DESC");
$Edits = $DB->to_array();
$Cache->cache_value($Type.'_edits_'.$PostID, $Edits, 0);
}
-list($UserID, $Username, $Time) = $Edits[$Depth];
+list($UserID, $Time) = $Edits[$Depth];
if($Depth != 0) {
- list(,,,$Body) = $Edits[$Depth - 1];
+ list(,,$Body) = $Edits[$Depth - 1];
} else {
//Not an edit, have to get from the original
switch($Type) {
@@ -66,7 +65,7 @@
if($Depth < count($Edits)) { ?>
«
=(($Depth == 0) ? 'Last edited by' : 'Edited by')?>
- =format_username($UserID, $Username) ?> =time_diff($Time,2,true,true)?>
+ =format_username($UserID, false, false, false) ?> =time_diff($Time,2,true,true)?>
} else { ?>
Original Post
}
diff --git a/sections/forums/delete.php b/sections/forums/delete.php
index 9dd09261..ed4cbe56 100644
--- a/sections/forums/delete.php
+++ b/sections/forums/delete.php
@@ -58,7 +58,6 @@
'NumPosts' => '-1',
'LastPostID' => $LastTopicPostID,
'LastPostAuthorID' => $LastTopicAuthorID,
- 'Username' => $LastTopicAuthorName,
'LastPostTime' => $LastTopicPostTime,
'LastPostTopicID' => $LastTopicID,
'Title' => $LastTopicTitle);
@@ -68,7 +67,6 @@
'NumPosts' => '-1',
'LastPostID' => $LastID,
'LastPostAuthorID' => $LastAuthorID,
- 'Username' => $LastAuthorName,
'LastPostTime' => $LastTime);
}
$UpdateArrayThread = array('Posts' => '-1', 'LastPostAuthorID' => $LastAuthorID);
diff --git a/sections/forums/forum.php b/sections/forums/forum.php
index d37cea46..3658affa 100644
--- a/sections/forums/forum.php
+++ b/sections/forums/forum.php
@@ -36,17 +36,13 @@
t.ID,
t.Title,
t.AuthorID,
- author.Username AS AuthorUsername,
t.IsLocked,
t.IsSticky,
t.NumPosts,
t.LastPostID,
t.LastPostTime,
- t.LastPostAuthorID,
- last_author.Username AS LastPostUsername
+ t.LastPostAuthorID
FROM forums_topics AS t
- LEFT JOIN users_main AS last_author ON last_author.ID = t.LastPostAuthorID
- LEFT JOIN users_main AS author ON author.ID = t.AuthorID
WHERE t.ForumID = '$ForumID'
ORDER BY t.IsSticky DESC, t.LastPostTime DESC
LIMIT $Limit"); // Can be cached until someone makes a new post
@@ -63,6 +59,7 @@
if (!check_perms('site_moderate_forums')) {
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] === 0) { error(403); }
}
+
if($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) { error(403); }
// Start printing
@@ -162,7 +159,7 @@
$Row='a';
foreach($Forum as $Topic){
- list($TopicID, $Title, $AuthorID, $AuthorName, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID, $LastAuthorName) = array_values($Topic);
+ list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
$Row = ($Row == 'a') ? 'b' : 'a';
// Build list of page links
@@ -216,11 +213,11 @@
} ?>
- by =format_username($LastAuthorID, $LastAuthorName)?> =time_diff($LastTime,1)?>
+ by =format_username($LastAuthorID, false, false, false)?> =time_diff($LastTime,1)?>
|
=number_format($PostCount-1)?> |
- =format_username($AuthorID, $AuthorName)?> |
+ =format_username($AuthorID, false, false, false)?> |
}
} ?>
diff --git a/sections/forums/index.php b/sections/forums/index.php
index 2930de19..2786f298 100644
--- a/sections/forums/index.php
+++ b/sections/forums/index.php
@@ -34,7 +34,6 @@
f.NumPosts,
f.LastPostID,
f.LastPostAuthorID,
- um.Username,
f.LastPostTopicID,
f.LastPostTime,
COUNT(sr.ThreadID) AS SpecificRules,
@@ -44,7 +43,6 @@
FROM forums AS f
JOIN forums_categories AS fc ON fc.ID = f.CategoryID
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
- LEFT JOIN users_main AS um ON um.ID=f.LastPostAuthorID
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
GROUP BY f.ID
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
diff --git a/sections/forums/main.php b/sections/forums/main.php
index 20d3bf2c..94a18967 100644
--- a/sections/forums/main.php
+++ b/sections/forums/main.php
@@ -41,7 +41,7 @@
$RestrictedForums = explode(',', $RestrictedForums);
$PermittedForums = array_keys($LoggedUser['PermittedForums']);
foreach ($Forums as $Forum) {
- list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastPostAuthorName, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
+ list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead>$LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== FALSE)) {
continue;
}
@@ -98,7 +98,7 @@
} ?>
- by =format_username($LastAuthorID, $LastPostAuthorName)?> =time_diff($LastTime,1)?>
+ by =format_username($LastAuthorID, false, false, false)?> =time_diff($LastTime,1)?>
=number_format($NumTopics)?> |
=number_format($NumPosts)?> |
diff --git a/sections/forums/mod_thread.php b/sections/forums/mod_thread.php
index ab205521..dc5b9113 100644
--- a/sections/forums/mod_thread.php
+++ b/sections/forums/mod_thread.php
@@ -91,7 +91,6 @@
'NumTopics'=>'-1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
- 'Username'=>$NewLastAuthorName,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle,
@@ -176,7 +175,6 @@
'NumTopics'=>'-1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
- 'Username'=>$NewLastAuthorName,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle,
@@ -219,7 +217,6 @@
'NumTopics'=>'+1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
- 'Username'=>$NewLastAuthorName,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle
diff --git a/sections/forums/newthread.php b/sections/forums/newthread.php
index d3c3c24b..911b1d4d 100644
--- a/sections/forums/newthread.php
+++ b/sections/forums/newthread.php
@@ -46,7 +46,7 @@
#XXXXXX
- by =format_username($LoggedUser['ID'], $LoggedUser['Username'], $LoggedUser['Donor'], $LoggedUser['Warned'], $LoggedUser['Enabled'] == 2 ? false : true, $LoggedUser['PermissionID'])?> if (!empty($LoggedUser['Title'])) { echo '('.$LoggedUser['Title'].')'; }?>
+ by =format_username($LoggedUser['ID'], true, true, true, true, true)?> if (!empty($LoggedUser['Title'])) { echo '('.$LoggedUser['Title'].')'; }?>
Just now
diff --git a/sections/forums/take_new_thread.php b/sections/forums/take_new_thread.php
index d74de848..358219bf 100644
--- a/sections/forums/take_new_thread.php
+++ b/sections/forums/take_new_thread.php
@@ -136,7 +136,6 @@
'ID' => $TopicID,
'Title' => $Title,
'AuthorID' => $LoggedUser['ID'],
- 'AuthorUsername' => $LoggedUser['Username'],
'IsLocked' => 0,
'IsSticky' => 0,
'NumPosts' => 1,
@@ -157,7 +156,6 @@
'NumTopics'=>'+1',
'LastPostID'=>$PostID,
'LastPostAuthorID'=>$LoggedUser['ID'],
- 'Username'=>$LoggedUser['Username'],
'LastPostTopicID'=>$TopicID,
'LastPostTime'=>sqltime(),
'Title'=>$Title,
@@ -178,7 +176,6 @@
'Body'=>$Body,
'EditedUserID'=>0,
'EditedTime'=>'0000-00-00 00:00:00',
- 'Username'=>''
);
$Cache->insert('', $Post);
$Cache->commit_transaction(0);
diff --git a/sections/forums/take_reply.php b/sections/forums/take_reply.php
index 25361f8f..c65d9adc 100644
--- a/sections/forums/take_reply.php
+++ b/sections/forums/take_reply.php
@@ -124,7 +124,6 @@
$Thread['LastPostID'] = $PostID; //Set postid for read/unread
$Thread['LastPostTime'] = sqltime(); //Time of last post
$Thread['LastPostAuthorID'] = $LoggedUser['ID']; //Last poster id
- $Thread['LastPostUsername'] = $LoggedUser['Username']; //Last poster username
$Part2 = array($TopicID=>$Thread); //Bumped thread
//if we're bumping from an older page
@@ -136,20 +135,18 @@
//Never know if we get a page full of stickies...
if ($Stickies < TOPICS_PER_PAGE || $ThreadInfo['IsSticky'] == 1) {
//Pull the data for the thread we're bumping
- $DB->query("SELECT f.AuthorID, f.IsLocked, f.IsSticky, f.NumPosts, u.Username, ISNULL(p.TopicID) AS NoPoll FROM forums_topics AS f INNER JOIN users_main AS u ON u.ID=f.AuthorID LEFT JOIN forums_polls AS p ON p.TopicID=f.ID WHERE f.ID ='$TopicID'");
- list($AuthorID,$IsLocked,$IsSticky,$NumPosts,$AuthorName,$NoPoll) = $DB->next_record();
+ $DB->query("SELECT f.AuthorID, f.IsLocked, f.IsSticky, f.NumPosts, ISNULL(p.TopicID) AS NoPoll FROM forums_topics AS f LEFT JOIN forums_polls AS p ON p.TopicID=f.ID WHERE f.ID ='$TopicID'");
+ list($AuthorID,$IsLocked,$IsSticky,$NumPosts,$NoPoll) = $DB->next_record();
$Part2 = array($TopicID => array(
'ID' => $TopicID,
'Title' => $ThreadInfo['Title'],
'AuthorID' => $AuthorID,
- 'AuthorUsername' => $AuthorName,
'IsLocked' => $IsLocked,
'IsSticky' => $IsSticky,
'NumPosts' => $NumPosts,
'LastPostID' => $PostID,
'LastPostTime' => sqltime(),
'LastPostAuthorID' => $LoggedUser['ID'],
- 'LastPostUsername' => $LoggedUser['Username'],
'NoPoll' => $NoPoll
)); //Bumped
} else {
@@ -178,7 +175,6 @@
'NumPosts'=>'+1',
'LastPostID'=>$PostID,
'LastPostAuthorID'=>$LoggedUser['ID'],
- 'Username'=>$LoggedUser['Username'],
'LastPostTopicID'=>$TopicID,
'LastPostTime'=>sqltime(),
'Title'=>$ThreadInfo['Title'],
diff --git a/sections/forums/thread.php b/sections/forums/thread.php
index cd41aef2..81ca57d2 100644
--- a/sections/forums/thread.php
+++ b/sections/forums/thread.php
@@ -366,20 +366,12 @@
foreach($Thread as $Key => $Post){
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(user_info($AuthorID));
-
- // Image proxy CTs
- if(check_perms('site_proxy_images') && !empty($UserTitle)) {
- $UserTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) {
- return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
- }, $UserTitle);
- }
?>
#=$PostID?>
- =format_username($AuthorID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $PermissionID)?>
- =!empty($UserTitle) ? '('.$UserTitle.')' : '' ?>
+ =format_username($AuthorID, true, true, true, true, true)?>
=time_diff($AddedTime,2)?>
if(!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')){ ?>
- [Quote]
@@ -429,7 +421,7 @@
«
} ?>
Last edited by
- =format_username($EditedUserID, $EditedUsername) ?> =time_diff($EditedTime,2,true,true)?>
+ =format_username($EditedUserID, false, false, false) ?> =time_diff($EditedTime,2,true,true)?>
} ?>
|
@@ -456,8 +448,7 @@
#XXXXXX
- by =format_username($LoggedUser['ID'], $LoggedUser['Username'], $LoggedUser['Donor'], $LoggedUser['Warned'], $LoggedUser['Enabled'] == 2 ? false : true, $LoggedUser['PermissionID'])?> if (!empty($LoggedUser['Title'])) { echo '('.$LoggedUser['Title'].')'; }?>
- Just now
+ by =format_username($LoggedUser['ID'], true, true, true, true, true)?> Just now
[Report Post]
diff --git a/sections/friends/friends.php b/sections/friends/friends.php
index 27b55430..047ff3b6 100644
--- a/sections/friends/friends.php
+++ b/sections/friends/friends.php
@@ -29,11 +29,7 @@
m.Uploaded,
m.Downloaded,
m.PermissionID,
- m.Enabled,
m.Paranoia,
- i.Donor,
- i.Warned,
- m.Title,
m.LastAccess,
i.Avatar
FROM friends AS f
@@ -65,14 +61,14 @@
}
// Start printing out friends
foreach($Friends as $Friend) {
- list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Enabled, $Paranoia, $Donor, $Warned, $Title, $LastAccess, $Avatar) = $Friend;
+ list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Paranoia, $LastAccess, $Avatar) = $Friend;
?>
| | |