📄 blog-shout.php
字号:
<?php
/*
Plugin Name: Blog Shout
Plugin URI: http://www.pkphp.com/blog-shout/
Description: This plugin create shout box to easily edit.
Author: askie
Version: 0.2
Author URI: http://www.pkphp.com
*/
//鍩烘湰璁剧疆
function bs_generalsetting()
{
if ($_POST['flag']=="general")
{
foreach ($_POST as $key=>$value)
{
if ($key=="bs_templet")
{
$ckeys=array("[title]","[body]","[date]");
foreach ($ckeys as $tag)
{
if (strstr($value,$tag)==false)
{
echo '<div class="updated"><p>'.__("[title],[body],[date] must be added in templet.","BlogShout").'</p></div>';
$failure=true;
break 2;
}
}
}
if (strstr($key,"bs_")==$key)
{
update_option($key, stripslashes($value));
}
}
if ($failure<>true)
{
echo '<div class="updated"><p>General setting saved!</p></div>';
}
}
?>
<div class="wrap">
<table width="100%" border="0" cellpadding="3">
<tr>
<td valign="top">
<form name="updateoption" method="post">
<input type="hidden" name="flag" value="general">
<table class="form-table">
<tr>
<th nowrap><? _e("Output:","BlogShout");?></th>
<td>
<? bs_script(); ?>
<div>
<?
$style=stripslashes(get_option("bs_style"));
$templet=stripslashes(get_option("bs_templet"));
$ckeys=array("[title]","[body]","[date]");
$cvalue=array(get_option("bs_widget_title"),get_option("bs_widget_text"),get_option("bs_widget_mdate"));
$templet=str_replace($ckeys,$cvalue,$templet);
echo $style;
echo $templet;
?>
</div>
</td>
</tr>
<tr>
<th nowrap><? _e("Output templet:","BlogShout");?></th>
<td>
<?
$templet=stripslashes(get_option("bs_templet"));
?>
<textarea name="bs_templet" style="width:400px;height:300px;"><?=$templet?></textarea><br>
[title],[body],[date] must be added in.
</td>
</tr>
<tr>
<th nowrap><? _e("CSS style:","BlogShout");?></th>
<td>
<?
$style=stripslashes(get_option("bs_style"));
?>
<textarea name="bs_style" style="width:400px;height:300px;"><?=$style?></textarea>
</td>
</tr>
</table>
<p><div class="submit"><input type="submit" name="update_rp" value="<?php _e('Save!', 'update_rp') ?>" style="font-weight:bold;" /></div></p>
</form>
</td>
<td valign="top" width="250">
</td>
</tr>
</table>
</div>
<?php
}
//杈撳嚭鍐呭
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -