示例#1
0
 public function testAdd()
 {
     $fg = new FlagHelper('_flag1:1024__flag2:0_');
     $fg->add('flag3', 'Test');
     $this->assertTrue($fg->exists('flag3'));
     $this->assertEquals('Test', $fg->value('flag3'));
     $this->assertEquals('_flag1:1024__flag2:0__flag3:Test_', $fg->toString());
 }
示例#2
0
 function autoHookRegistBeforeCommit(&$name, &$email, &$sub, &$com, &$category, &$age, $dest, $isReply, $imgWH, &$status)
 {
     global $PIO;
     $fh = new FlagHelper($status);
     $size = @getimagesize($dest);
     if (isset($_POST['anigif']) && $size[2] == 1) {
         // 動態GIF
         $fh->toggle('agif');
         $status = $fh->toString();
     }
     if ($isReply) {
         $rpost = $PIO->fetchPosts($isReply);
         // 強制sage
         $rfh = new FlagHelper($rpost[0]['status']);
         if ($rfh->value('asage')) {
             $age = false;
         }
     }
 }