#author("2018-10-16T11:41:25+09:00","default:dramsukohome","dramsukohome")
[[その他]]

#shadowheader(1,pukiwiki tips);

#contents




* 機能追加 [#wcaa318b]



** MenuBar を 右側にも表示 [#d962cf92]
- cd plugin
- cp menu.inc.php menu2.inc.php
- vi menu2.inc.php
-- function plugin_menu_convert()
-- > function plugin_menu2_convert()
- index.php?MenuBar2 の編集
- vi pukiwiki.ini.php
-- 追加 $menubar2 = 'MenuBar2';
- vi plugin/menu2.inc.php
-- 変更 global $script,$vars,$menubar2;
-- 変更 $page = ($menu === NULL) ? $menubar2 : $menu;
- vi skin/pukiwiki.skin.php
 <?php if (arg_check('read') && exist_plugin_convert('menu')) { ?>
 <table border="0" style="width:100%">
  <tr>
   <td class="menubar">
    <div id="menubar"><?php echo do_plugin_convert('menu') ?></div>
   </td>
   <td valign="top">
    <div id="body"><?php echo $body ?></div>
   </td>
  </tr>
 </table>
に次を追加。
 <?php if (exist_plugin_convert('menu2')) { ?>
  <td class="menubar2">
    <div id="menubar2">
      <?php echo do_plugin_convert('menu2') ?>
    </div>
  </td>
 <?php } ?>
以下のようになる。
 <?php if (arg_check('read') && exist_plugin_convert('menu')) { ?>
 <table border="0" style="width:100%">
  <tr>
   <td class="menubar">
    <div id="menubar"><?php echo do_plugin_convert('menu') ?></div>
   </td>
   <td valign="top">
    <div id="body"><?php echo $body ?></div>
   </td>
   <?php if (exist_plugin_convert('menu2')) { ?>
    <td class="menubar2">
      <div id="menubar2">
        <?php echo do_plugin_convert('menu2') ?>
      </div>
    </td>
   <?php } ?>
  </tr>
 </table>

- 参考~
[[ページ右側にもMenuBarがほしいです。>http://pukiwiki.sourceforge.jp/dev/?BugTrack%2F430]]



** ボタンの追加 [#dfc33a62]


*** はてなブックマーク ボタン [#gc3ea820]
 <!-- hatebu -->
 <a href="http://b.hatena.ne.jp/entry/<?php echo $link['reload'] ?>" 
 class="hatena-bookmark-button" 
 data-hatena-bookmark-title="dramsuko wiki" 
 data-hatena-bookmark-layout="standard-balloon" 
 title="このエントリーをはてなブックマークに追加"> 
 <img src="http://b.st-hatena.com/images/entry-button/button-only.gif" 
 alt="このエントリーをはてなブックマークに追加" 
 width="20" 
 height="20" 
 style="border: none;" /></a>
 <script type="text/javascript" 
 src="http://b.st-hatena.com/js/bookmark_button.js" 
 charset="utf-8" 
 async="async"></script>

-参考
--[[はてなブックマークボタンの作成・設置について:http://b.hatena.ne.jp/guide/bbutton]]


*** Facebook like ボタン [#hcd2fedb]
 <!-- facebook core -->
 <span id="fb-root"></span>
 <script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1";
   fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));</script>
 <!-- /facebook core -->
 <script>
 <!--
 var html = '<div class="fb-like" data-href="'+  encodeURIComponent(document.location) + '"  data-send="false" data- layout="button_count" data-width="450" data-show-faces="true"></div>';
 document.write(html);
 -->
 </script>

-参考
--[[Open Graph Overview - Facebook開発者:https://developers.facebook.com/docs/reference/plugins/like/]]


*** Twitter 共有ボタン [#d3fbe67c]
 <!-- Twitter -->
 <a href="https://twitter.com/share" class="twitter-share-button" data-lang="ja">ツイート</a>
  <script>!function(d,s,id){
    var js,
    fjs=d.getElementsByTagName(s) [0],
    p=/^http:/.test(d.location)?'http':'https';
    if(!d.getElementById(id)){
     js=d.createElement(s);
     js.id=id;
     js.src=p+'://platform.twitter.com/widgets.js';
     fjs.parentNode.insertBefore(js,fjs);
    }
  }(document, 'script', 'twitter-wjs'); 
 </script>

-参考
--[[ツイートボタン:https://twitter.com/about/resources/buttons]]


*** google +1 ボタン [#o1263ecd]
 <!-- google -->
 <!-- Place this tag in your head or just before your close body tag. -->
 <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
 </script>
 
 <!-- Place this tag where you want the +1 button to render. -->
 <div class="g-plusone" data-annotation="inline" data-width="300" 
  data-href="<? php echo $link['reload'] ?>"></div>

-参考
-- [[+1 Button - Google+ Platform &mdash; Google Developers:https://developers.google.com/+/web/+1button/?hl=ja]]


*** 共有ボタンの追加 [#jf43aad4]
-参考リンク
-- [[jQuery.socialbutton プラグインでソーシャルリンクボタンを付ける:http://dexlab.net/pukiwiki/index.php?Memo%2FWiki]]
-- [[Pinterest/Google+1/Twitter/facebookいいね!/facebook Share/mixiチェック/mixiイイネ!/GREEいいね/Evernote/はてブのボタンを超カンタンに作れる jQuery.socialbutton プラグインを作ったよ:http://itra.jp/jquery_socialbutton_plugin/]]

 <script src="skin/jquery.min.js" type="text/javascript"></script>
 <script src="skin/jquery.socialbutton.js" type="text/javascript"></script> 

 <!-- jquery.socialbutton -->
 
 <style>
	.clearfix:after {
		content: ".";
		display: block;
		height: 0;
		clear: both;
		visibility: hidden;
	}
 
	.clearfix {
		display: inline-block;
	}
 
	/* Hides from IE-mac \*/
	* html .clearfix {
		height: 1%;
	}
 
	.clearfix {
		display: block;
	}
	/* End hide from IE-mac */
 
	.block div {
		margin-right: 15px;
		float: left;
	}
 </style>
 
 <script>
	$(function() {
		$('#evernote').socialbutton('evernote', {
			url:document.URL,
			button: 'site-mem-22',
			styling: 'full'
		});
 
		$('#hatena').socialbutton('hatena', {
			url:document.URL
		});
 
		$('#twitter').socialbutton('twitter', {
			url:document.URL,
			button: 'horizontal',
			text: '',
			via: 'YOUR_TWITTER_ID'
		});
 
		$('#facebook_like').socialbutton('facebook_like', {
			button: 'button_count'
		});
 
		$('#google_plusone').socialbutton('google_plusone', {
			lang: 'ja',
			size: 'medium'
		});
	});
 </script>
 
 <br>
 
 <div class="block clearfix">
	<div id="evernote"></div>
	<div id="hatena"></div>
	<div id="twitter"></div>
	<div id="google_plusone"></div>
	<div id="facebook_like"></div>
 </div>



** bodycache 関連 [#p7e19573]
-[[PukiWiki bodycache改良版:http://jasmin.sakura.ne.jp/blog/PukiWiki/bodycache_kai]]


***patch コマンドによる適用 [#t4f4feb8]
 ls
 bodycache.patch  pukiwiki-1.5.1_utf8.zip
 unzip pukiwiki-1.5.1_utf8.zip
 cd pukiwiki-1.5.1_utf8
 patch -p1 < ../bodycache.patch


***reload.inc.php [#h5db09a2]
+PukiWikiのpluginディレクトリにreload.inc.phpを格納
+「?cmd=reload&page=ページ名」にアクセス
+指定したページのキャッシュが再生成



** Pukiwiki全部からリンク切れリンクを探す [#s2769a5b]
 [[index.php?plugin=yetlist>http://tar3.net/pukiwiki/index.php?plugin=yetlist]]



** Counter 関連 [#t7a72620]
  Today : &counter(today);~
  Yesterday : &counter(yesterday);~
  Total : &counter(total);~




* トラブル関連 [#f7874506]



** pkwk_chown(): flock() failed 対応 [#y292f39c]
- file.phpの598行目の$ffile = fopen($filename, 'r') orの'r'を'w+'に変更




** pgid plugin,htaccess 記述内容 [#p7f13259]
-ただし今はトラブルありで未使用(180930)
 RewriteEngine on
 RewriteRule ^([0-9]*)\.html$ index.php?plugin=pgid&id=$1



** pukiwiki ユーザー認証有効後、ページロードが終わらない [#oc49a572]
-「$edit_auth = 1;」を設定した後、pukiwikiページが表示されない
-認証方法を変更したら解決
 $auth_type = AUTH_TYPE_BASIC;



** 以下2つの機能を有効にするとページの読み込みが終わらなくなる [#n351f8d4]
+cache
+counter
--プラグインをリネーム
---plugin/counter.inc.php~
|->plugin/counter.inc.php.bak
+pgid



* エスケープ, 文字整形関連 [#g1c4ff67]



** 行頭チルダのエスケープ(チルダを2つ書く) [#xd9db4b4]
- 例: ~~/.bashrc



** { 及び } のエスケープ [#o7624525]
- {
 &#x7b;
- }
 &#x7d;



** 表内 | のエスケープ [#ud8abda1]
- |
 &#x7c;



** 表内先頭 ~ のエスケープ [#ud8abda1]
- 空白を頭に付ける。|~abc| -> | ~abc|



** タブを表示 [#e0146e28]
 &t;


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS