2015
Mar
28
28
NP_GeSHi2
NP_GeSHi2なる物をインストールしてみた。
<?php
if (!function_exists('sql_table')){
function sql_table($name) {
return 'nucleus_' . $name;
}
}
class NP_gobac extends NucleusPlugin {
function getEventList() { return array(); }
function getVersion() { return '0.00'; }
function getDescription() { return 'This plugin displays ';}
function supportsFeature($what) {
switch($what){
case 'SqlTablePrefix':
return 1;
default:
return 0;
}
}
function doSkinVar($skintype,$awp) {
global $itemid, $blogid;
$caturl = createBlogidLink($blogid);
$qut = "SELECT * FROM ". sql_table("item") . " WHERE inumber=$itemid";
$rst = mysql_query($qut);
while($rowt = mysql_fetch_array($rst)){
$itm='"'.$rowt[6].'"';
}
$qu = "SELECT * FROM ". sql_table("item") . " WHERE itime>=$itm and iblog=$blogid";
$rs4 = mysql_query($qu);
$row1 = mysql_num_rows($rs4);
$tpg = ceil($row1/$awp);
if($tpg>1){
$tpg = '/page/'.$tpg;
}else{
$tpg = '';
}
echo $caturl. $tpg.'#'. $itemid;
}
}
?>
<?php
if (!function_exists('sql_table')){
function sql_table($name) {
return 'nucleus_' . $name;
}
}
class NP_gobac extends NucleusPlugin {
function getEventList() { return array(); }
function getVersion() { return '0.00'; }
function getDescription() { return 'This plugin displays ';}
function supportsFeature($what) {
switch($what){
case 'SqlTablePrefix':
return 1;
default:
return 0;
}
}
function doSkinVar($skintype,$awp) {
global $itemid, $blogid;
$caturl = createBlogidLink($blogid);
$qut = "SELECT * FROM ". sql_table("item") . " WHERE inumber=$itemid";
$rst = mysql_query($qut);
while($rowt = mysql_fetch_array($rst)){
$itm='"'.$rowt[6].'"';
}
$qu = "SELECT * FROM ". sql_table("item") . " WHERE itime>=$itm and iblog=$blogid";
$rs4 = mysql_query($qu);
$row1 = mysql_num_rows($rs4);
$tpg = ceil($row1/$awp);
if($tpg>1){
$tpg = '/page/'.$tpg;
}else{
$tpg = '';
}
echo $caturl. $tpg.'#'. $itemid;
}
}
?>
NP_GeSHi2.phpと
GeSHi libraryから GeSHi version 1.0.7.20をダウンロードしgeshiディレクトリとgeshi.phpをupしてインストール
でOK
php,css,HTML,rubyとかいろいろ色分けしてくれる。よ。