Compare commits

..

No commits in common. "5b272d27613215a14363a1f3e5f507e20bf0ba53" and "65fce1ec67be3d5f125dff97a76f4caad97f2b97" have entirely different histories.

2 changed files with 25 additions and 39 deletions

View File

@ -1,26 +1,25 @@
<body>
<html>
<?php
if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){
if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'])){
echo 'VALID FILENAME';
$language = $_POST['language'];
$rolefile = fopen("roles/".$language."/".$_POST['rolename'].".php", "w");
$rolefile = "roles/".$language."/".$_POST['rolename'].".php";
#Initialisation
fwrite($rolefile, '<?php'.PHP_EOL);
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, '$color = "'.$f_color.'"'.PHP_EOL);
fwrite($rolefile, $f_color);
# Text Color
$f_tcolor = $_POST['tcolor'];
fwrite($rolefile, '$tcolor = '.$f_tcolor.PHP_EOL);
#
@ -29,11 +28,10 @@ if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){
#The Name of the Role
$f_name = $_POST['rolename'];
fwrite($rolefile, '$name = '.$f_name.PHP_EOL);
fwrite($rolefile, $f_name);
#The Description of the Role, HTML conform :)
$f_description = $_POST['roledesc'];
fwrite($rolefile,'$description = '. $f_description.PHP_EOL);
fwrite($rolefile, $f_description);
@ -44,15 +42,14 @@ if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){
#How To play
$f_howtoplay = $_POST['howtoplay'];
fwrite($rolefile, '$howtoplay = '.$f_howtoplay.PHP_EOL);
fwrite($rolefile, $f_howtoplay);
#With what roles does this role play best?
fwrite($rolefile, '$playsbestwith = "<ul>'.PHP_EOL);
foreach($_POST['goodRoles'] as $selectedOption) {
fwrite($rolefile, '<li>'.$selectedOption.'</li>'.PHP_EOL);
fwrite($rolefile, '$playsbestwith = "<ul>');
foreach($_POST['goodRol es'] as $selectedOption) {
fwrite($rolefile, '<li>'.$selectedOption.'</li>');
};
fwrite($rolefile, '</ul>;"'.PHP_EOL);
fwrite($rolefile, '<</ul>"');
#Convars
@ -62,7 +59,7 @@ if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){
Rolespecific Convars:
<code>'.$_POST['cconvars'].'</code>"';
fwrite($rolefile, $f_convars.PHP_EOL);
fwrite($rolefile, $f_convars);
#
@ -71,22 +68,21 @@ if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){
#The Steam URL to your addon
$f_steam = $_POST['steam'];
fwrite($rolefile, '$steam = '.$f_steam.PHP_EOL);
fwrite($rolefile, $f_steam);
#The Source URL to your addon
$f_source = $_POST['source'];
fwrite($rolefile, '$source = '.$f_source.PHP_EOL);
fwrite($rolefile, $f_source);
#Creator of the Addon
$f_author = $_POST['creator'];
fwrite($rolefile, '$author = '.$f_author.PHP_EOL);
$f_author = $_POST[''];
fwrite($rolefile, $f_author);
#Creatorlink
$f_authorurl = $_POST['creatorurl'];
fwrite($rolefile, '$authorurl = '.$f_authorurl.PHP_EOL);
$f_authorurl = $_POST[''];
fwrite($rolefile, $f_authorurl);
# Credittext (can use the above variables)
$f_ctext = $_POST['credits'];
fwrite($rolefile, '$ctext = '.$f_ctext);
fwrite($rolefile, $f_ctext);
fwrite($rolefile, PHP_EOL.'?>');
fclose($rolefile);
} else {
echo 'INVALID ROLENAME';

View File

@ -88,7 +88,7 @@
<label>Select Strength</label>
</div>
<div class="input-field col s3">
<select id="tcolor" name="tcolor" onchange="updateCard()">
<select id="tcolor" name="textcol" onchange="updateCard()">
<option value="" disabled selected>Textcolor</option>
<option value="black-text">Black</option>
<option value="white-text">White</option>
@ -104,7 +104,7 @@
</div>
<div class="row">
<div class="input-field col s12">
<select id="goodRoles" name="goodRoles[]" onchange="updateCard()" multiple="multiple">
<select id="goodRoles" name="goodRoles" onchange="updateCard()" multiple>
<option value="" disabled> Choose your option </option>
<?php
$files = glob("roles/en/*.php");
@ -131,16 +131,6 @@
<label for="convars">Paste your role specific convars</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input name="creator" id="creator" type="text" onkeyup="updateCard()">
<label for="creator">Steam Creator</label>
</div>
<div class="input-field col s6">
<input name="creatorurl" id="creatorurl" type="text" onkeyup="updateCard()">
<label for="creatorurl">Steeam Creator Link</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="credits" name="credits" onkeyup="updateCard()" class="materialize-textarea"></textarea>