Re: add the new places i nselect menu [ Started by matteoraggi in Feature requests : 1 replies ]

read here: http://www.jobberbase.com/forum/topic967-update-the-list-of-available-cities.html

Topic: Update the list of available cities [ Started by punctweb in Feature requests : 11 replies ]

Because the list of available cities is fixed (as in static) by default, let's do a trick: let's update that list based on what users provide in the new job form.

First we will make sure that there will be no duplicate cities. In phpMyAdmin (for example), run this, in the 'cities' table:

[code]
ALTER TABLE `cities` ADD UNIQUE (`ascii_name`)
[/code]

Now we will have a list with distinct cities.

Next, we will modify some files.

First, open /_includes/class.Sanitizer.php and add this new method:

[code]
public function cleanData($input) {
$input = strip_tags($input);
$input = htmlspecialchars($input);

return $input;
}
[/code]

Now, open /_includes/class.Job.php and modify like this:

- before 'class Job' add

[code]
require_once 'class.Sanitizer.php';
[/code]

- modify the '__construct' method by adding this:

[code]
$this->db = $db;
$this->sanitizer = new Sanitizer();
[/code]

- modify method 'Activate' by adding, before the '}', this:

[cod …

Topic: increase the number of internal links [ Started by punctweb in Feature requests : 1 replies ]

Because mister G (as in Google) loves internal linking in a website, let's give him what he wants :)

In the details page of a job, we will add two more links: "all jobs of the current company" and "all jobs in the same location"

Go go go !

Open /_templates/job.tpl and add this where you want the links to appear:

[code]
<a href="{$BASE_URL}jobs-at/{$job.company_alias}/" title="{$translations.jobs.all_from_company}">{$translations.jobs.all_from_company} {$job.company}</a> |
<a href="{$BASE_URL}jobs-in/{$job.location_alias}/" title="{$translations.jobs.all_from_location}">{$translations.jobs.all_from_location} {$job.location}</a>
[/code]

Open /page_job.php and add these (starting from line 101):

[code]
if($info['company'] != '') {
$sanitizer = new Sanitizer();

$info['company_alias'] = $sanitizer->sanitize_title_with_dashes($info['company']);
}

if($info['location'] != '') {
$sanitizer = new Sanitizer(); …

Topic: function.redirect_to.php [ Started by punctweb in Bug reports : 3 replies ]

Hey all,

[This is not a bug]

Here is my modification of the function.redirect_to.php file and a little suggestion regarding the SEO features (explanation will follow):

[code]
function redirect_to($url, $status = '')
{
switch($status) {
case '404':
header("HTTP/1.1 404 Not Found");
header('Location: ' . $url);
break;
case '301':
header("HTTP/1.1 301 Moved Permanently");
header('Location: ' . $url);
break;
default:
header('Location: ' . $url);
exit;
}
}
[/code]

and a small modification in index.php (Line 198)

[code]
redirect_to(BASE_URL . 'page-unavailable/', '404');
[/code]

Explanation: if you access a link that does not exists (let's say BASE_URL/bla-bla/), you get redirected to the "page-unavailable/" but the headers sent are 200 - OK, which, for Google or other search engines, means that the page actually exists and can be indexed.

So, if you specify the ' …