mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
10 changes from Fri Sep 9 18:31:41 2011 +0200 to Fri Sep 9 22:33:05 2011 +0200
Make sure Trim trailing spaces Fixes http://what.cd/forums.php?action=viewthread&threadid=101865&postid=3478072#post3478072 Trimmed trailing whitespace Treats IP search as if they begin with a | Sorts the Assign To box in staff pms alphabetically. Enable any/all option for tags in request filter Minor tweaks Show all used filters in the sphinx debug table Better detection of jpeg in image.php
This commit is contained in:
parent
f935268904
commit
fb83d88439
@ -51,11 +51,12 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
$QueryEndTime=microtime(true);
|
||||
|
||||
$Filters = array();
|
||||
foreach($this->Filters as $Name => $Value) {
|
||||
list($Value) = $Value;
|
||||
$Filters[] = $Name." - ".$Value;
|
||||
foreach($this->Filters as $Name => $Values) {
|
||||
foreach($Values as $Value) {
|
||||
$Filters[] = $Name." - ".$Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->Queries[]=array('Params: '.$Query.' Filters: '.implode(", ", $Filters).' Indicies: '.$this->Index,($QueryEndTime-$QueryStartTime)*1000);
|
||||
$this->Time+=($QueryEndTime-$QueryStartTime)*1000;
|
||||
|
||||
@ -147,9 +148,11 @@ function set_index($Index) {
|
||||
$this->Index = $Index;
|
||||
}
|
||||
|
||||
function set_filter($Name, $Val, $Exclude=false) {
|
||||
$this->Filters[$Name] = $Val;
|
||||
$this->SetFilter($Name, $Val, $Exclude);
|
||||
function set_filter($Name, $Vals, $Exclude=false) {
|
||||
foreach($Vals as $Val) {
|
||||
$this->Filters[$Name][] = $Val;
|
||||
}
|
||||
$this->SetFilter($Name, $Vals, $Exclude);
|
||||
}
|
||||
|
||||
function set_filter_range($Name, $Min, $Max, $Exclude) {
|
||||
|
17
image.php
17
image.php
@ -67,6 +67,23 @@ function verysmall($Image) {
|
||||
return ((imagesx($Image) * imagesy($Image)) < 25) ? true : false;
|
||||
}
|
||||
|
||||
function image_type($Data) {
|
||||
if(!strncmp($Data,'GIF',3)) {
|
||||
return 'gif';
|
||||
}
|
||||
if(!strncmp($Data,pack('H*','89504E47'),4)) {
|
||||
return 'png';
|
||||
}
|
||||
if(!strncmp($Data,pack('H*','FFD8'),2)) {
|
||||
return 'jpeg';
|
||||
}
|
||||
if(!strncmp($Data,'BM',2)) {
|
||||
return 'bmp';
|
||||
}
|
||||
if(!strncmp($Data,'II',2) || !strncmp($Data,'MM',2)) {
|
||||
return 'tiff';
|
||||
}
|
||||
}
|
||||
|
||||
function image_height($Type, $Data) {
|
||||
$Length = strlen($Data);
|
||||
|
@ -3,70 +3,46 @@
|
||||
// The image proxy does not use script_start.php, its code instead resides entirely in image.php in the document root
|
||||
// Bear this in mind when you try to use script_start functions.
|
||||
|
||||
if (!check_perms('site_proxy_images')) { error('forbidden'); }
|
||||
if(!check_perms('site_proxy_images')) { error('forbidden'); }
|
||||
$URL = isset($_GET['i']) ? htmlspecialchars_decode($_GET['i']) : null;
|
||||
|
||||
if (!extension_loaded('openssl') && strtoupper($URL[4]) == 'S') { error('badprotocol'); }
|
||||
if(!extension_loaded('openssl') && strtoupper($URL[4]) == 'S') { error('badprotocol'); }
|
||||
|
||||
if(!preg_match('/^'.IMAGE_REGEX.'/is',$URL,$Matches)) {
|
||||
error('invalid');
|
||||
}
|
||||
|
||||
if (isset($_GET['c'])) {
|
||||
if(isset($_GET['c'])) {
|
||||
list($Data,$Type) = $Cache->get_value('image_cache_'.md5($URL));
|
||||
$Cached = true;
|
||||
}
|
||||
if(!isset($Data) || !$Data) {
|
||||
$Cached = false;
|
||||
$Data = @file_get_contents($URL,0,stream_context_create(array('http'=>array('timeout'=>15))));
|
||||
if (!$Data || empty($Data)) {
|
||||
if(!$Data || empty($Data)) {
|
||||
error('timeout');
|
||||
}
|
||||
|
||||
$Supported = false;
|
||||
if (substr($Data,6,4) == 'JFIF') { // Todo: Support exif
|
||||
if(function_exists('imagecreatefromjpeg')) { $Supported = true; }
|
||||
$Type = 'jpeg';
|
||||
} elseif (substr($Data,0,3) == 'GIF') {
|
||||
if(function_exists('imagecreatefromgif')) { $Supported = true; }
|
||||
$Type = 'gif';
|
||||
} elseif (substr($Data,1,3) == 'PNG') {
|
||||
if(function_exists('imagecreatefrompng')) { $Supported = true; }
|
||||
$Type = 'png';
|
||||
} elseif ((substr($Data,0,2) == 'II' || substr($Data,0,2) == 'MM')) {
|
||||
$Type = 'tiff';
|
||||
} elseif (substr($Data,0,2) == 'BM') {
|
||||
$Type = 'bmp';
|
||||
}
|
||||
|
||||
|
||||
if ($Supported) {
|
||||
$Type = image_type($Data);
|
||||
if($Type && function_exists('imagecreatefrom'.$Type)) {
|
||||
$Image = imagecreatefromstring($Data);
|
||||
if (invisible($Image)) {
|
||||
if(invisible($Image)) {
|
||||
error('invisible');
|
||||
}
|
||||
if (verysmall($Image)) {
|
||||
if(verysmall($Image)) {
|
||||
error('small');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_GET['c']) && strlen($Data) < 262144) {
|
||||
|
||||
if(isset($_GET['c']) && strlen($Data) < 262144) {
|
||||
$Cache->cache_value('image_cache_'.md5($URL), array($Data,$Type), 3600*24*7);
|
||||
} else {
|
||||
//require_once(SERVER_ROOT.'/classes/class_mysql.php');
|
||||
//$DB = new
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Enforce avatar rules
|
||||
if (isset($_GET['avatar'])) {
|
||||
if(isset($_GET['avatar'])) {
|
||||
if(!is_number($_GET['avatar'])) { die(); }
|
||||
$UserID = $_GET['avatar'];
|
||||
|
||||
|
||||
$Height = image_height($Type, $Data);
|
||||
if(strlen($Data)>256*1024 || $Height>400) {
|
||||
// Sometimes the cached image we have isn't the actual image
|
||||
@ -76,33 +52,27 @@
|
||||
$Data2 = $Data;
|
||||
}
|
||||
if(strlen($Data2)>256*1024 || image_height($Type, $Data2)>400) {
|
||||
|
||||
require_once(SERVER_ROOT.'/classes/class_mysql.php');
|
||||
require_once(SERVER_ROOT.'/classes/class_time.php'); //Require the time class
|
||||
|
||||
|
||||
$DB = new DB_MYSQL;
|
||||
|
||||
|
||||
$DBURL = db_string($URL);
|
||||
|
||||
|
||||
// Reset avatar, add mod note
|
||||
$UserInfo = $Cache->get_value('user_info_'.$UserID);
|
||||
$UserInfo['Avatar'] = '';
|
||||
$Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000);
|
||||
|
||||
$DB->query("UPDATE users_info SET Avatar='', AdminComment=CONCAT('".sqltime()." - Avatar reset automatically (Size: ".number_format((strlen($Data))/1024)."kb, Height: ".$Height."px). Used to be $DBURL
|
||||
|
||||
', AdminComment) WHERE UserID='$UserID'");
|
||||
|
||||
|
||||
$DB->query("UPDATE users_info SET Avatar='', AdminComment=CONCAT('".sqltime()." - Avatar reset automatically (Size: ".number_format((strlen($Data))/1024)."kb, Height: ".$Height."px). Used to be $DBURL\n\n', AdminComment) WHERE UserID='$UserID'");
|
||||
|
||||
// Send PM
|
||||
|
||||
send_pm($UserID,0,"Your avatar has been automatically reset","The following avatar rules have been in effect for months now:
|
||||
|
||||
send_pm($UserID,0,"Your avatar has been automatically reset","The following avatar rules have been in effect for months now:
|
||||
|
||||
[b]Avatars must not exceed 256kB or be vertically longer than 400px. [/b]
|
||||
|
||||
Your avatar at $DBURL has been found to exceed these rules. As such, it has been automatically reset. You are welcome to reinstate your avatar once it has been resized down to an acceptable size.");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -114,7 +84,7 @@
|
||||
error('timeout');
|
||||
}
|
||||
*/
|
||||
if (isset($Type)) {
|
||||
if(isset($Type)) {
|
||||
header('Content-type: image/'.$Type);
|
||||
}
|
||||
echo $Data;
|
||||
|
@ -87,24 +87,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
$TagMatcher = (!empty($_GET['tagmatcher']) && $_GET['tagmatcher'] == "any") ? "any" : "all";
|
||||
|
||||
if(!empty($_GET['tags'])){
|
||||
$Tags = explode(',', $_GET['tags']);
|
||||
$TagNames = array();
|
||||
foreach ($Tags as $Tag){
|
||||
foreach ($Tags as $Tag) {
|
||||
$Tag = sanitize_tag($Tag);
|
||||
if(!empty($Tag)) {
|
||||
$TagNames[] = $Tag;
|
||||
}
|
||||
}
|
||||
|
||||
$Tags = get_tags($TagNames);
|
||||
if(count($Tags) < 1) {
|
||||
$Fail = true;
|
||||
} else {
|
||||
$SS->set_filter('tagid', array_keys($Tags));
|
||||
}
|
||||
|
||||
if(empty($_GET['tags_type']) && !empty($Tags)) {
|
||||
$_GET['tags_type'] = '0';
|
||||
$SS->set_filter('tagid', array_keys($Tags));
|
||||
} elseif(!empty($Tags)) {
|
||||
foreach(array_keys($Tags) as $Tag) {
|
||||
$SS->set_filter('tagid', array($Tag));
|
||||
}
|
||||
} else {
|
||||
$_GET['tags_type'] = '1';
|
||||
}
|
||||
|
||||
if(!empty($_GET['filter_cat'])) {
|
||||
@ -327,11 +330,9 @@
|
||||
<tr>
|
||||
<td class="label">Tags (comma-separated):</td>
|
||||
<td>
|
||||
<input type="text" name="tags" size="60" value="<?= (!empty($TagNames) ? display_str(implode(', ', $TagNames)) : '') ?>" />
|
||||
<?/*
|
||||
<input type="radio" name="tagmatcher" value="any" <?=((empty($TagMatcher) || $TagMatcher == "any") ? ' checked="checked" ' : '')?>/>Any
|
||||
<input type="radio" name="tagmatcher" value="all" <?=((!empty($TagMatcher) && $TagMatcher == "all") ? ' checked="checked" ' : '')?>/>All
|
||||
*/?>
|
||||
<input type="text" name="tags" size="60" value="<?= (!empty($TagNames) ? display_str(implode(', ', $TagNames)) : '') ?>" />
|
||||
<input type="radio" name="tags_type" id="tags_type0" value="0" <?selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>
|
||||
<input type="radio" name="tags_type" id="tags_type1" value="1" <?selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -471,7 +472,7 @@
|
||||
<a href="requests.php?order=lastvote&sort=<?=(($CurrentOrder == 'lastvote') ? $NewSort : 'desc')?>&<?=$CurrentURL ?>"><strong>Last Vote</strong></a>
|
||||
</td>
|
||||
</tr>
|
||||
<? if($NumResults == 0 || !empty($Fail)) { ?>
|
||||
<? if($NumResults == 0) { ?>
|
||||
<tr class="rowb">
|
||||
<td colspan="8">
|
||||
Nothing found!
|
||||
|
@ -1,192 +1,192 @@
|
||||
<?
|
||||
|
||||
show_header('Staff Inbox');
|
||||
|
||||
$View = display_str($_GET['view']);
|
||||
$UserLevel = $LoggedUser['Class'];
|
||||
|
||||
// Setup for current view mode
|
||||
switch ($View) {
|
||||
case 'unanswered':
|
||||
$ViewString = "Unanswered";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
break;
|
||||
case 'open':
|
||||
$ViewString = "All open";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status IN ('Open', 'Unanswered')";
|
||||
break;
|
||||
case 'resolved':
|
||||
$ViewString = "Resolved";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Resolved'";
|
||||
break;
|
||||
case 'my':
|
||||
$ViewString = "My unanswered";
|
||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
break;
|
||||
default:
|
||||
if ($IsStaff) {
|
||||
$ViewString = "My unanswered";
|
||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
} else {
|
||||
// FLS
|
||||
$ViewString = "Unanswered";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
list($Page,$Limit) = page_limit(MESSAGES_PER_PAGE);
|
||||
// Get messages
|
||||
$StaffPMs = $DB->query("
|
||||
SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
ID,
|
||||
Subject,
|
||||
UserID,
|
||||
Status,
|
||||
Level,
|
||||
AssignedToUser,
|
||||
Date,
|
||||
Unread,
|
||||
ResolverID
|
||||
FROM staff_pm_conversations
|
||||
$WhereCondition
|
||||
ORDER BY Date DESC
|
||||
LIMIT $Limit
|
||||
");
|
||||
|
||||
$DB->query('SELECT FOUND_ROWS()');
|
||||
list($NumResults) = $DB->next_record();
|
||||
$DB->set_query_id($StaffPMs);
|
||||
|
||||
$CurURL = get_url();
|
||||
if(empty($CurURL)) {
|
||||
$CurURL = "staffpm.php?";
|
||||
} else {
|
||||
$CurURL = "staffpm.php?".$CurURL."&";
|
||||
}
|
||||
$Pages=get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
|
||||
|
||||
$Row = 'a';
|
||||
|
||||
// Start page
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><?=$ViewString?> Staff PMs</h2>
|
||||
<div class="linkbox">
|
||||
<? if ($IsStaff) {
|
||||
?> <a href="staffpm.php">[My unanswered]</a>
|
||||
<? } ?>
|
||||
<a href="staffpm.php?view=unanswered">[All unanswered]</a>
|
||||
<a href="staffpm.php?view=open">[Open]</a>
|
||||
<a href="staffpm.php?view=resolved">[Resolved]</a>
|
||||
<br />
|
||||
<br />
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<div class="box pad" id="inbox">
|
||||
<?
|
||||
|
||||
if ($DB->record_count() == 0) {
|
||||
// No messages
|
||||
?>
|
||||
<h2>No messages</h2>
|
||||
<?
|
||||
|
||||
} else {
|
||||
// Messages, draw table
|
||||
if ($ViewString != 'Resolved' && $IsStaff) {
|
||||
// Open multiresolve form
|
||||
?>
|
||||
<form method="post" action="staffpm.php" id="messageform">
|
||||
<input type="hidden" name="action" value="multiresolve" />
|
||||
<input type="hidden" name="view" value="<?=strtolower($View)?>" />
|
||||
<?
|
||||
}
|
||||
|
||||
// Table head
|
||||
?>
|
||||
<table>
|
||||
<tr class="colhead">
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
|
||||
<? } ?>
|
||||
<td width="50%">Subject</td>
|
||||
<td>Sender</td>
|
||||
<td>Date</td>
|
||||
<td>Assigned to</td>
|
||||
<? if ($ViewString == 'Resolved') { ?>
|
||||
<td>Resolved by</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
// List messages
|
||||
while(list($ID, $Subject, $UserID, $Status, $Level, $AssignedToUser, $Date, $Unread, $ResolverID) = $DB->next_record()) {
|
||||
$Row = ($Row === 'a') ? 'b' : 'a';
|
||||
$RowClass = 'row'.$Row;
|
||||
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
// Get assigned
|
||||
if ($AssignedToUser == '') {
|
||||
// Assigned to class
|
||||
$Assigned = ($Level == 0) ? "First Line Support" : $ClassLevels[$Level]['Name'];
|
||||
// No + on Sysops
|
||||
if ($Assigned != 'Sysop') { $Assigned .= "+"; }
|
||||
|
||||
} else {
|
||||
// Assigned to user
|
||||
$UserInfo = user_info($AssignedToUser);
|
||||
$Assigned = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
}
|
||||
|
||||
// Get resolver
|
||||
if ($ViewString == 'Resolved') {
|
||||
$UserInfo = user_info($ResolverID);
|
||||
$ResolverStr = format_username($ResolverID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
}
|
||||
|
||||
// Table row
|
||||
?>
|
||||
<tr class="<?=$RowClass?>">
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<td class="center"><input type="checkbox" name="id[]" value="<?=$ID?>" /></td>
|
||||
<? } ?>
|
||||
<td><a href="staffpm.php?action=viewconv&id=<?=$ID?>"><?=display_str($Subject)?></a></td>
|
||||
<td><?=$UserStr?></td>
|
||||
<td><?=time_diff($Date, 2, true)?></td>
|
||||
<td><?=$Assigned?></td>
|
||||
<? if ($ViewString == 'Resolved') { ?>
|
||||
<td><?=$ResolverStr?></td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
$DB->set_query_id($StaffPMs);
|
||||
}
|
||||
|
||||
// Close table and multiresolve form
|
||||
?>
|
||||
</table>
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<input type="submit" value="Resolve selected" />
|
||||
<? } ?>
|
||||
</form>
|
||||
<?
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
||||
show_footer();
|
||||
|
||||
?>
|
||||
<?
|
||||
|
||||
show_header('Staff Inbox');
|
||||
|
||||
$View = display_str($_GET['view']);
|
||||
$UserLevel = $LoggedUser['Class'];
|
||||
|
||||
// Setup for current view mode
|
||||
switch ($View) {
|
||||
case 'unanswered':
|
||||
$ViewString = "Unanswered";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
break;
|
||||
case 'open':
|
||||
$ViewString = "All open";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status IN ('Open', 'Unanswered')";
|
||||
break;
|
||||
case 'resolved':
|
||||
$ViewString = "Resolved";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Resolved'";
|
||||
break;
|
||||
case 'my':
|
||||
$ViewString = "My unanswered";
|
||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
break;
|
||||
default:
|
||||
if ($IsStaff) {
|
||||
$ViewString = "My unanswered";
|
||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
} else {
|
||||
// FLS
|
||||
$ViewString = "Unanswered";
|
||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
list($Page,$Limit) = page_limit(MESSAGES_PER_PAGE);
|
||||
// Get messages
|
||||
$StaffPMs = $DB->query("
|
||||
SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
ID,
|
||||
Subject,
|
||||
UserID,
|
||||
Status,
|
||||
Level,
|
||||
AssignedToUser,
|
||||
Date,
|
||||
Unread,
|
||||
ResolverID
|
||||
FROM staff_pm_conversations
|
||||
$WhereCondition
|
||||
ORDER BY Date DESC
|
||||
LIMIT $Limit
|
||||
");
|
||||
|
||||
$DB->query('SELECT FOUND_ROWS()');
|
||||
list($NumResults) = $DB->next_record();
|
||||
$DB->set_query_id($StaffPMs);
|
||||
|
||||
$CurURL = get_url();
|
||||
if(empty($CurURL)) {
|
||||
$CurURL = "staffpm.php?";
|
||||
} else {
|
||||
$CurURL = "staffpm.php?".$CurURL."&";
|
||||
}
|
||||
$Pages=get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
|
||||
|
||||
$Row = 'a';
|
||||
|
||||
// Start page
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><?=$ViewString?> Staff PMs</h2>
|
||||
<div class="linkbox">
|
||||
<? if ($IsStaff) {
|
||||
?> <a href="staffpm.php">[My unanswered]</a>
|
||||
<? } ?>
|
||||
<a href="staffpm.php?view=unanswered">[All unanswered]</a>
|
||||
<a href="staffpm.php?view=open">[Open]</a>
|
||||
<a href="staffpm.php?view=resolved">[Resolved]</a>
|
||||
<br />
|
||||
<br />
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<div class="box pad" id="inbox">
|
||||
<?
|
||||
|
||||
if ($DB->record_count() == 0) {
|
||||
// No messages
|
||||
?>
|
||||
<h2>No messages</h2>
|
||||
<?
|
||||
|
||||
} else {
|
||||
// Messages, draw table
|
||||
if ($ViewString != 'Resolved' && $IsStaff) {
|
||||
// Open multiresolve form
|
||||
?>
|
||||
<form method="post" action="staffpm.php" id="messageform">
|
||||
<input type="hidden" name="action" value="multiresolve" />
|
||||
<input type="hidden" name="view" value="<?=strtolower($View)?>" />
|
||||
<?
|
||||
}
|
||||
|
||||
// Table head
|
||||
?>
|
||||
<table>
|
||||
<tr class="colhead">
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
|
||||
<? } ?>
|
||||
<td width="50%">Subject</td>
|
||||
<td>Sender</td>
|
||||
<td>Date</td>
|
||||
<td>Assigned to</td>
|
||||
<? if ($ViewString == 'Resolved') { ?>
|
||||
<td>Resolved by</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
// List messages
|
||||
while(list($ID, $Subject, $UserID, $Status, $Level, $AssignedToUser, $Date, $Unread, $ResolverID) = $DB->next_record()) {
|
||||
$Row = ($Row === 'a') ? 'b' : 'a';
|
||||
$RowClass = 'row'.$Row;
|
||||
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
// Get assigned
|
||||
if ($AssignedToUser == '') {
|
||||
// Assigned to class
|
||||
$Assigned = ($Level == 0) ? "First Line Support" : $ClassLevels[$Level]['Name'];
|
||||
// No + on Sysops
|
||||
if ($Assigned != 'Sysop') { $Assigned .= "+"; }
|
||||
|
||||
} else {
|
||||
// Assigned to user
|
||||
$UserInfo = user_info($AssignedToUser);
|
||||
$Assigned = format_username($AssignedToUser, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
}
|
||||
|
||||
// Get resolver
|
||||
if ($ViewString == 'Resolved') {
|
||||
$UserInfo = user_info($ResolverID);
|
||||
$ResolverStr = format_username($ResolverID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
}
|
||||
|
||||
// Table row
|
||||
?>
|
||||
<tr class="<?=$RowClass?>">
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<td class="center"><input type="checkbox" name="id[]" value="<?=$ID?>" /></td>
|
||||
<? } ?>
|
||||
<td><a href="staffpm.php?action=viewconv&id=<?=$ID?>"><?=display_str($Subject)?></a></td>
|
||||
<td><?=$UserStr?></td>
|
||||
<td><?=time_diff($Date, 2, true)?></td>
|
||||
<td><?=$Assigned?></td>
|
||||
<? if ($ViewString == 'Resolved') { ?>
|
||||
<td><?=$ResolverStr?></td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
$DB->set_query_id($StaffPMs);
|
||||
}
|
||||
|
||||
// Close table and multiresolve form
|
||||
?>
|
||||
</table>
|
||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||
<input type="submit" value="Resolve selected" />
|
||||
<? } ?>
|
||||
</form>
|
||||
<?
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
||||
show_footer();
|
||||
|
||||
?>
|
||||
|
@ -1,244 +1,245 @@
|
||||
<?
|
||||
include(SERVER_ROOT.'/classes/class_text.php');
|
||||
$Text = new TEXT;
|
||||
|
||||
if ($ConvID = (int)$_GET['id']) {
|
||||
// Get conversation info
|
||||
$DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID");
|
||||
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record();
|
||||
|
||||
if ($UserID == $LoggedUser['ID'] || $IsStaff || ($Level == 0 && $IsFLS) || $LoggedUser['ID'] == $AssignedToUser) {
|
||||
// User is trying to view their own unread conversation, set it to read
|
||||
if ($UserID == $LoggedUser['ID'] && $Unread) {
|
||||
$DB->query("UPDATE staff_pm_conversations SET Unread=false WHERE ID=$ConvID");
|
||||
// Clear cache for user
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
}
|
||||
|
||||
show_header('Staff PM', 'staffpm,bbcode');
|
||||
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
$OwnerID = $UserID;
|
||||
|
||||
?>
|
||||
<div id="thin">
|
||||
<h2>Staff PM - <?=display_str($Subject)?></h2>
|
||||
<div class="linkbox">
|
||||
<?
|
||||
// Staff only
|
||||
if ($IsStaff) {
|
||||
?>
|
||||
<a href="staffpm.php">[My unanswered]</a>
|
||||
<?
|
||||
}
|
||||
|
||||
// FLS/Staff
|
||||
if ($IsFLS) {
|
||||
?>
|
||||
<a href="staffpm.php?view=unanswered">[All unanswered]</a>
|
||||
<a href="staffpm.php?view=open">[Open]</a>
|
||||
<a href="staffpm.php?view=resolved">[Resolved]</a>
|
||||
<?
|
||||
// User
|
||||
} else {
|
||||
?>
|
||||
<a href="staffpm.php">[Back to inbox]</a>
|
||||
<?
|
||||
}
|
||||
|
||||
?>
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
<div id="inbox">
|
||||
<?
|
||||
// Get messages
|
||||
$StaffPMs = $DB->query("SELECT UserID, SentDate, Message FROM staff_pm_messages WHERE ConvID=$ConvID");
|
||||
|
||||
while(list($UserID, $SentDate, $Message) = $DB->next_record()) {
|
||||
// Set user string
|
||||
if ($UserID == $OwnerID) {
|
||||
// User, use prepared string
|
||||
$UserString = $UserStr;
|
||||
} else {
|
||||
// Staff/FLS
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserString = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
}
|
||||
?>
|
||||
<div class="box vertical_space">
|
||||
<div class="head">
|
||||
<strong>
|
||||
<?=$UserString?>
|
||||
|
||||
</strong>
|
||||
<?=time_diff($SentDate, 2, true)?>
|
||||
|
||||
</div>
|
||||
<div class="body"><?=$Text->full_format($Message)?></div>
|
||||
</div>
|
||||
<div align="center" style="display: none"></div>
|
||||
<?
|
||||
$DB->set_query_id($StaffPMs);
|
||||
}
|
||||
|
||||
// Common responses
|
||||
if ($IsFLS && $Status != 'Resolved') {
|
||||
?>
|
||||
<div id="common_answers" class="hidden">
|
||||
<div class="box vertical_space">
|
||||
<div class="head">
|
||||
<strong>Preview</strong>
|
||||
</div>
|
||||
<div id="common_answers_body" class="body">Select an answer from the dropdown to view it.</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="center">
|
||||
<select id="common_answers_select" onChange="UpdateMessage();">
|
||||
<option id="first_common_response">Select a message</option>
|
||||
<?
|
||||
// List common responses
|
||||
$DB->query("SELECT ID, Name FROM staff_pm_responses");
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
?>
|
||||
<option value="<?=$ID?>"><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="button" value="Set message" onClick="SetMessage();" />
|
||||
<input type="button" value="Create new / Edit" onClick="location.href='staffpm.php?action=responses&convid=<?=$ConvID?>'" />
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
|
||||
// Ajax assign response div
|
||||
if ($IsStaff) {
|
||||
?>
|
||||
<div id="ajax_message" class="hidden center alertbar"></div>
|
||||
<?
|
||||
}
|
||||
|
||||
// Replybox and buttons
|
||||
?>
|
||||
<h3>Reply</h3>
|
||||
<div class="box pad">
|
||||
<div id="preview" class="hidden"></div>
|
||||
<div id="buttons" class="center">
|
||||
<form action="staffpm.php" method="post" id="messageform">
|
||||
<input type="hidden" name="action" value="takepost" />
|
||||
<input type="hidden" name="convid" value="<?=$ConvID?>" id="convid" />
|
||||
<textarea id="quickpost" name="message" cols="90" rows="10"></textarea> <br />
|
||||
<?
|
||||
// Assign to
|
||||
if ($IsStaff) {
|
||||
// Staff assign dropdown
|
||||
?>
|
||||
<select id="assign_to" name="assign">
|
||||
<optgroup label="User classes">
|
||||
<?
|
||||
// FLS "class"
|
||||
$Selected = (!$AssignedToUser && $Level == 0) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="class_0"<?=$Selected?>>First Line Support</option>
|
||||
<?
|
||||
// Staff classes
|
||||
foreach ($ClassLevels as $Class) {
|
||||
// Create one <option> for each staff user class
|
||||
if ($Class['Level'] >= 650) {
|
||||
$Selected = (!$AssignedToUser && ($Level == $Class['Level'])) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="class_<?=$Class['Level']?>"<?=$Selected?>><?=$Class['Name']?></option>
|
||||
<?
|
||||
}
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
<optgroup label="Staff">
|
||||
<?
|
||||
|
||||
// Staff members
|
||||
$DB->query("
|
||||
SELECT
|
||||
m.ID,
|
||||
m.Username
|
||||
FROM permissions as p
|
||||
JOIN users_main as m ON m.PermissionID=p.ID
|
||||
WHERE p.DisplayStaff='1'
|
||||
ORDER BY p.Level DESC"
|
||||
);
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
// Create one <option> for each staff member
|
||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="user_<?=$ID?>"<?=$Selected?>><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
<optgroup label="First Line Support">
|
||||
<?
|
||||
// FLS users
|
||||
$DB->query("
|
||||
SELECT
|
||||
m.ID,
|
||||
m.Username
|
||||
FROM users_info as i
|
||||
JOIN users_main as m ON m.ID=i.UserID
|
||||
JOIN permissions as p ON p.ID=m.PermissionID
|
||||
WHERE p.DisplayStaff!='1' AND i.SupportFor!=''
|
||||
");
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
// Create one <option> for each FLS user
|
||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="user_<?=$ID?>"<?=$Selected?>><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
</select>
|
||||
<input type="button" onClick="Assign();" value="Assign" />
|
||||
<?
|
||||
} elseif ($IsFLS) { // FLS assign button
|
||||
?>
|
||||
<input type="button" value="Assign to staff" onClick="location.href='staffpm.php?action=assign&to=staff&convid=<?=$ConvID?>';" />
|
||||
<input type="button" value="Assign to forum staff" onClick="location.href='staffpm.php?action=assign&to=forum&convid=<?=$ConvID?>';" />
|
||||
<?
|
||||
}
|
||||
|
||||
if ($Status != 'Resolved') {
|
||||
|
||||
if ($IsFLS) { ?>
|
||||
<input type="button" value="Common answers" onClick="$('#common_answers').toggle();" />
|
||||
<input type="button" value="Preview" onclick="PreviewMessage();" />
|
||||
<? } ?>
|
||||
<input type="button" value="Resolve" onClick="location.href='staffpm.php?action=resolve&id=<?=$ConvID?>';" />
|
||||
<input type="submit" value="Send message" />
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<input type="button" value="Unresolve" onClick="location.href='staffpm.php?action=unresolve&id=<?=$ConvID?>';" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
||||
show_footer();
|
||||
} else {
|
||||
// User is trying to view someone else's conversation
|
||||
error(403);
|
||||
}
|
||||
} else {
|
||||
// No id
|
||||
header('Location: staffpm.php');
|
||||
}
|
||||
<?
|
||||
include(SERVER_ROOT.'/classes/class_text.php');
|
||||
$Text = new TEXT;
|
||||
|
||||
if ($ConvID = (int)$_GET['id']) {
|
||||
// Get conversation info
|
||||
$DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID");
|
||||
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record();
|
||||
|
||||
if ($UserID == $LoggedUser['ID'] || $IsStaff || ($Level == 0 && $IsFLS) || $LoggedUser['ID'] == $AssignedToUser) {
|
||||
// User is trying to view their own unread conversation, set it to read
|
||||
if ($UserID == $LoggedUser['ID'] && $Unread) {
|
||||
$DB->query("UPDATE staff_pm_conversations SET Unread=false WHERE ID=$ConvID");
|
||||
// Clear cache for user
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
}
|
||||
|
||||
show_header('Staff PM', 'staffpm,bbcode');
|
||||
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
$OwnerID = $UserID;
|
||||
|
||||
?>
|
||||
<div id="thin">
|
||||
<h2>Staff PM - <?=display_str($Subject)?></h2>
|
||||
<div class="linkbox">
|
||||
<?
|
||||
// Staff only
|
||||
if ($IsStaff) {
|
||||
?>
|
||||
<a href="staffpm.php">[My unanswered]</a>
|
||||
<?
|
||||
}
|
||||
|
||||
// FLS/Staff
|
||||
if ($IsFLS) {
|
||||
?>
|
||||
<a href="staffpm.php?view=unanswered">[All unanswered]</a>
|
||||
<a href="staffpm.php?view=open">[Open]</a>
|
||||
<a href="staffpm.php?view=resolved">[Resolved]</a>
|
||||
<?
|
||||
// User
|
||||
} else {
|
||||
?>
|
||||
<a href="staffpm.php">[Back to inbox]</a>
|
||||
<?
|
||||
}
|
||||
|
||||
?>
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
<div id="inbox">
|
||||
<?
|
||||
// Get messages
|
||||
$StaffPMs = $DB->query("SELECT UserID, SentDate, Message FROM staff_pm_messages WHERE ConvID=$ConvID");
|
||||
|
||||
while(list($UserID, $SentDate, $Message) = $DB->next_record()) {
|
||||
// Set user string
|
||||
if ($UserID == $OwnerID) {
|
||||
// User, use prepared string
|
||||
$UserString = $UserStr;
|
||||
} else {
|
||||
// Staff/FLS
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserString = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']);
|
||||
|
||||
}
|
||||
?>
|
||||
<div class="box vertical_space">
|
||||
<div class="head">
|
||||
<strong>
|
||||
<?=$UserString?>
|
||||
|
||||
</strong>
|
||||
<?=time_diff($SentDate, 2, true)?>
|
||||
|
||||
</div>
|
||||
<div class="body"><?=$Text->full_format($Message)?></div>
|
||||
</div>
|
||||
<div align="center" style="display: none"></div>
|
||||
<?
|
||||
$DB->set_query_id($StaffPMs);
|
||||
}
|
||||
|
||||
// Common responses
|
||||
if ($IsFLS && $Status != 'Resolved') {
|
||||
?>
|
||||
<div id="common_answers" class="hidden">
|
||||
<div class="box vertical_space">
|
||||
<div class="head">
|
||||
<strong>Preview</strong>
|
||||
</div>
|
||||
<div id="common_answers_body" class="body">Select an answer from the dropdown to view it.</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="center">
|
||||
<select id="common_answers_select" onChange="UpdateMessage();">
|
||||
<option id="first_common_response">Select a message</option>
|
||||
<?
|
||||
// List common responses
|
||||
$DB->query("SELECT ID, Name FROM staff_pm_responses");
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
?>
|
||||
<option value="<?=$ID?>"><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="button" value="Set message" onClick="SetMessage();" />
|
||||
<input type="button" value="Create new / Edit" onClick="location.href='staffpm.php?action=responses&convid=<?=$ConvID?>'" />
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
|
||||
// Ajax assign response div
|
||||
if ($IsStaff) {
|
||||
?>
|
||||
<div id="ajax_message" class="hidden center alertbar"></div>
|
||||
<?
|
||||
}
|
||||
|
||||
// Replybox and buttons
|
||||
?>
|
||||
<h3>Reply</h3>
|
||||
<div class="box pad">
|
||||
<div id="preview" class="hidden"></div>
|
||||
<div id="buttons" class="center">
|
||||
<form action="staffpm.php" method="post" id="messageform">
|
||||
<input type="hidden" name="action" value="takepost" />
|
||||
<input type="hidden" name="convid" value="<?=$ConvID?>" id="convid" />
|
||||
<textarea id="quickpost" name="message" cols="90" rows="10"></textarea> <br />
|
||||
<?
|
||||
// Assign to
|
||||
if ($IsStaff) {
|
||||
// Staff assign dropdown
|
||||
?>
|
||||
<select id="assign_to" name="assign">
|
||||
<optgroup label="User classes">
|
||||
<?
|
||||
// FLS "class"
|
||||
$Selected = (!$AssignedToUser && $Level == 0) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="class_0"<?=$Selected?>>First Line Support</option>
|
||||
<?
|
||||
// Staff classes
|
||||
foreach ($ClassLevels as $Class) {
|
||||
// Create one <option> for each staff user class
|
||||
if ($Class['Level'] >= 650) {
|
||||
$Selected = (!$AssignedToUser && ($Level == $Class['Level'])) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="class_<?=$Class['Level']?>"<?=$Selected?>><?=$Class['Name']?></option>
|
||||
<?
|
||||
}
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
<optgroup label="Staff">
|
||||
<?
|
||||
|
||||
// Staff members
|
||||
$DB->query("
|
||||
SELECT
|
||||
m.ID,
|
||||
m.Username
|
||||
FROM permissions as p
|
||||
JOIN users_main as m ON m.PermissionID=p.ID
|
||||
WHERE p.DisplayStaff='1'
|
||||
ORDER BY p.Level DESC, m.Username ASC"
|
||||
);
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
// Create one <option> for each staff member
|
||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="user_<?=$ID?>"<?=$Selected?>><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
<optgroup label="First Line Support">
|
||||
<?
|
||||
// FLS users
|
||||
$DB->query("
|
||||
SELECT
|
||||
m.ID,
|
||||
m.Username
|
||||
FROM users_info as i
|
||||
JOIN users_main as m ON m.ID=i.UserID
|
||||
JOIN permissions as p ON p.ID=m.PermissionID
|
||||
WHERE p.DisplayStaff!='1' AND i.SupportFor!=''
|
||||
ORDER BY m.Username ASC
|
||||
");
|
||||
while(list($ID, $Name) = $DB->next_record()) {
|
||||
// Create one <option> for each FLS user
|
||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||
?>
|
||||
<option value="user_<?=$ID?>"<?=$Selected?>><?=$Name?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
</select>
|
||||
<input type="button" onClick="Assign();" value="Assign" />
|
||||
<?
|
||||
} elseif ($IsFLS) { // FLS assign button
|
||||
?>
|
||||
<input type="button" value="Assign to staff" onClick="location.href='staffpm.php?action=assign&to=staff&convid=<?=$ConvID?>';" />
|
||||
<input type="button" value="Assign to forum staff" onClick="location.href='staffpm.php?action=assign&to=forum&convid=<?=$ConvID?>';" />
|
||||
<?
|
||||
}
|
||||
|
||||
if ($Status != 'Resolved') {
|
||||
|
||||
if ($IsFLS) { ?>
|
||||
<input type="button" value="Common answers" onClick="$('#common_answers').toggle();" />
|
||||
<input type="button" value="Preview" onclick="PreviewMessage();" />
|
||||
<? } ?>
|
||||
<input type="button" value="Resolve" onClick="location.href='staffpm.php?action=resolve&id=<?=$ConvID?>';" />
|
||||
<input type="submit" value="Send message" />
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<input type="button" value="Unresolve" onClick="location.href='staffpm.php?action=unresolve&id=<?=$ConvID?>';" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
||||
show_footer();
|
||||
} else {
|
||||
// User is trying to view someone else's conversation
|
||||
error(403);
|
||||
}
|
||||
} else {
|
||||
// No id
|
||||
header('Location: staffpm.php');
|
||||
}
|
||||
|
@ -139,6 +139,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
unset($Words[$Key]);
|
||||
}
|
||||
}
|
||||
unset($Word);
|
||||
$Words = trim(implode(' ',$Words));
|
||||
if(!empty($Words)) {
|
||||
$Queries[]='@(groupname,artistname,yearfulltext) '.$Words;
|
||||
@ -163,16 +164,17 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
unset($TagList[$Key]);
|
||||
}
|
||||
}
|
||||
unset($Tag);
|
||||
}
|
||||
|
||||
if(empty($_GET['tags_type']) && !empty($TagList) && count($TagList) > 1) {
|
||||
$_GET['tags_type'] = '0';
|
||||
if(!empty($TagListEx)) {
|
||||
$Queries[]='@taglist ( '.implode(' | ', $TagList).' ) '.implode(' ', $TagListEx);
|
||||
} else {
|
||||
$Queries[]='@taglist ( '.implode(' | ', $TagList).' )';
|
||||
}
|
||||
} elseif(!empty($TagList)) {
|
||||
$_GET['tags_type'] = '1';
|
||||
$Queries[]='@taglist '.implode(' ', array_merge($TagList,$TagListEx));
|
||||
} else {
|
||||
$_GET['tags_type'] = '1';
|
||||
@ -517,8 +519,8 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td class="label">Tags (comma-separated):</td>
|
||||
<td colspan="3">
|
||||
<input type="text" size="40" id="tags" name="taglist" class="inputtext smaller" title="Use !tag to exclude tag" value="<?=str_replace('_','.',form('taglist', true))?>" />
|
||||
<input type="radio" name="tags_type" id="tags_type0" value="0" <?selected('tags_type',0,'checked')?> /> <label for="tags_type0">Any</label>
|
||||
<input type="radio" name="tags_type" id="tags_type1" value="1" <?selected('tags_type',1,'checked')?> /> <label for="tags_type1">All</label>
|
||||
<input type="radio" name="tags_type" id="tags_type0" value="0" <?selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>
|
||||
<input type="radio" name="tags_type" id="tags_type1" value="1" <?selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
define('USERS_PER_PAGE', 30);
|
||||
|
||||
function wrap($String, $ForceMatch = ''){
|
||||
function wrap($String, $ForceMatch = '', $IPSearch = false){
|
||||
if(!$ForceMatch){
|
||||
global $Match;
|
||||
} else {
|
||||
@ -38,9 +38,9 @@ function wrap($String, $ForceMatch = ''){
|
||||
if($Match == ' LIKE '){
|
||||
// Fuzzy search
|
||||
// Stick in wildcards at beginning and end of string unless string starts or ends with |
|
||||
if($String[0] != '|'){
|
||||
if (($String[0] != '|') && !$IPSearch) {
|
||||
$String = '%'.$String;
|
||||
} else {
|
||||
} elseif ($String[0] == '|') {
|
||||
$String = substr($String, 1, strlen($String));
|
||||
}
|
||||
|
||||
@ -251,9 +251,9 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
|
||||
if(isset($_GET['ip_history'])){
|
||||
$Distinct = 'DISTINCT ';
|
||||
$Join[]=' JOIN users_history_ips AS hi ON hi.UserID=um1.ID ';
|
||||
$Where[]= ' hi.IP '.$Match.wrap($_GET['ip']);
|
||||
$Where[]= ' hi.IP '.$Match.wrap($_GET['ip'], '', true);
|
||||
} else {
|
||||
$Where[]='um1.IP'.$Match.wrap($_GET['ip']);
|
||||
$Where[]='um1.IP'.$Match.wrap($_GET['ip'], '', true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
|
||||
if(!empty($_GET['tracker_ip'])){
|
||||
$Distinct = 'DISTINCT ';
|
||||
$Join[]=' JOIN xbt_files_users AS xfu ON um1.ID=xfu.uid ';
|
||||
$Where[]= ' xfu.ip '.$Match.wrap($_GET['tracker_ip']);
|
||||
$Where[]= ' xfu.ip '.$Match.wrap($_GET['tracker_ip'], '', true);
|
||||
}
|
||||
|
||||
// if(!empty($_GET['tracker_ip'])){
|
||||
|
@ -1,21 +1,25 @@
|
||||
function Subscribe(topicid) {
|
||||
ajax.get("userhistory.php?action=thread_subscribe&topicid=" + topicid + "&auth=" + authkey, function() {
|
||||
if($("#subscribelink" + topicid).raw().firstChild.nodeValue.substr(1,1) == 'U') {
|
||||
$("#subscribelink" + topicid).raw().firstChild.nodeValue = "[Subscribe]";
|
||||
} else {
|
||||
$("#subscribelink" + topicid).raw().firstChild.nodeValue = "[Unsubscribe]";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function Collapse() {
|
||||
var hide = ($('#collapselink').raw().innerHTML.substr(0,1) == 'H' ? 1 : 0);
|
||||
if($('.row').results() > 0) {
|
||||
$('.row').toggle();
|
||||
}
|
||||
if(hide) {
|
||||
$('#collapselink').raw().innerHTML = 'Show post bodies';
|
||||
} else {
|
||||
$('#collapselink').raw().innerHTML = 'Hide post bodies';
|
||||
}
|
||||
}
|
||||
function Subscribe(topicid) {
|
||||
ajax.get("userhistory.php?action=thread_subscribe&topicid=" + topicid + "&auth=" + authkey, function() {
|
||||
var subscribeLink = $("#subscribelink" + topicid).raw();
|
||||
if(subscribeLink) {
|
||||
if(subscribeLink.firstChild.nodeValue.substr(1,1) == 'U') {
|
||||
subscribeLink.firstChild.nodeValue = "[Subscribe]";
|
||||
} else {
|
||||
subscribeLink.firstChild.nodeValue = "[Unsubscribe]";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function Collapse() {
|
||||
var collapseLink = $('#collapselink').raw();
|
||||
var hide = (collapseLink.innerHTML.substr(0,1) == 'H' ? 1 : 0);
|
||||
if($('.row').results() > 0) {
|
||||
$('.row').toggle();
|
||||
}
|
||||
if(hide) {
|
||||
collapseLink.innerHTML = 'Show post bodies';
|
||||
} else {
|
||||
collapseLink.innerHTML = 'Hide post bodies';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user