Direktori : /home/redrockmedical/public_html/
Upload File :
Current File : /home/redrockmedical/public_html/wp-trackback.php

<?php
/**
 * Handle Trackbacks and Pingbacks Sent to WordPress
 *
 * @since 0.71
 *
 * @package WordPress
 * @subpackage Trackbacks
 */

if (empty($wp)) {
	require_once( dirname( __FILE__ ) . '/wp-load.php' );
	wp( array( 'tb' => '1' ) );
}

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param mixed  $error         Whether there was an error.
 *                              Default '0'. Accepts '0' or '1', true or false.
 * @param string $error_message Error message if an error occurred.
 */
function trackback_response($error = 0, $error_message = '') {
	header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
	if ($error) {
		echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
		echo "<response>\n";
		echo "<error>1</error>\n";
		echo "<message>$error_message</message>\n";
		echo "</response>";
		die();
	} else {
		echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
		echo "<response>\n";
		echo "<error>0</error>\n";
		echo "</response>";
	}
}

// Trackback is done by a POST.
$request_array = 'HTTP_POST_VARS';

if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) {
	$tb_id = explode('/', $_SERVER['REQUEST_URI']);
	$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
}

$tb_url  = isset($_POST['url'])     ? $_POST['url']     : '';
$charset = isset($_POST['charset']) ? $_POST['charset'] : '';

// These three are stripslashed here so they can be properly escaped after mb_convert_encoding().
$title     = isset($_POST['title'])     ? wp_unslash($_POST['title'])      : '';
$excerpt   = isset($_POST['excerpt'])   ? wp_unslash($_POST['excerpt'])    : '';
$blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name'])  : '';

if ($charset)
	$charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) );
else
	$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';

// No valid uses for UTF-7.
if ( false !== strpos($charset, 'UTF-7') )
	die;

// For international trackbacks.
if ( function_exists('mb_convert_encoding') ) {
	$title     = mb_convert_encoding($title, get_option('blog_charset'), $charset);
	$excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
	$blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset);
}

// Now that mb_convert_encoding() has been given a swing, we need to escape these three.
$title     = wp_slash($title);
$excerpt   = wp_slash($excerpt);
$blog_name = wp_slash($blog_name);

if ( is_single() || is_page() )
	$tb_id = $posts[0]->ID;

if ( !isset($tb_id) || !intval( $tb_id ) )
	trackback_response( 1, __( 'I really need an ID for this to work.' ) );

if (empty($title) && empty($tb_url) && empty($blog_name)) {
	// If it doesn't look like a trackback at all.
	wp_redirect(get_permalink($tb_id));
	exit;
}

if ( !empty($tb_url) && !empty($title) ) {
	/**
	* Fires before the trackback is added to a post.
	*
	* @since 4.7.0
	*
	* @param int    $tb_id     Post ID related to the trackback.
	* @param string $tb_url    Trackback URL.
	* @param string $charset   Character Set.
	* @param string $title     Trackback Title.
	* @param string $excerpt   Trackback Excerpt.
	* @param string $blog_name Blog Name.
	*/
	do_action( 'pre_trackback_post', $tb_id, $tb_url, $charset, $title, $excerpt, $blog_name );

	header('Content-Type: text/xml; charset=' . get_option('blog_charset') );

	if ( !pings_open($tb_id) )
		trackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) );

	$title =  wp_html_excerpt( $title, 250, '&#8230;' );
	$excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' );

	$comment_post_ID = (int) $tb_id;
	$comment_author = $blog_name;
	$comment_author_email = '';
	$comment_author_url = $tb_url;
	$comment_content = "<strong>$title</strong>\n\n$excerpt";
	$comment_type = 'trackback';

	$dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) );
	if ( $dupe )
		trackback_response( 1, __( 'We already have a ping from that URL for this post.' ) );

	$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');

	$result = wp_new_comment( $commentdata );

	if ( is_wp_error( $result ) ) {
		trackback_response( 1, $result->get_error_message() );
	}

	$trackback_id = $wpdb->insert_id;

	/**
	 * Fires after a trackback is added to a post.
	 *
	 * @since 1.2.0
	 *
	 * @param int $trackback_id Trackback ID.
	 */
	do_action( 'trackback_post', $trackback_id );
	trackback_response( 0 );
}
Blog - Red Rock Medical Group Blog - Red Rock Medical Group
Dropdown button for navigation mobile view
(702) 877-9514

5701 W. Charleston Blvd, #100
Las Vegas, Nevada 89146

Blog


Blood Work in Las Vegas for Nutritional Deficiencies: What Tests May Reveal

Posted: November 02, 2016

While no one enjoys getting blood work done, doing so can be very insightful, helpful and even life saving. The results of blood tests can show whether a patient has a disease or not. They can even help people find out what they need to do to live a healthier and more vibrant life. Two…

Read The Full Article

Fight or Flight: How Stress Affects People with Diabetes

Posted: November 01, 2016

Patients with diabetes know they have a lot to monitor in their everyday life. From their blood glucose levels and diet to how much they exercise and the diabetes treatment a Las Vegas doctor might recommend to them. Recent research has shown that there is yet another factor that diabetes patients need to monitor: their…

Read The Full Article

The Zika Virus: Are Las Vegas Families at Risk?

Posted: October 28, 2016

Early in September of this year, the CDC announced that it had granted approximately $2.4 million to Chicago, Houston, Los Angeles County, New York City and Philadelphia to combat the spread of the Zika virus. That is in addition to the $193 million that the CDC had already made available to counties within the US….

Read The Full Article

The Latest Pain Management Techniques That Are Proving Effective for Patients

Posted: October 26, 2016

Pain is not something that is always easy to manage. Therefore, researchers and doctors have been studying and implementing a number of pain management techniques over the years. The research has lead to a variety of non-invasive treatments that are making both patients and doctors much happier. A Very Brief History of Pain Management Throughout…

Read The Full Article

What to Take Into Consideration When Choosing an OB/GYN

Posted: October 24, 2016

Choosing the best OB/GYN in Las Vegas is one of the most important decisions a woman in this part of Nevada can make. Not only are these specialists vital for the health of a pregnant woman and her unborn baby, they’re vital for a woman’s health in general. Why an OB/GYN is So Important to…

Read The Full Article

BLOOD WORK LAS VEGAS: PREPARATION

Posted: October 13, 2016

There comes a time in most people’s lives when blood work has to be done. Very few people actually enjoy the process of having blood drawn, but in order to ensure the process goes smoothly and results are not affected by external forces, there are some steps that have to be taken beforehand. Before the…

Read The Full Article

DIABETES TREATMENT IN LAS VEGAS FOR WOMEN: LIFESTYLE

Posted: October 10, 2016

Diabetes is a serious disease for everyone. However, it can be especially hard on women. This is because diabetes can not only affect mothers, but their unborn children as well. Diabetes and Depression in Women Diabetes can have severe effects of women. One example of these effects is depression. Women experience depression approximately twice as…

Read The Full Article

GENERAL PRACTICE VERSUS FAMILY PRACTICE IN LAS VEGAS

Posted: October 03, 2016

Within the medical profession, there are many types of specialists and surgeons, each with their own expertise in a particular branch of healthcare. Often times, the differences between two types of practices are unknown to those who are not in the medical field. Two examples of frequently confused practices are general practice and family practice….

Read The Full Article

PAIN MANAGEMENT IN LAS VEGAS: CHRONIC BACK PAIN AND LIFESTYLE

Posted: September 30, 2016

Many people suffer from some kind of back pain in their lives – whether chronic or acute. Chronic back pain does not only negatively influence an individual’s life and force them to deal with pain every day, it also impacts their relationships with their friends, family, their children, and their spouse. Managing pain is therefore…

Read The Full Article

The Difference Between a Midwife and an OB/GYN in Las Vegas

Posted: September 23, 2016

Choosing whether to have a midwife or an OB/GYN is a critical step in helping ensure one’s birth plan goes accordingly. In order to pave the way for a healthy pregnancy and birth, it is important to be able to differentiate between the two practitioners. What is a Midwife? A certified nurse midwife (CNM) is…

Read The Full Article

Next Page »
Translate »