[Slashdotjp-dev 1213] [741] merged from 2.5.0.192 branch

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 9月 9日 (火) 17:53:05 JST


Revision: 741
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=741
Author:   tach
Date:     2008-09-09 17:53:05 +0900 (Tue, 09 Sep 2008)

Log Message:
-----------
merged from 2.5.0.192 branch

Modified Paths:
--------------
    slashjp/trunk/Slash/Apache/Apache.pm
    slashjp/trunk/Slash/Apache/User/User.pm
    slashjp/trunk/Slash/DB/MySQL/MySQL.pm
    slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm
    slashjp/trunk/Slash/Display/Display.pm
    slashjp/trunk/Slash/LDAPDB/lib/Slash/LDAPDB.pm
    slashjp/trunk/Slash/Utility/Anchor/Anchor.pm
    slashjp/trunk/Slash/Utility/Data/Data.pm
    slashjp/trunk/Slash/Utility/Display/Display.pm
    slashjp/trunk/Slash/Utility/Environment/Environment.pm
    slashjp/trunk/Slash/Utility/System/System.pm
    slashjp/trunk/Slash/XML/FOAF/FOAF.pm
    slashjp/trunk/Slash/XML/RSS/RSS.pm
    slashjp/trunk/debian/changelog
    slashjp/trunk/debian/slash-backend.init.d
    slashjp/trunk/debian/slash-backend.logcheck.ignore.server
    slashjp/trunk/plugins/Admin/admin.pl
    slashjp/trunk/plugins/FireHose/FireHose.pm
    slashjp/trunk/plugins/Journal/Journal.pm
    slashjp/trunk/plugins/Journal/journal.pl
    slashjp/trunk/plugins/Moderation/Moderation.pm
    slashjp/trunk/plugins/PollBooth/pollBooth.pl
    slashjp/trunk/plugins/Tags/mysql_dump.sql
    slashjp/trunk/plugins/Zoo/zoo.pl
    slashjp/trunk/sql/mysql/defaults.sql
    slashjp/trunk/themes/slashcode/htdocs/article.pl
    slashjp/trunk/themes/slashcode/htdocs/topics.pl
    slashjp/trunk/themes/slashcode/htdocs/users.pl
    slashjp/trunk/themes/slashcode/tasks/freshenup.pl
    slashjp/trunk/themes/slashcode/tasks/new_headfoot.pl
    slashjp/trunk/themes/slashcode/tasks/open_backend.pl

Added Paths:
-----------
    slashjp/trunk/themes/slashcode/templates/rss_item_description;misc;default


-------------- next part --------------
Modified: slashjp/trunk/Slash/Apache/Apache.pm
===================================================================
--- slashjp/trunk/Slash/Apache/Apache.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Apache/Apache.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -354,6 +354,57 @@
 	#	$uri =~ s/^\Q$path//;
 	#}
 
+	# return shtml internally when AC
+	# for slashdot.jp (2008-07-17)
+	if ($uri =~ m!^/(\w+/)?article\.pl$! && !$is_user) {
+		my $section = $1 || 'articles';
+		my $the_request = $r->the_request;
+		my $qs = {$the_request =~ m!\b(sid|threshold|mode|commentsort|lowbandwidth|simpledesign|light)=([-\w/]+)!g};
+
+		if ((defined($qs->{sid}) && $qs->{sid} =~ m|^\d{2}/\d{2}/\d{2}/\d{6,}$|) &&
+		    (!defined($qs->{threshold}) || $qs->{threshold} == 1) &&
+		    (!defined($qs->{mode}) || $qs->{mode} eq 'thread' ) &&
+		    (!defined($qs->{commentsort}) || $qs->{commentsort} == 3) &&
+		    !$qs->{lowbandwidth} &&
+		    !$qs->{simpledesign} &&
+		    !$qs->{light}) {
+			my $file = "$constants->{basedir}/$section/$qs->{sid}.shtml";
+			if ($constants->{mobile_enabled} &&
+			    ($constants->{mobile_useragent_regex} &&
+			     $r->header_in('user-agent') =~ $constants->{mobile_useragent_regex}) ||
+			    $r->args() =~ m{\bm=[1-9a-zA-Z]}) {
+				$section = $constants->{mobile_urlpath};
+				$file = "$constants->{basedir}/$section/$qs->{sid}.shtml";
+			}
+			if (-r $file) {
+				$r->uri("/$section/$qs->{sid}.shtml");
+				$r->filename($file);
+				writeLog('shtml');
+				return OK;
+			}
+		}
+	}
+
+	# REDIRECT article page shtml for mobile mode
+	if ($uri !~ m|^$constants->{mobile_urlpath}/| && $uri =~ m|^/\w+/(\d{2}/\d{2}/\d{2}/\d{6,})\.shtml|) {
+		my $sid = $1;
+		if ($constants->{mobile_enabled}) {
+			if (($constants->{mobile_useragent_regex} &&
+			     $r->header_in('user-agent') =~ $constants->{mobile_useragent_regex}) ||
+			     $r->args() =~ m{\bm=[1-9a-zA-Z]}) {
+				my $newuri = $constants->{real_rootdir}.$constants->{mobile_urlpath}."/$sid.shtml";
+				redirect($newuri);
+				return DONE;
+			}
+		}
+	}
+
+	# DECLINED if the skin does not exist
+	if ($uri =~ m|^/\w+/\w+\.pl$| &&
+	    determineCurrentSkin() == getCurrentStatic('mainpage_skid')) {
+		return DECLINED;
+	}
+
 	# Comment this in if you want to try having this do the right
 	# thing dynamically
 	# my $slashdb = getCurrentDB();
@@ -388,6 +439,13 @@
 			if ($gSkin->{skid} == $constants->{mainpage_skid}) {
 				$r->filename("$basedir/$base.shtml");
 				$r->uri("/$base.shtml");
+				if ($constants->{mobile_enabled}) {
+					if (($constants->{mobile_useragent_regex} &&
+					     $r->header_in('user-agent') =~ $constants->{mobile_useragent_regex}) ||
+				            $r->args() =~ m{\bm=[1-9a-zA-Z]}) {
+						$r->uri($constants->{mobile_urlpath}."/$base.shtml");
+					}
+				}
 			} else {
 				$r->filename("$basedir/$gSkin->{name}/$base.shtml");
 				$r->uri("/$gSkin->{name}/$base.shtml");
@@ -398,7 +456,7 @@
 	}
 
 	if ($uri eq '/firehose.pl') {
-		$r->uri($is_user ? '/firehose.pl' : '/firehose.shtml');
+		$r->uri($is_user || $r->the_request =~ /\bid=\d+\b/ ? '/firehose.pl' : '/firehose.shtml');
 		return OK;
 	}
 
@@ -423,6 +481,43 @@
 		return OK;
 	}
 
+	if ($uri eq '/topics.pl') {
+		if (!$is_user && $r->the_request !~ /\bop=\w+\b/) {
+			$r->uri('/topics.shtml');
+			$r->filename("$constants->{basedir}/topics.shtml");
+			writeLog('shtml');
+			return OK;
+		}
+	}
+
+	# faq for slashdot.jp
+	if ($uri =~ m!^/faq (?: (/[^?]*) | /? ) (?: \?(.*) )? $!x) {
+		my($word, $query) = ($1, $2);
+		$word =~ m!^/(.+)\.shtml$! && redirect("$constants->{absolutedir}/faq/$1");
+		$word ? $word =~ s!^/!! : redirect("$constants->{absolutedir}/faq/");
+		my @args = ($query);
+		if ($word) {
+			$word = "-$word";
+		}
+		$word = "faq$word";
+		my $fpath = "/$constants->{sfjp_wikicontents_path}/$word.shtml";
+		my $file = "$constants->{basedir}$fpath";
+		unless (-r $file) {
+			return NOT_FOUND;
+		}
+		if ($is_user) {
+			push @args, "name=$word";
+			$r->args(join('&', @args));
+			$r->uri('/wikicontents.pl');
+			$r->filename($constants->{basedir} . '/wikicontents.pl');
+			return OK;
+		} else {
+			$r->uri($fpath);
+			$r->filename($file);
+			return OK;
+		}
+	}
+
 	# redirect to static if
 	# * not a user, nor a daypass holder,
 	# and
@@ -500,3 +595,4 @@
 Slash(3).
 
 =cut
+        

Modified: slashjp/trunk/Slash/Apache/User/User.pm
===================================================================
--- slashjp/trunk/Slash/Apache/User/User.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Apache/User/User.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -576,7 +576,7 @@
 	}
 
 	# URIs like /tags and /tags/foo and /tags/foo?type=bar are special cases.
-	if ($uri =~ m[^/tags (?: /([^?]*) | /? ) (?: \?(.*) )? $]x) {
+	if ($uri =~ m!^/tags (?: /([^?]*) | /? ) (?: \?(.*) )? $!x) {
 		my($word, $query) = ($1, $2);
 		my @args = ( );
 		if ($word =~ /^(active|recent|all)$/) {
@@ -605,6 +605,50 @@
                 return OK;
         }
  
+	# journals for slashdot.jp
+	if ($uri =~ m!^/journals (?: /([^?]*) | /? ) (?: \?(.*) )? $!x) {
+		my($word, $query) = ($1, $2);
+		my @args = ($query);
+		$word =~ s!/+$!!;
+		$word =~ s{/}{_}g;
+		$word =~ s/^top(recent|friends|posters)(.*)$/top_$1$2/;
+		$word =~ s/^topcount(.*)$/top_posters$1/;
+		if ($word eq "rss") {
+			$word = "top_recent_rss";
+		} elsif ($word eq "") {
+			$word = "top";
+		}
+		if ($word =~ /^(.+)_rss$/) {
+			$word = $1;
+			push @args, "content_type=rss";
+		}
+		push @args, "op=$word" if ($word);
+		$r->args(join('&', @args));
+		$r->uri('/journal.pl');
+		$r->filename($constants->{basedir} . '/journal.pl');
+		return OK;
+	}
+
+	# polls for slashdot.jp
+	if ($uri =~ m!^/polls (?: /([^?]*) | /? ) (?: \?(.*) )? $!x) {
+		my($word, $query) = ($1, $2);
+		my @args = ($query);
+		if ($word =~ /^rss$/) {
+			push @args, "content_type=rss";
+			if ($constants->{rss_cachedir} && -r "$constants->{rss_cachedir}/pollBooth.rss") {
+				$r->filename("$constants->{rss_cachedir}/pollBooth.rss");
+				return OK;
+			}
+		} elsif ($word =~ /^(\d+)$/) {
+			push @args, "qid=$1";
+		}
+		push @args, "op=$word" if ($word);
+		$r->args(join('&', @args));
+		$r->uri('/pollBooth.pl');
+		$r->filename($constants->{basedir} . '/pollBooth.pl');
+		return OK;
+	}
+
 	# for self-references (/~/ and /my/)
 	if (($saveuri =~ m[^/(?:%7[eE]|~)] && $uri =~ m[^/~ (?: /(.*) | /? ) $]x)
 		# /my/ or /my can match, but not /mything

Modified: slashjp/trunk/Slash/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -541,6 +541,9 @@
 	my $theme = ($user->{simpledesign} || $user->{pda}) ? "light" : $user->{css_theme};
 	my $constants = getCurrentStatic();
 
+	# force mobile theme
+	$theme = 'mobile' if ($user->{mobile});
+
 	my $expire_time = $constants->{css_expire} || 3600;
 	$expire_time += int(rand(60)) if $expire_time;
 	_genericCacheRefresh($self, 'css', $expire_time);
@@ -5879,6 +5882,16 @@
 		my $nexus_clause = join ',', @$nexuses, $mp_tid;
 		$where .= " AND story_topics_rendered.tid IN ($nexus_clause)";
 		$key .= '|>=';
+	} elsif (!$section && !$topic) {
+		# suppress stories never seen
+		$where .= " AND story_topics_rendered.stoid NOT IN (SELECT stoid FROM story_topics_rendered WHERE tid IN ($user->{story_never_nexus}))"
+			if ($user->{story_never_nexus});
+		my $nexuses = [];
+		push @$nexuses, $user->{story_full_best_nexus} if ($user->{story_full_best_nexus});
+		push @$nexuses, $user->{story_brief_best_nexus} if ($user->{story_brief_best_nexus});
+		my $nexus_clause .= join ',', @$nexuses;
+		$where .= " AND (story_topics_rendered.stoid NOT IN (SELECT stoid FROM story_topics_rendered WHERE tid IN ($nexus_clause)) OR story_topics_rendered.tid = $mp_tid)"
+			if ($nexus_clause);
 	} else {
 		$where .= " AND story_topics_rendered.tid = $mp_tid";
 		$key .= '|=';
@@ -5898,6 +5911,8 @@
 		$key = $user->{story_never_topic}
 			|| $user->{story_never_author}
 			|| $user->{story_never_nexus}
+			|| $user->{story_full_best_nexus}
+			|| $user->{story_brief_best_nexus}
 			? ''
 			: "$key|";
 	} elsif ($topic) {
@@ -7867,7 +7882,7 @@
 		# will be updated later by journal_fix.pl
 		if ($story->{journal_id}) {
 			delete @{$dis_data}{qw(ts)};
-			delete @{$discussion}{qw(title url)} unless ($constants->{update_journal_story_discussion_to_story});
+			delete @{$dis_data}{qw(title url)} unless ($constants->{update_journal_story_discussion_to_story});
 		}
 
 		if (!$error) {
@@ -8090,6 +8105,9 @@
 		$conf{reasons} = $self->sqlSelectAllHashref(
 			"id", "*", "modreasons"
 		);
+		foreach my $d (split(/,/, $conf{modreasons_select_disabled} || '')) {
+			$conf{reasons}{int($d)}{select_disabled} = 1;
+		}
 	}
 
 	$conf{rootdir}		||= "//$conf{basedomain}";
@@ -9519,10 +9537,14 @@
 		$page ||= 'misc';
 	}
 	unless ($skin) {
+		$skin = getCurrentUser('currentSkin');
 		$skin ||= getCurrentSkin('name');
 		$skin ||= 'default';
 	}
 
+	# change to mobile skin
+	$skin = 'm' if (getCurrentUser('mobile'));
+
 	#Now, lets figure out the id
 	#name|page|skin => name|page|default => name|misc|skin => name|misc|default
 	# That frat boy march with a paddle
@@ -10212,7 +10234,7 @@
 	my($self, $skid, $options) = @_;
 	if (!$skid) {
 		if ($ENV{GATEWAY_INTERFACE}) {
-			errorLog("cannot getSkin for empty skid='$skid'");
+			errorLog("cannot getSkin for empty skid");
 		}
 		$skid = getCurrentStatic('mainpage_skid');
 	}

Modified: slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -83,19 +83,21 @@
 	my $constants = getCurrentStatic();
 
 	my $limit = $options->{limit} || 10;
-	my $topic = $options->{topic} || getCurrentStatic('mainpage_nexus_tid');
+	my $topic = $options->{topic};
 
 	my $select = "stories.stoid AS stoid, sid, title, stories.tid AS tid, primaryskid, time,
-		dept, stories.uid AS uid, commentcount, hitparade, introtext, bodytext, stories.qid as qid";
+		dept, stories.uid AS uid, commentcount, hitparade, introtext, bodytext, stories.qid as qid, discussion";
 
 	my $from = "stories, story_text, story_topics_rendered";
 
 	my $where = "stories.stoid = story_text.stoid
 		AND time < NOW() AND in_trash = 'no'
-		AND stories.stoid = story_topics_rendered.stoid
-		AND story_topics_rendered.tid=$topic";
+		AND stories.stoid = story_topics_rendered.stoid";
+	if ($topic) {
+		$where .= " AND story_topics_rendered.tid=$topic";
+	}
 
-	my $other = "ORDER BY time DESC LIMIT $limit";
+	my $other = "GROUP BY sid ORDER BY time DESC LIMIT $limit";
 
 	my $returnable = $self->sqlSelectAllHashrefArray($select, $from, $where, $other);
 

Modified: slashjp/trunk/Slash/Display/Display.pm
===================================================================
--- slashjp/trunk/Slash/Display/Display.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Display/Display.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -227,6 +227,7 @@
 
 	my $show_comm = $constants->{template_show_comments} ? 1 : 0;
 	$show_comm &&= 0 if $opt->{Nocomm} && $constants->{template_show_comments} < 2;
+	$show_comm &&= 0 if $user->{mobile} && $constants->{template_show_comments} < 2;
 	$out = "\n\n<!-- start template: $TEMPNAME -->\n\n$out\n\n<!-- end template: $TEMPNAME -->\n\n"
 		if $show_comm;
 
@@ -400,7 +401,9 @@
 			POST_CHOMP	=> $constants->{template_post_chomp},
 			CACHE_SIZE	=> $cache_size,
 			%$cfg2,
+			EVAL_PERL	=> ($constants->{enable_template_evalperl} ? 1 : 0),
 		})],
+		EVAL_PERL	=> ($constants->{enable_template_evalperl} ? 1 : 0),
 	});
 
 	$cfg->{template}	= $template if ref $cfg;

Modified: slashjp/trunk/Slash/LDAPDB/lib/Slash/LDAPDB.pm
===================================================================
--- slashjp/trunk/Slash/LDAPDB/lib/Slash/LDAPDB.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/LDAPDB/lib/Slash/LDAPDB.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -55,7 +55,7 @@
 		  @_ };
     bless $self, $class;
 
-    $DEBUG_LEVEL = $constants->{ldap_debug_level} >= 0 ? $constants->{ldap_debug_level} : $DEBUG_LEVEL;
+    $DEBUG_LEVEL = $constants->{ldap_debug_level} ? int($constants->{ldap_debug_level}) : $DEBUG_LEVEL;
 
     if (!$self->{_disabled} &&
 	!($self->{_ldap} = Net::LDAP->new($self->{host}, timeout => $self->{timeout}))){

Modified: slashjp/trunk/Slash/Utility/Anchor/Anchor.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Anchor/Anchor.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Utility/Anchor/Anchor.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -441,6 +441,7 @@
 	(my $dir = $gSkin->{rootdir}) =~ s|^(?:https?:)?//[^/]+||;
 	my $hostname = $gSkin->{hostname};
 	my $page = $options->{Page} || $user->{currentPage} || 'misc';
+	$dir = $constants->{mobile_urlpath} if ($user->{mobile});
 
 	# if there's a special .inc header for this page, use it, else it's
 	# business as usual.

Modified: slashjp/trunk/Slash/Utility/Data/Data.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Data/Data.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Utility/Data/Data.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -415,12 +415,15 @@
 sub cleanRedirectUrl {
 	my($redirect) = @_;
 	my $gSkin = getCurrentSkin();
+	my $form = getCurrentForm();
+	my $rurl = $gSkin->{rootdir};
+	$rurl .= '?m=1' if ($form->{m});
 
 	if (urlFromSite($redirect)) {
 		my $base = root2abs();
-		return URI->new_abs($redirect || $gSkin->{rootdir}, $base);
+		return URI->new_abs($redirect || $rurl, $base);
 	} else {
-		return url2abs($gSkin->{rootdir});
+		return url2abs($rurl);
 	}
 }
 
@@ -2078,7 +2081,7 @@
 			my $a_lc = lc $a;
 			next unless $allowed{$a_lc};
 			my $data = $attr_data{$a_lc} || '';
-			$data = fudgeurl($data) if $allowed{$a_lc}{url};
+			$data = fudgeurl($data) || '' if $allowed{$a_lc}{url};
 			next unless length $data;
 			$wholetag .= qq{ $a_lc="$data"};
 			++$found{$a_lc} if $required{$a_lc};

Modified: slashjp/trunk/Slash/Utility/Display/Display.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Display/Display.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Utility/Display/Display.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -188,6 +188,7 @@
 		if ($all_name) {
 			$hashref = {
 				map { ($_, $hashref->{$_}{name}) }
+				grep { !$hashref->{$_}{select_disabled} }
 				keys %$hashref
 			};
 		}
@@ -474,6 +475,7 @@
 	$params{sid} = $story_link->{sid};
 	$params{mode} = $story_link->{mode} if $story_link->{mode};
 	$params{threshold} = $story_link->{threshold} if exists $story_link->{threshold};
+	$params{m} = '1' if (getCurrentForm('m'));
 
 	# Setting $dynamic properly is important.  When generating the
 	# AC index.shtml, it's a big win if we link to other
@@ -525,6 +527,7 @@
 
 	my $skin = $reader->getSkin($story_link->{skin});
 	$url = $skin->{rootdir} || $constants->{real_rootdir} || $gSkin->{rootdir};
+	$url = $constants->{real_rootdir} if ($user->{mobile});
 
 	if (!$static && $dynamic) {
 		$url .= "/$script?";
@@ -545,7 +548,11 @@
 		# but we would need to `mv articles mainpage`, or ln -s, and it just seems better
 		# to me to keep the same URL scheme if possible
 		my $skinname = $skin->{name} eq 'mainpage' ? 'articles' : $skin->{name};
-		$url .= "/$skinname" unless ($url =~ /\/${skinname}$/);
+		if ($user->{mobile}) {
+			$skinname = $constants->{mobile_urlpath};
+			$skinname =~ s/^\/*//;
+		}
+		$url .= "/$skinname" if ($skinname && $url !~ /\/${skinname}$/);
 		$url .= "/" . ($story_link->{sid} || $story_ref->{sid}) . ".shtml";
 		# manually add the tid(s), if wanted
 		if ($constants->{tids_in_urls} && $params{tids}) {
@@ -559,7 +566,7 @@
 		}
 	}
 
-	my @extra_attrs_allowed = qw( title class id );
+	my @extra_attrs_allowed = qw( title class id accesskey );
 	if ($render) {
 		my $rendered = '<a href="' . strip_attribute($url) . '"';
 		for my $attr (@extra_attrs_allowed) {

Modified: slashjp/trunk/Slash/Utility/Environment/Environment.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Environment/Environment.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Utility/Environment/Environment.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -1625,6 +1625,31 @@
 	}
 	$constants->{tweak_japanese} and $user->{aton} = '';
 
+	# mobile theme for slashdot.jp
+	if ($constants->{mobile_enabled}) {
+		if ($ENV{GATEWAY_INTERFACE}) {
+#print STDERR $r->header_in('user-agent') . " =~ $constants->{mobile_useragent_regex}\n";
+			if ($constants->{mobile_useragent_regex} &&
+			    $r->header_in('user-agent') =~ $constants->{mobile_useragent_regex}) {
+				$user->{mobile} = 1;
+#print STDERR "MOBILE SKIN MATCH: " . $r->header_in('user-agent') . "\n";
+			} elsif ($r->args() =~ m{\bm=[1-9a-zA-Z]}) {
+				$user->{mobile} = 1;
+#print STDERR "FORCE MOBILE MODE: " . $r->args() . "\n";
+			}
+		} else {
+			$user->{mobile} = 1 if (getCurrentForm('m'));
+			setCurrentForm('m', undef);
+		}
+
+		# settings for mobile mode
+		if ($user->{mobile}) {
+			$user->{mode} = $constants->{mobile_commentmode} || 'flat'; # show flat
+			$user->{commentsort} = $constants->{mobile_commentsort} || 4; # sorted by date asc
+			$user->{commentlimit} = $constants->{mobile_commentlimit} || 5; # comments per page
+		}
+	}
+
 	if ($uri =~ m[^/$]) {
 		$user->{currentPage} = 'index';
 	} elsif ($uri =~ m{\b([^/]+)\.pl\b}) {

Modified: slashjp/trunk/Slash/Utility/System/System.pm
===================================================================
--- slashjp/trunk/Slash/Utility/System/System.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/Utility/System/System.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -122,6 +122,12 @@
 		return 0;
 	}
 
+	# workaround for unicode WAVE DASH problem...
+	if ($constants->{tweak_japanese}) {
+		$content =~ tr/\x{ff5e}/\x{301c}/;
+		$subject =~ tr/\x{ff5e}/\x{301c}/;
+	}
+
 	# Character Code Conversion; target encoding must be valid name
 	# Characters not representable in the destination character set
 	# and encoding will be replaced with \x{HHHH} place-holders
@@ -489,6 +495,7 @@
 			if (!open $fh, "> $filename\0") {
 				$err_str .= " could not write to '$filename': '$!'";
 			} else {
+				binmode $fh, ":encoding($options->{encoding})" if (defined($options->{encoding}));
 				print $fh $data;
 				close $fh;
 				$success = 1;

Modified: slashjp/trunk/Slash/XML/FOAF/FOAF.pm
===================================================================
--- slashjp/trunk/Slash/XML/FOAF/FOAF.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/XML/FOAF/FOAF.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -167,7 +167,7 @@
 			$ret .= $self->_processFoaf( $name, $_ );
 		}
         }else{
-		if ($foaf_elements{$name} eq "resource"){
+		if ($foaf_elements{$name} && $foaf_elements{$name} eq "resource"){
 			$ret .= "<foaf:$name rdf:resource=\"$node\" />\n";
 		}elsif ($name eq "seeAlso"){
 			$ret .= "<rdfs:seeAlso rdf:resource=\"$node\" />\n";

Modified: slashjp/trunk/Slash/XML/RSS/RSS.pm
===================================================================
--- slashjp/trunk/Slash/XML/RSS/RSS.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/Slash/XML/RSS/RSS.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -28,6 +28,7 @@
 use strict;
 use Slash;
 use Slash::Utility;
+use Slash::Display;
 use XML::RSS;
 use base 'Slash::XML';
 use vars qw($VERSION);
@@ -172,10 +173,10 @@
 	);
 
 	my $dynamic = 0;
-	my $absolutedir = $gSkin->{absolutedir};
+	my $absolutedir = $gSkin->{absolutedir} || $constants->{absolutedir};
 	if (defined &Slash::Apache::ConnectionIsSSL) {
 		$dynamic = 1;
-		$absolutedir = $gSkin->{absolutedir_secure} if Slash::Apache::ConnectionIsSSL();
+		$absolutedir = ($gSkin->{absolutedir_secure} || $constants->{absolutedir_secure}) if Slash::Apache::ConnectionIsSSL();
 	}
 
 	# set defaults
@@ -190,7 +191,7 @@
 		subject		=> $constants->{rdfsubject},
 		language	=> $constants->{rdflanguage},
 		creator		=> $constants->{adminmail},
-		publisher	=> $constants->{rdfpublisher},
+		publisher	=> $constants->{rdfpublisher} || $constants->{sitepublisher},
 		rights		=> $constants->{rdfrights},
 
 		# syn
@@ -284,14 +285,14 @@
 	if ($param->{textinput}) {
 		# set defaults
 		my %textinput = (
-			title		=> 'Search ' . $constants->{sitename},
-			description	=> 'Search ' . $constants->{sitename} . ' stories',
-			name		=> 'query',
+			title		=> getData('search_header_title', {}, 'search'),
+			description	=> getData('search_header_descr', { section => $param->{skin} ? $param->{skin}{title} : undef }, 'search'),
+			name		=> $constants->{search_query_name} || 'query',
 			'link'		=> $channel{'link'} . 'search.pl',
 		);
 
 		# let $param->{textinput} override
-		if (ref($param->{image}) eq 'HASH') {
+		if (ref($param->{textinput}) eq 'HASH') {
 			for (keys %textinput) {
 				my $value = defined $param->{textinput}{$_}
 					? $param->{textinput}{$_}
@@ -324,6 +325,10 @@
 				$encoded_item->{dc}{creator} = $self->encode($item->{creator})
 					if $item->{creator};
 			}
+			$encoded_item->{dc}{source} = $item->{source}
+				if $item->{source};
+			$encoded_item->{dc}{relation} = $item->{relation}
+				if $item->{relation};
 
 			for my $key (keys %$item) {
 				if ($key eq 'description') {
@@ -454,10 +459,21 @@
 		my $desc = $self->rss_item_description($item->{description} || $story->{introtext});
 		if ($desc) {
 			$encoded_item->{description} = $desc;
-			$encoded_item->{description} .= qq{<p><a href="$action"><img src="$channel->{'link'}slashdot-it.pl?from=rss&amp;op=image&amp;style=h0&amp;sid=$story->{sid}"></a></p>};
-			$encoded_item->{description} .= "<p><a href=\"$action\">Read more of this story</a> at $constants->{sitename}.</p>" if $action;
+			$encoded_item->{description} = $desc . getData('rss_story_readmore', {
+				'link'		=> $encoded_item->{link},
+				discussion	=> $story->{discussion},
+			}, 'index');
+			# disabled on slashdot.jp (2008-09-09, tach)
+			#$encoded_item->{description} .= qq{<p><a href="$action"><img src="$channel->{'link'}slashdot-it.pl?from=rss&amp;op=image&amp;style=h0&amp;sid=$story->{sid}"></a></p>};
+			#$encoded_item->{description} .= "<p><a href=\"$action\">Read more of this story</a> at $constants->{sitename}.</p>" if $action;
 			# add poll if any
 			$encoded_item->{description} .= pollbooth($story->{qid},1, 0, 1) if $story->{qid};
+
+			# add content:encoded for slashdot.jp
+			$item->{'content:encoded'} ||= ($item->{description} || $story->{introtext}) . getData('rss_story_readmore', {
+				'link'		=> $encoded_item->{link},
+				discussion	=> $story->{discussion},
+			}, 'index');
 		}
 	}
 

Modified: slashjp/trunk/debian/changelog
===================================================================
--- slashjp/trunk/debian/changelog	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/debian/changelog	2008-09-09 08:53:05 UTC (rev 741)
@@ -1,12 +1,6 @@
 slash (2.5.0.201-1) unstable; urgency=low
 
   * New upstream CVS release
-  * Allow to show AC info for admin user
-  * Fix: user karma_bonus settings are vanished...
-  * Fix: comment count fail when user hardthresh setting is enabled
-  * Remove "tid=" from story link at stories
-  * Update journal-story discussions' title/url to story title/url when vars
-    update_journal_story_discussion_to_story has been enabled.
 
  -- Taku YASUI <tach****@osdn*****>  Mon, 21 Apr 2008 21:58:15 +0900
 
@@ -36,10 +30,223 @@
 slash (2.5.0.195-1) unstable; urgency=low
 
   * New upstream CVS release
+
+ -- Taku YASUI <tach****@osdn*****>  Tue, 26 Feb 2008 11:54:28 +0000
+
+slash (2.5.0.192-17) unstable; urgency=low
+
+  * Fix journals URL (remove "top")
+    - top recent: /journals/top/recent -> /journals/recent
+    - top posters: /journals/top/posters -> /journals/posters
+    - you can access old URL
+  * Add /faq/ internal redirection at Slash/Apache/Apache.pm
+    - This code is for slash-plugin-wikicontents
+  * Fix LDAP.pm DEBUG_LEVEL warning
+  * Use $user->{currentSkin} at $slashdb->getTemplateByName()
+    - Fix: slashDisplay() option 'Skin' does not applied
+  * Add logcheck ignore rule for SearchEst
+
+ -- Taku YASUI <tach****@osdn*****>  Mon,  8 Sep 2008 11:58:09 +0000
+
+slash (2.5.0.192-16) unstable; urgency=low
+
+  * Fix for reason_modifier setting for users.pl
+    - Use reason_id as key instead of name
+  * Add workaround for unicode WAVE DASH problem
+  * Add "dc:source" and "dc:relation" to RSS output
+  * Change "sitename.(rss|ref|xml|atom)" to including all stories even if
+    section local
+  * Change journal top rss including html description and change URL adding
+    journal id
+  * Add new journal top rss url: "/journals/top/rss" and
+    "/journals/top/recent/rss"
+  * Add "readmore" link for journal top rss and journal rss
+  * use $constants->{sitepublisher} when $constants->{rdfpublisher} does not
+    exist on creating RSS
+  * Add content:encoded for story main rss
+  * Add "mainpage" title to "index.rss"
+  * Fix RSS "textinput" handling on Slash/XML/RSS/RSS.pm
+  * Add simple pollBooth URL
+    - "/polls" and "/polls/{qid}"
+  * Add feature: display pollBooth RSS on "/polls/rss"
+  * Improve article.pl performance when non-user access
+    - redirect to shtml internally
+  * Add feature to change query string form name for search.pl
+    - Use variable "search_query_name"
+  * Improve "polls/rss" performance using rss cache
+    - Use variable "rss_cachedir"
+    - cache creating task is not included in slash distribution
+  * Allow firehose.pl for AC when the "id" is specified
+  * move createMenu() into hierarchy and listTopics templates
+  * Redirect topics.pl to topics.shtml internally when when AC access
+
+ -- Taku YASUI <tach****@osdn*****>  Tue, 22 Jul 2008 07:57:22 +0000
+
+slash (2.5.0.192-15) unstable; urgency=low
+
+  * Add vars "modreasons_select_disabled" to insert "disabled => 1" for getReasons()
+
+ -- Taku YASUI <tach****@osdn*****>  Sat,  5 Jul 2008 12:30:25 +0000
+
+slash (2.5.0.192-14) unstable; urgency=low
+
+  * Fix to change commentsort for mobile mode from 5 to 4
+  * Make to change commentsort, commentmode and commentlimitfor mobile mode
+    using constants
+    - commentsort = mobile_commentsort
+    - commentlimit = mobile_commentlimit
+    - mode = mobile_commentmode
+  * Fix: redirect url when ('?m=1') has been appended
+  * Add "discussion" variable for printCommComments template
+  * enable to show divided top journal pages
+    - top_recent
+    - top_posters
+    - top_friends
+  * add "start" parameter for $journal->top() and $journal->topRecent()
+    - for enabling pagination for top journals
+  * Add new url for userdir_handler
+    - Add "/journals" URL
+  * Add next and previous journal data to journal
+    - use $journal_reader->getJournalByTime()
+  * Disable to show comments when mobile mode
+
+ -- Taku YASUI <tach****@osdn*****>  Fri, 27 Jun 2008 07:03:00 +0000
+
+slash (2.5.0.192-13) unstable; urgency=low
+
+  * Fix: linkStory() add '?m=1'
+  * Fix: force mobile mode when ssi=yes and m=1 for prog2file
+  * Fix: Use of uninitialized value in string eq at
+    /usr/lib/perl5/Slash/XML/FOAF.pm line 170.
+  * Fix: Use of uninitialized value in numeric ge (>=) at
+    /var/lib/slash/site/slashdot.jp/htdocs/zoo.pl line 440.
+  * Fix: Use of uninitialized value in numeric ge (>=) at
+    /var/lib/slash/site/slashdot.jp/htdocs/zoo.pl line 427.
+  * Fix: Use of uninitialized value in numeric ge (>=) at
+    /var/lib/slash/site/slashdot.jp/htdocs/zoo.pl line 428.
+  * Do not show footer when show foaf at plugins/Zoo/zoo.pl
+  * Fix: Use of uninitialized value in concatenation (.) or string at
+    /usr/lib/perl5/Slash/DB/MySQL.pm line 10184
+  * Enable to specify encoding for prog2file
+    - use 'encoding' to option
+  * Add feature to write static html file for mobile mode
+  * Add feature to enable/disable PERL / RAWPERL directives on Template
+    - use constant 'enable_template_evalperl'
+  * Add feature to create slashhead/slashfoot file for mobile mode
+  * Fix: Automatic adding related stories and comments
+    - Check sid existance
+    - Select enable/disable to add related comments using variable
+      "related_cid_disabled"
+  * Add to killing orphaned slashd child process when keepalive
+  * Fix next_prev_stories selection code
+    - Make same as mainpage story list
+  * Change mobile mode default charset from Shift_JIS to UTF-8
+  * Fix to specify correct ssi include file for mobile mode
+  * Fix linkStory() for mobile mode
+  * Show mobile mode page when useragent matches "mobile_useragent_regex"
+  * Redirect to mobile story page when mobile clients come to normal shtml
+  * Allow "accesskey" attribute at linkStory()
+
+ -- Taku YASUI <tach****@osdn*****>  Fri, 20 Jun 2008 08:10:20 +0000
+
+slash (2.5.0.192-12) unstable; urgency=low
+
+  * Add mobile mode
+    - Use "mobile_enabled" constant to use mobile mode
+    - Force mobile mode when the user-agent matches "mobile_useragent_regex"
+      or URL arg includes "m=1"
+    - getCurrentUser('mobile') is true when mobile mode has been enabled
+    - Do not show any comments on article.pl when mobile mode
+    - Force some settings
+      o Show comments as flat
+      o Comments are sorted by date desc
+      o Show only 5 comments per page
+  * Add number of display journal count to _printHead() on Journal.pm
+    - You can use 'jcount' variable journalhead;journal template
+  * Fix: Use of uninitialized value in length at
+    /usr/lib/perl5/Slash/Utility/Data.pm line 2054.
+
+ -- Taku YASUI <tach****@osdn*****>  Mon, 12 May 2008 18:00:12 +0000
+
+slash (2.5.0.192-11) unstable; urgency=low
+
+  * Change RSS item description suffix
+    - use template "rss_item_description;misc;default" to change description
+  * Add feature to change whether nexus topics will be shown or not on topic
+    list
+    - use $constants->{topiclist_dont_show_nexuses}
+  * Add feature to change automatic tag stories to use topic.textname instead
+    of topic.keyword
+    - use $constants->{autoaddstorytopics_use_textname}
+
+ -- Taku YASUI <tach****@osdn*****>  Thu,  1 May 2008 14:27:42 +0000
+
+slash (2.5.0.192-10) unstable; urgency=low
+
+  * Fix to take discussion id from journal-submission
+  * Update journal-story discussions' title/url to story title/url when vars
+    update_journal_story_discussion_to_story has been enabled.
+  * Fix not to show contents when the skin does not exist
+  * Fix to create/update firehose item from Journal correctly
+    - Do not use "submit" reskey
+  * Fix to update story-submitted journal correctly
+    - Do not use "submit" reskey
+  * Add to enable/disable to show publicized(story-submitted) journals to
+    firehose as journal firehose item
+    - Using "update_journal_story_discussion_to_story" variable
+
+ -- Taku YASUI <tach****@osdn*****>  Thu, 24 Apr 2008 18:36:57 +0900
+
+slash (2.5.0.192-9) unstable; urgency=low
+
+  * Fix continue: firehose color for bookmark feed to same as normal bookmarks
+    at tagboxes
+  * Fix Prototype mismatch: sub main::EOF: none vs () at
+    /var/lib/slash/site/slashdot.jp/tasks/zoo_run_people_log.pl
+  * Allow to show AC info for admin user
+  * Fix: user karma_bonus settings are vanished...
+  * Fix: comment count fail when user hardthresh setting is enabled
+  * Remove "tid=" from story link at stories
+
+ -- Taku YASUI <tach****@osdn*****>  Mon, 21 Apr 2008 21:58:15 +0900
+
+slash (2.5.0.192-8) unstable; urgency=low
+
+  * Enable to select using shtml links at site RSS/RDF by
+    $constants->{rss_use_story_shtml}
+  * Change method to pick up nexus topics for section selection on
+    editH****@users***** (for slashdot.jp)
+  * Add logcheck ignore rules for fetch_rss_bookmarks.pl
+  * Move processing %special keys to after encode changing at filter_params
+    at Slash/Utility/Environment/Environment.pm
+  * Fix firehose color for bookmark feed to same as normal bookmarks
+  * Fix Use of uninitialized value****@tagbo***** line 285
+
+ -- Taku YASUI <tach****@osdn*****>  Wed, 26 Mar 2008 05:00:59 +0000
+
+slash (2.5.0.192-7) unstable; urgency=low
+
+  * Add to forbid Moderation for user doing bad moderation
+  * Fix to remove some unicode control characters from form
+  * Fix to attach discussion to another story when duplicate stories are
+    removed
+
+ -- Taku YASUI <tach****@osdn*****>  Thu,  6 Mar 2008 09:20:58 +0000
+
+slash (2.5.0.192-6) unstable; urgency=low
+
+  * Fix email message for new user creation
+    - You should create "mail_msg_newuser" data to template
+      "data;login;default"
+
+ -- Taku YASUI <tach****@osdn*****>  Mon,  3 Mar 2008 10:06:08 +0000
+
+slash (2.5.0.192-5) unstable; urgency=low
+
   * Fix admin topic select window to change tree/alpabetical
   * Fix to show stories that should display
 
- -- Taku YASUI <tach****@osdn*****>  Tue, 26 Feb 2008 11:54:28 +0000
+ -- Taku YASUI <tach****@osdn*****>  Tue, 26 Feb 2008 20:13:25 +0900
 
 slash (2.5.0.192-4) unstable; urgency=low
 

Modified: slashjp/trunk/debian/slash-backend.init.d
===================================================================
--- slashjp/trunk/debian/slash-backend.init.d	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/debian/slash-backend.init.d	2008-09-09 08:53:05 UTC (rev 741)
@@ -145,6 +145,18 @@
 		;;
 
 	keepalive)
+		# kill orphaned slashd child process
+		pids=`pidof -x slashd`
+		for pid in $pids; do
+			ppid=`egrep '^PPid:' /proc/$pid/status 2>/dev/null | awk '{print $2}'`
+			pname=`cat /proc/$pid/cmdline 2>/dev/null`
+			pcmd=`echo $pname | awk '{print $3}'`
+			test "$ppid" != "1" && continue
+			test -z "$pcmd" && continue
+			echo Orphaned slashd procces is found: $pid $ppid $pname
+			kill -USR1 $pid
+		done
+
 		for server_name in $GRAB_CONFIG; do
 			break_parts;
 			if [ ! -f $RUNNINGPID ] ;then

Modified: slashjp/trunk/debian/slash-backend.logcheck.ignore.server
===================================================================
--- slashjp/trunk/debian/slash-backend.logcheck.ignore.server	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/debian/slash-backend.logcheck.ignore.server	2008-09-09 08:53:05 UTC (rev 741)
@@ -50,3 +50,5 @@
 ^So total tokens=[0-9]+
 newcomments: [0-9]+
 [0-9]+ comments becomes [0-9]+ tokens\.
+Updated the data for estmaster:
+SKIP: the data has no .* for hyperestraier

Modified: slashjp/trunk/plugins/Admin/admin.pl
===================================================================
--- slashjp/trunk/plugins/Admin/admin.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Admin/admin.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -1589,7 +1589,11 @@
 	# Extract sids from urls in introtext and bodytext
 	foreach ($form->{introtext}, $form->{bodytext}) {
 		next unless ($_);
-		push @$related, $1 while /$match/g;
+		while (/$match/g) {
+			next unless $slashdb->getStory($1);
+			push @$related, $1;
+		}
+		next if ($constants->{related_cid_disabled});
 		push @$related_cids, $1 while /$match_cid/g;
 	}
 
@@ -2534,7 +2538,7 @@
 			for my $tid (keys %$chosen_hr) {
 				next unless $chosen_hr->{$tid} > 0;	# must have weight
 				next unless $tree->{$tid}{image};	# must have an image
-				my $kw = $tree->{$tid}{keyword};
+				my $kw = $constants->{autoaddstorytopics_use_textname} ? $tree->{$tid}{textname} : $tree->{$tid}{keyword};
 				next unless $tagsdb->tagnameSyntaxOK($kw); # must be a valid tagname
 				$tt{$kw} = 1;
 			}

Modified: slashjp/trunk/plugins/FireHose/FireHose.pm
===================================================================
--- slashjp/trunk/plugins/FireHose/FireHose.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/FireHose/FireHose.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -110,7 +110,7 @@
 				discussion => $journal->{discussion}, 
 				word_count => countWords($introtext) 
 			});
-
+			$self->setFireHose($itemid, { public => "no" }) if (getCurrentStatic("firehose_disable_to_show_publicized_journals") && $journal->{promotetype} eq "publicize");
 		} else {
 			$self->createItemFromJournal($id);
 		}

Modified: slashjp/trunk/plugins/Journal/Journal.pm
===================================================================
--- slashjp/trunk/plugins/Journal/Journal.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Journal/Journal.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -60,14 +60,10 @@
 	$self->sqlUpdate('journals', \%j1, "id=$id") if keys %j1;
 	$self->sqlUpdate('journals_text', \%j2, "id=$id") if $j2{article};
 	if ($constants->{plugin}{FireHose}) {
-		my $reskey = getObject('Slash::ResKey');
-		my $rkey = $reskey->key('submit', { nostate => 1 });
-		if ($rkey && $rkey->createuse) {
-			my $journal_item = $self->get($id);
-			my $firehose = getObject("Slash::FireHose");
-			if ($journal_item->{promotetype} eq "publicize" || $journal_item->{promotetype} eq "publish") {
-				$firehose->createUpdateItemFromJournal($id);
-			}
+		my $journal_item = $self->get($id);
+		my $firehose = getObject("Slash::FireHose");
+		if ($journal_item->{promotetype} eq "publicize" || $journal_item->{promotetype} eq "publish") {
+			$firehose->createUpdateItemFromJournal($id);
 		}
 	}
 }
@@ -215,15 +211,11 @@
 	my $slashdb = getCurrentDB();
 	$slashdb->setUser($user->{uid}, { journal_last_entry_date => $date });
 	if ($constants->{plugin}{FireHose}) {
-		my $reskey = getObject('Slash::ResKey');
-		my $rkey = $reskey->key('submit', { nostate => 1 });
-		if ($rkey && $rkey->createuse) {
-			my $firehose = getObject("Slash::FireHose");
-			my $journal = getObject("Slash::Journal");
-			my $j = $journal->get($id);
-			if ($j->{promotetype} eq "publicize" || $j->{promotetype} eq "publish") {
-				$firehose->createItemFromJournal($id);
-			}
+		my $firehose = getObject("Slash::FireHose");
+		my $journal = getObject("Slash::Journal");
+		my $j = $journal->get($id);
+		if ($j->{promotetype} eq "publicize" || $j->{promotetype} eq "publish") {
+			$firehose->createItemFromJournal($id);
 		}
 	}
 
@@ -303,45 +295,39 @@
 }
 
 sub top {
-	my($self, $limit) = @_;
+	my($self, $limit, $start) = @_;
 	$limit ||= getCurrentStatic('journal_top') || 10;
+	$start ||= 0;
 	$self->sqlConnect;
 
 	my $sql = <<EOT;
-SELECT count AS c,nickname,users_journal.uid,date,jid AS id
+SELECT count AS c,nickname,users_journal.uid,users_journal.date,jid AS id,description,journals_text.article,posttype,tid
 FROM users_journal JOIN users USING (uid)
+JOIN journals ON jid=journals.id
+JOIN journals_text ON jid=journals_text.id
 ORDER BY count DESC
-LIMIT $limit
+LIMIT $start, $limit
 EOT
 
 	my $losers = $self->{_dbh}->selectall_arrayref($sql);
+	return [ ] if !$losers || !@$losers;
 
-	my $sql2 = sprintf <<EOT, join (',', map { $_->[4] } @$losers);
-SELECT id, description
-FROM journals
-WHERE id IN (%s)
-EOT
-	my $losers2 = $self->{_dbh}->selectall_hashref($sql2, 'id');
-
-	for (@$losers) {
-		$_->[5] = $losers2->{$_->[4]}{description};
-	}
-
 	return $losers;
 }
 
 sub topRecent {
-	my($self, $limit) = @_;
+	my($self, $limit, $start) = @_;
 	$limit ||= getCurrentStatic('journal_top') || 10;
+	$start ||= 0;
 	$self->sqlConnect;
 
 	my $sql = <<EOT;
-SELECT count AS c,nickname,users_journal.uid,users_journal.date,jid AS id,description,journals_text.article
+SELECT count AS c,nickname,users_journal.uid,users_journal.date,jid AS id,description,journals_text.article,posttype,tid
 FROM users_journal JOIN users USING (uid)
 JOIN journals ON jid=journals.id
 JOIN journals_text ON jid=journals_text.id
 ORDER BY date DESC
-LIMIT $limit
+LIMIT $start, $limit
 EOT
 
 	my $losers = $self->{_dbh}->selectall_arrayref($sql);
@@ -657,7 +643,7 @@
 			url		=> $url,
 			ts		=> $journal_story->{'time'}
 		};
-		delete @{$discussion}{qw(title url)} if ($constants->{update_journal_story_discussion_to_story});
+		delete @{$discussion}{qw(title url)} if (getCurrentStatic("update_journal_story_discussion_to_story"));
 
 		if ($self->setDiscussion($journal_story->{discussion}, $discussion)) {
 			$self->sqlUpdate('journal_transfer', {
@@ -703,7 +689,39 @@
 	}
 }
 
+sub getJournalByTime {
+	my($self, $sign, $journal, $options) = @_;
+	my $constants = getCurrentStatic();
+	$options = {} if !$options || ref($options) ne 'HASH';
+	my $limit = $options->{limit} || 1;
+	my $uid = int($options->{uid}) || undef;
+	my $where = "";
+	my $name  = 'journal_by_time';
+	my $order = $sign eq '<' ? 'DESC' : 'ASC';
 
+	# $journal->[0]: datetime string
+	# $journal->{1]: journaltext
+	# $journal->{2]: journaltitle
+	# $journal->[3]: journal_id
+	# $journal->[4]: format_id
+	# $journal->[5]: topic_id
+	# $journal->[6]: discussion_id
+
+	if ($uid) {
+		$where .= " AND uid=$uid";
+	}
+
+	my $returnable = $self->sqlSelectHashref(
+		'date, article, description, id, posttype, tid, discussion',
+		'journals JOIN journals_text USING (id)',
+		"date $sign '$journal->[0]'
+		 AND date <= NOW()
+		 $where",
+		 "ORDER by date $order LIMIT $limit"
+	);
+	return $returnable;
+}
+
 sub DESTROY {
 	my($self) = @_;
 	$self->{_dbh}->disconnect if !$ENV{GATEWAY_INTERFACE} && $self->{_dbh};

Modified: slashjp/trunk/plugins/Journal/journal.pl
===================================================================
--- slashjp/trunk/plugins/Journal/journal.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Journal/journal.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -68,6 +68,9 @@
 		list		=> [ 1,			\&listArticle		],
 		display		=> [ 1,			\&displayArticle	],
 		top		=> [ $top_ok,		\&displayTop		],
+		top_posters	=> [ $top_ok,		\&displayTop		],
+		top_friend	=> [ $top_ok,		\&displayTop		],
+		top_recent	=> [ $top_ok,		\&displayTop		],
 		searchusers	=> [ 1,			\&searchUsers		],
 		friends		=> [ 1,			\&displayFriends	],
 		friendview	=> [ 1,			\&displayArticleFriends	],
@@ -97,7 +100,7 @@
 
 	# hijack feeds
 	if ($form->{content_type} && $form->{content_type} =~ $constants->{feed_types}) {
-		if ($op eq 'top' && $top_ok) {
+		if ($op =~ /^top/ && $top_ok) {
 			displayTopRSS($journal, $constants, $user, $form, $journal_reader, $gSkin);
 		} else {
 			displayRSS($journal, $constants, $user, $form, $journal_reader, $gSkin);
@@ -117,20 +120,33 @@
 	my $journals;
 
 	_printHead('mainhead') or return;
+	my $start = $form->{start} || 0;
+	my $limit = $user->{mobile} ? $constants->{mobile_top_journal_count} || 10
+	                            : $constants->{'journal_top'} || 10;
 
 	# this should probably be in a separate template, so the site admins
 	# can select the order themselves -- pudge
-	if ($constants->{journal_top_recent}) {
-		$journals = $journal_reader->topRecent;
-		slashDisplay('journaltop', { journals => $journals, type => 'recent' });
+	if ($constants->{journal_top_recent} && $form->{op} =~ /^top(_recent)?$/) {
+		$journals = $journal_reader->topRecent($limit, $start);
+		slashDisplay('journaltop', {
+			journals	=> $journals,
+			type		=> 'recent',
+			start		=> $start,
+			limit		=> $limit,
+		});
 	}
 
-	if ($constants->{journal_top_posters}) {
-		$journals = $journal_reader->top;
-		slashDisplay('journaltop', { journals => $journals, type => 'top' });
+	if ($constants->{journal_top_posters} && $form->{op} =~ /^top(_posters)?$/) {
+		$journals = $journal_reader->top($limit, $start);
+		slashDisplay('journaltop', {
+			journals	=> $journals,
+			type		=> 'top',
+			start		=> $start,
+			limit		=> $limit,
+		});
 	}
 
-	if ($constants->{journal_top_friend}) {
+	if ($constants->{journal_top_friend} && $form->{op} =~ /^top(_friend)?$/) {
 		my $zoo   = getObject('Slash::Zoo');
 		$journals = $zoo->topFriends;
 		slashDisplay('journaltop', { journals => $journals, type => 'friend' });
@@ -236,6 +252,15 @@
 			$juid     = $juser->{uid};
 		}
 
+		my $link = "$gSkin->{absolutedir}/~" . fixparam($nickname) . "/journal/$article->[3]";
+		my $journalurl = "$gSkin->{absolutedir}/~" . fixparam($nickname) . "/journal/";
+		my $text = strip_mode($article->[1], $article->[4]);
+		$text .= getData('rss_readmore', {
+			link		=> $link,
+			journalurl	=> $journalurl,
+			nickname	=> $nickname,
+		});
+
 		push @items, {
 			story		=> {
 				'time'		=> $article->[0],
@@ -244,8 +269,9 @@
 			},
 			title		=> $article->[2],
 			description	=> strip_notags($article->[1]),
-			'content:encoded' =>  balanceTags(strip_mode($article->[1], $article->[4]), { deep_nesting => 1 }),
+			'content:encoded' =>  balanceTags($text, { deep_nesting => 1 }),
 			'link'		=> root2abs() . '/~' . fixparam($nickname) . "/journal/$article->[3]",
+			relation		=> $journalurl,
 		};
 	}
 
@@ -309,21 +335,38 @@
 
 		$title =~ s/s$// if $entry->[0] == 1 && ($type eq 'count' || $type eq 'friends');
 
+		my $link = "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/$entry->[4]";
+		my $journalurl = "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/";
+		my $text = strip_mode($entry->[6], $entry->[7]);
+		$text .= getData('rss_readmore', {
+			link		=> $link,
+			journalurl	=> $journalurl,
+			nickname	=> $entry->[1],
+		});
+
 		push @items, {
-			title	=> $title,
-			link	=> "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/",
-			description => strip_notags($entry->[6]),
+			story	=> {
+				'time'	=> $entry->[3],
+				uid	=> $entry->[2],
+				tid	=> $entry->[8],
+			},
+			title			=> $title,
+			link			=> $link,
+			'content:encoded'	=> balanceTags($text, { deep_nesting => 1 }),
+			description		=> strip_notags($entry->[6]),
+			relation		=> $journalurl,
 		};
 	}
 
 	xmlDisplay($form->{content_type} => {
 		channel => {
-			title		=> "$constants->{sitename} Journals",
-			description	=> "Top $constants->{journal_top} Journals",
-			'link'		=> "$gSkin->{absolutedir}/journal.pl?op=top",
+			title		=> getData('rss_top_recent_title'),
+			description	=> getData('rss_top_recent_desc'),
+			'link'		=> "$gSkin->{absolutedir}/journals/",
 		},
 		image	=> 1,
-		items	=> \@items
+		items	=> \@items,
+		rdfitemdesc		=> $constants->{journal_rdfitemdesc},
 	});
 }
 
@@ -412,6 +455,7 @@
 	my $collection = {};
 	my $user_change = {};
 	my $head_data = {};
+	my ($prev, $next);
 
 	my $slashdb = getCurrentDB();
 
@@ -463,6 +507,7 @@
 	if (@$articles == 1) {
 	    $head_data->{html_title} = $articles->[0]->[2];
 	}
+	$head_data->{jcount} = scalar(@$articles);
 	_printHead('userhead', $head_data, 1) or return;
 
 	# check for extra articles ... we request one more than we need
@@ -501,6 +546,8 @@
 			$commentcount = $article->[6]
 				? $discussion->{commentcount}
 				: 0;
+			$prev = $journal_reader->getJournalByTime('>', $article, { uid => $uid });
+			$next = $journal_reader->getJournalByTime('<', $article, { uid => $uid });
 		} else {
 			$commentcount = $article->[6]
 				? $journal_reader->getDiscussion($article->[6], 'commentcount')
@@ -520,11 +567,14 @@
 			discussion	=> $article->[6],
 			id		=> $article->[3],
 			commentcount	=> $commentcount,
+			prev		=> $prev,
+			next		=> $next,
 		};
 	}
 
 	push @sorted_articles, $collection;
 	my $theme = _checkTheme($form->{theme} || $journal_reader->getUser($uid, 'journal_theme'));
+	$theme = 'mobile' if ($user->{mobile});
 
 	my $show_discussion = $form->{id} && !$constants->{journal_no_comments_item} && $discussion;
 	my $zoo   = getObject('Slash::Zoo');
@@ -540,7 +590,7 @@
 
 	print getData('journalfoot');
 
-	if ($show_discussion) {
+	if (!$user->{mobile} && $show_discussion) {
 		printComments($discussion);
 	}
 
@@ -584,7 +634,7 @@
 	# don't allow submission if user can't submit stories
 	# note: this may not work properly with SOAP, but submissions
 	# not enabled with SOAP now anyway
-	if ($constants->{journal_create_submission} && $form->{promotetype} eq 'publicize') {
+	if (!$form->{id} && $constants->{journal_create_submission} && $form->{promotetype} eq 'publicize') {
 		my $reskey = getObject('Slash::ResKey');
 		my $submit_rkey = $reskey->key('submit', { nostate => 1 });
 		unless ($submit_rkey->createuse) {

Modified: slashjp/trunk/plugins/Moderation/Moderation.pm
===================================================================
--- slashjp/trunk/plugins/Moderation/Moderation.pm	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Moderation/Moderation.pm	2008-09-09 08:53:05 UTC (rev 741)
@@ -41,9 +41,16 @@
 sub getReasons {
 	my($self) = @_;
 	my $table_cache = "_reasons_cache";
-	$self->{$table_cache} ||= $self->sqlSelectAllHashref(
+	return {( %{$self->{$table_cache}} )} if ($self->{$table_cache});
+
+	$self->{$table_cache} = $self->sqlSelectAllHashref(
 		"id", "*", "modreasons"
 	);
+	my $mrd = getCurrentStatic('modreasons_select_disabled') || '';
+	foreach my $d (split(/,/, $mrd)) {
+		$d = int($d);
+		$self->{$table_cache}{$d}{select_disabled} = 1;
+	}
 	return {( %{$self->{$table_cache}} )};
 }
 

Modified: slashjp/trunk/plugins/PollBooth/pollBooth.pl
===================================================================
--- slashjp/trunk/plugins/PollBooth/pollBooth.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/PollBooth/pollBooth.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -8,6 +8,7 @@
 use Slash;
 use Slash::Display;
 use Slash::Utility;
+use Slash::XML;
 
 #################################################################
 sub main {
@@ -28,6 +29,12 @@
 		linkstory	=> \&link_story_to_poll
 	);
 
+        # hijack feeds
+	if ($form->{content_type} && $form->{content_type} =~ $constants->{feed_types}) {
+		listpollsRSS($form, $slashdb, $constants);
+		return;
+	}
+
 	my $op = $form->{op} && $ops{$form->{op}} ? $form->{op} : 'default';
 
 	if (defined $form->{aid}) {
@@ -512,6 +519,55 @@
 }
 
 #################################################################
+sub listpollsRSS {
+	my ($form, $slashdb, $constants) = @_;
+	my $polls = getObject('Slash::PollBooth', { db_type => 'reader' });
+	my $offset = 0;
+	my $limit = 10;
+
+	my $columns = "*";
+	my $tables = "pollquestions";
+	my $where = "";
+	my $other = "ORDER BY date DESC LIMIT $offset, $limit";
+	my $questions = $polls->sqlSelectAllHashrefArray($columns, $tables, $where, $other);
+
+	my $items = [];
+	foreach my $entry (@$questions) {
+		my $poll = $polls->getPoll($entry->{qid});
+		my $pollbooth = getData('rss_pollbooth', { poll	=> $poll });
+		my $readmore = getData('rss_readmore', { poll => $poll });
+		push(@$items, {
+			story	=> {
+				uid	=> $entry->{uid},
+				'time'	=> $entry->{date},
+			},
+			'link'			=> "$constants->{absolutedir}/polls/$entry->{qid}",
+			title			=> $entry->{question},
+			'time'			=> $entry->{date},
+			description		=> $entry->{question} . $readmore,
+			'content:encoded'	=> $pollbooth . $readmore,
+		});
+	}
+
+	my $ret = xmlDisplay($form->{content_type} => {
+		channel			=> {
+			title		=> getData('rss_title'),
+			description	=> getData('rss_descr'),
+			'link'		=> "$constants->{absolutedir}/polls/",
+		},
+		image			=> 1,
+		textinput		=> {
+			title	=> getData('search_header_title', { op => getData('polls', {}, 'search') }, 'search'),
+			'link'	=> "$constants->{absolutedir}/search.pl?op=polls",
+		},
+		items			=> $items,
+		rdfitemdesc		=> $constants->{dfitemdesc},
+		rdfitemdesc_html	=> $constants->{dfitemdesc_html} || 1,
+	}, $form->{ssi} ? 1 : 0);
+	print "$ret\n" if ($form->{ssi});
+}
+
+#################################################################
 createEnvironment();
 main();
 

Modified: slashjp/trunk/plugins/Tags/mysql_dump.sql
===================================================================
--- slashjp/trunk/plugins/Tags/mysql_dump.sql	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Tags/mysql_dump.sql	2008-09-09 08:53:05 UTC (rev 741)
@@ -59,3 +59,5 @@
 
 #INSERT INTO tagboxes VALUES (NULL, 'tag_count', 'user', '1.0', 0, NULL);
 
+-- for slashdot.jp
+INSERT IGNORE INTO vars (name, value, description) VALUES ('autoaddstorytopics_use_textname', '1', 'Use "textname" instead of "keyword" for Auto-add tags for story topic');

Modified: slashjp/trunk/plugins/Zoo/zoo.pl
===================================================================
--- slashjp/trunk/plugins/Zoo/zoo.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/plugins/Zoo/zoo.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -54,7 +54,7 @@
 	if ($r = Apache->request) {
 		return if $r->header_only;
 	}
-	footer() unless $form->{content_type} && $form->{content_type} =~ $constants->{feed_types};
+	footer() unless $op eq 'foaf' || $form->{content_type} && $form->{content_type} =~ $constants->{feed_types};
 }
 
 sub people {
@@ -424,8 +424,8 @@
 
 	# add various field is defined
 	# email address depending on display setting
-	$person->{mbox_sha1sum} = Digest::SHA1::sha1_hex('mailto:' . $user->{realemail}) if $user->{realemail} && $user->{emaildisplay} >= 1;
-        $person->{mbox} = "mailto:" . $user->{realemail} if $user->{realemail} && $user->{emaildisplay} >= 2; 
+	$person->{mbox_sha1sum} = Digest::SHA1::sha1_hex('mailto:' . $user->{realemail}) if $user->{realemail} && ($user->{emaildisplay} && int($user->{emaildisplay}) >= 1);
+        $person->{mbox} = "mailto:" . $user->{realemail} if $user->{realemail} && ($user->{emaildisplay} && int($user->{emaildisplay}) >= 2); 
 	$person->{homepage} = $user->{homepage} if $user->{homepage};
 	$person->{weblog} = $userpage . "journal/" if $user->{journal_last_entry_date};
 
@@ -437,7 +437,7 @@
 			nick		=> $p->{nickname},
 			seeAlso		=> "$constants->{rootdir}/~" . fixparam($p->{nickname}) . "/$type.rdf",
 		}};
-		$other->{Person}{mbox_sha1sum} = Digest::SHA1::sha1_hex("mailto:" . $p->{realemail}) if $p->{emaildisplay} >= 1;
+		$other->{Person}{mbox_sha1sum} = Digest::SHA1::sha1_hex("mailto:" . $p->{realemail}) if ($p->{emaildisplay} && int($p->{emaildisplay}) >= 1);
 		push @knows, $other;
 	
 	}

Modified: slashjp/trunk/sql/mysql/defaults.sql
===================================================================
--- slashjp/trunk/sql/mysql/defaults.sql	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/sql/mysql/defaults.sql	2008-09-09 08:53:05 UTC (rev 741)
@@ -1142,6 +1142,20 @@
 INSERT IGNORE INTO vars (name, value, description) VALUES ('firehose_name','Firehose','The name of "Firehose" function');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('rss_use_story_shtml','0','Use ${sid}.shtml for RSS/RDF link');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('update_journal_story_discussion_to_story','0','Update discussion of journal-story title/url to story title/url');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('firehose_disable_to_show_publicized_journals','1','Do not show publicized(story-submitted) journals as firehose item');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('topiclist_dont_show_nexuses','1','Do not show nexus topics on topic list');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_enabled','0','Use mobile mode (1: enable, 0: disable)');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_useragent_regex','','User-Agent regex to force mobile mode');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_encoding','utf8','Content encoding for mobile webpages (static html files)');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_staticdir','','Path for mobile static html files (disabled if empty)');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_urlpath','/m','URL path for mobile static html files');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_commentsort','4','comment sort for mobile mode');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_commentlimit','5','comment limit for mobile mode');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_commentmode','flat','comment mode for mobile mode');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('enable_template_evalperl','0','Add "EVAL_PERL" to Template option to be able to use "PERL" and "RAWPERL" directives');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('related_cid_disabled','0','If set, then disable inserting cid to related story list');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('modreasons_select_disabled','','Comma separated "modreasons.id"s disable to select when moderation');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('search_query_name','query','alternative query string form name for search.pl');
 UPDATE vars SET value='text/html; charset=UTF-8' WHERE name='content_type_webpage';
 UPDATE vars SET value='0' WHERE name='draconian_charset';
 UPDATE vars SET value='UTF-8' WHERE name='rdfencoding';

Modified: slashjp/trunk/themes/slashcode/htdocs/article.pl
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/article.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/htdocs/article.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -204,7 +204,7 @@
 			}
 			# If no comments ever have existed and commentstatus is disabled,
 			# just skip the display of the comment header bar -Brian
-			if ($discussion && ! (
+			if ($discussion && !$user->{mobile} && ! (
 				   !$discussion->{commentcount}
 				&&  $discussion->{commentstatus} eq 'disabled'
 			)) {

Modified: slashjp/trunk/themes/slashcode/htdocs/topics.pl
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/topics.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/htdocs/topics.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -16,11 +16,12 @@
 
 	my $hierarchy_op = $form->{op} && $form->{op} eq 'hierarchy';
 	my $data = $hierarchy_op
-		? { admin => 1, adminmenu => 'info', tab_selected => 'hierarchy' }
+		? { tab_selected => 'hierarchy' }
 		: { };
 	header(getData('head'), $form->{section}, $data) or return;
 
-	print createMenu('topics');
+	# move createMenu() into hierarchy and listTopics templates for slashdot.jp (2008-07-22)
+	#print createMenu('topics');
 
 	if ($hierarchy_op) {
 		hierarchy();
@@ -67,6 +68,10 @@
 		$topics = \%new_topics;
 	}
 
+	foreach my $id ($reader->getNexusTids()) {
+		delete($topics->{$id}) if ($constants->{topiclist_dont_show_nexuses});
+	}
+
 	slashDisplay('listTopics', {
 		title		=> getData('current_topics'),
 		width		=> '90%',

Modified: slashjp/trunk/themes/slashcode/htdocs/users.pl
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/users.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/htdocs/users.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -2190,6 +2190,8 @@
 
 	my @reasons = ( );
 	my %reason_select = ( );
+	my $reasons_plus = {};
+	my $reasons_minus = {};
 	if ($constants->{m1}) {
 		my $mod_reader = getObject("Slash::$constants->{m1_pluginname}", { db_type => 'reader' });
 		my $reasons = $mod_reader->getReasons();
@@ -2197,12 +2199,20 @@
 			push @reasons, $reasons->{$id}{name};
 		}
 		# Reason modifiers
-		for my $reason_name (@reasons) {
-			my $key = "reason_alter_$reason_name";
-			$reason_select{$reason_name} = createSelect(
+		for my $id (sort { $a <=> $b } keys %$reasons) {
+			next unless ($reasons->{$id}{listable});
+			my $key = "reason_alter_$id";
+			$reasons->{$id}{reason_select} = createSelect(
 				$key, \@range, 
 				$user_edit->{$key} || 0, 1, 1
 			);
+			if ($reasons->{$id}{val} > 0) {
+				$reasons_plus->{$id} = $reasons->{$id};
+			} elsif ($reasons->{$id}{val} < 0) {
+				$reasons_minus->{$id} = $reasons->{$id};
+			} else {
+				next;
+			}
 		}
 	}
 
@@ -2308,6 +2318,8 @@
 		range			=> \@range,
 		reasons			=> \@reasons,
 		reason_select		=> \%reason_select,
+		reasons_minus		=> $reasons_minus,
+		reasons_plus		=> $reasons_plus,
 		people			=> \@people,
 		people_select		=> \%people_select,
 		new_user_percent_select	=> $new_user_percent_select,
@@ -2852,9 +2864,9 @@
 		push @reasons, $reasons->{$id}{name};
 	}
 
-	for my $reason_id (%$reasons) {
-		next unless $reasons->{$reason_id}{listable};
-		my $key = "reason_alter_$reason_id";
+	for my $id (sort { $a <=> $b } keys %$reasons) {
+		next unless $reasons->{$id}{listable};
+		my $key = "reason_alter_$id";
 		my $answer = $form->{$key} || 0;
 		$answer = 0 if !$answer || $answer !~ /^[\-+]?\d+$/;
 		$user_edits_table->{$key} = ($answer == 0) ? '' : $answer;

Modified: slashjp/trunk/themes/slashcode/tasks/freshenup.pl
===================================================================
--- slashjp/trunk/themes/slashcode/tasks/freshenup.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/tasks/freshenup.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -321,6 +321,34 @@
 			}
 		}
 
+		# mobile mode
+		if ($constants->{mobile_enabled} && $constants->{mobile_staticdir}) {
+			my $filename_m = "$constants->{mobile_staticdir}/$sid.shtml";
+			my $args_m = "$vu ssi=yes m=1 sid='$sid'";
+			my ($success_m, $stderr_text_m) = prog2file(
+				"$basedir/article.pl",
+				$filename_m,
+				{
+					args =>		$args_m,
+					verbosity =>	verbosity(),
+					handle_err =>	1,
+					encoding =>	$constants->{mobile_encoding},
+				}
+			);
+			if (!$success_m) {
+				$logmsg .= " success='$success_m'";
+				$do_log ||= (verbosity() >= 1);
+			}
+			if ($stderr_text_m) {
+				$stderr_text_m =~ s/\s+/ /g;
+				$logmsg .= " stderr: '$stderr_text_m'";
+				if ($stderr_text_m =~ /\b(ID \d+, \w+;\w+;\w+) :/) {
+					# template error, skip
+					slashdErrnote("template error updating $sid: $stderr_text_m");
+				}
+			}
+		}
+
 		# Now we extract what we need from the file we created
 		my($cc, $hp) = _read_and_unlink_cchp_file($cchp_file, $cchp_param);
 		if (defined($cc)) {
@@ -428,6 +456,22 @@
 				handle_err =>	0
 		});
 
+		# mobile mode
+		if ($constants->{mobile_enabled} && $constants->{mobile_staticdir}) {
+			my $filename_m = "$constants->{mobile_staticdir}/$base.shtml";
+			my $args_m = "$vu ssi=yes m=1";
+			prog2file(
+				"$basedir/$gSkin->{index_handler}",
+				$filename_m,
+				{
+					args =>		"$args_m section='$gSkin->{name}'$extra_args",
+					verbosity =>	verbosity(),
+					handle_err =>	0,
+					encoding =>	$constants->{mobile_encoding},
+				}
+			);
+		}
+
 		if ($constants->{plugin}{FireHose}) {
 			gen_firehose_static($virtual_user, "index_firehose.shtml", $gSkin->{name}, "", {  skipmenu => 1, skippop => 1, fhfilter => "story", duration => "7", mode => 'fulltitle', mixedmode => '1', setfield => '1', color => "black", index => "1", nocolors => 1  });
 			if ($base ne "firehose") {
@@ -467,6 +511,23 @@
 					verbosity =>	verbosity(),
 					handle_err =>	0
 			});
+
+			# mobile mode
+			if ($constants->{mobile_enabled} && $constants->{mobile_staticdir}) {
+				my $filename_m = "$constants->{mobile_staticdir}/$skinname.shtml";
+				my $args_m = "$vu ssi=yes m=1";
+				prog2file(
+					"$basedir/$gSkin->{index_handler}",
+					$filename_m,
+					{
+						args =>		"$args_m section='$skin->{name}'$extra_args",
+						verbosity =>	verbosity(),
+						handle_err =>	0,
+						encoding =>	$constants->{mobile_encoding},
+					}
+				);
+			}
+
 			if ($constants->{plugin}{FireHose}) {
 				gen_firehose_static($virtual_user, "index_firehose.shtml", $skin->{name}, $skinname, { skipmenu => 1, skippop => 1, fhfilter => "'story $skin->{name}'", duration => "7", mode => 'fulltitle', mixedmode => '1', setfield => '1', color => "black", index => "1", nocolors => "1"  });
 				if ($base ne "firehose") {

Modified: slashjp/trunk/themes/slashcode/tasks/new_headfoot.pl
===================================================================
--- slashjp/trunk/themes/slashcode/tasks/new_headfoot.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/tasks/new_headfoot.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -38,6 +38,31 @@
 	my $cssbase = slashDisplay("html-header", { only_css => 1}, { Return => 1 });
 	print $fh $cssbase;
 
+	# mobile mode
+	if ($constants->{mobile_enabled} && $constants->{mobile_staticdir}) {
+		$file = "$constants->{mobile_staticdir}/slashhead.inc";
+		open $fh, ">$file" or die "Can't open $file : $!";
+		binmode $fh, ':utf8';
+		setCurrentForm('ssi', 1);
+		setCurrentUser("mobile", 1);
+		$header = header("", "", { noheader => 1, Return => 1 });
+		setCurrentUser("mobile", 0);
+		setCurrentForm('ssi', 0);
+		print $fh $header;
+		close $fh;
+
+		$file = "$constants->{mobile_staticdir}/slashfoot.inc";
+		open $fh, ">$file" or die "Can't open $file : $!";
+		binmode $fh, ':utf8';
+		setCurrentForm('ssi', 1);
+		setCurrentUser("mobile", 1);
+		$header = footer({ noheader => 1, Return => 1, });
+		setCurrentUser("mobile", 0);
+		setCurrentForm('ssi', 0);
+		print $fh $header;
+		close $fh;
+	}
+
 	return;
 };
 

Modified: slashjp/trunk/themes/slashcode/tasks/open_backend.pl
===================================================================
--- slashjp/trunk/themes/slashcode/tasks/open_backend.pl	2008-09-09 08:16:58 UTC (rev 740)
+++ slashjp/trunk/themes/slashcode/tasks/open_backend.pl	2008-09-09 08:53:05 UTC (rev 741)
@@ -65,9 +65,10 @@
 	my $skin    = { };
 	$skin       = $slashdb->getSkin($name) if $name;
 	my $link    = ($skin->{url}  || $gSkin->{absolutedir}) . '/';
+	$link =~ s!/+$!/!;
 	my $title   = $constants->{sitename};
 	$title = "$title: $skin->{title}"
-		if $skin->{skid} && $skin->{skid} != $constants->{mainpage_skid} && $skin->{title};
+		if $skin->{skid} && $skin->{title};
 
 	my $description = $constants->{slogan};
 
@@ -119,6 +120,7 @@
 		version		=> $version,
 		textinput	=> 1,
 		image		=> 1,
+		skin		=> $skin,
 		items		=> \@items,
 	}, 1);
 

Copied: slashjp/trunk/themes/slashcode/templates/rss_item_description;misc;default (from rev 740, slashjp/branches/2.5.0.192/themes/slashcode/templates/rss_item_description;misc;default)
===================================================================
--- slashjp/trunk/themes/slashcode/templates/rss_item_description;misc;default	                        (rev 0)
+++ slashjp/trunk/themes/slashcode/templates/rss_item_description;misc;default	2008-09-09 08:53:05 UTC (rev 741)
@@ -0,0 +1,29 @@
+__skin__
+default
+__description__
+これがそのまま description に入り、XML::RSS モジュールに渡される
+
+ * desc - description 本文
+ * more - 本文に続きがあるときにはその続き
+ * link - URL
+ * comment_link - コメントを書くときの URL
+__title__
+RSS アイテムの description
+__page__
+misc
+__lang__
+en_US
+__name__
+rss_item_description
+__template__
+[% desc %][% IF link %]
+<p>
+<a href="[% link %]">[% IF more && more.length > 0; "続きの" _ more.length _ "バイトを読む..."; ELSE; "続きを読む..."; END %]</a>
+[% IF comment_link %] | <a href="[% comment_link %]">コメントする</a>[% END %]
+</p>[% END %]
+
+
+__seclev__
+10000
+__version__
+


Slashdotjp-dev メーリングリストの案内
Back to archive index