Hello and thank you for the response.
The php script is:
<?php
// important files
require "./includes/functions.php";
require './includes/rare_funcs.php';
// get parameters
$cat_id = get_param ('cat_id');
$s = get_param ('s');
$o = get_param ('o');
$p = get_param ('p', 1);
// is there any childs?
$child_cats = 0;
for ($i = 1; $i <= $tmp_tbl['parent'][0]; $i++)
{
if ($tmp_tbl['parent'][$i] == $cat_id) $child_cats = 1;
}
// load tpl
$section = section_tpl ($config['skin']."/list_links.tpl");
$tpl = load_tpl ($config['skin']."/list.tpl");
// variables
$ipp = $config['link_perpage']; // ipp = items per page
// sort vars
$sortby[0] = "sort_point DESC, list_date DESC";
$sortby[1] = "title";
$sortby[2] = "list_date";
$sortby[3] = "avg_rating";
$sortby[4] = "ttl_clicks";
$sortorder[0] = '';
$sortorder[1] = "ASC";
$sortorder[2] = "DESC";
if (empty($o) || !array_key_exists($o, $sortorder)) $o = "0";
if (empty($s) || !array_key_exists($s, $sortby)) { $s = "0"; $o = "0"; }
// get total pages
$where = create_category_sql ($cat_id, 'OR');
$res = sql_query ("SELECT SUM(status='') AS total FROM d97_links WHERE $where");
$row = sql_fetch_array ($res);
$total = $row['total'];
$pages = ceil($total / $ipp); // number of pages of list
// verify vars
// if $p is not defined or $p > number_of_pages
if (empty ($p) or ($p > $pages) or ($p < 1)) $p = "1";
$start = ($p-1) * $ipp;
// create list of links under defined cat_id
$tmp = ''; $i = $start; $tmp_sp = array ();
$where = create_category_sql ($cat_id, 'OR');
$sql = "SELECT * FROM d97_links WHERE ($where) AND status='' ORDER BY sponsored DESC, $sortby[$s] $sortorder[$o] LIMIT $start, $ipp";
$res = sql_query ($sql);
while ($row = sql_fetch_array ($res))
{
$i++; $k = 1; $row['status_flag'] = '';
$row['list_category'] = '';
$row['i'] = $i;
$row['list_date_shortdate'] = convert_date ($row['list_date'], 0);
$row['list_date_longdate'] = convert_date ($row['list_date'], 1);
$row['avg_rating_img'] = rating_img ($row['avg_rating']);
$row['note'] = line_wrap ($row['note'], $config['list_wrap']);
// new/updated links
if (diff_date ($row['list_date']) <= $config['link_newperiod']) $row['status_flag'] .= $lang['l_new_flag'];
if (diff_date ($row['last_update']) <= $config['link_updateperiod']) $row['status_flag'] .= $lang['l_update_flag'];
if ($row['editor_pick']) $row['status_flag'] .= $lang['l_editor_flag'];
// 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";
// custom fields
$custom = get_custom ($row);
$row = array_merge ($row, $custom);
if ($row['sponsored'])
$tmp_sp[] = quick_tpl (load_tpl ($section['list_sponsored']), $row);
else
$tmp .= quick_tpl (load_tpl ($section['list_common']), $row);
}
// randomize sponsored link spots
if (!empty ($tmp_sp))
{
shuffle ($tmp_sp);
$tmp = implode (' ', $tmp_sp).$tmp;
}
// sort & method select form
$txt['sort_select'] = create_select_form ('s', $sortby_nm, $s);
$txt['order_select'] = create_select_form ('o', $sortorder_nm, $o);
// previous & next page link
$pr = $p - 1;
$nx = $p + 1;
// generate list pages link
if ($p > 1)
$txt['prev'] = "<a href=\"list.php?cat_id=$cat_id&p=$pr&s=$s&o=$o\">".$lang['l_prev']."</a>";
else
$txt['prev'] = $lang['l_prev'];
if ($p < $pages)
$txt['next'] = "<a href=\"list.php?cat_id=$cat_id&p=$nx&s=$s&o=$o\">".$lang['l_next']."</a>";
else
$txt['next'] = $lang['l_next'];
$txt['list_pages_list'] = generate_pagination ("list.php?cat_id=$cat_id&s=$s&o=$o", $pages, $p);
// 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);
// generate list content
$txt['cat_id'] = $cat_id;
$txt['current_page'] = $p;
$txt['number_of_pages'] = $pages;
$txt['list_items'] = $tmp;
$txt['total_links'] = num_format ($total);
where_am_i ($cat_id, 1);
generate_category ('list', $cat_id);
generate_html_header ($txt['where_am_i'], $row['cat_note'], $row['cat_keywords']);
// flush output
$txt['main_body'] = quick_tpl ($tpl, $txt);
flush_tpl ();
?>
The TPL files are:
1 - List.tpl
<table border="0" cellpadding="0" cellspacing="0" width="750">
<tr>
<td width="550" colspan="2" valign="top">
<!-- BEGINIF $child_cats -->
<!-- CATEGORY -->
<table border="0" cellpadding="0" cellspacing="0" width="550" height="190">
<tr>
<td width="550" colspan="4">
<h1 align="center" style="margin-top: 0; margin-bottom: 0">
<span class="postbody"><font size="5">
{$cat_name}<p align="center" style="margin-top: 0; margin-bottom: 0">
</p>
<h1 align="center" style="margin-top: 0; margin-bottom: 0">
<span style="font-weight: 400; ">
<font face="Calisto MT" size="4">{$site_description}</font></span></h1>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<h2 align="center" style="margin-top: 0; margin-bottom: 0">
<span style="font-weight: 400; font-style: italic">
<font face="Calisto MT" size="3">{$where_am_i_link}</font></span></h2>
</td>
</tr>
<tr>
<td width="550" bgcolor="red" colspan="4"><img border="0" src="skins/holiday/images/cat-1.gif" width="550" height="20"></td>
</tr>
<tr>
<td width="1" bgcolor="#AFB5BA"><img src="skins/holiday/images/1x1t.gif" width="1" height="1"></td>
<td width="10" bgcolor="#CFE6FC"><img src="skins/holiday/images/1x1t.gif" width="10" height="1"></td>
<td width="538" bgcolor="#CFE6FC" height="150">
{$category_1}
<p><img src="skins/holiday/images/1x1t.gif" width="3" height="1"></td>
<td width="1" bgcolor="#AFB5BA"><img src="skins/holiday/images/1x1t.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="550" bgcolor="red" colspan="4"><img border="0" src="skins/holiday/images/cat-3.gif" width="550" height="20"></td>
</tr>
</table>
<p>
<BR />
<!-- ENDIF -->
<p>{$list_items}
</p>
</p>
<p align="center">{$current_page}/{$number_of_pages} :: {$prev} {$next}</p>
<p align="center">{$list_pages_list}</p>
</td>
<td><img src="skins/holiday/images/1x1t.gif" width="10" height="10"></td>
<td valign="top">
<table width="190" cellpadding="5" cellspacing="0" border="0" style="border: solid 1px black">
<form method="GET" action="list.php">
<input type="hidden" name="cat_id" value="{$cat_id}">
<td width="100%" height="25" bgcolor="#0066CC" class="box_head" style="border-bottom: solid 1px black">
<img border="0" src="skins/holiday/images/right.gif" align="absbottom" width="20" height="20"> Toolbox
</td>
<tr>
<td bgcolor="lightgrey" style="border-bottom: solid 1px black"><b>You are here</b></td>
</tr>
<tr>
<td><img src="skins/holiday/images/cat.gif"> {$where_am_i_link}</td>
</tr>
<tr>
<td><img src="skins/holiday/images/subscribe.gif"> <a href="subs.php?cmd=cat_on&cat_id={$cat_id}">Subscribe to this category</a></td>
</tr>
<tr>
<td style="border-bottom: solid 1px black"><img src="skins/holiday/images/cat.gif"> We have {$total_links} links here.</td>
</tr>
<tr>
<td bgcolor="lightgrey" style="border-bottom: solid 1px black"><b>Sort by</b></td>
</tr>
<tr>
<td>{$sort_select}</td>
</tr>
<td>{$order_select}</td>
</tr>
<tr>
<td align="center" style="border-bottom: solid 1px black"><input type="submit" value="Sort"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
2 - List_links.tpl
<!-- BEGINSECTION list_common -->
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table width="100%" border="1" style="border-collapse:collapse" bordercolor="lightblue" cellpadding="3" cellspacing="0">
<tr>
<td class="common_head" colspan="2">{$title}</td>
</tr>
<tr>
<td width="80%">
<p>
{$status_flag} {$short_note}<BR />
<span class="list_button">{$avg_rating_img}</span>
</p>
</td>
<td width="20%" valign="top">
<a href="go.php?link_id={$link_id}" class="smallbox">Visit</a><br>
<a href="tell.php?link_id={$link_id}" class="smallbox">Tell-a-friend</a><br>
<a href="detail.php?link_id={$link_id}" class="smallbox">Detail</a><br>
</p>
</td>
</tr>
</table>
<BR>
<!-- ENDSECTION -->
<!-- BEGINSECTION list_sponsored -->
<table width="100%" border="1" style="border-collapse:collapse" bordercolor="#B9DBFF" cellpadding="3" cellspacing="0">
<tr>
<td class="sponsor_head" colspan="3" bgcolor="#0066CC">
<img src="skins/holiday/images/right.gif" width="15" align="absbottom"> {$title} <img src="skins/holiday/images/sponsor.gif"</td>
</tr>
<tr>
<!-- TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL -->
<!-- TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL - TUTORIAL -->
<td class="sponsor_bg" width="20%">
{$_ilogo_img}
</td>
<td class="sponsor_bg" width="80%">
{$status_flag} {$note}<BR />
<span class="list_button">{$avg_rating_img}</span>
</td>
<td class="sponsor_bg" width="20%" valign="top">
<a href="go.php?link_id={$link_id}" class="smallbox">Visit</a>
<a href="tell.php?link_id={$link_id}" class="smallbox">Tell-a-friend</a>
<a href="detail.php?link_id={$link_id}" class="smallbox">Detail</a>
</p>
</td>
</tr>
</table>
<BR>
<!-- ENDSECTION -->
I want to display the category name, and description on each of the list pages. Something is blocking the {cat_name} and that is what I am trying to figure out.
Thank you so much!
Mindy
You can view the directory at:
http://www.athomedirectory.com