Adding CompanyDirectory company status to the Companies tab in the admin panel

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Adding CompanyDirectory company status to the Companies tab in the admin panel

Post by jmcgin51 »

I'm using CompanyDirectory on one of my sites, and there are a number of active companies listed, as well as a number that are either "Disabled" or "Draft".  I wanted to be able to see the status of each company without having to click on the company to view its details.  Here is how I did it (the code below works as of CompanyDirectory 1.4):

DISCLAIMER: EDITS TO THE SOURCE CODE MAKE YOUR SITE UNSUPPORTABLE.  PROCEED AT YOUR OWN RISK.  THE MODIFICATIONS PRESENTED BELOW ARE WORKING FINE FOR ME, BUT I MAKE NO CLAIM THAT THEY WILL WORK FOR YOU.

Open function.admin_companiestab.php.  Insert the following code:

Code: Select all

    after line 39:    $onerow->status = $row['status'];
    after line 63:    $smarty->assign('statustext', $this->Lang('status'));
Open templates\companylist.tpl.  Insert the following code:

Code: Select all

    after line 28:    <th>{$statustext}</th>
    after line 40:    <td>{$entry->status}</td>
With these edits in place, a new column "Status" is added to the Companies tab in the Admin panel, and the status of each company is listed.

I hope this is useful to someone!
Post Reply

Return to “Tips and Tricks”