Created
October 23, 2012 10:05
-
-
Save lizheming/3938001 to your computer and use it in GitHub Desktop.
PageCookery网站挂件主文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; | |
$entry = $db->query($sql)->result_array(); | |
echo '<style type="text/css">#pagecookery img {display:none;}</style><ul>'; | |
foreach($entry as $item){ | |
echo '<li>'; | |
echo '<span clss="entry">' . get_username_by_id($item['userid']) . '</span>'; | |
echo ':'; | |
echo Format::ParseBBCode( htmlspecialchars($item['content'],ENT_QUOTES)); | |
echo '<a href="' . BASE_URL .'?act=view&id=' . $item['id'] . '" target="_blank"><span class="time">' . Format::Time($item['time']) . '</span></a>'; | |
echo '</li>'; | |
} | |
echo '</ul>'; | |
}else{ | |
echo '这里没有你要的东西呢'; | |
} | |
?>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment