Results 1 to 9 of 9

Thread: Detail header mod

  1. #1
    Join Date
    Sep 2002
    Location
    UK
    Posts
    89

    Default Detail header mod

    I have created a mod to insert link keywords and classification tags into your detail pages. The classification is ported from the links main category.

    First open /themes/default/header.html

    within the header insert

    <meta name="keywords" content="<%keywords%>">
    <meta name="classification" content="<%classification%>">

    Once done save this file as /themes/default/detail_header.html

    Next

    Open detail.php and look around line 26 in 3.2

    Code:
    include("application.php");
    
      session_start();
    
      $conn = ConnectDB();
    
      $query = "select title, keywords, category_id, suspended from idx_link where link_id = '$id'";
      $result = $conn->Execute($query);
      $link_title = $result->Fields("title");
      $suspended = $result->Fields("suspended");
      $link_keywords = $result->Fields("keywords");
      $catnumber = $result->Fields("category_id");
    Straight after add this

    Code:
      // mod classification
    
      $query = "select name from idx_category where category_id = $catnumber";
      $result = $conn->Execute($query);
      $link_classification = $result->Fields("name");
      
      // End classification mod
    Lastly and around line 166

    Code:
    $title = str_replace("<%link_title%>",$link_title,$title);
     $keywords = $link_keywords;
     $classification = $link_classification;
    
    DisplayTemplate($theme_path."detail_header.html","\$title,\$cat,\$keywords,\$classification");
    Last edited by markbrooks; 09-05-2004 at 05:39 PM.

  2. #2
    Join Date
    Dec 2003
    Posts
    28

    Default Slight addition...

    Thanks for the great mod... I simply added a description in the header...

    Open a copy of /themes/default/header.html
    Save this copy as /themes/default/detail_header.html

    Edit your new detail_header.html to include the following lines within the <head></head> section:

    Code:
    <meta name="keywords"       content="<%keywords%>">
    <meta name="description"    content="<%short_desc%>">
    <meta name="classification" content="<%classification%>">
    Open detail.php and look around line 26 in 3.2

    Code:
      include("application.php");
    
      session_start();
    
      $conn = ConnectDB();
    
    // MOD START --> INCLUDE KEYWORDS & DESCRIPTION IN PAGE HEAD
    //  $query = "select title, suspended from idx_link where link_id = '$id'";
    //  $result = $conn->Execute($query);
    //  $link_title = $result->Fields("title");
    //  $suspended = $result->Fields("suspended");
      $query = "select title, keywords, category_id, description, suspended from idx_link where link_id = '$id'";
      $result = $conn->Execute($query);
      $link_title = $result->Fields("title");
      $link_description = $result->Fields("description");
      $suspended = $result->Fields("suspended");
      $link_keywords = $result->Fields("keywords");
      $catnumber = $result->Fields("category_id");
      $query = "select name from idx_category where category_id = $catnumber";
      $result = $conn->Execute($query);
      $link_classification = $result->Fields("name");
    // MOD STOP  --> INCLUDE KEYWORDS & DESCRIPTION IN PAGE HEAD
    (Make sure you get all of those commas inserted in the $query = "select title, keywords, category_id... line above!

    Next at around line 166

    Code:
    // MOD START --> INCLUDE KEYWORDS & DESCRIPTION IN PAGE HEAD
    //$title = str_replace("<%link_title%>",$link_title,$title);
    
    //DisplayTemplate($theme_path."header.html","\$title,\$cat");
     $title = str_replace("<%link_title%>",$link_title,$title);
     $keywords = $link_keywords;
     $classification = $link_classification;
     $short_desc = trim(substr(strip_tags($link_description),0,150)) . "...";
    
    
    DisplayTemplate($theme_path."detail_header.html","\$title,\$cat,\$keywords,\$classification,\$short_desc");
    // MOD STOP  --> INCLUDE KEYWORDS & DESCRIPTION IN PAGE HEAD
    ShowDetailPage();
    DisplayTemplate($theme_path."footer.html","\$cat,\$ma");
    The 150 in the $short_desc line above sets the number of characters in the description field... change it to your desired length.

  3. #3
    Join Date
    Jul 2002
    Location
    California
    Posts
    57

    Default

    [QUOTE=bestfx]Thanks for the great mod... I simply added a description in the header...


    Does this work on 3.2?

    Allen

  4. #4
    Join Date
    Dec 2003
    Posts
    28

    Default Yes it works on 3.2

    Yes, it works well in 3.2.
    Code:
                 \||/
                 |  @___oo
         /\  /\  /(__,,,,|    Wayne Becker
        ) /^\)^\/  _)         (Full Time Obstinate Bugger)
        )   /^\/   _)         Honolulu HI 96816
        )   _ /  / _)
    /\  )/\/ ||  | )_)
    <  >      |(,,) )__)
    ||      /    \)___)\
    | \____(      )___) )__
    \_______(_______;;;__;;;

  5. #5
    Join Date
    Jul 2002
    Location
    California
    Posts
    57

    Default

    well I thought I was following the directions very closely,

    getting this above the header

    Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/gearshop/public_html/shop/lib/template.lib.php(61) : eval()'d code on line 1


    If i install the code for only the classification and keywords, it works, if i attempt to do the revised code with short_description then It fails with this.

    Files in the raw attached

    any ideas?

    allen
    Last edited by AllenNance; 12-02-2004 at 05:34 PM. Reason: updating

  6. #6
    Join Date
    Dec 2003
    Posts
    28

    Smile Check your code...

    Cut and paste is the best way to make these changes. If you want, post your pages as text attachment and I will look at them.
    Code:
                 \||/
                 |  @___oo
         /\  /\  /(__,,,,|    Wayne Becker
        ) /^\)^\/  _)         (Full Time Obstinate Bugger)
        )   /^\/   _)         Honolulu HI 96816
        )   _ /  / _)
    /\  )/\/ ||  | )_)
    <  >      |(,,) )__)
    ||      /    \)___)\
    | \____(      )___) )__
    \_______(_______;;;__;;;

  7. #7
    Join Date
    Jul 2002
    Location
    California
    Posts
    57

    Default still have problems...

    "Cut and paste is the best way to make these changes. If you want, post your pages as text attachment and I will look at them."

    I thought I did cut and paste, but something went wrong.. here are the two unmodified files....

    Thank you for your assistance..

    Allen
    Attached Files Attached Files
    Last edited by AllenNance; 12-02-2004 at 05:35 PM. Reason: bump

  8. #8
    Join Date
    Dec 2003
    Posts
    28

    Default Show me da files...

    We learn by doing... show me the files that you have altered... not the files you want me to alter... that ain't happenin'... I'll look at your work and try to help you.
    Code:
                 \||/
                 |  @___oo
         /\  /\  /(__,,,,|    Wayne Becker
        ) /^\)^\/  _)         (Full Time Obstinate Bugger)
        )   /^\/   _)         Honolulu HI 96816
        )   _ /  / _)
    /\  )/\/ ||  | )_)
    <  >      |(,,) )__)
    ||      /    \)___)\
    | \____(      )___) )__
    \_______(_______;;;__;;;

  9. #9
    Join Date
    Jul 2002
    Location
    California
    Posts
    57

    Default

    Quote Originally Posted by bestfx
    We learn by doing... show me the files that you have altered... not the files you want me to alter... that ain't happenin'... I'll look at your work and try to help you.
    Sorry about that, I miss read/interpetated your instructions...

    ok the files are attached here.

    the file, gooddetailphp.txt is the mod by Mark. It seems to work fine.

    File detailphp.txt is the expanded mod and it's shows an error at the very top of the page like it's above the detail_header file.

    Wayne, I like obstinance, makes us dummys work harder

    Thanks for taking some time to assist.

    Allen
    Attached Files Attached Files

Similar Threads

  1. Replies: 2
    Last Post: 05-12-2004, 10:18 PM
  2. what does it mean ?
    By lewisw in forum v5.x
    Replies: 10
    Last Post: 08-29-2003, 02:05 AM
  3. Replies: 2
    Last Post: 08-05-2003, 02:16 AM
  4. Getting lots of header errors
    By shalida in forum v5.x
    Replies: 3
    Last Post: 06-24-2003, 07:30 PM
  5. Customize header template in V3.1 ?
    By Frank71 in forum Templates
    Replies: 5
    Last Post: 06-05-2003, 04:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •