Skip to content

Commit

Permalink
✨ feat:Forum signatures added #60
Browse files Browse the repository at this point in the history
  • Loading branch information
DNA-styx committed Dec 31, 2024
1 parent dc0beb5 commit 8355254
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 17 deletions.
4 changes: 2 additions & 2 deletions web/pages/admintasks/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function draw()
$optiongroups[0]->options[] = new Option('show_weapon_target_flash', 'Show hitbox flash animation instead of plain html table for games with accuracy tracking (on supported games)', 'select');
$optiongroups[0]->options[] = new Option('show_server_load_image', 'Show load summaries from all monitored servers', 'select');
$optiongroups[0]->options[] = new Option('showqueries', 'Show "Executed X queries, generated this page in Y Seconds." message in footer?', 'select');
$optiongroups[0]->options[] = new Option('sigbackground', 'Default background for forum signature(Numbers 1-11 or random)<br />Look in sig folder to see background choices', 'text');
$optiongroups[0]->options[] = new Option('sigbackground', 'Default background for forum signature (Numbers 1-11 or random)<br>Look in hlstatsimg->sig folder to see background choices.<br>Remove all text to disable this feature', 'text');
$optiongroups[0]->options[] = new Option('modrewrite', 'Use modrewrite to make forum signature image compatible with more forum types. (To utilize this, you <strong>must</strong> have modrewrite enabled on your webserver and add the following text to a .htaccess file in the directory of hlstats.php)<br /><br /><textarea rows="3" cols="72" style="overflow:hidden;">
RewriteEngine On
RewriteRule sig-(.*)-(.*).png$ sig.php?player_id=$1&background=$2 [L]</textarea>', 'select');
Expand Down Expand Up @@ -254,7 +254,7 @@ function draw()
$optiongroups[30]->options[] = new Option('graphtxt_trend', 'Player Trend graph: text color hex# (RRGGBB)', 'text');
$optiongroups[30]->options[] = new Option('style', 'Stylesheet filename to use', 'styles');
$optiongroups[30]->options[] = new Option('display_style_selector', 'Display Style Selector?<br />Allow end users to change the style they are using.', 'select');
$optiongroups[30]->options[] = new Option('display_gamelist', 'Display games as icons on top menu?', 'select');
$optiongroups[30]->options[] = new Option('display_gamelist', 'Display games as icons on top menu', 'select');


$optiongroups[35] = new OptionGroup('Ranking settings');
Expand Down
104 changes: 89 additions & 15 deletions web/pages/playerinfo_general.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,6 @@
</td>
</tr>
</table>
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Player Trend</h4>
<?php echo "<img src=\"trend_graph.php?bgcolor=".$g_options['graphbg_trend'].'&amp;color='.$g_options['graphtxt_trend']."&amp;player=$player\" alt=\"Player Trend Graph\">"; ?>
</p>
</div>
<!-- end right card -->
Expand Down Expand Up @@ -717,26 +715,19 @@

<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">

<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="flex items-start p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 rounded-full">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Player Rank</h4>
<?php echo '<img src="'.$rankimage['url']."\" alt=\"$rankName\" title=\"$rankName\">"; ?>
</div>
<div>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Current rank: <b><?php echo htmlspecialchars($rankName, ENT_COMPAT); ?></b>
</p>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
<span class="flex items-center">
<meter min="0" max="100" low="25" high="50" optimum="75" value="<?php echo $rankPercent ?>"></meter>
</span>
</p>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Current rank: <b><?php echo htmlspecialchars($rankName, ENT_COMPAT); ?></b><br>
<meter min="0" max="100" low="25" high="50" optimum="75" value="<?php echo $rankPercent ?>"></meter><br>
Next rank: <?php echo "$rankKillsNeeded kills (".number_format($rankPercent, 0, '.', '');?>%)
</p>
</div>
</div>

<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="flex items-start p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 rounded-full">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Player History</h4>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Expand All @@ -757,7 +748,90 @@
</p>
</div>
</div>


<div class="flex items-start p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 rounded-full">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Player Trend</h4>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
<?php echo "<img src=\"trend_graph.php?bgcolor=".$g_options['graphbg_trend'].'&amp;color='.$g_options['graphtxt_trend']."&amp;player=$player\" alt=\"Player Trend Graph\">"; ?>
</p>
</div>
</div>

<?php
if ($g_options['sigbackground']){
?>
<div class="flex items-start p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 rounded-full">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Forum Signature</h4>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">

<?php
if ($g_options['modrewrite'] == 0)
{
$imglink = $siteurlneo.'sig.php?player_id='.$player.'&amp;background='.$g_options['sigbackground'];
$jimglink = $siteurlneo.'sig.php?player_id='.$player.'&background='.$g_options['sigbackground'];
}
else
{
$imglink = $siteurlneo.'sig-'.$player.'-'.$g_options['sigbackground'].'.png';
$jimglink = $imglink;
}

echo "<a href=\"$imglink\">";
echo " <img src=\"$imglink\" title=\"Copy &amp; Paste the whole URL below in your forum signature\" alt=\"forum sig image\"/>";
echo "</a>";

$script_path = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on")) ? 'https://' : 'http://';
$script_path .= $_SERVER['HTTP_HOST'];
$script_path .= str_replace('\\','/',dirname($_SERVER['PHP_SELF']));
$script_path = preg_replace('/\/$/','',$script_path);
?>
<br />
<script type="text/javascript">
/* <![CDATA[ */
function setForumText(val)
{
var txtArea = document.getElementById('siglink');
switch(val)
{
case 0:
<?php echo "txtArea.value = '$jimglink'\n"; ?>
break;
case 1:
<?php echo "txtArea.value = '[url=$script_path/hlstats.php?mode=playerinfo&player=$player"."][img]$jimglink"."[/img][/url]'\n"; ?>
break;
case 2:
<?php echo "txtArea.value = '[url=\"$script_path/hlstats.php?mode=playerinfo&player=$player\"][img]$jimglink"."[/img][/url]'\n"; ?>
break;
case 3:
<?php echo "txtArea.value = '[![". htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . "`s Stats]($jimglink"." \"". htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . "`s Stats\")]($script_path/hlstats.php?mode=playerinfo&player=$player)'\n"; ?>





break;
}
}
/* ]]> */
</script>
<span class="text-xs text-gray-600 dark:text-gray-400">
<a href="" onclick="setForumText(1);return false">
bbCode 1 (phpBB, SMF)</a>&nbsp;|&nbsp;<a href="" onclick="setForumText(2);return false">bbCode 2 (IPB)</a>&nbsp;|&nbsp;<a href="" onclick="setForumText(0);return false">Direct Image</a>&nbsp;|&nbsp;<a href="" onclick="setForumText(3);return false">Markdown</a>

</span>
<?php echo '<textarea class="block w-full mt-1 text-xs dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" style="width: 95%; height: 100px;" rows="2" cols="70" id="siglink" readonly="readonly" onclick="document.getElementById(\'siglink\').select();">[url='."$script_path/hlstats.php?mode=playerinfo&amp;player=$player"."][img]$imglink".'[/img][/url]</textarea>'; ?>

</p>
</div>
</div>

<?php
}
?>


</div>


Expand Down

0 comments on commit 8355254

Please sign in to comment.