Permalink
Browse files

Update to make things work on not just the server.

Signed-off-by: Neo Melonas <neo@neomelonas.com>
  • Loading branch information...
1 parent 5c10f66 commit a716971be990615a061df25df323086cb7ddb2d1 @neomelonas committed Mar 15, 2010
Showing with 104 additions and 106 deletions.
  1. +5 −4 .htaccess
  2. +2 −2 conf/settings.php
  3. +89 −94 index.php
  4. +2 −0 lib/css/ministyle.css
  5. +6 −6 mini.php
View
@@ -1,8 +1,9 @@
RewriteEngine On
# For the Mini News Feed Digest
-RewriteCond %{REQUEST_URI} ^/mini/? [NC]
-RewriteRule ^/mini/([^/d]+)/?$ /?type=$1 [L]
+RewriteBase /NewsDigest
+
+RewriteRule ^mini/$ mini.php [L]
+RewriteRule ^mini/([^/d]+)/?$ mini.php?type=$1 [L]
# For the normal News Feed Digest
-RewriteCond %{REQUEST_URI} ^/? [NC]
-RewriteRule ^([^/.]+)/?$ /?type=$1 [L]
+RewriteRule ^([^/.]+)/?$ index.php?type=$1 [L]
View
@@ -1,11 +1,11 @@
<?php
// Set the install directory.
// NO TRAILING SLASH
- $install = "/home/digest";
+ $install = "D:/Server/xampp/htdocs/NewsDigest/";
// If it is installed at the root of a (sub)domain, just put a "/", otherwise,
// enter the directory of the URL after the http://example.com/
//
- $uriPath = "/";
+ $uriPath = "/NewsDigest/";
/*/
// A list of stocks for the SparkLines
View
183 index.php
@@ -1,102 +1,97 @@
<?php
- // This should be set to the full path
- require ('conf/settings.php');
+ // This should be set to the full path
+ require ('conf/settings.php');
- require_once ($install.'/lib/php/simplepie.inc');
- //require_once ($install.'/lib/php/sparkline/Sparkline_Line.php');
- include ($install.'/lib/php/functions.php');
+ require_once ($install.'lib/php/simplepie.inc');
+ //require_once ($install.'/lib/php/sparkline/Sparkline_Line.php');
+ include ($install.'lib/php/functions.php');
- if (isset($_GET['type']))
- { $newsType = $_GET['type']; }
- else { $newsType = null; }
- include ($install.'/lib/php/feeds.php');
- $memuse = number_format(memory_get_usage());
+ if (isset($_GET['type']))
+ { $newsType = $_GET['type']; }
+ else { $newsType = null; }
+ include ($install.'lib/php/feeds.php');
+ $memuse = number_format(memory_get_usage());
?>
<!doctype html>
<html>
- <head>
- <title><?php echo $plug; ?> &lt; Feed Digest | neomelonas.com</title>
- <link rel="stylesheet" type="text/css" href="<?php echo $uriPath; ?>lib/css/newstyle.css" />
- <!--[if IE]>
- <link rel="stylesheet" type="text/css" href="<?php echo $uriPath; ?>lib/css/iestyle.css" />
- <![endif]-->
- <link rel="shortcut icon" href="<?php echo $uriPath; ?>lib/img/favicon.ico" type="image/x-icon" />
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <meta http-equiv="content-language" content="en" />
- <meta name="description" content="A digest of popular newsfeeds.." />
- <meta name="google-site-verification" content="uZPoUBJX2p8Ll-FXaXPhWgd7jw9wOp26HLbTONRYBWA" /><!--
-Specific to THIS site. /-->
- </head>
+ <head>
+ <title><?php echo $plug; ?> &lt; Feed Digest | neomelonas.com</title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $uriPath; ?>lib/css/newstyle.css" />
+ <!--[if IE]>
+ <link rel="stylesheet" type="text/css" href="<?php echo $uriPath; ?>lib/css/iestyle.css" />
+ <![endif]-->
+ <link rel="shortcut icon" href="<?php echo $uriPath; ?>lib/img/favicon.ico" type="image/x-icon" />
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="content-language" content="en" />
+ <meta name="description" content="A digest of popular newsfeeds.." />
+ <meta name="google-site-verification" content="uZPoUBJX2p8Ll-FXaXPhWgd7jw9wOp26HLbTONRYBWA" /><!-- Specific to THIS site. /-->
+ </head>
<body>
- <div id="footbar">
- <nav><div class="nav">
- <ul>
- <li><a href="<?php echo $uriPath; ?>">Main</a></li>
- <li><a href="<?php echo $uriPath; ?>business/">Business</a></li>
- <li><a href="<?php echo $uriPath; ?>politics/">Politics</a></li>
- <li><a href="<?php echo $uriPath; ?>tech/">Technology</a></li>
- <li><a href="<?php echo $uriPath; ?>sports/">Sports</a></li>
- <li><a href="<?php echo $uriPath; ?>entertainment">Entertainment</a></li>
- <li><a href="#top" class="backup">&uarr; Top</a></li>
- </ul>
- </div></nav>
- </div>
- <div id="container">
- <a id="top"></a>
- <div id="header">
- <h1 class="title"><?php echo $plug; ?> Feed Digest</h1>
- <nav>
- <div class="nav">
- <ul>
- <li><a href="<?php echo $uriPath; ?>">Main</a></li>
- <li><a href="<?php echo $uriPath; ?>business/">Business</a></li>
- <li><a href="<?php echo $uriPath; ?>politics/">Politics</a></li>
- <li><a href="<?php echo $uriPath; ?>tech/">Technology</a></li>
- <li><a href="<?php echo $uriPath; ?>sports/">Sports</a></li>
- <li><a href="<?php echo $uriPath; ?>entertainment">Entertainment</a></li>
- </ul>
- </div>
- </nav>
- <div id="charts"></div>
- <hr />
- </div>
- <div id="body">
- <section class="news">
- <?php
- foreach ($feed->get_items() as $item)
- {
- $feeds = $item->get_feed();
- echo '<article><a href="'. $item->get_permalink() .'">'.
-$item->get_title() .'</a>&nbsp;<a href="'.$feeds->get_permalink().'"><img src="'. $feeds->get_favicon() .'"
-alt="'.$feeds->get_title().'" title="'.$feeds->get_title().'" border="0" width="16" height="16" /></a>';
- echo '<p>'. $item->get_description() .'</p>';
- echo '<p>'. $item->get_date().' | Source: <a href="'.
-$feeds->get_permalink() .'">'. $feeds->get_title() .'</a></p></article>';
- if ($counter == 10)
- {
- echo '<hr />';
- echo "<aside class='ad'>";
- $counter = 0;
- include ($install.'/lib/js/ads.js');
- echo "<details>ADVERTISEMENT</details>";
- echo "</aside>";
- }
- else
- { $counter = $counter + 1; }
- echo '<hr />';
- }
- ?>
- </section>
- </div>
- <div id="footer">
- <footer>
- <p>Powered by <a href="http://simplepie.org/">SimplePie</a>. Historic stock data
-from <a href="http://finance.yahoo.com/">Yahoo! Finance</a>. Design by <a href="http://neomelonas.com/">Neo
-Melonas</a> &copy;2009.</p>
- <p><?php echo_memory_usage($memdebugz); ?> </p>
- </footer>
- </div>
- </div>
- <?php include_once 'lib/js/ga.js'; ?>
- </body>
+ <div id="footbar">
+ <nav><div class="nav">
+ <ul>
+ <li><a href="<?php echo $uriPath; ?>">Main</a></li>
+ <li><a href="<?php echo $uriPath; ?>business/">Business</a></li>
+ <li><a href="<?php echo $uriPath; ?>politics/">Politics</a></li>
+ <li><a href="<?php echo $uriPath; ?>tech/">Technology</a></li>
+ <li><a href="<?php echo $uriPath; ?>sports/">Sports</a></li>
+ <li><a href="<?php echo $uriPath; ?>entertainment/">Entertainment</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/">Mini Feed</a></li>
+ <li><a href="#top" class="backup">&uarr; Top</a></li>
+ </ul>
+ </div></nav>
+ </div>
+ <div id="container">
+ <a id="top"></a>
+ <div id="header">
+ <h1 class="title"><?php echo $plug; ?> Feed Digest</h1>
+ <nav>
+ <div class="nav">
+ <ul>
+ <li><a href="<?php echo $uriPath; ?>">Main</a></li>
+ <li><a href="<?php echo $uriPath; ?>business/">Business</a></li>
+ <li><a href="<?php echo $uriPath; ?>politics/">Politics</a></li>
+ <li><a href="<?php echo $uriPath; ?>tech/">Technology</a></li>
+ <li><a href="<?php echo $uriPath; ?>sports/">Sports</a></li>
+ <li><a href="<?php echo $uriPath; ?>entertainment">Entertainment</a></li>
+ </ul>
+ </div>
+ </nav>
+ <div id="charts"></div>
+ <hr />
+ </div>
+ <div id="body">
+ <section class="news">
+ <?php
+ foreach ($feed->get_items() as $item)
+ {
+ $feeds = $item->get_feed();
+ echo '<article><a href="'. $item->get_permalink() .'">'. $item->get_title() .'</a>&nbsp;<a href="'.$feeds->get_permalink().'"><img src="'. $feeds->get_favicon() .'" alt="'.$feeds->get_title().'" title="'.$feeds->get_title().'" border="0" width="16" height="16" /></a>';
+ echo '<p>'. $item->get_description() .'</p>';
+ echo '<p>'. $item->get_date().' | Source: <a href="'. $feeds->get_permalink() .'">'. $feeds->get_title() .'</a></p></article>';
+ if ($counter == 10)
+ {
+ echo '<hr />';
+ echo "<aside class='ad'>";
+ $counter = 0;
+ include ($install.'/lib/js/ads.js');
+ echo "<details>ADVERTISEMENT</details>";
+ echo "</aside>";
+ }
+ else
+ { $counter = $counter + 1; }
+ echo '<hr />';
+ }
+ ?>
+ </section>
+ </div>
+ <div id="footer">
+ <footer>
+ <p>Powered by <a href="http://simplepie.org/">SimplePie</a>. Historic stock data from <a href="http://finance.yahoo.com/">Yahoo! Finance</a>. Design by <a href="http://neomelonas.com/">Neo Melonas</a> &copy;2009.</p>
+ <p><?php echo_memory_usage($memdebugz); ?> </p>
+ </footer>
+ </div>
+ </div>
+ <?php include_once 'lib/js/ga.js'; ?>
+ </body>
</html>
View
@@ -40,3 +40,5 @@ a.title{color:#336699;font-size:1.5em;text-decoration:none;}
}
#footbar ul, #footbar li{padding:6px 6px;margin:0;}
#footbar a{text-decoration:none;}
+
+.backup{float:right;}/*position:fixed;bottom:5px;right:5px;}*/
View
@@ -20,19 +20,19 @@
<nav><div class="nav">
<ul>
<li><a href="<?php echo $uriPath; ?>mini/">Main</a></li>
- <li><a href="<?php echo $uriPath; ?>mini/?type=business">Business</a></li>
- <li><a href="<?php echo $uriPath; ?>mini/?type=politics">Politics</a></li>
- <li><a href="<?php echo $uriPath; ?>mini/?type=tech">Technology</a></li>
- <li><a href="<?php echo $uriPath; ?>mini/?type=sports">Sports</a></li>
- <li><a href="<?php echo $uriPath; ?>mini/?type=entertainment">Entertainment</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/business/">Business</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/politics/">Politics</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/tech/">Technology</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/sports/">Sports</a></li>
+ <li><a href="<?php echo $uriPath; ?>mini/entertainment/">Entertainment</a></li>
+ <li><a href="<?php echo $uriPath; ?>/">Full Feed</a></li>
<li><a href="#top" class="backup">&uarr; Top</a></li>
</ul>
</div></nav>
</div>
<div id="container">
<div id="header">
<h1><?php echo $plug; ?> Mini Feed Digest</h1>
- <p><?php echo $_SERVER['REQUEST_URI']; ?></p>
<hr />
</div>
<div id="body">

0 comments on commit a716971

Please sign in to comment.