/** * Generate a table row for a staff member on staff.php * * @param $Row used for alternating row colors * @param $ID the user ID of the staff member * @param $Paranoia the user's paranoia * @param $Class the user class * @param $LastAccess datetime the user last browsed the site * @param $Remark the "Staff remark" or FLS' "Support for" text * @param $HiddenBy the text that is displayed when a staff member's * paranoia hides their LastAccess time * @return string $Row */ function make_staff_row($Row, $ID, $Paranoia, $Class, $LastAccess, $Remark = '', $HiddenBy = 'Hidden by user') { $Row = $Row === 'a' ? 'b' : 'a'; echo "\t\t\t<tr class=\"row{$Row}\">\n\t\t\t\t<td class=\"nobr\">\n\t\t\t\t\t" . Users::format_username($ID, false, false, false) . "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"nobr\">\n\t\t\t\t\t"; //used for proper indentation of HTML if (check_paranoia('lastseen', $Paranoia, $Class)) { echo time_diff($LastAccess); } else { echo "{$HiddenBy}"; } echo "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"nobr\">" . Text::full_format($Remark) . "</td>\n\t\t\t</tr>\n"; // the "\n" is needed for pretty HTML // the foreach loop that calls this function needs to know the new value of $Row return $Row; }
$JsonSimilar[] = array('artistId' => (int) $Similar['ArtistID'], 'name' => $Similar['Name'], 'score' => (int) $Similar['Score'], 'similarId' => (int) $Similar['SimilarID']); } } $JsonRequests = array(); foreach ($Requests as $RequestID => $Request) { $JsonRequests[] = array('requestId' => (int) $RequestID, 'categoryId' => (int) $Request['CategoryID'], 'title' => $Request['Title'], 'year' => (int) $Request['Year'], 'timeAdded' => $Request['TimeAdded'], 'votes' => (int) $Request['Votes'], 'bounty' => (int) $Request['Bounty']); } //notifications disabled by default $notificationsEnabled = false; if (check_perms('site_torrents_notify')) { if (($Notify = $Cache->get_value('notify_artists_' . $LoggedUser['ID'])) === false) { $DB->query("\n\t\t\tSELECT ID, Artists\n\t\t\tFROM users_notify_filters\n\t\t\tWHERE UserID = '{$LoggedUser['ID']}'\n\t\t\t\tAND Label = 'Artist notifications'\n\t\t\tLIMIT 1"); $Notify = $DB->next_record(MYSQLI_ASSOC, false); $Cache->cache_value('notify_artists_' . $LoggedUser['ID'], $Notify, 0); } if (stripos($Notify['Artists'], "|{$Name}|") === false) { $notificationsEnabled = false; } else { $notificationsEnabled = true; } } // Cache page for later use if ($RevisionID) { $Key = "artist_{$ArtistID}" . "_revision_{$RevisionID}"; } else { $Key = "artist_{$ArtistID}"; } $Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist)); $Cache->cache_value($Key, $Data, 3600); json_print("success", array('id' => (int) $ArtistID, 'name' => $Name, 'notificationsEnabled' => $notificationsEnabled, 'hasBookmarked' => Bookmarks::has_bookmarked('artist', $ArtistID), 'image' => $Image, 'body' => Text::full_format($Body), 'vanityHouse' => $VanityHouseArtist == 1, 'tags' => array_values($Tags), 'similarArtists' => $JsonSimilar, 'statistics' => array('numGroups' => $NumGroups, 'numTorrents' => $NumTorrents, 'numSeeders' => $NumSeeders, 'numLeechers' => $NumLeechers, 'numSnatches' => $NumSnatches), 'torrentgroup' => $JsonTorrents, 'requests' => $JsonRequests));
<img style="max-width: 200px;" onclick="lightbox.init(this, 200);" src="<?php echo ImageTools::process($Image); ?> " alt="Relevant image" /> <?php } ?> </td> </tr> <?php } ?> <tr> <td class="label">User comment:</td> <td colspan="3"><?php echo Text::full_format($UserComment); ?> </td> </tr> <?php // END REPORTED STUFF :|: BEGIN MOD STUFF ?> <tr> <td class="label">Report comment:</td> <td colspan="3"> <input type="text" name="comment" id="comment<?php echo $ReportID; ?> " size="70" value="<?php echo $ModComment; ?>
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Username, $ReportedTimes) { function filelist($Str) { return "</td>\n<td>" . Format::get_size($Str[1]) . "</td>\n</tr>"; } $LastRemasterYear = '-'; $LastRemasterTitle = ''; $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; $EditionID = 0; foreach ($TorrentList as $Torrent) { //t.ID, t.Media, t.Format, t.Encoding, t.Remastered, t.RemasterYear, //t.RemasterTitle, t.RemasterRecordLabel, t.RemasterCatalogueNumber, t.Scene, //t.HasLog, t.HasCue, t.LogScore, t.FileCount, t.Size, t.Seeders, t.Leechers, //t.Snatched, t.FreeTorrent, t.Time, t.Description, t.FileList, //t.FilePath, t.UserID, t.last_action, HEX(t.info_hash), (bad tags), (bad folders), (bad filenames), //(cassette approved), (lossy master approved), (lossy web approved), t.LastReseedRequest, //LogInDB, (has file), Torrents::torrent_properties() list($TorrentID, $Media, $Format, $Encoding, $Remastered, $RemasterYear, $RemasterTitle, $RemasterRecordLabel, $RemasterCatalogueNumber, $Scene, $HasLog, $HasCue, $LogScore, $FileCount, $Size, $Seeders, $Leechers, $Snatched, $FreeTorrent, $TorrentTime, $Description, $FileList, $FilePath, $UserID, $LastActive, $InfoHash, $BadTags, $BadFolders, $BadFiles, $CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest, $LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent); if ($Remastered && !$RemasterYear) { $FirstUnknown = !isset($FirstUnknown); } $Reported = false; unset($ReportedTimes); $Reports = Torrents::get_reports($TorrentID); $NumReports = count($Reports); if ($NumReports > 0) { $Reported = true; include SERVER_ROOT . '/sections/reportsv2/array.php'; $ReportInfo = ' <table class="reportinfo_table"> <tr class="colhead_dark" style="font-weight: bold;"> <td>This torrent has ' . $NumReports . ' active ' . ($NumReports === 1 ? 'report' : 'reports') . ":</td>\n\t\t\t</tr>"; foreach ($Reports as $Report) { if (check_perms('admin_reports')) { $ReporterID = $Report['ReporterID']; $Reporter = Users::user_info($ReporterID); $ReporterName = $Reporter['Username']; $ReportLinks = "<a href=\"user.php?id={$ReporterID}\">{$ReporterName}</a> <a href=\"reportsv2.php?view=report&id={$Report['ID']}\">reported it</a>"; } else { $ReportLinks = 'Someone reported it'; } if (isset($Types[$GroupCategoryID][$Report['Type']])) { $ReportType = $Types[$GroupCategoryID][$Report['Type']]; } elseif (isset($Types['master'][$Report['Type']])) { $ReportType = $Types['master'][$Report['Type']]; } else { //There was a type but it wasn't an option! $ReportType = $Types['master']['other']; } $ReportInfo .= "\n\t\t\t<tr>\n\t\t\t\t<td>{$ReportLinks} " . time_diff($Report['ReportedTime'], 2, true, true) . ' for the reason "' . $ReportType['title'] . '": <blockquote>' . Text::full_format($Report['UserComment']) . '</blockquote> </td> </tr>'; } $ReportInfo .= "\n\t\t</table>"; } $CanEdit = check_perms('torrents_edit') || $UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki'] && !($Remastered && !$RemasterYear); $RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&torrentid=' . $TorrentID . '" class="brackets">Regenerate</a>' : ''; $FileTable = ' <table class="filelist_table"> <tr class="colhead_dark"> <td> <div class="filelist_title" style="float: left;">File Names' . $RegenLink . '</div> <div class="filelist_path" style="float: right;">' . ($FilePath ? "/{$FilePath}/" : '') . '</div> </td> <td> <strong>Size</strong> </td> </tr>'; if (substr($FileList, -3) == '}}}') { // Old style $FileListSplit = explode('|||', $FileList); foreach ($FileListSplit as $File) { $NameEnd = strrpos($File, '{{{'); $Name = substr($File, 0, $NameEnd); if ($Spaces = strspn($Name, ' ')) { $Name = str_replace(' ', ' ', substr($Name, 0, $Spaces)) . substr($Name, $Spaces); } $FileSize = substr($File, $NameEnd + 3, -3); $FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $Name, Format::get_size($FileSize)); } } else { $FileListSplit = explode("\n", $FileList); foreach ($FileListSplit as $File) { $FileInfo = Torrents::filelist_get_file($File); $FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size'])); } } $FileTable .= ' </table>'; $ExtraInfo = ''; // String that contains information on the torrent (e.g. format and encoding) $AddExtra = ''; // Separator between torrent properties $TorrentUploader = $Username; // Save this for "Uploaded by:" below // similar to Torrents::torrent_info() if ($Format) { $ExtraInfo .= display_str($Format); $AddExtra = ' / '; } if ($Encoding) { $ExtraInfo .= $AddExtra . display_str($Encoding); $AddExtra = ' / '; } if ($HasLog) { $ExtraInfo .= "{$AddExtra}Log"; $AddExtra = ' / '; } if ($HasLog && $LogInDB) { $ExtraInfo .= ' (' . (int) $LogScore . '%)'; } if ($HasCue) { $ExtraInfo .= "{$AddExtra}Cue"; $AddExtra = ' / '; } if ($Scene) { $ExtraInfo .= "{$AddExtra}Scene"; $AddExtra = ' / '; } if (!$ExtraInfo) { $ExtraInfo = $GroupName; $AddExtra = ' / '; } if ($IsSnatched) { $ExtraInfo .= $AddExtra . Format::torrent_label('Snatched!'); $AddExtra = ' / '; } if ($FreeTorrent == '1') { $ExtraInfo .= $AddExtra . Format::torrent_label('Freeleech!'); $AddExtra = ' / '; } if ($FreeTorrent == '2') { $ExtraInfo .= $AddExtra . Format::torrent_label('Neutral Leech!'); $AddExtra = ' / '; } if ($PersonalFL) { $ExtraInfo .= $AddExtra . Format::torrent_label('Personal Freeleech!'); $AddExtra = ' / '; } if ($Reported) { $ExtraInfo .= $AddExtra . Format::torrent_label('Reported'); $AddExtra = ' / '; } if (!empty($BadTags)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Tags'); $AddExtra = ' / '; } if (!empty($BadFolders)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Folders'); $AddExtra = ' / '; } if (!empty($CassetteApproved)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Cassette Approved'); $AddExtra = ' / '; } if (!empty($LossymasterApproved)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Lossy Master Approved'); $AddExtra = ' / '; } if (!empty($LossywebApproved)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Lossy WEB Approved'); $AddExtra = ' / '; } if (!empty($BadFiles)) { $ExtraInfo .= $AddExtra . Format::torrent_label('Bad File Names'); $AddExtra = ' / '; } if ($GroupCategoryID == 1 && ($RemasterTitle != $LastRemasterTitle || $RemasterYear != $LastRemasterYear || $RemasterRecordLabel != $LastRemasterRecordLabel || $RemasterCatalogueNumber != $LastRemasterCatalogueNumber || $FirstUnknown || $Media != $LastMedia)) { $EditionID++; ?> <tr class="releases_<?php echo $ReleaseType; ?> groupid_<?php echo $GroupID; ?> edition group_torrent"> <td colspan="5" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?php echo $GroupID; ?> , <?php echo $EditionID; ?> , this, event);" class="tooltip" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?php echo Torrents::edition_string($Torrent, $TorrentDetails); ?> </strong></td> </tr> <?php } $LastRemasterTitle = $RemasterTitle; $LastRemasterYear = $RemasterYear; $LastRemasterRecordLabel = $RemasterRecordLabel; $LastRemasterCatalogueNumber = $RemasterCatalogueNumber; $LastMedia = $Media; ?> <tr class="torrent_row releases_<?php echo $ReleaseType; ?> groupid_<?php echo $GroupID; ?> edition_<?php echo $EditionID; ?> group_torrent<?php echo $IsSnatched ? ' snatched_torrent' : ''; ?> " style="font-weight: normal;" id="torrent<?php echo $TorrentID; ?> "> <td> <span>[ <a href="torrents.php?action=download&id=<?php echo $TorrentID; ?> &authkey=<?php echo $LoggedUser['AuthKey']; ?> &torrent_pass=<?php echo $LoggedUser['torrent_pass']; ?> " class="tooltip" title="Download"><?php echo $HasFile ? 'DL' : 'Missing'; ?> </a> <?php if (Torrents::can_use_token($Torrent)) { ?> | <a href="torrents.php?action=download&id=<?php echo $TorrentID; ?> &authkey=<?php echo $LoggedUser['AuthKey']; ?> &torrent_pass=<?php echo $LoggedUser['torrent_pass']; ?> &usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a> <?php } ?> | <a href="reportsv2.php?action=report&id=<?php echo $TorrentID; ?> " class="tooltip" title="Report">RP</a> <?php if ($CanEdit) { ?> | <a href="torrents.php?action=edit&id=<?php echo $TorrentID; ?> " class="tooltip" title="Edit">ED</a> <?php } if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?> | <a href="torrents.php?action=delete&torrentid=<?php echo $TorrentID; ?> " class="tooltip" title="Remove">RM</a> <?php } ?> | <a href="torrents.php?torrentid=<?php echo $TorrentID; ?> " class="tooltip" title="Permalink">PL</a> ]</span> » <a href="#" onclick="$('#torrent_<?php echo $TorrentID; ?> ').gtoggle(); return false;"><?php echo $ExtraInfo; ?> </a> </td> <td class="number_column nobr"><?php echo Format::get_size($Size); ?> </td> <td class="number_column"><?php echo number_format($Snatched); ?> </td> <td class="number_column"><?php echo number_format($Seeders); ?> </td> <td class="number_column"><?php echo number_format($Leechers); ?> </td> </tr> <tr class="releases_<?php echo $ReleaseType; ?> groupid_<?php echo $GroupID; ?> edition_<?php echo $EditionID; ?> torrentdetails pad<?php if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?> hidden<?php } ?> " id="torrent_<?php echo $TorrentID; ?> "> <td colspan="5"> <blockquote> Uploaded by <?php echo Users::format_username($UserID, false, false, false); ?> <?php echo time_diff($TorrentTime); if ($Seeders == 0) { if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?> <br /><strong>Last active: <?php echo time_diff($LastActive); ?> </strong> <?php } else { ?> <br />Last active: <?php echo time_diff($LastActive); } if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?> <br /><a href="torrents.php?action=reseed&torrentid=<?php echo $TorrentID; ?> &groupid=<?php echo $GroupID; ?> " class="brackets">Request re-seed</a> <?php } } ?> </blockquote> <?php if (check_perms('site_moderate_requests')) { ?> <div class="linkbox"> <a href="torrents.php?action=masspm&id=<?php echo $GroupID; ?> &torrentid=<?php echo $TorrentID; ?> " class="brackets">Mass PM snatchers</a> </div> <?php } ?> <div class="linkbox"> <a href="#" class="brackets" onclick="show_peers('<?php echo $TorrentID; ?> ', 0); return false;">View peer list</a> <?php if (check_perms('site_view_torrent_snatchlist')) { ?> <a href="#" class="brackets tooltip" onclick="show_downloads('<?php echo $TorrentID; ?> ', 0); return false;" title="View the list of users that have clicked the "DL" button.">View download list</a> <a href="#" class="brackets tooltip" onclick="show_snatches('<?php echo $TorrentID; ?> ', 0); return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a> <?php } ?> <a href="#" class="brackets" onclick="show_files('<?php echo $TorrentID; ?> '); return false;">View file list</a> <?php if ($Reported) { ?> <a href="#" class="brackets" onclick="show_reported('<?php echo $TorrentID; ?> '); return false;">View report information</a> <?php } ?> </div> <div id="peers_<?php echo $TorrentID; ?> " class="hidden"></div> <div id="downloads_<?php echo $TorrentID; ?> " class="hidden"></div> <div id="snatches_<?php echo $TorrentID; ?> " class="hidden"></div> <div id="files_<?php echo $TorrentID; ?> " class="hidden"><?php echo $FileTable; ?> </div> <?php if ($Reported) { ?> <div id="reported_<?php echo $TorrentID; ?> " class="hidden"><?php echo $ReportInfo; ?> </div> <?php } if (!empty($Description)) { echo "\n\t\t\t\t\t\t<blockquote>" . Text::full_format($Description) . '</blockquote>'; } ?> </td> </tr> <?php } }
case 'comment': $DB->query("\n\t\t\t\t\t\t\t\t\t\tSELECT 1\n\t\t\t\t\t\t\t\t\t\tFROM comments\n\t\t\t\t\t\t\t\t\t\tWHERE ID = {$ThingID}"); if (!$DB->has_results()) { echo 'No comment with the reported ID found'; } else { echo "<a href=\"comments.php?action=jump&postid={$ThingID}\">COMMENT</a>"; } break; } ?> </strong> </td> </tr> <tr> <td colspan="2"><?php echo Text::full_format($Reason); ?> </td> </tr> <tr> <td colspan="2"> <?php if ($ClaimerID == $LoggedUser['ID']) { ?> <span id="claimed_<?php echo $ReportID; ?> ">Claimed by <?php echo Users::format_username($ClaimerID, false, false, false, false); ?> <a href="#" onclick="unClaim(<?php
function user_dupes_table($UserID) { global $DB, $LoggedUser; if (!check_perms('users_mod')) { error(403); } if (!is_number($UserID)) { error(403); } $DB->query("\n\t\tSELECT d.ID, d.Comments, SHA1(d.Comments) AS CommentHash\n\t\tFROM dupe_groups AS d\n\t\t\tJOIN users_dupes AS u ON u.GroupID = d.ID\n\t\tWHERE u.UserID = {$UserID}"); if (list($GroupID, $Comments, $CommentHash) = $DB->next_record()) { $DB->query("\n\t\t\tSELECT m.ID\n\t\t\tFROM users_main AS m\n\t\t\t\tJOIN users_dupes AS d ON m.ID = d.UserID\n\t\t\tWHERE d.GroupID = {$GroupID}\n\t\t\tORDER BY m.ID ASC"); $DupeCount = $DB->record_count(); $Dupes = $DB->to_array(); } else { $DupeCount = 0; $Dupes = array(); } ?> <form class="manage_form" name="user" method="post" id="linkedform" action=""> <input type="hidden" name="action" value="dupes" /> <input type="hidden" name="dupeaction" value="update" /> <input type="hidden" name="userid" value="<?php echo $UserID; ?> " /> <input type="hidden" id="auth" name="auth" value="<?php echo $LoggedUser['AuthKey']; ?> " /> <input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?php echo $CommentHash; ?> " /> <div class="box box2" id="l_a_box"> <div class="head"> Linked Accounts (<?php echo max($DupeCount - 1, 0); ?> ) <a href="#" onclick="$('.linkedaccounts').gtoggle(); return false;" class="brackets">View</a> </div> <table width="100%" class="layout hidden linkedaccounts"> <?php echo $DupeCount ? "<tr>\n" : ''; $i = 0; foreach ($Dupes as $Dupe) { $i++; list($DupeID) = $Dupe; $DupeInfo = Users::user_info($DupeID); ?> <td align="left"><?php echo Users::format_username($DupeID, true, true, true, true); ?> <a href="user.php?action=dupes&dupeaction=remove&auth=<?php echo $LoggedUser['AuthKey']; ?> &userid=<?php echo $UserID; ?> &removeid=<?php echo $DupeID; ?> " onclick="return confirm('Are you sure you wish to remove <?php echo $DupeInfo['Username']; ?> from this group?');" class="brackets tooltip" title="Remove linked account">X</a> </td> <?php if ($i == 4) { $i = 0; echo "\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n"; } } if ($DupeCount) { if ($i !== 0) { for ($j = $i; $j < 4; $j++) { echo "\t\t\t\t\t\t<td> </td>\n"; } } ?> </tr> <?php } ?> <tr> <td colspan="5" align="left" style="border-top: thin solid;"><strong>Comments:</strong></td> </tr> <tr> <td colspan="5" align="left"> <div id="dupecomments" class="<?php echo $DupeCount ? '' : 'hidden'; ?> "><?php echo Text::full_format($Comments); ?> </div> <div id="editdupecomments" class="<?php echo $DupeCount ? 'hidden' : ''; ?> "> <textarea name="dupecomments" onkeyup="resize('dupecommentsbox');" id="dupecommentsbox" cols="65" rows="5" style="width: 98%;"><?php echo display_str($Comments); ?> </textarea> </div> <span style="float: right;"><a href="#" onclick="$('#dupecomments').gtoggle(); $('#editdupecomments').gtoggle(); resize('dupecommentsbox'); return false;" class="brackets">Edit linked account comments</a></span> </td> </tr> </table> <div class="pad hidden linkedaccounts"> <label for="target">Link this user with: </label> <input type="text" name="target" id="target" /> <input type="submit" value="Update" id="submitlink" /> </div> </div> </form> <?php }
<?php if (empty($_GET['id']) || !is_number($_GET['id'])) { json_die("failure"); } list($NumComments, $Page, $Thread) = Comments::load('torrents', (int) $_GET['id'], false); //---------- Begin printing $JsonComments = array(); 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(Users::user_info($AuthorID)); $JsonComments[] = array('postId' => (int) $PostID, 'addedTime' => $AddedTime, 'bbBody' => $Body, 'body' => Text::full_format($Body), 'editedUserId' => (int) $EditedUserID, 'editedTime' => $EditedTime, 'editedUsername' => $EditedUsername, 'userinfo' => array('authorId' => (int) $AuthorID, 'authorName' => $Username, 'artist' => $Artist == 1, 'donor' => $Donor == 1, 'warned' => $Warned != '0000-00-00 00:00:00', 'avatar' => $Avatar, 'enabled' => $Enabled == 2 ? false : true, 'userTitle' => $UserTitle)); } json_die("success", array('page' => (int) $Page, 'pages' => ceil($NumComments / TORRENT_COMMENTS_PER_PAGE), 'comments' => $JsonComments));
} if ($LoggedUser['LastReadNews'] != $News[0][0]) { $Cache->begin_transaction("user_info_heavy_{$UserID}"); $Cache->update_row(false, array('LastReadNews' => $News[0][0])); $Cache->commit_transaction(0); $DB->query("\n\t\tUPDATE users_info\n\t\tSET LastReadNews = '" . $News[0][0] . "'\n\t\tWHERE UserID = {$UserID}"); $LoggedUser['LastReadNews'] = $News[0][0]; } if (($Blog = $Cache->get_value('blog')) === false) { $DB->query("\n\t\tSELECT\n\t\t\tb.ID,\n\t\t\tum.Username,\n\t\t\tb.UserID,\n\t\t\tb.Title,\n\t\t\tb.Body,\n\t\t\tb.Time,\n\t\t\tb.ThreadID\n\t\tFROM blog AS b\n\t\t\tLEFT JOIN users_main AS um ON b.UserID = um.ID\n\t\tORDER BY Time DESC\n\t\tLIMIT 20"); $Blog = $DB->to_array(); $Cache->cache_value('blog', $Blog, 1209600); } $JsonBlog = array(); for ($i = 0; $i < 5; $i++) { list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i]; $JsonBlog[] = array('blogId' => (int) $BlogID, 'author' => $Author, 'title' => $Title, 'bbBody' => $Body, 'body' => Text::full_format($Body), 'blogTime' => $BlogTime, 'threadId' => (int) $ThreadID); } $JsonAnnouncements = array(); $Count = 0; foreach ($News as $NewsItem) { list($NewsID, $Title, $Body, $NewsTime) = $NewsItem; if (strtotime($NewsTime) > time()) { continue; } $JsonAnnouncements[] = array('newsId' => (int) $NewsID, 'title' => $Title, 'bbBody' => $Body, 'body' => Text::full_format($Body), 'newsTime' => $NewsTime); if (++$Count > 4) { break; } } json_print("success", array('announcements' => $JsonAnnouncements, 'blogPosts' => $JsonBlog));
foreach ($DNU as $BadUpload) { list($Name, $Comment, $Updated) = $BadUpload; ?> <tr> <td> <?php echo Text::full_format($Name) . "\n"; if ($TimeDiff < strtotime($Updated)) { ?> <strong class="important_text">(New!)</strong> <?php } ?> </td> <td><?php echo Text::full_format($Comment); ?> </td> </tr> <?php } ?> </table> </div><?php echo $HideDNU ? '<br />' : ''; $TorrentForm->head(); switch ($UploadForm) { case 'Music': $TorrentForm->music_form($GenreTags); break; case 'Audiobooks':
$Ratio = Format::get_ratio($Uploaded, $Downloaded, 5); } else { $Ratio = null; } if (!check_paranoia_here('uploaded')) { $Uploaded = null; } if (!check_paranoia_here('downloaded')) { $Downloaded = null; } if (isset($RequiredRatio) && !check_paranoia_here('requiredratio')) { $RequiredRatio = null; } if ($ParanoiaLevel == 0) { $ParanoiaLevelText = 'Off'; } elseif ($ParanoiaLevel == 1) { $ParanoiaLevelText = 'Very Low'; } elseif ($ParanoiaLevel <= 5) { $ParanoiaLevelText = 'Low'; } elseif ($ParanoiaLevel <= 20) { $ParanoiaLevelText = 'High'; } else { $ParanoiaLevelText = 'Very high'; } //Bugfix for no access time available if ($LastAccess == '0000-00-00 00:00:00') { $LastAccess = ''; } header('Content-Type: text/plain; charset=utf-8'); json_die("success", array('username' => $Username, 'avatar' => $Avatar, 'isFriend' => $Friend, 'profileText' => Text::full_format($Info), 'stats' => array('joinedDate' => $JoinDate, 'lastAccess' => $LastAccess, 'uploaded' => $Uploaded == null ? null : (int) $Uploaded, 'downloaded' => $Downloaded == null ? null : (int) $Downloaded, 'ratio' => $Ratio, 'requiredRatio' => $RequiredRatio == null ? null : (double) $RequiredRatio), 'ranks' => array('uploaded' => $UploadedRank, 'downloaded' => $DownloadedRank, 'uploads' => $UploadsRank, 'requests' => $RequestRank, 'bounty' => $BountyRank, 'posts' => $PostRank, 'artists' => $ArtistsRank, 'overall' => $OverallRank == null ? 0 : $OverallRank), 'personal' => array('class' => $ClassLevels[$Class]['Name'], 'paranoia' => $ParanoiaLevel, 'paranoiaText' => $ParanoiaLevelText, 'donor' => $Donor == 1, 'warned' => $Warned != '0000-00-00 00:00:00', 'enabled' => $Enabled == '1' || $Enabled == '0' || !$Enabled, 'passkey' => $torrent_pass), 'community' => array('posts' => (int) $ForumPosts, 'torrentComments' => (int) $NumComments, 'collagesStarted' => $NumCollages == null ? null : (int) $NumCollages, 'collagesContrib' => $NumCollageContribs == null ? null : (int) $NumCollageContribs, 'requestsFilled' => $RequestsFilled == null ? null : (int) $RequestsFilled, 'requestsVoted' => $RequestsVoted == null ? null : (int) $RequestsVoted, 'perfectFlacs' => $PerfectFLACs == null ? null : (int) $PerfectFLACs, 'uploaded' => $Uploads == null ? null : (int) $Uploads, 'groups' => $UniqueGroups == null ? null : (int) $UniqueGroups, 'seeding' => $Seeding == null ? null : (int) $Seeding, 'leeching' => $Leeching == null ? null : (int) $Leeching, 'snatched' => $Snatched == null ? null : (int) $Snatched, 'invited' => $Invited == null ? null : (int) $Invited)));
public static function render_profile_rewards($EnabledRewards, $ProfileRewards) { for ($i = 1; $i <= 4; $i++) { if ($EnabledRewards['HasProfileInfo' . $i] && $ProfileRewards['ProfileInfo' . $i]) { ?> <div class="box"> <div class="head" style="height: 13px;"> <span style="float: left;"><?php echo !empty($ProfileRewards['ProfileInfoTitle' . $i]) ? display_str($ProfileRewards['ProfileInfoTitle' . $i]) : "Extra Profile " . ($i + 1); ?> </span> <span style="float: right;"><a href="#" onclick="$('#profilediv_<?php echo $i; ?> ').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span> </div> <div class="pad profileinfo" id="profilediv_<?php echo $i; ?> "> <?php echo Text::full_format($ProfileRewards['ProfileInfo' . $i]); ?> </div> </div> <?php } } }
<?php authorize(); if (!isset($_POST['postid']) || !is_number($_POST['postid']) || !isset($_POST['body']) || trim($_POST['body']) === '') { error(0); } if ($LoggedUser['DisablePosting']) { error('Your posting privileges have been removed.'); } $SendPM = isset($_POST['pm']) && $_POST['pm']; Comments::edit((int) $_POST['postid'], $_POST['body'], $SendPM); // This gets sent to the browser, which echoes it in place of the old body echo Text::full_format($_POST['body']);
$TorrentList = $TorrentCache[1]; // Resolve the torrentlist to the one specific torrent being reported foreach ($TorrentList as &$Torrent) { // Remove unneeded entries if ($Torrent['ID'] != $TorrentID) { unset($TorrentList[$Torrent['ID']]); } } // Group details list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID, $GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs, $TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($GroupDetails); $DisplayName = $GroupName; $AltName = $GroupName; // Goes in the alt text of the image $Title = $GroupName; // goes in <title> $WikiBody = Text::full_format($WikiBody); //Get the artist name, group name etc. $Artists = Artists::get_artist($GroupID); if ($Artists) { $DisplayName = '<span dir="ltr">' . Artists::display_artists($Artists, true) . "<a href=\"torrents.php?torrentid={$TorrentID}\">{$DisplayName}</a></span>"; $AltName = display_str(Artists::display_artists($Artists, false)) . $AltName; $Title = $AltName; } if ($GroupYear > 0) { $DisplayName .= " [{$GroupYear}]"; $AltName .= " [{$GroupYear}]"; $Title .= " [{$GroupYear}]"; } if ($GroupVanityHouse) { $DisplayName .= ' [Vanity House]'; $AltName .= ' [Vanity House]';
"> <?php if (Users::has_avatars_enabled()) { ?> <td class="avatar" valign="top"> <?php echo Users::show_avatar($Result['LastReadAvatar'], $Result['LastReadUsername'], $HeavyInfo['DisableAvatars']); ?> </td> <?php } ?> <td class="body" valign="top"> <div class="content3"> <?php echo Text::full_format($Result['LastReadBody']); if ($Result['LastReadEditedUserID']) { ?> <br /><br /> Last edited by <?php echo Users::format_username($Result['LastReadEditedUserID'], false, false, false); ?> <?php echo time_diff($Result['LastReadEditedTime']); } ?> </div> </td> </tr> <?php }
echo $Question['ID']; ?> ').raw().submit(); } return false;" class="brackets">Delete</a> <?php } if ($LoggedUser['ID'] == $UserID) { ?> <a href="questions.php?action=edit&id=<?php echo $Question['ID']; ?> &userid=<?php echo $UserID; ?> " class="brackets">Edit</a> <?php } ?> </span> </div> <div class="pad"> <?php echo Text::full_format("[quote=" . $Question['Username'] . "]" . $Question['Question'] . "[/quote]\n" . $Question['Answer']); ?> </div> </div> <?php } ?> </div> <?php View::show_footer();
$Percent = $Votes[$i] / $TotalVotes; } else { $Ratio = 0; $Percent = 0; } $JsonPollAnswers[] = array('answer' => $Answer, 'ratio' => $Ratio, 'percent' => $Percent); } if ($UserResponse !== null || $Closed || $ThreadInfo['IsLocked'] || $LoggedUser['Class'] < $Forums[$ForumID]['MinClassWrite']) { $JsonPoll['voted'] = True; } else { $JsonPoll['voted'] = False; } $JsonPoll['answers'] = $JsonPollAnswers; } //Sqeeze in stickypost if ($ThreadInfo['StickyPostID']) { if ($ThreadInfo['StickyPostID'] != $Thread[0]['ID']) { array_unshift($Thread, $ThreadInfo['StickyPost']); } if ($ThreadInfo['StickyPostID'] != $Thread[count($Thread) - 1]['ID']) { $Thread[] = $ThreadInfo['StickyPost']; } } $JsonPosts = array(); foreach ($Thread as $Key => $Post) { list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime) = array_values($Post); list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID)); $UserInfo = Users::user_info($EditedUserID); $JsonPosts[] = array('postId' => (int) $PostID, 'addedTime' => $AddedTime, 'bbBody' => $Body, 'body' => Text::full_format($Body), 'editedUserId' => (int) $EditedUserID, 'editedTime' => $EditedTime, 'editedUsername' => $UserInfo['Username'], 'author' => array('authorId' => (int) $AuthorID, 'authorName' => $Username, 'paranoia' => $Paranoia, 'artist' => $Artist === '1', 'donor' => $Donor === '1', 'warned' => $Warned !== '0000-00-00 00:00:00', 'avatar' => $Avatar, 'enabled' => $Enabled === '2' ? false : true, 'userTitle' => $UserTitle)); } print json_encode(array('status' => 'success', 'response' => array('forumId' => (int) $ForumID, 'forumName' => $Forums[$ForumID]['Name'], 'threadId' => (int) $ThreadID, 'threadTitle' => display_str($ThreadInfo['Title']), 'subscribed' => in_array($ThreadID, $UserSubscriptions), 'locked' => $ThreadInfo['IsLocked'] == 1, 'sticky' => $ThreadInfo['IsSticky'] == 1, 'currentPage' => (int) $Page, 'pages' => ceil($ThreadInfo['Posts'] / $PerPage), 'poll' => empty($JsonPoll) ? null : $JsonPoll, 'posts' => $JsonPosts)));
t.LastPostID,'; if ($UserID === $LoggedUser['ID']) { $SQL .= ' l.PostID AS LastRead,'; } $SQL .= "\n\t\t\t\tt.IsLocked,\n\t\t\t\tt.IsSticky\n\t\t\tFROM forums_posts AS p\n\t\t\t\tLEFT JOIN users_main AS um ON um.ID = p.AuthorID\n\t\t\t\tLEFT JOIN users_info AS ui ON ui.UserID = p.AuthorID\n\t\t\t\tLEFT JOIN users_main AS ed ON ed.ID = p.EditedUserID\n\t\t\t\tJOIN forums_topics AS t ON t.ID = p.TopicID\n\t\t\t\tJOIN forums AS f ON f.ID = t.ForumID\n\t\t\t\tLEFT JOIN forums_last_read_topics AS l ON l.UserID = {$UserID} AND l.TopicID = t.ID\n\t\t\tWHERE p.AuthorID = {$UserID}\n\t\t\t\tAND " . Forums::user_forums_sql(); if ($ShowUnread) { $SQL .= ' AND ((t.IsLocked = \'0\' OR t.IsSticky = \'1\') AND (l.PostID < t.LastPostID OR l.PostID IS NULL) ) '; } $SQL .= ' ORDER BY p.ID DESC'; if ($ShowGrouped) { $SQL .= ' ) AS sub GROUP BY TopicID ORDER BY ID DESC'; } $SQL .= "\n\t\tLIMIT {$Limit}"; $Posts = $DB->query($SQL); $DB->query('SELECT FOUND_ROWS()'); list($Results) = $DB->next_record(); $DB->set_query_id($Posts); } $JsonResults = array(); while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) { $JsonResults[] = array('postId' => (int) $PostID, 'topicId' => (int) $TopicID, 'threadTitle' => $ThreadTitle, 'lastPostId' => (int) $LastPostID, 'lastRead' => (int) $LastRead, 'locked' => $Locked === '1', 'sticky' => $Sticky === '1', 'addedTime' => $AddedTime, 'body' => Text::full_format($Body), 'bbbody' => $Body, 'editedUserId' => (int) $EditedUserID, 'editedTime' => $EditedTime, 'editedUsername' => $EditedUsername); } print json_encode(array('status' => 'success', 'response' => array('currentPage' => (int) $Page, 'pages' => ceil($Results / $PerPage), 'threads' => $JsonResults)));
print json_encode(array('status' => 'failure')); die; } // Get information on the conversation $DB->query("\n\tSELECT\n\t\tc.Subject,\n\t\tcu.Sticky,\n\t\tcu.UnRead,\n\t\tcu.ForwardedTo,\n\t\tum.Username\n\tFROM pm_conversations AS c\n\t\tJOIN pm_conversations_users AS cu ON c.ID = cu.ConvID\n\t\tLEFT JOIN users_main AS um ON um.ID = cu.ForwardedTo\n\tWHERE c.ID = '{$ConvID}'\n\t\tAND UserID = '{$UserID}'"); list($Subject, $Sticky, $UnRead, $ForwardedID, $ForwardedName) = $DB->next_record(); $DB->query("\n\tSELECT um.ID, Username\n\tFROM pm_messages AS pm\n\t\tJOIN users_main AS um ON um.ID = pm.SenderID\n\tWHERE pm.ConvID = '{$ConvID}'"); while (list($PMUserID, $Username) = $DB->next_record()) { $PMUserID = (int) $PMUserID; $Users[$PMUserID]['UserStr'] = Users::format_username($PMUserID, true, true, true, true); $Users[$PMUserID]['Username'] = $Username; $UserInfo = Users::user_info($PMUserID); $Users[$PMUserID]['Avatar'] = $UserInfo['Avatar']; } $Users[0]['UserStr'] = 'System'; // in case it's a message from the system $Users[0]['Username'] = '******'; $Users[0]['Avatar'] = ''; if ($UnRead == '1') { $DB->query("\n\t\tUPDATE pm_conversations_users\n\t\tSET UnRead = '0'\n\t\tWHERE ConvID = '{$ConvID}'\n\t\t\tAND UserID = '{$UserID}'"); // Clear the caches of the inbox and sentbox $Cache->decrement("inbox_new_{$UserID}"); } // Get messages $DB->query("\n\tSELECT SentDate, SenderID, Body, ID\n\tFROM pm_messages\n\tWHERE ConvID = '{$ConvID}'\n\tORDER BY ID"); $JsonMessages = array(); while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) { $JsonMessage = array('messageId' => (int) $MessageID, 'senderId' => (int) $SenderID, 'senderName' => $Users[(int) $SenderID]['Username'], 'sentDate' => $SentDate, 'avatar' => $Users[(int) $SenderID]['Avatar'], 'bbBody' => $Body, 'body' => Text::full_format($Body)); $JsonMessages[] = $JsonMessage; } print json_encode(array('status' => 'success', 'response' => array('convId' => (int) $ConvID, 'subject' => $Subject . ($ForwardedID > 0 ? " (Forwarded to {$ForwardedName})" : ''), 'sticky' => $Sticky == 1, 'messages' => $JsonMessages)));
').raw().submit(); } return false;" class="brackets">Delete</a> - <a href="#" id="<?php echo $Question['ID']; ?> " class="brackets ignore_link">Ignore</a> - <a href="#" id="<?php echo $Question['ID']; ?> " class="answer_link brackets">Answer</a> </span> </div> <div class="pad"> <?php echo Text::full_format($Question['Question']); ?> </div> </div> <div id="answer<?php echo $Question['ID']; ?> " class="hidden center box pad"> <?php new TEXTAREA_PREVIEW("replybox_" . $Question['ID'], "replybox_" . $Question['ID'], '', 40, 8); ?> <input type="submit" class="submit submit_button" id="<?php echo $Question['ID']; ?> " value="Answer" /> </div>
} $GroupID = $TorrentDetails['ID']; $ArtistForm = Artists::get_artist($GroupID); if ($TorrentDetails['CategoryID'] == 0) { $CategoryName = "Unknown"; } else { $CategoryName = $Categories[$TorrentDetails['CategoryID'] - 1]; } $JsonMusicInfo = array(); if ($CategoryName == "Music") { $JsonMusicInfo = array('composers' => $ArtistForm[4] == null ? array() : pullmediainfo($ArtistForm[4]), 'dj' => $ArtistForm[6] == null ? array() : pullmediainfo($ArtistForm[6]), 'artists' => $ArtistForm[1] == null ? array() : pullmediainfo($ArtistForm[1]), 'with' => $ArtistForm[2] == null ? array() : pullmediainfo($ArtistForm[2]), 'conductor' => $ArtistForm[5] == null ? array() : pullmediainfo($ArtistForm[5]), 'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]), 'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7])); } else { $JsonMusicInfo = null; } $TagList = explode('|', $TorrentDetails['GROUP_CONCAT(DISTINCT tags.Name SEPARATOR \'|\')']); $JsonTorrentDetails = array('wikiBody' => Text::full_format($TorrentDetails['WikiBody']), 'wikiImage' => $TorrentDetails['WikiImage'], 'id' => (int) $TorrentDetails['ID'], 'name' => $TorrentDetails['Name'], 'year' => (int) $TorrentDetails['Year'], 'recordLabel' => $TorrentDetails['RecordLabel'], 'catalogueNumber' => $TorrentDetails['CatalogueNumber'], 'releaseType' => (int) $TorrentDetails['ReleaseType'], 'categoryId' => (int) $TorrentDetails['CategoryID'], 'categoryName' => $CategoryName, 'time' => $TorrentDetails['Time'], 'vanityHouse' => $TorrentDetails['VanityHouse'] == 1, 'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID), 'musicInfo' => $JsonMusicInfo, 'tags' => $TagList); $Torrent = $TorrentList[$TorrentID]; $Reports = Torrents::get_reports($TorrentID); if (count($Reports) > 0) { $Torrent['Reported'] = true; } else { $Torrent['Reported'] = false; } // Convert file list back to the old format $FileList = explode("\n", $Torrent['FileList']); foreach ($FileList as &$File) { $File = Torrents::filelist_old_format($File); } unset($File); $FileList = implode('|||', $FileList); $Userinfo = Users::user_info($Torrent['UserID']);
?> <div class="submit_div"> <input type="submit" value="Fill request" /> </div> </form> </td> </tr> <?php } ?> </table> <div class="box box2 box_request_desc"> <div class="head"><strong>Description</strong></div> <div class="pad"> <?php echo Text::full_format($Request['Description']); ?> </div> </div> <div id="request_comments"> <div class="linkbox"> <a name="comments"></a> <?php $Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments'); echo $Pages; ?> </div> <?php //---------- Begin printing CommentsView::render_comments($Thread, $LastRead, "requests.php?action=view&id={$RequestID}"); if ($Pages) {
public static function render_events($Events) { $Categories = SiteHistory::get_categories(); $SubCategories = SiteHistory::get_sub_categories(); $CanEdit = check_perms('users_mod'); foreach ($Events as $Event) { ?> <div class="box"> <div class="head colhead_dark"> <div class="title"> <?php if ($CanEdit) { ?> <a class="brackets" href="sitehistory.php?action=edit&id=<?php echo $Event['ID']; ?> ">Edit</a> <?php } ?> <?php echo date('F d, Y', strtotime($Event['Date'])); ?> - <a href="sitehistory.php?action=search&category=<?php echo $Event['Category']; ?> " class="brackets"><?php echo $Categories[$Event['Category']]; ?> </a> <a href="sitehistory.php?action=search&subcategory=<?php echo $Event['SubCategory']; ?> " class="brackets"><?php echo $SubCategories[$Event['SubCategory']]; ?> </a> <?php if (!empty($Event['Url'])) { ?> <a href="<?php echo $Event['Url']; ?> "><?php echo $Event['Title']; ?> </a> <?php } else { ?> <?php echo $Event['Title']; } ?> </div> <div class="tags"> <?php self::render_tags($Event['Tags']); ?> </div> </div> <?php if (!empty($Event['Body'])) { ?> <div class="body"> <?php echo Text::full_format($Event['Body']); ?> </div> <?php } ?> </div> <?php } }
?> " /> <div class="box box2" id="staff_notes_box"> <div class="head"> Staff Notes <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a> <a href="#" onclick="$('#staffnotes').gtoggle(); return false;" class="brackets">Toggle</a> </div> <div id="staffnotes" class="pad"> <input type="hidden" name="comment_hash" value="<?php echo $CommentHash; ?> " /> <div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?php echo Text::full_format($AdminComment); ?> </div> <textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?php echo display_str($AdminComment); ?> </textarea> <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a> <script type="text/javascript"> resize('admincomment'); </script> </div> </div> <table class="layout" id="user_info_box"> <tr class="colhead">
?> </div> <?php if ($Reported) { ?> <div id="reported_<?php echo $TorrentID; ?> " class="hidden"><?php echo $ReportInfo; ?> </div> <?php } if (!empty($Description)) { echo "\n<blockquote>" . Text::full_format($Description) . '</blockquote>'; } ?> </td> </tr> <?php } ?> </table> <?php $Requests = get_group_requests($GroupID); if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) { $i = 0; ?> <div class="box"> <div class="head">
<input type="hidden" name="topicid" value="<?php echo $ThreadID; ?> " /> <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border hidden" id="thread_notes_table"> <?php foreach ($Notes as $Note) { ?> <tr><td><?php echo Users::format_username($Note['AuthorID']); ?> (<?php echo time_diff($Note['AddedTime'], 2, true, true); ?> )</td><td><?php echo Text::full_format($Note['Body']); ?> </td></tr> <?php } ?> <tr> <td colspan="2" class="center"> <div class="field_div textarea_wrap"><textarea id="topic_notes" name="body" cols="90" rows="3" onkeyup="resize('threadnotes');" style=" margin: 0px; width: 735px;"></textarea></div> <input type="submit" value="Save" /> </td> </tr> </table> </form> <br /> <h3>Edit thread</h3>
<?php /* AJAX Previews, simple stuff. */ if (!empty($_POST['message'])) { echo Text::full_format($_POST['message']); }
die; } Text::$TOC = true; $UserID = (int) $_GET['userid']; $UserIDSQL = ""; if (!empty($UserID)) { $UserIDSQL = " AND UserID != '{$UserID}' "; } G::$DB->query("\n\t\tSELECT UserID, Answer, Date\n\t\tFROM staff_answers\n\t\tWHERE QuestionID = '{$ID}'\n\t\t\t{$UserIDSQL}\n\t\tORDER BY DATE DESC"); $Answers = G::$DB->to_array(false, MYSQLI_ASSOC); foreach ($Answers as $Answer) { ?> <div class="box box2"> <div class="head"> <span> Answer by <?php echo Users::format_username($Answer['UserID']); ?> - <?php echo time_diff($Answer['Date']); ?> </span> </div> <div class="pad"> <?php echo Text::full_format($Answer['Answer']); ?> </div> </div> <?php }
echo time_diff($SentDate, 2, true); if ($Status != 'Resolved') { ?> - <a href="#quickpost" onclick="Quote('<?php echo $MessageID; ?> ', '<?php echo $Username; ?> ');" class="brackets">Quote</a> <?php } ?> </div> <div class="body"><?php echo Text::full_format($Message); ?> </div> </div> <div align="center" style="display: none;"></div> <?php $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>
?> " class="brackets">Edit</a> <?php } ?> <span style="float: right;"><a href="#" onclick="$('#newsbody<?php echo $NewsID; ?> ').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span> </div> <div id="newsbody<?php echo $NewsID; ?> " class="pad"><?php echo Text::full_format($Body); ?> </div> </div> <?php if (++$Count > $NewsCount - 1) { break; } } ?> <div id="more_news" class="box"> <div class="head"> <em><span><a href="#" onclick="news_ajax(event, 3, <?php echo $NewsCount; ?> , <?php
<?php /* AJAX Previews, simple stuff. */ Text::$TOC = true; if (!empty($_POST['AdminComment'])) { echo Text::full_format($_POST['AdminComment']); } else { $Content = $_REQUEST['body']; // Don't use URL decode. echo Text::full_format($Content); }