Skip to content

Instantly share code, notes, and snippets.

View lizheming's full-sized avatar
:octocat:

Austin Lee lizheming

:octocat:
View GitHub Profile
@lizheming
lizheming / gist:831339
Created February 17, 2011 09:00
entry评论框样式修改
<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_{$item['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-repeat scr
@lizheming
lizheming / gist:831340
Created February 17, 2011 09:01
httprequest.php send reply修改
case 'sendreply':
if ($options['allow_comment'] == 'false')
{
Helper::PrintJavaScript("alert('对方评论功能已经关闭'); window.location = '" . BASE_URL . "?act=view&id=" . intval($_POST['entryid']) . "';");
}
if (intval($_POST['entryid']) > 0 AND trim($_POST['message']))
{
if ($is_guest)
{
/*我添加的自定义函数*/
function CKURL($url){
if($url=="")return "none";else
if(strlen($url)>50)return "none";else
if($url=="none")return "none";else
if(ereg("[a-zA-z]+://[^\s]*",$url))return $url;else
return "http://".$url;
}
function sendReply(id)
{
if ($('#reply_message_' + id).val() == '')
{
alert('请输入回复内容.');
return false;
}
var replyid = id;
{template header}
<style type="text/css">
@import 'css/jquery.lightbox.css';
</style>
<script type="text/javascript" src="javascript/jquery.lightbox.js"></script>
<script type="text/javascript">
$(document).ready(function () {
{template header}
<div id="main">
<div class="comment_box">
<!--{while ($item = $SQL->FetchArray($comments))}-->
<php>$even = $even == 'even' ? 'odd' : 'even'</php>
<div class="item">
<img src="<echo>"http://www.gravatar.com/avatar/" . md5( strtolower( trim( $item['email'] ) ) ) . "?d=" . urlencode( "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=40") . "&s=40";</echo>" class="avatar_{$even}" alt="<!--{if ($item['nickname'])}-->{$item['nickname']}<!--{else}-->{$item['geo']} 网友<!--{/if}-->" />
<div class="text_main_{$even}">
<div class="text"><a href="?act=view&id={$item['entryid']}"><span class="nickname"><!--{if ($item['nickname'])}-->{$item['nickname']}<!--{else}-->{$item['geo']} <t>网友</t><!--{/if}--></span>: <echo>strip_tags($item['message'])</echo></a> <span class="time">(<echo>Format::Date($item['time'])</echo>)</span></div>
@lizheming
lizheming / sina_statuses_by_jQuery.html
Created January 4, 2012 02:10
jQ显示新浪微博消息
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<div id="sina"></div>
<script type="text/javascript">
$(function() {
$.getJSON('https://api.weibo.com/2/statuses/user_timeline.json?source=2546437393&screen_name=mattdallas&callback=?', function(content){
var statuses = content.data.statuses;
@lizheming
lizheming / get_status_in_a_week.php
Created February 14, 2012 13:03
获取一周内的新浪微博消息
<?php
function wholeweek($gdate = "", $first = 0) //get the week's start time and end time
{
if (!$gdate) $gdate = date("Y-m-d");
$w = date("w", strtotime($gdate));
$dn = $w ? $w - $first : 6;
$st = date("Y-m-d", strtotime("$gdate -" . $dn . " days"));
$en = strtotime("$st +6 days");
return array(strtotime($st),$en);
@lizheming
lizheming / xiami_decode.py
Created April 29, 2012 15:04 — forked from dndx/xiami_decode.py
Xiami URL Decoder
import urllib2
def xiami_decode(s):
s = s.strip()
if not s:
return False
result = []
line = int(s[0])
rows = len(s[1:]) / line
extra = len(s[1:]) % line
@lizheming
lizheming / badge.php
Created October 23, 2012 10:05
PageCookery网站挂件主文件
<?php
header('Content-Type:application/javascript;charset=utf-8');
require_once("global.php");
if (!isset($_GET['mount'])){
$_GET['mount']='10';
}
?>
document.getElementById('pagecookery').innerHTML='<?php
if(ereg("^[0-9]*$",$_GET['mount'])){
$sql='SELECT * FROM entry ORDER BY time DESC LIMIT '.$_GET['mount'];