<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rafadamar!! &#187; php</title>
	<atom:link href="http://rafadamar.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://rafadamar.com</link>
	<description>Hate me for who I am not who you think I am.</description>
	<lastBuildDate>Sat, 28 Jan 2012 02:12:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>HowTo: Integrate Privatemsg with the Flag and jQuery_Impromptu modules</title>
		<link>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/</link>
		<comments>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/#comments</comments>
		<pubDate>Thu, 13 May 2010 01:36:19 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://rafadamar.com/?p=97</guid>
		<description><![CDATA[I needed a way for a user to be prompted to send a message to the author of a node after it was flagged. This was my solution. jQuery Impromptu provides a nice way of implementing a pop-up feature. Flag of course flags a node. &#60;?php // Load necessary to avoid error module_load_include('pages.inc','privatemsg'); // Adds [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a way for a user to be prompted to send a message to the author of a node after it was flagged. This was my solution.</p>
<p><a href="http://drupal.org/project/jquery_impromptu">jQuery</a> Impromptu provides a nice way of implementing a pop-up feature.<br />
<a href="http://drupal.org/project/flag">Flag</a> of course flags a node.</p>
<pre class="brush: php">&lt;?php
  // Load necessary to avoid error
  module_load_include('pages.inc','privatemsg');

  // Adds javascript to header
  jquery_impromptu_add();

  // Gets rid of whitespaces that break javascript code
  // drupal_get_form retrieves the privatemsg form
  // $uid is the author of the node
  // $title is the title of the node
  $form = str_replace("\r", '', str_replace("\n", '', drupal_get_form('privatemsg_new', $uid, $title)));

  // javascript that runs jquery_impromptu on flag event
  print '&lt;script language="javascript"&gt;';
  print "
  $(document).bind('flagGlobalAfterLinkUpdate', function(event, data) {
    if(data.flagStatus == 'flagged'){
      $.prompt('$form');
    }
  });
  ";
  print '&lt;/script&gt;';

  // Necessary because previous module_load_include changes title
  drupal_set_title(check_plain($node-&gt;title));
?&gt;
</pre>
<p>For more information on how you can customize the privatemsg form, look here <a href="http://drupal.org/node/624528">http://drupal.org/node/624528</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Script to Check If a Site is Up</title>
		<link>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/</link>
		<comments>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:10:12 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I needed to develop this script in order to check whether or not my streaming media server was up. At first, I tried to use PHP&#8217;s system function with BASH&#8217;s wget, but that wasn&#8217;t working. I ended up using PHP&#8217;s file_get_contents. &#60;?php function chkuri($link){ //$link is the website which i am checking // If file_get_contents [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to develop this script in order to check whether or not my streaming media server was up. At first, I tried to use PHP&#8217;s system function with BASH&#8217;s wget, but that wasn&#8217;t working. I ended up using PHP&#8217;s file_get_contents.</p>
<pre class="brush:php">
&lt;?php
function chkuri($link){
//$link is the website which i am checking
// If file_get_contents failed to retrieve
// the page, it's not up
  if(!file_get_contents($link)){
    return 'I\'m sorry, but the Ampache server is down. :(';
// It is up
  }else{
    return 'It\'s up! &lt;a href="'.$link.'"&gt;Click here to go!&lt;/a&gt;';
  }
}
print '&lt;h2&gt;'.chkuri('http://martinez.homelinux.org/ampache').'&lt;/h2&gt;';
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

