Emiliano wrote:
>
> > I am creating a new company directory which will hopefully be a little more
> > dynamic than our current one. I have planned to use the person records to
> > store as much information about each person as possible, but in some cases I
> > need to use the homepage field to specify a separate page for additional
> > information. As I understand it, the homepage field contains a URL that
> > points to another web page. I'm wondering if it is possible to have it point
> > to an article.
>
> The homepage field is actually a free-form text field. There's no
> obligation to use it for an URL.
So that people can check out news articles by name instead of article
number on
my site, I use this code...
$topic = 20;
$count = 1;
// I am using ".jtn" as a file extension for pages served
// off this site. Why? Just to be different. :)
// Strip off the .jtn and leave the article name or
// numeric ID. .html still works; if you use .html
// as the extension, it will be automatically
// stripped by Midgard.
$id = ereg_replace(".jtn","",$id);
if ($id!="")
{
// If the first character of the article
// id is a digit, we assume we were given
// an article ID and do nothing.
// Otherwise we search for an article with
// the URL field set to what was passed to us.
if ($id[0] > "9")
{
$real_id="";
$arttemp = mgd_list_topic_articles($topic);
while ($arttemp->fetch())
{
if ($arttemp->url==$id)
{
$real_id=$arttemp->id;
}
}
$id = $real_id;
}
if ($id!="")
{
$realart=mgd_get_article($id);
// if we found an article, display it!
if ($realart->id == $id)
{ ?>
<p><h1>&(realart.title);</H1></p>
&(realart.content:h);
<p><hr size=1 noshade></p>
<? }
}
}
Check http://midgard.justthe.net/services/21.jtn
(the actual topic number of the article) or
http://midgard.justthe.net/services/dsl.jtn .
Either will work. Using .html instead of .jtn
as the extension will also work.
--
North Shore Technologies, Cleveland, OH
http://NorthShoreTechnologies.net
Steve Sobol, BOFH - President, Chief Website Architect and Janitor
Linux Instructor, PC/LAN Program, Natl. Institute of Technology, Akron,
OH
[EMAIL PROTECTED] - 888.480.4NET - 216.619.2NET
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]