その他?

pukiwiki tips

機能追加

MenuBar を 右側にも表示

ボタンの追加

はてなブックマーク ボタン

<!-- 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>

Facebook like ボタン

<!-- 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>

Twitter 共有ボタン

<!-- 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>

google +1 ボタン

<!-- 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>

共有ボタンの追加

<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 関連

patch コマンドによる適用

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

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

Pukiwiki全部からリンク切れリンクを探す

[[index.php?plugin=yetlist>http://tar3.net/pukiwiki/index.php?plugin=yetlist]]

Counter 関連

 Today : &counter(today);~
 Yesterday : &counter(yesterday);~
 Total : &counter(total);~

表全体を左側へ寄せる

トラブル関連

pkwk_chown(): flock() failed 対応

pgid plugin,htaccess 記述内容

pukiwiki ユーザー認証有効後、ページロードが終わらない

以下2つの機能を有効にするとページの読み込みが終わらなくなる

  1. cache
  2. counter
    • プラグインをリネーム
      • plugin/counter.inc.php
        |->plugin/counter.inc.php.bak
  3. pgid

エスケープ, 文字整形関連

行頭チルダのエスケープ(チルダを2つ書く)

{ 及び } のエスケープ

表内 | のエスケープ

表内先頭 ~ のエスケープ

表内の改行

タブを表示

&t;

Tips

ページ内リンクは改行できない


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