list($OldBody, $AuthorID, $CollageID, $PostNum) = $DB->next_record(); // Make sure they aren't trying to edit posts they shouldn't // We use die() here instead of error() because whatever we spit out is displayed to the user in the box where his forum post is if($UserID!=$AuthorID && !check_perms('site_moderate_forums')) { die('Permission denied'); } if($DB->record_count()==0) { die('Post not found!'); } // Perform the update $DB->query("UPDATE collages_comments SET Body = '$Body' WHERE ID='$PostID'"); $Cache->delete_value('collage_'.$CollageID); $PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE); $CatalogueID = floor((POSTS_PER_PAGE*$PageNum-POSTS_PER_PAGE)/THREAD_CATALOGUE); $Cache->delete_value('collage_'.$CollageID.'_catalogue_'.$CatalogueID); $DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body) VALUES ('collages', ".$PostID.", ".$UserID.", '".sqltime()."', '".db_string($OldBody)."')"); // This gets sent to the browser, which echoes it in place of the old body echo $Text->full_format($_POST['body']); ?>
<? $DB->query("SELECT d.Name, d.Comment FROM do_not_upload as d ORDER BY d.Time"); ?> <table style=""> <tr class="colhead"> <td width="50%"><strong>Name</strong></td> <td><strong>Comment</strong></td> </tr> <? while(list($Name, $Comment) = $DB->next_record()){ ?> <tr> <td><?php echo $Text->full_format($Name); ?> </td> <td><?php echo $Text->full_format($Comment); ?> </td> </tr> <? } ?> </table> </div> <? $TorrentForm->head(); switch ($UploadForm) { case 'Music': $TorrentForm->music_form($GenreTags);
$Ratio = $Votes[$i] / $MaxVotes; $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, $EditedUsername) = array_values($Post); list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(user_info($AuthorID)); $JsonPosts[] = array('postId' => $PostID, 'addedTime' => $AddedTime, 'body' => $Text->full_format($Body), 'editedUserId' => $EditedUserID, 'editedTime' => $EditedTime, 'editedUsername' => $EditedUsername, 'author' => array('authorId' => $AuthorID, 'authorName' => $Username, 'paranoia' => $Paranoia, 'artist' => $Artist, 'donor' => $Donor, 'warned' => $Warned, 'avatar' => $Avatar, 'enabled' => $Enabled == 2 ? false : true, 'userTitle' => $UserTitle)); } print json_encode(array('status' => 'success', 'response' => array('forumId' => $ForumID, 'forumName' => $Forums[$ForumID]['Name'], 'threadId' => $ThreadID, 'threadTitle' => $ThreadInfo['Title'], 'subscribed' => in_array($ThreadID, $UserSubscriptions), 'locked' => $ThreadInfo['IsLocked'], 'sticky' => $ThreadInfo['IsSticky'], 'currentPage' => intval($Page), 'pages' => ceil($ThreadInfo['Posts'] / $PerPage), 'poll' => $JsonPoll, 'posts' => $JsonPosts)));
" alt="<?php echo $Image; ?> " /> <? } ?> </td> </tr> <? } ?> <tr> <td class="label">User Comment:</td> <td colspan="3"><?php echo $Text->full_format($UserComment); ?> </td> </tr> <? // 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="45" value="<?php echo $ModComment; ?> " /> <input type="button" value="Update now" onclick="UpdateComment(<?php
in the next <?php echo time_diff($RatioWatchEnds); ?> , or their leeching privileges will be revoked. Amount downloaded while on ratio watch: <?php echo get_size($Downloaded - $RatioWatchDownload); ?> </div> </div> <?php } ?> <div class="box"> <div class="head"> <span style="float:left;">Profile<?php if ($CustomTitle) { echo " - " . $Text->full_format(html_entity_decode($DisplayCustomTitle)); } ?> </span> <span style="float:right;"><?php echo $Badges; ?> </span> </div> <div class="pad"> <?php if (!$Info) { ?> This profile is currently empty. <?php } else {
$TorrentDisplayList = ob_get_clean(); $JsonSimilar = array(); if (empty($SimilarArray)) { $DB->query("\n\t\tSELECT\n\t\ts2.ArtistID,\n\t\ta.Name,\n\t\tass.Score,\n\t\tass.SimilarID\n\t\tFROM artists_similar AS s1\n\t\tJOIN artists_similar AS s2 ON s1.SimilarID=s2.SimilarID AND s1.ArtistID!=s2.ArtistID\n\t\tJOIN artists_similar_scores AS ass ON ass.SimilarID=s1.SimilarID\n\t\tJOIN artists_group AS a ON a.ArtistID=s2.ArtistID\n\t\tWHERE s1.ArtistID='{$ArtistID}'\n\t\tORDER BY ass.Score DESC\n\t\tLIMIT 30\n\t"); $SimilarArray = $DB->to_array(); foreach ($SimilarArray as $Similar) { $JsonSimilar[] = array('artistId' => $Similar['ArtistID'], 'name' => $Similar['Name'], 'score' => $Similar['Score'], 'similarId' => $Similar['SimilarID']); } $NumSimilar = count($SimilarArray); } $JsonRequests = array(); foreach ($Requests as $Request) { list($RequestID, $CategoryID, $Title, $Year, $TimeAdded, $Votes, $Bounty) = $Request; $JsonRequests[] = array('requestId' => $RequestID, 'categoryId' => $CategoryID, 'title' => $Title, 'year' => $Year, 'timeAdded' => $TimeAdded, 'votes' => $Votes, 'bounty' => $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("SELECT ID, Artists FROM users_notify_filters WHERE UserID='{$LoggedUser['ID']}' AND Label='Artist notifications' LIMIT 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; } } print json_encode(array('status' => 'success', 'response' => array('id' => $ArtistID, 'name' => $Name, 'notificationsEnabled' => $notificationsEnabled, 'hasBookmarked' => has_bookmarked('artist', $ArtistID), 'image' => $Image, 'body' => $Text->full_format($Body), 'vanityHouse' => $VanityHouseArtist, 'tags' => array_values($Tags), 'similarArtists' => $JsonSimilar, 'statistics' => array('numGroups' => $NumGroups, 'numTorrents' => $NumTorrents, 'numSeeders' => $NumSeeders, 'numLeechers' => $NumLeechers, 'numSnatches' => $NumSnatches), 'torrentgroup' => $JsonTorrents, 'requests' => $JsonRequests)));
<?php /* AJAX Previews, simple stuff. */ include SERVER_ROOT . '/classes/class_text.php'; // Text formatting class $Text = new TEXT(); if (!empty($_POST['AdminComment'])) { echo $Text->full_format($_POST['AdminComment']); } else { $Content = $_REQUEST['body']; // Don't use URL decode. echo $Text->full_format($Content); }
} list($InInbox, $InSentbox) = $DB->next_record(); if (!$InInbox && !$InSentbox) { print json_encode(array('status' => 'failure')); die; } // Get information on the conversation $DB->query("SELECT\n\tc.Subject,\n\tcu.Sticky,\n\tcu.UnRead,\n\tcu.ForwardedTo,\n\tum.Username\n\tFROM pm_conversations AS c\n\tJOIN pm_conversations_users AS cu ON c.ID=cu.ConvID\n\tLEFT JOIN users_main AS um ON um.ID=cu.ForwardedTo\n\tWHERE c.ID='{$ConvID}' AND UserID='{$UserID}'"); list($Subject, $Sticky, $UnRead, $ForwardedID, $ForwardedName) = $DB->next_record(); $DB->query("SELECT UserID, Username, PermissionID, Enabled, Donor, Warned\n\tFROM pm_messages AS pm\n\tJOIN users_info AS ui ON ui.UserID=pm.SenderID\n\tJOIN users_main AS um ON um.ID=pm.SenderID\n\tWHERE pm.ConvID='{$ConvID}'"); while (list($PMUserID, $Username, $PermissionID, $Enabled, $Donor, $Warned) = $DB->next_record()) { $PMUserID = (int) $PMUserID; $Users[$PMUserID]['UserStr'] = format_username($PMUserID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $PermissionID); $Users[$PMUserID]['Username'] = $Username; } $Users[0]['UserStr'] = 'System'; // in case it's a message from the system $Users[0]['Username'] = '******'; if ($UnRead == '1') { $DB->query("UPDATE pm_conversations_users SET UnRead='0' WHERE ConvID='{$ConvID}' AND UserID='{$UserID}'"); // Clear the caches of the inbox and sentbox $Cache->decrement('inbox_new_' . $UserID); } // Get messages $DB->query("SELECT SentDate, SenderID, Body, ID FROM pm_messages AS m WHERE ConvID='{$ConvID}' ORDER BY ID"); $JsonMessages = array(); while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) { $JsonMessage = array('messageId' => $MessageID, 'senderId' => $SenderID, 'senderName' => $Users[(int) $SenderID]['Username'], 'sentDate' => $SentDate, 'body' => $Text->full_format($Body)); $JsonMessages[] = $JsonMessage; } print json_encode(array('status' => 'success', 'response' => array('convId' => $ConvID, 'subject' => $Subject . ($ForwardedID > 0 ? ' (Forwarded to ' . $ForwardedName . ')' : ''), 'sticky' => $Sticky, 'messages' => $JsonMessages)));
</div> <? } ?> <div class="box"> <div class="head"> <span style="float:left;">Profile<? if ($CustomTitle) { echo " - ".html_entity_decode($CustomTitle); } ?></span> <span style="float:right;"><?php echo $Badges; ?> </span> </div> <div class="pad"> <? if (!$Info) { ?> This profile is currently empty. <? } else { echo $Text->full_format($Info); } ?> </div> </div> <? if ($Snatched > 4 && $Paranoia < 2) { $RecentSnatches = $Cache->get_value('recent_snatches_'.$UserID); if(!is_array($RecentSnatches)){ $DB->query("SELECT g.ID, g.Name, g.WikiImage FROM xbt_snatched AS s INNER JOIN torrents AS t ON t.ID=s.fid
echo "No comment with the reported ID found"; } else { list($CollageID, $Body, $PostNum) = $DB->next_record(); $PerPage = POSTS_PER_PAGE; $PageNum = ceil($PostNum / $PerPage); echo "<a href='collage.php?action=comments&collageid=".$CollageID."&page=".$PageNum."#post".$ThingID."'>COMMENT</a>"; } break; } ?> </strong> </td> </tr> <tr> <td><?php echo $Text->full_format($Reason); ?> </td> </tr> <tr> <td> <input type="submit" name="submit" value="Resolved" /> </td> </tr> </table> </form> <br /> <? $DB->set_query_id($Reports); } ?>
<td>Last Movement</td> </tr> <?php while (list($Key, list($EntryID, $UserID, $Title, $Approved, $StaffID, $Time, $TimeChange, $Username, $StaffUsername, $CurrentTitle, $PermissionID, $Enabled, $Donor, $Warned)) = each($Pending)) { ?> <tr> <td><?php echo format_username($UserID, $Username, $Donor, $Warned, $Enabled, $PermissionID); ?> </td> <td><?php echo time_diff($Time); ?> </td> <td><?php echo $Text->full_format($Title); ?> </td> <td><?php echo status($Approved); ?> </td> <td><select onchange="v4_callback(<?php echo $EntryID; ?> )" style="width:100%" name="vsel_<?php echo $EntryID; ?> " id="vsel_<?php echo $EntryID; ?>
</tr> <tr> <td class='avatar' valign="top"> <? if(empty($HeavyInfo['DisableAvatars'])) { if($Avatar){ ?> <img src='<?=$Avatar?>' width='150' alt="<?=$Username ?>'s avatar" /> <? } else { ?> <img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" /> <? } }?> </td> <td class='body' valign="top"> <?=$Text->full_format($Body) ?> <? if($EditorID){ ?> <br /><br /> Last edited by <?=format_username($EditorID, $EditorUsername) ?> <?=time_diff($EditedTime)?> <? } ?> </td> </tr> </table> <? }
list($Name, $Desc, $Filled) = $DB->next_record(); ?> <p>You are reporting the request:</p> <table> <tr class="colhead"> <td>Title</td> <td>Description</td> <td>Filled?</td> </tr> <tr> <td><?php echo display_str($Name); ?> </td> <td><?php echo $Text->full_format($Desc); ?> </td> <td><strong><?php echo $Filled == 0 ? 'No' : 'Yes'; ?> </strong></td> </tr> </table> <? break; case "collage" : $DB->query("SELECT Name, Description FROM collages WHERE ID=".$ID); if($DB->record_count() < 1) { error(404); }
">[Report Collage]</a> <? if (check_perms('site_collages_delete') || $UserID == $LoggedUser['ID']) { ?> <a href="collages.php?action=delete&collageid=<?php echo $CollageID; ?> &auth=<?php echo $LoggedUser['AuthKey']; ?> " onclick="return confirm('Are you sure you want to delete this collage?.');">[Delete]</a> <? } ?> </div> <div class="sidebar"> <div class="box"> <div class="head"><strong>Description</strong></div> <div class="pad"><?php echo $Text->full_format($Description); ?> </div> </div> <? ?> <div class="box"> <div class="head"><strong>Stats</strong></div> <ul class="stats nobullet"> <li>Torrents: <?php echo $NumGroups; ?> </li> <? if(count($Artists) >0) { ?> <li>Artists: <?php echo count($Artists);
if(!$RevisionID) { $Cache->cache_value('torrents_details_'.$GroupID,array($TorrentDetails,$TorrentList),$CacheTime); } } else { // If we're reading from cache $TorrentDetails=$TorrentCache[0]; $TorrentList=$TorrentCache[1]; } // Group details list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs, $TagPositiveVotes, $TagNegativeVotes) = array_shift($TorrentDetails); $DisplayName=$GroupName; $AltName=$GroupName; // Goes in the alt text of the image $Title=$GroupName; // goes in <title> $WikiBody = $Text->full_format($WikiBody); $Artists = get_artist($GroupID); if($Artists) { $DisplayName = display_artists($Artists, true).$DisplayName; $AltName = display_artists($Artists, false).$AltName; $Title = $AltName; } if($GroupYear>0) { $DisplayName.=' ['.$GroupYear.']'; $AltName.=' ['.$GroupYear.']'; } if($GroupCategoryID == 1) { $DisplayName.=' ['.$ReleaseTypes[$ReleaseType].']';
</strong> <?php echo time_diff($SentDate); ?> - <a href="#quickpost" onclick="Quote('<?php echo $MessageID; ?> ','<?php echo $Users[$SenderID]['Username']; ?> ');">[Quote]</a> </div> <div class="body" id="message<?php echo $MessageID; ?> "><?php echo $Text->full_format($Body); ?> </div> </div> <? } ?> <h2>Reply</h2> <form action="inbox.php" method="post" id="messageform"> <div class="box pad"> <input type="hidden" name="action" value="takecompose" /> <input type="hidden" name="toid" value="<?php echo $User2ID; ?> " /> <input type="hidden" name="convid" value="<?php
<? /* AJAX Previews, simple stuff. */ include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class $Text = new TEXT; $Content = $_REQUEST['body']; // Don't use URL decode. echo $Text->full_format($Content); ?>