fixed image select and added headphones

This commit is contained in:
Karl Hudgell 2016-02-06 11:00:38 +00:00
parent fa2bb58e90
commit 02c2cb2552
14 changed files with 285 additions and 45 deletions

BIN
Pic/Upload/KWorld.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
Pic/Upload/Konvos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
Pic/Upload/ftp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
Pic/Upload/headphones.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
Pic/Upload/madsonic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

BIN
Pic/Upload/sick.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
Pic/Upload/test.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -1,6 +1,5 @@
.gridster {
width: 730px;
background: #004756;
margin-left:auto;
margin-right:auto;
opacity: .8;
@ -104,9 +103,4 @@ h3 {
font-size: 25px;
font-weight: 600;
color: white;
}
/* Uncomment this if you set helper : "clone" in draggable options */
/*.gridster .player {
opacity:0;
}*/
}

View File

@ -4,38 +4,115 @@
SAB Enabled: <input name="sabvisible" id="id" type="checkbox" <?php if($sabvisible > "0") echo "checked=checked; "; ?> /><br />
SAB Port: <input type="text" value="<?php echo $sabport ?>" name="sabport" /><br />
SAB Name: <input type="text" value="<?php echo $sabname ?>" name="sabname" /><br />
SAB Pic: <select name="sabpic">
<?php
$dir = "../Pic/Upload/";
$default = $sabpicname;
SAB Pic: <?php
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print "<option value=\"{$file}\" >{$file}</option>";
}
closedir($dh);
}
}
?>
</select><br />
<br />
$folder = '../Pic/Upload';
echo '<select name="sabpic">'."\n".
dropdown(image_filenames($folder), @$_POST['image']).
'</select>'."\n".'</br></br>';
function image_filenames($dir)
{
$handle = @opendir($dir)
or die("I cannot open the directory '<b>$dir</b>' for reading.");
$images = array();
while (false !== ($file = readdir($handle)))
{
if (eregi('\.(jpg|gif|png)$', $file))
{
$images[] = $file;
}
}
closedir($handle);
return $images;
}
function dropdown($options_array, $selected = null)
{
global $sabpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $sabpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Sick Enabled: <input name="sickvisible" id="id" type="checkbox" <?php if($sickvisible > "0") echo "checked=checked; "; ?> /><br />
Sick Type : <input type="radio" name="sicktype" value="1" <?php if($sicktype < "2") echo "checked=checked; "; ?>>SickBeard / <input type="radio" name="sicktype" value="2" <?php if($sicktype > "1") echo "checked=checked; "; ?>>SickRage<br />
Sick Port: <input type="text" value="<?php echo $sickport ?>" name="sickport" /><br />
Sick Name: <input type="text" value="<?php echo $sickname ?>" name="sickname" /><br />
Sick Pic: <input type="text" value="<?php echo $sickpicname ?>" name="sickpicname" /><br />
<br />
Sick Pic:<?php
echo '<select name="sickpic">'."\n".
dropdown_sick(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_sick($options_array, $selected = null)
{
global $sickpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $sickpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Couch Enabled: <input name="couchvisible" id="id" type="checkbox" <?php if($couchvisible > "0") echo "checked=checked; "; ?> /><br />
Couch Adults : <input type="radio" name="cpadultsvisible" value="1" <?php if($cpadultsvisible > "0") echo "checked=checked; "; ?>>Enabled / <input type="radio" name="cpadultsvisible" value="2" <?php if($cpadultsvisible < "1") echo "checked=checked; "; ?>>Disabled<br />
Couch Adults Port: <input type="text" value="<?php echo $cpadults ?>" name="cpadults" /><br />
Couch Adults Name: <input type="text" value="<?php echo $cpadultsname ?>" name="cpadultsname" /><br />
Couch Adults Pic: <input type="text" value="<?php echo $cpadultspicname ?>" name="cpadultspicname" /><br />
Couch Adults Pic: <?php
echo '<select name="cpapic">'."\n".
dropdown_cpa(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_cpa($options_array, $selected = null)
{
global $cpadultspicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $cpadultspicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Couch Kids : <input type="radio" name="cpkidsvisible" value="1" <?php if($cpkidsvisible > "0") echo "checked=checked; "; ?>>Enabled / <input type="radio" name="cpkidsvisible" value="2" <?php if($cpkidsvisible < "1") echo "checked=checked; "; ?>>Disabled<br />
Couch Kids Port: <input type="text" value="<?php echo $cpkids ?>" name="cpkids" /><br />
Couch Kids Name: <input type="text" value="<?php echo $cpkidsname ?>" name="cpkidsname" /><br />
Couch Kids Pic: <input type="text" value="<?php echo $cpkidspicname ?>" name="cpkidspicname" /><br />
Couch Kids Pic: <?php
echo '<select name="cpkpic">'."\n".
dropdown_cpk(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_cpk($options_array, $selected = null)
{
global $cpkidspicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $cpkidspicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
<input type="submit" name="submit" value="Update" />
</form>

View File

@ -1,4 +1,24 @@
<?php include '../config.php';?>
<?php
$folder = '../Pic/Upload';
function image_filenames($dir)
{
$handle = @opendir($dir)
or die("I cannot open the directory '<b>$dir</b>' for reading.");
$images = array();
while (false !== ($file = readdir($handle)))
{
if (eregi('\.(jpg|gif|png)$', $file))
{
$images[] = $file;
}
}
closedir($handle);
return $images;
}
?>
<form action="write3.php" method="post">
<div style="width:100%;"> <!-- Main Div -->
@ -6,18 +26,73 @@
FTP Enabled: <input name="ftpvisible" id="id" type="checkbox" <?php if($ftpvisible > "0") echo "checked=checked; "; ?> /><br />
FTP Port: <input type="text" value="<?php echo $ftpport ?>" name="ftpport" /><br />
FTP Name: <input type="text" value="<?php echo $ftpname ?>" name="ftpname" /><br />
FTP Pic: <input type="text" value="<?php echo $ftppicname ?>" name="ftppicname" /><br />
<br />
FTP Pic: <?php
echo '<select name="ftppic">'."\n".
dropdown_ftp(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_ftp($options_array, $selected = null)
{
global $ftppicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $ftppicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Torrent Enabled: <input name="torrentvisible" id="id" type="checkbox" <?php if($torrentvisible > "0") echo "checked=checked; "; ?> /><br />
Torrent Type : <input type="radio" name="torrenttype" value="1" <?php if($torrenttype < "2") echo "checked=checked; "; ?>>uTorrent / <input type="radio" name="torrenttype" value="2" <?php if($torrenttype > "1") echo "checked=checked; "; ?>>Transmission<br />
Torrent Port: <input type="text" value="<?php echo $torrentport ?>" name="torrentport" /><br />
Torrent Name: <input type="text" value="<?php echo $torrentname ?>" name="torrentname" /><br />
Torrent Pic: <input type="text" value="<?php echo $torrentpicname ?>" name="torrentpicname" /><br />
<br />
Torrent Pic: <?php
echo '<select name="torrentpic">'."\n".
dropdown_torrent(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_torrent($options_array, $selected = null)
{
global $torrentpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $torrentpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Madsonic Enabled: <input name="madsonicvisible" id="id" type="checkbox" <?php if($madsonicvisible > "0") echo "checked=checked; "; ?> /><br />
Madsonic Port: <input type="text" value="<?php echo $madsonicport ?>" name="madsonicport" /><br />
Madsonic Name: <input type="text" value="<?php echo $madsonicname ?>" name="madsonicname" /><br />
Madsonic Pic: <input type="text" value="<?php echo $madsonicpicname ?>" name="madsonicpicname" /><br />
Madsonic Pic: <?php
echo '<select name="madpic">'."\n".
dropdown_mad(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_mad($options_array, $selected = null)
{
global $madsonicpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $madsonicpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
</div>
<div style="float:right; width:50%; ">
@ -25,16 +100,94 @@
Plex Enabled: <input name="plexvisible" id="id" type="checkbox" <?php if($plexvisible > "0") echo "checked=checked; "; ?> /><br />
Plex Port: <input type="text" value="<?php echo $plexport ?>" name="plexport" /><br />
Plex Name: <input type="text" value="<?php echo $plexname ?>" name="plexname" /><br />
Plex Pic: <input type="text" value="<?php echo $plexpicname ?>" name="plexpicname" /><br />
<br />
Squeezebox Enabled: <input name="squeezevisible" id="id" type="checkbox" <?php if($squeezevisible > "0") echo "checked=checked; "; ?> /><br />
Plex Pic: <?php
echo '<select name="plexpic">'."\n".
dropdown_plex(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_plex($options_array, $selected = null)
{
global $plexpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $plexpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Squeezebox Enabled: <input name="squeezevisible" id="id" type="checkbox" <?php if($squeezevisible > "0") echo "checked=checked; "; ?> /><br />
Squeezebox Port: <input type="text" value="<?php echo $squeezeport ?>" name="squeezeport" /><br />
Squeezebox Name: <input type="text" value="<?php echo $squeezename ?>" name="squeezename" /><br />
Squeezebox Pic: <input type="text" value="<?php echo $squeezepicname ?>" name="squeezepicname" /><br />
<br />
Jdownloader Enabled: <input name="jdownloadervisible" id="id" type="checkbox" <?php if($jdownloadervisible > "0") echo "checked=checked; "; ?> /><br />
Squeezebox Pic: <?php
echo '<select name="squeezepic">'."\n".
dropdown_squeeze(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_squeeze($options_array, $selected = null)
{
global $squeezepicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $squeezepicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
Jdownloader Enabled: <input name="jdownloadervisible" id="id" type="checkbox" <?php if($jdownloadervisible > "0") echo "checked=checked; "; ?> /><br />
Jdownloader Name: <input type="text" value="<?php echo $jdownloadername ?>" name="jdownloadername" /><br />
Jdownloader Pic: <input type="text" value="<?php echo $jdownloaderpicname ?>" name="jdownloaderpicname" /><br />
Jdownloader Pic: <?php
echo '<select name="jdpic">'."\n".
dropdown_jd(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_jd($options_array, $selected = null)
{
global $jdownloaderpicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $jdownloaderpicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
HeadPhones Enabled: <input name="headphonesvisible" id="id" type="checkbox" <?php if($headvisible > "0") echo "checked=checked; "; ?> /><br />
HeadPhones Port: <input type="text" value="<?php echo $headport ?>" name="headport" /><br />
HeadPhones Name: <input type="text" value="<?php echo $headname ?>" name="headphonesname" /><br />
HeadPhones Pic: <?php
echo '<select name="headpic">'."\n".
dropdown_head(image_filenames($folder), @$_POST['image2']).
'</select>'."\n".'</br></br>';
function dropdown_head($options_array, $selected = null)
{
global $headphonespicname;
$return = null;
foreach($options_array as $option)
{
$return .= '<option value="'.$option.'"'.
(($option == $headphonespicname) ? ' selected="selected"' : null ).
'>'.$option.'</option>'."\n";
}
return $return;
}
?>
<br />
</div>

View File

@ -1,5 +1,5 @@
<?php
$target_dir = "../Pic/";
$target_dir = "../Pic/Upload/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);

View File

@ -6,16 +6,16 @@ $sabpicname1 = $_POST['sabpic'];
$sickvis1 = $_POST['sickvisible'];
$sicktype1 = $_POST['sicktype'];
$sickname1 = $_POST['sickname'];
$sickpicname1 = $_POST['sickpicname'];
$sickpicname1 = $_POST['sickpic'];
$sickport1 = $_POST['sickport'];
$couchvisible1 = $_POST['couchvisible'];
$cpadultsvisible1 = $_POST['cpadultsvisible'];
$cpadultsname1 = $_POST['cpadultsname'];
$cpadultspicname1 = $_POST['cpadultspicname'];
$cpadultspicname1 = $_POST['cpapic'];
$cpadults1 = $_POST['cpadults'];
$cpkidsvisible1 = $_POST['cpkidsvisible'];
$cpkidsname1 = $_POST['cpkidsname'];
$cpkidspicname1 = $_POST['cpkidspicname'];
$cpkidspicname1 = $_POST['cpkpic'];
$cpkids1 = $_POST['cpkids'];
//
$fl='../config.php';

View File

@ -23,6 +23,10 @@ $squeezeport1 = $_POST['squeezeport'];
$jdownloadervisible1 = $_POST['jdownloadervisible'];
$jdownloadername1 = $_POST['$jdownloadername'];
$jdownloaderpicname1 = $_POST['jdownloaderpicname'];
$headvisible1 = $_POST['headphonesvisible'];
$headname1 = $_POST['$headphonesname'];
$headpicname1 = $_POST['headpic'];
$headport1 = $_POST['headport'];
@ -107,6 +111,18 @@ if (empty($jdownloadervisible1)) {
$content = preg_replace( '/\$jdownloadername = \"(.*?)\";/', '$jdownloadername = "'.$jdownloadername1.'";', $content);
$content = preg_replace( '/\$jdownloaderpicname = \"(.*?)\";/', '$jdownloaderpicname = "'.$jdownloaderpicname1.'";', $content);
// End of Squeeze Settigns
// HeadPhones Settings
// HeadPhones Visible Update
if (empty($headvisible1)) {
$content = preg_replace( '/\$headvisible = \"(.*?)\";/', '$headvisible = "0";', $content);
} else {
$content = preg_replace( '/\$headvisible = \"(.*?)\";/', '$headvisible = "1";', $content);
}
$content = preg_replace( '/\$headport = \"(.*?)\";/', '$headport = "'.$headport1.'";', $content);
$content = preg_replace( '/\$headname = \"(.*?)\";/', '$headname = "'.$headname1.'";', $content);
$content = preg_replace( '/\$headpicname = \"(.*?)\";/', '$headpicname = "'.$headpicname1.'";', $content);
// End of HeadPhones Settigns
/*write operation ->*/ $tmp =fopen($fl, "w"); fwrite($tmp, $content); fclose($tmp);

View File

@ -4,7 +4,7 @@ if (empty($sabpicname)) {
echo "<li id=\"li3\" data-row=\"1\" data-col=\"4\" data-sizex=\"1\" data-sizey=\"1\"><a href=\"$myurl:$sabport\" target=\"_blank\"><img src=\"$myurl/Pic/sab.png\" style=\"width: 130px; height: 130px;\"/></a></li>";
}
else {
echo "<li id=\"li3\" data-row=\"1\" data-col=\"4\" data-sizex=\"1\" data-sizey=\"1\"><a href=\"$myurl:$sabport\" target=\"_blank\"><img src=\"$myurl/Pic/$sabpicname\" style=\"width: 130px; height: 130px;\"/></a></li>";
echo "<li id=\"li3\" data-row=\"1\" data-col=\"4\" data-sizex=\"1\" data-sizey=\"1\"><a href=\"$myurl:$sabport\" target=\"_blank\"><img src=\"$myurl/Pic/Upload/$sabpicname\" style=\"width: 130px; height: 130px;\"/></a></li>";
}
?>