Updated some codes on back-end and front-end of steemauto.com
By these changes, curation trail page changed and now looks better.
Search function added and you can share your trail's link. On that page, users will be able to follow, unfollow or change settings.
Also, I will update fanbase and posting page as soon as I can.
BTW. you don't need to understand these codes.
Commit link: Added search function, added pages buttons to the buttom of table and configured list to display by pages, added page for each searched trail, added follow, unfollow and settings button to that page, changed links of trails and ... .
Some codes of search function:
...
...
<div class="content">
<? if($searchtrail == 1){ ?>
<div class="row" style="margin:0 !important">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="card">
<div class="content">
<h3>Searching for trail: </h3><br>
<?
$stmt = $conn->prepare("SELECT EXISTS(SELECT * FROM `trailers` WHERE `user`=?)");
$searchedtrail = $_GET['trail'];
$stmt->bind_param('s', $searchedtrail);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
foreach($row as $exists){}
if($exists == 1){
$stmt = $conn->prepare("SELECT * FROM `trailers` WHERE `user`=?");
$stmt->bind_param('s', $searchedtrail);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$resultt = $conn->query("SELECT EXISTS(SELECT * FROM `followers` WHERE `follower` = '$name' AND `trailer`='$searchedtrail')");
foreach($resultt as $y){
foreach($y as $y){}
}
if($y == 1){
$alreadyfollowed = 1;
}else{
$alreadyfollowed = 0;
}
?>
<strong>Trail name:</strong> </span><br>
<strong>Description:</strong> </span><br>
<strong>Followers:</strong> (dash.php?i=15&id=1&user=<? echo htmlspecialchars($searchedtrail); ?>">Show enable followers)
if(confirm('Are you sure?')){unfollow('<? echo $row['user']; ?>');};" class="btn btn-danger">UNFOLLOW
showset('1');" class="btn btn-primary">Settings
query("SELECT * FROM `followers` WHERE `follower` = '$name' AND `trailer`='$searchedtrail'");
foreach($resultt as $n){}
?>
row" style="margin:0 !important;">
text-align:left; display:none; padding:20px;" id="set1" class="col-md-12">
settings('<? echo $row['user']; ?>'); return false;">
Settings for Trailer: https://steemit.com/@" target="_blank">@
<div id="setweight" <? if($n['fcurator'] == 1){echo 'style="display:none;"';} ?>><label>Weight: Default Weight is 100%. leave it empty to be default.</label>
<input id="weight" placeholder="Voting Weight" name="weight" type="number" class="form-control" value="" step="0.01" min="0" max="100">
</div>
<li style="margin-top:5px; margin-bottom:5px;" class="list-group-item">
Follow Curator Weight:
<div class="material-switch pull-right">
<input id="fcurator" name="fcurator" class="fcurator" type="checkbox" <? if($n['fcurator'] == 1){echo 'checked';} ?>/>
<label for="fcurator" id="fcurator1" class="label-primary"></label>
</div>
</li>
<label>Time to wait before voting. Default Time is 0 minutes.</label>
<input id="aftermin" value="" placeholder="Upvoting After X Minutes." name="aftermin" type="number" class="form-control" step="1" min="0" max="30">
<li style="margin-top:5px; margin-bottom:5px;" class="list-group-item">
Enabled:
<div class="material-switch pull-right">
<input id="enable" name="enable" class="enable" type="checkbox" <? if($n['enable'] == 1){echo 'checked';} ?>/>
<label for="enable" id="enable" class="label-success"></label>
</div>
</li>
<input style="margin-top:10px;"value="Save Settings" type="submit" class="btn btn-primary">
</form>
</div>
</div>
<script>
$(document).ready(function() {
if(document.getElementById('fcurator<? echo $row['user']; ?>').checked){
$('#setweight<? echo $row['user']; ?>').hide(500);
}else{
$('#setweight<? echo $row['user']; ?>').show(500);
}
$('#fcurator<? echo $row['user']; ?>').change(function() {
if(document.getElementById('fcurator<? echo $row['user']; ?>').checked){
$('#setweight<? echo $row['user']; ?>').hide(500);
}else{
$('#setweight<? echo $row['user']; ?>').show(500);
}
});
});
</script>
<? }else{ ?>
<button onclick="if(confirm('Are you sure?')){follow('');};" class="btn btn-primary">FOLLOW</button>
<? } ?>
<?
}else{ ?>
<p style="color:red;">Can't find. That Trail should register on steemauto and become a trail.</p>
<?
}
?>
</div>