本文整理汇总了PHP中get_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP get_settings函数的具体用法?PHP get_settings怎么用?PHP get_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_settings函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: upgrade_wp_tables
function upgrade_wp_tables()
{
global $xoopsDB;
require_once dirname(dirname(__FILE__)) . '/wp-config.php';
if ($xoopsDB->query("SHOW COLUMNS FROM " . wp_table('postmeta')) == false) {
$sql1 = "CREATE TABLE " . wp_table('postmeta') . " (\n\t\t\t\t\t\tmeta_id int(11) NOT NULL auto_increment,\n\t\t\t\t\t\tpost_id int(11) NOT NULL default '0',\n\t\t\t\t\t\tmeta_key varchar(255) default NULL,\n\t\t\t\t\t\tmeta_value text,\n\t\t\t\t\t\tPRIMARY KEY\t (meta_id),\n\t\t\t\t\t\tKEY post_id (post_id),\n\t\t\t\t\t\tKEY meta_key (meta_key)\n\t\t\t\t\t)";
$xoopsDB->query($sql1);
$GLOBALS['msgs'][] = "TABLE " . wp_table('postmeta') . " is added.";
}
if (!$xoopsDB->getRowsNum($xoopsDB->query("SHOW COLUMNS FROM " . wp_table('comments') . " LIKE 'comment_type'"))) {
$sql1 = "ALTER TABLE " . wp_table('comments') . " ADD (\n\t\t\t\t\t\tcomment_agent varchar(255) NOT NULL default '',\n\t\t\t\t\t\tcomment_type varchar(20) NOT NULL default '',\n\t\t\t\t\t\tcomment_parent int(11) NOT NULL default '0',\n\t\t\t\t\t\tuser_id int(11) NOT NULL default '0'\n\t\t\t\t\t)";
$xoopsDB->query($sql1);
$GLOBALS['msgs'][] = "TABLE " . wp_table('comments') . " is modified.";
}
# --------------------------------------------------------
if ($xoopsDB->query("DELETE FROM " . wp_table('options') . " WHERE option_id =7 AND option_name ='new_users_can_blog'")) {
$xoopsDB->query("DELETE FROM " . wp_table('optiongroup_options') . " WHERE group_id=6 AND option_id =7");
}
if ($xoopsDB->query("DELETE FROM " . wp_table('options') . " WHERE option_id =8 AND option_name ='users_can_register'")) {
$xoopsDB->query("DELETE FROM " . wp_table('optiongroup_options') . " WHERE group_id=6 AND option_id =8");
}
if ($xoopsDB->query("DELETE FROM " . wp_table('options') . " WHERE option_id =91 AND option_name ='gzipcompression'")) {
$xoopsDB->query("DELETE FROM " . wp_table('optiongroup_options') . " WHERE group_id=6 AND option_id =91");
}
if (!get_settings('use_comment_preview')) {
add_option('use_comment_preview', '0', 2, "Display Preview Screen after comment posting.", 2, 8);
}
if (!get_settings('active_plugins')) {
add_option('active_plugins', "\n");
}
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:onupdate.inc.php
示例2: timesince
function timesince()
{
global $post;
$older_date = abs(strtotime($post->post_date_gmt . " GMT"));
$newer_date = time();
$chunks = array(array(60 * 60 * 24 * 365, 'year'), array(60 * 60 * 24 * 30, 'month'), array(60 * 60 * 24 * 7, 'week'), array(60 * 60 * 24, 'day'), array(60 * 60, 'hour'), array(60, 'minute'));
$newer_date = $newer_date == false ? time() + 60 * 60 * get_settings("gmt_offset") : $newer_date;
$since = $newer_date - $older_date;
for ($i = 0, $j = count($chunks); $i < $j; $i++) {
$seconds = $chunks[$i][0];
$name = $chunks[$i][1];
if (($count = floor($since / $seconds)) != 0) {
break;
}
}
$output = $count == 1 ? '1 ' . $name : "{$count} {$name}s";
if ($i + 1 < $j) {
$seconds2 = $chunks[$i + 1][0];
$name2 = $chunks[$i + 1][1];
if (($count2 = floor(($since - $seconds * $count) / $seconds2)) != 0) {
$output .= $count2 == 1 ? ', 1 ' . $name2 : ", {$count2} {$name2}s";
}
}
echo $output;
}
开发者ID:jinpingv,项目名称:website_wrapper,代码行数:25,代码来源:functions.php
示例3: wptouch_time_since
function wptouch_time_since($older_date, $newer_date = false)
{
// array of time period chunks
$chunks = array(array(60 * 60 * 24 * 30, __('mo', 'wptouch')), array(60 * 60 * 24 * 7, __('wk', 'wptouch')), array(60 * 60 * 24, __('day', 'wptouch')), array(60 * 60, __('hr', 'wptouch')), array(60, __('min', 'wptouch')));
$newer_date = $newer_date == false ? time() + 60 * 60 * get_settings("gmt_offset") : $newer_date;
// difference in seconds
$since = $newer_date - $older_date;
for ($i = 0, $j = count($chunks); $i < $j; $i++) {
$seconds = $chunks[$i][0];
$name = $chunks[$i][1];
// finding the biggest chunk (if the chunk fits, break)
if (($count = floor($since / $seconds)) != 0) {
break;
}
}
// set output var
$output = $count == 1 ? '1 ' . $name : "{$count} {$name}s";
// step two: the second chunk
if ($i + 1 < $j) {
$seconds2 = $chunks[$i + 1][0];
$name2 = $chunks[$i + 1][1];
if (($count2 = floor(($since - $seconds * $count) / $seconds2)) != 0) {
// add to output var
$output .= $count2 == 1 ? ', 1 ' . $name2 : ", {$count2} {$name2}s";
}
}
return $output;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:28,代码来源:functions.php
示例4: widget_king_admin_head
/**
* @desc Output of king widget css and js in admin head area. Is included in every king widget
* @author Georg Leciejewski
*/
function widget_king_admin_head()
{
//$js_dir = str_replace(ABSPATH, get_settings('siteurl').'/', dirname(__FILE__)) . '/js';
$js_dir = get_settings('siteurl') . '/wp-content/plugins/king-includes/js/';
$css_dir = get_settings('siteurl') . '/wp-content/plugins/king-includes/css/';
if (strpos($_SERVER['REQUEST_URI'], 'themes.php') !== false || strpos($_SERVER['REQUEST_URI'], 'king-framework.php') !== false) {
# only include in themes area
echo '<link rel="stylesheet" href="' . $css_dir . 'king_widget.css" type="text/css" media="screen" />' . "\n";
echo '<script type="text/javascript" src="' . $js_dir . 'jquery.js"></script>' . "\n";
echo '<script type="text/javascript" src="' . $js_dir . 'jquery_plugins.js"></script>' . "\n";
echo '<script type="text/javascript" src="' . $js_dir . 'tooltip.js"></script>' . "\n";
echo '<script type="text/javascript" src="' . $js_dir . 'king_widgets.js"></script>' . "\n";
load_plugin_textdomain('widgetKing', '/wp-content/plugins/king-includes/lang');
} elseif (strpos($_SERVER['REQUEST_URI'], 'post.php') !== false) {
# only include in post article temp. disabled since incompatibilities
# and new methods to add js to head in wp2.1
// echo '<link rel="stylesheet" href="'. $css_dir.'king_admin.css" type="text/css" media="screen" />'."\n";
// echo '<script type="text/javascript" src="'.$js_dir.'jquery.js"></script>'."\n";
// echo '<script type="text/javascript" src="'.$js_dir.'jquery_plugins.js"></script>'."\n";
// echo '<script type="text/javascript" src="'.$js_dir.'king_admin.js"></script>'."\n";
}
if (strpos($_SERVER['REQUEST_URI'], 'plugins.php') !== false) {
echo '<script type="text/javascript" src="' . $js_dir . 'prototype-1.4.0.js"></script>' . "\n";
load_plugin_textdomain('widgetKing', '/wp-content/plugins/king-includes/lang');
}
}
开发者ID:jbogota,项目名称:blog-king,代码行数:30,代码来源:king_widget_functions.php
示例5: __construct
/**
*
*/
function __construct()
{
$apiKey = get_settings('site_settings', 'gerencianet_apikey');
$apiSecret = get_settings('site_settings', 'gerencianet_apisecret');
$options = ['client_id' => $apiKey, 'client_secret' => $apiSecret, 'sandbox' => ENVIRONMENT == 'development' ? true : false];
$this->api = new Gerencianet($options);
}
开发者ID:Thavia,项目名称:plb,代码行数:10,代码来源:GerenciaNetApi.php
示例6: wp_mail
function wp_mail($to, $subject, $message, $headers = '')
{
if ($headers == '') {
$headers = "MIME-Version: 1.0\n" . "From: " . get_settings('admin_email') . "\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
}
return @mail($to, $subject, $message, $headers);
}
开发者ID:mroussel,项目名称:flatpress,代码行数:7,代码来源:core.wp-pluggable-funcs_old.php
示例7: etruel_AdServe_Bannersave
function etruel_AdServe_Bannersave($id)
{
global $wpdb, $table_prefix;
$table_name = $wpdb->prefix . "adserve";
$scriptcode = isset($_POST['scriptcode']) ? 1 : 0;
$src = !empty($_POST['src']) ? $_POST['src'] : '';
$width = !empty($_POST['width']) ? $_POST['width'] : null;
$height = !empty($_POST['height']) ? $_POST['height'] : null;
if ($scriptcode) {
$ok = true;
} else {
$ext = substr($src, strlen($src) - 3, 3);
if ($ext !== 'swf' || $width != null && $height !== null) {
$ok = true;
} else {
$ok = false;
}
}
if ($ok) {
$height = is_null($height) ? 'null' : $height;
$width = is_null($width) ? $height : $width;
if ($id > 0) {
// update
$query = " UPDATE {$table_name}\n SET\n title\t\t='" . $_POST['title'] . "',\n scriptcode \t= " . $scriptcode . ",\n url\t\t\t='" . $_POST['url'] . "',\n src\t\t\t='" . urlencode($src) . "',\n user\t\t='" . $_POST['user'] . "',\n email\t\t='" . $_POST['email'] . "',\n keywords\t='" . $_POST['keywords'] . "',\n width\t\t= " . $width . ",\n height\t\t= " . $height . "\n WHERE id={$id}";
} else {
// insert
$query = " INSERT INTO {$table_name}" . " (title, scriptcode, url, src, email, keywords, impressions, clicks, width, height) " . "VALUES ('" . $_POST['title'] . "', '" . $scriptcode . "', '" . $_POST['url'] . "', '" . urlencode($src) . "', '" . $_POST['email'] . "', '" . $_POST['keywords'] . "',0, 0, {$width}, {$height})";
}
//echo $query."<br>";
$wpdb->query($query);
}
return get_settings('siteurl') . "/wp-admin/admin.php?page=admanage";
}
开发者ID:etruel,项目名称:WPeMyAds,代码行数:33,代码来源:adsave.php
示例8: mdv_recent_posts
function mdv_recent_posts($no_posts = 10, $before = '<li>', $after = '</li>', $hide_pass_post = true, $skip_posts = 0, $show_excerpts = false)
{
global $wpdb;
$time_difference = get_settings('gmt_offset');
$now = gmdate("Y-m-d H:i:s", time());
$request = "SELECT ID, post_title, post_excerpt FROM {$wpdb->posts} WHERE post_status = 'publish' ";
if ($hide_pass_post) {
$request .= "AND post_password ='' ";
}
$request .= "AND post_date_gmt < '{$now}' ORDER BY post_date DESC LIMIT {$skip_posts}, {$no_posts}";
$posts = $wpdb->get_results($request);
$output = '';
if ($posts) {
foreach ($posts as $post) {
$post_title = stripslashes($post->post_title);
$permalink = get_permalink($post->ID);
$output .= $before . '<a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . htmlspecialchars($post_title, ENT_COMPAT) . '">' . htmlspecialchars($post_title) . '</a>';
if ($show_excerpts) {
$post_excerpt = stripslashes($post->post_excerpt);
$output .= '<br />' . $post_excerpt;
}
$output .= $after;
}
} else {
$output .= $before . "None found" . $after;
}
echo $output;
}
开发者ID:askin,项目名称:misc,代码行数:28,代码来源:functions.php
示例9: AGCZone_Settings
function AGCZone_Settings()
{
echo '<div class="wrap">';
echo '<h2>AGCZone Plugins Settings</h2>';
echo '<form method="post" action="options.php">';
echo settings_fields('az-settings-group');
echo get_settings('az-settings-group');
echo '<table class="form-table">';
echo '<tr valign="top">';
echo '<th scope="row">Your Amazon Affiliate ID</th>';
echo '<td><input type="text" name="affid" value="' . get_option('affid') . '" /></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">Your Amazon API Key</th>';
echo '<td><input type="text" name="apikey" value="' . get_option('apikey') . '" /></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">Your Amazon Secret Key</th>';
echo '<td><input type="text" name="secret_key" value="' . get_option('secret_key') . '" /></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">Amazon Country</th>';
echo '<td><input type="text" name="region" value="' . get_option('region') . '" /></td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<th scope="row">Sets Category</th>';
echo '<td><input type="text" name="department" value="' . get_option('department') . '" /></td>';
echo '</tr>';
echo '</table>';
echo submit_button();
echo '</form>';
echo '</div>';
}
开发者ID:gigikiri,项目名称:curlwp,代码行数:33,代码来源:agczone.php
示例10: ing_recent_posts
public static function ing_recent_posts($no_posts = 8, $before = '<li>', $after = "</li>\n", $hide_pass_post = true, $skip_posts = 0, $type = 'post')
{
global $wpdb;
$time_difference = get_settings('gmt_offset');
$now = gmdate("Y-m-d H:i:s", time());
$request = "SELECT ID, post_title, post_content, DATE_FORMAT(post_date_gmt, '%M %d %Y') as my_date FROM {$wpdb->posts} WHERE post_status = 'publish' ";
if ($hide_pass_post) {
$request .= "AND post_password ='' ";
}
$request .= "AND post_type='{$type}' ";
$request .= "ORDER BY post_date DESC LIMIT {$skip_posts}, {$no_posts}";
$posts = $wpdb->get_results($request);
$output = '';
if ($posts) {
foreach ($posts as $post) {
$post_title = stripslashes($post->post_title);
$permalink = get_permalink($post->ID);
$content = stripslashes($post->post_content);
$stripedcontent = strip_tags($content);
$shortexcerpt = $this->ing_truncate($stripedcontent, 90);
$output .= $before;
$output .= '<span class="shortexcerpt">' . $shortexcerpt . '</span>';
$output .= '<br /><span class="postdate">' . $post->my_date . '</span> - by <span class="name">' . htmlspecialchars($post_title) . '</span> - <a href="' . $permalink . '" rel="bookmark" class="postlink" title="' . htmlspecialchars($post_title, ENT_COMPAT) . '">Read Post</a> ';
//$output .= '<a href="' . $permalink . '" rel="bookmark" title="' . htmlspecialchars($post_title, ENT_COMPAT) . '">' . htmlspecialchars($post_title). '</a>';
$output .= $after;
}
} else {
$output .= $before . "Sorry, No Recent Stories!" . $after;
}
return $output;
}
开发者ID:beardon,项目名称:okprop,代码行数:31,代码来源:ingage_class.php
示例11: get_news_settings
public static function get_news_settings()
{
if (empty(self::$news_settings)) {
self::$news_settings = get_settings("news");
}
return self::$news_settings;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:7,代码来源:server.php
示例12: wpbl_notify
function wpbl_notify($comment_id, $reason, $harvest)
{
global $wpdb, $wp_id, $url, $email, $comment, $user_ip, $comment_post_ID, $author, $tableposts;
$tableposts = $wpdb->posts[$wp_id];
$sql = "SELECT * FROM {$tableposts} WHERE ID='{$comment_post_ID}' LIMIT 1";
$post = $wpdb->get_row($sql);
if (!empty($user_ip)) {
$comment_author_domain = gethostbyaddr($user_ip);
} else {
$comment_author_domain = '';
}
// create the e-mail body
$notify_message = "A new comment on post #{$comment_post_ID} \"" . stripslashes($post->post_title) . "\" has been automatically deleted by the WPBlacklist plugin.\r\n\r\n";
$notify_message .= "Author : {$author} (IP: {$user_ip} , {$comment_author_domain})\r\n";
$notify_message .= "E-mail : {$email}\r\n";
$notify_message .= "URL : {$url}\r\n";
$notify_message .= "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput={$user_ip}\r\n";
$notify_message .= "Comment:\r\n" . stripslashes($comment) . "\r\n\r\n";
$notify_message .= "Triggered by : {$reason}\r\n\r\n";
// add harvested info - if there is any
if (!empty($harvest)) {
$notify_message .= "Harvested the following information:\r\n" . stripslashes($harvest);
}
// e-mail header
$subject = '[' . stripslashes(get_settings('blogname')) . '] Automatically deleted: "' . stripslashes($post->post_title) . '"';
$admin_email = get_settings("admin_email");
$from = "From: {$admin_email}";
// send e-mail
if (function_exists('mb_send_mail')) {
mb_send_mail($admin_email, $subject, $notify_message, $from);
} else {
@mail($admin_email, $subject, $notify_message, $from);
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:35,代码来源:blacklist.php
示例13: bm_custom_login
function bm_custom_login()
{
// default wordpress mu plugin path
$pluginPath = "/wp-content/mu-plugins/";
// change this to wordpress mu version that has the new login design
$versionCheck = 999;
// is it wordpress mu or wordpress normal?
if (!is_dir($pluginPath)) {
$pluginPath = "/wp-content/plugins/";
$versionCheck = 2.5;
}
$themeVersions = array(array('min' => 0, 'max' => 2.5, 'css' => '/bm-custom-login.css'), array('min' => 2.5, 'max' => 2.7, 'css' => '/bm-custom-login-2.css'), array('min' => 2.7, 'max' => 5, 'css' => '/bm-custom-login-3.css'));
// full plugin path
$pluginUrl = get_settings('siteurl') . $pluginPath . plugin_basename(dirname(__FILE__));
// check which version of wp is being used
$blogVersion = substr(get_bloginfo('version'), 0, 3);
// split style sheets based upon current wp version
foreach ($themeVersions as $version) {
if ($blogVersion >= $version['min'] && $blogVersion < $version['max']) {
$pluginUrl .= $version['css'];
break;
}
}
echo '<link rel="stylesheet" type="text/css" href="' . $pluginUrl . '" />';
}
开发者ID:howardlei82,项目名称:IGSM-Website,代码行数:25,代码来源:bm-custom-login.php
示例14: check_option
function check_option($opt)
{
$settings = get_settings('bas_options');
if (in_array($opt, $settings)) {
echo ' checked="checked"';
}
}
开发者ID:sajidsan,项目名称:sajidsan.github.io,代码行数:7,代码来源:BAStats_options.php
示例15: pg_action_init
function pg_action_init()
{
global $pg_options;
include 'js/atatari.php';
load_plugin_textdomain('platesgenerator', false, dirname(plugin_basename(__FILE__)) . '/languages/');
$pg_options = array('your_reg_caption' => __('your_reg_caption', 'platesgenerator'), 'your_reg_description' => __('your_reg_description', 'platesgenerator'), 'plate_size_caption' => __('plate_size_caption', 'platesgenerator'), 'text_style_caption' => __('text_style_caption', 'platesgenerator'), 'badge_caption' => __('badge_caption', 'platesgenerator'), 'border_caption' => __('border_caption', 'platesgenerator'), 'slogan_caption' => __('slogan_caption', 'platesgenerator'), 'your_mail' => get_settings('admin_email'));
}
开发者ID:hendricson,项目名称:wp-platesgenerator,代码行数:7,代码来源:platesgenerator.php
示例16: postie_loadjs_admin_head
function postie_loadjs_admin_head()
{
$plugindir = get_settings('home') . '/wp-content/plugins/' . dirname(plugin_basename(__FILE__));
wp_enqueue_script('loadjs', $plugindir . '/js/simpleTabs.jquery.js');
echo '<link type="text/css" rel="stylesheet" href="' . get_bloginfo('url') . '/wp-content/plugins/postie/css/style.css" />' . "\n";
echo '<link type="text/css" rel="stylesheet" href="' . get_bloginfo('url') . '/wp-content/plugins/postie/css/simpleTabs.css" />' . "\n";
}
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:7,代码来源:postie.php
示例17: is_referer_search_engine
function is_referer_search_engine($engine = 'google')
{
$siteurl = get_settings('home');
$referer = urldecode($_SERVER['HTTP_REFERER']);
//echo "referer is: $referer<br />";
if (!$engine) {
return 0;
}
switch ($engine) {
case 'google':
if (preg_match('|^http://(www)?\\.?google.*|i', $referer)) {
return 1;
}
break;
case 'lycos':
if (preg_match('|^http://search\\.lycos.*|i', $referer)) {
return 1;
}
break;
case 'yahoo':
if (preg_match('|^http://search\\.yahoo.*|i', $referer)) {
return 1;
}
break;
case 'wordpress':
if (preg_match("#^{$siteurl}#i", $referer)) {
return 1;
}
break;
}
return 0;
}
开发者ID:mover5,项目名称:imobackup,代码行数:32,代码来源:google-hilite.php
示例18: time_since
function time_since($older_date, $newer_date = false)
{
// array of time period chunks
$chunks = array(array(60 * 60 * 24 * 365, 'year'), array(60 * 60 * 24 * 30, 'month'), array(60 * 60 * 24 * 7, 'week'), array(60 * 60 * 24, 'day'), array(60 * 60, 'hour'), array(60, 'minute'));
// $newer_date will equal false if we want to know the time elapsed between a date and the current time
// $newer_date will have a value if we want to work out time elapsed between two known dates
$newer_date = $newer_date == false ? time() + 60 * 60 * get_settings("gmt_offset") : $newer_date;
// difference in seconds
$since = $newer_date - $older_date;
// we only want to output two chunks of time here, eg:
// x years, xx months
// x days, xx hours
// so there's only two bits of calculation below:
// step one: the first chunk
for ($i = 0, $j = count($chunks); $i < $j; $i++) {
$seconds = $chunks[$i][0];
$name = $chunks[$i][1];
// finding the biggest chunk (if the chunk fits, break)
if (($count = floor($since / $seconds)) != 0) {
break;
}
}
// set output var
$output = $count == 1 ? '1 ' . $name : "{$count} {$name}s";
// step two: the second chunk
if ($i + 1 < $j) {
$seconds2 = $chunks[$i + 1][0];
$name2 = $chunks[$i + 1][1];
if (($count2 = floor(($since - $seconds * $count) / $seconds2)) != 0) {
// add to output var
$output .= $count2 == 1 ? ', 1 ' . $name2 : ", {$count2} {$name2}s";
}
}
return $output;
}
开发者ID:adamhunter,项目名称:Black-Apple,代码行数:35,代码来源:time_since.php
示例19: comicpress_avatar
/**
* Better display of avatars in comments
* Should only be used in comment sections (may update in future)
* Checks for false empty commenter URLs 'http://' w/registered users
* Adds the class 'photo' to the image
* Adds a call to 'images/trackback.jpg' for trackbacks
* Adds a call to 'images/pingback.jpg' for pingbacks
*
* Filters should only return a string for an image URL for the avatar with class $avatar
* They should not get the avatar as this is done after the filter
*
* @since 0.2
* @filter
*/
function comicpress_avatar()
{
global $comment;
$url = get_comment_author_url();
$comment_type = get_comment_type();
if (get_settings('avatar_default')) {
$avatar = get_settings('avatar_default');
}
// $avatar = apply_filters('comicpress_avatar', $avatar);
if ($comment_type != 'pingback' && $comment_type != 'trackback') {
echo '<div class="comment-avatar">';
if ($url == true && $url != 'http://') {
echo '<a href="' . $url . '" rel="external nofollow" title="' . wp_specialchars(get_comment_author(), 1) . '">';
}
$id_or_email = get_comment_author_email();
if (empty($id_or_email)) {
$id_or_email = get_comment_author();
}
if (function_exists('comicpress_get_avatar') && $comment_type != 'pingback' && $comment_type != 'trackback') {
echo str_replace("alt='", "alt='" . wp_specialchars(get_comment_author(), 1) . "' title='" . wp_specialchars(get_comment_author(), 1), comicpress_get_avatar($id_or_email, 64));
} else {
echo '<img src="' . get_template_directory_uri() . '/' . $avatar . '" class="avatar photo" />';
}
if ($url == true && $url != 'http://') {
echo '</a>';
}
echo '</div>';
}
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:43,代码来源:comment-functions.php
示例20: email_back
function email_back($id)
{
global $wpdb, $email_send_comment;
$reply_id = mysql_escape_string($_REQUEST['comment_reply_ID']);
$post_id = mysql_escape_string($_REQUEST['comment_post_ID']);
if ($reply_id == 0 || $_REQUEST["email"] != get_settings('admin_email') && !isset($_REQUEST['comment_email_back'])) {
return;
}
$comment = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_ID='{$id}' LIMIT 0, 1");
$reply_comment = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_ID='{$reply_id}' LIMIT 0, 1");
$post = $wpdb->get_results("SELECT * FROM {$wpdb->posts} WHERE ID='{$post_id}' LIMIT 0, 1");
$comment = $comment[0];
$reply_comment = $reply_comment[0];
$post = $post[0];
$title = $post->post_title;
$author = $reply_comment->comment_author;
$url = get_permalink($post_id);
$to = $reply_comment->comment_author_email;
if ($to == "") {
return;
}
$subject = "The author replied your comment at [" . get_bloginfo() . "]'" . $title;
$date = mysql2date('Y.m.d H:i', $reply_comment->comment_date);
$message = "\r\n\t<div>\r\n\t\t<p>Dear {$author}:<p>\r\n\t\t<p>{$comment->comment_content}</p>\r\n\t\t<div style='color:grey;'><small>{$date}, your comment at " . get_bloginfo() . "<a href='{$url}#comment-{$id}'>{$title}</a>: </small>\r\n\t\t\t<blockquote>\r\n\t\t\t\t<p>{$reply_comment->comment_content}</p>\r\n\t\t\t</blockquote>\r\n\t\t</div>\r\n\t</div>";
// strip out some chars that might cause issues, and assemble vars
$site_name = get_bloginfo();
$site_email = get_settings('admin_email');
$charset = get_settings('blog_charset');
$headers = "From: \"{$site_name}\" <{$site_email}>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=\"{$charset}\"\n";
$email_send_comment = "Email notification has sent to " . $to . " with subject '" . $subject . "'";
return wp_mail($to, $subject, $message, $headers);
}
开发者ID:sontv1003,项目名称:vtcacademy,代码行数:34,代码来源:comment-reply.php
注:本文中的get_settings函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论