Skip to content

Instantly share code, notes, and snippets.

Avatar
🐵

Austin Lee lizheming

🐵
View GitHub Profile
View api.php
<?php
define(P2_PATH,'http://pagecookery.net/'); //输入你的PageCookery地址,不要忘记最后的"/"哦!
include("config.php");
mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PSSWORD) or
die("Could not connect: " . mysql_error());
mysql_select_db(DATABASE_DB_NAME);
View read.php
<?php
define(P2_PATH,'http://pagecookery.net/'); // please change to your P2 path, remember the ending slash.
function pcurl($url,$postargs=false)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
View quote_code.php
<code lang="php">
<?php
require_once("read.php"); //如果不是在首页调用的话则read.php替换为"你的typecho地址+read.php"
echo readit();
?>
</code>
View quote_code_by_austion.php
//这个是调用文件,具体看代码第4行就知道是哪段代码了
<div class="widget">
<div id="twitter"><img src="http://blog.imnerd.org/T.png"></div>
<div class="pagecookery">
<?php
require_once("read.php");
echo readit();
?>
</div>
</div>
View microblog.php
<?php
/**
* MicroBlog
* Author:怡红公子
* @package custom
*/
?>
<?php $this->need('header.php'); ?>
<div class="grid_10" id="content">
View rss_update.php
<?php
ob_start();
$entry = $SQL->RunQuery("SELECT * FROM entry ORDER BY time DESC LIMIT 0, 50");
$title = SITE_NAME . ' - RSS';
echo urldecode('%3C%3Fxml+version=%221.0%22+encoding=%22utf-8%22%3F%3E');
?><rss version="2.0">
<channel>
View pagecookery_list.css
.pagecookery_list {
list-style-type:disc;
font-size:14px;
color:#666666;
line-height:1.7;
font-family:Georgia,Times,"Times New Roman",serif;
}
.pagecookery_list li {
border-bottom:1px dashed #CCCCCC;
list-style-type:none;
@lizheming
lizheming / gist:831320
Created Feb 17, 2011
last_entry的评论样式修改
View gist:831320
<ul id="reply_contents_{$last_entry['id']}">
<!--{if ($SQL->GetNumRows($last_entry_reply) > 0)}-->
<!--{while ($message = $SQL->FetchArray($last_entry_reply))}-->
<php>$ip = explode('.', $message['ip']);</php>
<li id="reply_item_{$message['id']}">
<div class="reply_avatar">
<img src="<echo>"http://www.gravatar.com/avatar/" . md5( strtolower( trim( $message['email'] ) ) ) . "?d=" . urlencode( "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=40") . "&s=40";</echo>" alt="" />
</div>
<!--{if ($message['userid'] > 0)}--><span style="color:red"><echo>get_username_by_id($message['userid'])</echo>:</span><!--{else if ($message['geo'] == 'owner')}--><span style="color:red">博主:</span><!--{else}--><span style="color:#666"><!--{if ($message['nickname'])}--><strong><a href="{$message['url']}" target="_blank">{$message['nickname']}</a></strong> {$message['geo']}<!--{else}-->{$message['geo']} 网友<!--{/if}--> ({$ip[0]}.{$ip[1]}.{$ip[2]}.*):</span><!--{/if}--><br />
<echo>strip_tags($message['message
@lizheming
lizheming / gist:831323
Created Feb 17, 2011
entry评论样式的修改
View gist:831323
<ul id="reply_contents_{$item['id']}">
<!--{if ($SQL->GetNumRows($reply) > 0)}-->
<!--{while ($message = $SQL->FetchArray($reply))}-->
<php>$ip = explode('.', $message['ip']);</php>
<li id="reply_item_{$message['id']}">
<div class="reply_avatar"><img src="<echo>"http://www.gravatar.com/avatar/" . md5( strtolower( trim( $message['email'] ) ) ) . "?d=" . urlencode( "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=40") . "&s=40";</echo>" alt="" /></div>
<!--{if ($message['userid'] > 0)}--><span style="color:red"><echo>get_username_by_id($message['userid'])</echo>:</span><!--{else if ($message['geo'] == 'owner')}--><span style="color:red">博主:</span><!--{else}--><span style="color:#666"><!--{if ($message['nickname'])}--><strong><a href="{$message['url']}" target="_blank">{$message['nickname']}</a></strong> {$message['geo']}<!--{else}-->{$message['geo']} 网友<!--{/if}--> ({$ip[0]}.{$ip[1]}.{$ip[2]}.*):</span><!--{/if}--> <br />
<echo>strip_tags($message['message'])</echo> <!--{if ($message['time']
@lizheming
lizheming / gist:831336
Created Feb 17, 2011
last_entry评论框样式修改
View gist:831336
<p>
<!--{if ($options['allow_comment'] == 'false')}-->
<i>评论功能已关闭.</i>
<!--{else}-->
<!--{if (!$is_guest)}-->
登录身份:<a href="?act=profile"><echo>get_username_by_id($User['id'])</echo></a>.&nbsp;<a href="?act=logout">退出»</a>
<!--{else}-->
<input type="text" class="content" name="nickname" value="昵称" onblur="if(this.value==''){this.value='昵称';}" onfocus="if(this.value=='昵称'){this.value=''};" onkeydown="if(event.keyCode==13){return false;}" maxlength="10" style="width: 60px; margin: 0 10px 0 0; border-top: 0; border-left: 0; border-right: 0;background: transparent url(../images/name.png) no-repeat scroll left center;" id="reply_nickname_{$last_entry['id']}" />
<input type="text" class="content" name="email" value="邮箱"onblur="if(this.value==''){this.value='邮箱';}" onfocus="if(this.value=='邮箱'){this.value=''};" onkeydown="if(event.keyCode==13){return false;}" maxlength="50" style="width: 60px; margin: 0 10px 0 0; border-top: 0; border-left: 0; border-right: 0;background: transparent url(../images/mail.png) no-repe
You can’t perform that action at this time.