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