<?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>ThePizzy.net/blog &#187; PHP</title>
	<atom:link href="http://thepizzy.net/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://thepizzy.net/blog</link>
	<description>Solving the complex in 140 characters or less...</description>
	<lastBuildDate>Mon, 02 Jan 2012 15:55:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Jasper: Just a store platform experience, reworked</title>
		<link>http://thepizzy.net/blog/2011/02/jasper-just-a-store-platform-experience-reworked/</link>
		<comments>http://thepizzy.net/blog/2011/02/jasper-just-a-store-platform-experience-reworked/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 01:08:03 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Jasper]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[catalog.xml]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[jasper]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[kodingen.com]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[objinfo.xml]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[yahoo store platform]]></category>
		<category><![CDATA[yahoo! stores]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=1132</guid>
		<description><![CDATA[Jasper is an experiment in creating a Yahoo! Store Editor and CMS using only the cloud-based coding solution from Kodingen.com]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-1133" title="Jasper Logo" src="http://thepizzy.net/blog/wp-content/uploads/2011/02/logo-name-300x171.png" alt="Jasper Logo" width="300" height="171" />For the past 3 years, I&#8217;ve been working on a store that uses the Yahoo! Store platform. At first, the user interface for the web page design and page object models was easy to grasp (both the prefab versions and the custom ones I had access to), but going through the entire rewrite process was a pain &#8211; the biggest of which was the requirement of perfection. If a mistake was made in any field names or data-types it held, the whole object model had to be scrapped and started over. They&#8217;ve made minor improvements over the past 3 years to their Merchant Solutions side of things, but they have been extremely minor. One thing that hasn&#8217;t changed is the interface to edit pages.</p>
<p>There are two methods of doing the editing, depending on the Yahoo! Store platform that you have. If you&#8217;re on the Legacy version, you must go to the page itself, and click edit. This provides you with a series of fields and input boxes for each type of field. No intelligence in the design of what those fields are for or differentiation in how they interact.</p>
<p>If you&#8217;re on the Merchant Solutions platform, then you have the option of going directly to the page still, or you can do it in a flat-file pseudo database-like UI which is nothing more than a search-by-field interface, which presents you with a different-looking (but still the same) interface for editing the page.</p>
<p>Over the next few months, I&#8217;m going to embark on a web-based interface for importing the legacy store feed (objinfo.xml, which can&#8217;t be customized) and see what can be done with the data as far as modifying it, preparing it, cleaning it, and exporting it back to the store. I&#8217;m also going to attempt to code it entirely using <a href="http://kodingen.com" target="_blank">Kodingen.com</a>. I&#8217;ve done a highly customized version of this concept for the company I currently work for (at the time of this post), but none of the code will be reused from that project, and this project will have different, and limited features (in some areas, and expanded in other areas), but for a different data model. In some areas, this application will be more limited (since it&#8217;s working with a standardized data format, rather than a customized &#8220;catalog.xml&#8221; feed from Merchant Solutions. Once this basic version is solid, I may start working on a customized version, or even offering a customizing service to handle the catalog.xml file.</p>
<p>Some things I&#8217;d like to do differently with this basic version is:</p>
<ul>
<li>create an install process (a la phpBB)</li>
<li>extensive automation, and possibly some AI concepts</li>
<li>learn more about object-oriented design and how it can be extended conceptually</li>
<li>experiment with some various php and javascript frameworks</li>
</ul>
<p>There are plenty of other feature sets that I&#8217;ve learned and developed in addition to these in the past and plan to use as well. So we&#8217;ll see how this goes, and I&#8217;ll post some updates here. Depending on what I plan to do with it, I may or may not open-source it. If I do, I&#8217;ll host it on Google Code.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ajax' rel='tag' target='_blank'>ajax</a>, <a class='technorati-link' href='http://technorati.com/tag/catalog.xml' rel='tag' target='_blank'>catalog.xml</a>, <a class='technorati-link' href='http://technorati.com/tag/Coding' rel='tag' target='_blank'>Coding</a>, <a class='technorati-link' href='http://technorati.com/tag/jasper' rel='tag' target='_blank'>jasper</a>, <a class='technorati-link' href='http://technorati.com/tag/JavaScript' rel='tag' target='_blank'>JavaScript</a>, <a class='technorati-link' href='http://technorati.com/tag/kodingen.com' rel='tag' target='_blank'>kodingen.com</a>, <a class='technorati-link' href='http://technorati.com/tag/MySQL' rel='tag' target='_blank'>MySQL</a>, <a class='technorati-link' href='http://technorati.com/tag/objinfo.xml' rel='tag' target='_blank'>objinfo.xml</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_blank'>Programming</a>, <a class='technorati-link' href='http://technorati.com/tag/yahoo+store+platform' rel='tag' target='_blank'>yahoo store platform</a>, <a class='technorati-link' href='http://technorati.com/tag/yahoo%21+stores' rel='tag' target='_blank'>yahoo! stores</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2011/02/jasper-just-a-store-platform-experience-reworked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Connect to SQL through Windows Authenticated ODBC in PHP</title>
		<link>http://thepizzy.net/blog/2011/02/how-to-connect-to-sql-through-windows-authenticated-odbc-in-php/</link>
		<comments>http://thepizzy.net/blog/2011/02/how-to-connect-to-sql-through-windows-authenticated-odbc-in-php/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 20:41:09 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[how to connect to sql server in php with odbc]]></category>
		<category><![CDATA[microsoft odbc]]></category>
		<category><![CDATA[microsoft sql server]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[odbc connection]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php odbc connection]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server odbc connection]]></category>
		<category><![CDATA[windows authenticated odbc]]></category>
		<category><![CDATA[windows authenticated odbc connection]]></category>
		<category><![CDATA[windows odbc connection]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=1116</guid>
		<description><![CDATA[If you use MSSQL over ODBC, connecting w/ PHP is simply a DOMAIN\WEBSERVER acct on the MSSQL server &#038; the DSN in PHP's odbc_connect()]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1125" title="ODBC Connection" src="http://thepizzy.net/blog/wp-content/uploads/2011/02/8787717937219497341.png" alt="" width="256" height="256" />For about the last year, I&#8217;ve been creating a CMS (content management system), for the automatic management and maintenance of my company&#8217;s eCommerce site, on the Yahoo! Store platform. The software imports the entire store automatically, runs a series of cleanup processes with about a dozen different criteria, saves the changes it has made, exports the modified pages, and makes them available to download from Jada&#8217;s interface. This automation cuts the need for about 3-4 people doing a weeks&#8217; worth of work, and does it all automatically in 10-30 minutes. The one thing it doesn&#8217;t do, is the one cleanup process that takes the longest, and requires the most human thought: comparing every product&#8217;s available options on the site, and checking them against actual inventory in the order management software.</p>
<p>Until now.</p>
<p>Our current order management software runs as a MS Access front-end to a MSSQL 2005 server backend through and ODBC DSN connection. This connection has been limited to MS Access and MS Excel application/queries, and thus, was the limiting factor to writing this most-complex cleanup process into Jada. The most difficult part in my development was finding an understandable article describing how to make an ODBC call, and then actually get the data back, in the same simple manner that one makes a MySQL query. The real issue has been <strong>once the connection is closed, the result cannot be accessed</strong>. I had to find that out the hardway, via <a href="http://msdn.microsoft.com/en-us/library/ms811006.aspx" target="_blank">Microsoft&#8217;s convoluted documentation on using ODBC</a>.</p>
<p>Here&#8217;s the code I&#8217;ve used to make the ODBC connection in PHP (unfortunately my blog&#8217;s template can&#8217;t handle actual code right now):</p>
<p><a href="http://thepizzy.net/blog/wp-content/uploads/2011/02/2011-02-06_13131.png"><img class="aligncenter size-full wp-image-1119" title="function odbcQuery()" src="http://thepizzy.net/blog/wp-content/uploads/2011/02/2011-02-06_13131.png" alt="" width="630" height="786" /></a></p>
<h1>Code Breakdown</h1>
<p>We&#8217;ll start creating a function that makes an ODBC connection, passes it an SQL query, then parses the data into a table/array and return the array.</p>
<h2>Function call</h2>
<pre>function odbcQuery($sql, $attempt="") {</pre>
<p>When we call the function, we&#8217;ll provide the SQL Query we want executed, and an optional description of what we&#8217;re trying to do with the query. In this way, if it errors, an semantic error will be displayed along with the technical one to help locate the code easily.</p>
<h2>Database Connection</h2>
<pre>// Establish an odbc connection with the database
$link = odbc_connect("My_DSN_Name", "", "");</pre>
<p>When running <strong><a href="http://us3.php.net/manual/en/function.odbc-connect.php" target="_blank">odbc_connect()</a></strong> it takes 3 parameters:</p>
<ul>
<li>the DSN; Server,Port; or Server/SQLInstance</li>
<li>username</li>
<li>password</li>
</ul>
<p>When connecting using Windows Authentication &amp; a DSN (as this example is about), there are some caveats and things to remember:</p>
<ol>
<li>On the web server, the User running the Web Service process needs to be a User with permission to access the SQL Server.
<ol>
<li>In my case, the user running the web server is <strong>SYSTEM</strong>, and so the user trying to access the SQL server is &#8220;<strong>DOMAIN\COMPUTERNAME$</strong>&#8220;.</li>
<li>There is no password for a SYSTEM account, and so on the SQL Server needs to have a user created named &#8220;<strong>DOMAIN\COMPUTERNAME$</strong>&#8220;.</li>
<li>Due to some security concerns, I&#8217;ve decided to give the account read-only access to the database I want to access. You&#8217;ll need to consult your own IT Administrator or security advisor for your security concerns.</li>
</ol>
</li>
<li>In the odbc_connect() statement, you then only need the name of the DSN (which I assume has already been configured on the Web Server you&#8217;re using) , followed by two null-quotes: &#8220;&#8221;.</li>
</ol>
<p>This creates an active link via ODBC to the SQL Server&#8230;supposedly</p>
<h2>Database Connection Checking &amp; Error Handling</h2>
<pre>if (!$link) {
	die('Could not connect: '.odbc_error().': '.odbc_errormsg());
} else {</pre>
<p>Next, we check the link . If it just flat-out doesn&#8217;t exist, then we kill the program, throw an error message that will read: &#8220;Could not connect: &lt;insert odbc error code&gt;:  &lt;insert odbc error text&gt;&#8221;. Otherwise, we move on&#8230;</p>
<h2>Sending the SQL Query &amp; Checking Response</h2>
<pre>$data = odbc_exec($link, $sql);
if($data === false) {
	echo "ODBC Query: ".$sql."&lt;br /&gt;&lt;br /&gt;";
	die("ODBC Query failed:  ".$attempt."&lt;br /&gt;Error: ".odbc_error());
} else {</pre>
<p>Now that we have a valid link to the database, we&#8217;ll send a request for <strong>data</strong> using the <strong><a href="http://us3.php.net/manual/en/function.odbc-exec.php" target="_blank">odbc_exec()</a></strong> function. This function sends the connection resource (<strong>$link</strong>) and the SQL Query we want run (<strong>$sql</strong>). It will return a &#8220;ODBC result identifier&#8221; or <em><strong>false</strong></em>.</p>
<p>Since a result identifier could, I assume, be the number 0 (zero) I want to ensure that <strong>$data</strong> is actually <strong><em>false</em></strong> and not just zero. That&#8217;s where the triple === comes in. When doing conditional statements, using == will convert the data being compared into a true/false value, where <em>zero or nothing</em> = <strong><em>false</em></strong> and <em>anything else</em> = <strong><em>true</em></strong>. When you use === you test for an actual boolean value, meaning <em>anything including zero</em> = <strong><em>true</em></strong> and <strong><em>false = false</em></strong>.</p>
<p>If the query failed, and resulted in a <strong><em>false</em></strong> result, we&#8217;ll display an error message: &#8220;ODBC Query: &lt;insert actual SQL Query&gt; // ODBC Query failed: &lt;insert query description&gt; // Error: &lt;insert ODBC error code&gt;&#8221;. Otherwise, we&#8217;ll move on&#8230;</p>
<h2>Parsing the Query Results &#8211; Column Headers</h2>
<pre>// Initialization
$row = $fields = $records = $result = array(); 	

// Get the result's column names
$count = odbc_num_fields($data);
for($x=1;$x&lt;=$count;$x++) {
	$fields[] = odbc_field_name($data, $x);
}</pre>
<p>We start off by initializing all the variables we&#8217;re going to use in the next bit of code, to make sure they&#8217;re empty.</p>
<p>Then we&#8217;ll run <strong><a href="http://us3.php.net/manual/en/function.odbc-num-fields.php" target="_blank">odbc_num_fields()</a></strong> over the <strong>$data</strong> to get the number of columns we need to iterate through. For columns, the counting starts at 1, so the for-loop starts at 1.</p>
<p>Iterate through each column name and add it to an array, called <strong>$fields</strong>:</p>
<pre>Array (
	[0] =&gt; field_name_1
	[1] =&gt; field_name_2
	[2] =&gt; field_name_3
)</pre>
<h2>Parsing the Query Results &#8211; Records</h2>
<pre>
<pre>// Get the result's data: array[record#][column#] = value
$count = odbc_num_rows($data);
for($x=0;$x&lt;$count;$x++) {
	odbc_fetch_into($data, $row, $x);
	array_push($records,$row);
}</pre>
</pre>
<p>Then we run <strong><a href="http://us3.php.net/manual/en/function.odbc-num-rows.php" target="_blank">odbc_num_rows()</a></strong> over the $data to get the number of rows we need to iterate through. For rows, the counting starts at 0, so the for-loop starts at 0.</p>
<p>Iterate through each record row and insert it to a temporary array <strong>$row</strong> using <strong><a href="http://us3.php.net/manual/en/function.odbc-fetch-into.php" target="_blank">odbc_fetch_into()</a></strong>. Then take <strong>$row</strong> and put it into an array of records, <strong>$records</strong> giving you something like this:</p>
<pre>Array (
	[0] =&gt; Array (
		[0] =&gt; record_1_column_1
		[1] =&gt; record_1_column_2
		[2] =&gt; record_1_column_3
	)
	[1] =&gt; Array (
		[0] =&gt; record_2_column_1
 		[1] =&gt; record_2_column_2
 		[2] =&gt; record_2_column_3
  	)
	[2] =&gt; Array (
 		[0] =&gt; record_3_column_1
 		[1] =&gt; record_3_column_2
 		[2] =&gt; record_3_column_3
  	)
 )</pre>
<h2>Making the data useable</h2>
<p>Now that we&#8217;ve got two tables/arrays of data &#8211; the field/column names, and each record&#8217;s array of data &#8211; it&#8217;s time to make it usable in a format that we can consistently expect to be returned. There are two ways to do this. We can create an array listind every record as an array with column_name keys and values</p>
<pre>// Return data in the format: array[record_id][column_name] = value
foreach($records as $rid =&gt; $record) {
	foreach($fields as $key =&gt; $name) {
		$result[$rid][$name] = $record[$key];
	}
}</pre>
<p>or we can list every column as an array of record id&#8217;s as keys and values.</p>
<pre>// Return the data in the format: array[column_name][record_id] = value
foreach($fields as $key =&gt; $name) {
	foreach($records as $record) {
		$result[$name][] = $record[$key];
	}
}</pre>
<p>Personally I find the first option to be more consistent with my results when calling a 2-dimensional result from MySQL queries, so it is the one I have gone with in my example at the start of the post, and in this description.</p>
<p>The <strong><a href="http://us3.php.net/manual/en/control-structures.foreach.php" target="_blank">foreach()</a></strong> statements describe a compilation of a <strong>$result</strong> array in this manner:</p>
<ol>
<li>For each item in the <strong>$records</strong> array, store the record_id as <strong>$rid</strong>, and the record array as <strong>$record</strong>.</li>
<li>Then for each item in the <strong>$fields</strong> array, store its cardinality as <strong>$key</strong> and it&#8217;s value/name as <strong>$name</strong>.</li>
<li>Then compile an array, iterating through each of the fields, storing this <strong>$record</strong>&#8216;s associated cardinality <strong>$key</strong>&#8216;s value into the <strong>$result</strong> array&#8217;s storage for this record&#8217;s id (<strong>$rid</strong>) under the appropriate field name.</li>
</ol>
<p>It&#8217;s a lot easier to grasp than it sounds. Basically, take array from the Query Results &#8211; Records section, and replace the # with the column name in each: [#] =&gt; record_y_column_x, but store it as a different array, called <strong>$results</strong>. The resulting array would look something like this:</p>
<pre>Array (
	[0] =&gt; Array (
		[column1] =&gt; record_1_column_1_data
		[column2] =&gt; record_1_column_2_data
		[column3] =&gt; record_1_column_3_data
	)
	[1] =&gt; Array (
		[column1] =&gt; record_2_column_1_data
 		[column2] =&gt; record_2_column_2_data
 		[column3] =&gt; record_2_column_3_data
  	)
	[2] =&gt; Array (
 		[column1] =&gt; record_3_column_1_data
 		[column2] =&gt; record_3_column_2_data
 		[column3] =&gt; record_3_column_3_data
  	)
 )</pre>
<h2>Close the connection, Return the result</h2>
<pre>		odbc_close($link);
		return $result;
	}
}</pre>
<p>Now that we&#8217;ve stored the data we need from the volatile <strong>$data</strong> variable returned from the SQL Query into <strong>$result</strong>, we can close the connection to <strong>$link</strong> using <strong><a href="http://us3.php.net/manual/en/function.odbc-close.php" target="_blank">odbc_close()</a></strong>, and then return <strong>$result</strong> for the program to do with it what it will.</p>
<h1>Conclusion</h1>
<p>This is just an example code that explains one way of many to extract a variable 1-2 dimension array of data from your SQL Query, using a Windows-Authenticated ODBC DSN connection. There are many other methods to do this, as well as security fixes, data scrubbing, and other modifications that one would probably want to do.</p>
<p>This is the first function I&#8217;ve written in any language to access an SQL Server via ODBC. This is also a function that has worked in tests, but that I have not yet put into production. I encourage you to take this bit of explanation and massage it into something that fits your needs in the code that you&#8217;re writing, and don&#8217;t rely on what I&#8217;ve got here as a written-in-stone example of good production-level code. This sample will change many times before I actually implement it.</p>
<p>Happy Hacking!</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/how+to+connect+to+sql+server+in+php+with+odbc' rel='tag' target='_blank'>how to connect to sql server in php with odbc</a>, <a class='technorati-link' href='http://technorati.com/tag/microsoft+odbc' rel='tag' target='_blank'>microsoft odbc</a>, <a class='technorati-link' href='http://technorati.com/tag/microsoft+sql+server' rel='tag' target='_blank'>microsoft sql server</a>, <a class='technorati-link' href='http://technorati.com/tag/mssql' rel='tag' target='_blank'>mssql</a>, <a class='technorati-link' href='http://technorati.com/tag/odbc' rel='tag' target='_blank'>odbc</a>, <a class='technorati-link' href='http://technorati.com/tag/odbc+connection' rel='tag' target='_blank'>odbc connection</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/php+odbc+connection' rel='tag' target='_blank'>php odbc connection</a>, <a class='technorati-link' href='http://technorati.com/tag/sql' rel='tag' target='_blank'>sql</a>, <a class='technorati-link' href='http://technorati.com/tag/sql+server+odbc+connection' rel='tag' target='_blank'>sql server odbc connection</a>, <a class='technorati-link' href='http://technorati.com/tag/windows+authenticated+odbc' rel='tag' target='_blank'>windows authenticated odbc</a>, <a class='technorati-link' href='http://technorati.com/tag/windows+authenticated+odbc+connection' rel='tag' target='_blank'>windows authenticated odbc connection</a>, <a class='technorati-link' href='http://technorati.com/tag/windows+odbc+connection' rel='tag' target='_blank'>windows odbc connection</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2011/02/how-to-connect-to-sql-through-windows-authenticated-odbc-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TweetSuite WordPress Plugin + Ping.fm (Preview)</title>
		<link>http://thepizzy.net/blog/2009/03/tweetsuite-wordpress-plugin-pingfm-preview/</link>
		<comments>http://thepizzy.net/blog/2009/03/tweetsuite-wordpress-plugin-pingfm-preview/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 16:41:23 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Ping.fm]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thought Experiments]]></category>
		<category><![CDATA[TweetSuite]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[dan zarrella]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[syndication]]></category>
		<category><![CDATA[tweetbacks]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=319</guid>
		<description><![CDATA[A couple weeks ago, I found out that Twitter had a Search feature that showed real-time tweets for a keyword. I gave it a little thought, considered what it would...]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago, I found out that <a href="http://twitter.com" target="_blank">Twitter</a> had a <a href="http://search.twitter.com" target="_blank">Search feature</a> that showed real-time tweets for a keyword. I gave it a little thought, considered what it would take to actually write the software &#8211; and then wised up, and decided to see if someone already did the hard work.</p>
<p>Sure enough, <a title="@danzarrella" href="http://twitter.com/danzarrella" target="_blank">Dan Zarrella</a> over at <a href="http://danzarrella.com/" target="_blank">danzarrella.com</a> had. He wrote one for <a href="http://danzarrella.com/tweetbacks-beta.html" target="_blank">Tweetbacks</a>, and then expanded on it with <a href="http://danzarrella.com/beyond-tweetbacks-introducing-tweetsuite.html" target="_blank">TweetSuite</a>. So I gave them a shot.</p>
<p>I started with Tweetbacks on the <a href="http://freeformfrog.com/blog" target="_blank">FreeformFrog.com Blog</a> and everything seemed to be working fine &#8211; until one day when the Tweetbacks stopped. It just stopped finding them &#8211; even though I knew they were getting tweeted &#8211; because I was using <a href="http://ping.fm" target="_blank">Ping.fm</a> to syndicate my blog posts to the appropriate social networks.</p>
<p>I gave it a couple weeks, and then decided I was going to fix it. I was tired of not having my TweetBacks working &#8211; especially during my efforts pushing a Social Networking campaign at job.</p>
<p>So, I added @danzarrella, and asked&#8230;</p>
<blockquote><p><span class="entry-content">@<a href="http://twitter.com/danzarrella">danzarrella</a> do you have plans to integrate ping.fm posting in TweetSuite? If not, mind if I take a crack at it?<br />
from @neotsn at <a class="entry-date" rel="bookmark" href="http://twitter.com/neotsn/status/1350750034"><span class="published">4:32 PM Mar 18th</span></a> from web</span></p></blockquote>
<p><span class="entry-content">A few minutes later, I got a response&#8230;</span></p>
<blockquote><p><span class="entry-content"><span class="entry-content">@<a href="http://twitter.com/neotsn">neotsn</a> go to town<br />
from @danzarrella at </span><span class="meta entry-meta"><a class="entry-date" rel="bookmark" href="http://twitter.com/danzarrella/status/1350761852"><span class="published">4:34 PM Mar 18th</span></a> from <a href="http://www.tweetdeck.com/">TweetDeck</a> <a href="http://twitter.com/neotsn/status/1350750034">in reply to neotsn</a></span></span></p></blockquote>
<p><span class="entry-content"><span class="meta entry-meta">Excellent&#8230;now I had his blessing to hack his codes. And so I have&#8230;<br />
</span></span></p>
<p><span class="entry-content"><span class="meta entry-meta"><span id="more-319"></span><br />
</span></span></p>
<h2><span class="entry-content"><span class="meta entry-meta">The download is coming soon</span></span></h2>
<h3><span class="entry-content"><span class="meta entry-meta">I have to get my Ping.fm API Key approved before anyone but me can install the plugin.<br />
</span></span></h3>
<p><span class="entry-content"><span class="meta entry-meta">And now I present to you a general overview of what I wanted to accomplish, and how I did it. (<strong>Please note, this is a GENERAL overview with some examples</strong> &#8211; it&#8217;s not meant to be a how-to, so don&#8217;t try to just copy/paste the samples &#8211; there is much more to do than can be explained here). Let&#8217;s get started&#8230;</span></span></p>
<h2><span class="entry-content"><span class="meta entry-meta">Objectives&#8230;</span></span></h2>
<ol>
<li><span style="text-decoration: underline;"><strong>Make it post through Ping.fm</strong></span> &#8211; I syndicate all my stuff through <a href="http://twitterfeed.com" target="_blank">twitterfeed.com</a> and it pushes everything out through Ping.fm for me. Upon further investigation, I noticed that TweetSuite used its own publishing code to push out the updates &#8211; after it created its own shortened urls and attached them. So of course it would never find my updates &#8211; it didn&#8217;t know what urls to search for, because it didn&#8217;t create them.</li>
<li><span style="text-decoration: underline;"><strong>Make it find my tweets that were pushed through Ping.fm</strong></span> &#8211; After realizing that it stopped searching for blog titles and started searching for the shortened urls as the unique identifier on the web, I realized that I needed it to create my urls and push them out with my Ping.fm update text. That was the only way to let TweetSuite know that there were tweets out there about my blog, and obtw here&#8217;s the link.</li>
<li><span style="text-decoration: underline;"><strong>Clean up some of the things that were a little messy</strong></span> &#8211; Once I got poking around in the code, I noticed that it some parts of it were written a little redundantly, and in order for me to maintain understanding of what was going on, I needed to clean it up a little.</li>
</ol>
<h2>Let&#8217;s Code&#8230;</h2>
<p>Well, for starters, to accomplish #1, I had to write a function that would validate the user&#8217;s app key with Ping.fm:<br />
{code type=php}<br />
/* [[Neo]] */<br />
//BEGIN Ping.fm functions<br />
function pingfm_verify() {<br />
	// request app key verification<br />
	$ch = curl_init();<br />
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
	curl_setopt($ch, CURLOPT_POST, true);<br />
	curl_setopt($ch, CURLOPT_URL, &#8216;http://api.ping.fm/v1/user.validate&#8217;);<br />
	curl_setopt($ch, CURLOPT_POSTFIELDS, Array(<br />
		&#8216;api_key&#8217; =&gt; get_option(&#8216;tweetsuite_ping_api_key&#8217;),<br />
		&#8216;user_app_key&#8217; =&gt; get_option(&#8216;tweetsuite_ping_app_key&#8217;)<br />
	));<br />
	$output = curl_exec($ch);<br />
	// update database with response<br />
	if (preg_match(&#8216;/OK/&#8217;, $output)) {<br />
		echo &#8216;	&lt;strong&gt;Your key has been verified.&lt;/strong&gt; Your can now post to your<br />
				&lt;a href=&#8221;http://www.ping.fm&#8221; target=&#8221;_blank&#8221;&gt;Ping.fm&lt;/a&gt; account.&#8217;;<br />
		update_option(&#8216;tweetsuite_ping_keyVerified&#8217;, 1);<br />
	} else {<br />
		echo (&#8216;&lt;strong&gt;Your key could not be verified.&lt;/strong&gt;.&#8217;);<br />
		update_option(&#8216;tweetsuite_ping_keyVerified&#8217;, 0);<br />
		return false;<br />
	}<br />
}</p>
<p>// END Ping.fm Functions<br />
{/code}<br />
Just your basic <span style="font-family: 'Courier New'; line-height: 18px; white-space: pre;">curl</span><span style="font-family: Georgia; line-height: 19px; white-space: normal;"> function to contact </span><span style="font-family: 'Courier New'; line-height: 18px; white-space: pre;">http://api.ping.fm/v1/user.validate</span><span style="font-family: Georgia; line-height: 19px; white-space: normal;"> and pass the api_key and user_app_key to the api, per the <a href="http://groups.google.com/group/pingfm-developers/web/api-documentation?pli=1#user.validate" target="_blank">API Documentation</a> on <strong>user.validate</strong>. Depending on the response, store it to the database, and display the appropriate message.</span></p>
<p><span style="font-family: Georgia; line-height: 19px; white-space: normal;">Next, I had to implement the fields to make that happen. We&#8217;ll start with the database&#8230;</span><br />
{code type=php}<br />
/* [[Neo]] */<br />
//ADDED:<br />
	add_option(&#8216;tweetsuite_ping_api_key&#8217;,&#8217;333333333333333333333333333333333&#8242;);<br />
	add_option(&#8216;tweetsuite_ping_app_key&#8217;,&#8221;);<br />
	add_option(&#8216;tweetsuite_use_ping&#8217;,0);<br />
	add_option(&#8216;tweetsuite_ping_keyVerified&#8217;,0);<br />
//END ADD<br />
{/code}<br />
This sticks those fields into the wordpress database table &#8220;wp_options&#8221; where all the config values go. My developer&#8217;s api key, a blank user application key, a field for the checkbox &#8220;Do you want to use Ping.fm?&#8221; and one for whether or not the user_app_key successfully verified.</p>
<p>Then I create the user interface for those fields (as well as rearrange the rest of the fields since these have to flow right to make sense&#8230;<br />
{code type=php}<br />
/* [[Neo]] */<br />
//ADDED:<br />
	update_option(&#8216;tweetsuite_ping_app_key&#8217;, $_POST['tweetsuite_ping_app_key']);<br />
//END ADD</p>
<p>//tweetsuite_use_ping<br />
($_POST['tweetsuite_use_ping']) ? update_option(&#8216;tweetsuite_use_ping&#8217;, 1) : update_option(&#8216;tweetsuite_use_ping&#8217;, 0);<br />
{/code}</p>
<p>That part allows the database to be updated with the data from the fields below&#8230;<br />
{code type=html}<br />
&lt;!&#8211; /* [[Neo]] */ &#8211;&gt;<br />
&lt;!&#8211; BEGIN ADD &#8211;&gt;<br />
&lt;tr valign=&#8221;top&#8221;&gt;<br />
	&lt;th scope=&#8221;row&#8221;&gt;Ping.fm :: Use Ping.fm to publish new posts (via your default method)?:&lt;/th&gt;<br />
	&lt;td&gt;&lt;INPUT TYPE=CHECKBOX NAME=&#8221;tweetsuite_use_ping&#8221; &lt;?php if(get_option(&#8216;tweetsuite_use_ping&#8217;)) { echo &#8220;checked&#8221;; } ?&gt;&gt;<br />
		&lt;br /&gt;&lt;b&gt;["Send a Tweet when you publish" is required for this to work]&lt;/b&gt;<br />
	&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr valign=&#8221;top&#8221;&gt;<br />
	&lt;th scope=&#8221;row&#8221;&gt;Ping.fm :: Your Ping.fm &lt;a href=&#8221;http://ping.fm/key/&#8221; target=&#8221;_blank&#8221;&gt;Application Key&lt;/a&gt;:&lt;/th&gt;<br />
	&lt;td&gt;&lt;INPUT TYPE=text NAME=&#8221;tweetsuite_ping_app_key&#8221;  value=&#8217;&lt;?php echo get_option(&#8216;tweetsuite_ping_app_key&#8217;); ?&gt;&#8217; /&gt;&lt;br /&gt;&lt;?php if(get_option(&#8216;tweetsuite_ping_app_key&#8217;)) { echo pingfm_verify(); } ?&gt;<br />
	&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;!&#8211; END ADD &#8211;&gt;<br />
{/code}<br />
This is below the checkbox for &#8220;Send a Tweet when you publish a post?&#8221;&#8230;if that is checked, then if you check &#8220;Use Ping.fm to publish new posts (via your default method)?&#8221; and fill out the next field for &#8220;Your Ping.fm <a href="http://ping.fm/key/" target="_blank">Application Key</a>&#8221; then it will send your post details on Publish through Ping.fm instead of Twitter itself, appending the tinyurl associated with the post to your Ping.fm message. All this is done by editing the function that sends the tweets&#8230;<br />
{code type=php}<br />
function tweetsuite_send($msg) {<br />
	/* [[Neo]] */<br />
	//REMOVED:<br />
	//$prefix = urlencode(get_option(&#8216;tweetsuite_prefix&#8217;).&#8217; &#8216;);<br />
	//REPLACED:<br />
	$prefix = (get_option(tweetsuite_use_ping) and get_option(tweetsuite_ping_keyVerified)) ? get_option(&#8216;tweetsuite_prefix&#8217;).&#8217; &#8216; : urlencode(get_option(&#8216;tweetsuite_prefix&#8217;).&#8217; &#8216;);<br />
	$msg = $prefix.$msg;</p>
<p>	/* [[Neo]] */<br />
	//ADDED<br />
	if(get_option(tweetsuite_use_ping) and get_option(tweetsuite_ping_keyVerified)) {<br />
		$ch = curl_init();<br />
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
		curl_setopt($ch, CURLOPT_POST, true);<br />
		curl_setopt($ch, CURLOPT_URL, &#8216;http://api.ping.fm/v1/user.post&#8217;);<br />
		curl_setopt($ch, CURLOPT_POSTFIELDS, Array(<br />
			&#8216;api_key&#8217; =&gt; get_option(&#8216;tweetsuite_ping_api_key&#8217;),<br />
			&#8216;user_app_key&#8217; =&gt; get_option(&#8216;tweetsuite_ping_app_key&#8217;),<br />
			&#8216;post_method&#8217; =&gt; &#8220;default&#8221;,<br />
			&#8216;body&#8217; =&gt; $msg)<br />
		);<br />
		$output = curl_exec($ch);<br />
	} else {<br />
		//END ADD<br />
		$username = get_option(&#8216;tweetsuite_twitter_username&#8217;);<br />
		$password = get_option(&#8216;tweetsuite_twitter_password&#8217;);<br />
		if(($username) and ($password))  {<br />
			$url = &#8216;http://twitter.com/statuses/update.xml&#8217;;<br />
			$curl_handle = curl_init();<br />
			curl_setopt($curl_handle, CURLOPT_URL, &#8220;$url&#8221;);<br />
			curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);<br />
			curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);<br />
			curl_setopt($curl_handle, CURLOPT_POST, 1);<br />
			curl_setopt($curl_handle, CURLOPT_POSTFIELDS, &#8220;status=$msg&#8221;);<br />
			curl_setopt($curl_handle, CURLOPT_USERPWD, &#8220;$username:$password&#8221;);<br />
			$buffer = curl_exec($curl_handle);<br />
			curl_close($curl_handle);<br />
		}<br />
	/* [[Neo]] */<br />
	//ADDED<br />
	}<br />
	//END ADD<br />
}<br />
{/code}<br />
This starts off by swapping out the original <strong>urlencode()</strong> function for a conditional statement deciding if this is a ping.fm post or a twitter post. If it&#8217;s a ping.fm post, then we don&#8217;t want to <strong>urlencode()</strong> the prefix, because it sticks + signs where there should be spaces in the prefix to the title. However, if we don&#8217;t want to use ping.fm, then don&#8217;t mess with the original code.</p>
<p>Following that, it splits which method we used to post, based on the same criteria &#8211; make sure the checkbox is true for &#8220;tweetsuite_use_ping&#8221; and that the user&#8217;s app key is verified in &#8220;tweetsuite_ping_keyVerified&#8221;. If that&#8217;s the case, then post it through ping.fm &#8211; if any of that is not met, then go ahead and try to post it through twitter. If there is no username and password supplied on the options page, then we just won&#8217;t post anything.</p>
<p>Now&#8230;about the whole $msg &#8211; that part got skipped in the logic of everything. This was the tricky part, for me. Originally, I stumbled across an API Documentation page for the ping.fm method &#8220;url.shorten&#8221; and that was the very thing I needed &#8211; something to grab a ping.fm url, without passing it through ping.fm yet. However, I found out, after much frustration, that this method was mysteriously &#8220;depreciated&#8221; (which should be read as &#8220;edited off the page, and 404&#8242;d when you try to use it). But, I found <a href="http://groups.google.com/group/pingfm-developers/browse_thread/thread/e6bf14bd63fdb7df/e59e3c16424ad20f?lnk=gst&amp;q=url+shortening#e59e3c16424ad20f" target="_blank">another solution</a> in the knowledgebase at Ping.fm&#8230;<br />
{code type=php}<br />
function ts_send_tweet($postID) {<br />
	global $wpdb;<br />
	if(!is_int($postID))<br />
		$postID = $postID-&gt;ID;</p>
<p>	$table_name = $wpdb-&gt;prefix . &#8220;shorturls&#8221;;<br />
	$line = $wpdb-&gt;get_row(&#8220;select * from $table_name where postID=$postID&#8221;);<br />
	if($line-&gt;postID==$postID) {<br />
		/* [[Neo]] */<br />
		// ADDED: &#8220;*&#8221;.<br />
		$shorturl = &#8220;*&#8221;.$line-&gt;tinyurl;<br />
		$post = get_post($postID);<br />
		if(get_option(&#8216;tweetsuite_send_posts&#8217;))<br />
			tweetsuite_send(trim($post-&gt;post_title).&#8217; &#8216;.$shorturl);<br />
	}<br />
}<br />
{/code}<br />
The article said you can prepend a <strong>* </strong>to the front of a url and it would not shorten it (in addition to the fact that they said they wouldn&#8217;t re-shorten any URLs 24 characters or smaller). So, I went with the * solution, because we&#8217;re already providing short URLs, but don&#8217;t want to risk the functionality in future updates to allow for custom url shortening services.</p>
<p>And that accomplishes both #1 and #2. We have the TweetSuite posting its updates through the Ping.fm API, and pushing a shortened url out with the post. TweetSuite then becomes aware of this url at publish, and stores it in its database. Then the cron job that runs every 5 minutes searches on any version of the URL that was stored and pulls back all the entries from the search.twitter.com Atom feed &#8211; parses them, and updates the database with them.</p>
<p>The rest of the stuff I did in the plugin was merely cleaning up&#8230;for example, reading the shortened urls from the Atom feed. The original code was:<br />
{code type=php}<br />
if(stristr($tweet, &#8216;http://bit.ly&#8217;)) {<br />
	if(strstr($tweet, $bitly)) {<br />
		$add = true;<br />
	} else {<br />
		$add = false;<br />
	}<br />
}<br />
{/code}<br />
Because the urls are using alphanumeric sequences to track what link is what &#8211; and the url&#8217;s are case-sensitive, it was returning links that were not related to the post. For example, I got <a href="http://twitter.com/lukebuchanan/statuses/1332713478" target="_blank">someone&#8217;s tweet about Rush Limbaugh</a> because the bit.ly url (&#8220;http://bit.ly/fyhz&#8221;)was the same letters, but in a different case then my original &#8220;http://bit.ly/FyhZ&#8221;. So I changed the order of the search, did it for all the services currently supported, and cleaned up the code a little:<br />
{code type=php}&#8230;<br />
if(strstr($tweet, &#8216;http://bit.ly&#8217;)) { $add = (stristr($tweet, $bitly)) ? true : false; } else {<br />
&#8230;<br />
{/code}<br />
The function<strong> strstr() </strong>is <strong>not</strong> case-sensitive, and that&#8217;s ok for a search on the domain name &#8211; we want anything that looks close to &#8220;bit.ly&#8221; to return positive. However, once it does, it&#8217;s imperitive that we use the case-sensitive <strong>stristr()</strong> function to return a positive result only if the full url matches what we have in the database case-for-case.</p>
<h2>Wrapping up&#8230;</h2>
<p>I made a couple more additions to the code beyond that, some of them required for functionality, some of them for cosmetics. I&#8217;ve submitted my plugin version to Ping.fm to approve it, and take my Developer&#8217;s Key out of &#8220;Pending&#8221; status. Once that&#8217;s done, I&#8217;ll send it off to Dan Zarrella to take a look and see how he wants to move forward. Then I&#8217;ll be able to post the plugin for download (definitely here, but also on the WordPress Plugin directory.</p>
<h2>Continuing on&#8230;</h2>
<p>I have read through the comments on Dan&#8217;s blog from the people, and have taken note of the things that they are asking for. After reading the code, he had already been working on some of the features. There are 5 main ones that people are asking for, and I&#8217;ve already done one of them in this release:</p>
<ol>
<li><span style="text-decoration: line-through;">TweetThis link opens in a new window.</span></li>
<li>AutoUpgrade via WordPress Plugin Directory</li>
<li>Allow customized URL Shortening Services</li>
<li>TweetThis links for pre-installation posts</li>
<li>TweetThis links on the home page.</li>
</ol>
<p>I&#8217;ll be looking more into the other options and see what I can do.</p>
<h2>One More Thing&#8230;</h2>
<p>This post was syndicated through the TweetSuite + Ping.fm plugin <img src='http://thepizzy.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/beta' rel='tag' target='_blank'>beta</a>, <a class='technorati-link' href='http://technorati.com/tag/dan+zarrella' rel='tag' target='_blank'>dan zarrella</a>, <a class='technorati-link' href='http://technorati.com/tag/database' rel='tag' target='_blank'>database</a>, <a class='technorati-link' href='http://technorati.com/tag/internet' rel='tag' target='_blank'>internet</a>, <a class='technorati-link' href='http://technorati.com/tag/MySQL' rel='tag' target='_blank'>MySQL</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/Ping.fm' rel='tag' target='_blank'>Ping.fm</a>, <a class='technorati-link' href='http://technorati.com/tag/site' rel='tag' target='_blank'>site</a>, <a class='technorati-link' href='http://technorati.com/tag/syndication' rel='tag' target='_blank'>syndication</a>, <a class='technorati-link' href='http://technorati.com/tag/tweetbacks' rel='tag' target='_blank'>tweetbacks</a>, <a class='technorati-link' href='http://technorati.com/tag/TweetSuite' rel='tag' target='_blank'>TweetSuite</a>, <a class='technorati-link' href='http://technorati.com/tag/twitter' rel='tag' target='_blank'>twitter</a>, <a class='technorati-link' href='http://technorati.com/tag/Wordpress' rel='tag' target='_blank'>WordPress</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2009/03/tweetsuite-wordpress-plugin-pingfm-preview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>twitter &amp; tsn.7</title>
		<link>http://thepizzy.net/blog/2008/01/twitter-tsn7/</link>
		<comments>http://thepizzy.net/blog/2008/01/twitter-tsn7/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:31:04 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[the-spot.net]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[buddy list]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[database backend]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[front page]]></category>
		<category><![CDATA[members]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[rss reader]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[tsn.7]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=100</guid>
		<description><![CDATA[With a new My Spot page comes new possibilities. This time around, I&#8217;m going to make a concerted effort to actually write in new code and attach a new database...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1181" title="the-spot.net logo" src="http://thepizzy.net/blog/wp-content/uploads/2008/04/Untitled-2-150x150.png" alt="" width="150" height="150" />With a new My Spot page comes new possibilities. This time around, I&#8217;m going to make a concerted effort to actually write in new code and attach a new database backend that pulls from the phpbb database and the users&#8217; accounts on the-spot.net.With this new plan, there will be increased ability to add features and remove features on the user-level&#8230;that is to say, you can choose what you want to see on the page.</p>
<p>There will also be some integration to popular social sites right on the My Spot page, like twitter and flickr &#8211; community based sites with an API that doesn&#8217;t require you to visit their site in order to view content.</p>
<p>Last night, I worked with the twitter.com API and with the RSS reader that I&#8217;ve hacked up in PHP, and turned out the twitter stream for the-spot.net&#8217;s twitter friends. That will go on the front page of the My Spot page so that everyone on tsn can know what all the other tsn members are twittering about.</p>
<p>The next thing I&#8217;m going to be doing with that is working on a way to allow the users to update their twitter status directly from tsn. That&#8217;s going to take a bit more work than displaying the feed, but it will be a good challenge.</p>
<p>On the previous version of the site, there was a flickr flash app that showed the new photos from the tsn flickr group. That will be coming back as well.</p>
<p>I&#8217;m also going to try to make the User Control Panel more accessible and integrate the Buddy List into the My Spot page so you can see when your favorite posters are online (since the information box at the bottom displays the last X minutes, and not &#8220;Currently&#8221; online).</p>
<p>I&#8217;m still trying to gather new ideas from everyone about what they&#8217;d like to see on the page&#8230;and I hope to make it modular like that previous My Spot page was so they can just be plugged in to the template based on information in the new database determining whether or not they wish to see that.</p>
<p>if you have any ideas &#8211; leave comments, or message me directly.</p>
<p style="text-align: right; font-size: 8px;">Blogged with <a title="Flock" href="http://www.flock.com/blogged-with-flock" target="_new">Flock</a></p>
<p><!-- technorati tags begin --></p>
<p style="font-size: 10px; text-align: right;">Tags: <a rel="tag" href="http://technorati.com/tag/the-spot.net">the-spot.net</a>, <a rel="tag" href="http://technorati.com/tag/tsn7">tsn7</a>, <a rel="tag" href="http://technorati.com/tag/%20my%20spot"> my spot</a>, <a rel="tag" href="http://technorati.com/tag/%20flickr"> flickr</a>, <a rel="tag" href="http://technorati.com/tag/%20twitter"> twitter</a>, <a rel="tag" href="http://technorati.com/tag/%20api"> api</a>, <a rel="tag" href="http://technorati.com/tag/%20programming"> programming</a>, <a rel="tag" href="http://technorati.com/tag/%20hacking"> hacking</a>, <a rel="tag" href="http://technorati.com/tag/%20rss"> rss</a>, <a rel="tag" href="http://technorati.com/tag/%20php"> php</a>, <a rel="tag" href="http://technorati.com/tag/%20tsn"> tsn</a>, <a rel="tag" href="http://technorati.com/tag/%20community"> community</a>, <a rel="tag" href="http://technorati.com/tag/%20integration"> integration</a>, <a rel="tag" href="http://technorati.com/tag/%20mashup"> mashup</a></p>
<p><!-- technorati tags end --></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/api' rel='tag' target='_blank'>api</a>, <a class='technorati-link' href='http://technorati.com/tag/buddy+list' rel='tag' target='_blank'>buddy list</a>, <a class='technorati-link' href='http://technorati.com/tag/community' rel='tag' target='_blank'>community</a>, <a class='technorati-link' href='http://technorati.com/tag/database+backend' rel='tag' target='_blank'>database backend</a>, <a class='technorati-link' href='http://technorati.com/tag/flash' rel='tag' target='_blank'>flash</a>, <a class='technorati-link' href='http://technorati.com/tag/flickr' rel='tag' target='_blank'>flickr</a>, <a class='technorati-link' href='http://technorati.com/tag/front+page' rel='tag' target='_blank'>front page</a>, <a class='technorati-link' href='http://technorati.com/tag/members' rel='tag' target='_blank'>members</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/phpbb' rel='tag' target='_blank'>phpbb</a>, <a class='technorati-link' href='http://technorati.com/tag/RSS' rel='tag' target='_blank'>RSS</a>, <a class='technorati-link' href='http://technorati.com/tag/rss+reader' rel='tag' target='_blank'>rss reader</a>, <a class='technorati-link' href='http://technorati.com/tag/style' rel='tag' target='_blank'>style</a>, <a class='technorati-link' href='http://technorati.com/tag/template' rel='tag' target='_blank'>template</a>, <a class='technorati-link' href='http://technorati.com/tag/the-spot.net' rel='tag' target='_blank'>the-spot.net</a>, <a class='technorati-link' href='http://technorati.com/tag/tsn.7' rel='tag' target='_blank'>tsn.7</a>, <a class='technorati-link' href='http://technorati.com/tag/twitter' rel='tag' target='_blank'>twitter</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2008/01/twitter-tsn7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[[Oracle]] and tsnlocal.net</title>
		<link>http://thepizzy.net/blog/2006/09/oracle-and-tsnlocalnet/</link>
		<comments>http://thepizzy.net/blog/2006/09/oracle-and-tsnlocalnet/#comments</comments>
		<pubDate>Thu, 21 Sep 2006 22:14:00 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[the-spot.net]]></category>
		<category><![CDATA[The-Spot.Network]]></category>
		<category><![CDATA[thepizzy.net]]></category>
		<category><![CDATA[tsnLocal.net]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[[[Oracle]]]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[chat rooms]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dns control]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[dyndns]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[email server]]></category>
		<category><![CDATA[email settings]]></category>
		<category><![CDATA[exodus]]></category>
		<category><![CDATA[FileZilla]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[hamachi]]></category>
		<category><![CDATA[instant messaging]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[jabber client]]></category>
		<category><![CDATA[jabber server]]></category>
		<category><![CDATA[Jabbin]]></category>
		<category><![CDATA[nameserver]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql capabilities]]></category>
		<category><![CDATA[VoIP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[webpage]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[Wildfire]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=73</guid>
		<description><![CDATA[I&#8217;ve spent the last two weeks working on getting [[Oracle]] into the role she was designed to play&#8230;but have found it to be a bit more involved than I realized....]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1191" title="oracle" src="http://thepizzy.net/blog/wp-content/uploads/2007/10/oracle-150x150.png" alt="" width="150" height="150" />I&#8217;ve spent the last two weeks working on getting [[Oracle]] into the role she was designed to play&#8230;but have found it to be a bit more involved than I realized.</p>
<p>Originally, I set up the server to be a <a title="[[Oracle]] Reborn, tsnlocal goes up beta" href="http://thepizzy.net/blog/2006/09/oracle-reborn-tsnlocal-goes-up-beta/" target="_blank">web server with php and sql capabilities</a>. Then I realized I needed to FTP files to the web server, so I installed <a href="http://filezilla.sourceforge.net/" target="_blank">FileZilla Server</a>. Once that was done, I started working on the webpage for tsnlocal.net. I got it up, and then wanted to play around with some other type of server, and decided on a Jabber server for instant messaging. I installed <a href="http://www.jivesoftware.org/index.jsp" target="_blank">Wildfire</a>.</p>
<p>Wildfire is extremely easy to setup and install &#8211; so once I finished that, I looked for a Jabber client. My first choice was a VoIP client called <a href="http://www.jabbin.com/int/" target="_blank">Jabbin</a>, but I couldn&#8217;t get it to connect to the server &#8211; probably because I don&#8217;t have a VoIP Protocol on the server to support it. So I went with what we use at work, <a href="http://exodus.jabberstudio.org/: target=">Exodus</a>. It&#8217;s a fairly functional Jabber client &#8211; with chat rooms, IM rosters, subscriptions, and file transfer&#8230;and a bunch of other stuff, including plugins.</p>
<p>Once the Jabber service was set up, and I figured out how to connect to it, I realized that telling people to use my dyndns domain name was not going to work. So I had to figure out how to get my Godaddy.com domain name to link directly to my IP address. But, come to find out, I have to have a Top Level Domain for an IP address, or my dyndns must be a nameserver registered with the NS Registry, in order to use it as a nameserver. I spent 2 days setting up BIND on Windows XP (because there was very little help on the internet for how to do it). Then I jacked around with the Total DNS control settings on godaddy, and got the webserver to work like it should &#8211; almost.</p>
<p>So now you can join the jabber server with yourname@jabber.tsnlocal.net. Now that I had that working, I noticed that there were email settings like pop.tsnlocal.net and smtp.tsnlocal.net that could be set up, so I decided to look into running my own email server. I got in #bloodshotgamer on irc.gamesurge.net and asked some of the tecky people I talk to in there what they&#8217;d recommend. Duck-Lap recommended qmail for linux, but mentined <a href="http://mailenable.com" target="_blank">MailEnable</a> for Windows. I was hoping for an IMAP service so I could run the webpage side of it, but that was not included with this. I might upgrade the service to something new later on, but for now, this was easy to install, and has easy administration, which is what I&#8217;m looking for since most of these other services aren&#8217;t critical to the function of the server. BIND was about the only thing that was hell to configure&#8230;everything else was easily figured out once I had the info and a general grasp of what it does and how it does it.</p>
<p>So now, [[Oracle]] does these things:<br />
- Web Server (Apache, PHP, MySQL)<br />
- FTP Server<br />
- DNS Server<br />
- Email Server<br />
- Jabber Server<br />
- TeamSpeak Voicechat Server<br />
- Hamachi server<br />
- Google Desktop distributed indexing server for the hamachi shares (the essence of tsnlocal)<br />
- and a keep-alive for the dyndns service linking my IP to the dynamic domain</p>
<p>That&#8217;s a lot for a little box&#8230;but I&#8217;m not done yet &#8211; I need to put ssh on it so I can telnet into it. I&#8217;m sure there are other things that I will find to do with it as time goes on too.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/bind' rel='tag' target='_blank'>bind</a>, <a class='technorati-link' href='http://technorati.com/tag/chat+rooms' rel='tag' target='_blank'>chat rooms</a>, <a class='technorati-link' href='http://technorati.com/tag/DNS' rel='tag' target='_blank'>DNS</a>, <a class='technorati-link' href='http://technorati.com/tag/dns+control' rel='tag' target='_blank'>dns control</a>, <a class='technorati-link' href='http://technorati.com/tag/domain+name' rel='tag' target='_blank'>domain name</a>, <a class='technorati-link' href='http://technorati.com/tag/dyndns' rel='tag' target='_blank'>dyndns</a>, <a class='technorati-link' href='http://technorati.com/tag/Email' rel='tag' target='_blank'>Email</a>, <a class='technorati-link' href='http://technorati.com/tag/email+server' rel='tag' target='_blank'>email server</a>, <a class='technorati-link' href='http://technorati.com/tag/email+settings' rel='tag' target='_blank'>email settings</a>, <a class='technorati-link' href='http://technorati.com/tag/exodus' rel='tag' target='_blank'>exodus</a>, <a class='technorati-link' href='http://technorati.com/tag/FileZilla' rel='tag' target='_blank'>FileZilla</a>, <a class='technorati-link' href='http://technorati.com/tag/FTP' rel='tag' target='_blank'>FTP</a>, <a class='technorati-link' href='http://technorati.com/tag/godaddy' rel='tag' target='_blank'>godaddy</a>, <a class='technorati-link' href='http://technorati.com/tag/hamachi' rel='tag' target='_blank'>hamachi</a>, <a class='technorati-link' href='http://technorati.com/tag/instant+messaging' rel='tag' target='_blank'>instant messaging</a>, <a class='technorati-link' href='http://technorati.com/tag/internet' rel='tag' target='_blank'>internet</a>, <a class='technorati-link' href='http://technorati.com/tag/Jabber' rel='tag' target='_blank'>Jabber</a>, <a class='technorati-link' href='http://technorati.com/tag/jabber+client' rel='tag' target='_blank'>jabber client</a>, <a class='technorati-link' href='http://technorati.com/tag/jabber+server' rel='tag' target='_blank'>jabber server</a>, <a class='technorati-link' href='http://technorati.com/tag/Jabbin' rel='tag' target='_blank'>Jabbin</a>, <a class='technorati-link' href='http://technorati.com/tag/nameserver' rel='tag' target='_blank'>nameserver</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/pop' rel='tag' target='_blank'>pop</a>, <a class='technorati-link' href='http://technorati.com/tag/server' rel='tag' target='_blank'>server</a>, <a class='technorati-link' href='http://technorati.com/tag/setup' rel='tag' target='_blank'>setup</a>, <a class='technorati-link' href='http://technorati.com/tag/smtp' rel='tag' target='_blank'>smtp</a>, <a class='technorati-link' href='http://technorati.com/tag/sql' rel='tag' target='_blank'>sql</a>, <a class='technorati-link' href='http://technorati.com/tag/sql+capabilities' rel='tag' target='_blank'>sql capabilities</a>, <a class='technorati-link' href='http://technorati.com/tag/VoIP' rel='tag' target='_blank'>VoIP</a>, <a class='technorati-link' href='http://technorati.com/tag/Web' rel='tag' target='_blank'>Web</a>, <a class='technorati-link' href='http://technorati.com/tag/web+server' rel='tag' target='_blank'>web server</a>, <a class='technorati-link' href='http://technorati.com/tag/webpage' rel='tag' target='_blank'>webpage</a>, <a class='technorati-link' href='http://technorati.com/tag/webserver' rel='tag' target='_blank'>webserver</a>, <a class='technorati-link' href='http://technorati.com/tag/Wildfire' rel='tag' target='_blank'>Wildfire</a>, <a class='technorati-link' href='http://technorati.com/tag/Windows' rel='tag' target='_blank'>Windows</a>, <a class='technorati-link' href='http://technorati.com/tag/%5B%5BOracle%5D%5D' rel='tag' target='_blank'>[[Oracle]]</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2006/09/oracle-and-tsnlocalnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[[Oracle]] Reborn, tsnlocal goes up beta</title>
		<link>http://thepizzy.net/blog/2006/09/oracle-reborn-tsnlocal-goes-up-beta/</link>
		<comments>http://thepizzy.net/blog/2006/09/oracle-reborn-tsnlocal-goes-up-beta/#comments</comments>
		<pubDate>Mon, 11 Sep 2006 13:16:29 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[the-spot.net]]></category>
		<category><![CDATA[tsnLocal.net]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[[m3rlin]]]></category>
		<category><![CDATA[[[Oracle]]]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache mysql]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[computer oracle]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[game server]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hamachi]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[irc bot]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[network connections]]></category>
		<category><![CDATA[network shares]]></category>
		<category><![CDATA[oracle hosting]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search page]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[TeamSpeak]]></category>
		<category><![CDATA[teamspeak server]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[WAMP]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=71</guid>
		<description><![CDATA[This weekend, I hung out with [wizard] and we worked on our servers. He created his [m3rlin] server, and I created my [[Oracle]] server. Originally, as you might recall from...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1191" title="oracle" src="http://thepizzy.net/blog/wp-content/uploads/2007/10/oracle-150x150.png" alt="" width="150" height="150" />This weekend, I hung out with [wizard] and we worked on our servers. He created his [m3rlin] server, and I created my [[Oracle]] server.</p>
<p>Originally, as you might recall from <a title="Project: [[Oracle]].Server" href="http://thepizzy.net/blog/2006/03/project-oracleserver/">previous</a> <a title="Update: [[Oracle]].Server" href="http://thepizzy.net/blog/2006/04/project-oracleserver-updated/">posts</a>, [[Oracle]] is an IRC bot that we use for auto responding and chanserv purposes. Our bots are still the same in function so far, but they each have their own computer.</p>
<p>[[Oracle]] is now the webserver for tsnlocal.net, and runs the tsn.lcl project. It&#8217;s hosting a hamachi client, and serveral tsnlocal network connections. It&#8217;s also using Google Desktop those network shares, so that I can make them web-searchable, and the files downloadable for those connected to the tsnlocal network. I&#8217;m still working on the technology to provide the search page to the outside world (though the files will only be accessible to those who are connected and authenticated to the hamachi network.</p>
<p>To do this, I have installed WAMP (Apache, MySQL, and PHP for Windows) and put it on an XP Professional box. There is a main webpage up right now that shows the online status of [[Oracle]] and [[Oracle]].1 (a secondary server, of which there is also an [[Oracle]].2 which will be used later). The webpage also shows the online status of those involved with the tsnlocal project. The design of the webpage is still under construction though, at the moment.</p>
<p>[[Oracle]] is also hosting some other services for tsn&#8230;things that aren&#8217;t directly tied to the website, per se&#8230;like a TeamSpeak server, Blockland game server, and some other stuff that I haven&#8217;t gotten to set up yet.</p>
<p>It&#8217;s also been brought to my attention that there is a security exploit in Apache for windows, and [[Oracle]] will be the test-bed for solving that exploit. I have a solution in mind that would work, but might be a bit difficult to set up &#8211; though it would solve the problem until a patch is fixed. I&#8217;ll post more on that when I get some time to test it.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Apache' rel='tag' target='_blank'>Apache</a>, <a class='technorati-link' href='http://technorati.com/tag/apache+mysql' rel='tag' target='_blank'>apache mysql</a>, <a class='technorati-link' href='http://technorati.com/tag/client' rel='tag' target='_blank'>client</a>, <a class='technorati-link' href='http://technorati.com/tag/computer+oracle' rel='tag' target='_blank'>computer oracle</a>, <a class='technorati-link' href='http://technorati.com/tag/design' rel='tag' target='_blank'>design</a>, <a class='technorati-link' href='http://technorati.com/tag/game+server' rel='tag' target='_blank'>game server</a>, <a class='technorati-link' href='http://technorati.com/tag/google' rel='tag' target='_blank'>google</a>, <a class='technorati-link' href='http://technorati.com/tag/hamachi' rel='tag' target='_blank'>hamachi</a>, <a class='technorati-link' href='http://technorati.com/tag/IRC' rel='tag' target='_blank'>IRC</a>, <a class='technorati-link' href='http://technorati.com/tag/irc+bot' rel='tag' target='_blank'>irc bot</a>, <a class='technorati-link' href='http://technorati.com/tag/MySQL' rel='tag' target='_blank'>MySQL</a>, <a class='technorati-link' href='http://technorati.com/tag/network+connections' rel='tag' target='_blank'>network connections</a>, <a class='technorati-link' href='http://technorati.com/tag/network+shares' rel='tag' target='_blank'>network shares</a>, <a class='technorati-link' href='http://technorati.com/tag/oracle+hosting' rel='tag' target='_blank'>oracle hosting</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/search+page' rel='tag' target='_blank'>search page</a>, <a class='technorati-link' href='http://technorati.com/tag/Servers' rel='tag' target='_blank'>Servers</a>, <a class='technorati-link' href='http://technorati.com/tag/TeamSpeak' rel='tag' target='_blank'>TeamSpeak</a>, <a class='technorati-link' href='http://technorati.com/tag/teamspeak+server' rel='tag' target='_blank'>teamspeak server</a>, <a class='technorati-link' href='http://technorati.com/tag/technology' rel='tag' target='_blank'>technology</a>, <a class='technorati-link' href='http://technorati.com/tag/the-spot.net' rel='tag' target='_blank'>the-spot.net</a>, <a class='technorati-link' href='http://technorati.com/tag/tsnLocal.net' rel='tag' target='_blank'>tsnLocal.net</a>, <a class='technorati-link' href='http://technorati.com/tag/WAMP' rel='tag' target='_blank'>WAMP</a>, <a class='technorati-link' href='http://technorati.com/tag/webserver' rel='tag' target='_blank'>webserver</a>, <a class='technorati-link' href='http://technorati.com/tag/website' rel='tag' target='_blank'>website</a>, <a class='technorati-link' href='http://technorati.com/tag/Windows' rel='tag' target='_blank'>Windows</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2006/09/oracle-reborn-tsnlocal-goes-up-beta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Update: tsnX – tsnX-lite theme, et al.</title>
		<link>http://thepizzy.net/blog/2006/07/update-tsnx-tsnx-lite-theme-et-al/</link>
		<comments>http://thepizzy.net/blog/2006/07/update-tsnx-tsnx-lite-theme-et-al/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 15:41:54 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[the-blot.net]]></category>
		<category><![CDATA[the-spot.net]]></category>
		<category><![CDATA[The-Spot.Network]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Blot]]></category>
		<category><![CDATA[lan party]]></category>
		<category><![CDATA[photoalbum]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[profiles]]></category>
		<category><![CDATA[Spot]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tsnX]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=67</guid>
		<description><![CDATA[So it&#8217;s time for an update. The tsnX-lite theme is up, and has been since the LAN party. Let me know what you think. It&#8217;s not all the way finished...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1181" title="the-spot.net logo" src="http://thepizzy.net/blog/wp-content/uploads/2008/04/Untitled-2-150x150.png" alt="" width="150" height="150" />So it&#8217;s time for an update. The tsnX-lite theme is up, and has been since the LAN party. Let me know what you think. It&#8217;s not all the way finished yet&#8230;I&#8217;m still working on it, and 4 others based on it.</p>
<p>I&#8217;m also going to be working on two versions of the former &#8220;My Spot&#8221; page&#8230;one that is universal, and one that is user-oriented/customized. The customized one (My Spot) will be written in AJAX, the universal one (The Spot) will be in php.</p>
<p>The new My Spot page will also be the basis for the My Blot page, that will be the essence of the-blot.net &#8211; insomuch as the settings will be saved per user on the My Spot page, and will be accessible by user_id&#8230;whereas the My Blot page will be accessible by username: the-blot.net/KD or /~day_dreamer~ or /Agent%20Smith.</p>
<p>There will be further posts concerning what the details of all the pages will contain&#8230;but greater emphasis will be placed on the photoalbum, journals, profiles, and buddy lists with the coming pages.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ajax' rel='tag' target='_blank'>ajax</a>, <a class='technorati-link' href='http://technorati.com/tag/Blot' rel='tag' target='_blank'>Blot</a>, <a class='technorati-link' href='http://technorati.com/tag/lan+party' rel='tag' target='_blank'>lan party</a>, <a class='technorati-link' href='http://technorati.com/tag/photoalbum' rel='tag' target='_blank'>photoalbum</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/profiles' rel='tag' target='_blank'>profiles</a>, <a class='technorati-link' href='http://technorati.com/tag/Spot' rel='tag' target='_blank'>Spot</a>, <a class='technorati-link' href='http://technorati.com/tag/the-spot.net' rel='tag' target='_blank'>the-spot.net</a>, <a class='technorati-link' href='http://technorati.com/tag/theme' rel='tag' target='_blank'>theme</a>, <a class='technorati-link' href='http://technorati.com/tag/tsnX' rel='tag' target='_blank'>tsnX</a>, <a class='technorati-link' href='http://technorati.com/tag/update' rel='tag' target='_blank'>update</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2006/07/update-tsnx-tsnx-lite-theme-et-al/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;We&#8217;re number 1!!&#8221;</title>
		<link>http://thepizzy.net/blog/2006/05/were-number-1/</link>
		<comments>http://thepizzy.net/blog/2006/05/were-number-1/#comments</comments>
		<pubDate>Wed, 17 May 2006 00:17:30 +0000</pubDate>
		<dc:creator>[[Neo]]</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[the-spot.net]]></category>
		<category><![CDATA[categories hierarchy]]></category>
		<category><![CDATA[category hierarchy]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[forums]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[profilecp]]></category>
		<category><![CDATA[query sql]]></category>
		<category><![CDATA[Registration]]></category>
		<category><![CDATA[registration ip]]></category>
		<category><![CDATA[stripslashes]]></category>
		<category><![CDATA[tsnX]]></category>

		<guid isPermaLink="false">http://thepizzy.net/blog/?p=56</guid>
		<description><![CDATA[Ok, so while coding the tsnX forums for the-spot.net, there were several instances in which the mods didn&#8217;t work because everyone&#8217;s mods assume (usually) that they are going to be...]]></description>
			<content:encoded><![CDATA[<p>Ok, so while coding the tsnX forums for the-spot.net, there were several instances in which the mods didn&#8217;t work because everyone&#8217;s mods assume (usually) that they are going to be the only mod installed in the forums. And while this is the ideology that saves time when writing a modification, it is not a &#8220;best practice&#8221; in programming. So to help with some of that frustration as to why your mod won&#8217;t work, I&#8217;m going to do my best to post some of the code changes that will need to be made in order to make some of these things interact with each other. <span id="more-56"></span></p>
<p>So far, on tsnX.3 I&#8217;ve installed phpBB 2.0.20, Category Hierarchy 2.1.4c, and Profile Control Panel 200-1, and Registration IP 1.0.0. At least, those are the ones that I had to write my own code to get the mods to work.</p>
<p>So after you install phpbb 2.0.20, then you install CH 2.1.4c. Once you&#8217;ve done that, install Profile CP, and in the root/profilecp/profilecp_register.php you&#8217;ll need to make these modifications:</p>
<p>First, we<br />
Find:</p>
<blockquote><pre>		if ( !$row = $db->sql_fetchrow($result) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
		}
		$userrow['user_id'] = $row['total'] + 1;</pre>
</blockquote>
<p>Add After:</p>
<blockquote><pre>//-- mod : categories hierarchy ------------------------------------------------
//-- add
			// update last user
			$config->set('stat_last_user', $user_id);
			$config->set('stat_last_username', stripslashes($username));
			$sql = 'SELECT COUNT(user_id) AS total_users
						FROM ' . USERS_TABLE . '
						WHERE user_id <> ' . ANONYMOUS;
			$result = $db->sql_query($sql, false, __LINE__, __FILE__);
			$row = $db->sql_fetchrow($result);
			$config->set('stat_total_users', intval($row['total_users']) + 1);
//-- fin mod : categories hierarchy --------------------------------------------</pre>
</blockquote>
<p>Find:</p>
<blockquote><pre>		$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
				VALUES ($user_id, $group_id, 0)";
		if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
		{
			message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
		}</pre>
</blockquote>
<p>Add After:</p>
<blockquote><pre>//-- mod : categories hierarchy ------------------------------------------------
//-- add
			// cache groups list and set the user_id on the single group_id
			$view_user = new user();
			$view_user->read($user_id);
			$view_user->get_groups_list(true);
//-- fin mod : categories hierarchy --------------------------------------------</pre>
</blockquote>
<p>Find:</p>
<blockquote<pre>
			if ( $username_changed )
			{
				$sql = &#8220;UPDATE &#8221; . GROUPS_TABLE . &#8221;
						SET group_name = &#8216;&#8221; . str_replace(&#8220;\&#8217;&#8221;, &#8220;&#8221;&#8221;, $username) . &#8220;&#8216;
						WHERE group_name = &#8216;&#8221; . str_replace(&#8220;\&#8217;&#8221;, &#8220;&#8221;&#8221;, $view_userdata['username'] ) . &#8220;&#8216;&#8221;;
				if ( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, &#8216;Could not rename users group&#8217;, &#8221;, __LINE__, __FILE__, $sql);
				}
			}</pre>
</blockquote>
<p>After Add:</p>
<blockquote><pre>//-- mod : categories hierarchy ------------------------------------------------
//-- add
			// if name changed, update some data
			if ( !empty($username_sql) )
			{
				$fields = array(
					'forum_last_username' => stripslashes($username),
				);
				$db->sql_statement($fields);

				// update forums last poster
				$sql = 'UPDATE ' . FORUMS_TABLE . '
							SET ' . $db->sql_update . '
							WHERE forum_last_poster = ' . intval($user_id);
				$db->sql_query($sql, false, __LINE__, __FILE__);

				// update last user
				if ( ($user_id == $config->data['stat_last_user']) || empty($config->data['stat_last_username']) )
				{
					$config->set('stat_last_user', $user_id);
					$config->set('stat_last_username', stripslashes($username));
				}

				// recache moderators
				include_once($config->url('includes/class_forums'));
				$moderators = new moderators();
				$moderators->set_users_status();
				$moderators->read(true);
			}
//-- fin mod : categories hierarchy --------------------------------------------</pre>
</blockquote>
<p>Those changes take care of the caching that the Category Hierarchy does when creating a new user, and/or updating the username/group information if/when the user changes their name.</p>
<p>Then I installed the Registration IP mod, that grabs the session IP while registering and puts it into the user's profile. What you should do is install the mod like normal, and then go back to this page (root/profilecp/profilecp_register.php) and do this:</p>
<p>Find:</p>
<blockquote><pre>	if ( $active_changed )	 $values['user_actkey'] = $user_actkey;</pre</blockquote>

After Add:
<blockquote><pre>	if ( $create_user )		 $values['user_regip'] = $userdata['session_ip'];</pre>
</blockquote>
<p>That will put the ip into the database in the next couple lines where the SQL statement grabs the $values for insterting into the user_table.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/categories+hierarchy' rel='tag' target='_blank'>categories hierarchy</a>, <a class='technorati-link' href='http://technorati.com/tag/category+hierarchy' rel='tag' target='_blank'>category hierarchy</a>, <a class='technorati-link' href='http://technorati.com/tag/forum' rel='tag' target='_blank'>forum</a>, <a class='technorati-link' href='http://technorati.com/tag/forums' rel='tag' target='_blank'>forums</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_blank'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/phpbb' rel='tag' target='_blank'>phpbb</a>, <a class='technorati-link' href='http://technorati.com/tag/profilecp' rel='tag' target='_blank'>profilecp</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_blank'>Programming</a>, <a class='technorati-link' href='http://technorati.com/tag/query+sql' rel='tag' target='_blank'>query sql</a>, <a class='technorati-link' href='http://technorati.com/tag/Registration' rel='tag' target='_blank'>Registration</a>, <a class='technorati-link' href='http://technorati.com/tag/registration+ip' rel='tag' target='_blank'>registration ip</a>, <a class='technorati-link' href='http://technorati.com/tag/stripslashes' rel='tag' target='_blank'>stripslashes</a>, <a class='technorati-link' href='http://technorati.com/tag/tsnX' rel='tag' target='_blank'>tsnX</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://thepizzy.net/blog/2006/05/were-number-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

