]> git.mjollnir.org Git - m.o.git/commitdiff
html formatting & moved some stuff into config
authorPenny Leach <penny@hippolyta.local>
Fri, 25 Apr 2008 22:28:44 +0000 (10:28 +1200)
committerPenny Leach <penny@hippolyta.local>
Fri, 25 Apr 2008 22:28:44 +0000 (10:28 +1200)
comp/blog.php
comp/flickr.php
comp/lastfm.php
comp/twitter.php
config-dist.php
include/main.inc
index.php

index dd3932659a88bfd24aa8cb48382f7c790501ba15..97d7cda2dbec8dfa201792f0d34ef25d1c291da7 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 
 function comp_blog() {
-    echo '<h2>latest blog posts</h2>';
+    echo '            <h2>latest blog posts</h2>' ."\n";
     if ($data = parse_rss(get_config('blog_rss'))) {
-        echo '<ul>';
+        echo '            <ul>' . "\n";
         foreach ($data->content as $item) {
-            echo '<li><a href="' . $item->link . '">' . $item->title . '</a></li>';
+            echo '                <li><a href="' . $item->link . '">' . $item->title . '</a></li>' . "\n";;
         }
-        echo '<li class="last"><a href="http://she.geek.nz/"> ... more</a></li>';
-        echo '</ul>';
+        echo '                <li class="last"><a href="' . get_config('blog_url') . '"> ... more</a></li>' . "\n";
+        echo '            </ul>' . "\n";
     }
 }
 
index a0d9595c485d58099b52e10ca28b35eb01cbb2af..329b63998b197c5a7425761947778cadb34069cf 100644 (file)
@@ -12,6 +12,8 @@ function comp_flickr() {
     $photos_url = $f->urls_getUserPhotos($person['id']);
     $photos = $f->people_getPublicPhotos($person['id'], NULL, 9);
 
+    // no nice formatting here, whtespace fucks the browser
+    echo "\n";
     foreach ((array)$photos['photo'] as $photo) {
         echo "<a href=$photos_url$photo[id]>";
         echo "<img border='0' alt='$photo[title]' ".
@@ -19,4 +21,5 @@ function comp_flickr() {
         echo "</a>";
         $i++;
     }
+    echo "\n";
 }
index 5435e20d40e3d4d74ed088a63a9873b8eb1388a1..800f200e2ef5472e84f654944280ad9d94c3542c 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 
 function comp_lastfm() {
-    echo '<h2>recently listened tracks</h2>';
+    echo '            <h2>recently listened tracks</h2>' . "\n";
     if ($data = parse_rss('http://ws.audioscrobbler.com/1.0/user/' . get_config('lastfm_username') . '/recenttracks.rss')) {
-        echo '<ul>';
+        echo '                 <ul>' . "\n";
         foreach ($data->content as $item) {
-            echo '<li><a href="' . $item->link . '">' . $item->title  . '</a></li>';
+            echo '                <li><a href="' . $item->link . '">' . $item->title  . '</a></li>' . "\n";
         }
-        echo '<li class="last"><a href="http://last.fm/user/mjollnir_/">... more</a></li>';
-        echo '</ul>';
+        echo '                <li class="last"><a href="http://last.fm/user/' . get_config('lastfm_username') . '/">... more</a></li>' . "\n";
+        echo '            </ul>' . "\n";
     }
 
 }
index 1065b9c76d77528aeff4f5cda1ce3e723d2893f3..4dab86a52d00060ce40ded955e70ba5264c5c34c 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 
 function comp_twitter() {
-    echo '<h2>latest twitter updates</h2>';
+    echo '            <h2>latest twitter updates</h2>' . "\n";
     if ($data = parse_rss('http://twitter.com/statuses/user_timeline/' . get_config('twitter_username') . '.rss')) {
-        echo '<ul>';
+        echo '            <ul>' . "\n";
         foreach ($data->content as $item) {
-            echo '<li><a href="' . $item->link . '">' . substr($item->title, strlen(get_config('twitter_username')) + 2) . '</a></li>';
+            echo '                <li><a href="' . $item->link . '">' . substr($item->title, strlen(get_config('twitter_username')) + 2) . '</a></li>' . "\n";
         }
-        echo '<li class="last"><a href="http://twitter.com/mjollnir/">... more</a></li>';
-        echo '</ul>';
+        echo '                <li class="last"><a href="http://twitter.com/' . get_config('twitter_username') . '/">... more</a></li>' . "\n";
+        echo '            </ul>' . "\n";
     }
 }
 
index 9bd50055aa15900141df023341c3552a481c3bb4..1d22705c73837580c4989ec2a664bbacd9b0dae3 100644 (file)
@@ -8,9 +8,11 @@ $CFG = array(
     'twitter_username'  => '',
     'lastfm_username'   => '',
     'blog_rss'          => '',
+    'blog_url'          => '',
     'rss_cache'         => '',
     'curl'              => '',
     'cache_lifetime'    => 0,
+    'title'             => '',
 );
 
 // autodetect stuff
index b940abbf1dfc56f5283713a55f97290bda1da0c0..54a6022eaeb0d8aa370445b105d656b10f2ef3a3 100644 (file)
 ksort($whorepile);
 
 ?>
-<h2>mjollnir.org</h2>
-<p>a collection of what I'm doing all over the internet, mashed together into one place for your viewing pleasure.</p>
-<p>my blog lives at <a href="http://she.geek.nz">she.geek.nz</a>. there's an <a href="http://she.geek.nz/about/">about page</a> there too. it's old and rather out of date.</p>
-<p>find me on <?php
-    $count = 0;
-    foreach ($whorepile as $service => $url) {
-        echo '<a href="' . $url . '">' . $service . '</a>';
-        if ($count != count($whorepile) -1) {
-            echo ', ';
-        }
-        $count++;
-    }
-?>.  christ.  at least I never got livejournal.</p>
-<p>I don't have an rss feed for this mashup. use friendfeed instead, or an individual site's feed.</p>
-<p>thanks to <a href="http://nothing.net.nz">vex</a> for the vserver</p>
-<p><a href="mailto:penny@mjollnir.org">send me email!</a>
-<span class="mind"><b>On my mind</b>: <a href="http://mahara.org">mahara</a>, more tattoos, less tattoos, moodle gsoc, Europe</span>
+            <h2>mjollnir.org</h2>
+            <p>a collection of what I'm doing all over the internet, mashed together into one place for your viewing pleasure.</p>
+            <p>my blog lives at <a href="http://she.geek.nz">she.geek.nz</a>. there's an <a href="http://she.geek.nz/about/">about page</a> there too. it's old and rather out of date.</p>
+            <p>find me on <?php
+                $count = 0;
+                foreach ($whorepile as $service => $url) {
+                    echo '<a href="' . $url . '">' . $service . '</a>';
+                    if ($count != count($whorepile) -1) {
+                        echo ', ';
+                    }
+                    $count++;
+                }
+            ?>.  christ.  at least I never got livejournal.</p>
+            <p>I don't have an rss feed for this mashup. use friendfeed instead, or an individual site's feed.</p>
+            <p>thanks to <a href="http://nothing.net.nz">vex</a> for the vserver</p>
+            <p><a href="mailto:penny@mjollnir.org">send me email!</a>
+            <span class="mind"><b>On my mind</b>: <a href="http://mahara.org">mahara</a>, more tattoos, less tattoos, moodle gsoc, Europe</span>
index 97e7f507da7973ae66e430da993620ec9a58c7a1..5344a0652d923a14b0931f4123075c5e51614f0c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -9,17 +9,17 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
-        <title>mjollnir.org</title>
+        <title><?php echo get_config('title'); ?></title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <link rel="stylesheet" type="text/css" href="style.css" />
     </head>
     <body>
 <?php
     foreach ($components as $comp) {
-        echo '        <div class="component" id="' . $comp . '">';
+        echo '        <div class="component" id="' . $comp . '">' . "\n";
         require_once(get_config('comp') . $comp . '.php');
         call_user_func('comp_' . $comp);
-        echo '        </div>';
+        echo "\n" . '        </div>' . "\n";
     }
 ?>
     </body>