On Thu, Nov 15, 2001 at 10:19:03AM +0100, pp wrote:
> > > > mgd_get_object_by_guid
> > > and how can I get object's guid?
> > $object->guid() returns a string which you can use as reference in hyper
> > links instead of $object->id. Then instead using mgd_get_xxxx($id) use
> > mgd_get_object_by_guid($guid) when $id and $guid are some arguments to
> > this page (for example, /some/page/argument.html, wheer argument will be
> > either guid or id depending which value you embedded into hyper link).
> ok, I got url - www.domain.com/page/page/xxxx.html
> so I use
>  if ($argc == 1) $id = $argv[0];
> if ($id) $t = mgd_get_topic($id);
> if ($id) $a = mgd_get_article($id);
> 
> So in this case I think I should generate links 
> which uses guids not id? right?
Right.

> And I sould replace xxxx.html from id to guid?
Right. Something like this:

echo "<a href=\"/page/page/\" . $article->guid() . ".html\">" . $article->title . 
"</a>"

and instead of the code quoted above:
 if ($argc == 1) $guid = $argv[0];
 if (eregi("^[0-9a-f]{32}$", $guid) 
        $obj = mgd_get_object_by_guid($guid);

Eregi call is needed to detect that passed argument has GUID form.

-- 
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
  `Senior software developer and analyst for SaM-Solutions Ltd.`
---
A penny saved kills your career in government.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to