Exemplo n.º 1
0
 public static function icon($email, $size = 24, $rating = 'PG', $type = null)
 {
     if ($type == null) {
         $type = self::$gravType;
     }
     $gHash = md5(strtolower(trim($email)));
     $tPath = Cfg::get('tmp_path');
     $fName = 'GRAV' . $size . $type . $gHash . '.png';
     $fPath = $tPath . '/' . $fName;
     // Locally Caches the gavatar image
     if (!file_exists($fPath)) {
         copy(sprintf(self::ICO, self::$URL, $gHash, $size, $rating, $type), $fPath);
         if (!file_exists($fPath)) {
             return Tag::img(sprintf(self::ICO, self::$URL, $gHash, $size, $rating, $type));
         }
     }
     return Tag::img(Cfg::get('site_url') . '/' . basename($tPath) . '/' . $fName);
 }
Exemplo n.º 2
0
    protected function zoom()
    {
        $siteUrl = Cfg::siteUrl();
        $html = '';
        $html .= JS::library(JS::JQUERY);
        // Get the current Pin
        $url = Request::get('url');
        $jQuery = <<<JS
    var currentXPos = 0;
    var currentYPos = 0;
    var IE = document.all?true:false
    if (!IE) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = getMouseXY;
    function getMouseXY(e) {
        if (IE) { // grab the x-y pos.s if browser is IE
            currentXPos = event.clientX + document.body.scrollLeft;
            currentYPos = event.clientY + document.body.scrollTop;
        } else {  // grab the x-y pos.s if browser is NS
            currentXPos = e.pageX;
            currentYPos = e.pageY;
        }
        if (currentXPos < 0) currentXPos = 0;
        if (currentYPos < 0) currentYPos = 0;
        return true;
    }
    function movePinToCursor () {
       var offs = \$('#baseImage').offset();
       \$('#PinTop').attr ( 'value', '' + parseInt ( currentYPos - offs.top ) );
       \$('#PinLeft').attr ( 'value', '' + parseInt ( currentXPos - offs.left ) );
    }
JS;
        $html .= JS::javaScript($jQuery);
        $html .= Tag::img($siteUrl . $url, ['title' => 'Click on this image to move the Pin', 'id' => 'baseImage', 'onClick' => 'movePinToCursor();', 'name' => 'voodoo_image']);
        $html .= '<br>X' . Tag::text('PinLeft', '', ['size' => 4, 'id' => 'PinLeft']);
        $html .= '<br>Y' . Tag::text('PinTop', '', ['size' => 4, 'id' => 'PinTop']);
        return $html;
    }
Exemplo n.º 3
0
 public function newRegistration()
 {
     // Initialise the $msg and $action and $disclaimer variables
     $disclaimer = Cfg::get('disclaimer');
     $formName = 'FancyLogin_newRegistration';
     $valid = Validator::factory($formName, 'NR')->addExists('fldEmail', 'Email field is empty. Please insert valid email and resubmit')->addEmail('fldEmail', 'Email needs to exist and be correct format')->addExists('fldFirstName', 'First Name must exist')->addExists('fldCaptcha', 'You must enter Captcha Code')->addExists('fldLastName', 'Last Name must exist');
     $cap = new Captcha();
     $html = $valid->toHtml() . Tag::form(['id' => $formName, 'name' => $formName, 'onSubmit' => $valid->onSubmit()]) . Response::factory()->set(self::ACTION, __CLASS__ . '->signUp()')->set('_CAP', $cap->getValue())->toHidden() . Tag::table(['align' => 'center', 'border' => 0, 'cellspacing' => 0, 'cellpadding' => 2]) . Tag::tr() . Tag::td() . 'Email:' . Tag::_td() . Tag::td() . Tag::text('fldEmail', Request::get('fldEmail')) . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td() . 'First&nbsp;Name:' . Tag::_td() . Tag::td() . Tag::text('fldFirstName', Request::get('fldFirstName')) . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td() . 'Last&nbsp;Name:' . Tag::_td() . Tag::td() . Tag::text('fldLastName', Request::get('fldLastName')) . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td() . Tag::img($cap->imageUrl()) . Tag::_td() . Tag::td() . Tag::text('fldCaptcha') . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td(['colspan' => 2, 'nowrap' => 'nowrap', 'valign' => 'top']) . 'Please Read Disclaimer:' . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td(['colspan' => 2]) . Tag::hTag('iframe', ['src' => $disclaimer, 'width' => '100%']) . Tag::_hTag('iframe') . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td(['colspan' => 2, 'align' => 'center']) . 'By clicking below, you are stating that you understand and agree to the Disclamer above' . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td(['colspan' => 2, 'align' => 'center']) . Tag::submit('New Account') . Tag::_td() . Tag::_tr() . Tag::_table() . Tag::_form();
     return $html;
 }