- Title: Member
- Status: Offline
- From: Costa Rica
- Registered: 2008-08-25
- Posts: 38
Topic: How to place companies cloud in sidebar
Anybody knows how to bring the "companies cloud" to the sideabar? the one that shows in the companies sections.
Thank you in advance, I´ll appreciate the help.
Last edited by The_man (2008-08-30 21:14:29)
- Title: Member
- Status: Offline
- From: Costa Rica
- Registered: 2008-08-25
- Posts: 38
Re: How to place companies cloud in sidebar
like the one in www.hireme.sg
- Title: Member
- Status: Offline
- From: Italy
- Registered: 2008-08-26
- Posts: 193
Re: How to place companies cloud in sidebar
all we have this code on COMPANY FOLDER: http://www.lavorohotel.net/companies/
you just need to copy this code and put it into sidebar.tpl or something similar..
- Title: Member
- Status: Offline
- From: Costa Rica
- Registered: 2008-08-25
- Posts: 38
Re: How to place companies cloud in sidebar
Yeah, I tried that thinking it was that simple copy /paste code from one place to the other, but for some reason it only shows the cloud in the sidebar as I want it, but in the "companies" page only not in the home page or other pages. I must be missing something...
Anybody can help?
- Title: Member
- Status: Offline
- From: Italy
- Registered: 2008-08-26
- Posts: 193
Re: How to place companies cloud in sidebar
could you show the code that you copied to understand exactly your situation?
- Title: Member
- Status: Offline
- Registered: 2008-08-20
- Posts: 31
Re: How to place companies cloud in sidebar
Hi,
In page_home.php, Add
Code:
$companies = array();
$sanitizer = new Sanitizer();
$sql = 'SELECT DISTINCT company FROM jobs WHERE is_temp = 0 AND is_active = 1 ORDER BY Rand() ASC LIMIT 20';
$comps = $db->QueryArray($sql);
foreach ($comps as $company)
{
$sql = 'SELECT COUNT(id) AS nr
FROM jobs
WHERE company = "' . $company['company'] . '"';
$nr = $db->QueryItem($sql);
if ($nr < 2)
{
$tag_height = 1;
}
else if ($nr >= 2 && $nr < 3)
{
$tag_height = 2;
}
else if ($nr >= 3 && $nr < 4)
{
$tag_height = 3;
}
else if ($nr >= 4 && $nr < 5)
{
$tag_height = 4;
}
else if ($nr >= 5 && $nr < 6)
{
$tag_height = 5;
}
else if ($nr >= 6)
{
$tag_height = 6;
}
$companies[] = array('name' => $company['company'],
'varname' => $sanitizer->sanitize_title_with_dashes($company['company']),
'count' => $nr,
'tag_height' => $tag_height);
}
$smarty->assign('companies', $companies);
$smarty->assign('companies_count', count($comps));
And in the tpl file add
Code:
<div class="companycloud">
<h3>Company Cloud</h3>
<p class="names">{section name=tmp loop=$companies}
<span class="company-tag-{$companies[tmp].tag_height}">
<a href="{$BASE_URL}jobs-at/{$companies[tmp].varname}/">{$companies[tmp].name}</a>
</span>
{/section}
<br />
</p>
<p class="clearfix viewmore"><a href="{$BASE_URL}companies/">View All →</a></p>
</div>
regards
vinay
- Title: Member
- Status: Offline
- From: Italy
- Registered: 2008-08-26
- Posts: 193
Re: How to place companies cloud in sidebar
good, I hope it will be in new version too 
- Title: Member
- Status: Offline
- From: Costa Rica
- Registered: 2008-08-25
- Posts: 38
Re: How to place companies cloud in sidebar
Hey Flakdesign. Thanks man! I really appreciate your help.
Posts [ 8 ]
Guest posting is disabled. You must login or register to post a reply.