Jump to content

mindy1978

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by mindy1978

  1. Hello,

    I have been trying to figure out a php scripting problem for weeks now. I basically know nothing about php and that is the problem. I am setting up a directory and I am working with tpl files and php.

    I have set up almost 400 categories. Entering category name {$cat_name}, category description {$cat_note}, category keywords{$cat_keywords}.

    The template file pulls the description and keywords for the meta tags and description for each page. This works fine. I want to pull the page <title/> and html header from {$cat_name} which is the category name. I cannot figure out how. Right now it pulls info from where_am_i, showing the directories and subdirectories, etc.

    On my list pages I would also like to list the category name and description on every page even if there are no links in that category. The {$cat_name} and {$cat_note} fields just don't work on the listing pages.

    In my sql database I changed to {$cat_name} to a text field but when I try to modify the php, nothing works. I tried to change the following script:

    where_am_i ($cat_id, 1);
    generate_category ('list', $cat_id);
    generate_html_header ($txt['where_am_i'], $row['cat_note'], $row['cat_keywords']);

    to:

    where_am_i ($cat_id, 1);
    generate_category ('list', $cat_id);
    generate_html_header ($txt['cat_name'], $row['cat_note'], $row['cat_keywords']);

    This is some of the other scripting I thought I may need to change to get this to work, but I just don't know how:

    // get keyword & description for HTML HEADER
    $sql = "SELECT cat_note, cat_keywords FROM d97_category WHERE cat_id = '$cat_id' LIMIT 1";
    $res = sql_query ($sql);
    $row = sql_fetch_array ($res);

    and:

    // categories information
    $tmp_cat = '';
    for ($j = 1; $j <= $config['cat_multiple']; $j++)
    {
    $c = "category_$j";
    $c = $row[$c];
    if (!empty($c)) { $tmp_cat[$k] = where_am_i($c, 0); $k++; }
    }

    // sort category
    reset ($tmp_cat);
    asort ($tmp_cat);
    while (list ($key, $val) = each ($tmp_cat)) $row['list_category'] .= "$val<BR>\n";

    I am hoping that someone can help me and give me some instruction. I am getting so frustrated.

    Thanks so much.

    Mindy

    You can view the directory at: http://www.athomedirectory.com
    I have asked this question at another forum buy can't get it resolved. You can view the thread at:
    http://www.selfstartersweeklytips.com/forum/viewtopic.php?p=44923
×
×
  • 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.