Esempio n. 1
0
			</form>
		</div>
	</div>

<?php 
} else {
    ?>
	<div class="content">	
		<div class="content-header">
			<h4><a href="?p=admin">Main Menu</a> / Vote Links</h4>
		</div> <!-- .content-header -->				
		<div class="main-content">
			<?php 
    if (isset($_POST['action'])) {
        if ($_POST['action'] == 'addSite') {
            addSite();
        }
    }
    ?>
			<form method="POST" action="?p=admin&sub=vote&addlink=true" class="form label-inline">
			<input type="hidden" name="action" value="update">
				<h5><center>List of Vote Sites</center></h5><br />
				<table>
					<thead>
						<th><center><b><?php 
    echo $lang['hostname'];
    ?>
</center></b></th>
						<th><center><b><?php 
    echo $lang['image'];
    ?>
Esempio n. 2
0
}
if (isset($_GET['comment'])) {
    $json = $_GET['comment'];
    addComment($json, $dbh);
}
if (isset($_GET['challange'])) {
    $json = $_GET['challange'];
    addChallange($json, $dbh);
}
if (isset($_GET['chComment'])) {
    $json = $_GET['chComment'];
    addChComment($json, $dbh);
}
if (isset($_GET['site'])) {
    $json = $_GET['site'];
    addSite($json, $dbh);
} else {
}
function addKit($json, $db)
{
    $array = split(',', $json);
    $ins = "insert into Kit (image, brand, model, item, date, userId) \n        values ('{$array['0']}', '{$array['1']}', '{$array['2']}', '{$array['3']}', '{$array['4']}','{$array['5']}');" or die(print_r($dbh->errorInfo(), true));
    $db->query($ins);
}
function addLog($json, $db)
{
    $array = split(',', $json);
    $ins = "insert into Logs (diveNo, date, depth, timeIn, duration, visibility, PG, location, \n            buddy, comments, diveProfile, userID) values ('{$array['0']}', '{$array['1']}', '{$array['2']}', '{$array['3']}',\n                 '{$array['4']}','{$array['5']}','{$array['6']}','{$array['7']}', '{$array['8']}','{$array['9']}','{$array['10']}',\n                    '{$array['11']}');" or die(print_r($dbh->errorInfo(), true));
    $db->query($ins);
}
function addComment($json, $db)
Esempio n. 3
0
    addKit($values, $dbh);
}
if ($type == 'log') {
    addLog($values, $dbh);
}
if ($type == 'comment') {
    addComment($values, $dbh);
}
if ($type == 'challange') {
    addChallange($values, $dbh);
}
if ($type == 'chComment') {
    addChComment($values, $dbh);
}
if ($type == 'site') {
    addSite($values, $dbh);
}
if ($type == 'like') {
    like($values, $dbh);
}
function addKit($json, $db)
{
    $ins = $db->prepare("insert into Kit (image, brand, model, item, date, userId) \n        values (?, ?, ?, ?, ?, ?);") or die(print_r($dbh->errorInfo(), true));
    $ins->bindParam(1, $json[0]);
    $ins->bindParam(2, $json[1]);
    $ins->bindParam(3, $json[2]);
    $ins->bindParam(4, $json[3]);
    $ins->bindParam(5, $json[4]);
    $ins->bindParam(6, $json[5]);
    $ins->execute();
}
Esempio n. 4
0
                }
            }
        } else {
            // We get A LOT of requests to add deep pages (eg, "http://www.youtube.com/blahblah").
            // But we only allow one page per hostname if the URL is not in the list of top sites.
            // Here we check if this is a deep URL.
            $rooturl = substr($gRurl, 0, strpos($gRurl, "/", 10));
            $rooturlObj = getUrl($rooturl, true);
            if ($rooturlObj) {
                echo "<p class=warning>{$gRurl} will not be added because <a href='{$rooturlObj['url']}'>{$rooturlObj['url']}</a> is already in the crawl. If a URL is not in the list of <a href='about.php#listofurls'>top URLs</a> it can only be added if there are no other URLs with the same hostname already in the crawl.</p>\n";
            } else {
                $bAdd = true;
            }
        }
        if ($bAdd) {
            addSite($gRurl);
            // queue it for adding
            echo "<p class=warning>{$gRurl} will be added within five business days and will be included in the next crawl after that.</p>\n";
        }
    }
}
?>


<h1><?php 
echo $gTitle;
?>
</h1>

<script type="text/javascript">
function confirmAdd() {