Jump to content

Help with a company directory


danielm60

Recommended Posts

Hi Guys,

I have a website with a company directory plugin which works a treat but the authors no longer support questions so my  first port of call was you!

At the moment the database works fine but only calls the company name and bio into the page.... I know it has all the other stuff i need to show but i dont know how to call it in (noobieish)

I want to show

company name

Telephone

email

website

Address

Bio

 

 

 

Any help would be great

I think it is this part of the functions.php but if not I can post the rest

//get Listings
$query = "SELECT * FROM ".BIZDIRDBTABLE." l LEFT JOIN ".BIZDIRCATTABLE." c ON (c.category_id = l.category_id) ORDER BY company_name ASC;";
$listings = bizdir_clean_output($wpdb->get_results($query,ARRAY_A));
$listingsByStatus = array("Pending"=>array(),"Approved"=>array());
foreach($listings as $l)
if(@$l["status"] == 0)
$listingsByStatus["Pending"][] = $l;
else
$listingsByStatus["Approved"][] = $l;
$display = "";
foreach($listingsByStatus as $title=>$list) {
$display .= "<h3>$title Listings: ".count($list)."</h3><table width='100%' border='0' cellspacing='0' cellpadding='0' class='widefat'>";
$display .=
"<thead><tr>".
"<th>Company Name</th>".
"<th>Category</th>".
"<th>Name</th>".
"<th>Email</th>".
"<th>Company Website</th>".
"<th>Actions</th>".
"</tr></thead>".
"<tbody>"
;
$count = 0;
foreach($list as $l)
$display .=
"<tr ".($count++%2 == 0?"class='alternate'":"").">".
"<td>".str_replace("Â&","&",@$l["company_name"])."</td>".
"<td>".@$l["category"]."</td>".
"<td>".@$l["name"]."</td>".
"<td><a href='mailto:".@$l["email"]."' target='_blank'>".@$l["email"]."</a></td>".
"<td>".(empty($l["company_url"])?" ":"<a href='".$l["company_url"]."' target='_blank'>".@$l["company_url"]."</a>")."</td>".
"<td>".
"<a style='cursor:pointer;' onClick='bizdir_edit_listing(\"".@$l["listing_id"]."\")'>review</a> | ".
($title == "Pending"?"<a style='cursor:pointer;' onClick='bizdir_change_status(\"".@$l["listing_id"]."\",1)'>approve</a> | ":"").
"<a style='cursor:pointer;' onClick='bizdir_delete_listing(\"".@$l["listing_id"]."\")'>delete</a>".
"</td>".
"</tr>";
;
if(count($list) < 1)
$display .= "<tr><td colspan='4'>There are no \"$title Listings\".</td></tr>";
else
$display .= "</tbody>";
$display .= "</table>";
}
return $display;
}

 

 

many thanks

D

Link to comment
https://forums.phpfreaks.com/topic/232671-help-with-a-company-directory/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.