function OpenTag($tag, $attr) { //Opening tag switch ($tag) { case 'SUP': if (!empty($attr['SUP'])) { //Set current font to 6pt $this->SetFont('', '', 6); //Start 125cm plus width of cell to the right of left margin //Superscript "1" $this->Cell(2, 2, $attr['SUP'], 0, 0, 'L'); } break; case 'TABLE': // TABLE-BEGIN if (!empty($attr['BORDER'])) { $this->tableborder = $attr['BORDER']; } else { $this->tableborder = 0; } break; case 'TR': //TR-BEGIN break; case 'TD': // TD-BEGIN if (!empty($attr['WIDTH'])) { $this->tdwidth = $attr['WIDTH'] / 4; } else { $this->tdwidth = 40; } // Set to your own width if you need bigger fixed cells if (!empty($attr['HEIGHT'])) { $this->tdheight = $attr['HEIGHT'] / 6; } else { $this->tdheight = 6; } // Set to your own height if you need bigger fixed cells if (!empty($attr['ALIGN'])) { $align = $attr['ALIGN']; if ($align == 'LEFT') { $this->tdalign = 'L'; } if ($align == 'CENTER') { $this->tdalign = 'C'; } if ($align == 'RIGHT') { $this->tdalign = 'R'; } } else { $this->tdalign = 'L'; } // Set to your own if (!empty($attr['BGCOLOR'])) { $coul = hex2dec($attr['BGCOLOR']); $this->SetFillColor($coul['R'], $coul['G'], $coul['B']); $this->tdbgcolor = true; } $this->tdbegin = true; break; case 'HR': if (!empty($attr['WIDTH'])) { $Width = $attr['WIDTH']; } else { $Width = $this->w - $this->lMargin - $this->rMargin; } $x = $this->GetX(); $y = $this->GetY(); $this->SetLineWidth(0.2); $this->Line($x, $y, $x + $Width, $y); $this->SetLineWidth(0.2); $this->Ln(1); break; case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['G'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist) && isset($attr['SIZE']) && $attr['SIZE'] != '') { $this->SetFont(strtolower($attr['FACE']), '', $attr['SIZE']); $this->issetfont = true; } break; } }
function editTag($e_ids, $a, $r) { logMe("editTag()\n"); foreach ($e_ids as $i => $e_id) { $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' } $entryDAO = FreshRSS_Factory::createEntryDao(); switch ($a) { case 'user/-/state/com.google/read': $entryDAO->markRead($e_ids, true); break; case 'user/-/state/com.google/starred': $entryDAO->markFavorite($e_ids, true); break; /*case 'user/-/state/com.google/tracking-kept-unread': break; case 'user/-/state/com.google/like': break; case 'user/-/state/com.google/broadcast': break;*/ } switch ($r) { case 'user/-/state/com.google/read': $entryDAO->markRead($e_ids, false); break; case 'user/-/state/com.google/starred': $entryDAO->markFavorite($e_ids, false); break; } echo 'OK'; exit; }
function OpenTag($tag, $attr) { // Opening tag switch ($tag) { case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'UL': break; case 'LI': $this->SetFont('Arial', '', 9); $this->Ln(1); $this->Write(4, "o "); $this->SetLeftMargin($this->lMargin + 5); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'TR': case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'H1': $this->Ln(5); $this->SetFont('Arial', 'B', 20); break; case 'H2': $this->Ln(5); $this->SetFont('Arial', 'B', 18); break; case 'H3': $this->Ln(5); $this->SetFont('Arial', 'B', 16); break; case 'H4': $this->Ln(5); $this->SetFont('Arial', 'B', 14); break; case 'H5': $this->Ln(5); $this->SetFont('Arial', 'B', 12); break; case 'H6': $this->Ln(5); $this->SetFont('Arial', 'B', 10); break; case 'H7': $this->Ln(5); $this->SetFont('Arial', 'B', 9); break; case 'P': $this->SetFont('Arial', '', 9); $this->Ln(3); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['V'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; } }
public function initialize($username, $userid, $s, $v, $A, $b) { $this->_Adec = hex2dec($A); if (strcmp(bcmod($this->_Adec, $this->_srp->Ndec()), '0') == 0) { throw new Exception('PROTOCOL_EXCEPTION'); } $this->_Ahex = $A; $this->_username = $username; $this->_userid = $userid; $this->_shex = $s; $this->_vhex = $v; $this->_vdec = hex2dec($v); $this->_bhex = $b; $this->_bdec = hex2dec($b); $this->_computeB(); $this->_computeK(); $this->setValue('SRP_shex', $this->_shex); $this->setValue('SRP_Ahex', $this->_Ahex); $this->setValue('SRP_Bhex', $this->_Bhex); $this->setValue('SRP_Khex', $this->_Khex); $this->setValue('SRP_I', $this->_username); $this->setValue('userid', $this->_userid); $this->_setState(SrpSession::INITIALIZED); }
function OpenTag($tag, $attr, $scale) { //Opening tag switch ($tag) { case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'P': $this->ALIGN = $attr['ALIGN']; break; case 'IMG': $this->IMG = $attr['IMG']; $this->SRC = $attr['SRC']; $this->WIDTH = $attr['WIDTH']; $this->HEIGHT = $attr['HEIGHT']; $this->PutImage($attr[SRC], $scale); break; case 'TR': case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'HR': if ($attr['WIDTH'] != '') { $Width = $attr['WIDTH']; } else { $Width = $this->w - $this->lMargin - $this->rMargin; } $this->Ln(2); $x = $this->GetX(); $y = $this->GetY(); $this->SetLineWidth(0.4); $this->Line($x, $y, $x + $Width, $y); $this->SetLineWidth(0.2); $this->Ln(2); break; case 'FONT': if (isset($attr['COLOR']) and $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['G'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) and in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; } }
/** * getSignature * Get the base64 signature of a dictionary * @param array Associative array (i.e. dictionary) of key-value pairs * @param string Hexadecimal string of public key * @param string Hexadecimal string the private key * @return string Base64 encoded signature */ function getSignature($dict, $key, $privKey) { // Sort keys alphabetically uksort($dict, "strcasecmp"); // Concatenate all values $total = ''; foreach ($dict as $value) { $total .= $value; } // Escape apostrophes by un-quoting, adding apos, then re-quoting // so this turns ' into '\'' ... we have to double-slash for this php. $fixedApostrophes = str_replace("'", "'\\''", $total); // This part is the most expensive below // We try to do it with native code first ob_start(); $passthruString = DOC_ROOT . "/includes/aquaticprime {$key} {$privKey} '{$fixedApostrophes}'"; //passthru($passthruString, $err); $sig = ob_get_contents(); ob_end_clean(); if (true) { // Get the hash $hash = sha1(utf8_encode($total)); // OpenSSL-compatible PKCS1 Padding // 128 bytes - 20 bytes hash - 3 bytes extra padding = 105 bytes '0xff' $paddedHash = '0001'; for ($i = 0; $i < 105; $i++) { $paddedHash .= 'ff'; } $paddedHash .= '00' . $hash; $decryptedSig = hex2dec($paddedHash); // Encrypt into a signature $sig = powmod($decryptedSig, hex2dec($privKey), hex2dec($key)); $sig = base64_encode(hex2bin(dec2hex($sig))); } return $sig; }
/** * getSignature * Get the base64 signature of a dictionary * @param array Associative array (i.e. dictionary) of key-value pairs * @param string Hexadecimal string of public key * @param string Hexadecimal string the private key * @return string Base64 encoded signature */ function getSignature($dict, $key, $privKey) { // Sort keys alphabetically uksort($dict, "strcasecmp"); // Concatenate all values $total = ''; foreach ($dict as $value) { $total .= $value; } // Escape apostrophes by un-quoting, adding apos, then re-quoting // so this turns ' into '\'' ... we have to double-slash for this php. // Switch to UTF8 before otherwise escapeshellarg will strip out non-ASCII characters $oldlocale = setlocale(LC_CTYPE, 0); setlocale(LC_CTYPE, "en_US.UTF-8"); $fixedApostrophes = escapeshellarg($total); // restore localte setlocale(LC_CTYPE, $oldlocale); // This part is the most expensive below // We try to do it with native code first $aquatic_root = preg_replace('!((/[A-Za-z._-]+)+)/AquaticPrime\\.php!', '$1', __FILE__); ob_start(); $passthruString = $aquatic_root . "/aquaticprime {$key} {$privKey} {$fixedApostrophes}"; passthru($passthruString, $err); $sig = ob_get_contents(); ob_end_clean(); if ($err) { error_log("passthrough yielded {$err}: {$passthruString}"); } // If that fails, do it in php if ($sig != "") { $sig = base64_encode($sig); } else { // Get the hash $hash = sha1(utf8_encode($total)); // OpenSSL-compatible PKCS1 Padding // 128 bytes - 20 bytes hash - 3 bytes extra padding = 105 bytes '0xff' $paddedHash = '0001'; for ($i = 0; $i < 105; $i++) { $paddedHash .= 'ff'; } $paddedHash .= '00' . $hash; $decryptedSig = hex2dec($paddedHash); // Encrypt into a signature $sig = powmod($decryptedSig, hex2dec($privKey), hex2dec($key)); $sig = base64_encode(ap_hex2bin(dec2hex($sig))); } return $sig; }
function OpenTag($tag, $attr) { //Opening tag switch ($tag) { case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) and (isset($attr['WIDTH']) or isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'TR': case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) and $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['G'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) and in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; case 'HR': if (isset($attr['WIDTH']) && $attr['WIDTH'] != '') { $Width = $attr['WIDTH']; } else { $Width = $this->w - $this->lMargin - $this->rMargin; } $x = $this->GetX(); $y = $this->GetY(); $this->SetDrawColor(200, 200, 200); $this->SetLineWidth(0.5); $this->Line($x + 5, $y + 5, $x + $Width, $y + 5); $this->SetDrawColor(0, 0, 0); $this->Ln(8); break; case 'H2': $this->SetFont('Arial', 'B', 18); break; } }
function get_global($date, $djia, $debug = false) { $md5 = md5($date . "-" . $djia); list($lat, $lon) = str_split($md5, 16); $latlon = array(hex2dec($lat), hex2dec($lon)); if ($debug) { echo "<pre>local:\n" . print_r($latlon, true) . "</pre>\n"; } $latlon[0] = $latlon[0] * 180 - 90; $latlon[1] = $latlon[1] * 360 - 180; if ($debug) { echo "<pre>global:\n" . print_r($latlon, true) . "</pre>\n"; } return $latlon; }
/** * getSignature * Get the base64 signature of a dictionary * @param array Associative array (i.e. dictionary) of key-value pairs * @param string Hexadecimal string of public key * @param string Hexadecimal string the private key * @return string Base64 encoded signature */ function getSignature($dict, $key, $privKey) { // Sort keys alphabetically uksort($dict, "strcasecmp"); // Concatenate all values $total = ''; foreach ($dict as $value) { $total .= $value; } // Get the hash $hash = sha1(utf8_encode($total)); // OpenSSL-compatible PKCS1 Padding // 128 bytes - 20 bytes hash - 3 bytes extra padding = 105 bytes '0xff' $paddedHash = '0001'; for ($i = 0; $i < 105; $i++) { $paddedHash .= 'ff'; } $paddedHash .= '00' . $hash; $decryptedSig = hex2dec($paddedHash); // Encrypt into a signature $sig = powmod($decryptedSig, hex2dec($privKey), hex2dec($key)); $sig = base64_encode(hex2bin(dec2hex($sig))); return $sig; }
function computverifier($srp, $user, $pwd, $salt) { // private key $innerHash = $srp->hashHex(strToHex($user) . '3a' . strToHex($pwd)); $privateKey = $srp->hashHex($salt . $innerHash); // verifier $tmp = dec2hex(bcpowmod($srp->gdec(), hex2dec($privateKey), $srp->Ndec())); $verifier = str_pad($tmp, strlen($srp->Nhex()), "0", STR_PAD_LEFT); return $verifier; }
function mac2dec($mac) { $mac = str_replace(':', '', $mac); $mac = str_replace('-', '', $mac); $mac = str_replace('.', '', $mac); return hex2dec(strtoupper($mac)); }
for ($i = 0; $i < $unkn_len - 1; $i++) { for ($j = $i + 1; $j < $unkn_len; $j++) { if ($pins[$i] == $pins[$j] || $pins[$i] == $pin) { continue; } $k = (hexdec(substr($unkn[$pins[$i]], 6, 6)) - hexdec(substr($unkn[$pins[$j]], 6, 6))) / ((int) ($pins[$i] / 10) - (int) ($pins[$j] / 10)); if ($k == 0) { continue; } if ($k == (hexdec(substr($bss, 6, 6)) - hexdec(substr($unkn[$pins[$i]], 6, 6))) / ((int) ($pin / 10) - (int) ($pins[$i] / 10))) { $found = TRUE; $plus_score = 1.0 / sqrt(abs(hexdec(substr($bss, 6, 6)) - hexdec(substr($bssid, 6, 6))) + 1); $plus_score += 1.0 / sqrt(abs(hexdec(substr($unkn[$pins[$i]], 6, 6)) - hexdec(substr($bssid, 6, 6))) + 1); $plus_score += 1.0 / sqrt(abs(hexdec(substr($unkn[$pins[$j]], 6, 6)) - hexdec(substr($bssid, 6, 6))) + 1); $total_score += $plus_score; $algos[] = array('generator' => new WpsGenLinear($k, bcsub(hex2dec($bss), bcmul((int) ($pin / 10), $k))), 'score' => $plus_score); unset($unkn[$pins[$i]]); unset($unkn[$pins[$j]]); break 2; } } } if (!$found) { $unkn[$pin] = $bss; } } else { $unkn[$pin] = $bss; } } } }
/** * OpenTag * öffnet einen HTML Tag in der PDF Klasse * @param string $tag * @param array $attr */ function OpenTag($tag, $attr) { //Start Tag //diverse Anpassungen an Kunden Bedürfnisse switch ($tag) { case 'SUP': if (!empty($attr['SUP'])) { //Set current font to 6pt $this->SetFont('', '', 6); //Start 125cm plus width of cell to the right of left margin //Superscript "1" $this->Cell(2, 2, $attr['SUP'], 0, 0, 'L'); } break; case 'TABLE': // TABLE-BEGIN $this->iTAB++; $this->iTR = 0; if (!empty($attr['BORDER'])) { $this->tableborder = $attr['BORDER']; } else { $this->tableborder = 'B'; } break; case 'TR': //TR-BEGIN $this->iTR++; $this->iTD = 0; break; case 'TH': case 'TD': // TD-BEGIN $this->iTD++; /*if( !empty($attr['WIDTH']) ) $this->tdwidth=($attr['WIDTH']/4); else $this->setTDdim( 'WIDTH' ); if( !empty($attr['HEIGHT']) ) $this->tdheight=($attr['HEIGHT']/6); else $this->setTDdim( 'HEIGHT' );*/ $this->setTDdim('WIDTH'); $this->setTDdim('HEIGHT'); if (!empty($attr['ALIGN'])) { $align = $attr['ALIGN']; if ($align == 'LEFT') { $this->tdalign = 'L'; } if ($align == 'CENTER') { $this->tdalign = 'C'; } if ($align == 'RIGHT') { $this->tdalign = 'R'; } } else { $this->tdalign = 'L'; } // Set to your own if (!empty($attr['BGCOLOR'])) { $coul = hex2dec($attr['BGCOLOR']); $this->SetFillColor($coul['R'], $coul['G'], $coul['B']); $this->tdbgcolor = true; } $this->tdbegin = true; break; case 'HR': if (!empty($attr['WIDTH'])) { //$axt=1; $Width = $attr['WIDTH']; } else { $Width = $this->w - $this->lMargin - $this->rMargin; } $x = $this->GetX(); $y = $this->GetY(); $this->SetLineWidth(0.2); $this->Line($x, $y, $x + $Width, $y); $this->SetLineWidth(0.2); $this->Ln(1); break; case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC'])) { if (!isset($attr['WIDTH'])) { if ($this->firstPic == 1) { $attr['WIDTH'] = 540; $this->firstPic = 0; } else { $attr['WIDTH'] = 0; } } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['G'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist) && isset($attr['SIZE']) && $attr['SIZE'] != '') { $this->SetFont(strtolower($attr['FACE']), '', $attr['SIZE']); $this->issetfont = true; } break; } }
function OpenTag($tag, $attr) { //Opening tag switch ($tag) { case 'STRONG': case 'B': if ($this->bi) { $this->SetStyle('B', true); } else { $this->SetStyle('U', true); } break; case 'H1': $this->Ln(5); $this->SetTextColor(150, 0, 0); $this->SetFontSize(22); break; case 'H2': $this->Ln(5); $this->SetFontSize(18); $this->SetStyle('U', true); break; case 'H3': $this->Ln(5); $this->SetFontSize(16); $this->SetStyle('U', true); break; case 'H4': $this->Ln(5); $this->SetTextColor(102, 0, 0); $this->SetFontSize(14); if ($this->bi) { $this->SetStyle('B', true); } break; case 'PRE': $this->SetFont('Courier', '', 11); $this->SetFontSize(11); $this->SetStyle('B', false); $this->SetStyle('I', false); $this->PRE = true; break; case 'RED': $this->SetTextColor(255, 0, 0); break; case 'BLOCKQUOTE': $this->mySetTextColor(100, 0, 45); $this->Ln(3); break; case 'BLUE': $this->SetTextColor(0, 0, 255); break; case 'I': case 'EM': if ($this->bi) { $this->SetStyle('I', true); } break; case 'U': $this->SetStyle('U', true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); $this->Ln(3); } break; case 'LI': $this->Ln(2); $this->SetTextColor(190, 0, 0); $this->Write(5, ' » '); $this->mySetTextColor(-1); break; case 'TR': $this->Ln(7); $this->PutLine(); break; case 'BR': $this->Ln(4); break; case 'P': $this->Ln(10); $this->SetLeftMargin(60); break; case 'HR': $this->PutLine(); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->mySetTextColor($coul['R'], $coul['G'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; } }
function OpenTag($tag, $attr) { //Balise ouvrante switch ($tag) { case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'TH': $this->TH = 'TH'; // $this->lMargin += 5; // $this->SetXY(5, $this->tMargin); break; // $this->Cell(50,6,$e,1,1,'L'); // break; // $this->Cell(50,6,$e,1,1,'L'); // break; case 'TD': $this->TD = 'TD'; break; case 'TR': // $y = $this->getY(); // $this->setY($y+5); // $this->setX(10); $this->Ln(5); // $this->SetXY($this->lMargin, $this->tMargin); break; case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['V'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; } }
function OpenTag($tag, $attr) { //Opening tag switch ($tag) { case 'STRONG': $this->SetStyle('B', true); break; case 'EM': $this->SetStyle('I', true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag, true); break; case 'A': $this->HREF = $attr['HREF']; break; case 'IMG': if (isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if (!isset($attr['WIDTH'])) { $attr['WIDTH'] = 0; } if (!isset($attr['HEIGHT'])) { $attr['HEIGHT'] = 0; } $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'TR': case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR'] != '') { $coul = hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'], $coul['V'], $coul['B']); $this->issetcolor = true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont = true; } break; } }
function optinrev_popup_css($is_view = NULL) { $optin = optinrev_get('optinrevolution/optin1'); if (empty($optin)) { return false; } $dir = OPTINREV_DIR; if ($optin) { $optin = unserialize($optin); } else { //load default $optin = array('optinrev_round_border' => '', 'optinrev_wbg_color' => '#FFFFFF', 'optinrev_wbg_opacity' => 0, 'optinrev_border_opacity' => 0, 'optinrev_pwbg_color' => '#FFFFFF', 'optinrev_border_color' => '#000000', 'optinrev_border_radius' => 0, 'optinrev_border_thickness' => 1, 'optinrev_top_margin' => 50, 'optinrev_wwidth' => 700, 'optinrev_hheight' => 400, 'optinrev_delay' => 0, 'optinrev_close_popup_image' => 'close1', 'optinrev_close_button' => 'top:230px;right:230px;', 'optinrev_link_color' => '#1122CC', 'optinrev_link_underline' => ''); } $pdim = array('width' => $optin['optinrev_wwidth'], 'height' => $optin['optinrev_hheight']); //dynamic close button $ww = $pdim['width']; $wh = $pdim['height']; $bw = $optin['optinrev_border_thickness']; //goto website button $loc = isset($optin['optinrev_gotowebsite']) && $optin['optinrev_gotowebsite'] == 'bottom' ? $wh - 56 : 20; $close_btn = array('close1' => array($ww - 30 / 2 + $bw, -(30 / 2) - $bw), 'close2' => array($ww - 45 / 2 + $bw, -(45 / 2) - $bw), 'close3' => array($ww - 60 / 2 + $bw, -(60 / 2) - $bw), 'close4' => array($ww - 30 / 2 + $bw, -(30 / 2) - $bw), 'close5' => array($ww - 45 / 2 + $bw, -(45 / 2) - $bw), 'close6' => array($ww - 60 / 2 + $bw, -(60 / 2) - $bw), 'close7' => array($ww - 272, $loc), 'close8' => array($ww - 272, $loc)); $lpos = $close_btn[$optin['optinrev_close_popup_image']]; $close_btn = 'left:' . $lpos[0] . 'px;top:' . $lpos[1] . 'px;'; $top_margin = !$is_view ? 'margin-top:45px !important;' : ''; $li_padding = $is_view ? 'line-height: 35px !important;' : ''; //IE only $border_color = optinrev_is_ie() ? $optin['optinrev_border_color'] : 'rgba(' . implode(',', hex2dec($optin['optinrev_border_color'])) . ',' . $optin['optinrev_border_opacity'] / 100 . ')'; $htc = optinrev_is_ie() ? 'behavior: url(' . $dir . 'css/PIE.php);' : ''; $unrem_css = ' img.wotimg {border: 1px dashed #888 !important;} .mceImageDrag {padding:0px !important;position:absolute;z-index:9999;} #close {position:absolute;z-index:1001;text-decoration:none;border: 1px solid transparent;} .mceImageSelect {position:relative;padding:0px !important;border: 1px dashed #888 !important;} .mceWotlayer {border: 1px dashed #888 !important;z-index:999;padding:0px !important;margin:0px !important;} '; if ($is_view) { $unrem_css = ''; } $view_cleaned = ' #zindex {position:absolute;width:50px;padding:0px;font-size:9px;font-weight:normal;background-color:#f0f0f0;color:#404040;padding:2px} #imglabel {position:absolute;left:0px;bottom:0px;padding:0px;font-size:9px;font-weight:normal;background-color:red;color:#ffffff;padding:0px 2px 0px 2px;} #mceWotmove {position:absolute;right:-1px;bottom:-1px;width:14px;height:14px; background: url(' . $dir . 'images/cursor_drag_arrow.png) no-repeat center center;cursor:move;background-color:#fff;z-index:99999;} #mceDeleteObj {position:absolute;left:-1px;top:-12px;width:12px;height:12px; background: url(' . $dir . 'images/delete-ic.png) no-repeat center center;cursor:pointer;background-color:#fff;z-index:99999;} '; if ($is_view) { $view_cleaned = ''; } //is rounded border $optin['optinrev_border_radius'] = $optin['optinrev_round_border'] == 'on' ? $optin['optinrev_border_radius'] : '0'; $form_css = $is_view ? isset($optin['optinrev_email_form_css']) ? stripcslashes($optin['optinrev_email_form_css']) : '' : ''; $wm_hand = $is_view ? '#simplemodal-container #wm {cursor:pointer;}' : ''; $pwd_color = !$is_view ? 'black' : getContrast50($optin['optinrev_wbg_color']); $cursor = optinrev_is_ie() ? 'cursor:crosshair;' : 'cursor: se-resize;'; //resizable $resizable = ' .ui-icon { width: 18px; height: 18px; background-image: url(' . $dir . 'images/hgrip.png); } .ui-icon-gripsmall-diagonal-se { background-repeat: no-repeat; background-position: left top;} .ui-icon-gripsmall-diagonal-se:hover { background-repeat: no-repeat; background-position: left -18px;} .ui-resizable-handle { position: absolute;font-size: 0.1px; z-index: 99999; display: block; ' . $cursor . '} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-se { ' . $cursor . ' width: 18px; height: 18px; right: -8px;bottom: -8px;} '; if ($is_view) { $resizable = ''; } $lnk_under = 'none'; if (isset($optin['optinrev_link_underline'])) { $lnk_under = $optin['optinrev_link_underline'] == 'on' ? 'underline' : 'none'; } $lnk_color = isset($optin['optinrev_link_color']) ? $optin['optinrev_link_color'] : ''; $mcebody = !$is_view ? '#tinymce {overflow:hidden !important;} #tinymce a:link, #tinymce a:visited, #tinymce a:hover, #tinymce a:active {color:' . $lnk_color . ';text-decoration:' . $lnk_under . ';}' : ''; //Close button $active_close_button = '#simplemodal-container .close1 {background:url(' . $dir . 'images/close1b.png) no-repeat; width:39px; height:39px;' . $close_btn . 'display:inline; z-index:3200; position:absolute;cursor:pointer;text-decoration:none;}'; //init btn $popbtn = array('close1' => array('39px', 'close1b'), 'close2' => array('52px', 'close2b'), 'close3' => array('62px', 'close3b'), 'close4' => array('39px', 'close1r'), 'close5' => array('52px', 'close2r'), 'close6' => array('62px', 'close3r'), 'close7' => array('263px', 'btn1'), 'close8' => array('263px', 'btn2')); if ($is_view) { if (isset($optin['optinrev_close_popup_image']) && ($sbtn = $optin['optinrev_close_popup_image'])) { if (in_array($sbtn, array_keys($popbtn))) { $pbtn = $popbtn[$sbtn]; $w = $pbtn[0]; $h = $sbtn == 'close7' || $sbtn == 'close8' ? '47px' : $pbtn[0]; $active_close_button = sprintf('#simplemodal-container .%s {background:url(%simages/%s.png) no-repeat; width:%s; height:%s;' . $close_btn . 'display:inline; z-index:3200; position:absolute;cursor:pointer;text-decoration:none;}', $sbtn, $dir, $pbtn[1], $w, $h); } } } else { foreach ($popbtn as $sbtn => $v) { $pbtn = $popbtn[$sbtn]; $w = $pbtn[0]; $h = $sbtn == 'close7' || $sbtn == 'close8' ? '47px' : $pbtn[0]; $active_close_button .= sprintf('#simplemodal-container .%s {background:url(%simages/%s.png) no-repeat; width:%s; height:%s;' . $close_btn . 'display:inline; z-index:3200; position:absolute;cursor:pointer;text-decoration:none;}', $sbtn, $dir, $pbtn[1], $w, $h); } } $line_height = optinrev_is_ie() ? '130%' : '110%'; $round_border = optinrev_is_ie() && optinrev_ie_version() < 9 ? 'border-radius: ' . $optin['optinrev_border_radius'] . 'px;' : '-moz-border-radius: ' . $optin['optinrev_border_radius'] . 'px;-webkit-border-radius: ' . $optin['optinrev_border_radius'] . 'px;border-radius: ' . $optin['optinrev_border_radius'] . 'px;-khtml-border-radius:' . $optin['optinrev_border_radius'] . 'px;'; //Wait box $wait_box = 'background-color: #81FF21;color:#000000;font-size:12px !important;border: 1px solid #000000;font-style: normal !important;padding: 6px 10px 6px 10px !important;'; header('Content-Type: text/css; charset=utf-8'); header("cache-control: must-revalidate"); $offset = 60 * 7200; $expire = "expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; header($expire); $modal = <<<LOAD_CSS #simplemodal-overlay {background-color:{$optin['optinrev_wbg_color']} !important;z-index: 9999 !important;} #simplemodal-container {box-sizing: content-box !important;-moz-box-sizing: content-box !important;-webkit-box-sizing: content-box !important;} #simplemodal-container {position:fixed;{$top_margin}height:{$pdim['height']}px;width:{$pdim['width']}px;background-color:{$optin['optinrev_pwbg_color']};border:{$optin['optinrev_border_thickness']}px solid {$border_color};{$round_border}{$htc}z-index:9999 !important;text-shadow: none !important;} #simplemodal-container img {padding:0px;border:none;-webkit-appearance: none;-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;} #simplemodal-container .simplemodal-data a:link, #simplemodal-container .simplemodal-data a:visited, #simplemodal-container .simplemodal-data a:hover #simplemodal-container .simplemodal-data a:active {color:{$lnk_color};text-decoration:{$lnk_under};} #simplemodal-container .simplemodal-data span {line-height:{$line_height};margin:0px;padding:0px;} #simplemodal-container .simplemodal-data ol, #simplemodal-container .simplemodal-data ul {padding:0px;margin:0px;} #simplemodal-container .simplemodal-data ol li {list-style: decimal inside !important;{$li_padding}} #simplemodal-container .simplemodal-data ul li {list-style: disc inside !important;{$li_padding}} #simplemodal-container .simplemodal-data {font-family: arial !important;font-size: 12px;} #simplemodal-container .simplemodal-data input[type="text"]{text-transform:none !important;} {$active_close_button} {$unrem_css} {$wm_hand} {$view_cleaned} {$resizable} {$mcebody} #simplemodal-container #wm {cursor:pointer;border: none !important;text-decoration:none !important;} #waitbox {position:absolute;left:4px;top:4px;{$wait_box}z-index:99999;} .wp_themeSkin .mceButtonDisabled .mceIcon {opacity:0.5 !important; filter:alpha(opacity=50) !important;} #no_thanks_btn {cursor:pointer;display:none;position:absolute;width: 263px; height: 47px;background: url({$dir}images/no-thanks.png) no-repeat left top;z-index:999999;} #poweredby {position:absolute;color: {$pwd_color} !important;text-decoration:none !important;z-index: 9999} #poweredby a {cursor:pointer;color: {$pwd_color} !important;text-decoration:none !important;} #poweredby a:hover {text-decoration:underline;} LOAD_CSS; echo optinrev_cssminify($modal); }