danielm60 Posted April 4, 2011 Share Posted April 4, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.