<?php if (empty($_GET['url'])) { exit('Hello World!'); } $blog = isset($_GET['blog']) ? $_GET['blog'] : 'unknow'; $content = getContent($_GET['url']); $src = getSrc($content); if ($content && $src) { header('Location: ' . $src, true, 301); //logInfo($src, $blog); if (isset($_GET['forward'])) { file_get_contents("{$_GET['forward']}?{$_SERVER['QUERY_STRING']}"); } } else { //logError($src, $content, $_GET['url'], parseUrl($_GET['url'])); echo 'seems something wrong'; } /** * Parse URL * tumblr has two type of url * first type like http://blabla/digits * second type like http://blabla/digits/blabla * when you can't load content from second type, try first type * * @param $origin string Original URL(second type) * @return mixed */ function parseUrl($origin) { preg_match('<http.+/post/\\d+>', $origin, $new);
</aside> <?php } ?> <?php if ($icons['right']) { ?> <aside class="m2o-nav-right"> <?php foreach ($icons['right'] as $k => $v) { ?> <a class="m2o-nav-icon <?php echo $v; ?> " href="<?php getSrc($v); ?> "></a> <?php } ?> </aside> <?php } ?> <h1 class="m2o-nav-title"><?php echo $title; ?> </h1> </div> </header>