Guest User

Untitled

a guest
Jun 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. function page_title($table_name, $id) {
  2.  
  3. switch ($table_name) {
  4. case "products":
  5. $results = mysql_query("SELECT CONCAT_WS(' - ', product_groups.name, products.name) AS title, products.meta_keywords, products.meta_description FROM product_groups INNER JOIN products ON product_groups.groupID = products.groupID WHERE productID = '$id'");
  6. $row = mysql_fetch_array($results, MYSQL_ASSOC);
  7. break;
  8. }
  9.  
  10. return $row;
  11.  
  12. }
  13.  
  14.  
  15.  
  16. <?php if(isset($url->vars[1])):?>
  17. <?php $pageinfo = page_title($page['table_name'],$url->vars[1]); ?>
  18. <title>Kingpin | Products > <?php echo ucwords($pageinfo['title'])?></title>
  19. <meta name="Keywords" content="<?=$pageinfo["meta_keywords"]?>" />
  20. <meta name="Description" content="" />
  21. <?php else: ?>
  22. <title>Kingpin | <?php echo $page['title']; ?></title>
  23. <meta name="Keywords" content="<?php echo $page['keywords']; ?>" />
  24. <meta name="Description" content="<?php echo $page['description']; ?>" />
  25. <?php endif; ?>
Add Comment
Please, Sign In to add comment