summaryrefslogtreecommitdiffabout
authorWojciech Polak <polak@gnu.org>2010-04-19 16:46:47 (GMT)
committer Wojciech Polak <polak@gnu.org>2010-04-19 16:46:47 (GMT)
commit9e0a7fd01fe083f1d8b47c528cb599fd49fd138d (patch) (side-by-side diff)
tree5139e052fddf6d20f514d25a2905a9394f45f983
parent9a2ce594f9ad8f40d77f8228856d673efc426b17 (diff)
downloadblogright-master.tar.gz
blogright-master.tar.bz2
version 2.5HEADmaster
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--blog.php69
1 files changed, 50 insertions, 19 deletions
diff --git a/blog.php b/blog.php
index 367773b..823fbde 100644
--- a/blog.php
+++ b/blog.php
@@ -2,4 +2,4 @@
-// blogRight! version 2.2 (2008-03-16)
-// Copyright (C) 2004, 2005, 2006, 2007, 2008 Wojciech Polak.
+// blogRight! version 2.5 (2010-04-19)
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Wojciech Polak.
//
@@ -73,2 +73,6 @@ else
+$feed_titles_idx = array ();
+if (isset ($CONF['feed.titles.idx']))
+ @include $CONF['path.data'].$CONF['feed.titles.idx'];
+
if (isset ($CONF['orderfile']) &&
@@ -268,3 +272,5 @@ if (isset ($RSS))
$pubDate = date ("D, d M Y H:i:s O", $fmtime);
- $itemTitle = date ('d M Y', $fmtime);
+ $idx = substr ($inc, strlen ($cwd));
+ $itemTitle = isset ($feed_titles_idx[$idx]) ? $feed_titles_idx[$idx] :
+ date ('d M Y', $fmtime);
$permaLink = date ($CONF['permalinkFmt'], $fmtime);
@@ -278,4 +284,4 @@ if (isset ($RSS))
echo " <description><![CDATA[\n";
- indent_include (9, $inc, $CONF['feed.CDATA']);
- echo " ]]></description>\n";
+ indent_include (0, $inc, $CONF['feed.CDATA']);
+ echo "]]></description>\n";
}
@@ -283,3 +289,3 @@ if (isset ($RSS))
echo " <description>\n";
- indent_include (9, $inc, $CONF['feed.CDATA']);
+ indent_include (0, $inc, $CONF['feed.CDATA']);
echo " </description>\n";
@@ -360,3 +366,5 @@ else if (isset ($ATOM))
$pubDate = date ('Y-m-d\TH:i:s\Z', $fmtime);
- $itemTitle = date ('d M Y', $fmtime);
+ $idx = substr ($inc, strlen ($cwd));
+ $itemTitle = isset ($feed_titles_idx[$idx]) ? $feed_titles_idx[$idx] :
+ date ('d M Y', $fmtime);
$permaLink = date ($CONF['permalinkFmt'], $fmtime);
@@ -373,3 +381,3 @@ else if (isset ($ATOM))
echo " <div xmlns=\"http://www.w3.org/1999/xhtml\">\n";
- indent_include (6, $inc, $CONF['feed.XHTML']);
+ indent_include (0, $inc, $CONF['feed.XHTML']);
echo " </div>\n";
@@ -379,4 +387,4 @@ else if (isset ($ATOM))
echo " <content type=\"html\" xml:space=\"preserve\"><![CDATA[\n";
- indent_include (6, $inc, $CONF['feed.CDATA']);
- echo " ]]></content>\n";
+ indent_include (0, $inc, $CONF['feed.CDATA']);
+ echo "]]></content>\n";
}
@@ -384,3 +392,3 @@ else if (isset ($ATOM))
echo " <content type=\"html\" xml:space=\"preserve\">\n";
- indent_include (6, $inc, $CONF['feed.CDATA']);
+ indent_include (0, $inc, $CONF['feed.CDATA']);
echo " </content>\n";
@@ -419,3 +427,3 @@ else // HTML
if (ereg ("^$search_m-$search_d.*\.html\$", basename ($inc)))
- include_file ($inc);
+ include_file ($inc, 'd');
}
@@ -423,3 +431,3 @@ else // HTML
if (ereg ("^$search_m-.*\.html\$", basename ($inc)))
- include_file ($inc);
+ include_file ($inc, 'm');
}
@@ -427,3 +435,3 @@ else // HTML
if (ereg (".*\.html\$", basename ($inc)))
- include_file ($inc);
+ include_file ($inc, 'y');
}
@@ -606,5 +614,5 @@ function printer ($data, $string)
// HTML output
-function include_file ($file)
+function include_file ($file, $type)
{
- global $CONF, $search_d, $local_fn, $year_array;
+ global $CONF, $search_y, $search_m, $local_fn, $year_array;
$res = array ();
@@ -661,4 +669,4 @@ function include_file ($file)
echo '<a href="./'.$CONF['qpattern'].
- $permaLink.'" rel="bookmark" title="'.$entryDate.
- '"><abbr class="published" title="'.
+ $permaLink.'" class="bookmark" rel="bookmark" title="'.
+ $entryDate.'"><abbr class="published" title="'.
$pubDate.'">'.$entryDate.'</abbr></a>'."\n";
@@ -666,2 +674,25 @@ function include_file ($file)
$CONF['feed.authorName'].'</span></address>';
+
+ /* disqus support */
+ if (isset ($CONF['disqus.account']) && $CONF['disqus.account'] != '') {
+ if ($type == 'd') {
+ echo "\n";
+ echo '<div id="disqus_thread"></div>';
+ echo '<script type="text/javascript" src="http://disqus.com/forums/'.
+ $CONF['disqus.account'].'/embed.js"></script>';
+ if (isset ($CONF['disqus.showNoScript'])) {
+ echo '<noscript><div><a href="http://'.$CONF['disqus.account'].
+ '.disqus.com/?url=ref">View the forum thread.</a></div></noscript>';
+ }
+ echo '<a href="http://disqus.com" class="dsq-brlink">'.
+ 'comments powered by <span class="logo-disqus">Disqus</span>'.
+ '</a>'."\n";
+ }
+ else if (isset ($CONF['recent']) &&
+ (!isset ($search_y) || isset ($search_m))) {
+ echo '<a href="./'.$CONF['qpattern'].$permaLink.
+ '#disqus_thread" title="View comments">Comments</a>'."\n";
+ }
+ }
+
echo '</div>'."\n";
@@ -741,3 +772,3 @@ function printCalendar ()
echo " <td><div class=\"calendar-year\"><a href=\"./".
- $CONF['qpattern'].$dir."/\">$dir</a></div>\n";
+ $CONF['qpattern'].$dir."/\" rel=\"nofollow\">$dir</a></div>\n";
echo " <table class=\"calendar-months\">\n\n";

Return to:

Send suggestions and report system problems to the System administrator.