Posted By

conspirator on 12/19/08


Tagged

php textmate page title accrisoft freedom


Versions (?)

accrisoft freedom page title override - php


 / Published in: Other
 

  1. <?php
  2. // USED WITH ACCRISOFT FREEDOM
  3. // USED TO PULL PAGE_TITLE_OVERRIDE, BUT DEFAULT TO PAGE TITLE WHEN EMPTY
  4. // MUST HAVE CREATED A TAG FIRST!!! [[tag.page_title_override]]
  5. // WRAPPED IN GENDOCS CONDITIONAL
  6.  
  7. if ($_REQUEST['src'] == 'gendocs') {
  8.  
  9. $x_sql = "SELECT metatags FROM gendocs WHERE keywords = '{$_REQUEST['ref']}' LIMIT 1 ";
  10. $x_result = mysql_query($x_sql);
  11. $x_row = mysql_fetch_array($x_result);
  12. $x_lines = split("\n", $x_row['metatags']);
  13. foreach($x_lines as $x_line) {
  14. if (strstr ($x_line, 'Page_Title_Override')) {
  15. list($null, $x_title) = split("=", $x_line);
  16. }
  17. }
  18.  
  19. if ($x_title == '') {
  20. ?>
  21. <title>Grand Oak | [[Page_Title]]</title>
  22. <?php
  23. } else {
  24. echo "<title>Grand Oak | {$x_title}</title>";
  25. }
  26. } else {
  27. ?>
  28. <title>Grand Oak | [[Page_Title]]</title>
  29. <?php
  30. }
  31. ?>

Report this snippet  

You need to login to post a comment.