Cannot get HREF to work
| From: | Elena Fraboschi | Date: | Tue, 02 Apr 2002 16:00:58 +0000 |
| Subject: | Cannot get HREF to work | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3437@lists.php.net to get a copy of this message | ||
Dear All:
First posting to this list---Greetings. Yes, I'm a newbie. I have
read the docs not once but twice---honest. And I am still stumped, and
will appreciate any hint as to how to solve the problem below.
What is desired is to offer a Table of Contents of preprints
(papers accepted but not yet published). The output should
look more or less like this:
AUTHOR TITLE DOWNLOADABLE FILE
Elena Fraboschi Cats for the Worls 1234.dvi
The file name, "1234.dvi", concats the id number for the item,
"1234", and the suffix "dvi". The source for that portion
should read:
<a href="1234.dvi">1234.dvi</a> for obvious reasons.
I get Smarty to do everything, with these two oddities:
(a) If I do not request <a href...> for the dvi files, the column
headed DOWNLOADABLE FILE prints out just fine (of course, the
file names are not clickable):
1234.dvi
2586.dvi
4927.dvi
(b) If I request a write-up as I showed above, with <a href...>,
though the debugging window lists all the files (so the
array is compiled), the column titled DOANLOADABLE FILE does not
get displayed at all.
Where am I going wrong, please? Many thanks, elena
Here is the preprints.php file
==============================
<?php
include("./smartyHdr.php");
include("/space/local/apache/htdocs/iumj/Smarty/dbConnect.php");
$results = mysql_query("select
author.lastName as author, article.title as title,
concat_ws(\".\", article.artid, \"dvi\") as file
from author, article where author.artid = article.artid and
article.url like '%020'");
while($rowarr = mysql_fetch_array($results)){
$author[] = $rowarr[0];
$title[] = $rowarr[1];
$file[] = $rowarr[2];
}
$smarty->assign("author", $author);
$smarty->assign("title", $title);
$smarty->assign("file", $file);
$smarty->display("index.tpl");
mysql_close();
?>
Here is the pertinent portion of index.tpl file
================================================
{section name=accepted loop=$file}
<tr valign="{#valign#}">
<td height="63" width="249" background="{#gradient#}"
align="{#align#}">
{$author[accepted]}</td>
<td align="{#align#}">
{$title[accepted]}</td>
<td align="{#align#}"> *}
<a href="{$file[accepted]}">{$file[accepted]}</a></td>
</tr>
{/section}