<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Jacob Schatz</title>
	<atom:link href="http://jacobschatz.com/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://jacobschatz.com</link>
	<description>Programming with comments</description>
	<lastBuildDate>Thu, 10 May 2012 12:21:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Getting started with Parsley Framework with Flex by Abhijeet B</title>
		<link>http://jacobschatz.com/?p=345&#038;cpage=1#comment-1887</link>
		<dc:creator>Abhijeet B</dc:creator>
		<pubDate>Thu, 10 May 2012 12:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://jacobschatz.com/?p=345#comment-1887</guid>
		<description>@davidjmcclelland: Issue that you have brought up is due to incompatible Parsley libraries, if your are using Flex SDK4.5(FB4.5) then please upgrade the Parsley libraries to 2.4.1 or afterwards. I changed the libraries to &quot;parsley-flex4-2.4.1.swc&quot; and &quot;spicelib-flex-2.4.0.swc&quot; , it worked for me.</description>
		<content:encoded><![CDATA[<p>@davidjmcclelland: Issue that you have brought up is due to incompatible Parsley libraries, if your are using Flex SDK4.5(FB4.5) then please upgrade the Parsley libraries to 2.4.1 or afterwards. I changed the libraries to &#8220;parsley-flex4-2.4.1.swc&#8221; and &#8220;spicelib-flex-2.4.0.swc&#8221; , it worked for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Make a WordPress plugin with database by Kajal</title>
		<link>http://jacobschatz.com/?p=23&#038;cpage=1#comment-1886</link>
		<dc:creator>Kajal</dc:creator>
		<pubDate>Mon, 07 May 2012 14:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://jacobschatz.com/?p=23#comment-1886</guid>
		<description>Guess code is not being showed up.. have nothing to attach the file.. sorry for this..</description>
		<content:encoded><![CDATA[<p>Guess code is not being showed up.. have nothing to attach the file.. sorry for this..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Make a WordPress plugin with database by Kajal</title>
		<link>http://jacobschatz.com/?p=23&#038;cpage=1#comment-1885</link>
		<dc:creator>Kajal</dc:creator>
		<pubDate>Mon, 07 May 2012 14:14:19 +0000</pubDate>
		<guid isPermaLink="false">http://jacobschatz.com/?p=23#comment-1885</guid>
		<description>Please use the below code for all functionality add/edit/delete


prefix . &#039;random_q_table&#039;);
add_action(&#039;admin_menu&#039;, &#039;randomquote_menu&#039;);
 
function randomquote_menu()
{
    $allowed_group = &#039;manage_options&#039;;
 
    //Add the admin panel for randomquote
    if(function_exists(&#039;add_menu_page&#039;))
    {
        add_menu_page(__(&#039;Random Quote Maker&#039;,&#039;rndmqmker&#039;), __(&#039;Random Quote Maker&#039;,&#039;rndmqmker&#039;),$allowed_group,&#039;rndmqmker&#039;,&#039;edit_options&#039;);
    }
}
 
function edit_options()
{
	   global $wpdb;
 
    $action     = !empty($_REQUEST[&#039;action&#039;]) ? $_REQUEST[&#039;action&#039;] : &#039;add&#039;;
	
	//echo $action;
    //for deleting
    $quote_id   = !empty($_REQUEST[&#039;quote_id&#039;]) ? $_REQUEST[&#039;quote_id&#039;] : &#039;&#039;;
    //the quote itself
    $quote      = !empty($_REQUEST[&#039;quote&#039;]) ? $_REQUEST[&#039;quote&#039;] : &#039;&#039;;
    //the author of the quote... Anonymous if left blank...
    $author     = !empty($_REQUEST[&#039;author&#039;]) ? $_REQUEST[&#039;author&#039;] : &#039;Anonymous&#039;;
 
    //check to see if the database is installed... and if they have the right version later...
    check_random_quote_database();
	
    //if there is a quote ready to be saved let&#039;s save it right away
    if(!empty($quote)&amp;&amp;$action!=&#039;edit&#039;)
    {
        //some security.
        $quote = trim(htmlspecialchars(mysql_real_escape_string($quote)));
        //trust no one and escape everything.
        $author = trim(htmlspecialchars(mysql_real_escape_string($author)));
        //the query.
        $sql = &quot;INSERT INTO &quot; . RANDOM_Q_TABLE . &quot; (rq_quote,rq_author) VALUES (&#039;&quot; . $quote . &quot;&#039;,&#039;&quot; . $author . &quot;&#039;);&quot;;
        //run the query.
        $wpdb-&gt;get_results($sql);
        //See if the query successfully went through...
        $sql = &quot;SELECT * FROM &quot; . RANDOM_Q_TABLE . &quot; WHERE rq_quote=&#039;&quot; . mysql_real_escape_string($quote) . &quot;&#039;&quot;;
            $results = $wpdb-&gt;get_results($sql);
            //if it returned a non empty quote we know it worked
            if(!empty($results[0]-&gt;rq_quote))
            {
                //pre setup class for the div to display that nice updated message...
                ?&gt;
                
                
                &lt;strong&gt;&lt;/strong&gt;
                
        
        
        
        
        get_results($sql);
            //check that it worked... The query
            $sql = &quot;SELECT * FROM &quot; . RANDOM_Q_TABLE . &quot; WHERE rq_id=&#039;&quot; . mysql_real_escape_string($quote_id) . &quot;&#039;&quot;;
            //run it
            $results = $wpdb-&gt;get_results($sql);
            //did we get anything back? If so it didn&#039;t delete
            if(empty($results) &#124;&#124; empty($results[0]-&gt;rq_id))
            {
                ?&gt;
                
                
                &lt;strong&gt;&lt;/strong&gt;
                get_results($sql);
            //check that it worked... The query
            $sql = &quot;SELECT * FROM &quot; . RANDOM_Q_TABLE . &quot; WHERE rq_id=&#039;&quot; . mysql_real_escape_string($quote_id) . &quot;&#039;&quot;;
            //run it
            $results = $wpdb-&gt;get_results($sql);
            //did we get anything back? If so it didn&#039;t delete
            if(empty($results) &#124;&#124; empty($results[0]-&gt;rq_id))
            {
                ?&gt;
                
                
                &lt;strong&gt;&lt;/strong&gt;
                get_var(&quot;SHOW TABLES LIKE &#039;$table_name&#039;&quot;) != $table_name)
	{
		$sql = &quot;CREATE TABLE &quot; . $table_name . &quot; (
		rq_id INT(11) NOT NULL AUTO_INCREMENT,
		rq_quote TEXT,
		rq_author VARCHAR(100) NOT NULL DEFAULT &#039;anonymous&#039;,
		PRIMARY KEY  id (rq_id)
		);&quot;;
 
		require_once(ABSPATH . &#039;wp-admin/includes/upgrade.php&#039;);
		dbDelta($sql);
 
		$insert = &quot;INSERT INTO &quot; . $table_name .
		&quot; (rq_quote, rq_author) &quot; .
            &quot;VALUES (&#039;A penny saved is a penny earned.&#039;,&#039;Ben Franklin&#039;)&quot;;
 
		$results = $wpdb-&gt;query( $insert );
		add_option(&quot;rq_db_version&quot;, $rq_db_version);
	}
        //for updates
        $installed_ver = get_option( &quot;cl_db_version&quot; );
}
function rq_display_quotes()
{
        //we need the wp database functions
	global $wpdb;
 
        //get all the quotes and authors
        $quotes = $wpdb-&gt;get_results( &#039;SELECT * FROM &#039; . RANDOM_Q_TABLE . &#039; ORDER BY &#039; . RANDOM_Q_TABLE . &#039;.rq_author ASC&#039;);
 
        //if we got quotes back...
	if( !empty($quotes))
	{
		?&gt;
        &lt;a href=&quot;?page=rndmqmker&quot;&gt;Add New Quote &lt;/a&gt;
		
			
			
			
			
			
            
			
			
		rq_quote) &gt; 30)
			{
                            //if this quote is longer than 30 do a dot dot dot
				$new_quote = substr($quote-&gt;rq_quote,0, 30);
				$new_quote .= &quot;...&quot;;
			}
			else
			{
				$new_quote = $quote-&gt;rq_quote;
			}
			$url = get_bloginfo(&#039;wpurl&#039;);
                        //output the info into the table.. It will call itelf when they press delete... PHP_SELF
			?&gt;
			&lt;tr class=&quot;&quot;&gt;
				rq_id;?&gt;
				
                                rq_author; ?&gt;
				&lt;a href=&quot;?page=rndmqmker&amp;action=delete&amp;quote_id=rq_id;?&gt;&quot; class=&quot;delete&quot; onclick=&quot;return confirm(&#039;&#039;)&quot;&gt;&lt;/a&gt;
                &lt;a href=&quot;?page=rndmqmker&amp;action=edit&amp;rq_id=rq_id;?&gt;&quot; class=&quot;delete&quot; &gt;&lt;/a&gt;
			
		
		
		
		                
		
		
    
    get_results( &#039;SELECT * FROM &#039; . RANDOM_Q_TABLE . &#039; where rq_id=&#039;.$_REQUEST[&#039;rq_id&#039;].&#039;&#039;);	
		foreach($quotes as $quote)
		{
			$str1 = preg_replace(&quot;//&quot;, &quot;&quot;, $quote-&gt;rq_quote);
			$str = strip_tags($str1, &#039;&#039;);
			//echo $str;
			$auth= preg_replace(&quot;//&quot;, &quot;&quot;,$quote-&gt;rq_author);
		}
	?&gt;
	&lt;form class=&quot;wrap&quot; method=&quot;post&quot; action=&quot;?page=rndmqmker&amp;action=&amp;rq_id=&quot;&gt;
            
                
                
                
                
                
                    
                
                
                
                    
                    
                        &lt;input type=&quot;text&quot; name=&quot;author&quot; class=&quot;input&quot; size=&quot;40&quot; maxlength=&quot;200&quot; value=&quot;&quot; /&gt;
                    
                
                
                   &lt;input type=&quot;submit&quot; name=&quot;save&quot; class=&quot;button bold&quot; value=&quot; &#187;&quot; /&gt;
                
                
                
            
        
    
        
get_row(&#039;SELECT * FROM &#039; . RANDOM_Q_TABLE . &#039; ORDER BY RAND() LIMIT 1&#039;);
 
    return $result-&gt;rq_quote . &#039;--&#039; . $result-&gt;rq_author;
}
 
add_shortcode(&#039;randomquote&#039;, &#039;random_quote&#039;);
 
?&gt;</description>
		<content:encoded><![CDATA[<p>Please use the below code for all functionality add/edit/delete</p>
<p>prefix . &#8216;random_q_table&#8217;);<br />
add_action(&#8216;admin_menu&#8217;, &#8216;randomquote_menu&#8217;);</p>
<p>function randomquote_menu()<br />
{<br />
    $allowed_group = &#8216;manage_options&#8217;;</p>
<p>    //Add the admin panel for randomquote<br />
    if(function_exists(&#8216;add_menu_page&#8217;))<br />
    {<br />
        add_menu_page(__(&#8216;Random Quote Maker&#8217;,'rndmqmker&#8217;), __(&#8216;Random Quote Maker&#8217;,'rndmqmker&#8217;),$allowed_group,&#8217;rndmqmker&#8217;,'edit_options&#8217;);<br />
    }<br />
}</p>
<p>function edit_options()<br />
{<br />
	   global $wpdb;</p>
<p>    $action     = !empty($_REQUEST['action']) ? $_REQUEST['action'] : &#8216;add&#8217;;</p>
<p>	//echo $action;<br />
    //for deleting<br />
    $quote_id   = !empty($_REQUEST['quote_id']) ? $_REQUEST['quote_id'] : &#8221;;<br />
    //the quote itself<br />
    $quote      = !empty($_REQUEST['quote']) ? $_REQUEST['quote'] : &#8221;;<br />
    //the author of the quote&#8230; Anonymous if left blank&#8230;<br />
    $author     = !empty($_REQUEST['author']) ? $_REQUEST['author'] : &#8216;Anonymous&#8217;;</p>
<p>    //check to see if the database is installed&#8230; and if they have the right version later&#8230;<br />
    check_random_quote_database();</p>
<p>    //if there is a quote ready to be saved let&#8217;s save it right away<br />
    if(!empty($quote)&amp;&amp;$action!=&#8217;edit&#8217;)<br />
    {<br />
        //some security.<br />
        $quote = trim(htmlspecialchars(mysql_real_escape_string($quote)));<br />
        //trust no one and escape everything.<br />
        $author = trim(htmlspecialchars(mysql_real_escape_string($author)));<br />
        //the query.<br />
        $sql = &#8220;INSERT INTO &#8221; . RANDOM_Q_TABLE . &#8221; (rq_quote,rq_author) VALUES (&#8216;&#8221; . $quote . &#8220;&#8216;,&#8217;&#8221; . $author . &#8220;&#8216;);&#8221;;<br />
        //run the query.<br />
        $wpdb-&gt;get_results($sql);<br />
        //See if the query successfully went through&#8230;<br />
        $sql = &#8220;SELECT * FROM &#8221; . RANDOM_Q_TABLE . &#8221; WHERE rq_quote=&#8217;&#8221; . mysql_real_escape_string($quote) . &#8220;&#8216;&#8221;;<br />
            $results = $wpdb-&gt;get_results($sql);<br />
            //if it returned a non empty quote we know it worked<br />
            if(!empty($results[0]-&gt;rq_quote))<br />
            {<br />
                //pre setup class for the div to display that nice updated message&#8230;<br />
                ?&gt;</p>
<p>                <strong></strong></p>
<p>        get_results($sql);<br />
            //check that it worked&#8230; The query<br />
            $sql = &#8220;SELECT * FROM &#8221; . RANDOM_Q_TABLE . &#8221; WHERE rq_id=&#8217;&#8221; . mysql_real_escape_string($quote_id) . &#8220;&#8216;&#8221;;<br />
            //run it<br />
            $results = $wpdb-&gt;get_results($sql);<br />
            //did we get anything back? If so it didn&#8217;t delete<br />
            if(empty($results) || empty($results[0]-&gt;rq_id))<br />
            {<br />
                ?&gt;</p>
<p>                <strong></strong><br />
                get_results($sql);<br />
            //check that it worked&#8230; The query<br />
            $sql = &#8220;SELECT * FROM &#8221; . RANDOM_Q_TABLE . &#8221; WHERE rq_id=&#8217;&#8221; . mysql_real_escape_string($quote_id) . &#8220;&#8216;&#8221;;<br />
            //run it<br />
            $results = $wpdb-&gt;get_results($sql);<br />
            //did we get anything back? If so it didn&#8217;t delete<br />
            if(empty($results) || empty($results[0]-&gt;rq_id))<br />
            {<br />
                ?&gt;</p>
<p>                <strong></strong><br />
                get_var(&#8220;SHOW TABLES LIKE &#8216;$table_name&#8217;&#8221;) != $table_name)<br />
	{<br />
		$sql = &#8220;CREATE TABLE &#8221; . $table_name . &#8221; (<br />
		rq_id INT(11) NOT NULL AUTO_INCREMENT,<br />
		rq_quote TEXT,<br />
		rq_author VARCHAR(100) NOT NULL DEFAULT &#8216;anonymous&#8217;,<br />
		PRIMARY KEY  id (rq_id)<br />
		);&#8221;;</p>
<p>		require_once(ABSPATH . &#8216;wp-admin/includes/upgrade.php&#8217;);<br />
		dbDelta($sql);</p>
<p>		$insert = &#8220;INSERT INTO &#8221; . $table_name .<br />
		&#8221; (rq_quote, rq_author) &#8221; .<br />
            &#8220;VALUES (&#8216;A penny saved is a penny earned.&#8217;,'Ben Franklin&#8217;)&#8221;;</p>
<p>		$results = $wpdb-&gt;query( $insert );<br />
		add_option(&#8220;rq_db_version&#8221;, $rq_db_version);<br />
	}<br />
        //for updates<br />
        $installed_ver = get_option( &#8220;cl_db_version&#8221; );<br />
}<br />
function rq_display_quotes()<br />
{<br />
        //we need the wp database functions<br />
	global $wpdb;</p>
<p>        //get all the quotes and authors<br />
        $quotes = $wpdb-&gt;get_results( &#8216;SELECT * FROM &#8216; . RANDOM_Q_TABLE . &#8216; ORDER BY &#8216; . RANDOM_Q_TABLE . &#8216;.rq_author ASC&#8217;);</p>
<p>        //if we got quotes back&#8230;<br />
	if( !empty($quotes))<br />
	{<br />
		?&gt;<br />
        &lt;a href=&quot;?page=rndmqmker&#8221;&gt;Add New Quote </p>
<p>		rq_quote) &gt; 30)<br />
			{<br />
                            //if this quote is longer than 30 do a dot dot dot<br />
				$new_quote = substr($quote-&gt;rq_quote,0, 30);<br />
				$new_quote .= &#8220;&#8230;&#8221;;<br />
			}<br />
			else<br />
			{<br />
				$new_quote = $quote-&gt;rq_quote;<br />
			}<br />
			$url = get_bloginfo(&#8216;wpurl&#8217;);<br />
                        //output the info into the table.. It will call itelf when they press delete&#8230; PHP_SELF<br />
			?&gt;<br />
			&lt;tr class=&quot;&#8221;&gt;<br />
				rq_id;?&gt;</p>
<p>                                rq_author; ?&gt;<br />
				&lt;a href=&quot;?page=rndmqmker&amp;action=delete&amp;quote_id=rq_id;?&gt;&#8221; class=&#8221;delete&#8221; onclick=&#8221;return confirm(&#8221;)&#8221;&gt;<br />
                &lt;a href=&quot;?page=rndmqmker&amp;action=edit&amp;rq_id=rq_id;?&gt;&#8221; class=&#8221;delete&#8221; &gt;</p>
<p>    get_results( &#8216;SELECT * FROM &#8216; . RANDOM_Q_TABLE . &#8216; where rq_id=&#8217;.$_REQUEST['rq_id'].&#8221;);<br />
		foreach($quotes as $quote)<br />
		{<br />
			$str1 = preg_replace(&#8220;//&#8221;, &#8220;&#8221;, $quote-&gt;rq_quote);<br />
			$str = strip_tags($str1, &#8221;);<br />
			//echo $str;<br />
			$auth= preg_replace(&#8220;//&#8221;, &#8220;&#8221;,$quote-&gt;rq_author);<br />
		}<br />
	?&gt;<br />
	&lt;form class=&quot;wrap&quot; method=&quot;post&quot; action=&quot;?page=rndmqmker&amp;action=&amp;rq_id=&#8221;&gt;</p>
<p>                        &lt;input type=&quot;text&quot; name=&quot;author&quot; class=&quot;input&quot; size=&quot;40&quot; maxlength=&quot;200&quot; value=&quot;&#8221; /&gt;</p>
<p>                   &lt;input type=&quot;submit&quot; name=&quot;save&quot; class=&quot;button bold&quot; value=&quot; &raquo;&#8221; /&gt;</p>
<p>get_row(&#8216;SELECT * FROM &#8216; . RANDOM_Q_TABLE . &#8216; ORDER BY RAND() LIMIT 1&#8242;);</p>
<p>    return $result-&gt;rq_quote . &#8216;&#8211;&#8217; . $result-&gt;rq_author;<br />
}</p>
<p>add_shortcode(&#8216;randomquote&#8217;, &#8216;random_quote&#8217;);</p>
<p>?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Make a WordPress plugin with database by John</title>
		<link>http://jacobschatz.com/?p=23&#038;cpage=1#comment-1883</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 04 May 2012 01:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://jacobschatz.com/?p=23#comment-1883</guid>
		<description>Great post. I&#039;m looking to convert this into a plugin for my clients to list their home opens, so I need to customise it. However, I can&#039;t even get it to create the table. Can you send the completed plugin please.
Thankd, and once again - a good tutorial</description>
		<content:encoded><![CDATA[<p>Great post. I&#8217;m looking to convert this into a plugin for my clients to list their home opens, so I need to customise it. However, I can&#8217;t even get it to create the table. Can you send the completed plugin please.<br />
Thankd, and once again &#8211; a good tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Make a WordPress plugin with database by Star Icontempest</title>
		<link>http://jacobschatz.com/?p=23&#038;cpage=1#comment-1882</link>
		<dc:creator>Star Icontempest</dc:creator>
		<pubDate>Thu, 03 May 2012 20:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://jacobschatz.com/?p=23#comment-1882</guid>
		<description>Thanks for your comment. The issue is something that I am looking into, as I am having the same issue myself. I will update you all shortly with a solution.</description>
		<content:encoded><![CDATA[<p>Thanks for your comment. The issue is something that I am looking into, as I am having the same issue myself. I will update you all shortly with a solution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

