Exemple #1
0
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'linkmobile.php';
include mnminclude . 'commentmobile.php';
include mnminclude . 'html1-mobile.php';
$link = new LinkMobile();
$url_args = $globals['path'];
array_shift($url_args);
// Discard "story"
if (!isset($_REQUEST['id']) && $url_args[0] && !is_numeric($url_args[0])) {
    // Compatibility with story.php?id=x and /story/x
    $link->uri = $db->escape($url_args[0]);
    if (!$link->read('uri')) {
        not_found();
    }
} else {
    if (isset($_REQUEST['id'])) {
        $link->id = intval($_REQUEST['id']);
    } else {
        $link->id = intval($url_args[0]);
    }
    if ($id > 0 && $link->read()) {
        // Redirect to the right URL if the link has a "semantic" uri
        if (!empty($link->uri)) {
            header('HTTP/1.1 301 Moved Permanently');
            header('Location: ' . $link->get_permalink());
            die;
        }
Exemple #2
0
$cat=$_REQUEST['category'];

do_header('Chuza! mobile');
do_tabs('main','published');

$from_where = "FROM links WHERE link_status='published' ";
$order_by = " ORDER BY link_date DESC ";

echo '<div id="newswrap">'."\n";

$link = new LinkMobile;
$rows = $db->get_var("SELECT SQL_CACHE count(*) $from_where");

$links = $db->get_col("SELECT SQL_CACHE link_id $from_where $order_by LIMIT $offset,$page_size");
if ($links) {
	foreach($links as $link_id) {
		$link->id=$link_id;
		$link->read();
		$link->print_summary();
	}
}

do_pages($rows, $page_size);
echo '</div>'."\n";

do_footer();


?>
Exemple #3
0
// The source code packaged with this file is Free Software, Copyright (C) 2008 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'linkmobile.php';
include mnminclude . 'commentmobile.php';
include mnminclude . 'html1-mobile.php';
$link = new LinkMobile();
if (!isset($_REQUEST['id']) && !empty($_SERVER['PATH_INFO'])) {
    $url_args = preg_split('/\\/+/', $_SERVER['PATH_INFO'], 3, PREG_SPLIT_NO_EMPTY);
    $link->uri = $db->escape($url_args[0]);
    if (!$link->read('uri')) {
        not_found();
    }
} else {
    $url_args = preg_split('/\\/+/', $_REQUEST['id']);
    $link->id = intval($url_args[0]);
    if (is_numeric($url_args[0]) && $link->read('id')) {
        // Redirect to the right URL if the link has a "semantic" uri
        if (!empty($link->uri) && !empty($globals['base_story_url'])) {
            if (!empty($url_args[1])) {
                $extra_url = '/' . urlencode($url_args[1]);
            }
            header('Location: ' . $link->get_permalink() . $extra_url);
            die;
        }
    } else {