* used wrong conditionals, fixed
authorWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:56:53 +0000 (16:56 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:56:53 +0000 (16:56 +0000)
* add conditional which was done wrong via SUBST

webcit/static/t/who/section.html
webcit/static/t/who/summary_section.html
webcit/who.c

index cfa97bd6a62f0aa5fbfc12f103199967ec2e3258..e5896bf0912df736f2d9a7e77d3d464929136b3b 100644 (file)
@@ -26,7 +26,6 @@
    <td class="host_col">
 <!-- hostname -->
 <?WHO:HOST("X")>
-<?!("COND:SUBST", 8, "WHO:REALHOST", "")> <br /><i> <?WHO:REALHOST("X")></i>
-<?!("X", 8)>
+<?!("WHO:REALHOST", 8)> <br /><i> <?WHO:REALHOST("X")></i><?!("X", 8)>
 </td>
 </tr>
index 94fea8215996ab92002970187559512c85e5a072..540da8ec8442939acea1b8c7b0935f699c6fd4b1 100644 (file)
@@ -5,13 +5,13 @@
 </td>
 <!-- idle flag -->
 <td width="5%">
-<?!("COND:SUBST", 4, "WHO:IDLE")>  <img align="middle" src="static/inactiveuser_24x.gif" alt="(<?_("idle since")>s <?WHO:IDLESINCE> <?_("Minutes")>)" border="0" />  <?!("X", 4)>
-<??("COND:SUBST", 5, "WHO:IDLE")>  <img align="middle" src="static/activeuser_24x.gif" alt="(<?_("active")>)" border="0" />  <?!("X", 5)>
+<?!("WHO:IDLE", 4)>  <img align="middle" src="static/inactiveuser_24x.gif" alt="(<?_("idle since")>s <?WHO:IDLESINCE> <?_("Minutes")>)" border="0" />  <?!("X", 4)>
+<??("WHO:IDLE", 5)>  <img align="middle" src="static/activeuser_24x.gif" alt="(<?_("active")>)" border="0" />  <?!("X", 5)>
 </td>
 <td>
 <!--  username (link to user bio/photo page)  -->
 <a href="showuser?who=<?WHO:NAME("U")>"> <?WHO:NAME("X")></a> 
-<??("COND:SUBST", 6, "WHO:NSESSIONS", 1)>[<?WHO:NSESSIONS>] </a><?!("X", 6)>
+<??("WHO:NSESSIONS", 6, 0, 1)>[<?WHO:NSESSIONS>] </a><?!("X", 6)>
 <!-- room -->
 </td><td>
 <?WHO:ROOM>
index 692481e382dfec128f8850925dc73c0776dc9e27..cb9cfd4b25f24553dd9b826edd2f86426045036e 100644 (file)
@@ -274,6 +274,11 @@ void tmplput_who_realhost(StrBuf *Target, WCTemplputParams *TP)
        UserStateStruct *User = (UserStateStruct*) CTX;
        StrBufAppendTemplate(Target, TP, User->RealHost, 0);
 }
+int conditional_who_realhost(StrBuf *Target, WCTemplputParams *TP)
+{
+       UserStateStruct *User = (UserStateStruct*) CTX;
+       return StrLength(User->RealHost) > 0;
+}
 
 void tmplput_who_lastactive(StrBuf *Target, WCTemplputParams *TP)
 {
@@ -343,4 +348,5 @@ InitModule_WHO
        RegisterConditional(HKEY("WHO:NSESSIONS"), 1, conditional_who_nsessions, CTX_WHO);
        RegisterConditional(HKEY("WHO:ISME"),      1, conditional_who_isme, CTX_WHO);
        RegisterConditional(HKEY("WHO:REALROOM"),  1, conditional_who_realroom, CTX_WHO);
+       RegisterConditional(HKEY("WHO:REALHOST"),  1, conditional_who_realhost, CTX_WHO);
 }