forked from RetroAchievements/RAWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattemptrename.php
85 lines (67 loc) · 2.37 KB
/
attemptrename.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
require_once('db.inc.php');
if( !RA_ReadCookieCredentials( $user, $points, $truePoints, $unreadMessageCount, $permissions, Permissions::Developer ) )
{
// Immediate redirect if we cannot validate user! //TBD: pass args?
header( "Location: http://" . AT_HOST );
exit;
}
$gameID = seekGET( 'g' );
$errorCode = seekGET( 'e' );
$achievementList = array();
$gamesList = array();
$gameIDSpecified = ( isset( $gameID ) && $gameID != 0 );
if( $gameIDSpecified )
{
getGameMetadata( $gameID, $user, $achievementData, $gameData );
if( $gameData == NULL )
{
// Immediate redirect: this is pointless otherwise!
header( "Location: http://" . AT_HOST . "?e=unknowngame" );
}
}
else
{
// Immediate redirect: this is pointless otherwise!
header( "Location: http://" . AT_HOST );
}
$consoleName = $gameData['ConsoleName'];
$consoleID = $gameData['ConsoleID'];
$gameTitle = $gameData['Title'];
$gameIcon = $gameData['ImageIcon'];
$pageTitle = "Rename Game Entry ($consoleName)";
//$numGames = getGamesListWithNumAchievements( $consoleID, $gamesList, 0 );
//var_dump( $gamesList );
RenderDocType();
?>
<head>
<?php RenderSharedHeader( $user ); ?>
<?php RenderTitleTag( $pageTitle, $user ); ?>
<?php RenderGoogleTracking(); ?>
</head>
<body>
<?php RenderTitleBar( $user, $points, $truePoints, $unreadMessageCount, $errorCode ); ?>
<?php RenderToolbar( $user, $permissions ); ?>
<div id="mainpage">
<div class='left'>
<h2>Rename Game Entry</h2>
<?php
echo GetGameAndTooltipDiv( $gameID, $gameTitle, $gameIcon, $consoleName, FALSE, 96 );
echo "</br></br>";
echo "Renaming game entry <a href='/Game/$gameID'>$gameTitle</a> for $consoleName.<br/>";
echo "Please enter a new name below:<br/><br/>";
echo "<FORM method=post action='requestmodifygame.php'>";
echo "<INPUT TYPE='hidden' NAME='u' VALUE='$user' />";
echo "<INPUT TYPE='hidden' NAME='g' VALUE='$gameID' />";
echo "<INPUT TYPE='hidden' NAME='f' VALUE='1' />";
echo "New Name: <INPUT TYPE='text' NAME='v' VALUE=\"$gameTitle\" size='60' />";
echo " <INPUT TYPE='submit' VALUE='Submit' />";
echo "</FORM>";
echo "<br/><div id='warning'><b>Warning:</b> PLEASE be careful with this tool. If in doubt, <a href='/createmessage.php?t=Scott&s=Attempt%20to%20Rename%20a%20title'>leave me a message</a> and I'll help sort it.</div>";
?>
<br/>
</div>
</div>
<?php RenderFooter(); ?>
</body>
</html>