+int ConditionalHaveBIO(StrBuf *Target, WCTemplputParams *TP)
+{
+ UserListEntry *ul = (UserListEntry*) CTX;
+
+ if (ul == NULL)
+ return 0;
+ return ul->HasBio;
+}
+
+void tmplput_USER_BIO(StrBuf *Target, WCTemplputParams *TP)
+{
+ int Done = 0;
+ StrBuf *Buf;
+ const char *who;
+ long len;
+
+ GetTemplateTokenString(Target, TP, 0, &who, &len);
+
+ Buf = NewStrBuf();
+ serv_printf("RBIO %s", who);
+ StrBuf_ServGetln(Buf);
+ if (GetServerStatus(Buf, NULL) == 1) {
+ StrBuf *BioBuf = NewStrBufPlain(NULL, SIZ);
+ while (!Done && StrBuf_ServGetln(Buf)>=0) {
+ if ( (StrLength(Buf)==3) &&
+ !strcmp(ChrPtr(Buf), "000"))
+ Done = 1;
+ else
+ StrBufAppendBuf(BioBuf, Buf, 0);
+ }
+ StrBufAppendTemplate(Target, TP, BioBuf, 1);
+ FreeStrBuf(&BioBuf);
+ }
+ FreeStrBuf(&Buf);
+}
+
+int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP)
+{
+ StrBuf *Buf;
+ const char *who;
+ long len;
+ int r = 0;
+
+ GetTemplateTokenString(Target, TP, 2, &who, &len);
+
+ Buf = NewStrBuf();
+ serv_printf("OIMG _userpic_|%s", who);
+ StrBuf_ServGetln(Buf);
+ if (GetServerStatus(Buf, NULL) != 2) {
+ r = 1;
+ }
+ else {
+ r = 0;
+ }
+ serv_puts("CLOS");
+ StrBuf_ServGetln(Buf);
+ GetServerStatus(Buf, NULL);
+ FreeStrBuf(&Buf);
+ return(r);
+}
+