PyukiWiki CVS Commit
pyuki****@lists*****
2012年 7月 28日 (土) 03:49:25 JST
Index: PyukiWiki-Devel-UTF8/plugin/ad.inc.pl diff -u PyukiWiki-Devel-UTF8/plugin/ad.inc.pl:1.348 PyukiWiki-Devel-UTF8/plugin/ad.inc.pl:1.349 --- PyukiWiki-Devel-UTF8/plugin/ad.inc.pl:1.348 Sat Jul 28 01:08:57 2012 +++ PyukiWiki-Devel-UTF8/plugin/ad.inc.pl Sat Jul 28 03:49:25 2012 @@ -1,6 +1,6 @@ ###################################################################### # ad.inc.pl - This is PyukiWiki, yet another Wiki clone. -# $Id: ad.inc.pl,v 1.348 2012/07/27 16:08:57 papu Exp $ +# $Id: ad.inc.pl,v 1.349 2012/07/27 18:49:25 papu Exp $ # # "ad" ver 1.08 $$ # Author: Nanami http://nanakochi.daiba.cx/ @@ -37,6 +37,7 @@ @::AD_DB; %::AD_DB_MEMO; +%::AD_DB_ALT; %::AD_DB_HTML; %::AD_DB_CREATE; %::AD_DB_UPDATE; @@ -111,10 +112,13 @@ $ret=~s/<[Aa]\s/\f /g; # $ret=~s/\f(([^<]*))[Hh][Rr][Ee][Ff]="?(($::isurl_ad))"?(([^<]*))>(([^\f]*))<\/[Aa]>/@{[&make_link_target("$::script?cmd=ad&c=@{[$loop++]}&p=@{[&dbmname($::form{mypage})]}&l=$id", "adlink", "_blank", $8, 1)]}$8<\/a>/g; $ret=~s/\f(([^<]*))[Hh][Rr][Ee][Ff]="?(($::isurl_ad))"?(([^<]*?))>(([^\f]*?))<\/[Aa]>/<a href="$4" target="_blank" class="adlink">$8<\/a>/g; +# while($ret=~/($::isurl_ad)/) { $ret=~s/($::isurl_ad)/@{["$::script?cmd=ad&c=@{[$loop++]}&p=@{[&dbmname($::form{mypage})]}&l=$id"]}/gm; +# $loop++; +# } $ret=~s/<[Ii][Mm][Gg] (([^<]*)) [Ww][Ii][Dd][Tt][Hh]="1p?x?" [Hh][Ee][Ii][Gg][Hh][Tt]="1p?x?" (([^<]*))>/<img $1 class="addmy" $3>/g; $ret=~s/<[Ii][Mm][Gg] (([^<]*)) [Hh][Ee][Ii][Gg][Hh][Tt]="1p?x?" [Ww][Ii][Dd][Tt][Hh]="1p?x?" (([^<]*))>/<img $1 class="addmy" $3>/g; - +# $ret=~s/<[Ii][Mm][Gg] (([^<]*)) width="1p?x?" height="1p?x?" (([^<]*))>//g; if($::AD_LOADED eq 0) { $::AD_LOADED=1; $::IN_HEAD.=<<EOM; @@ -136,7 +140,22 @@ chomp; next if(/^\/\//); # åºåå - if(/^\*\*\*(.*?)\t(.*?)\t(\d+)\t(\d+)\t(\d+)\t(\d+)\t(\d+)/ && $space ne '') { + if(/^\*\*\*(.*?)\t(.*?)\t(\d+)\t(\d+)\t(\d+)\t(\d+)\t(\d+)\t(.*)/ && $space ne '') { + $id=$1; + my $pr=$3; + my $st=$4; + my $ex=$5; + my $cr=$6; + my $up=$7; + $::AD_DB_MEMO{"$hex\_$id"}=$2; + $::AD_DB_ALT{"$hex\_$id"}=$8; + $::AD_DB_PRIORITY{"$hex\_$id"}=$pr; + $::AD_DB_START{"$hex\_$id"}=$st; + $::AD_DB_EXPIRE{"$hex\_$id"}=$ex; + $::AD_DB_CREATE{"$hex\_$id"}=$cr; + $::AD_DB_UPDATE{"$hex\_$id"}=$up; + $::AD_DB{$hex}.="$id\f"; + } elsif(/^\*\*\*(.*?)\t(.*?)\t(\d+)\t(\d+)\t(\d+)\t(\d+)\t(\d+)/ && $space ne '') { $id=$1; my $pr=$3; my $st=$4; @@ -144,6 +163,7 @@ my $cr=$6; my $up=$7; $::AD_DB_MEMO{"$hex\_$id"}=$2; + $::AD_DB_ALT{"$hex\_$id"}=""; $::AD_DB_PRIORITY{"$hex\_$id"}=$pr; $::AD_DB_START{"$hex\_$id"}=$st; $::AD_DB_EXPIRE{"$hex\_$id"}=$ex; Index: PyukiWiki-Devel-UTF8/plugin/ad_edit.inc.pl diff -u PyukiWiki-Devel-UTF8/plugin/ad_edit.inc.pl:1.344 PyukiWiki-Devel-UTF8/plugin/ad_edit.inc.pl:1.345 --- PyukiWiki-Devel-UTF8/plugin/ad_edit.inc.pl:1.344 Mon Jul 16 22:36:34 2012 +++ PyukiWiki-Devel-UTF8/plugin/ad_edit.inc.pl Sat Jul 28 03:49:25 2012 @@ -1,8 +1,8 @@ ###################################################################### # ad_edit.inc.pl - This is PyukiWiki, yet another Wiki clone. -# $Id: ad_edit.inc.pl,v 1.344 2012/07/16 13:36:34 papu Exp $ +# $Id: ad_edit.inc.pl,v 1.345 2012/07/27 18:49:25 papu Exp $ # -# "ad" ver 1.07 $$ +# "ad" ver 1.08 $$ # Author: Nanami http://nanakochi.daiba.cx/ # Copyright (C) 2004-2012 Nekyo # http://nekyo.qp.land.to/ @@ -18,7 +18,7 @@ ###################################################################### $PLUGIN="ad"; -$VERSION="1.07"; +$VERSION="1.08"; use strict; use Digest::MD5 qw(md5_hex); @@ -94,7 +94,7 @@ $hex=~ s/(.)/unpack('H2', $1)/eg; $dbbody.="**$space\t$::AD_DB{__width}{$hex}x$::AD_DB{__height}{$hex}\n"; foreach my $id(split(/\f/,$::AD_DB{$hex})) { - $dbbody.=qq(***$id\t$::AD_DB_MEMO{"$hex\_$id"}\t$::AD_DB_PRIORITY{"$hex\_$id"}\t$::AD_DB_START{"$hex\_$id"}\t$::AD_DB_EXPIRE{"$hex\_$id"}\t$::AD_DB_CREATE{"$hex\_$id"}\t$::AD_DB_UPDATE{"$hex\_$id"}\n); + $dbbody.=qq(***$id\t$::AD_DB_MEMO{"$hex\_$id"}\t$::AD_DB_PRIORITY{"$hex\_$id"}\t$::AD_DB_START{"$hex\_$id"}\t$::AD_DB_EXPIRE{"$hex\_$id"}\t$::AD_DB_CREATE{"$hex\_$id"}\t$::AD_DB_UPDATE{"$hex\_$id"}\t$::AD_DB_ALT{"$hex\_$id"}\n); foreach my $html(split(/\n/,$::AD_DB_HTML{"$hex\_$id"})) { $dbbody.=" $html\n"; } @@ -212,6 +212,7 @@ my $_id=$3; if($_mode eq 'update') { $::AD_DB_MEMO{"$_hex\_$_id"}=&code_convert(\$::form{"memo\_$_hex\_$_id"},$::defaultcode,$::kanjicode); + $::AD_DB_ALT{"$_hex\_$_id"}=&code_convert(\$::form{"alt\_$_hex\_$_id"},$::defaultcode,$::kanjicode); $::AD_DB_UPDATE{"$_hex\_$_id"}=time; $::AD_DB_START{"$_hex\_$_id"}=&selectdate("view","start\_$_hex\_$_id",-1); $::AD_DB_EXPIRE{"$_hex\_$_id"}=&selectdate("view","expire\_$_hex\_$_id",0); @@ -223,12 +224,12 @@ $space=~s/([A-Fa-f0-9][A-Fa-f0-9])/pack("C", hex($1))/eg; $form.=<<EOM; <h3>$space<br />$_id</h3> -<table><tr><td colspan="2"> +<table><tr><td> +$::resource{ad_plugin_msg_altconfirm}:$::AD_DB_ALT{"$_hex\_$_id"}<br /> $::resource{ad_plugin_msg_memo}:$::AD_DB_MEMO{"$_hex\_$_id"} </td></tr><tr><td valign="top"> $::resource{ad_plugin_msg_create}:@{[&selectdate("format","create",$::AD_DB_CREATE{"$_hex\_$_id"})]}<br /> $::resource{ad_plugin_msg_update}:@{[&selectdate("format","update",$::AD_DB_UPDATE{"$_hex\_$_id"})]}<br /> -</td><td valign="top" width="250"> $::resource{ad_plugin_msg_priority}:@{[&selectnum("view","priority\_$_hex\_$_id",0,10,$::AD_DB_PRIORITY{"$_hex\_$_id"})]}<br /> $::resource{ad_plugin_msg_start}:@{[&selectdate("format","start\_$_hex\_$_id",$::AD_DB_START{"$_hex\_$_id"})]}<br /> $::resource{ad_plugin_msg_end}:@{[&selectdate("format","expire\_$_hex\_$_id",$::AD_DB_EXPIRE{"$_hex\_$_id"})]}<br /></td></tr></table> @@ -271,13 +272,33 @@ $i++; $::IN_HEAD.=<<EOM if($::IN_HEAD!~/Display/); <script type="text/javascript"><!-- -function Display(b,a){if(d.all||d.getElementById){if(d.all){obj=d.all(b).style}else{if(d.getElementById){obj=d.getElementById(b).style}}if(a=="view"){obj.display="block"}else{if(a=="none"){obj.display="none"}else{if(obj.display=="block"){obj.display="none"}else{if(obj.display=="none"){obj.display="block"}}}}}}; +//\@\@yuicompressor_js="./plugin/ad_edit.inc.js"\@\@ +function Display(id,mode){ + if(d.all || d.getElementById){ //IE4, NN6 or later + if(d.all){ + obj = d.all(id).style; + }else if(d.getElementById){ + obj = d.getElementById(id).style; + } + if(mode == "view") { + obj.display = "block"; + } else if(mode == "none") { + obj.display = "none"; + } else if(obj.display == "block"){ + obj.display = "none"; //hidden + }else if(obj.display == "none"){ + obj.display = "block"; //view + } + } +} + //--></script> EOM $form.=<<EOM; <h3>$_<br />$id</h3> <table><tr><td colspan="2"> +$::resource{ad_plugin_msg_alt}:<input type="text" name="alt\_$hex\_$id" value="$::AD_DB_ALT{"$hex\_$id"}" size="$ad_text" /><br /> $::resource{ad_plugin_msg_memo}:<input type="text" name="memo\_$hex\_$id" value="$::AD_DB_MEMO{"$hex\_$id"}" size="$ad_text" /> </td></tr><tr><td valign="top"> $::resource{ad_plugin_msg_create}:@{[&selectdate("format","create",$::AD_DB_CREATE{"$hex\_$id"})]}<br /> @@ -345,9 +366,10 @@ $height=$::form{height}; $width=$::form{width}; $title=$::resource{ad_plugin_msg_finish}; + my $alt=$::form{alt}; my $size; if($width eq 1) { - $size=sprintf($::resource{ad_plugin_msg_text}); + $size=sprintf($::resource{ad_plugin_msg_adtext}); } elsif($height eq 1) { $size=sprintf($::resource{ad_plugin_msg_w}, $width); } else { @@ -359,6 +381,7 @@ $form.=<<EOM; $::resource{ad_plugin_msg_space}: $space<br /> $::resource{ad_plugin_msg_id}: $id<br /> +$::resource{ad_plugin_msg_altconfirm}: @{[$alt eq "" ? $::resource{ad_plugin_msg_altconfirm_none} : $alt]}<br /> $size<br /> $::resource{ad_plugin_msg_priority}:@{[&selectnum("view","priority",0,10,3)]}<br /> $::resource{ad_plugin_msg_start}:@{[&selectdate("format","start",-1)]}<br /> @@ -386,6 +409,7 @@ $::AD_DB_HTML{"$space\_$id"}=$::form{mymsg}; $::AD_DB_CREATE{"$space\_$id"}=time; $::AD_DB_UPDATE{"$space\_$id"}=time; + $::AD_DB_ALT{"$space\_$id"}=$alt; $::AD_DB_START{"$space\_$id"}=&selectdate("view","start",-1); $::AD_DB_EXPIRE{"$space\_$id"}=&selectdate("view","expire",0); $::AD_DB_PRIORITY{"$space\_$id"}=&selectnum("view","priority",0,10,3); @@ -422,7 +446,7 @@ $title=$::resource{ad_plugin_msg_confirm}; my $size; if($width eq 1) { - $size=sprintf($::resource{ad_plugin_msg_text}); + $size=sprintf($::resource{ad_plugin_msg_adtext}); } elsif($height eq 1) { $size=sprintf($::resource{ad_plugin_msg_w}, $width); } else { @@ -431,6 +455,7 @@ $mymsg=&htmlspecialchars($::form{mymsg}); $::form{space}=$space; $id=md5_hex(sprintf("%s:%03d:%03d",$::form{mymsg},$::form{width},$::form{height})); + my $alt=$::form{alt}; foreach my $spc(@::AD_DB) { my $tmph=$spc; $tmph=~ s/(.)/unpack('H2', $1)/eg; @@ -445,6 +470,7 @@ $form.=<<EOM; $::resource{ad_plugin_msg_space}: $space<br /> $::resource{ad_plugin_msg_id}: $id<br /> +$::resource{ad_plugin_msg_altconfirm}: @{[$alt eq "" ? $::resource{ad_plugin_msg_altconfirm_none} : $alt]}<br /> $size<br /> $::resource{ad_plugin_msg_html}: <br /> <textarea cols="$ad_cols" rows="$ad_rows" name="mymsg">$mymsg</textarea><br /> @@ -458,6 +484,7 @@ <input type="hidden" name="selspace" value="$::form{selspace}" /> <input type="hidden" name="width" value="$width" /> <input type="hidden" name="height" value="$height" /> +<input type="hidden" name="alt" value="$alt" /> EOM $last.=qq(<hr />$::form{mymsg}); } @@ -503,6 +530,7 @@ <input type="hidden" name="height" value="$height" /> <input type="hidden" name="mymsg" value="$mymsg" /><br /> <hr /> +$::resource{ad_plugin_msg_alt}:<input type="text" name="alt" value="$::form{alt}" size="$ad_text" /><br /> $::resource{ad_plugin_msg_newspace}:<input type="text" name="newspace" value="$::form{newspace}" size="$ad_text" /><br /> $::resource{ad_plugin_msg_selspace}:<select name="selspace">$sel</select> EOM @@ -598,7 +626,6 @@ return "$name($width x $height)"; } - sub selectdate { my($md,$s,$t,$y,$m,$d)=@_; my $str;