public function filter($text) { if (Options::get('typogrify__do_amp')) { $text = amp($text); } if (Options::get('typogrify__do_widont')) { $text = widont($text); } if (Options::get('typogrify__do_smartypants')) { // Standard options plus convert_quot ('w') to // convert " entities, that Habari might // already have converted '"' characters into. $text = SmartyPants($text, "qbdew"); } if (Options::get('typogrify__do_caps')) { $text = caps($text); } if (Options::get('typogrify__do_initial_quotes')) { $text = initial_quotes($text); } if (Options::get('typogrify__do_guillemets')) { $text = initial_quotes($text, true); } if (Options::get('typogrify__do_dash')) { $text = dash($text); } return $text; }
public function ampFilter($str) { $charset = craft()->templates->getTwig()->getCharset(); $str = amp($str); return new \Twig_Markup($str, $charset); }
private static function get_client_xml(fs_client $client) { $ret = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><client />'); $ret->addChild('name', amp($client->fields['name'])); $ret->addChild('details', amp($client->fields['address'])); return $ret; }
private static function get_client_xml(fs_client $client) { $ret = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><company />'); $ret->addChild('name', amp($client->fields['name'])); $cd = $ret->addChild('contact-data'); $addrs = $cd->addChild('addresses'); $addr = $addrs->addChild('address'); $addr->addChild('location', 'Work'); foreach (highrise::address_to_fields($client->fields['address']) as $k => $i) { $addr->addChild($k, amp($i)); } return $ret; }
/** 스킨에서 지정되는 url_key 값들을 이용해 link_key 값들을 만들어 내는 함수 * @class io.skin * @param $arr: 배열 자료 */ function urlToLink(&$arr) { global $mini; foreach ($arr as $key => $val) { if (preg_match("/^url_/i", $key)) { if (preg_match("/_del\$/i", $key)) { $msg = '삭제하시겠습니까?'; if (preg_match("/cmt\\.x\\.php/i", $val)) { $msg = '선택한 댓글을 지우시겠습니까?' . (!empty($mini['member']['level_admin']) ? "\\\\n(답변 댓글이 달려있으면 같이 지워집니다)" : ''); } if (preg_match("/write\\.x\\.php/i", $val)) { $msg = '선택한 글을 지우시겠습니까?'; } str($msg, 'encode'); if (!isset($arr["link_" . str_replace("url_", "", $key)])) { $arr["link_" . str_replace("url_", "", $key)] = $val ? "href='{$val}' onclick='return confirm(\"{$msg}\");'" : "href='#' onclick='return false;'"; } if (!isset($arr["js_" . str_replace("url_", "", $key)])) { $arr["js_" . str_replace("url_", "", $key)] = $val ? "onclick='if (confirm(\"{$msg}\")) document.location.href=\"{$val}\";'" : "disabled='disabled'"; } } else { if (!isset($arr["link_" . str_replace("url_", "", $key)])) { $arr["link_" . str_replace("url_", "", $key)] = $val ? "href='{$val}'" : "href='#' onclick='return false;'"; } if (!isset($arr["js_" . str_replace("url_", "", $key)])) { $arr["js_" . str_replace("url_", "", $key)] = $val ? "onclick='document.location.href=\"{$val}\";'" : "disabled='disabled'"; } } $arr["url2_" . str_replace("url_", "", $key)] = amp($val, 'encode'); } if (preg_match("/^pop_/i", $key)) { $arr["js_{$key}"] = $val ? "onclick='{$val}'" : ""; } } }
/** * typogrify * * The super typography filter. * Applies the following filters: widont, smartypants, caps, amp, initial_quotes * Optionally choose to apply quote span tags to Gullemets as well. */ function typogrify($text, $do_guillemets = false) { $text = amp($text); $text = widont($text); $text = SmartyPants($text); $text = caps($text); $text = initial_quotes($text, $do_guillemets); $text = dash($text); return $text; }
<?php //amp sets in func.php $amp = amp(); $cdrdb = new mysqli('localhost', $amp['AMPDBUSER'], $amp['AMPDBPASS'], "asteriskcdrdb"); if ($cdrdb->connect_errno) { printf("Не удалось подключиться: %s\n", $cdrdb->connect_error); exit; } $asteriskdb = new mysqli('localhost', $amp['AMPDBUSER'], $amp['AMPDBPASS'], "asterisk"); if ($asteriskdb->connect_errno) { printf("Не удалось подключиться: %s\n", $asteriskdb->connect_error); exit; }