<?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>Chris Wallace &#187; Jobberbase</title>
	<atom:link href="http://www.chris-wallace.com/tag/jobberbase/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chris-wallace.com</link>
	<description>User experience designer and infamous WordPress developer.</description>
	<lastBuildDate>Sat, 21 Jan 2012 15:50:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Automatically Post Job Listings to Twitter from Jobberbase</title>
		<link>http://www.chris-wallace.com/2008/12/01/automatically-post-job-listings-to-twitter-from-jobberbase/</link>
		<comments>http://www.chris-wallace.com/2008/12/01/automatically-post-job-listings-to-twitter-from-jobberbase/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 23:47:31 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Tips & Tutorials]]></category>
		<category><![CDATA[Jobberbase]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.chris-wallace.com/?p=272</guid>
		<description><![CDATA[Want to post new jobs to popular micro-blogging service Twitter? Of course you do. Follow the tutorial below to make your Jobberbase site almost as cool as AllDevJobs.com. To avoid conflicting with newer versions of Jobberbase, I am writing this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alldevjobs.com"><img class="alignnone size-full wp-image-460" title="AllDevJobs.com" src="http://cdn.chris-wallace.com/wp-content/uploads/alldev.gif" alt="AllDevJobs.com" width="580" height="160" /></a></p>
<p>Want to post new jobs to popular micro-blogging service Twitter? Of course you do. Follow the tutorial below to make your Jobberbase site almost as cool as <a title="All Development Jobs" href="http://www.alldevjobs.com">AllDevJobs.com</a>.<span id="more-272"></span></p>
<p><a href="http://cdn.chris-wallace.com/wp-content/uploads/featured-twitter.jpg"><img class="alignnone size-full wp-image-278" title="Automaticall Post Jobs to Twitter" src="http://cdn.chris-wallace.com/wp-content/uploads/featured-twitter.jpg" alt="" width="500" height="191" /></a><br />
<!--more--><br />
To avoid conflicting with newer versions of Jobberbase, I am writing this tutorial for any version so it should always work. As always, make sure you back up your site before you proceed with the following changes.</p>
<h2>Step 1: Create a Twitter Account</h2>
<p>This may seem obvious, but yes, you need to create a new account. <a href="http://twitter.com/signup">Create Account »</a></p>
<h2>Step 2: Modify config.php</h2>
<p>In the root directory of your Jobberbase installation, you have a &#8216;config.php&#8217; file. In that file you will want to add your Twitter account information. I added mine at line 41. The bolded text indicates the places you need to add your account info.</p>
<pre><code>/* Twitter username &amp; password */
define('TWITTER_ENABLED',1);
define('TWITTER_USERNAME','<strong>username_goes_here</strong>');
define('TWITTER_PASSWORD','<strong>password_goes_here</strong>');
</code></pre>
<p>After that&#8217;s done, you also need to add a reference to the Twitter function you&#8217;ll be creating in Step 4. Around line 87, you should see the following:</p>
<pre><code>// Function and classes includes
require_once '_includes/function.validate_email.php';
require_once '_includes/function.redirect_to.php';
require_once '_includes/function.printr.php';
require_once '_includes/function.escape.php';
require_once '_includes/functions.php';
require_once '_includes/class.phpmailer.php';
require_once '_includes/class.Postman.php';
...</code></pre>
<p>You need to add <code>require_once '_includes/function.Twitter.php';</code> to this list. I added it just after <code>require_once '_includes/functions.php';</code>.</p>
<p>When done, it should look like this:</p>
<pre><code>// Function and classes includes
require_once '_includes/function.validate_email.php';
require_once '_includes/function.redirect_to.php';
require_once '_includes/function.printr.php';
require_once '_includes/function.escape.php';
<strong>require_once '_includes/function.Twitter.php';</strong>
require_once '_includes/functions.php';
require_once '_includes/class.phpmailer.php';
require_once '_includes/class.Postman.php';
require_once '_includes/class.Textile.php';
require_once '_includes/class.Sanitizer.php';
require_once '_includes/class.Db.php';
require_once '_includes/class.Job.php';
require_once '_includes/class.JobRequest.php';
require_once '_includes/class.Paginator.php';
require_once '_includes/class.Feed.php';
require_once '_includes/class.SpamReport.php';
require_once '_includes/class.Api.php';
require_once '_includes/class.JobApplication.php';
require_once '_includes/class.SearchKeywords.php';
require_once '_includes/smarty/libs/Smarty.class.php';</code></pre>
<h2>Step 3: Edit file &#8216;_includes/class.Job.php&#8217;</h2>
<p>You will shortly be creating a new Twitter function that will post the job listings for you, however, you need to find the right place to call that function, which would be immediately after the job listing is activated, not necessarily when it&#8217;s been posted, because you don&#8217;t want people just posting anything to Twitter before you&#8217;ve reviewed it.</p>
<p>Around line 873, you&#8217;ll need to replace the entire <code>public function Publish()</code> with the following code:</p>
<pre><code>
	// Publishes a newly created job post (is_temp =&gt; 0)
	public function Publish()
	{
		global $db;
		if ($this-&gt;CheckPosterEmail())
		{
			$sql = 'UPDATE jobs SET is_temp = 0, is_active = 1 WHERE id = ' . $this-&gt;mId;
			$db-&gt;query($sql);

			$sql = 'SELECT type_id, id, title, company FROM jobs WHERE id = ' . $this-&gt;mId;
			$result = $db-&gt;query($sql);
			$row = $result-&gt;fetch_assoc();

		  $formattedMessage = $row['title'] . " at " .$row['company'] . " " . BASE_URL . "job/" .$row['id'] . "/";
		  Tweet($formattedMessage);

		}
		else
		{
			$sql = 'UPDATE jobs SET is_temp = 0, is_active = 0 WHERE id = ' . $this-&gt;mId;
			$db-&gt;query($sql);
		}

	}</code></pre>
<h2>Step 4: Create file &#8216;_includes/function.Twitter.php&#8217;</h2>
<p>In your main includes directory, you need to create a new file for the script to post Twitter messages. You will need to have cURL enabled on your server for this to work.</p>
<p>Inside the new file, add this:</p>
<pre><code>&lt;?php
/**
 * Twitter post API
 */

function Tweet($msg){
	if(TWITTER_ENABLED==1){

		$username = TWITTER_USERNAME;
		$password = TWITTER_PASSWORD; 

		$message = $msg;

		$url = 'http://twitter.com/statuses/update.xml';
		// Alternative JSON version
		// $url = 'http://twitter.com/statuses/update.json';

		$curl_handle = curl_init();
		curl_setopt($curl_handle, CURLOPT_URL, "$url");
		curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
		curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl_handle, CURLOPT_POST, 1);
		curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
		curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
		$buffer = curl_exec($curl_handle);
		curl_close($curl_handle);
		// check for success or failure
		if (empty($buffer)) {
				echo 'Post failed. Please add listing manually.';
		} else {
				echo 'Success';
		}
	}
}

?&gt;</code></pre>
<p>That&#8217;s it. Upload your files and you&#8217;re ready to post to Twitter. Please let me know if you have any difficulties with this tutorial and I will update it accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chris-wallace.com/2008/12/01/automatically-post-job-listings-to-twitter-from-jobberbase/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Build your own Job Board with Jobberbase</title>
		<link>http://www.chris-wallace.com/2008/11/11/build-your-own-job-board-with-jobberbase/</link>
		<comments>http://www.chris-wallace.com/2008/11/11/build-your-own-job-board-with-jobberbase/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 15:08:49 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Tips & Tutorials]]></category>
		<category><![CDATA[job board]]></category>
		<category><![CDATA[Jobberbase]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://www.chris-wallace.com/?p=112</guid>
		<description><![CDATA[I recently released a developer job board built with Jobberbase, an open-source job board software written in PHP/MySQL. While I can&#8217;t recommend it for a large job networking site, it is a great piece of software for adding a simple [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cdn.chris-wallace.com/wp-content/uploads/alldevjobs1.jpg"><img class="alignnone size-full wp-image-184" title="AllDevJobs.com - Job Board Software" src="http://cdn.chris-wallace.com/wp-content/uploads/alldevjobs1.jpg" alt="" width="500" height="196" /></a></p>
<p>I recently released a developer job board built with <a title="Jobberbase" href="http://www.jobberbase.com">Jobberbase</a>, an open-source job board software written in PHP/MySQL. While I can&#8217;t recommend it for a large job networking site, it is a great piece of software for adding a simple job board to your existing website. I thought I would give a quick rundown on its features, installation process, and some customization tips to get you started.</p>
<h2>Features</h2>
<p>Below, I&#8217;ve listed some of the features of Jobberbase:</p>
<ul>
<li>Post jobs without an account.</li>
<li>Search for jobs (ajax).</li>
<li>Apply for jobs.</li>
<li>Administer jobs via admin panel (edit/delete/activate/deactivate).</li>
<li>RSS feeds.</li>
<li>Job widget.</li>
</ul>
<p><span id="more-112"></span></p>
<h2>Installation</h2>
<p>These are the installation instructions from the Jobberbase readme.txt file:</p>
<ol>
<li>Make sure you have PHP 5+ and MySQL 4.1+ installed. Also, Apache module mod_rewrite should be enabled.</li>
<li>Create a new database and import __db/jobberbase.sql into it.</li>
<li>Open config.php and update the following constants so they suit your environment:<br />
- DB_HOST, DB_USER, DB_PASS, DB_NAME, NOTIFY_EMAIL, ADMIN_EMAIL, SITE_NAME</li>
<li>Following directories need write access:<br />
/uploads            (uploaded resumes are temporary stored here)<br />
/_templates/_cache  (smarty cache)</li>
<li>If your host doesn&#8217;t offer the mysqli PHP extension (find out from phpinfo()),<br />
you can use a mysql wrapper instead.Open config.php and just replace &lt;require_once &#8216;_includes/class.Db.php&#8217;&gt; with<br />
&lt;require_once &#8216;_includes/class.Db.MySql.php&#8217;&gt;.</li>
<li>That&#8217;s it, open a browser and type in the URL (e.g. http://localhost/jobberbase/).</li>
<li>The admin panel is available at http://localhost/admin/ with the default username &#8220;admin&#8221; and password &#8220;admin&#8221;.</li>
</ol>
<h2>Customizing It</h2>
<p>After following the installation directions on the Jobberbase website, you should customize your new job site. A lot of Jobberbase sites end up looking exactly the same as the original, simply because they change the logo and nothing else. You don&#8217;t want to do that.</p>
<h2>Jobberbase uses Smarty Templates</h2>
<p>If you are not familiar with Smarty, you can read up on it <a href="http://www.smarty.net">here</a>. Smarty templates are great because they separate the presentation layer from the application layer, which is always a good thing. However, you still have the ability to run your own code within the Smarty templates, which can sometimes be necessary as well. Smarty.net explains the reasoning well here:</p>
<blockquote><p>One of Smartys primary design goals is to facilitate the separation of  application code from presentation. Typically, the application code contains the business logic of your application, written and maintained in PHP code. This code is maintained by programmers. The presentation is the way your content is presented to the end user, which is written and maintained in template files. The templates are maintained by template designers.</p></blockquote>
<p>After you&#8217;ve installed Jobberbase, you should have the following folder structure (minus the &#8216;phpmyadmin&#8217; folder):</p>
<p><a href="http://cdn.chris-wallace.com/wp-content/uploads/folders.jpg"><img title="Jobberbase Folder Structure" src="http://cdn.chris-wallace.com/wp-content/uploads/folders.jpg" alt="" width="102" height="186" /></a></p>
<p>You are going to want to dive into the &#8216;css&#8217; and &#8216;_templates&#8217; folder to modify your site design. No need to touch anything else for now. The &#8216;css&#8217; folder is pretty self-explanatory. Edit the CSS there. The &#8216;_templates&#8217; folder has a lot more to look at:</p>
<p><a href="http://cdn.chris-wallace.com/wp-content/uploads/_templates.jpg"><img class="alignnone size-full wp-image-165" title="Templates Folder" src="http://cdn.chris-wallace.com/wp-content/uploads/_templates.jpg" alt="" width="342" height="243" /></a></p>
<p>These are your Smarty templates. As you can see, they are labeled quite well and you should be able to make the changes you need by editing these files. However, there are some things you should know about Smarty templates. For example, they don&#8217;t allow you to run any JavaScript unless you wrap the code in {literal} tags:</p>
<pre><code>
<strong>{literal}</strong>
  &lt;script type="text/javascript"&gt;
  var smarty = "This code can now be run.";
  alert(smarty);
  &lt;/script&gt;
<strong>{/literal}</strong></code></pre>
<p>When I first started using Smarty, not knowing the rules of the templates was enough to make me slam my face into my desk. But once you know it, it&#8217;s no problem. You can read more about Smarty <a href="http://smarty.net/manual/en/">here</a>.</p>
<p>The main templates you may want to modify are of course the &#8216;header.tpl&#8217; and &#8216;footer.tpl&#8217; files but also take a look at the &#8216;sidebar.tpl&#8217; file as well. This is a great place to add some customizations. I added a link to a twitter account that is set up to automatically post jobs every time one is approved.</p>
<p>Questions? Comments? Let me know in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chris-wallace.com/2008/11/11/build-your-own-job-board-with-jobberbase/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/15 queries in 0.005 seconds using disk: basic
Object Caching 381/407 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: cdn.chris-wallace.com

Served from: www.chris-wallace.com @ 2012-02-09 11:48:17 -->
