Пример #1
0
 public function contactimageAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     header('PRAGMA: NO-CACHE');
     header('CACHE-CONTROL: NO-CACHE');
     header('Content-type: image/png');
     ob_start();
     $text = new textPNG();
     $id = $this->_getParam("id");
     $pseudoid = $this->_getParam("pseudoid");
     $msg = "";
     if (is_numeric($id)) {
         $r = new Repository_Model_MetaContacts();
         $r->filter->id->equals($id);
         if (count($r->items) > 0) {
             $msg = $r->items[0]->email;
         }
     } else {
         if (trim($pseudoid) !== "" && preg_match("/^[0-9a-zA-Z]+\$/", $pseudoid) > 0) {
             $r = new Repository_Model_VMetaProductRepoAreaContacts();
             $r->filter->id->equals($pseudoid);
             if (count($r->items) > 0) {
                 $msg = $r->items[0]->email;
             }
         } else {
             $msg = $id;
         }
     }
     $this->view->text = $text;
     $text->msg = $msg;
     $text->size = '9';
     ob_end_clean();
     $text->draw();
 }
Пример #2
0
 public function sitecontactAction()
 {
     header('PRAGMA: NO-CACHE');
     header('CACHE-CONTROL: NO-CACHE');
     header('Content-type: image/png');
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $text = new textPNG();
     $c = new Default_Model_Sites();
     $c->filter->id->equals($this->_getParam("id"));
     if (count($c->items) > 0) {
         $field = $this->_getParam("type") . "email";
         $text->msg = $c->items[0]->{$field};
     } else {
         $text->msg = "n\\a";
     }
     $text->size = '9';
     $text->draw();
 }
Пример #3
0
            }
        }
        $image = imagecreate($width + $this->pad * 2 + 1, $height + $this->pad * 2 + 1);
        $background = ImageColorAllocate($image, $this->bg_red, $this->bg_grn, $this->bg_blu);
        $foreground = ImageColorAllocate($image, $this->red, $this->grn, $this->blu);
        if ($this->transparent) {
            ImageColorTransparent($image, $background);
        }
        ImageInterlace($image, false);
        // render the image
        ImageTTFText($image, $this->size, $this->rot, $offset_x + $this->pad, $offset_y + $this->pad, $foreground, $this->font, $this->msg);
        // output PNG object.
        imagePNG($image);
    }
}
$text = new textPNG();
if (isset($msg)) {
    $text->msg = $msg;
}
// text
if (isset($font)) {
    $text->font = $font;
}
// font
if (isset($size)) {
    $text->size = $size;
}
// size
if (isset($rot)) {
    $text->rot = $rot;
}