last_dona management factorization and promo
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 14 Mar 2013 07:07:19 +0000 (08:07 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 14 Mar 2013 07:07:19 +0000 (08:07 +0100)
web/Obj/brisk.phh
web/Obj/user.phh
web/briskin5/Obj/briskin5.phh
web/index.php

index 058cf34..90c5b50 100644 (file)
@@ -141,10 +141,10 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi',
 $G_lng = langtolng($G_lang);
 
 $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "4.7.0";
+$G_brisk_version = "4.7.1";
 
 /* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: aggiunta infrastruttura per gestire le preferenze utente lato server e la personalizzazione delle S di supporter.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: prova il nuovo azioni->preferenze.',
                                        'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
                        'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: server-side infrastructure to manage user preferences added and S customization added.',
                                        'If you want to subscribe our <a target="_blank" href="ml-briscola+subscribe@milug.org">Mailing List</a>, click it!' ) );
@@ -779,7 +779,7 @@ class Client_prefs {
         $user->flags_set(($this->listen << 2), USER_FLAG_MAP_AUTH);
         fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
                 $user->flags);
-        if ($user->rec != FALSE && $user->rec->last_dona > 1356994800) {
+        if ($user->is_supp_custom()) {
             $user->rec->supp_comp = $this->supp_comp;
         }
         if ($is_save)
@@ -2231,7 +2231,7 @@ class Room
       $flags = $this->user[$i]->flags;
 
       // sql record exists AND last donate > 2013-01-01
-      if ($this->user[$i]->rec != FALSE && $this->user[$i]->rec->last_dona > 1356994800) {
+      if ($this->user[$i]->is_supp_custom()) {
           $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp);
       }
       else {
@@ -2279,7 +2279,7 @@ class Room
             $flags |= 1;
         
         log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
-        if ($user_cur->rec != FALSE && $user_cur->rec->last_dona > 1356994800)
+        if ($user_cur->is_supp_custom())
             $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp);
         else
             $supp_comp_s = '';
index 416dbb4..51956c8 100644 (file)
@@ -762,6 +762,21 @@ static function base_get()
     return $c::BASE;
 }
 
+function is_supp_custom()
+{
+    if ($this->rec != FALSE) {
+        if ($this->flags & USER_FLAG_TY_SUPER) {
+            return (TRUE);
+        }
+        /*
+          if ($this->rec->last_dona > 1356994800) {
+              return (TRUE);
+          }
+        */
+    }
+    return (FALSE);
+}
+
 } // end class User
 
 
index d7dc0df..008d85c 100644 (file)
@@ -525,7 +525,7 @@ class Bin5_user extends User {
         
         log_wr("Bin5 constructor");
         
-        $this->privflags  = ($CO_bin5_pref_ring_endauct == "true" ? BIN5_USER_FLAG_RING_ENDAUCT : 0) | 0;
+        $thiz->privflags  = ($CO_bin5_pref_ring_endauct == "true" ? BIN5_USER_FLAG_RING_ENDAUCT : 0) | 0;
 
         $thiz->table_orig = $table;
         $thiz->table      = 0;
index b5ed1e9..0b3076a 100644 (file)
@@ -1245,7 +1245,7 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 </table>
 </div>
 <?php
-if ($user->rec != FALSE && $user->rec->last_dona > 1356994800) {
+if ($user->is_supp_custom()) {
 ?>
 </td>
 <td style="vertical-align: top;">