Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.