TTT_Role_Overview/confirm.php

94 lines
1.8 KiB
PHP

<body>
<html>
<?php
if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'])){
echo 'VALID FILENAME';
$language = $_POST['language'];
$rolefile = "roles/".$language."/".$_POST['rolename'].".php";
fopen($rolefile, "w");
#
# COLORS
#
# Text Color
$f_tcolor = $_POST['textcol'];
fwrite($rolefile, $f_tcolor);
# This is the color defined by https://materializecss.com/color.html
$f_color = $_POST['rolecolor']." ".$_POST['rolestrength']."-".$_POST['rolemod'];
fwrite($rolefile, $f_color);
#
# BASEINFO
#
#The Name of the Role
$f_name = $_POST['rolename'];
fwrite($rolefile, $f_name);
#The Description of the Role, HTML conform :)
$f_description = $_POST['roledesc'];
fwrite($rolefile, $f_description);
#
# TABS
#
#How To play
$f_howtoplay = $_POST['howtoplay'];
fwrite($rolefile, $f_howtoplay);
#With what roles does this role play best?
fwrite($rolefile, '$playsbestwith = "<ul>');
foreach($_POST['goodRol es'] as $selectedOption) {
fwrite($rolefile, '<li>'.$selectedOption.'</li>');
};
fwrite($rolefile, '<</ul>"');
#Convars
$f_convars = '$convars = "Normal Role Convars (also found in ULX):
<code>'.$_POST['gconvars'].'</code>
Rolespecific Convars:
<code>'.$_POST['cconvars'].'</code>"';
fwrite($rolefile, $f_convars);
#
# Credits
#
#The Steam URL to your addon
$f_steam = $_POST['steam'];
fwrite($rolefile, $f_steam);
#The Source URL to your addon
$f_source = $_POST['source'];
fwrite($rolefile, $f_source);
#Creator of the Addon
$f_author = $_POST[''];
fwrite($rolefile, $f_author);
#Creatorlink
$f_authorurl = $_POST[''];
fwrite($rolefile, $f_authorurl);
# Credittext (can use the above variables)
$f_ctext = $_POST['credits'];
fwrite($rolefile, $f_ctext);
fclose($rolefile);
} else {
echo 'INVALID ROLENAME';
}
?>
</body>
</html>