We have created a nice function that parses information of a gamereplay that is attached to a posting. Works nice but there's a problem:
In all forums that are 'internal' the tool won't work.
This is the code used:
showthread.php (3.6.4), lines 939 to 942, of course the file that contains the stremreplay function is included at the top of showthread.php (line 99: require_once("twrr.php"); )
Code:
if (stristr($attachment['filename'], ".CNC3Replay"))
{
$attachment['replay'] = streamReplay("http://www.cncforen.de/attachment.php?attachmentid=$attachment[attachmentid]", $attachment['filename']);
}
postbit_attachment template:
Code:
<tr>
<td valign='top'><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)
<if condition="$attachment['replay']">
<div style='border:1px double medium; height: 300px; margin:3px; padding:3px;'>
<div class='thead'>Replayinfos: (<small>Beta-Status)</small></div>
<div class='alt1'>
<span>Replay-Version: {$attachment[replay][version]} | </span>
<span>Game-Name: {$attachment[replay][name]} | </span>
<span>Voip: {$attachment[replay][ini][voip]} | </span>
<span>Battlecast: {$attachment[replay][ini][bc]}</span>
</div>
<div class='alt2' style='border-top:1px solid; border-bottom:1px solid;'>
<span>Kisten: {$attachment[replay][ini][crates]} | </span>
<span>Startcredits: {$attachment[replay][ini][startcash]} | </span>
<span>Gamespeed: {$attachment[replay][ini][gamespeed]} | </span>
<span>Sonst: {$attachment[replay][ini][gametype]}, {$attachment[replay][ini][matchtype]}</span>
</div>
<div style='float:left;'>
<div style='text-align:center; padding:3px;'><strong>Map: {$attachment[replay][mapname]}</strong></div>
<if condition="$attachment['replay']['official']">
<img src='images/mappics/{$attachment[replay][mapname]}.png' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][mapname]}' />
<else />
<img src='images/mappics/unofficial.jpg' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][mapname]}' />
</if></div>
<div style='margin:3px; text-align:center;'>
<table border='1' cellpadding='0' cellspacing='0'>
<tr>
<td style='font-weight:bold;'>#</td>
<td style='font-weight:bold;'> Fraktion </td>
<td style='font-weight:bold;'> Spieler-Typ </td>
<td style='font-weight:bold;'> Name </td>
<td style='font-weight:bold;'> Team </td>
<td style='font-weight:bold;'> Farbe </td>
<td style='font-weight:bold;'> Position </td>
<td style='font-weight:bold;'> Clan </td>
</tr>
<if condition="$attachment[replay][ini][players][1]">
<tr style='height:25px;'>
<td>1</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][1][faction]}.png' alt='{$attachment[replay][ini][players][1][faction]}' /> </td>
<td> {$attachment[replay][ini][players][1][playertype]} </td>
<td> {$attachment[replay][ini][players][1][playername]}</a> </td>
<td> {$attachment[replay][ini][players][1][team]} </td>
<td> {$attachment[replay][ini][players][1][color]} </td>
<td> {$attachment[replay][ini][players][1][mappos]} </td>
<td> {$attachment[replay][ini][players][1][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][2]">
<tr style='height:25px;'>
<td>2</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][2][faction]}.png' alt='{$attachment[replay][ini][players][2][faction]}' /> </td>
<td> {$attachment[replay][ini][players][2][playertype]} </td>
<td> {$attachment[replay][ini][players][2][playername]} </td>
<td> {$attachment[replay][ini][players][2][team]} </td>
<td> {$attachment[replay][ini][players][2][color]} </td>
<td> {$attachment[replay][ini][players][2][mappos]} </td>
<td> {$attachment[replay][ini][players][2][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][3]">
<tr style='height:25px;'>
<td>3</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][3][faction]}.png' alt='{$attachment[replay][ini][players][3][faction]}' /> </td>
<td> {$attachment[replay][ini][players][3][playertype]} </td>
<td> {$attachment[replay][ini][players][3][playername]} </td>
<td> {$attachment[replay][ini][players][3][team]} </td>
<td> {$attachment[replay][ini][players][3][color]} </td>
<td> {$attachment[replay][ini][players][3][mappos]} </td>
<td> {$attachment[replay][ini][players][3][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][4]">
<tr style='height:25px;'>
<td>4</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][4][faction]}.png' alt='{$attachment[replay][ini][players][4][faction]}' /> </td>
<td> {$attachment[replay][ini][players][4][playertype]} </td>
<td> {$attachment[replay][ini][players][4][playername]} </td>
<td> {$attachment[replay][ini][players][4][team]} </td>
<td> {$attachment[replay][ini][players][4][color]} </td>
<td> {$attachment[replay][ini][players][4][mappos]} </td>
<td> {$attachment[replay][ini][players][4][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][5]">
<tr style='height:25px;'>
<td>5</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][5][faction]}.png' alt='{$attachment[replay][ini][players][5][faction]}' /> </td>
<td> {$attachment[replay][ini][players][5][playertype]} </td>
<td> {$attachment[replay][ini][players][5][playername]} </td>
<td> {$attachment[replay][ini][players][5][team]} </td>
<td> {$attachment[replay][ini][players][5][color]} </td>
<td> {$attachment[replay][ini][players][5][mappos]} </td>
<td> {$attachment[replay][ini][players][5][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][6]">
<tr style='height:25px;'>
<td>6</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][6][faction]}.png' alt='{$attachment[replay][ini][players][6][faction]}' /> </td>
<td> {$attachment[replay][ini][players][6][playertype]} </td>
<td> {$attachment[replay][ini][players][6][playername]} </td>
<td> {$attachment[replay][ini][players][6][team]} </td>
<td> {$attachment[replay][ini][players][6][color]} </td>
<td> {$attachment[replay][ini][players][6][mappos]} </td>
<td> {$attachment[replay][ini][players][6][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][7]">
<tr style='height:25px;'>
<td>7</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][7][faction]}.png' alt='{$attachment[replay][ini][players][7][faction]}' /> </td>
<td> {$attachment[replay][ini][players][7][playertype]} </td>
<td> {$attachment[replay][ini][players][7][playername]} </td>
<td> {$attachment[replay][ini][players][7][team]} </td>
<td> {$attachment[replay][ini][players][7][color]} </td>
<td> {$attachment[replay][ini][players][7][mappos]} </td>
<td> {$attachment[replay][ini][players][7][clan]} </td>
</tr>
</if>
<if condition="$attachment[replay][ini][players][8]">
<tr style='height:25px;'>
<td>8</td>
<td> <img src='images/mappics/{$attachment[replay][ini][players][8][faction]}.png' alt='{$attachment[replay][ini][players][8][faction]}' /> </td>
<td> {$attachment[replay][ini][players][8][playertype]} </td>
<td> {$attachment[replay][ini][players][8][playername]} </td>
<td> {$attachment[replay][ini][players][8][team]} </td>
<td> {$attachment[replay][ini][players][8][color]} </td>
<td> {$attachment[replay][ini][players][8][mappos]} </td>
<td> {$attachment[replay][ini][players][8][clan]} </td>
</tr>
</if>
</table>
</div>
<div style='clear:left;'></div>
<div class='thead' style='padding:3px; margin:3px;'>© Chrissyx & cncforen.de</div>
</div>
</if>
</td>
</tr>
Attached please find the twrr.php
I don't have a clue why it is working in forums that are public and not in forums that have limited access by usergroup or individually.
Please help...