forked from RetroAchievements/RAWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
largechat.php
149 lines (125 loc) · 4.02 KB
/
largechat.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
require_once('db.inc.php');
RA_ReadCookieCredentials( $user, $points, $truePoints, $unreadMessageCount, $permissions );
if( getAccountDetails( $user, $userDetails ) == FALSE )
{
// Immediate redirect if we cannot validate user!
header( "Location: http://" . AT_HOST . "?e=accountissue" );
exit;
}
$errorCode = seekGET( 'e' );
$vidID = seekGET( 'v', 0 );
$mobileSetting = seekGET( 'm' );
$pageTitle = "RA Cinema";
RenderDocType();
?>
<head>
<?php RenderSharedHeader( $user ); ?>
<?php RenderTitleTag( $pageTitle, $user ); ?>
<?php RenderGoogleTracking(); ?>
<script type='text/javascript' src="/js/all.js"></script>
<script type='text/javascript' src="/js/ping_chat.js"></script>
</head>
<body onload="init_chat(250);">
<script>
//var archiveURLs = Array();
//var archiveTitles = Array();
<?php
$query = "SELECT *
FROM PlaylistVideo
ORDER BY Added DESC";
$dbResult = s_mysql_query( $query );
while( $nextData = mysqli_fetch_assoc( $dbResult ) )
{
//$archiveURLs[ $nextData['ID'] ] = $nextData;
$nextID = $nextData['ID'];
$nextURL = $nextData['Link'];
$nextTitle = htmlspecialchars( $nextData['Title'] );
echo "archiveURLs[ $nextID ] = \"$nextURL\";"; // Push this to JS
echo "archiveTitles[ $nextID ] = \"$nextTitle\";";
}
?>
function PostVideoLink()
{
var bodyTag = $("body");
var title = bodyTag.find( "#videourltitle" ).val();
var url = bodyTag.find( "#videourlinput" ).val();
url = replaceAll( "http", "_http_", url );
var posting = $.post( "/requestsubmitvid.php", { a: '<?php echo $user; ?>', i: <?php echo $vidID; ?>, t: title, l: url } );
posting.done( onPostComplete );
//$("body").find( "#warning" ).html( "Status: Updating..." );
}
function onPostComplete( data )
{
alert( data );
if( data !== "OK" )
{
//$("body").find( "#warning" ).html( "Status: Errors..." );
}
else
{
//$("body").find( "#warning" ).html( "Status: Loading..." );
window.location.reload();
}
}
</script>
<?php RenderTitleBar( $user, $points, $truePoints, $unreadMessageCount, $errorCode ); ?>
<?php RenderToolbar( $user, $permissions ); ?>
<div id="mainpage">
<div id='leftcontainer'>
<?php
// left
RenderTwitchTVStream( 600, 500, 'left', $vidID );
if( $mobileSetting == 1 )
{
echo "<iframe id='player' type='text/html' width='620' height='378' src='http://www.twitch.tv/retroachievementsorg/hls' frameborder='0'></iframe>";
}
if( $permissions > 1 )
{
echo "<div class='left'>";
echo "<span onclick=\"$('#devboxcontent').toggle(500); return false;\">Extra (click to show):</span>";
echo "<div id='devboxcontent'>";
$vidTitle = "";
$vidLink = "";
$vidAuthor = $user;
$vidAdded = "";
if( $vidID != 0 )
{
$query = "SELECT *
FROM PlaylistVideo
WHERE ID=$vidID";
$dbResult = s_mysql_query( $query );
$vidData = mysqli_fetch_assoc( $dbResult );
$vidTitle = $vidData['Title'];
$vidLink = $vidData['Link'];
$vidAuthor = $vidData['Author'];
$vidAdded = $vidData['Added'];
}
//echo "<form method='post' action='requestsubmitvid.php'>";
//echo "<form method='post'>";
echo "</br>";
echo "<ul>";
echo "<li><a href='http://www.twitch.tv/retroachievementsorg/dashboard'>Dashboard on Twitch.tv - select game on this page!</a></li>";
echo "<li>Add/Modify Video:</br>";
echo " ID: <input type='text' name='i' size='2' value='$vidID' readonly> ";
echo "Title: <input id='videourltitle' type='text' name='t' style='width: 50%;' value='$vidTitle' > ";
echo " Author: <input type='text' name='a' value='$vidAuthor' readonly><br/>";
echo " Link: <input id='videourlinput' type='text' name='l' style='width: 80%;' value='$vidLink'>";
echo "<input type='submit' name='submit' size='37' style='float: right;' value='Submit!' onclick=\"PostVideoLink()\" />";
echo "</ul>";
//echo "</form></br>";
echo "</div>";
echo "</div>";
}
?>
</div>
<div id='rightcontainer'>
<?php
// right
RenderChat( $user, 490, 'right' );
?>
</div>
</div>
<?php RenderFooter(); ?>
</body>
</html>