html validator
こないだの作業のときに使って、入れっぱなしにしてたんですが、激しく遅くなるんで止めました。
環境は、
- Ubuntu 8.04LTS
- firefox 3.0.10
- html validator 0.8.5.6
症状は、
- 右クリックするとメニューが出てくるのが激しく遅い。
- スクロールが激しく遅い。
- 何もかもが遅い。
- その時、CPU使用率は100%。
表示する度にチェックするんなら、当然といえば当然なんですが、その機能をoffにしても、なんか動いてるっぽいです。自動チェック機能をオフにする機能が機能していない感じです。
ほかのadd-onと当たってるかもしんないと思って、html validatorだけにしてみましたが、同じでした。
使う機会は滅多に無いんで、使うときだけ有効にするようにしました。
新しいギターを見せてあげる
http://mainichi.jp/enta/art/news/20090503k0000m040102000c.html
さよなら、キヨシロー。
作業軽減策。
MD Comics Neoのページですが、やっつけ風味の仕様になっていた、画像のタグ入れ部分を、爆乳様(仮名)の負担を軽減するためと、ミスする隙を埋めるために、仕様変更しました。
取り合えず要求仕様を満たすために、それぞれのサイズのタグをカスタムフィールドに入れるという、非常に回りくどい手順になっていましたが、その部分をこちらとこちらを参考にして、勝手にやってくれるようにしました。もはや、「投稿に挿入」すら必要ありませんw。
/* functions.php*/ function get_the_post_image($postid,$size,$order=0,$max=null) { $attachments = get_children(array( 'post_parent' => $postid, 'post_type' => 'attachment', 'post_mime_type' => 'image' )); if ( is_array($attachments) ){ foreach ($attachments as $key => $row) { $mo[$key] = $row->menu_order; $aid[$key] = $row->ID; } array_multisort($mo, SORT_ASC,$aid,SORT_ASC,$attachments); $max = empty($max)? $order+1 :$max; for($i=$order;$i<$max;$i++){ $the_image = $attachments[$i]; $attachmenturl = wp_get_attachment_url($the_image->ID); $attachmentimage = wp_get_attachment_image($the_image->ID, $size ); $img_title = $the_image->post_title; $img_desc = $the_image->post_excerpt; $img_alt = $the_image->post_name; if ($size == "thumbnail" || $size == "medium"){ $attachmentimage = preg_replace('/class="attachment.*?"/','class="alignright size-'.$size.'"',$attachmentimage);//CSSに合わせるため $attachmentimage = preg_replace('/alt=".*?"/','alt="'.attribute_escape($img_alt).'"',$attachmentimage);//altが直接拾えないので echo '<a href="'.clean_url($attachmenturl).'" rel="lightbox['.get_the_ID().']" title="'.attribute_escape($img_title).'">'.$attachmentimage.'</a>'; } elseif($size == "large") { $attachmentimage = preg_replace('/class="attachment.*?"/','class="alignright size-'.$size.'"',$attachmentimage); $attachmentimage = preg_replace('/alt=".*?"/','alt="'.attribute_escape($img_alt).'"',$attachmentimage); echo $attachmentimage; } else { echo '<img src="'.clean_url($attachmenturl).'">'; } } } } /* index.phpなどでの呼び出し部分*/ <?php get_the_post_image(get_the_ID(), 'thumbnail', 0, 1); ?> /* get_the_post_image($post_id, $size, $order, $max) $post_id= 記事ID $size = 画像のサイズ(thumbnail,medium,large,full) $order = ギャラリーでの順番 $max = $orderから何枚使うか *WebTecNoteさんより拝借。* */
WebTecNoteさんから、記事に添付された画像をソートする部分を拝借して、Forumからデータを拾う部分をいただいて、くっつけただけのものですが……。
これで、扉ページと、個別ページと、リストページに、それぞれ、何もせずに予定どおりの画像が入るようにできました。
先人の皆さんに感謝。
開店。
MDComicxNeoのホームページが開店しました。
今後も、ちまちま、小変更をすると思いますが、なんとかかんとか。
ただ、旧世代環境はざっくり無視したので、古い環境だとほとんどどうにもなってません(OS9のIEとか悲惨)。
画像表示に非標準な方法を使っているので、プラグインで出しているケータイ向けでは、文字情報しか見られませんが、その辺は改造していく予定です。