Dynamic URL structure
This modification allows you to change the basic URL-structure of JobberBase. This can be useful when setting up jobberbase for something other than a jobboard, but also for localized non-english jobsites (useful for SEO). The variables can easily be adjusted within the config.php, after which all links are updated.
I've written a script that should automatically do 90% of the work (replacing the static appearences to the dynamic variables). I haven't tested it on other server setups yet, so make sure to back up all your files before running it. The scripts will go through all the .php and .tpl files and does several find/replaces.
Modification Features:
- Ability to dynamically change the following URL's using config.php:
- '/job' (Job-details page)
- '/jobs' (Category overview)
- '/jobs-at' (Company overview)
- '/jobs-in' (City overview)
- '/companies' (Company tag-cloud)
- '/cities' (Cities tag-cloud)
- Build-in support for my 'Cities Tag-Cloud' modification (will work without as well)
- Including an installation-script that automatically find/replaces all static URL's
- The installation script can be run anytime to update any new code
Screenshot: Automated URL-Update Script
1. Open "config.php":
Find:
define('FILE_UPLOAD_DIR', 'uploads/'); define('JOBS_PER_PAGE', 50);
Add below:
//URL definitions (do not use spaces or invalid url-characters) define ('URL_JOB', 'job'); //Job Details. -- Example: "http://jobberbase.com/job/4/web-developer-3-at-foo-inc". define ('URL_JOBS', 'jobs'); //Specific Category . -- Example: "http://jobberbase.com/jobs/administrators/". define ('URL_CITIES', 'cities'); //All Locations. -- Example: "http://jobberbase.com/cities". define ('URL_COMPANIES', 'companies'); //All Companies. -- Example: "http://jobberbase.com/companies". define ('URL_JOBS_IN_CITY', 'jobs-in'); //Specific Location. -- Example: "http://jobberbase.com/jobs-in/london-uk". define ('URL_JOBS_AT_COMPANY', 'jobs-at'); //Specific Company. -- Example: "http://jobberbase.com/jobs-at/foo-inc".
2. Open "index.php":
Find / Replace:
case 'job':
case URL_JOB:
Find / Replace:
case 'jobs':
case URL_JOBS:
Find / Replace:
case 'jobs-at':
case URL_JOBS_AT_COMPANY:
Find / Replace:
case 'jobs-in':
case URL_JOBS_IN_CITY:
Find / Replace:
case 'companies':
case URL_COMPANIES:
Find / Replace: (if city tag-cloud mod is installed)
case 'cities':
case URL_CITIES:
Find:
$smarty->assign('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
Add below:
//Add the dynamic URL defitions to SMARTY $smarty->assign('URL_JOB', URL_JOB); $smarty->assign('URL_JOBS', URL_JOBS); $smarty->assign('URL_CITIES', URL_CITIES); $smarty->assign('URL_COMPANIES', URL_COMPANIES); $smarty->assign('URL_JOBS_IN_CITY', URL_JOBS_IN_CITY); $smarty->assign('URL_JOBS_AT_COMPANY', URL_JOBS_AT_COMPANY);
3. Open "/admin/index.php":
Find / Replace:
case 'job':
case URL_JOB:
Find / Replace:
case 'jobs':
case URL_JOBS:
Find:
// get job categories and cities $smarty->assign('categories', get_categories());
Add below:
//Add the dynamic URL defitions to SMARTY $smarty->assign('URL_JOB', URL_JOB); $smarty->assign('URL_JOBS', URL_JOBS); $smarty->assign('URL_CITIES', URL_CITIES); $smarty->assign('URL_COMPANIES', URL_COMPANIES); $smarty->assign('URL_JOBS_IN_CITY', URL_JOBS_IN_CITY); $smarty->assign('URL_JOBS_AT_COMPANY', URL_JOBS_AT_COMPANY);
4. Extract the contents of the .zip:
The following file should be uploaded from this zip file. After running the installation script, all your PHP and TPL files will be updated with the dynamic variables. Make sure to back up your files before running the php file.
- /dynamic_url_installer.php






July 2nd, 2009 - 13:09
Brilliant!
I’ve been able to do it in 3 minutes.
Thanks.
July 8th, 2009 - 16:03
We have a jobberBase based running website joburiIT.ro and we would be interested in some add-ons:
1. companies to be able to upload logos;
2. companies to be able to hide there identity on ads (but at the same time companies counter to be able to count them);
3. logos to be displayed randomly on right-hand sidebar for a specific period (same way as for spotlight jobs);
4. spotlight jobs specific to each category to be displayed within each category page.
Please email us your quote asap.
July 8th, 2009 - 16:03
btw… your contact form is not working… recipient(s) could not be reached
July 19th, 2009 - 18:20
Great, thank you very much!
It takes just a few minutes to install your script.
July 20th, 2009 - 01:29
Nice one Chronos! It’s a nice tune up for SEO. Thanks
July 29th, 2009 - 23:59
Hey Chronos apparentely there’s a small bug on my test site.
Everything works but the small block of links beneath the Apply now link/button is now gone. I would like to keep this. There some usefull links on that block of code. What am I doing wrong in the implementation? Or is this normal ?
Thanks in advance
July 30th, 2009 - 15:48
I found the cause of your bug and updated the automatic install script. To manually fix this, go to “_templates/job.tpl” and replace “$CURRENT_PAGE == ‘job’” with “$CURRENT_PAGE == $URL_JOB”.