navjotjsingh

Topic: Jobberbase 1.8 Development

If you think next version's development of Jobberbase is slowing down then you are not right. With the coming of Chronos, Redjumpsuit and evertsemeijn in Development Team of Jobberbase, next version does promise some new features.

I have prepared a roadmap to version 1.8 of Jobberbase.

Jobberbase Roadmap

You can always check here for list of features in upcoming versions of Jobberbase.

Want to Test Out?

Sure you can test this version. Just visit http://code.google.com/p/jobberbase/source/checkout and use any SVN Client (TortoiseSVN if using Windows) and XAMPP(Windows, Linux and MAC) to test Jobberbase on your PC.

This also helps us as you can help as quash bugs faster. If you find any bug in v1.7 or SVN version, you can report it via forums. We will keep track of them and make changes as when neccessary.

Note: - It is not advisable to use SVN version on a Live Job Board - it may have some bugs which you may not want in your final job board.

Help us in making a better JobBoard.
-Jobberbase Dev Team-

PopaWoody

Re: Jobberbase 1.8 Development

Hello Jobberbase Team!!! I would like to contribute to the development of jobberbase. Having achieved a great start from this platform. Our development is focused on expanding on the core features of jobberbase.

I have taken a look at the SVN trunk files. Looks like some good things are happening. If our work is accepted some work would be necessary to implement the additions we have made to jobberbase. We have been using 1.6 since January. Search pagination is important and the changes we have made to our branch is not compatible with current SVN files.

The modules that we have developed that we would contribute to the project would include a job seeker/employer user class. This allows for a job seeker or employer to create an account. Job Seeker alerts for categories and location to monitor for job alerts. The employer feature is not complete at this time. but we have built in functionality for user_type logic. One of the important features to have for employers is to be able to accept their XML/JSON Feeds and this is in our RoadMap as well.

I would also contribute our twitter function class that is used as a job alert feature. This module also monitors whether a user is following your twitter account so that if a user stops following your sites twitter account, the user account is turned off in the data base and further notices are stopped.

We have done some extensive work on the cron_maintenance by setting cron up with an environment. We have also built in development, QA, and production envrionments with debugging information passed in the footer of QA and dev enviroment variables.

In addition we are implementing another monetization feature that allows job board owners to pull content from indeed or simplyhired, careerjet or other API providers. This module is not complete yet. When it is finished we would include that as well to the open source community of jobberbase.

We have developed another feature that is pretty slick to see it in action navigate to http://test.jobshouts.com/candidate-search/

This feature allows employers to search for talent using functions we developed to Search Google's AJAX Search API. We return a mash up of results from 7 different networks. At this time we will not be releasing this code to the OS community.

Lastly if you check our test environment, click on the user login green button. We are almost finished implementing http://RPXnow.com SSO user application. This allow's visitors to login and create a user account by using credentials from other social networks or email providers. Since this was not to difficult to implement I would share this as well.

I planned on emailing filip directly but I figured if I posted this on jobberbase all of the team could take part in the discussion.

So what is the next step JB? Anyone interested in our work? smile

jobshouts.com A Jobberbased Derivative wink

Chronos

Re: Jobberbase 1.8 Development

Sounds good! All these modifications sound like they would find a good place at the core JB.
Most importantly, I think many users are waiting for more functionality to monetize their JB installations (like jobseeker / employer accounts). I was planning on creating this for the 2.0 release, but if we could adjust an existing (and tested!) piece of code that would surely save a lot of time.

I'm open for converting some features to JB, but you (or your programmer if that's another person) could probably get SVN access as well.

For me the most interesting features to adopt are:

- Accounts for both Employers (for what's finished) and Job Seekers
- Import of other websites such as Indeed (when finished)
- cron_maintenance.php The current version is incompitable with the unix cronjob (at least some).

Member of Jobberbase Development Team - Implementation and Coding

Visit my Blog: ChronoScripts (JobberBase scripts, support and freelance)
JobBoards: Telefonisch Werk and Top Bijbaan

evertsemeijn

Re: Jobberbase 1.8 Development

I have worked with PopaWoody in the past and I would advice to include most of their mod's. The codes that I have seen looked solid and worked smoothly.

Member of Jobberbase Development Team - Templates/Usability

:: Looking for a jobboard installation and/or custom design? ::

navjotjsingh

Re: Jobberbase 1.8 Development

I would love to see their suggestions and improvements in Jobberbase Core but its upto Filip to accept them as part of Developer and give them SVN access.

Would love to see your contribution in upcoming Jobberbase release.

PopaWoody

Re: Jobberbase 1.8 Development

Thanks Evert smile

I would be happy to further the development of Jobberbase, in true open source fashion. I just finished setting up the current SVN jobberbase in a local environment. I noticed some interesting improvements. A table for site settings and such, good idea!

As I mentioned previously some work would be necessary to merge the different branches of code. Our config.php handles the environment a lot differently. We use a local, QA, and prod environment.

One of the first things I should probably contribute, and since Chronos asked, is the cron features we have implemented. This should be simple to roll into the current branch.

First we have cron_config.php to set up the server environment. We do this because when running php from the command line, which is how cron executes your script, there is no browser setting all the system variables. This is the reason your cron jobs in their original release did not work too well.

Code:
<?php
/*
 * set up an environment for cron jobs so they can run more like they're being served from a server.
 * do things different for dev / production environments
 *
 * @param environment - takes on parameter on the command line, a string.  prod or dev.  defaults to prod!
 */

if(!isset($argv[1]))
    define('CRON_ENV', 'prod');
else
    define('CRON_ENV', $argv[1]);

/*set web-server dependencies on location necessary to automate the cron job*/
/*Our team uses vhosts like jobshouts.local since we have more than one site running on our dev hardware you can easily substitute this for localhost.
switch(CRON_ENV){
    case 'dev':
        $_SERVER['SERVER_NAME']='mysite.local'; /* OR  'localhost' */
        break;
    case 'qa':
        $_SERVER['SERVER_NAME'] = 'subdomain.mysite.com';
                break;
        case 'prod':
    default:
        $_SERVER['SERVER_NAME']='mysite.com';
}

$_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'];
$_SERVER['REQUEST_URI'] = '';
$_SERVER['SERVER_PORT'] = 80;
$_SERVER['SCRIPT_NAME'] = '/'. basename($argv[0]); 

Next we have the actual script we call from the cron tab in your cpanel, plesk etc. file: cron_maintenance.php

Code:


<?php
/**
 * JobShouts Job Board and Search Engine
 *             
 */

require_once 'cron_config.php'; //sets up environment 

require_once 'config.php';
require_once '_includes/class.Maintenance.php';
require_once '_includes/class.Postman.php';

    $janitor = new Maintenance();
    
    // delete temporary posts older than 2 days
    $janitor->DeleteTemporaryJobs();
    // deactivate jobs older than 30 days + delete jobs older than 60 days.
        $janitor->DeactivateJobs();
    // delete jobs older than 60 days.
        $janitor->DeleteOldJobs();
    // delete applications after 30 days. prevents them showing up on            home page in popular jobs after job expiration.
    $janitor->DeleteOldApps();
?>

Finally we execute all cron function inside the class.Maintenance.php. There are some settings here for emailing job posters to let them know the ad is expiring. The constant declarations can be adjusted to suit ones need and could easily be a part of the site settings table.

Code:


<?php
/**
 * JobShouts Job Board and Search Engine
 *
 *             
 * 
 * Maintenance class handles site/database maintenance operations
 */

class Maintenance
{
    
    function __construct()
    { }
    
    // delete temporary posts older than 2 days
    public function DeleteTemporaryJobs()
    {
        global $db;
        $sql = 'DELETE FROM jobs WHERE DATEDIFF(NOW(), created_on) > 1 AND is_temp = 1 AND is_active = 0';
        $db->Execute($sql);
    }
    
    

    public function DeactivateJobs()
          {      

          $postMan = new Postman();

          global $db;

          $notifmin = 28; //the day when you want notification to be sent prior to the ad expiring
          $notifmax = 30; //the day the ad actually expires
          $dayscount = $notifmax - $notifmin;

          $sql = 'SELECT * FROM jobs WHERE DATEDIFF(NOW(), created_on) = '. $notifmin. ' AND is_active = 1';
          $row = $db->QueryArray($sql);
          #print_r($row); // this will print the array of the ad that was deactivated
          foreach ( $row as $rows )
              {
              $ademail = trim(strtolower($rows['poster_email']));
              $adname = trim($rows['title']);
              $adcomp = trim($rows['company']);
              $adurl = BASE_URL . "job/" . $rows['id'] . "/";
              //$postMan->MailExpiringAd($ademail, $adname, $adcomp, $adurl, $dayscount);
          }
          /**
           * that finishes up notify the expiring ones.  Now, lets delete the old ones
           */
          
          $sql = 'update jobs set is_active = 0 WHERE DATEDIFF(NOW(), created_on) >= ' . $notifmax . ' AND is_active = 1';
          $db->query($sql);
          
      }

    public function DeleteOldJobs()
    {
        global $db;
        $sql = 'DELETE FROM jobs WHERE DATEDIFF(NOW(), created_on) > 60';
        $db->Execute($sql);
    }
    public function DeleteOldApps()
    {
        global $db;
        $sql = 'DELETE FROM jobs_applications WHERE DATEDIFF(NOW(), created_on) > 30';
        $db->Execute($sql);
    }

}
?>

That's about it I believe. From the cron_config.php you can see how we use a case switch statement to set up the environment. We also have taken this approach in config.php as well. Setting up different databases for development. Using a QA subdomain on the actual production server allows us to make sure the code will run the same in production as in the local dev environment before commiting our changes to our production server.

jobshouts.com A Jobberbased Derivative wink

hobo

Re: Jobberbase 1.8 Development

Hi PopaWoody
In class.maintenance.php

Line:

Code:
$sql = 'SELECT * FROM jobs WHERE DATEDIFF(NOW(), created_on) = '. $notifmin. ' AND is_active = 1';

What I currently have there is:

Code:
$sql = 'SELECT * FROM jobs WHERE DATEDIFF(NOW(), created_on) >= '. $notifmin .' AND is_active = 1';

I got my code here.

PopaWoody

Re: Jobberbase 1.8 Development

Either way, almost the exact same thing, since I run cron everyday it will work with either = OR >= . if you do not run your cron job everyday you might want to have the > sign as well. The whitespace is ignored in php so the statements are nearly identical with the only difference being the > sign. smile

jobshouts.com A Jobberbased Derivative wink

filipcte

Re: Jobberbase 1.8 Development

Hi @PopaWoody,

Thanks for getting involved in trying to make this platform better!

We would be very happy to include the modules you built and would like to discuss details smile. I've just sent you an invitation to our mailing list.

Original jobberBase author
www.filipcte.com

hobo

Re: Jobberbase 1.8 Development

For above code, the only thing i had to change to get it all working is the new cron_config.php
just remove the stuff not used and now file looks like this:

Code:
<?php
/*
 * set up an environment for cron jobs so they can run more like they're being served from a server.
 * do things different for dev / production environments
 *
 * @param environment - takes on parameter on the command line, a string.  prod or dev.  defaults to prod!
 */

if(!isset($argv[1]))
    define('CRON_ENV', 'prod');
else
    define('CRON_ENV', $argv[1]);

/*set web-server dependencies on location necessary to automate the cron job*/
/*Our team uses vhosts like jobshouts.local since we have more than one site running on our dev hardware you can easily substitute this for localhost. */
switch(CRON_ENV){
        case 'prod':
    default:
        $_SERVER['SERVER_NAME']='example.com/myjobberbaseappfolder/'; 
}

$_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'];
$_SERVER['REQUEST_URI'] = '';
$_SERVER['SERVER_PORT'] = 80;
$_SERVER['SCRIPT_NAME'] = '/'. basename($argv[0]);

If you installed in root folder than the line

$_SERVER['SERVER_NAME']='example.com/myjobberbaseappfolder/';

should look more like:

$_SERVER['SERVER_NAME']='example.com/';

Thanks for the codes!