Esempio n. 1
0
" />
		<link href="<?php 
echo THEME_PATH;
?>
/style.css" type="text/css" rel="stylesheet" />
		<link href="<?php 
echo THEME_PATH;
?>
/favicon.ico" type="x-image/ico" rel="icon" />
		<link href="<?php 
echo THEME_PATH;
?>
/favicon.ico" type="x-image/ico" rel="shortcut icon" />
		
<?php 
checkpoint('html_header');
planetoid_feed();
link_feeds();
?>
	</head>
	<body>
		<div id="header">
			<h1><a href="<?php 
echo get_home_link();
?>
"><?php 
echo get_title();
?>
</a></h1>
		</div>
		<div id="top-bar">
Esempio n. 2
0
function list_articles($build = false)
{
    $list_articles_ch = CACHE_DIR . '/list_articles.spc';
    if (is_cached($list_articles_ch)) {
        return get_cache($list_articles_ch);
    } else {
        global $feeds;
        $feed = array(count($feeds));
        $articles = array();
        // 		$date_format= sql_escape("date_format");
        for ($n = 0; $n < count($feeds); $n++) {
            $feed[$n] = new SimplePie();
            $feed[$n]->strip_ads(true);
            $feed[$n]->remove_div();
            $feed[$n]->feed_url($feeds[$n]);
            $feed[$n]->init();
            $link = $feed[$n]->get_feed_link();
            $avatar = sql_action("SELECT avatar FROM feeds WHERE url='{$feeds[$n]}';");
            $avatar = $avatar['avatar'];
            if ($feed[$n]->data) {
                foreach ($feed[$n]->get_items() as $item) {
                    $key = $item->get_date('U');
                    $author_q = $item->get_author();
                    $match = false;
                    if ($author_q) {
                        $author = $author_q->get_name();
                    } else {
                        $author = $link;
                    }
                    $title = $item->get_title();
                    $content = $item->get_description();
                    $title_regexp = get_setting_value('title_regexp');
                    $content_regexp = get_setting_value('content_regexp');
                    if (strlen($title_regexp) == 0 && strlen($content_regexp) == 0) {
                        $match = true;
                    } else {
                        if (strlen($title_regexp) != 0) {
                            $title_match = preg_match($title_regexp, $title);
                        } else {
                            $title_match = false;
                        }
                        if (strlen($content_regexp) != 0) {
                            $content_match = preg_match($content_regexp, $content);
                        } else {
                            $content_match = false;
                        }
                        if ($title_match || $content_match) {
                            $match = true;
                        }
                    }
                    if ($match) {
                        $articles[$key] = array('title' => $item->get_title(), 'author' => $author, 'permalink' => htmlspecialchars($item->get_permalink()), 'description' => $content, 'timestamp' => $key, 'post_time' => $item->get_date("j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> M Y"), 'avatar_url' => $avatar);
                        /* Call plugins that are attached to "article" */
                        $articles[$key]['plugin_data'] = checkpoint('article', $articles[$key]);
                    }
                }
            }
        }
        /* Articles are stored in $articles with their publish timestamp as key */
        /* so that they can be sorted by post time (ksort()). */
        /* Then the keys is replaced with numbers (0 - articles length)  */
        /* And splice()d to length defined in settings */
        ksort($articles);
        $articles = array_reverse($articles, false);
        $article_limit = intval(get_setting_value('posts_num'));
        if ($article_limit != 0) {
            array_splice($articles, $article_limit);
        }
        cache($articles, $list_articles_ch);
        return $articles;
    }
}
Esempio n. 3
0
function checkpoint($html)
{
    $form_action = parse_action($html);
    $inputs = parse_inputs($html);
    $post_params = "";
    foreach ($inputs as $input) {
        switch ($input->getAttribute('name')) {
            case "":
                break;
            case "submit[I don't recognize]":
                break;
            case "submit[Don't Save]":
                break;
            case "machine_name":
                $post_params .= 'machine_name=' . urlencode($GLOBALS['device_name']) . '&';
                break;
            default:
                $post_params .= $input->getAttribute('name') . '=' . urlencode($input->getAttribute('value')) . '&';
        }
    }
    if ($GLOBALS['debug']) {
        echo "\nCheckpoint form action: {$form_action}\n";
        echo "\nCheckpoint post params: {$post_params}\n";
    }
    //Verify the machine
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_COOKIEJAR, $GLOBALS['cookies']);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $GLOBALS['cookies']);
    curl_setopt($ch, CURLOPT_USERAGENT, $GLOBALS['uagent']);
    curl_setopt($ch, CURLOPT_URL, $form_action);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
    $home = curl_exec($ch);
    if ($GLOBALS['debug']) {
        echo "This is f*****g shit: -- {$home} --";
    }
    curl_close($ch);
    if (strpos($home, "machine_name") || strpos($home, "/checkpoint/") || strpos($home, "submit[Continue]")) {
        echo "\n[i] Solving another checkpoint...\n";
        checkpoint($home);
    }
}
Esempio n. 4
0
    define('MOBILE', false);
}
ob_start();
require_once 'inc/simplepie/idn/idna_convert.class.php';
require_once 'inc/simplepie/simplepie.inc';
require_once 'config.php';
require_once 'planetoid.php';
$plugins = list_active_plugins();
for ($p = 0; $p < count($plugins); $p++) {
    $plugin_load_file = plugin_load_file($plugins[$p]);
    if (file_exists($plugin_load_file)) {
        include $plugin_load_file;
    }
}
checkpoint('header');
if (!MOBILE) {
    define('THEME_PATH', 'inc/themes/' . get_setting_value('theme_dir_name'));
    include THEME_PATH . '/index.php';
} else {
    checkpoint('header.mobile');
    if (isset($_GET['p'])) {
        $page = intval($_GET['p']);
    } else {
        $page = 1;
    }
    include 'inc/themes/mobile/index.php';
    checkpoint('footer.mobile');
}
checkpoint('footer');
sql_close();
ob_flush();