Jump to content


Directory php help

  • Please log in to reply
2 replies to this topic

#1 mindy1978

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 September 2006 - 04:22 AM


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']);


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);


// 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.


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:

#2 rallokkcaz

  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 02 September 2006 - 04:43 AM

whats the error?

#3 mindy1978

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 September 2006 - 01:32 PM

There isn't really an error, the information I am trying to display just doesn't show.

- cat_name
- cat_description


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users