Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty totally removed + some logic changes and optimizations #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions adm/_notes/dwsync.xml

This file was deleted.

70 changes: 34 additions & 36 deletions adm/ads.php
Original file line number Diff line number Diff line change
@@ -1,75 +1,73 @@
<?php
require_once "header.php";
if(isset($_POST['save'])){
$fp = fopen('../ads/left.php',"w");
fwrite($fp,$_POST['left']);
$ads_left=explode("\n",$_POST['left']);
$ads_main_top=explode("\n",$_POST['top']);
$ads_right=explode("\n",$_POST['right']);
$ads_1=explode("\n",$_POST['ad1']);
$ads_2=explode("\n",$_POST['ad2']);
$ads_3=explode("\n",$_POST['ad3']);
$ads_main_bottom=explode("\n",$_POST['bottom']);
$content = "<?php
\$ads_left=".var_export($ads_left,true).";
\$ads_left_count=".count($ads_left).";
\$ads_main_top=".var_export($ads_main_top,true).";
\$ads_main_top_count=".count($ads_main_top).";
\$ads_right=".var_export($ads_right,true).";
\$ads_right_count=".count($ads_right).";
\$ads_1=".var_export($ads_1,true).";
\$ads_1_count=".count($ads_1).";
\$ads_2=".var_export($ads_2,true).";
\$ads_2_count=".count($ads_2).";
\$ads_3=".var_export($ads_3,true).";
\$ads_3_count=".count($ads_3).";
\$ads_main_bottom=".var_export($ads_main_bottom,true).";
\$ads_main_bottom_count=".count($ads_main_bottom).";
";
$fp = fopen('../configs/ads.php',"w");
fwrite($fp,$content);
fclose($fp);

$fp = fopen('../ads/top.php',"w");
fwrite($fp,$_POST['top']);
fclose($fp);

$fp = fopen('../ads/right.php',"w");
fwrite($fp,$_POST['right']);
fclose($fp);

$fp = fopen('../ads/ad1.php',"w");
fwrite($fp,$_POST['ad1']);
fclose($fp);

$fp = fopen('../ads/ad2.php',"w");
fwrite($fp,$_POST['ad2']);
fclose($fp);

$fp = fopen('../ads/ad3.php',"w");
fwrite($fp,$_POST['ad3']);
fclose($fp);

$fp = fopen('../ads/bottom.php',"w");
fwrite($fp,$_POST['bottom']);
fclose($fp);
header('Location: ads.php');
}else{
}else include "../configs/ads.php";
?>
<form method="post">
<Div class="row">
<div class="form-group">
<label for="exampleInputEmail1">Left</label>
<textarea name="left" class="form-control" rows="10"><?php echo file_get_contents('../ads/left.php');?></textarea>
<textarea name="left" class="form-control" rows="10"><?php echo implode("\n",$ads_left);?></textarea>
</div>

<div class="form-group">
<label for="exampleInputEmail1">Top</label>
<textarea name="top" class="form-control" rows="10"><?php echo file_get_contents('../ads/top.php');?></textarea>
<textarea name="top" class="form-control" rows="10"><?php echo implode("\n",$ads_main_top);?></textarea>
</div>


<div class="form-group">
<label for="exampleInputEmail1">Right</label>
<textarea name="right" class="form-control" rows="10"><?php echo file_get_contents('../ads/right.php');?></textarea>
<textarea name="right" class="form-control" rows="10"><?php echo implode("\n",$ads_right);?></textarea>
</div>

<div class="form-group">
<label for="exampleInputEmail1">Ad1</label>
<textarea name="ad1" class="form-control" rows="10"><?php echo file_get_contents('../ads/ad1.php');?></textarea>
<textarea name="ad1" class="form-control" rows="10"><?php echo implode("\n",$ads_1);?></textarea>
</div>

<div class="form-group">
<label for="exampleInputEmail1">Ad2</label>
<textarea name="ad2" class="form-control" rows="10"><?php echo file_get_contents('../ads/ad2.php');?></textarea>
<textarea name="ad2" class="form-control" rows="10"><?php echo implode("\n",$ads_2);?></textarea>
</div>

<div class="form-group">
<label for="exampleInputEmail1">Ad3</label>
<textarea name="ad3" class="form-control" rows="10"><?php echo file_get_contents('../ads/ad3.php');?></textarea>
<textarea name="ad3" class="form-control" rows="10"><?php echo implode("\n",$ads_3);?></textarea>
</div>

<div class="form-group">
<label for="exampleInputEmail1">Bottom</label>
<textarea name="bottom" class="form-control" rows="10"><?php echo file_get_contents('../ads/bottom.php');?></textarea>
<textarea name="bottom" class="form-control" rows="10"><?php echo implode("\n",$ads_main_bottom);?></textarea>
</div>
<button type="submit" name="save" class="btn btn-success col-md-3 col-md-push-4">Save</button>
</Div>
</form><br>

<?php }include("footer.php") ?>
<?php include("footer.php") ?>
11 changes: 4 additions & 7 deletions adm/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@
$_SESSION['admin_loged']=true;
header('Location: index.php');
die();
}else{
header('Location: login.php?error=1');
die();
}
}else{
}else $error = true;
}
?>
<form action="" method="post">
<Div class="col-md-6 col-md-push-3">
<?php if(isset($_GET ['out'])){ ?>
<div class="row"><div class="alert alert-success">Logout was successful</div></div>
<?php }else if(isset($_GET['error'])){ ?><br><br>
<?php }else if(isset($error)){ ?><br><br>
<div class="row"><div class="alert alert-danger">Login failed</div></div>
<?php } ?>

Expand All @@ -32,4 +29,4 @@
</div>
</Div>
</form>
<?php }require_once('footer.php'); ?>
<?php require_once('footer.php'); ?>
Loading