本文整理汇总了PHP中Blog::store方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::store方法的具体用法?PHP Blog::store怎么用?PHP Blog::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::store方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get($url) {
$url=trim($url);
if(!preg_match('/^http[s]*:/', $url)) return false;
$url_components = parse_url($url);
if($url_components[host] == get_server_name()) return false;
if(version_compare(phpversion(), '5.1.0') >= 0) {
$opts = array(
'http' => array('user_agent' => 'Mozilla/5.0 (compatible; Meneame; +http://meneame.net/) Gecko/Meneame Firefox', 'max_redirects' => 7),
'https' => array('user_agent' => 'Mozilla/5.0 (compatible; Meneame; +http://meneame.net/) Gecko/Meneame Firefox', 'max_redirects' => 7)
);
$context = stream_context_create($opts);
$url_ok = $this->html = file_get_contents($url, false, $context, 0, 200000);
} else {
$url_ok = $this->html = file_get_contents($url);
}
if (!$url_ok) return false;
$this->valid = true;
$this->url=$url;
if(preg_match('/charset=([a-zA-Z0-9-_]+)/i', $this->html, $matches)) {
$this->encoding=trim($matches[1]);
if(strcasecmp($this->encoding, 'utf-8') != 0) {
$this->html=iconv($this->encoding, 'UTF-8//IGNORE', $this->html);
}
}
if(preg_match('/<title>([^<>]*)<\/title>/i', $this->html, $matches)) {
$this->url_title=trim($matches[1]);
}
require_once(mnminclude.'blog.php');
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if(!$blog->read('key')) {
$blog->store();
}
$this->blog=$blog->id;
$this->type=$blog->type;
// Detect trackbacks
if (!empty($_POST['trackback'])) {
$this->trackback=trim($_POST['trackback']);
} elseif (preg_match('/trackback:ping="([^"]+)"/i', $this->html, $matches) ||
preg_match('/trackback:ping +rdf:resource="([^>]+)"/i', $this->html, $matches) ||
preg_match('/<trackback:ping>([^<>]+)/i', $this->html, $matches)) {
$this->trackback=trim($matches[1]);
} elseif (preg_match('/<a[^>]+rel="trackback"[^>]*>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
} elseif (preg_match('/<a[^>]+href=[^>]+>trackback<\/a>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
}
}
示例2: get
function get($url) {
$url=trim($url);
//$context = array('user_agent' => 'Mozilla/5.0 (compatible; Meneame; +http://meneame.net/)'); // for PHP5
if(!preg_match('/^http[s]*:/', $url) || !($this->html = file_get_contents($url))) {
return;
}
$this->valid = true;
$this->url=$url;
if(preg_match('/charset=([a-zA-Z0-9-_]+)/i', $this->html, $matches)) {
$this->encoding=trim($matches[1]);
if(strcasecmp($this->encoding, 'utf-8') != 0) {
$this->html=iconv($this->encoding, 'UTF-8//IGNORE', $this->html);
}
}
if(preg_match('/<title>([^<>]*)<\/title>/i', $this->html, $matches)) {
$this->url_title=trim($matches[1]);
}
require_once(mnminclude.'blog.php');
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if(!$blog->read('key')) {
$blog->store();
}
$this->blog=$blog->id;
$this->type=$blog->type;
// Detect trackbacks
if (!empty($_POST['trackback'])) {
$this->trackback=trim($_POST['trackback']);
} elseif (preg_match('/trackback:ping="([^"]+)"/i', $this->html, $matches) ||
preg_match('/trackback:ping +rdf:resource="([^>]+)"/i', $this->html, $matches) ||
preg_match('/<trackback:ping>([^<>]+)/i', $this->html, $matches)) {
$this->trackback=trim($matches[1]);
} elseif (preg_match('/<a[^>]+rel="trackback"[^>]*>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
} elseif (preg_match('/<a[^>]+href=[^>]+>trackback<\/a>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback=trim($matches2[1]);
}
}
}
示例3: count
//$count = $db->get_var("SELECT count(*) from blogs where blog_url regexp 'http://.+/.+'");
$count = $db->get_var("SELECT count(*) from blogs where blog_url regexp 'http://.+'");
echo "{$count} <br>\n";
flush();
$ids = $db->get_col("SELECT blog_id from blogs where blog_url regexp 'http://.+' order by blog_id asc");
foreach ($ids as $dbid) {
$blog->id = $dbid;
if (!$blog->read()) {
continue;
}
$url = $db->get_var("select link_url from links where link_blog = {$dbid} limit 1");
if (!empty($url)) {
$old_url = $blog->url;
$blog->find_base_url($url);
$old_key = $blog->key;
$blog->calculate_key();
if ($blog->url != $old_url || $old_key != $blog->key) {
echo "NEW: {$new_url} ({$old_url})<br>\n";
$old_id = $db->get_var("select blog_id from blogs where blog_key = '{$blog->key}' and blog_id != {$blog->id}");
if ($old_id > 0) {
echo "REPE: {$old_id} -> {$blog->id}<br>\n";
$db->query("update links set link_blog={$blog->id} where link_blog={$old_id}");
$db->query("delete from blogs where blog_id = {$old_id}");
}
$blog->store();
}
} else {
echo "Deleting {$dbid}\n";
$db->query("delete from blogs where blog_id = {$dbid}");
}
}
示例4: Blog
function create_blog_entry() {
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if(!$blog->read('key')) {
$blog->store();
}
$this->blog=$blog->id;
$this->type=$blog->type;
}
示例5: Blog
function create_blog_entry()
{
require_once mnminclude . 'blog.php';
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if (!$blog->read('key')) {
$blog->store();
}
$this->blog = $blog->id;
$this->type = $blog->type;
}
示例6: Blog
function create_blog_entry()
{
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if (!$blog->read('key') || $blog->type != 'noiframe' && $this->noiframe) {
if ($blog->type != 'noiframe' && $this->noiframe) {
$blog->type = 'noiframe';
syslog(LOG_INFO, "Meneame, changed to noiframe ({$blog->id}, {$blog->url})");
}
$blog->store();
}
$this->blog = $blog->id;
$this->type = $blog->type;
}
示例7: Blog
$is_admin = true;
}
if (strpos($call_script, '/blog/moderator/') !== false && $g_user->hasPermission('plugin_blog_moderator')) {
$is_moderator = true;
}
// Check permissions
if (!$g_user->hasPermission('plugin_blog_admin')) {
camp_html_display_error(getGS('You do not have the right to manage blogs.'));
exit;
}
$f_blog_id = Input::Get('f_blog_id', 'int');
$Blog = new Blog($f_blog_id);
if ($Blog->store($is_admin)) {
camp_html_add_msg(getGS('Blog saved.'), 'ok');
?>
<script language="javascript">
window.opener.location.reload();
window.close();
</script>
<?php
exit();
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Expires" content="now">
<link rel="stylesheet" type="text/css" href="<?php echo $Campsite['WEBSITE_URL']; ?>/admin-style/admin_stylesheet.css">
示例8: get
function get($url)
{
$url = trim($url);
if (Validate_URL != false) {
$r = new HTTPRequest($url);
$xxx = $r->DownloadToString();
} else {
$xxx = "";
$this->valid = true;
$this->url = $url;
return;
}
if (CHECK_SPAM && $this->check_spam($url)) {
$this->valid = false;
return;
}
if (!($this->html = $xxx)) {
return;
}
if ($xxx == "BADURL") {
$this->valid = false;
return;
}
$this->valid = true;
$this->url = $url;
if (preg_match('/charset=([a-zA-Z0-9-_]+)/i', $this->html, $matches)) {
$this->encoding = trim($matches[1]);
//you need iconv to encode to utf-8
if (function_exists("iconv")) {
if (strcasecmp($this->encoding, 'utf-8') != 0) {
//convert the html code into utf-8 whatever encoding it is using
$this->html = iconv($this->encoding, 'UTF-8//IGNORE', $this->html);
}
}
}
if (preg_match("'<title>([^<]*?)</title>'", $this->html, $matches)) {
$this->url_title = trim($matches[1]);
}
require_once mnminclude . 'blog.php';
$blog = new Blog();
$blog->analyze_html($this->url, $this->html);
if (!$blog->read('key')) {
$blog->store();
}
$this->blog = $blog->id;
$this->type = $blog->type;
// Detect trackbacks
if (!empty($_POST['trackback'])) {
$this->trackback = trim($_POST['trackback']);
} elseif (preg_match('/trackback:ping="([^"]+)"/i', $this->html, $matches) || preg_match('/trackback:ping +rdf:resource="([^>]+)"/i', $this->html, $matches) || preg_match('/<trackback:ping>([^<>]+)/i', $this->html, $matches)) {
$this->trackback = trim($matches[1]);
} elseif (preg_match('/<a[^>]+rel="trackback"[^>]*>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback = trim($matches2[1]);
}
} elseif (preg_match('/<a[^>]+href=[^>]+>trackback<\\/a>/i', $this->html, $matches)) {
if (preg_match('/href="([^"]+)"/i', $matches[0], $matches2)) {
$this->trackback = trim($matches2[1]);
}
}
}