<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Welcart コミュニティー&#124;ECサイト構築プラグイン &#187; 警告</title>
	<atom:link href="http://www.welcart.com/community/archives/tag/%e8%ad%a6%e5%91%8a/feed" rel="self" type="application/rss+xml" />
	<link>http://www.welcart.com/community</link>
	<description>Welcart に関する情報を交換しましょう</description>
	<lastBuildDate>Tue, 07 Feb 2012 09:28:51 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>SSL で警告が出る Lightbox 2　と　FancyBox の対処法</title>
		<link>http://www.welcart.com/community/archives/1912</link>
		<comments>http://www.welcart.com/community/archives/1912#comments</comments>
		<pubDate>Fri, 23 Jul 2010 01:46:06 +0000</pubDate>
		<dc:creator>nanbu</dc:creator>
				<category><![CDATA[技術資料]]></category>
		<category><![CDATA[FancyBox]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[警告]]></category>

		<guid isPermaLink="false">http://www.welcart.com/community/?p=1912</guid>
		<description><![CDATA[この警告はインターネット・エクスプローラーのものです。Welcart で、https:// で始まるページを閲覧中に目にするものです。この警告が出る原因は大きく分けて2つ有ります。 一つは、テンプレートを編集中に画像等の [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-1913" title="ie_alert" src="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/07/ie_alert-300x115.jpg" alt="" width="300" height="115" />この警告はインターネット・エクスプローラーのものです。Welcart で、https:// で始まるページを閲覧中に目にするものです。この警告が出る原因は大きく分けて2つ有ります。<br />
一つは、テンプレートを編集中に画像等のURLを直書きしてしまった場合。もう一つは、使用しているプラグインが、スタイルシートなどのlink タグを直書きしてしまっている場合です。<br />
前者は自分で編集しているので察しが付くでしょうが、プラグインが原因となるとお手上げです。本来なら作者にお願いすべきでしょうが、英語で説明するのはプラグインをカスタマイズするよりも難しいｗ</p>
<p>そこで、特に報告の多い「Lightbox 2」と「FuncyBox for WordPress」の2つのプラグインでの対処法を説明いたします。つまり本体へのハックです。（フックが無かったのでハックするしかありませんでした）<span id="more-1912"></span><br />
<br class="_space" /></p>
<h3>Lightbox 2 での対処</h3>
<p>修正箇所は2箇所です。</p>
<p><span style="font-size: xx-large;">1.</span> lightbox2.php 内にある関数、lightbox_styles() を次のように書き換えます。</p>
<pre class="brush: php; title: ; notranslate">
function lightbox_styles() {
	/* What version of WP is running? */
	global $wp_version;
	global $stimuli_lightbox_plugin_prefix;
    /* The next line figures out where the javascripts and images and CSS are installed,
    relative to your wordpress server's root: */
    $lightbox_2_theme = urldecode(get_option('lightbox_2_theme'));
    $lightbox_style = ($stimuli_lightbox_plugin_prefix.&quot;Themes/&quot;.$lightbox_2_theme.&quot;/&quot;);

	wp_enqueue_style('lightbox_styles_customize', $lightbox_style.&quot;lightbox.css&quot;);
}
</pre>
<p><span style="font-size: xx-large;">2.</span>最後から2行目のアクションフックを変更します。</p>
<pre class="brush: php; title: ; notranslate">
add_action('wp_head', 'lightbox_styles');
↓
add_action('init', 'lightbox_styles');
</pre>
<p><br class="_space" /></p>
<h3>FuncyBox for WordPress での対処</h3>
<p>変更はfancybox.php 内、2箇所です。</p>
<p><span style="font-size: xx-large;">1.</span> 関数mfbfw_css() 内にある次の行を1行削除します。</p>
<pre class="brush: php; title: ; notranslate">
	echo &quot;\n&quot;.'&lt;link rel=&quot;stylesheet&quot; href=&quot;'. FBFW_URL . '/css/fancybox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;'.&quot;\n&quot;;
</pre>
<p><span style="font-size: xx-large;">2.</span> コードの一番最後に次のコードを付け足します。</p>
<pre class="brush: php; title: ; notranslate">
add_action('init', 'mfbfw_css_customize');
function mfbfw_css_customize(){
	$url = FBFW_URL . '/css/fancybox.css';
	wp_enqueue_style('mfbfw_css_customize', $url);
}
</pre>
<p><br class="_space" /><br />
<br class="_space" /><br />
どちらのプラグインも、スタイルシートをインクルードする際はwp_enqueue_style（） 関数を使うように変更しているだけです。</p>
<p>汎用性を持たせるために、WordPress には様々な関数が用意されていますが、wp_enqueue はこんなに重要だったんですね。プラグインを作るときは気をつけましょう。<br />
<br class="_space" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/1912/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

