예제 #1
0
    if (is_numeric($request->ID) || $request->ID == "profile") {
        $_GET['part'] = $request->page;
        $_GET['id'] = $request->ID;
        makeSource("profile");
        $GLOBALS['itsMyPage'] = true;
    }
});
$router->respond("/chat?/[i:id]?", function ($request, $response) {
    idPage("chat", $request);
});
$router->respond("/view?/[i:id]?", function ($request, $response) {
    idPage("view", $request);
});
$router->respond("/search/?[**:query]?", function ($request, $response) {
    if ($_SERVER['REDIRECT_URL'] == "/search" && isset($_GET['q'])) {
        $encodedQuery = Open::encodeQuery($_GET['q']);
        $url = Open::URL("/search/{$encodedQuery}");
        $response->redirect($url);
    } else {
        $_GET['q'] = $request->query;
        makeSource("search");
    }
    $GLOBALS['itsMyPage'] = true;
});
$router->respond("/data/?[**:path]?", function ($request, $response) {
    $_GET['request'] = $request->path;
    makeSource("data/handle");
    $GLOBALS['itsMyPage'] = true;
});
/* END - Dynamic Pages */
$router->respond("/css/[**:files]", function ($request, $response) use($docRoot) {
예제 #2
0
<?php

$LS->init();
$_GET['q'] = isset($_GET['q']) ? Open::encodeQuery($_GET['q'], true) : "";
$searchQuery = $OP->format($_GET['q']);
if ($searchQuery != '') {
    $sql = $OP->dbh->prepare("UPDATE `trend` SET `hits` = `hits` + 1 WHERE `title` = ?");
    $sql->execute(array($_GET['q']));
    if ($sql->rowCount() == 0) {
        $sql = $OP->dbh->prepare("INSERT INTO `trend` (`title`, `hits`) VALUES(?, '1')");
        $sql->execute(array($_GET['q']));
    }
}
?>
<!DOCTYPE html>
<html>
	<head>
		<meta name="type" value="search"></meta>
		<?php 
$OP->head("Search", "ac,post_form,home,time,gadget", "ac,home,post_form,gadget");
?>
	</head>
	<body>
		<?php 
include "{$docRoot}/inc/header.php";
?>
		<div class="content blocks">
			<div class="block left viewpoint">
				<form action="<?php 
echo Open::URL('search');
?>
예제 #3
0
<div style="padding: 0px 15px;margin: 0px -10px 0px -15px;">
	<font size="5" style="color:#74ACE9;background: url(<?php 
echo HOST;
?>
/cdn/img/up.png);background-position: left;background-size: 22px;background-repeat: no-repeat;padding-left: 28px;">Trending</font>
	<div style="padding-left:10px;margin-top:10px;color:black;">
		<?php 
$sql = $OP->dbh->query("SELECT * FROM `trend` ORDER BY `hits` DESC LIMIT 9");
foreach ($sql as $trend) {
    $title = $OP->format($trend['title']);
    $url = Open::URL("search/" . Open::encodeQuery($trend['title']));
    $extra = strlen($title) >= 25 ? "..." : "";
    $sTitle = str_split($title, 25);
    $sTitle = $sTitle[0] . $extra;
    echo '<div style="padding:1px;margin-bottom: 5px;">';
    echo '<a href="' . $url . '" title="' . $title . '">' . $sTitle . '</a>';
    echo "</div>";
}
$OP->dbh->query("DELETE FROM `trend` WHERE `hits` = (SELECT MIN(`hits`) FROM (SELECT * FROM `trend` HAVING COUNT(`hits`) > 150) x);");
?>
	</div>
</div>
<div style="background:#FAB359;border-radius: 10px;text-align:center;padding:5px;margin:5px 0px 0px 0px;">
	<a href="invite">Invite your Friends</a>
</div>