aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blog.php43
-rw-r--r--config.php9
2 files changed, 38 insertions, 14 deletions
diff --git a/blog.php b/blog.php
index 6d1d35a..e591dc9 100644
--- a/blog.php
+++ b/blog.php
@@ -1,6 +1,6 @@
<?php
-// blogRight! version 1.8c (2005-07-22)
+// blogRight! version 1.9 (2005-07-30)
// Copyright (C) 2004, 2005 Wojciech Polak.
//
// This program is free software; you can redistribute it and/or modify
@@ -333,7 +333,8 @@ function footnote_handler ($matches)
// for the given input file.
function process_line ($line)
{
- global $site, $photodir, $gscript, $imagedir, $search_d;
+ global $site, $photodir, $imagedir, $search_d;
+ global $gscript, $defaultGallery, $thumbnailPrefix;
global $local_fn, $global_fn, $footnotes;
global $collect;
@@ -359,17 +360,33 @@ function process_line ($line)
if (!preg_match ('/="(https?|ftp|mailto):\/\/.*?"/i', $line)) // a local path
{
- $line = preg_replace ('/<img src="(.*?)"(.*?)>/i',
- '<img src="'.$site.'/'.$imagedir.'/$1" alt="[image]"$2 />',
- $line);
+ $res = array ();
+
+ if (preg_match ('/<img src="(.*?)"(.*?)>/i', $line, $res))
+ {
+ $line = preg_replace ('/<img src="(.*?)"(.*?)>/i',
+ '<img src="'.$site.'/'.$imagedir.'/$1" alt="[image]"$2 />', $line);
+ }
+ else if (preg_match ('/<photo album="(.*?)" src="(.*?)"(.*?)>/i', $line, $res))
+ {
+ if ($res[1] == 'default')
+ $res[1] = $defaultGallery;
- $line = preg_replace ('/<photo src="(.*?)"(.*?)>/i',
- '<div class="photo"><a href="'.$photodir.'/photo.php?q=$1"><img src="'
- .$site.'/'.$photodir.'/small/small-$1" alt="[photo]"$2 /></a></div>',
- $line);
+ $prefix = dirname (trim ($res[2]));
+ if ($prefix[0] == '.')
+ $prefix = $thumbnailPrefix[$res[1]];
+ $photo = basename (trim ($res[2]));
- $res = array ();
- if (preg_match ('/<gallery album="(.*?)" img="(.*?)"(.*?)>/i', $line, $res))
+ $line = '<div class="photo"><a href="'.$photodir.'/'.$gscript.'?q='.$res[1].'&amp;photo='.$photo.'">'
+ .'<img src="'.$site.'/'.$photodir.'/'.$prefix.$photo.'" alt="[photo]"'.$res[3].' /></a></div>';
+ }
+ else if (preg_match ('/<photo src="(.*?)"(.*?)>/i', $line, $res))
+ {
+ $line = '<div class="photo"><a href="'.$photodir.'/photo.php?q='.$res[1].'"><img src="'
+ .$site.'/'.$photodir.'/'
+ .$thumbnailPrefix['default'].$res[1].'" alt="[photo]"'.$res[2].' /></a></div>';
+ }
+ else if (preg_match ('/<gallery album="(.*?)" img="(.*?)"(.*?)>/i', $line, $res))
{
$pdir = dirname (trim ($res[2]));
if ($pdir[0] == '.')
@@ -380,8 +397,8 @@ function process_line ($line)
.'<img src="'.$site.'/'.$photodir;
if ($pdir)
$line .= '/'.$pdir;
- $line .= '/small/small-'.$pbase.'" alt="[gallery]"'
- .$res[3]." /><br />&raquo;</a></div>\n";
+ $line .= '/'.$thumbnailPrefix['default'].$pbase.'" alt="[gallery]"'
+ .$res[3]." /><br />&raquo;</a></div>\n";
}
$line = preg_replace ('/<a href="(.*?)">/i', '<a href="'.$site.'/$1">', $line);
diff --git a/config.php b/config.php
index 54ac3db..ef22460 100644
--- a/config.php
+++ b/config.php
@@ -6,7 +6,6 @@ $site = 'http://your.site.name';
$weblogdir = 'blogright';
$imagedir = 'blogright/graphics';
$photodir = 'blogright/photos';
-$gscript = '';
$charsetEncoding = 'UTF-8';
@@ -19,12 +18,20 @@ $orderfile = '.order'; // [optional] order file name
$header_file = 'templates/header.html';
$footer_file = 'templates/footer.html';
+// Webxiangpianbu
+$gscript = ''; // empty means index.(html|php)
+$defaultGallery = 'photoblog';
+$thumbnailPrefix['default'] = 'small/small-';
+$thumbnailPrefix['photoblog'] = 'photoblog/small/small-';
+
+// RSS
$rssTitle = "RSS Title";
$rssDescription = "Some descriptive title";
$rssCopyright = "Your Name";
$rssEditor = "Editor Name";
$rssLanguage = "qu"; // Two-letter language code as per ISO 639
+// Calendar
$calendarEmptyMonths = false;
$calendarVertical = false;

Return to:

Send suggestions and report system problems to the System administrator.