John P . Looney wrote:
> On Fri, Mar 02, 2001 at 11:54:50AM +0100, David Guerizec mentioned:
>
>>> Oh right. Well, that's not to bad then. Is there a handy way of getting
>>> the sitegroup I'm in ?
>>
>> $midgard-sitegroup
>
>
> So, to do some new cool stuff, I've done;
>
> $topic = mgd_list_topics(0);
> if(!$topic) {
> echo "mgd_list_topics(0) failed.<br>";
> echo "reason: " . mgd_errstr();
> }else{
> while($topic->fetch()){
> if($topic->sitegroup == $midgard->sitegroup) {
> echo "<TR><TD><IMG alt=\"\" src=\"/blobs/images/grad.gif\"
>border=0></TD><TD> \n";
> echo "<A href=\"/articles/$topic->name\">$topic->name</a></TD></TR>";
> } else {
> echo "<TR><TD> $topic->sitegroup != $midgard->sitegroup</TD></TR>";
> }
> }
>
> For some reason now, it's saying that $topic->sitegroup is *always* 0. Again
> you can see what I mean at: http://midgard.linux.ie/
>
> Kate
ok, maybe you'll need to do:
$t = mgd_get_topic($topic->id);
if($t->sitegroup) {
}
BTW, testing if($t->sitegroup) is sufficient, because you can only see
the sitegroup you're in (!= 0) or the SG0 (==0).
--
Best Regards,
David Guerizec Free Software Developer
Aurora R&D [EMAIL PROTECTED]
Midgard core developer http://www.midgard-project.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]