query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
/ XSS Clean: Nasty HTML / Remove script tags from HTML (well, best shot anyway)
function xss_html_clean( $html ) { //----------------------------------------- // Opening script tags... // Check for spaces and new lines... //----------------------------------------- $html = preg_replace( "#<(\s+?)?s(\s+?)?c(\s+?)?r(\s+?)?i(\s+?)?p(\s+?)?t#is" , "&lt;script" , $html ); $html = preg_replace( "#<(\s+?)?/(\s+?)?s(\s+?)?c(\s+?)?r(\s+?)?i(\s+?)?p(\s+?)?t#is", "&lt;/script", $html ); //----------------------------------------- // Basics... //----------------------------------------- $html = preg_replace( "/javascript/i" , "j&#097;v&#097;script", $html ); $html = preg_replace( "/alert/i" , "&#097;lert" , $html ); $html = preg_replace( "/about:/i" , "&#097;bout:" , $html ); $html = preg_replace( "/onmouseover/i", "&#111;nmouseover" , $html ); $html = preg_replace( "/onclick/i" , "&#111;nclick" , $html ); $html = preg_replace( "/onload/i" , "&#111;nload" , $html ); $html = preg_replace( "/onsubmit/i" , "&#111;nsubmit" , $html ); $html = preg_replace( "/<body/i" , "&lt;body" , $html ); $html = preg_replace( "/<html/i" , "&lt;html" , $html ); $html = preg_replace( "/document\./i" , "&#100;ocument." , $html ); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}", "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "function stripHTMLTags( $content ) {\r\n \r\n $search = array (\"'<script[^>]*?>.*?</script>'si\", // Strip out javascript\r\n \"'<\\s*br\\s*(\\/)?>'i\", // Replace brs to spaces\r\n \"'<[\\/\\!]*?[^<>]*?>'si\", // Strip out html tags\r\n \"'([\\r\\n])[\\s]+'\", // Strip out white space\r\n \"'&(quot|#34);'i\", // Replace html entities\r\n \"'&(amp|#38);'i\",\r\n \"'&(lt|#60);'i\",\r\n \"'&(gt|#62);'i\",\r\n \"'&(nbsp|#160);'i\",\r\n \"'&(iexcl|#161);'i\",\r\n \"'&(cent|#162);'i\",\r\n \"'&(pound|#163);'i\",\r\n \"'&(copy|#169);'i\",\r\n \"'&#(\\d+);'\");\r\n \r\n $replace = array (\"\",\r\n \" \",\r\n \"\",\r\n \"\\\\1\",\r\n \"\\\"\",\r\n \"&\",\r\n \"<\",\r\n \">\",\r\n \" \",\r\n chr(161),\r\n chr(162),\r\n chr(163),\r\n chr(169),\r\n \"chr(\\\\1)\");\r\n \r\n $content = preg_replace ($search, $replace, $content);\r\n \r\n return $content;\r\n}", "function anti_xss($text){\n\t\t$a = array( \n\t\t\t'@< [/!]*?[^<>]*?>@si',\n\t\t\t'@< ![sS]*?--[ tnr]*>@',\n\t\t\t'/(?i)\\<script\\>(.*?)\\<\\/script\\>/i',\n\t\t\t'/(?i)\\<script (.*?)\\>(.*?)\\<\\/script>/i',\n\t\t\t'/(?i)\\<style\\>(.*?)\\<\\/style\\>/i',\n\t\t\t'/(?i)\\<style (.*?)\\>(.*?)\\<\\/style>/i'\n\t ); \n\n\t $b = array( \n\t\t\t'',\n\t\t\t'',\n\t\t\thtml_entity_decode('<script>\\\\1</script>'),\n\t\t\thtml_entity_decode('<script \\\\1>\\\\2</script>'),\n\t\t\thtml_entity_decode('<style>\\\\1</style>'),\n\t\t\thtml_entity_decode('<style \\\\1>\\\\2</style>')\n\t\t);\n\n foreach($a AS $key => $val){\n\t\t\twhile(preg_match($val, $text)){\n\t\t\t\t$text = preg_replace($val, '', $text);\n\t\t\t}\n\t\t}\n\t\t$text = preg_replace($a, $b, $text);\n\t\treturn $text;\n\t}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function clean_script_tag($input) {\n $input = str_replace(\"type='text/javascript' \", '', $input);\n return str_replace(\"'\", '\"', $input);\n}", "function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "public function removeBadHTML($text)\n {\n GeneralUtility::logDeprecatedFunction();\n // Copyright 2002-2003 Thomas Bley\n $text = preg_replace([\n '\\'<script[^>]*?>.*?</script[^>]*?>\\'si',\n '\\'<applet[^>]*?>.*?</applet[^>]*?>\\'si',\n '\\'<object[^>]*?>.*?</object[^>]*?>\\'si',\n '\\'<iframe[^>]*?>.*?</iframe[^>]*?>\\'si',\n '\\'<frameset[^>]*?>.*?</frameset[^>]*?>\\'si',\n '\\'<style[^>]*?>.*?</style[^>]*?>\\'si',\n '\\'<marquee[^>]*?>.*?</marquee[^>]*?>\\'si',\n '\\'<script[^>]*?>\\'si',\n '\\'<meta[^>]*?>\\'si',\n '\\'<base[^>]*?>\\'si',\n '\\'<applet[^>]*?>\\'si',\n '\\'<object[^>]*?>\\'si',\n '\\'<link[^>]*?>\\'si',\n '\\'<iframe[^>]*?>\\'si',\n '\\'<frame[^>]*?>\\'si',\n '\\'<frameset[^>]*?>\\'si',\n '\\'<input[^>]*?>\\'si',\n '\\'<form[^>]*?>\\'si',\n '\\'<embed[^>]*?>\\'si',\n '\\'background-image:url\\'si',\n '\\'<\\\\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit|onunload).*?>\\'si'\n ], '', $text);\n $text = preg_replace('/<a[^>]*href[[:space:]]*=[[:space:]]*[\"\\']?[[:space:]]*javascript[^>]*/i', '', $text);\n // Return clean content\n return $text;\n }", "function xss_clean($var) {\r\n\treturn preg_replace('/(java|vb)script/i', '\\\\1 script', utf8_htmlspecialchars($var));\r\n}", "function clean_script_tag( $input ) {\n\t$input = str_replace( \"type='text/javascript' \", '', $input );\n\n\treturn str_replace( \"'\", '\"', $input );\n}", "function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "public static function strip_html($text) {\n $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\\\s\\\\S]*?--[ \\\\t\\\\n\\\\r]*>@', // Strip multi-line comments including CDATA\n '@<[\\\\/\\\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@&nbsp;@', // Strip space\n '@\\s+@', // change wrap or break space\n );\n $text = preg_replace($search, ' ', $text);\n $text = strip_tags($text);\n $text = trim($text);\n return $text;\n }", "function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {\n // Only operate on valid UTF-8 strings. This is necessary to prevent cross\n // site scripting issues on Internet Explorer 6.\n if (!kc_validate_utf8($string)) {\n return '';\n }\n // Store the text format.\n _filter_xss_split($allowed_tags, TRUE);\n // Remove NULL characters (ignored by some browsers).\n $string = str_replace(chr(0), '', $string);\n // Remove Netscape 4 JS entities.\n $string = preg_replace('%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string);\n\n // Defuse all HTML entities.\n $string = str_replace('&', '&amp;', $string);\n // Change back only well-formed entities in our whitelist:\n // Decimal numeric entities.\n $string = preg_replace('/&amp;#([0-9]+;)/', '&#\\1', $string);\n // Hexadecimal numeric entities.\n $string = preg_replace('/&amp;#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\\1', $string);\n // Named entities.\n $string = preg_replace('/&amp;([A-Za-z][A-Za-z0-9]*;)/', '&\\1', $string);\n\n return preg_replace_callback('%\n (\n <(?=[^a-zA-Z!/]) # a lone <\n | # or\n <!--.*?--> # a comment\n | # or\n <[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string\n | # or\n > # just a >\n )%x', '_filter_xss_split', $string);\n}", "protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }", "function stripcleantohtml($s) {\n\t// Also strips any <html> tags it may encouter\n\t// Use: Anything that shouldn't contain html (pretty much everything that is not a textarea)\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "protected function sanitize($input){ \n\t\tif ( get_magic_quotes_gpc() )\n\t\t{\n\t\t\t$input = stripslashes($input);\n\t\t}\n\n\t $search = array(\n\t\t '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t \t);\n\n\t\t$output = preg_replace($search, '', $input);\n\t\treturn $output;\n }", "function tep_sanitize_javascript($str){\n $farr = array(\n \"/\\s+/\", //过滤多余的空白\n \"/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU\",//过滤script等\n \"/(<[^>]*)on[a-zA-Z]+\\s*=([^>]*>)/isU\", //过滤on开头的时间,防止js调用\n \"/(<[^>]*)(href|src)\\s*=.*(javascript|vbscript).*([^>]*)(>)/isU\",//去掉链接中调用js\n \"/expression\\((.*)\\);?/is\" //去掉css调用js\n );\n $tarr = array(\n \" \",\n \"<\\\\1\\\\2\\\\3>\",\n \"\\\\1\\\\2\",\n \"\\\\1\\\\5\",\n \"\"\n );\n\n $str = preg_replace( $farr,$tarr,$str);\n return $str;\n }", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "static function html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function cleanInput($input) \n{\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n $output = preg_replace($search, '', $input);\n return $output;\n}", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "function cleanInput($input) {\n\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $output = preg_replace($search, '', $input);\n return $output;\n}", "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "function stripcleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// Also strips any <html> tags it may encounter\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}" ]
[ "0.76953495", "0.76366156", "0.75242275", "0.75191516", "0.7439052", "0.7343403", "0.7316779", "0.7270205", "0.7215129", "0.7183738", "0.7139952", "0.7125731", "0.71240526", "0.706455", "0.7056384", "0.70540756", "0.70534205", "0.7041985", "0.6983359", "0.69827336", "0.6973274", "0.6971449", "0.6946156", "0.69207484", "0.69172627", "0.6900401", "0.6893514", "0.6881084", "0.6861741", "0.6817733" ]
0.8055647
0
/ HAX Check executable code / Checks for executable code
function hax_check_for_executable_code( $text='' ) { //----------------------------------------- // Test //----------------------------------------- if ( preg_match( "#include|require|include_once|require_once|exec|system|passthru|`#si", $text ) ) { return TRUE; } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isExecutable(): bool;", "public function getExecutableCode(): string;", "public function testExecutableLines() {\n\t\tdo {\n\t\t\t// These lines should be ignored\n\t\t\t//\n\n\t\t\t/* And these as well are ignored */\n\n\t\t\t/**\n\t\t\t * Testing never proves the absence of faults,\n\t\t\t * it only shows their presence.\n\t\t\t * - Dijkstra\n\t\t\t */\n\t\t} while (false);\n\n\t\t$result = Inspector::executable($this, ['methods' => __FUNCTION__]);\n\t\t$expected = [__LINE__ - 1, __LINE__, __LINE__ + 1];\n\t\t$this->assertEqual($expected, $result);\n\t}", "private function execCheck() {\n\t $disabled = explode(', ', ini_get('disable_functions'));\n\t return !in_array('exec', $disabled);\n\t}", "function is_executable($filename)\n{\n}", "public function isExecutable()\n {\n return $this->getBinary()->isExecutable();\n }", "function checkCSH($filename = '') {\n\t\treturn true;\n\t}", "public function isExecutable($executable): bool;", "public function isExecutable()\n {\n $this->is_executable = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $x = substr($this->temp_files[$this->path]->permissions, 3, 1);\n\n if ($x == 'x') {\n $this->is_executable = true;\n } else {\n $this->is_executable = false;\n }\n\n return;\n }", "function verifyCodeInFile( $sInstruction ){\n if( !empty( $sInstruction ) ){\n $aExp = explode( ',', $sInstruction );\n $aExp[0] = trim( $aExp[0] );\n if( $aExp[0] == 'admin.php' )\n $aExp[0] = $GLOBALS['config']['admin_file'];\n $aExp[1] = isset( $aExp[1] ) ? trim( $aExp[1] ) : null;\n if( !empty( $aExp[1] ) )\n return ( is_file( $aExp[0] ) && preg_match( $aExp[1], file_get_contents( $aExp[0] ) ) ) ? true : false;\n else\n return is_file( $aExp[0] ) ? true : false;\n }\n return null;\n}", "function _can_execute($name, $path = false) \r\n {\r\n \t\t\t$this->tx_cbywebdav_devlog(1,\"_can_execute: $path \",\"cby_webdav\",\"_can_execute\");\r\n \t\t$t3io=$this->CFG->t3io;\r\n\r\n // path defaults to PATH from environment if not set\r\n if ($path === false) {\r\n $path = getenv(\"PATH\");\r\n }\r\n \r\n // check method depends on operating system\r\n if (!strncmp(PHP_OS, \"WIN\", 3)) {\r\n // on Windows an appropriate COM or EXE file needs to exist\r\n $exts = array(\".exe\", \".com\");\r\n $check_fn = \"file_exists\";\r\n } else {\r\n // anywhere else we look for an executable file of that name\r\n $exts = array(\"\");\r\n $check_fn = \"is_executable\";\r\n }\r\n \r\n // now check the directories in the path for the program\r\n foreach (explode(PATH_SEPARATOR, $path) as $dir) {\r\n // skip invalid path entries\r\n if (!$t3io->T3FileExists($dir)) continue;\r\n if (!$t3io->T3IsDir($dir)) continue;\r\n\r\n // and now look for the file\r\n foreach ($exts as $ext) {\r\n if ($check_fn(\"$dir/$name\".$ext)) return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected function checkBinary() {\n\t\t$binary = Tx_CzWkhtmltopdf_Config::getBinaryPath();\n\n\t\tif(empty($binary)) {\n\t\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t\t'wkhtmltopdf binary', // title\n\t\t\t\t'not configured',\n\t\t\t\t'The path to the binary is not configured. Please head over to the Extension Manager and configure the path in the configuration of '.Tx_CzWkhtmltopdf_Config::EXTKEY , //message\n\t\t\t\ttx_reports_reports_status_Status::ERROR //severity\n\t\t\t);\n\n\t\t\treturn FALSE;\n\t\t}\n\n\n\t\t$cmd = escapeshellcmd($binary);\n\n\t\t$proc=proc_open($cmd,array(0=>array('pipe','r'),1=>array('pipe','w'),2=>array('pipe','w')),$pipes);\n fwrite($pipes[0],$input);\n fclose($pipes[0]);\n $stdout=stream_get_contents($pipes[1]);\n fclose($pipes[1]);\n $stderr=stream_get_contents($pipes[2]);\n fclose($pipes[2]);\n $returnCode = proc_close($proc);\n\n\t\t$pass = intval($returnCode) <= 1;\n\n\t\tif($pass) {\n\t\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t\t'wkhtmltopdf binary', // title\n\t\t\t\t$binary,\n\t\t\t\t'' , //message\n\t\t\t\ttx_reports_reports_status_Status::OK //severity\n\t\t\t);\n\t\t} else {\n\t\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t\t'wkhtmltopdf binary', // title\n\t\t\t\t$stderr,\n\t\t\t\t'The error code was '.$returnCode.'.' , //message\n\t\t\t\ttx_reports_reports_status_Status::ERROR //severity\n\t\t\t);\n\t\t}\n\n\n\t\treturn $pass;\n\t}", "function CheckScript() \n{\n\techo '<correct>Script avalible</correct>';\n\texit();\n}", "public function hasCode(){\n return $this->_has(3);\n }", "public function __invoke(int $code): bool;", "private function isExecutable ($file)\n {\n return is_executable($file);\n }", "function verify_code($rec_num, $checkstr)\n\t{\n\t\tif ($user_func = e107::getOverride()->check($this,'verify_code'))\n\t\t{\n\t \t\treturn call_user_func($user_func,$rec_num,$checkstr);\n\t\t}\n\t\t\n\t\t$sql = e107::getDb();\n\t\t$tp = e107::getParser();\n\n\t\tif ($sql->db_Select(\"tmp\", \"tmp_info\", \"tmp_ip = '\".$tp -> toDB($rec_num).\"'\")) {\n\t\t\t$row = $sql->db_Fetch();\n\t\t\t$sql->db_Delete(\"tmp\", \"tmp_ip = '\".$tp -> toDB($rec_num).\"'\");\n\t\t\t//list($code, $path) = explode(\",\", $row['tmp_info']);\n\t\t\t$code = intval($row['tmp_info']);\n\t\t\treturn ($checkstr == $code);\n\t\t}\n\t\treturn FALSE;\n\t}", "public function isExecutable()\n {\n return $this->adapter->isExecutable($this->path);\n }", "function checkAddon($plugin_path,$e_xxx)\n\t{\n\t\tif(is_readable(e_PLUGIN.$plugin_path.\"/\".$e_xxx.\".php\"))\n\t\t{\n\t\t\t$file_text = file_get_contents(e_PLUGIN.$plugin_path.\"/\".$e_xxx.\".php\");\n\t\t\tif ((substr($file_text, 0, 5) != '<'.'?php')\n\t\t\t\t\t|| ( (substr($file_text, -2, 2) != '?'.'>') && (strrpos($file_text, '?'.'>') !== FALSE) )\n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn 2;\n\t}", "public function executable()\n {\n return is_executable($this->path);\n }", "protected function checkOperationality()\n {\n if (!function_exists('exec')) {\n throw new SystemRequirementsNotMetException('exec() is not enabled.');\n }\n }", "function needsExecution() ;", "function checkExecParams() {\n return TRUE;\n }", "private function isExecutableScript(File $file): bool\n {\n $mimeType = $file->getMimeType();\n\n // Check if given file is a phar executable script.\n if (\n 'application/octet-stream' === $mimeType\n && 1 === preg_match('/^#![ \\t]*\\/usr\\/bin\\/env[ \\t]?/', $file->getContent())\n ) {\n try {\n new Phar($file->getPathname());\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }\n\n // Allow only text files.\n if (1 !== preg_match('/^text\\//', $mimeType)) {\n return false;\n }\n\n $shebangs = [\n '/^#![ \\t]*\\/bin\\/sh[ \\t]?/',\n '/^#![ \\t]*\\/bin\\/bash[ \\t]?/',\n '/^#![ \\t]*\\/usr\\/bin\\/env[ \\t]?/',\n ];\n\n $content = trim($file->getContent());\n\n foreach ($shebangs as $regex) {\n if (1 === preg_match($regex, $content)) {\n return true;\n }\n }\n\n return false;\n }", "protected function checkSomePhpOpcodeCacheIsLoaded() {}", "function compileExists($compile){\n\tif(file_exists(COMPILER_FOLDER.'/'.$compile.'/'.$compile.'.zip')&&file_exists(COMPILER_FOLDER.'/'.$compile.'/'.$compile.'.sql')){\n return true;\n }else{\n \treturn false;\n } \n}", "function isCompilable() ;", "public function isINTincScript() {}", "public static function scriptCanBeDecoded($packagename=\"Professional\"){\n\t\t\n//\t\tif(!empty(self::$ioncubeWorks)){\n//\t\t\treturn true;\n//\t\t}\n\t\t\n\t\t\n\n\t\t$majorVersion = GO::config()->getMajorVersion();\n\t\n\t\tswitch($packagename){\n\t\t\tcase 'Billing':\n\t\t\t\t$className = 'LicenseBilling';\n\t\t\t\t$licenseFile = 'billing-'.$majorVersion.'-license.txt';\n\t\t\t\tbreak;\n\n\t\t\tcase 'Documents':\n\t\t\t\t$className = 'LicenseDocuments';\n\t\t\t\t$licenseFile = 'documents-'.$majorVersion.'-license.txt';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$className = 'License';\n\t\t\t\t$licenseFile = 'groupoffice-pro-'.$majorVersion.'-license.txt';\n\t\t\t\t\n\t\t\t\t\n\t\t\tbreak;\n\t\t\n//\t\t\tdefault:\n//\t\t\t\tthrow new Exception(\"Unknown package \".$packagename);\n\t\t}\n\t\t\n\t\tif(isset(self::$ioncubeChecks[$className])) {\n\t\t\treturn self::$ioncubeChecks[$className];\n\t\t}\n\n\t\t$path = GO::config()->root_path.'modules/professional/'.$className.'.php';\n\t\t\n\t\t\n\t\tif(!file_exists($path)){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//echo $path;\n\n\t\t//check data for presence of ionCube in code.\n\t\t$data= file_get_contents($path, false, null, 0, 100);\t\t\n\t\tif(strpos($data, 'ionCube')===false){\t\t\n\t\t\tself::$ioncubeChecks[$className] = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tif(!extension_loaded('ionCube Loader')){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\n\n//\t\t$lf = self::getLicenseFile();\n\t\t\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->root_path.$licenseFile);\n\t\t\n\t\t//Empty license file is provided in download so we must check the size.\n\t\tif(!$file->exists()){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$fullClassName = \"\\\\GO\\\\Professional\\\\\".$className;\n\n\t\t$check = self::$ioncubeChecks[$className] = $fullClassName::check();\n\t\t\n//\t\tvar_dump($check);\n\t\t\n\t\treturn $check;\n\t\t\n//\t\tself::$ioncubeWorks = true;\n\t\t\n//\t\treturn self::$ioncubeWorks;\n\t\t\n\t}", "private function isRunningFullCodeBase() {\n global $argv;\n return in_array('run', $argv);\n }" ]
[ "0.6404987", "0.63047", "0.6201137", "0.6117604", "0.60923034", "0.59537566", "0.5916962", "0.581912", "0.57358354", "0.5649017", "0.56457555", "0.5609315", "0.5579336", "0.5559956", "0.55553925", "0.5484412", "0.5426609", "0.5425053", "0.54232424", "0.54074585", "0.5399883", "0.5390371", "0.5342982", "0.5323458", "0.52933073", "0.5264545", "0.526409", "0.52639973", "0.5256032", "0.5255705" ]
0.79373485
0
/ Convert string between charsets / Convert a string between charsets
function txt_convert_charsets($t, $original_cset, $destination_cset="") { $original_cset = strtolower($original_cset); $text = $t; //----------------------------------------- // Did we pass a destination? //----------------------------------------- $destination_cset = strtolower($destination_cset) ? strtolower($destination_cset) : strtolower($this->vars['gb_char_set']); //----------------------------------------- // Not the same? //----------------------------------------- if ( $destination_cset == $original_cset ) { return $t; } //----------------------------------------- // Do the convert //----------------------------------------- /*if ( function_exists( 'mb_convert_encoding' ) ) { $text = mb_convert_encoding( $text, $destination_cset, $original_cset ); } else if ( function_exists( 'recode_string' ) ) { $text = recode_string( $original_cset.'..'.$destination_cset, $text ); } else if ( function_exists( 'iconv' ) ) { $text = iconv( $original_cset, $destination_cset.'//TRANSLIT', $text); }*/ if ( ! is_object( $this->class_convert_charset ) ) { require_once( KERNEL_PATH.'/class_convert_charset.php' ); $this->class_convert_charset = new class_convert_charset(); } $text = $this->class_convert_charset->convert_charset( $text, $original_cset, $destination_cset ); return $text ? $text : $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function chars_convert($string)\r\n {\r\n if (function_exists('mb_convert_encoding'))\r\n {\r\n $out = mb_convert_encoding($string, mb_detect_encoding($string), \"UTF-8\"); \r\n }\r\n else\r\n {\r\n $out = $string;\r\n }\r\n \r\n return $out; \r\n }", "function charConv($string,$in,$out) {\n\n $str = null;\n\n //make them both lowercase\n $in = strtolower($in);\n $out = strtolower($out);\n\n //sanity checking\n if (!$in || !$out) return $string;\n\n if ($in==$out) return $string;\n\n //return string if we don't have this function\n if (!function_exists(\"iconv\")) return $string;\n\n //this tells php to ignore characters it doesn't know\n $out .= \"//IGNORE\";\n\n return iconv($in,$out,$string);\n\n}", "function atk_iconv($in_charset, $out_charset, $str)\n{\n\treturn atkString::iconv($in_charset,$out_charset,$str);\n}", "function convFromOutputCharset($str,$pagecodeto='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);\n\t\tif ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);\n\t\treturn $str;\n\t}", "private function convertUsing_internal( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\t$text \t= '';\n\t\t$original\t= $string;\n\t\t\n\t\tif( !$this->charsetPath )\n\t\t{\n\t\t\t$this->charsetPath\t= Yii::getPathOfAlias('common.extensions') . '/i18n/ConvertTables/';\n\t\t}\n\t\t\n\t\t/**\n\t\t * This divison was made to prevent errors during convertion to/from utf-8 with\n\t\t * \"entities\" enabled, because we need to use proper destination(to)/source(from)\n\t\t * encoding table to write proper entities.\n\t\t * \n\t\t * This is the first case. We are converting from 1byte chars...\n\t\t **/\n\t\tif ($string_char_set != \"utf-8\") \n\t\t{ \n\t\t\t/**\n\t\t\t * Now build table with both charsets for encoding change. \n\t\t\t **/\n\t\t\tif ($destination_char_set != \"utf-8\") \n\t\t\t{ \n\t\t\t\t$charsetTable = $this->_makeConversionTable( $string_char_set, $destination_char_set );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$charsetTable = $this->_makeConversionTable( $string_char_set );\n\t\t\t}\n\t\t\t\n\t\t\tif( !count($charsetTable) )\n\t\t\t{\n\t\t\t\t$this->errors[]\t= \"Character set table not found\";\n\t\t\t\treturn $original;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * For each char in a string... \n\t\t\t **/\n\t\t\tfor ($i = 0; $i < strlen($string); $i++)\n\t\t\t{\n\t\t\t\t$hexChar\t\t= \"\";\n\t\t\t\t$unicodeHexChar\t= \"\";\n\t\t\t\t$hexChar\t\t= strtoupper(dechex(ord($string[$i])));\n\n\t\t\t\t// This is fix from Mario Klingemann, it prevents\n\t\t\t\t// droping chars below 16 because of missing leading 0 [zeros]\n\t\t\t\tif ( strlen($hexChar)==1 )\n\t\t\t\t{\n\t\t\t\t\t$hexChar = \"0\" . $hexChar;\n\t\t\t\t}\n\n\t\t\t\t// This is quick fix of 10 chars in gsm0338\n\t\t\t\t// Thanks goes to Andrea Carpani who pointed on this problem and solve it ;)\n\t\t\t\tif ( ( $string_char_set == \"gsm0338\" ) && ( $hexChar == '1B' ) )\n\t\t\t\t{\n\t\t\t\t\t$i++;\n\t\t\t\t\t$hexChar .= strtoupper(dechex(ord($string[$i])));\n\t\t\t\t}\n\n\t\t\t\tif ( $destination_char_set != \"utf-8\" ) \n\t\t\t\t{\n\t\t\t\t\tif ( in_array( $hexChar, $charsetTable[$string_char_set] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$unicodeHexChar\t\t= array_search( $hexChar, $charsetTable[$string_char_set] );\n\t\t\t\t\t\t$unicodeHexChars\t= explode( \"+\",$unicodeHexChar );\n\n\t\t\t\t\t\tfor( $unicodeHexCharElement = 0; $unicodeHexCharElement < count($unicodeHexChars); $unicodeHexCharElement++ )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( array_key_exists( $unicodeHexChars[$unicodeHexCharElement], $charsetTable[$destination_char_set] ) ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ( $this->entities == true ) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$text .= $this->_unicodeEntity( $this->_hexToUtf( $unicodeHexChars[$unicodeHexCharElement] ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$text .= chr(hexdec($charsetTable[$destination_char_set][$unicodeHexChars[$unicodeHexCharElement]]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->errors[]\t= \"NO_CHAR_IN_DESTINATION: {$string[$i]}\";\n\t\t\t\t\t\t\t\treturn $original;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->errors[]\t= \"NO_CHAR_IN_SOURCE: {$string[$i]}\";\n\t\t\t\t\t\treturn $original;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( in_array( $hexChar, $charsetTable[$string_char_set] ) ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$unicodeHexChar\t\t= array_search( $hexChar, $charsetTable[$string_char_set] );\n\t\t\t\t\t\t$unicodeHexChars\t= explode( \"+\", $unicodeHexChar );\n\n\t\t\t\t\t\t/**\n\t\t\t\t \t * Sometimes there are two or more utf-8 chars per one regular char.\n\t\t\t\t\t\t * Extream, example is polish old Mazovia encoding, where one char contains\n\t\t\t\t\t\t * two lettes 007a (z) and 0142 (l slash), we need to figure out how to\n\t\t\t\t\t\t * solve this problem.\n\t\t\t\t\t\t * The letters are merge with \"plus\" sign, there can be more than two chars.\n\t\t\t\t\t\t * In Mazowia we have 007A+0142, but sometimes it can look like this\n\t\t\t\t\t\t * 0x007A+0x0142+0x2034 (that string means nothing, it just shows the possibility...)\n\t\t\t\t \t **/\n\t\t\t\t\t\tfor( $unicodeHexCharElement = 0; $unicodeHexCharElement < count($unicodeHexChars); $unicodeHexCharElement++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $this->entities == true ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$text .= $this->_unicodeEntity( $this->_hexToUtf( $unicodeHexChars[$unicodeHexCharElement] ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$text .= $this->_hexToUtf( $unicodeHexChars[$unicodeHexCharElement] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->errors[]\t= \"NO_CHAR_IN_SOURCE: {$string[$i]}\";\n\t\t\t\t\t\treturn $original;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * This is second case. We are encoding from multibyte char string. \n\t\t **/\n\n\t\telse if( $string_char_set == \"utf-8\" )\n\t\t{\n\t\t\t$hexChar\t\t= \"\";\n\t\t\t$unicodeHexChar\t= \"\";\n\t\t\t$charsetTable \t= $this->_makeConversionTable( $destination_char_set );\n\n\t\t\tif( is_array($charsetTable[$destination_char_set]) AND count($charsetTable[$destination_char_set]) )\n\t\t\t{\n\t\t\t\tforeach ( $charsetTable[$destination_char_set] as $unicodeHexChar => $hexChar )\n\t\t\t\t{\n\t\t\t\t\tif ($this->entities == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entityOrChar\t= $this->_unicodeEntity($this->_hexToUtf($unicodeHexChar));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$entityOrChar\t= chr(hexdec($hexChar));\n\t\t\t\t\t}\n\t\n\t\t\t\t\t$string = str_replace( $this->_hexToUtf( $unicodeHexChar), $entityOrChar, $string );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$text = $string;\n\t\t}\n\t\n\t\treturn $text ? $text : $original;\n\t}", "private static function normalize($string = '')\n {\n $string = mb_convert_encoding($string, 'UTF-8');\n $string = iconv('UTF-8-MAC', 'UTF-8', $string);\n\n return iconv('UTF-8-MAC', 'UTF-8', $string);\n }", "function go ($string, $string_char_set, $destination_char_set = 'UTF-8') {\n\t\t$string_char_set\t= strtolower($string_char_set);\n\t\t$t\t\t\t\t\t= $string;\n\t\t// Did we pass a destination?\n\t\t$destination_char_set = strtolower($destination_char_set);\n\t\t// Not the same?\n\t\tif ($destination_char_set == $string_char_set) {\n\t\t\treturn $string;\n\t\t}\n\t\t// Try to detect encoding automatically\n\t\tif (!$string_char_set && function_exists('mb_detect_encoding')) {\n\t\t\t$string_char_set = mb_detect_encoding($string);\n\t\t}\n\t\tif (!$string_char_set) {\n\t\t\treturn $string;\n\t\t}\n\t\t// Do the convert\n\t\tif (function_exists('mb_convert_encoding')) {\n\t\t\t$text = mb_convert_encoding($string, $destination_char_set, $string_char_set);\n\t\t} elseif (function_exists('recode_string')) {\n\t\t\t$text = recode_string($string_char_set.'..'.$destination_char_set, $string);\n\t\t} elseif (function_exists('iconv')) {\n\t\t\t$text = iconv($string_char_set, $destination_char_set, $string);\n\t\t} else {\n\t\t\trequire_once (YF_PATH. \"libs/convertcharset/ConvertCharset.class.php\");\n\t\t\t$convert\t= new ConvertCharset();\n\t\t\t$text\t\t= $convert->Convert($string, $string_char_set, $destination_char_set, false);\n\t\t}\n\t\treturn $text ? $text : $t;\n\t}", "function _convertCharacters($string) {\n return str_replace(array_keys($this->_transliterationTable), array_values($this->_transliterationTable), $string);\n }", "private function convertUsing_mb( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\tif ( function_exists( 'mb_convert_encoding' ) )\n\t\t{\n\t\t\t$encodings\t= array_map( 'strtolower', mb_list_encodings() );\n\t\t\t\n\t\t\tif( in_array( strtolower( $destination_char_set ), $encodings ) AND in_array( strtolower( $string_char_set ), $encodings ) )\n\t\t\t{\n\t\t\t\t$text = mb_convert_encoding( $string, $destination_char_set, $string_char_set );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->errors[]\t= \"NO_MB_FUNCTION\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[]\t= \"NO_MB_FUNCTION\";\n\t\t}\n\t\t\n\t\treturn $text ? $text : $string;\n\t}", "public function convertEncoding( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\t$string_char_set = strtolower($string_char_set);\n\t\t$t = $string;\n\t\t\n\t\tif ( is_numeric( $t ) )\n\t\t{\n\t\t\treturn $t;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Did we pass a destination?\n\t\t//-----------------------------------------\n\t\t\n\t\t$destination_char_set = strtolower($destination_char_set);\n\t\t\n\t\t//-----------------------------------------\n\t\t// Not the same?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $destination_char_set == $string_char_set )\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\t\t\n\t\tif( !$string_char_set )\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\t\t\n\t\tif( !$t OR $t == '' )\n\t\t{\n\t\t\treturn $string;\n\t\t}\t\t\n\t\t\n\t\t//-----------------------------------------\n\t\t// Do the convert - internally..\n\t\t//-----------------------------------------\n\t\t\n\t\t$method\t= \"convertUsing_\" . $this->method;\n\t\t$text\t= $this->$method( $string, $string_char_set, $destination_char_set );\n\n\t\treturn $text ? $text : $t;\n\t}", "private function convertUsing_recode( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\tif ( function_exists( 'recode_string' ) )\n\t\t{\n\t\t\t$text = recode_string( $string_char_set.'..'.$destination_char_set, $string );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[]\t= \"NO_RECODE_FUNCTION\";\n\t\t}\n\t\t\n\t\treturn $text ? $text : $string;\n\t}", "function sanear_string2($string){\n \n $string = trim($string);\n \n $string = str_replace(\n array('á', 'à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),\n array('a', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),\n $string\n );\n \n $string = str_replace(\n array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),\n array('e', 'e', 'e', 'e', 'E', 'E', 'E', 'E'),\n $string\n );\n \n $string = str_replace(\n array('í', 'ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),\n array('i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'),\n $string\n );\n \n $string = str_replace(\n array('ó', 'ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),\n array('o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'),\n $string\n );\n \n $string = str_replace(\n array('ú', 'ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),\n array('u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'),\n $string\n );\n \n $string = str_replace(\n array('ñ', 'Ñ', 'ç', 'Ç'),\n array('n', 'N', 'c', 'C',),\n $string\n );\n \n //Esta parte se encarga de eliminar cualquier caracter extraño\n $string = str_replace(\n array(\"\\\\\", \"¨\", \"º\", \"-\", \"~\",\n \"#\", \"@\", \"|\", \"!\", '\"',\n \"·\", \"$\", \"%\", \"&\", \"/\",\n \"(\", \")\", \"?\", \"'\", \"¡\",\n \"¿\", \"[\", \"^\", \"<code>\", \"]\",\n \"+\", \"}\", \"{\", \"¨\", \"´\",\n \">\", \"< \", \";\", \",\", \":\",\n \".\"),\n '',\n $string\n );\n return $string;\n}", "function unicode2charset($texte, $charset='AUTO') {\n\tstatic $CHARSET_REVERSE;\n\tstatic $trans = array();\n\t\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n$charset='utf-8';\n\tswitch($charset) {\n\tcase 'utf-8':\n\t\treturn unicode_to_utf_8($texte);\n\t\tbreak;\n\n\tdefault:\n\t\t$charset = load_charset($charset);\n\n\t\tif (!is_array($CHARSET_REVERSE[$charset])) {\n\t\t\t$CHARSET_REVERSE[$charset] = array_flip($GLOBALS['CHARSET'][$charset]);\n\t\t}\n\n\t\tif (!isset($trans[$charset])){\n\t\t\t$trans[$charset]=array();\n\t\t\t$t = &$trans[$charset];\n\t\t\tfor($e=128;$e<255;$e++){\n\t\t\t\t$h = dechex($e);\n\t\t\t\tif ($s = isset($CHARSET_REVERSE[$charset][$e])){\n\t\t\t\t\t$s = $CHARSET_REVERSE[$charset][$e];\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($s);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($s);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($e);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$texte = strtr($texte, $trans[$charset]);\n\t\treturn $texte;\n\t}\n}", "function csConv($str,$from='')\t{\n\t\t$this->csConvObj = t3lib_div::makeInstance('t3lib_cs');\n\t\tif ($from)\t{\n\t\t\t$output = $this->csConvObj->conv($str,$this->csConvObj->parse_charset($from),$this->renderCharset,1);\n\t\t\treturn $output ? $output : $str;\n\t\t} elseif (is_array($this->convCharsetToFrom))\t{\n\t\t\treturn $this->csConvObj->conv($str,$this->convCharsetToFrom['from'],$this->convCharsetToFrom['to'],1);\n\t\t} else {\n\t\t\treturn $str;\n\t\t}\n\t}", "function cs_encode($input, $charsetFrom = 'ISO-8859-15', $charsetTo = null)\r\n{\r\n\tglobal $cs_main;\r\n\t\r\n\tif (is_null($charsetTo))\r\n\t{\r\n\t\t$charsetTo = strtoupper($cs_main['charset']);\r\n\t}\r\n\t\r\n\t// no need to convert if the charsets are the same\r\n\tif (strtoupper($charsetTo) == strtoupper($charsetFrom))\r\n\t{\r\n\t\treturn $input;\r\n\t}\r\n\t\r\n\tif (function_exists('iconv'))\r\n\t{\r\n\t\t/* use transliteral */\r\n\t\t$return = @iconv(strtoupper($charsetFrom), strtoupper($charsetTo).'//TRANSLIT', $input);\r\n\t\tif ($return !== false)\r\n\t\t\treturn $return;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/* Uses utf8_encode/utf8_decode and mb_detect_encoding/mb_convert_encoding.\r\n\t\t * To be extended in the future...\r\n\t\t */\r\n\t\tif (strtoupper($charsetTo) == 'UTF-8')\r\n\t\t{\r\n\t\t\tswitch (strtoupper($charsetFrom))\r\n\t\t\t{\r\n\t\t\tcase 'ISO-8859-1':\r\n//\t\t\tcase 'ISO-8859-15':\r\n\t\t\t\treturn utf8_encode($input);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tif (function_exists('mb_detect_encoding'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$encoding = mb_detect_encoding($input);\r\n\t\t\t\t\tif (is_string($encoding))\r\n\t\t\t\t\t\treturn mb_convert_encoding($input, 'UTF-8', $encoding);\r\n\t\t\t\t\t// else, do nothing\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (strtoupper($charsetFrom) == 'UTF-8')\r\n\t\t{\r\n\t\t\tswitch (strtoupper($charsetTo))\r\n\t\t\t{\r\n\t\t\tcase 'ISO-8859-1':\r\n//\t\t\tcase 'ISO-8859-15':\r\n\t\t\t\treturn utf8_decode($input);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// if we don't know what to do, just return it\r\n\treturn $input;\r\n}", "private function convertUsing_iconv( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\tif ( function_exists( 'iconv' ) )\n\t\t{\n\t\t\t$text = iconv( $string_char_set, $destination_char_set.'//TRANSLIT', $string );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[]\t= \"NO_ICONV_FUNCTION\";\n\t\t}\n\t\t\n\t\treturn $text ? $text : $string;\n\t}", "protected function getCharsetConversion() {}", "public static function convert($string, $inEncoding, $outEncoding) {}", "public static function parse_charset($input)\n {\n static $charsets = array();\n $charset = strtoupper($input);\n\n if (isset($charsets[$input])) {\n return $charsets[$input];\n }\n\n $charset = preg_replace(array(\n '/^[^0-9A-Z]+/', // e.g. _ISO-8859-JP$SIO\n '/\\$.*$/', // e.g. _ISO-8859-JP$SIO\n '/UNICODE-1-1-*/', // RFC1641/1642\n '/^X-/', // X- prefix (e.g. X-ROMAN8 => ROMAN8)\n ), '', $charset);\n\n if ($charset == 'BINARY') {\n return $charsets[$input] = null;\n }\n\n // allow A-Z and 0-9 only\n $str = preg_replace('/[^A-Z0-9]/', '', $charset);\n\n if (isset(self::$aliases[$str])) {\n $result = self::$aliases[$str];\n }\n // UTF\n else if (preg_match('/U[A-Z][A-Z](7|8|16|32)(BE|LE)*/', $str, $m)) {\n $result = 'UTF-' . $m[1] . $m[2];\n }\n // ISO-8859\n else if (preg_match('/ISO8859([0-9]{0,2})/', $str, $m)) {\n $iso = 'ISO-8859-' . ($m[1] ?: 1);\n // some clients sends windows-1252 text as latin1,\n // it is safe to use windows-1252 for all latin1\n $result = $iso == 'ISO-8859-1' ? 'WINDOWS-1252' : $iso;\n }\n // handle broken charset names e.g. WINDOWS-1250HTTP-EQUIVCONTENT-TYPE\n else if (preg_match('/(WIN|WINDOWS)([0-9]+)/', $str, $m)) {\n $result = 'WINDOWS-' . $m[2];\n }\n // LATIN\n else if (preg_match('/LATIN(.*)/', $str, $m)) {\n $aliases = array('2' => 2, '3' => 3, '4' => 4, '5' => 9, '6' => 10,\n '7' => 13, '8' => 14, '9' => 15, '10' => 16,\n 'ARABIC' => 6, 'CYRILLIC' => 5, 'GREEK' => 7, 'GREEK1' => 7, 'HEBREW' => 8\n );\n\n // some clients sends windows-1252 text as latin1,\n // it is safe to use windows-1252 for all latin1\n if ($m[1] == 1) {\n $result = 'WINDOWS-1252';\n }\n // if iconv is not supported we need ISO labels, it's also safe for iconv\n else if (!empty($aliases[$m[1]])) {\n $result = 'ISO-8859-'.$aliases[$m[1]];\n }\n // iconv requires convertion of e.g. LATIN-1 to LATIN1\n else {\n $result = $str;\n }\n }\n else {\n $result = $charset;\n }\n\n $charsets[$input] = $result;\n\n return $result;\n }", "public static function sanear_string($string) {\n \t\t//setlocale(LC_ALL, 'en_US.UTF8');\n\n\t $string = trim($string);\n\n\t $string = str_replace(array('á','à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),array('a','a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),$string );\n\n\t $string = str_replace(array('é','è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),array('e','e', 'e', 'e', 'E', 'E', 'E', 'E'),$string);\n\n\t $string = str_replace(array('í','ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),array('i','i', 'i', 'i', 'I', 'I', 'I', 'I'),$string);\n\n\t $string = str_replace(array('ó','ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),array('o','o', 'o', 'o', 'O', 'O', 'O', 'O'),$string);\n\n\t $string = str_replace(array('ú','ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),array('u','u', 'u', 'u', 'U', 'U', 'U', 'U'),$string);\n\n\t \t$string = str_replace(array('ç', 'Ç'),array('c', 'C'),$string);\n\t \t$string = str_replace(array('ñ', 'Ñ'),array('n', 'N'),$string);\n\n\t //Esta parte se encarga de eliminar cualquier caracter extraño\n\t $string = str_replace(array(\"\\\\\", \"¨\", \"º\", \"-\", \"~\",\"#\", \"@\", \"|\", \"!\", \"\\\"\",\"·\", \"$\", \"%\", \"&\", \"/\",\"(\", \")\", \"?\", \"'\", \"¡\",\"¿\", \"[\", \"^\", \"`\", \"]\",\"+\", \"}\", \"{\", \"¨\", \"´\",\">\", \"< \", \";\", \",\", \":\",\".\"),'',$string);\n\t $string = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $string);\n\t $charset='ISO-8859-1'; // o 'UTF-8'\n\t\t$string = iconv($charset, 'ASCII//TRANSLIT', $string);\n\t return $string;\n\t}", "public function encode_convert($string) {\r\n\t\treturn mb_convert_encoding(trim($string), \"UTF-8\", \"EUC-JP, UTF-8, ASCII, JIS, eucjp-win, sjis-win\");\r\n\t}", "private function convToOutputCharset($str,$pagecodefrom='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_encode($str);\n\t\tif ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_decode($str);\n\t\treturn $str;\n\t}", "function convert($string, $to = 'UTF-8', $from = 'auto'){\n $result = false;\n if ($string != null && $to != null && is_string($to)) {\n $string = (string) $string;\n if (strpos($to, '//') !== false) {\n $split = explode('//', $to);\n $to = array_shift($split);\n }\n if (is_array($from)\n || (is_string($from) && strcasecmp($from, 'auto') === 0)) {\n $detect = $this->detectEncoding($string, $from);\n if ($detect !== false) {\n $from = $detect;\n }\n }\n if ($this->hasMBString) {\n $to = $this->getEncodingName($to, 'mbstring', $to);\n $from = $this->getEncodingName($from, 'mbstring', $from);\n $result = mb_convert_encoding($string, $to, $from);\n } else if ($this->hasIConv) {\n $to = $this->getEncodingName($to, 'iconv', $to);\n $to .= '//TRANSLIT//IGNORE';\n $from = $this->getEncodingName($from, 'iconv', $from);\n $result = @iconv($from, $to, $string);\n }\n if (!$result) {\n $to = $this->getEncodingName($to, null, $to);\n $from = $this->getEncodingName($from, null, $from);\n if (strcasecmp($to, $from) === 0) {\n $result = $string;\n } else {\n $result = false;\n }\n }\n }\n return $result;\n }", "function sanear_string($string)\n\t{\n\t\t$string = trim($string);\n\t \n\t $string = str_replace(\n\t array('á', 'à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),\n\t array('a', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),\n\t $string\n\t );\n\t \n\t $string = str_replace(\n\t array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),\n\t array('e', 'e', 'e', 'e', 'E', 'E', 'E', 'E'),\n\t $string\n\t );\n\t \n\t $string = str_replace(\n\t array('í', 'ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),\n\t array('i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'),\n\t $string\n\t );\n\t \n\t $string = str_replace(\n\t array('ó', 'ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),\n\t array('o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'),\n\t $string\n\t );\n\t \n\t $string = str_replace(\n\t array('ú', 'ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),\n\t array('u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'),\n\t $string\n\t );\n\t \n\t $string = str_replace(\n\t array('ñ', 'Ñ', 'ç', 'Ç'),\n\t array('n', 'N', 'c', 'C',),\n\t $string\n\t );\n\t \n\t //Esta parte se encarga de eliminar cualquier caracter extraño\n\t $string = str_replace(\n\t array(\"\\\\\", \"¨\", \"º\", \"-\", \"~\",\n\t \"#\", \"@\", \"|\", \"!\", \"\\\"\",\n\t \"·\", \"$\", \"%\", \"&\", \"/\",\n\t \"(\", \")\", \"?\", \"'\", \"¡\",\n\t \"¿\", \"[\", \"^\", \"`\", \"]\",\n\t \"+\", \"}\", \"{\", \"¨\", \"´\",\n\t \">\", \"<\", \";\", \",\", \":\",\n\t \".\", \"_\"),\n\t '',\n\t $string\n\t );\n\t \n\t return $string;\n\t}", "function unicode_conv($originalString) {\n $replacedString = preg_replace(\"#\\\\\\\\u(\\w{4})#\", \"&#x$1;\", $originalString);\n $unicodeString = mb_convert_encoding($replacedString, 'ISO-8859-1', 'HTML-ENTITIES');\n return $unicodeString;\n}", "function replaceAccent($string) {\n if ( !preg_match('/[\\x80-\\xff]/', $string) )\n return $string;\n \n if (seems_utf8($string)) {\n $chars = array(\n // Decompositions for Latin-1 Supplement\n chr(194).chr(170) => 'a', chr(194).chr(186) => 'o',\n chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',\n chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',\n chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',\n chr(195).chr(134) => 'AE',chr(195).chr(135) => 'C',\n chr(195).chr(136) => 'E', chr(195).chr(137) => 'E',\n chr(195).chr(138) => 'E', chr(195).chr(139) => 'E',\n chr(195).chr(140) => 'I', chr(195).chr(141) => 'I',\n chr(195).chr(142) => 'I', chr(195).chr(143) => 'I',\n chr(195).chr(144) => 'D', chr(195).chr(145) => 'N',\n chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',\n chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',\n chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',\n chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',\n chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',\n chr(195).chr(158) => 'TH',chr(195).chr(159) => 's',\n chr(195).chr(160) => 'a', chr(195).chr(161) => 'a',\n chr(195).chr(162) => 'a', chr(195).chr(163) => 'a',\n chr(195).chr(164) => 'a', chr(195).chr(165) => 'a',\n chr(195).chr(166) => 'ae',chr(195).chr(167) => 'c',\n chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',\n chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',\n chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',\n chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',\n chr(195).chr(176) => 'd', chr(195).chr(177) => 'n',\n chr(195).chr(178) => 'o', chr(195).chr(179) => 'o',\n chr(195).chr(180) => 'o', chr(195).chr(181) => 'o',\n chr(195).chr(182) => 'o', chr(195).chr(184) => 'o',\n chr(195).chr(185) => 'u', chr(195).chr(186) => 'u',\n chr(195).chr(187) => 'u', chr(195).chr(188) => 'u',\n chr(195).chr(189) => 'y', chr(195).chr(190) => 'th',\n chr(195).chr(191) => 'y', chr(195).chr(152) => 'O',\n // Decompositions for Latin Extended-A\n chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',\n chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',\n chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',\n chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',\n chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',\n chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',\n chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',\n chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',\n chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',\n chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',\n chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',\n chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',\n chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',\n chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',\n chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',\n chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',\n chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',\n chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',\n chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',\n chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',\n chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',\n chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',\n chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',\n chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',\n chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',\n chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',\n chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',\n chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',\n chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',\n chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',\n chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',\n chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',\n chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',\n chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',\n chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',\n chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',\n chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',\n chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',\n chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',\n chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',\n chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',\n chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',\n chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',\n chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',\n chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',\n chr(197).chr(154) => 'S',chr(197).chr(155) => 's',\n chr(197).chr(156) => 'S',chr(197).chr(157) => 's',\n chr(197).chr(158) => 'S',chr(197).chr(159) => 's',\n chr(197).chr(160) => 'S', chr(197).chr(161) => 's',\n chr(197).chr(162) => 'T', chr(197).chr(163) => 't',\n chr(197).chr(164) => 'T', chr(197).chr(165) => 't',\n chr(197).chr(166) => 'T', chr(197).chr(167) => 't',\n chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',\n chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',\n chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',\n chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',\n chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',\n chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',\n chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',\n chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',\n chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',\n chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',\n chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',\n chr(197).chr(190) => 'z', chr(197).chr(191) => 's',\n // Decompositions for Latin Extended-B\n chr(200).chr(152) => 'S', chr(200).chr(153) => 's',\n chr(200).chr(154) => 'T', chr(200).chr(155) => 't',\n // Euro Sign\n chr(226).chr(130).chr(172) => 'E',\n // GBP (Pound) Sign\n chr(194).chr(163) => '',\n // Vowels with diacritic (Vietnamese)\n // unmarked\n chr(198).chr(160) => 'O', chr(198).chr(161) => 'o',\n chr(198).chr(175) => 'U', chr(198).chr(176) => 'u',\n // grave accent\n chr(225).chr(186).chr(166) => 'A', chr(225).chr(186).chr(167) => 'a',\n chr(225).chr(186).chr(176) => 'A', chr(225).chr(186).chr(177) => 'a',\n chr(225).chr(187).chr(128) => 'E', chr(225).chr(187).chr(129) => 'e',\n chr(225).chr(187).chr(146) => 'O', chr(225).chr(187).chr(147) => 'o',\n chr(225).chr(187).chr(156) => 'O', chr(225).chr(187).chr(157) => 'o',\n chr(225).chr(187).chr(170) => 'U', chr(225).chr(187).chr(171) => 'u',\n chr(225).chr(187).chr(178) => 'Y', chr(225).chr(187).chr(179) => 'y',\n // hook\n chr(225).chr(186).chr(162) => 'A', chr(225).chr(186).chr(163) => 'a',\n chr(225).chr(186).chr(168) => 'A', chr(225).chr(186).chr(169) => 'a',\n chr(225).chr(186).chr(178) => 'A', chr(225).chr(186).chr(179) => 'a',\n chr(225).chr(186).chr(186) => 'E', chr(225).chr(186).chr(187) => 'e',\n chr(225).chr(187).chr(130) => 'E', chr(225).chr(187).chr(131) => 'e',\n chr(225).chr(187).chr(136) => 'I', chr(225).chr(187).chr(137) => 'i',\n chr(225).chr(187).chr(142) => 'O', chr(225).chr(187).chr(143) => 'o',\n chr(225).chr(187).chr(148) => 'O', chr(225).chr(187).chr(149) => 'o',\n chr(225).chr(187).chr(158) => 'O', chr(225).chr(187).chr(159) => 'o',\n chr(225).chr(187).chr(166) => 'U', chr(225).chr(187).chr(167) => 'u',\n chr(225).chr(187).chr(172) => 'U', chr(225).chr(187).chr(173) => 'u',\n chr(225).chr(187).chr(182) => 'Y', chr(225).chr(187).chr(183) => 'y',\n // tilde\n chr(225).chr(186).chr(170) => 'A', chr(225).chr(186).chr(171) => 'a',\n chr(225).chr(186).chr(180) => 'A', chr(225).chr(186).chr(181) => 'a',\n chr(225).chr(186).chr(188) => 'E', chr(225).chr(186).chr(189) => 'e',\n chr(225).chr(187).chr(132) => 'E', chr(225).chr(187).chr(133) => 'e',\n chr(225).chr(187).chr(150) => 'O', chr(225).chr(187).chr(151) => 'o',\n chr(225).chr(187).chr(160) => 'O', chr(225).chr(187).chr(161) => 'o',\n chr(225).chr(187).chr(174) => 'U', chr(225).chr(187).chr(175) => 'u',\n chr(225).chr(187).chr(184) => 'Y', chr(225).chr(187).chr(185) => 'y',\n // acute accent\n chr(225).chr(186).chr(164) => 'A', chr(225).chr(186).chr(165) => 'a',\n chr(225).chr(186).chr(174) => 'A', chr(225).chr(186).chr(175) => 'a',\n chr(225).chr(186).chr(190) => 'E', chr(225).chr(186).chr(191) => 'e',\n chr(225).chr(187).chr(144) => 'O', chr(225).chr(187).chr(145) => 'o',\n chr(225).chr(187).chr(154) => 'O', chr(225).chr(187).chr(155) => 'o',\n chr(225).chr(187).chr(168) => 'U', chr(225).chr(187).chr(169) => 'u',\n // dot below\n chr(225).chr(186).chr(160) => 'A', chr(225).chr(186).chr(161) => 'a',\n chr(225).chr(186).chr(172) => 'A', chr(225).chr(186).chr(173) => 'a',\n chr(225).chr(186).chr(182) => 'A', chr(225).chr(186).chr(183) => 'a',\n chr(225).chr(186).chr(184) => 'E', chr(225).chr(186).chr(185) => 'e',\n chr(225).chr(187).chr(134) => 'E', chr(225).chr(187).chr(135) => 'e',\n chr(225).chr(187).chr(138) => 'I', chr(225).chr(187).chr(139) => 'i',\n chr(225).chr(187).chr(140) => 'O', chr(225).chr(187).chr(141) => 'o',\n chr(225).chr(187).chr(152) => 'O', chr(225).chr(187).chr(153) => 'o',\n chr(225).chr(187).chr(162) => 'O', chr(225).chr(187).chr(163) => 'o',\n chr(225).chr(187).chr(164) => 'U', chr(225).chr(187).chr(165) => 'u',\n chr(225).chr(187).chr(176) => 'U', chr(225).chr(187).chr(177) => 'u',\n chr(225).chr(187).chr(180) => 'Y', chr(225).chr(187).chr(181) => 'y',\n // Vowels with diacritic (Chinese, Hanyu Pinyin)\n chr(201).chr(145) => 'a',\n // macron\n chr(199).chr(149) => 'U', chr(199).chr(150) => 'u',\n // acute accent\n chr(199).chr(151) => 'U', chr(199).chr(152) => 'u',\n // caron\n chr(199).chr(141) => 'A', chr(199).chr(142) => 'a',\n chr(199).chr(143) => 'I', chr(199).chr(144) => 'i',\n chr(199).chr(145) => 'O', chr(199).chr(146) => 'o',\n chr(199).chr(147) => 'U', chr(199).chr(148) => 'u',\n chr(199).chr(153) => 'U', chr(199).chr(154) => 'u',\n // grave accent\n chr(199).chr(155) => 'U', chr(199).chr(156) => 'u',\n );\n \n \n // Assume ISO-8859-1 if not UTF-8\n $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)\n .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)\n .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)\n .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)\n .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)\n .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)\n .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)\n .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)\n .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)\n .chr(252).chr(253).chr(255);\n \n $chars['out'] = \"EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy\";\n \n $string = strtr($string, $chars['in'], $chars['out']);\n $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));\n $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');\n }\n return $string;\n }", "function & _wp_utf8_to_8859_2(&$string) {\n $decode=array(\n \"\\xC4\\x84\"=>\"\\xA1\",\n \"\\xC4\\x85\"=>\"\\xB1\",\n \"\\xC4\\x86\"=>\"\\xC6\",\n \"\\xC4\\x87\"=>\"\\xE6\",\n \"\\xC4\\x98\"=>\"\\xCA\",\n \"\\xC4\\x99\"=>\"\\xEA\",\n \"\\xC5\\x81\"=>\"\\xA3\",\n \"\\xC5\\x82\"=>\"\\xB3\",\n \"\\xC5\\x83\"=>\"\\xD1\",\n \"\\xC5\\x84\"=>\"\\xF1\",\n \"\\xC3\\x93\"=>\"\\xD3\",\n \"\\xC3\\xB3\"=>\"\\xF3\",\n \"\\xC5\\x9A\"=>\"\\xA6\",\n \"\\xC5\\x9B\"=>\"\\xB6\",\n \"\\xC5\\xB9\"=>\"\\xAC\",\n \"\\xC5\\xBA\"=>\"\\xBC\",\n \"\\xC5\\xBB\"=>\"\\xAF\",\n \"\\xC5\\xBC\"=>\"\\xBF\"\n );\n\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "public static function replaceAccentedChars($str) {\n $str = preg_replace('/[\\x{0105}\\x{0104}\\x{00E0}\\x{00E1}\\x{00E2}\\x{00E3}\\x{00E4}\\x{00E5}]/u', 'a', $str);\n $str = preg_replace('/[\\x{00E7}\\x{010D}\\x{0107}\\x{0106}]/u', 'c', $str);\n $str = preg_replace('/[\\x{010F}]/u', 'd', $str);\n $str = preg_replace('/[\\x{00E8}\\x{00E9}\\x{00EA}\\x{00EB}\\x{011B}\\x{0119}\\x{0118}]/u', 'e', $str);\n $str = preg_replace('/[\\x{00EC}\\x{00ED}\\x{00EE}\\x{00EF}]/u', 'i', $str);\n $str = preg_replace('/[\\x{0142}\\x{0141}\\x{013E}\\x{013A}]/u', 'l', $str);\n $str = preg_replace('/[\\x{00F1}\\x{0148}]/u', 'n', $str);\n $str = preg_replace('/[\\x{00F2}\\x{00F3}\\x{00F4}\\x{00F5}\\x{00F6}\\x{00F8}\\x{00D3}]/u', 'o', $str);\n $str = preg_replace('/[\\x{0159}\\x{0155}]/u', 'r', $str);\n $str = preg_replace('/[\\x{015B}\\x{015A}\\x{0161}]/u', 's', $str);\n $str = preg_replace('/[\\x{00DF}]/u', 'ss', $str);\n $str = preg_replace('/[\\x{0165}]/u', 't', $str);\n $str = preg_replace('/[\\x{00F9}\\x{00FA}\\x{00FB}\\x{00FC}\\x{016F}]/u', 'u', $str);\n $str = preg_replace('/[\\x{00FD}\\x{00FF}]/u', 'y', $str);\n $str = preg_replace('/[\\x{017C}\\x{017A}\\x{017B}\\x{0179}\\x{017E}]/u', 'z', $str);\n $str = preg_replace('/[\\x{00E6}]/u', 'ae', $str);\n $str = preg_replace('/[\\x{0153}]/u', 'oe', $str);\n return $str;\n }", "function FixString($string)\n{\n return mb_convert_encoding($string, \"UTF-8\", \"Windows-1252\");\n}", "function mb_convert_case($sourcestring, $mode, $encoding) {}" ]
[ "0.7311858", "0.6885861", "0.6548213", "0.6541071", "0.653384", "0.6492425", "0.6470106", "0.63928986", "0.6357658", "0.6349433", "0.63421154", "0.62877643", "0.6277148", "0.62123096", "0.6194179", "0.61879134", "0.6178804", "0.61759263", "0.6157386", "0.6117931", "0.6111513", "0.6108299", "0.61074954", "0.61051667", "0.61046374", "0.60823363", "0.6067967", "0.60501367", "0.6018367", "0.59998447" ]
0.6991893
1
/ txt_filename_clean Clean filenames... / Clean a string to prevent file traversal issues
function txt_filename_clean( $t ) { $t = $this->txt_alphanumerical_clean( $t, '.' ); $t = preg_replace( '#\.{1,}#s', '.', $t ); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean($filename) \n {\n return preg_replace('/[^0-9a-z\\.\\_\\-]/i','', strtolower($filename));\n }", "function cleanFileName($fileName)\n {\n // remove all special chars and keep only alphanumeric chars\n $fileName = preg_replace(\"/[^a-zA-Z0-9- .]/\", \"\", trim($fileName));\n // replace multiple white spaces with single white space\n $fileName = preg_replace(\"/\\s+/\", \" \", $fileName);\n // replace multiple dashes with single dash\n $fileName = preg_replace('/-+/', '-', $fileName);\n // again remove special chars from the beginning of the string in case it contains\n // special chars in the beginning after clean-up\n $fileName = preg_replace('/(^([^a-zA-Z0-9])*|([^a-zA-Z0-9])*$)/', '', $fileName);\n return $fileName;\n }", "function clean_filename($filename)\n\t{\n//replaces all characters that are not alphanumeric with the exception of the . for filename usage\n\t\t$realname = preg_replace(\"/[^a-zA-Z0-9\\.]/\", \"\", strtolower($filename));\n\t\treturn $realname;\n\t}", "public function cleanFilename($filename = '')\n {\t\n \tif ($filename != '')\n \t{\n\t \t// Add spaces to ending HTMl tags\n\t \t$filename = preg_replace(\"/<\\/([^\\s])>/\", \"</$1> \", $filename);\n\t \t\n\t \t// Strip tags\n\t \t$filename = strip_tags($filename);\n\t \t\n\t \t// Convert all HTML entities\n\t \t$filename = html_entity_decode($filename);\n\t \t\n\t \t// Replace any white space\n\t \t$filename = preg_replace(\"/[\\r\\n\\t\\s]+/s\", \"-\", $filename);\n\t \t\n\t \t// Replace any dashes\n\t \t$filename = preg_replace(\"/[\\-]+/s\", \"-\", $filename);\n\t \t$filename = str_replace('--', '-', $filename);\n\t \t\n\t \t// Convert to lowercase\n\t \t$filename = strtolower($filename);\n\t \t\n\t \t// Remove any unexpected characters\n\t \t$filename = preg_replace(\"/[^a-zA-Z0-9\\-]?/\", \"\", $filename);\n\t }\n \n \treturn $filename;\n }", "function sanitize_file_name($filename)\n {\n }", "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "function cleanFileName($filename) {\n\t\t//$name = preg_replace('/[^a-zA-Z0-9.]/', '', $name);\n\t\t//$name = substr($name,0,9);\n\t\t$filename_raw = $filename;\n\t\t$special_chars = array(\"?\", \"[\", \"]\", \"/\", \"\\\\\", \"=\", \"<\", \">\", \":\", \";\", \",\", \"'\", \"\\\"\", \"&\", \"$\", \"#\", \"*\", \"(\", \")\", \"|\", \"~\", \"`\", \"!\", \"{\", \"}\", chr(0));\n\t\t$filename = preg_replace( \"#\\x{00a0}#siu\", ' ', $filename );\n\t\t$filename = str_replace($special_chars, '', $filename);\n\t\t$filename = preg_replace('/[\\s-]+/', '-', $filename);\n\t\t$filename = trim($filename, '.-_');\n\t\t$filename = str_replace(' ', '-', $filename);\n\t\treturn $filename;\n\t}", "function cleanFilename($inc_filename='')\n{\n\t$SafeFile = $inc_filename; \n\t$SafeFile = str_replace('#', 'No.', $SafeFile); \n\t$SafeFile = str_replace('$', 'Dollar', $SafeFile); \n\t$SafeFile = str_replace('%', 'Percent', $SafeFile); \n\t$SafeFile = str_replace('^', '', $SafeFile); \n\t$SafeFile = str_replace('&', 'and', $SafeFile); \n\t$SafeFile = str_replace('*', '', $SafeFile); \n\t$SafeFile = str_replace('?', '', $SafeFile); \n\n\t$uploaddir = 'tmp/'; \n\t$path = $uploaddir.$SafeFile;\n\treturn $path;\n}", "function strip_File($FileName) {\n\t//$arrItems = array(\" \", \"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"(\",\")\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$arrItems = array(\"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$FileName = str_replace($arrItems, \"_\", $FileName);\n\t$FileName = urldecode($FileName);\n\t$FileName = str_replace(\"%\", \"_\", $FileName);\n\treturn $FileName;\n}", "function sanitize_filename(\n string $fileName,\n bool $sanitizeForPath = false,\n string $charToReplaceWhiteSpace = ' '\n): string {\n //check whitespace\n $fileName = str_replace(' ', $charToReplaceWhiteSpace, $fileName);\n\n // Remove any runs of periods - avoid Path Traversal Vulnerabilities OSWAP\n // https://www.owasp.org/index.php/Path_Traversal\n $notAllowedPath = [\n '//',\n '\\\\\\\\',\n '../',\n './',\n '..\\\\',\n '.\\\\',\n '%2e%2e%2f',\n '%2e%2e/',\n '..%2f',\n '%2e%2e%5c',\n '%2e%2e\\\\',\n '..%5c',\n '%252e%252e%255c',\n '..%255c',\n '..%c0%af',\n '..%c1%9c',\n ];\n while (str_contains_arrayEx($fileName, $notAllowedPath) !== false) {\n $fileName = str_replace($notAllowedPath, '', $fileName);\n }\n\n // Remove anything which isn't a word, whitespace, number\n // or any of the following caracters -_~,;[]().\n // If you don't need to handle multi-byte characters\n // you can use preg_replace rather than mb_ereg_replace\n // Thanks @Łukasz Rysiak!\n $fileName = mb_ereg_replace('([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).' . ($sanitizeForPath ? '\\\\/' : '') . '])', '', $fileName);\n\n // remove exadecimal, non white space chars\n $fileName = mb_ereg_replace('([[:cntrl:]\\b\\0\\n\\r\\t\\f])', '', $fileName);\n\n //normalize and trim\n $fileName = trim(normalizeUtf8String($fileName));\n\n //do not start with ..\n while (starts_withEx($fileName, '..') !== false) {\n $fileName = substr($fileName, 2);\n }\n\n //do not end with ..\n while (ends_withEx($fileName, '..') !== false) {\n $fileName = substr($fileName, 0, -2);\n }\n //do not end with .\n while (ends_withEx($fileName, '.') !== false) {\n $fileName = substr($fileName, 0, -1);\n }\n\n return $fileName;\n}", "public function cleanFileName($fileName)\n {\n // Handle UTF-8 characters\n if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {\n // allow \".\", \"-\", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave)\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName));\n } else {\n $fileName = GeneralUtility::makeInstance(CharsetConverter::class)->specCharsToASCII('utf-8', $fileName);\n // Replace unwanted characters by underscores\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\\\xC0-\\\\xFF]/', '_', trim($fileName));\n }\n // Strip trailing dots and return\n return rtrim($cleanFileName, '.');\n }", "function filter_filename($name) {\n $name = str_replace(array_merge(\n array_map('chr', range(0, 31)),\n array('<', '>', ':', '\"', '/', '\\\\', '|', '?', '*','\\'')\n ), '', $name);\n // maximise filename length to 255 bytes http://serverfault.com/a/9548/44086\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $name= mb_strcut(pathinfo($name, PATHINFO_FILENAME), 0, 255 - ($ext ? strlen($ext) + 1 : 0), mb_detect_encoding($name)) . ($ext ? '.' . $ext : '');\n return $name;\n}", "public static function cleanForFilename(?string $string): string\n {\n if (null === $string) {\n return '';\n }\n\n return (new UnicodeString($string))\n ->ascii()\n ->trim()\n ->replaceMatches('#([^a-zA-Z0-9\\.]+)#', '_')\n ->lower()\n ->toString()\n ;\n }", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "function cleanFileName($str) {\n $str = strtolower($str);\n $ext_point = strrpos($str,\".\");\n if ($ext_point===false) return false;\n $ext = substr($str,$ext_point,strlen($str));\n $str = substr($str,0,$ext_point);\n\n return preg_replace(\"/[^a-z0-9-]/\",\"_\",$str).$ext;\n}", "public function sanitizeFileNameNonUTF8FilesystemDataProvider() {}", "public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }", "private static function strip_to_valid_filename( $string ) {\r\n\t\t\tif ( !mb_detect_encoding( $string, 'UTF-8', true ) ) {\r\n\t\t\t\treturn self::uniqString( 12 );\r\n\t\t\t}\r\n\t\t\t$string = preg_replace( '/[^\\w-.]/', '', $string );\r\n\t\t\treturn substr( $string, 0, 100 );\r\n\t\t}", "function sanitize_pathname(string $pathName, string $charToReplaceWhiteSpace): string\n{\n return sanitize_filename($pathName, true, $charToReplaceWhiteSpace);\n}", "function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}", "public static function cleanFilename($fileName)\r\n {\r\n $fileName = str_replace('../', '', $fileName);\r\n $fileName = str_replace('./', '', $fileName);\r\n $fileName = str_replace(' ', '_', $fileName);\r\n return $fileName;\r\n }", "function normalize($filename) {\n $maxlength = 20;\n $strippedString = preg_replace(\"/[^A-Za-z0-9_\\-]/\", \"\", $filename);\n return substr($strippedString, 0, min(strlen($strippedString), $maxlength));\n}", "function sanitizeFileName($fileName)\n{\n\t//sanitize, remove double dot .. and remove get parameters if any\n\t$fileName = __DIR__ . '/' . preg_replace('@\\?.*$@' , '', preg_replace('@\\.{2,}@' , '', preg_replace('@[^\\/\\\\a-zA-Z0-9\\-\\._]@', '', $fileName)));\n\treturn $fileName;\n}", "function sanitize_filename($filename) {\n\t// Remove any trailing dots, as those aren't ever valid file names.\n\t$filename = rtrim($filename, '.');\n\n\t$regex = array('#(\\.){2,}#', '#[^A-Za-z0-9\\.\\_\\- ]#', '#^\\.#');\n\t$filename = trim(preg_replace($regex, '', $filename));\n\t$filename = str_replace(' ', '-', $filename);\n\n\treturn $filename;\n}", "function cmk_sanitize_filename_on_upload($filename) {\n $ext = end(explode('.',$filename));\n // Reemplazar todos los caracteres extranos.\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/','', substr($filename, 0, -(strlen($ext)+1)));\n // Replace dots inside filename\n $sanitized = str_replace('.','-', $sanitized);\n return strtolower($sanitized.'.'.$ext);\n}", "static public function sanitizeFileName( $sFileName, $sReplacement='_' ) {\n \n // Remove anything which isn't a word, whitespace, number\n // or any of the following caracters -_~,;:[](). \n $sFileName = preg_replace( \"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\).])\", $sReplacement, $sFileName );\n \n // Remove any runs of periods.\n return preg_replace( \"([\\.]{2,})\", '', $sFileName );\n \n }", "public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename ?? '');\n\n // Since we use double underscore to delimit variants, eradicate them from filename\n return preg_replace('/_{2,}/', '_', $filename ?? '');\n }", "protected function filterFilename($value) {\n $value = str_replace(\" \", \"-\", $value);\n $value = str_replace([\"å\", \"ä\", \"ö\", \"Å\", \"Ä\", \"Ö\"], [\"a\", \"a\", \"o\", \"A\", \"A\", \"O\"], $value);\n $value = preg_replace(\"/[^a-z0-9\\-\\_\\.]/i\", \"\", $value);\n return $value;\n }", "function sanitize_filename(string $str = null, string $replace = '-')\n{\n if (!$str) {\n return bin2hex(random_bytes(4));\n }\n // Remove unwanted chars\n $str = mb_ereg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", $replace, $str);\n // Replace multiple dots by custom char\n $str = mb_ereg_replace(\"([\\.]{2,})\", $replace, $str);\n return $str;\n}", "public function sanitizeFileNameUTF8FilesystemDataProvider() {}" ]
[ "0.7226636", "0.71996677", "0.7081977", "0.7068488", "0.69993496", "0.698021", "0.6770819", "0.6734389", "0.6714323", "0.6712471", "0.6689857", "0.6682539", "0.6676493", "0.6667293", "0.6664809", "0.6642522", "0.6631256", "0.65814674", "0.65516025", "0.65275717", "0.6522782", "0.65085894", "0.6507156", "0.6506278", "0.6453369", "0.6437646", "0.63963497", "0.6344134", "0.6337665", "0.6312545" ]
0.7420139
0
/ txt_md5_clean Clean up MD5 hashes / Returns a cleaned MD5 hash
function txt_md5_clean( $t ) { return preg_replace( "/[^a-zA-Z0-9]/", "" , substr( $t, 0, 32 ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateMD5Pass() {\n $plaintext = $this->generator->generateString(8, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^+');\n $hash = md5($plaintext);\n return $hash;\n }", "public function getMd5(): string;", "function is_md5($str)\n{\n\t//return false;\n\treturn preg_match(\"/^[a-f0-9]{32}$/i\", $str);\n}", "function XMLEncStrMD5($cadena){\n\t\t$this->mdcstr=md5($cadena);\n\t\treturn $this->mdcstr;\n\t}", "public static function markableHashFilter($string) {\n $pos = strpos($string, \"/\");\n if($pos !== false) {\n $string = substr($string, $pos + 1);\n }\n $md5str = md5($string); \n $md5str_len = strlen($md5str);\n \n $ret = \"\";\n for($i = 0; $i < $md5str_len; $i++) {\n if(ctype_alpha($md5str[$i])) {\n $ret .= $md5str[$i];\n }\n }\n \n return $ret;\n }", "public function getT3xfilemd5() {}", "function return_md5_check()\n\t{\n\t\tif ( $this->member['id'] )\n\t\t{\n\t\t\treturn md5( $this->member['email'].'&'.$this->member['member_login_key'].'&'.$this->member['joined'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn md5(\"this is only here to prevent it breaking on guests\");\n\t\t}\n\t}", "public static function md5_hash( $string )\n {\n return '{MD5}'.base64_encode( pack( 'H*', md5( $string ) ) );\n }", "function canMd5()\n {\n return false;\n }", "public function get_file_md5() {\n\t\treturn md5_file( $this->file );\n\t}", "public function getMd5Checksum()\r\n {\r\n return md5_file($this->filename);\r\n }", "public static function md5() {\n return md5(uniqid(mt_rand(), true));\n }", "private function getUndoMd5()\n\t{\n\t\treturn(md5(serialize($this->partitionSteps)));\n\t}", "public function prepare_Security_GetMD5Hash($params)\n\t{\n\t\t$xml_string = \"p_ToHash=\".$params['p_ToHash'].\"\";\n\t\treturn $xml_string;\n\t}", "public function getHash()\n {\n $string = '';\n foreach ($this->board as $row) {\n /** @var array $row */\n $string .= implode('', $row);\n }\n\n return md5($string);\n }", "public function getMd5()\n {\n return md5($this->accountNumber.$this->apiKey.$this->submission->get());\n }", "public function hash()\n {\n return $this->adapter->md5File($this->path);\n }", "function string2(){\n\n $string2 = \"Hola mundo\";\n $md5 = md5($string2);\n\n echo $md5;\n\n}", "function compute_md5sum(&$data) {\n if (function_exists(\"hash_init\") && is_resource($data)) {\n $ctx = hash_init('md5');\n while (!feof($data)) {\n $buffer = fgets($data, 65536);\n hash_update($ctx, $buffer);\n }\n $md5 = hash_final($ctx, false);\n rewind($data);\n } elseif ((string) is_file($data)) {\n $md5 = md5_file($data);\n } else {\n $md5 = md5($data);\n }\n\n return $md5;\n}", "function sanitize_hex_color_no_hash($color)\n {\n }", "function createMd5OfString($arrayData)\r\n{\r\n $stringData = json_encode($arrayData, JSON_UNESCAPED_UNICODE);\r\n $md5Data = md5($stringData);\r\n return $md5Data;\r\n}", "protected static function _generateSaltMd5() {\n\t\treturn '$1$' . Random::generate(6, ['encode' => Random::ENCODE_BASE_64]);\n\t}", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "public static function getHMACMD5HashString($password, $data)\n {\n if(function_exists('hash_hmac')) {\n return hash_hmac('MD5', $data,$password);\n }\n else {\n return self::hmacFallbackMD5($data, $password);\n }\n }", "public static function decryptMD5DB($string)\r\n {\r\n\t\tif(!$string){\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\t// Create URL\r\n $url = 'https://md5.gromweb.com/?md5=' . $string . '';\r\n\t\t\r\n // Add http headers to imitate a real user (not a bot)\r\n $opts = array(\r\n 'http' => array(\r\n 'header' => \"User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53\\r\\n\"\r\n )\r\n );\r\n $context = stream_context_create($opts);\r\n\t\t\r\n // Parse web page with simple html dom lib\r\n $html = file_get_html('https://md5.gromweb.com/?md5=' . $string, 0, $context);\r\n\r\n // Retrieve tag with result\r\n if(isset($html->find('div#content em.string', 0)->plaintext)) {\r\n\t\t\treturn $html->find('div#content em.string', 0)->plaintext;\r\n\t\t} else {\r\n\t\t\treturn 'No matches';\r\n\t\t}\r\n }", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "protected function getPlainTextPasswordFromMD5($md5){\n\t\tif( $this->settings['MD5HashCrackSource'] == 'internal'){\n\t\t\treturn Tx_Typo3mind_Utility_UnsecurePasswords::getPlainPW($md5);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function hashFileMd5()\n {\n $this->hash_file_md5 = null;\n\n if ($this->exists === true) {\n\n } elseif ($this->is_file === true) {\n\n } else {\n return;\n }\n\n $this->hash_file_md5 = md5_file($this->temp);\n\n return;\n }", "public static function clean_user_fingerprints($user_fingerprints) {\n write_log('clean users fingerprints');\n //remove excess spaces and duplicates\n $user_fingerprints = array_unique(array_filter(str_replace(' ', '', $user_fingerprints)));\n return implode(\",\",$user_fingerprints);\n }" ]
[ "0.61390287", "0.61289364", "0.6110845", "0.5843", "0.5765471", "0.57389927", "0.5735733", "0.5716435", "0.5683292", "0.55890065", "0.5574767", "0.5525581", "0.5518164", "0.5473088", "0.5462147", "0.5459561", "0.5458615", "0.54270583", "0.5403831", "0.5388328", "0.5361892", "0.5349171", "0.53285736", "0.5297759", "0.5279268", "0.5273497", "0.5273497", "0.5263022", "0.52557176", "0.52253604" ]
0.7748718
0
/ txt_stripslashes Make Big5 safe only strip if not already... / Remove slashes if magic_quotes enabled
function txt_stripslashes($t) { if ( $this->get_magic_quotes ) { $t = stripslashes($t); $t = preg_replace( "/\\\(?!&amp;#|\?#)/", "&#092;", $t ); } return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanText($str) {\r\n $str = @trim($str);\r\n if (get_magic_quotes_gpc()) {\r\n $str = stripslashes($str);\r\n }\r\n return $str;\r\n}", "function txt_safeslashes($t=\"\")\n\t{\n\t\treturn str_replace( '\\\\', \"\\\\\\\\\", $this->txt_stripslashes($t));\n\t}", "function bwm_clean($s) {\r\n if (get_magic_quotes_gpc())\r\n return trim(stripslashes($s));\r\n return trim($s);\r\n}", "function &stripSlashesGPC( $text, $force = false ) {\n if ( get_magic_quotes_gpc() || $force == true ) {\n $text = stripslashes( $text );\n }\n return $text;\n }", "function smartstripslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == true ) {\n\t\t\t$str = stripslashes($str);\n\t\t}\n\t\treturn $str;\n\t}", "function DoStripSlashes($fieldValue) {\n if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { \n if (is_array($fieldValue) ) { \n return array_map('DoStripSlashes', $fieldValue); \n } else { \n return trim(stripslashes($fieldValue)); \n } \n } else { \n return $fieldValue; \n } \n}", "private function _remove_magic_quotes()\n {\n if(get_magic_quotes_gpc()) {\n $_GET = $this->_strip_slashes_deep($_GET);\n $_POST = $this->_strip_slashes_deep($_POST);\n $_COOKIE = $this->_strip_slashes_deep($_COOKIE);\n }\n }", "function safe_slash_html_input($text) {\r\n if (get_magic_quotes_gpc()==0) \r\n {\t\t\r\n $text = addslashes(htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false));\r\n } else \r\n {\t\t\r\n\t $text = htmlentities($text, ENT_QUOTES, 'UTF-8', false);\t\r\n }\r\n return $text;\r\n}", "function _put_safe_slashes ($text = \"\") {\n\t\t$text = str_replace(\"'\", \"&#039;\", trim($text));\n\t\t$text = str_replace(\"\\\\&#039;\", \"\\\\'\", $text);\n\t\t$text = str_replace(\"&#039;\", \"\\\\'\", $text);\n\t\tif (substr($text, -1) == \"\\\\\" && substr($text, -2, 1) != \"\\\\\") {\n\t\t\t$text .= \"\\\\\";\n\t\t}\n\t\treturn $text;\n\t}", "public function removeMagicQuotes() {\n if ( get_magic_quotes_gpc() ) {\n $_GET = $this->stripSlashesDeep($_GET);\n $_POST = $this->stripSlashesDeep($_POST);\n $_COOKIE = $this->stripSlashesDeep($_COOKIE);\n }\n }", "public static function removeMagicQuotes() {\r\n if (get_magic_quotes_gpc() ) {\r\n \tif(isset($_GET)){\r\n \t\t$_GET = self::stripSlashesDeep($_GET);\r\n \t}\r\n \r\n\t\t\tif(isset($_POST)){\r\n \t\t$_POST = self::stripSlashesDeep($_POST);\r\n \t}\r\n \r\n\t\t\tif(isset($_COOKIE)){\r\n \t\t$_COOKIE = self::stripSlashesDeep($_COOKIE);\r\n \t}\r\n \r\n }\r\n }", "function ATsanitize($input)\n{\n $user_input = trim($input);\n \n if (get_magic_quotesgpc())\n {\n $input = stripslashes($input);\n }\n}", "function _check_magic_quotes($value){\n\t\treturn $this->_magic_quotes?stripslashes($value):$value;\n\t}", "private static function _undoMagicQuotes(){\n\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\n\t\t\tfunction stripslashes_array($data) {\n\t\t\t\tif (is_array($data)) {\n\t\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t\t$data[$key] = stripslashes_array($value);\n\t\t\t\t\t}\n\t\t\t\t\treturn $data;\n\t\t\t\t} else {\n\t\t\t\t\treturn stripslashes($data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_REQUEST = stripslashes_array($_REQUEST);\n\t\t\t$_GET = stripslashes_array($_GET);\n\t\t\t$_POST = stripslashes_array($_POST);\n\t\t\t$_COOKIE = stripslashes_array($_COOKIE);\n\t\t\tif(isset($_FILES))\n\t\t\t\t$_FILES = stripslashes_array($_FILES);\n\t\t}\n\t}", "static function stripMagic() {\n\t\t@set_magic_quotes_runtime(0);\n\t\t// if magic_quotes_gpc strip slashes from GET POST COOKIE\n\t\tif (get_magic_quotes_gpc()){\n\t\tfunction stripslashes_array($array) {\n\t\t return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array);\n\t\t}\n\t\t$_GET= stripslashes_array($_GET);\n\t\t$_POST= stripslashes_array($_POST);\n\t\t$_REQUEST= stripslashes_array($_REQUEST);\n\t\t$_COOKIE= stripslashes_array($_COOKIE);\n\t\t}\n\t}", "function undo_magic_quotes() {\n if (get_magic_quotes_gpc()) {\n \n $in = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);\n \n while (list($k,$v) = each($in)) {\n foreach ($v as $key => $val) {\n if (!is_array($val)) {\n $in[$k][$key] = stripslashes($val);\n continue;\n }\n $in[] =& $in[$k][$key];\n }\n }\n \n unset($in);\n }\n }", "function wp_kses_stripslashes($content)\n {\n }", "function fix_input_quotes() {\n if(get_magic_quotes_gpc()) {\n array_stripslashes($_GET);\n array_stripslashes($_POST);\n array_stripslashes($_COOKIE);\n } // if\n }", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function remove_wp_magic_quotes() {\r\n\t\t$_GET = stripslashes_deep($_GET);\r\n\t\t$_POST = stripslashes_deep($_POST);\r\n\t\t$_COOKIE = stripslashes_deep($_COOKIE);\r\n\t\t$_REQUEST = stripslashes_deep($_REQUEST);\r\n\t}", "function cleanData($data) {\n $data = stripslashes($data);\n $data = trim($data);\n return $data;\n}", "function stripslashes_from_strings_only($value)\n {\n }", "function stripString($string) {\r\n return stripslashes($string);\r\n}", "function remove_ill($str)\r\n {\r\n\t\treturn (!get_magic_quotes_gpc() ? addslashes(trim($str)) : trim($str));\r\n }", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function wp_magic_quotes()\n {\n }", "static function revertSlashes($to_strip = null)\n\t{\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\tif (isset($to_strip)) {\n\t\t\t\treturn is_array($to_strip)\n\t\t\t\t ? array_map(array('Pie_Bootstrap', 'revertSlashes'), $to_strip) \n\t\t\t\t : stripslashes($to_strip);\n\t\t\t}\n\t\t\t$_COOKIE = self::revertSlashes($_COOKIE);\n\t\t\t$_FILES = self::revertSlashes($_FILES);\n\t\t\t$_GET = self::revertSlashes($_GET);\n\t\t\t$_POST = self::revertSlashes($_POST);\n\t\t\t$_REQUEST = self::revertSlashes($_REQUEST);\n\t\t}\n\t}", "function cleanInput($data)\n{\n    $data = trim($data);\n\n // gunakan stripslashes untuk elakkan  double escape if magic_quotes_gpc is enabledif(get_magic_quotes_gpc()){\n $data = stripslashes($data);}", "function sanitize($data) {\n $data = htmlentities(get_magic_quotes_gpc() ? stripslashes($data) : $data, ENT_QUOTES, 'UTF-8');\n return $data;\n }" ]
[ "0.7493485", "0.73703194", "0.7269341", "0.72181493", "0.72104377", "0.72050405", "0.7162849", "0.71528524", "0.7143947", "0.7110766", "0.70800537", "0.7077103", "0.70490474", "0.70359766", "0.69798195", "0.6970172", "0.68985367", "0.6898264", "0.6890047", "0.68774706", "0.68547416", "0.67434365", "0.67358196", "0.67225176", "0.6720595", "0.6697915", "0.6681452", "0.6668359", "0.6663905", "0.66063154" ]
0.755711
0
/ txt_raw2form makes _POST text safe for text areas / Convert text for use in a textarea
function txt_raw2form($t="") { $t = str_replace( '$', "&#036;", $t); if ( $this->get_magic_quotes ) { $t = stripslashes($t); } $t = preg_replace( "/\\\(?!&amp;#|\?#)/", "&#092;", $t ); //--------------------------------------- // Make sure macros aren't converted //--------------------------------------- $t = preg_replace( "/<{(.+?)}>/", "&lt;{\\1}&gt;", $t ); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFormInput($a_text, $a_stripslashes = true)\n\t{\n\t\t$a_text = str_replace(\"<\", \"&lt;\", $a_text);\n\t\t$a_text = str_replace(\">\", \"&gt;\", $a_text);\n\t\tif($a_stripslashes)\n\t\t\t$a_text = ilUtil::stripSlashes($a_text);\n\t\t\n\t\treturn $a_text;\n\t}", "function txt_form2raw($t=\"\")\n\t{\n\t\t$t = str_replace( \"&#036;\", '$' , $t);\n\t\t$t = str_replace( \"&#092;\", '\\\\', $t );\n\t\t\n\t\treturn $t;\n\t}", "function sanitize_textarea_field($str)\n {\n }", "function _xss_sanitization_esc_textarea( $text ) {\n $safe_text = htmlspecialchars( $text, ENT_QUOTES );\n return $safe_text;\n}", "function qa_post_text($field)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn isset($_POST[$field]) ? preg_replace('/\\r\\n?/', \"\\n\", trim(qa_gpc_to_string($_POST[$field]))) : null;\n}", "function _sanitize_text_fields($str, $keep_newlines = \\false)\n {\n }", "public function convert() {\n\t\tif ($this->Common->isPosted()) {\n\t\t\t$settings = $this->request->getData('Translate');\n\t\t\t$text = $this->request->getData('input');\n\n\t\t\t$ConvertLib = new ConvertLib();\n\t\t\t$text = $ConvertLib->convert($text, $settings);\n\t\t\t$this->set(compact('text'));\n\t\t}\n\t}", "public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}", "function string_textarea( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\treturn $p_string;\r\n}", "function sanitize_text_field($str)\n {\n }", "function format_input($data) { \n $data = trim($data); // Strips unnecessary characters (extra space, tab, newline) from the user input data\n $data = stripslashes($data); // Removes backslashes from the user input data\n $data = htmlspecialchars($data); // When a user tries to submit in a text \n // field. The code is now safe to be displayed on a page or inside an e-mail.\n return $data;\n}", "function dokan_posted_textarea( $key ) {\n $value = isset( $_POST[$key] ) ? trim( $_POST[$key] ) : '';\n\n return esc_textarea( $value );\n}", "function esc_textarea($text)\n {\n }", "function rec_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function inputRefine($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "function tc_sanitize_textarea( $value) {\r\n $value = esc_html( $value);\r\n return $value;\r\n }", "function show_form()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$raw_post = \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Unconvert the saved post if required\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! isset($_POST['Post']) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// If we're using RTE, then just clean up html\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->han_editor->method == 'rte' )\n\t\t\t{\n\t\t\t\t$raw_post = $this->parser->convert_ipb_html_to_html( $this->orig_post['post'] );\n\n\t\t\t\tif( intval($this->orig_post['post_htmlstate']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] )\n\t\t\t\t{\n\t\t\t\t\t# Make EMO_DIR safe so the ^> regex works\n\t\t\t\t\t$raw_post = str_replace( \"<#EMO_DIR#>\", \"&lt;#EMO_DIR&gt;\", $raw_post );\n\t\t\t\t\t\n\t\t\t\t\t# New emo\n\t\t\t\t\t$raw_post = preg_replace( \"#(\\s)?<([^>]+?)emoid=\\\"(.+?)\\\"([^>]*?)\".\">(\\s)?#is\", \"\\\\1\\\\3\\\\5\", $raw_post );\n\t\t\t\t\t\n\t\t\t\t\t# And convert it back again...\n\t\t\t\t\t$raw_post = str_replace( \"&lt;#EMO_DIR&gt;\", \"<#EMO_DIR#>\", $raw_post );\n\n\t\t\t\t\t$raw_post = $this->parser->convert_std_to_rte( $raw_post );\n\t\t\t\t}\n\n\t\t\t\tif( isset($this->orig_post['post_htmlstate']) AND $this->orig_post['post_htmlstate'] == 2 )\n\t\t\t\t{\n\t\t\t\t\t$raw_post = str_replace( '&lt;br&gt;', \"<br />\", $raw_post );\n\t\t\t\t\t$raw_post = str_replace( '&lt;br /&gt;', \"<br />\", $raw_post );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->orig_post['post_htmlstate'] = isset($this->orig_post['post_htmlstate']) ? $this->orig_post['post_htmlstate'] : 0;\n\t\t\t\t$this->parser->parse_html = intval($this->orig_post['post_htmlstate']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] ? 1 : 0;\n\t\t\t\t$this->parser->parse_nl2br = (isset($this->orig_post['post_htmlstate']) AND $this->orig_post['post_htmlstate'] == 2) ? 1 : 0;\n\t\t\t\t$this->parser->parse_smilies = intval($this->orig_post['use_emo']);\n\t\t\t\t$this->parser->parse_bbcode = $this->forum['use_ibc'];\n\n\t\t\t\tif( $this->parser->parse_html )\n\t\t\t\t{\n\t\t\t\t\t# Make EMO_DIR safe so the ^> regex works\n\t\t\t\t\t$this->orig_post['post'] = str_replace( \"<#EMO_DIR#>\", \"&lt;#EMO_DIR&gt;\", $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t# New emo\n\t\t\t\t\t$this->orig_post['post'] = preg_replace( \"#(\\s)?<([^>]+?)emoid=\\\"(.+?)\\\"([^>]*?)\".\">(\\s)?#is\", \"\\\\1\\\\3\\\\5\", $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t# And convert it back again...\n\t\t\t\t\t$this->orig_post['post'] = str_replace( \"&lt;#EMO_DIR&gt;\", \"<#EMO_DIR#>\", $this->orig_post['post'] );\n\t\t\t\t\n\t\t\t\t\t$this->orig_post['post'] = $this->parser->convert_ipb_html_to_html( $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t$this->orig_post['post'] = htmlspecialchars( $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\tif( $this->parser->parse_nl2br )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->orig_post['post'] = str_replace( '&lt;br&gt;', \"\\n\", $this->orig_post['post'] );\n\t\t\t\t\t\t$this->orig_post['post'] = str_replace( '&lt;br /&gt;', \"\\n\", $this->orig_post['post'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$raw_post = $this->parser->pre_edit_parse( $this->orig_post['post'] );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( $this->han_editor->method != 'rte' )\n\t\t\t{\n\t\t\t\t$_POST['Post'] = str_replace( '&', '&amp;', $_POST['Post'] );\n\t\t\t}\n\n\t\t\tif ( $this->ipsclass->input['_from'] == 'quickedit' )\n\t\t\t{\n\t\t\t\t$this->orig_post['post_htmlstatus'] = isset($this->orig_post['post_htmlstatus']) ? $this->orig_post['post_htmlstatus'] : 0;\n\t\t\t\t$this->parser->parse_html = intval($this->orig_post['post_htmlstatus']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] ? 1 : 0;\n\t\t\t\t$this->parser->parse_nl2br = (isset($this->ipsclass->input['post_htmlstatus']) AND $this->ipsclass->input['post_htmlstatus'] == 2) ? 1 : 0;\n\t\t\t\t$this->parser->parse_smilies = intval($this->orig_post['use_emo']);\n\t\t\t\t$this->parser->parse_bbcode = $this->forum['use_ibc'];\n\n\t\t\t\tif ( $this->han_editor->method == 'rte' )\n\t\t\t\t{\n\t\t\t\t\t$raw_post = $this->parser->convert_std_to_rte( $this->ipsclass->txt_stripslashes( $_POST['Post'] ) );\n\t\t\t\t\t\n\t\t\t\t\tforeach( $this->ipsclass->skin['_macros'] as $row )\n\t\t\t \t{\n\t\t\t\t\t\tif ( $row['macro_value'] != \"\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$raw_post = str_replace( \"<{\".$row['macro_value'].\"}>\", $row['macro_replace'], $raw_post );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$raw_post = str_replace( \"<#IMG_DIR#>\", $this->ipsclass->skin['_imagedir'], $raw_post );\n\t\t\t\t\t$raw_post = str_replace( \"<#EMO_DIR#>\", $this->ipsclass->skin['_emodir'] , $raw_post );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$raw_post = $this->ipsclass->txt_stripslashes( $_POST['Post'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$raw_post = $this->ipsclass->txt_stripslashes( $_POST['Post'] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Is this the first post in the topic?\n\t\t//-----------------------------------------\n\t\t\n\t\t$topic_title = \"\";\n\t\t$topic_desc = \"\";\n\t\t\n\t\tif ( $this->edit_title == 1 )\n\t\t{\n\t\t\t$topic_title = isset($_POST['TopicTitle']) ? $this->ipsclass->input['TopicTitle'] : $this->topic['title'];\n\t\t\t$topic_desc = isset($_POST['TopicDesc']) ? $this->ipsclass->input['TopicDesc'] : $this->topic['description'];\n\t\t\t\n\t\t\t$topic_title = $this->ipsclass->compiled_templates['skin_post']->topictitle_fields( array( 'TITLE' => $topic_title, 'DESC' => $topic_desc ) );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Do we have any posting errors?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( isset($this->obj['post_errors']) AND $this->obj['post_errors'] )\n\t\t{\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->errors( $this->ipsclass->lang[ $this->obj['post_errors'] ]);\n\t\t}\n\t\t\n\t\tif ( isset($this->obj['preview_post']) AND $this->obj['preview_post'] )\n\t\t{\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->preview( $this->show_post_preview( $this->post['post'], $this->post_key ) );\n\t\t}\n\t\t\n\t\t$this->output .= $this->html_start_form( array( 1 => array( 'CODE' , '09' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t2 => array( 't' , $this->topic['tid']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t3 => array( 'p' , $this->ipsclass->input['p'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t4 => array( 'st' , $this->ipsclass->input['st'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t5 => array( 'attach_post_key', $this->post_key )\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// START TABLE\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->table_structure();\n\t\t\n\t\t$start_table = $this->ipsclass->compiled_templates['skin_post']->table_top( \"{$this->ipsclass->lang['top_txt_edit']} {$this->topic['title']}\");\n\t\t\n\t\t$name_fields = $this->html_name_field();\n\t\t\n\t\t$post_box = $this->html_post_body( $raw_post );\n\t\t\t\n\t\t$mod_options = $this->edit_title == 1 ? $this->mod_options('edit') : '';\n\t\t\n\t\t$end_form = $this->ipsclass->compiled_templates['skin_post']->EndForm( $this->ipsclass->lang['submit_edit'] );\n\t\t\n\t\t$post_icons = $this->html_post_icons($this->orig_post['icon_id']);\n\t\t\n\t\t$upload_field = $this->can_upload ? $this->html_build_uploads($this->post_key,'edit',$this->orig_post['pid']) : '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Still here?\n\t\t//-----------------------------------------\n\t\t\n\t\t$poll_box = \"\";\n\t\t\n\t\tif ( $this->can_add_poll )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Did someone hit preview / do we have\n\t\t\t// post info?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$poll_questions = \"\";\n\t\t\t$poll_choices = \"\";\n\t\t\t$poll_votes = \"\";\n\t\t\t$show_open = 0;\n\t\t\t$is_mod = 0;\n\t\t\t$poll_only\t\t= \"\";\n\t\t\t$poll_multi\t\t= \"\";\t\t\t\n\t\t\t\n\t\t\tif ( isset($_POST['question']) AND is_array( $_POST['question'] ) and count( $_POST['question'] ) )\n\t\t\t{\n\t\t\t\tforeach( $_POST['question'] as $id => $question )\n\t\t\t\t{\n\t\t\t\t\t$poll_questions .= \"\\t{$id} : '\".str_replace( \"'\", '&#39;', $question ).\"',\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_question = $this->ipsclass->input['poll_question'];\n\t\t\t\t$show_open = 1;\n\t\t\t\t\n\t\t\t\tif ( is_array( $_POST['choice'] ) and count( $_POST['choice'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['choice'] as $id => $choice )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_choices .= \"\\t'{$id}' : '\".str_replace( \"'\", '&#39;', $choice ).\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( isset($_POST['multi']) AND is_array( $_POST['multi'] ) and count( $_POST['multi'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['multi'] as $id => $checked )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_multi .= \"\\t{$id} : '{$checked}',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( is_array( $_POST['votes'] ) and count( $_POST['votes'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['votes'] as $id => $vote )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_votes .= \"\\t'{$id}' : '\".$vote.\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_only = 0;\n\t\t\t\t\n\t\t\t\tif( $this->ipsclass->vars['ipb_poll_only'] AND $this->ipsclass->input['poll_only'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$poll_only = \"checked='checked'\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_questions = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_questions );\n\t\t\t\t$poll_choices = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_choices );\n\t\t\t\t$poll_multi \t= preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_multi );\n\t\t\t\t$poll_votes = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_votes );\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Load the poll from the DB\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'polls', 'where' => \"tid=\".$this->topic['tid'] ) );\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t \t\t$this->poll_data = $this->ipsclass->DB->fetch_row();\n\t \t\t\n\t \t\t$this->poll_answers = $this->poll_data['choices'] ? unserialize(stripslashes($this->poll_data['choices'])) : array();\n\n \t\t//-----------------------------------------\n \t\t// Lezz go\n \t\t//-----------------------------------------\n \t\t\n \t\tforeach( $this->poll_answers as $question_id => $data )\n \t\t{\n \t\t\t$poll_questions .= \"\\t{$question_id} : '\".str_replace( \"'\", '&#39;', $data['question'] ).\"',\\n\";\n \t\t\t\n \t\t\t$data['multi']\t = isset($data['multi']) ? intval($data['multi']) : 0;\n \t\t\t$poll_multi \t.= \"\\t{$question_id} : '\".$data['multi'].\"',\\n\";\n \t\t\t\n \t\t\tforeach( $data['choice'] as $choice_id => $text )\n\t\t\t\t\t{\n\t\t\t\t\t\t$choice = $text;\n\t\t\t\t\t\t$votes = intval($data['votes'][ $choice_id ]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$poll_choices .= \"\\t'{$question_id}_{$choice_id}' : '\".str_replace( \"'\", '&#39;', $choice ).\"',\\n\";\n\t\t\t\t\t\t$poll_votes .= \"\\t'{$question_id}_{$choice_id}' : '\".$votes.\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_only = 0;\n\t\t\t\t\n\t\t\t\tif ( $this->ipsclass->vars['ipb_poll_only'] AND $this->poll_data['poll_only'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$poll_only = \"checked='checked'\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Trim off trailing commas (Safari hates it)\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$poll_questions = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_questions );\n\t\t\t\t$poll_choices = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_choices );\n\t\t\t\t$poll_multi \t= preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_multi );\n\t\t\t\t$poll_votes = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_votes );\n\t\t\t\t\n\t\t\t\t$poll_question = $this->poll_data['poll_question'];\n\t\t\t\t$show_open = $this->poll_data['choices'] ? 1 : 0;\n\t\t\t\t$is_mod = $this->can_add_poll_mod;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print poll box\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$poll_box = $this->ipsclass->compiled_templates['skin_post']->poll_box( $this->max_poll_questions, $this->max_poll_choices_per_question, $poll_questions, $poll_choices, $poll_votes, $show_open, $poll_question, $is_mod, $poll_multi, $poll_only );\n\t\t}\n\t\t\n\t\t$edit_option = \"\";\n\t\t\n\t\tif ($this->ipsclass->member['g_append_edit'])\n\t\t{\n\t\t\t$checked = \"\";\n\t\t\t$show_reason = 0;\n\t\t\t\n\t\t\tif ($this->orig_post['append_edit'])\n\t\t\t{\n\t\t\t\t$checked = \"checked\";\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->moderator['edit_post'] OR $this->ipsclass->member['g_is_supmod'] )\n\t\t\t{\n\t\t\t\t$show_reason = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$edit_option = $this->ipsclass->compiled_templates['skin_post']->add_edit_box( $checked, $show_reason, $this->ipsclass->input['post_edit_reason'] ? $this->ipsclass->input['post_edit_reason'] : $this->orig_post['post_edit_reason'] );\n\t\t}\n\t\t\n\t\t$this->output = str_replace( \"<!--START TABLE-->\" , $start_table , $this->output );\n\t\t$this->output = str_replace( \"<!--NAME FIELDS-->\" , $name_fields , $this->output );\n\t\t$this->output = str_replace( \"<!--POST BOX-->\" , $post_box , $this->output );\n\t\t$this->output = str_replace( \"<!--POLL BOX-->\" , $poll_box , $this->output );\n\t\t$this->output = str_replace( \"<!--POST ICONS-->\" , $post_icons , $this->output );\n\t\t$this->output = str_replace( \"<!--END TABLE-->\" , $end_form , $this->output );\n\t\t$this->output = str_replace( \"<!--UPLOAD FIELD-->\", $upload_field , $this->output );\n\t\t$this->output = str_replace( \"<!--MOD OPTIONS-->\" , $edit_option . $mod_options , $this->output );\n\t\t$this->output = str_replace( \"<!--FORUM RULES-->\" , $this->ipsclass->print_forum_rules($this->forum), $this->output );\n\t\t$this->output = str_replace( \"<!--TOPIC TITLE-->\" , $topic_title , $this->output );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Add in siggy buttons and such\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->input['post_htmlstatus'] = $this->orig_post['post_htmlstate'];\n\t\t$this->ipsclass->input['enablesig']\t\t = $this->orig_post['use_sig'];\n\t\t$this->ipsclass->input['enableemo']\t\t = $this->orig_post['use_emo'];\n\t\t\n\t\t$this->html_checkboxes('edit', $this->topic['tid'], $this->forum['id']);\n\t\t\n\t\t$this->html_topic_summary( $this->topic['tid'] );\n\t\t\n\t\t$this->show_post_navigation();\n\t\t\t\t\t\t \n\t\t$this->title = $this->ipsclass->lang['editing_post'].' '.$this->topic['title'];\n\t\t\n\t\t$this->ipsclass->print->add_output( $this->output );\n\t\t\n $this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name'].\" -> \".$this->title,\n \t\t\t\t\t \t 'JS' => 1,\n \t\t\t\t\t \t 'NAV' => $this->nav,\n \t\t\t\t\t ) );\n\t}", "function displayData_Textbox($strInput)\n{\n\t$strInput = convertHTML(stripslashes($strInput));\n\treturn $strInput;\n}", "function showPreview() {\r\n $tpl = new tpl('gbook');\r\n $tpl->set(\"TEXT\", BBcode(escape($_POST[\"txt\"], \"textarea\")));\r\n $tpl->out('preview');\r\n}", "function Chkinput($data) \r\n{\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "function cek_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function acf_get_textarea_input($attrs = array())\n{\n}", "function santitise_input($data) {\n $data = trim($data);\n //Removing backslashes.\n $data = stripslashes($data);\n //Removing HTML special/control characters.\n $data = htmlspecialchars($data);\n return $data; \n }", "function input($data)\r\n {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function getPostText(){\n // htmlspecialchars\n // striptags\n // br\n // return it\n\n if (strlen($_POST[\"upost\"]) > 15000){\n echo \"Fuck off with wall of text, we can't read\";\n die;\n }else{\n $result=htmlspecialchars($_POST[\"upost\"]);\n $result=strip_tags($result);\n $result=str_replace(\"\\n\", \"<br>\", $result);\n if (substr_count($result, \"<br>\")>35){\n echo \"Fuck off with your reddit spacing, we can't read this\";\n die;\n }\n return $result;\n }\n\n }", "function funcs_processForm($text,$fields){\n\t//do not scan the text if the fields are empty\n\tif (empty($fields)){\n\t\treturn $text;\n\t}\n\t$pos = 0;\n\t$element = '<';\n\t//iterate through each element\n\twhile (($pos = strpos($text,$element,$pos)) !== false){\n\t\tif (preg_match('/^<input$/i',substr($text,$pos,6))){\n\t\t\t$tag_type = 1;\n\t\t\t$element2 = '>';\n\t\t}elseif (preg_match('/^<select$/i',substr($text,$pos,7))){\n\t\t\t$tag_type = 2;\n\t\t\t$element2 = '</select>';\n\t\t}elseif (preg_match('/^<textarea$/i',substr($text,$pos,9))){\n\t\t\t$tag_type = 3;\n\t\t\t$element2 = '</textarea>';\n\t\t}else{\n\t\t\t$pos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\t//keep grabing pieces with bigger size while not full element object\n\t\t$size = 50;\n\t\tdo{\n\t\t\t$grabed_string =& substr($text,$pos,$size);\n\t\t\t$size += 10;\n\t\t}while(($secPos = strpos($grabed_string,$element2)) === false);\n\t\t$grabed_string = substr($grabed_string,0,$secPos+strlen($element2));\n\t\tif ($tag_type == 1){\n\t\t\t//get element's properties\n\t\t\t$type = preg_replace('/^.*type=[\\'\"]?([^\"\\'> ]+).*$/is','\\\\1',$grabed_string);\n\t\t\t$name = preg_replace('/^.*name=[\\'\"]?([^\"\\'> ]+).*$/is','\\\\1',$grabed_string);\n\t\t\tif (preg_match('/^.*value=[\\'\"]?([^\"\\'> ]+).*$/i',$grabed_string)){\n\t\t\t\t$value = preg_replace('/^.*value=[\\'\"]?([^\"\\'> ]+).*$/is','\\\\1',$grabed_string);\n\t\t\t}else{\n\t\t\t\t$value = null;\n\t\t\t}\n\t\t\tif (($type == 'checkbox' || $type == 'radio')\n\t\t\t\t\t&& isset($fields[$name]) && $fields[$name] == $value ){\n\t\t\t\t//need to select this value\n\t\t\t\t$replacement = ' checked>';\n\t\t\t\t$new_string = str_replace('>',$replacement,$grabed_string);\n\t\t\t\t$text =& substr_replace($text,$new_string,$pos,strlen($grabed_string));\n\t\t\t}elseif(($type == 'text' || $type == 'hidden') && isset($fields[$name])){\n\t\t\t\t$replacement = ' value=\"'.$fields[$name].'\">';\n\t\t\t\t$new_string = preg_replace('/value=[^ >]+/','',$grabed_string);\n\t\t\t\t$new_string = str_replace('>',$replacement,$new_string);\n\t\t\t\t$text =& substr_replace($text,$new_string,$pos,strlen($grabed_string));\n\t\t\t}\n\t\t}elseif($tag_type == 2){\n\t\t\t//select tag\n\t\t\t$names = array();\n\t\t\tpreg_match('/name=[\\'\"]?([^\"\\'\\> ]+)/i',$grabed_string,$names);\n\t\t\t$name = preg_replace('/^.*=[\\'\"]?(.+)$/i','\\\\1',$names[0]);\n\t\t\tif (isset($fields[$name])){\n\t\t\t\tif ($fields[$name] !== ''){\n\t\t\t\t\t$new_string = preg_replace('/(<option[^>]+value=[\\'\"]?'.$fields[$name].'\\b[\\'\"]?[^\\/>]*)([\\/]?)>/i','\\\\1 selected\\\\2>',$grabed_string);\n\t\t\t\t}else{\n\t\t\t\t\t$new_string = preg_replace('/(<option[^>]+value=[\\'\"][\\'\"][^\\/>]*)([\\/]?)>/i','\\\\1 selected\\\\2>',$grabed_string);\n\t\t\t\t}\n\t\t\t\t$text = substr_replace($text,$new_string,$pos,strlen($grabed_string));\n\t\t\t}\n\t\t}elseif($tag_type == 3){\n\t\t\t//textarea tag\n\t\t\t$names = array();\n\t\t\tpreg_match('/name=[\\'\"]?([^\"\\'\\> ]+)/i',$grabed_string,$names);\n\t\t\t$name = preg_replace('/^.*=[\\'\"]?(.+)$/i','\\\\1',$names[0]);\n\t\t\tif (isset($fields[$name])){\n\t\t\t\t$pos1st = strpos($grabed_string,'>');\n\t\t\t\t$replacement = $fields[$name];\n\t\t\t\t$length = strlen($grabed_string)-($pos1st+1);\n\t\t\t\t$new_string = substr_replace($grabed_string,\n\t\t\t\t\t$replacement.'</textarea>',$pos1st+1,\n\t\t\t\t\t$length);\n\t\t\t\t$text =& substr_replace($text,$new_string,$pos,strlen($grabed_string));\n\t\t\t}\n\t\t}\n\t\t$pos += $secPos;\n\t}\n\treturn $text;\n}", "function input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "function input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function barnelli_wp_text_input($field) {\n\tglobal $thepostid, $post, $vision;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['placeholder'] \t= isset( $field['placeholder'] ) ? $field['placeholder'] : '';\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'short';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\t$field['name'] \t\t\t= isset( $field['name'] ) ? $field['name'] : $field['id'];\n\t$field['type'] \t\t\t= isset( $field['type'] ) ? $field['type'] : 'text';\n\n\t// Custom attribute handling\n\t$custom_attributes = array();\n\n\tif ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) )\n\t\tforeach ( $field['custom_attributes'] as $attribute => $value )\n\t\t\t$custom_attributes[] = esc_attr( $attribute ) . '=\"' . esc_attr( $value ) . '\"';\n\n\techo '<p class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><label for=\"' . esc_attr( $field['id'] ) . '\">' . wp_kses_post( $field['label'] ) . '</label><input type=\"' . esc_attr( $field['type'] ) . '\" class=\"' . esc_attr( $field['class'] ) . '\" name=\"' . esc_attr( $field['name'] ) . '\" id=\"' . esc_attr( $field['id'] ) . '\" value=\"' . esc_attr( $field['value'] ) . '\" placeholder=\"' . esc_attr( $field['placeholder'] ) . '\" ' . implode( ' ', $custom_attributes ) . ' /> ';\n\n\tif ( ! empty( $field['description'] ) ) {\n\n\t\tif ( isset( $field['desc_tip'] ) ) {\n\t\t\techo '<img class=\"help_tip\" data-tip=\"' . esc_attr( $field['description'] ) . '\" src=\"' . $vision->plugin_url() . '/assets/images/help.png\" height=\"16\" width=\"16\" />';\n\t\t} else {\n\t\t\techo '<span class=\"description\">' . wp_kses_post( $field['description'] ) . '</span>';\n\t\t}\n\n\t}\n\techo '</p>';\n}" ]
[ "0.69879556", "0.6888469", "0.6513916", "0.64248264", "0.63510996", "0.629223", "0.618613", "0.6139128", "0.60987395", "0.60081214", "0.6005362", "0.5989194", "0.59831065", "0.59759784", "0.59340274", "0.592039", "0.5915888", "0.58737713", "0.5866813", "0.58386433", "0.5837986", "0.58320767", "0.582022", "0.5753634", "0.572467", "0.5722567", "0.5698255", "0.56954676", "0.56954676", "0.56830776" ]
0.723241
0
/ txt_form2raw Converts textarea to raw / Unconvert text for use in a textarea
function txt_form2raw($t="") { $t = str_replace( "&#036;", '$' , $t); $t = str_replace( "&#092;", '\\', $t ); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function txt_raw2form($t=\"\")\n\t{\n\t\t$t = str_replace( '$', \"&#036;\", $t);\n\t\t\t\n\t\tif ( $this->get_magic_quotes )\n\t\t{\n\t\t\t$t = stripslashes($t);\n\t\t}\n\t\t\n\t\t$t = preg_replace( \"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $t );\n\t\t\n\t\t//---------------------------------------\n\t\t// Make sure macros aren't converted\n\t\t//---------------------------------------\n\t\t\n\t\t$t = preg_replace( \"/<{(.+?)}>/\", \"&lt;{\\\\1}&gt;\", $t );\n\t\t\n\t\treturn $t;\n\t}", "public static function decode_textarea( $value ) {\n if( empty( $value ) ) return $value;\n if( ( !empty( $value ) ) && ( is_string ( $value ) ) ) {\n return esc_html(stripslashes($value));\n }\n }", "public static function renderTextarea();", "function tc_sanitize_textarea( $value) {\r\n $value = esc_html( $value);\r\n return $value;\r\n }", "function _xss_sanitization_esc_textarea( $text ) {\n $safe_text = htmlspecialchars( $text, ENT_QUOTES );\n return $safe_text;\n}", "public static function convert_textarea_field() {\n\n\t\t// Create a new Textarea field.\n\t\tself::$field = new GF_Field_Textarea();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Textarea specific properties.\n\t\tself::$field->useRichTextEditor = rgar( self::$nf_field, 'textarea_rte' );\n\n\t}", "public function textarea()\n {\n return $this->content(false, false, false, true);\n }", "function sanitize_textarea_field($str)\n {\n }", "function esc_textarea($text)\n {\n }", "function prepareTextareaOutput($txt_output)\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\treturn ilUtil::prepareTextareaOutput($txt_output, $prepare_for_latex_output);\n\t}", "public static function decode_textarea_v5( $v, $value ) {\n if( empty( $value ) ) return $value;\n if( ( !empty( $value ) ) && ( is_string ( $value ) ) ) {\n if($v['type']==='html'){\n return stripslashes($value);\n }\n return esc_html(stripslashes($value));\n }\n }", "function bb2html($text)\n{\n $bbcode = array(\n \"[list]\", \"[*]\", \"[/list]\", \n \"[img]\", \"[/img]\", \n \"[b]\", \"[/b]\", \n \"[u]\", \"[/u]\", \n \"[i]\", \"[/i]\",\n '[color=\"', \"[/color]\",\n \"[size=\\\"\", \"[/size]\",\n '[url=\"', \"[/url]\",\n \"[mail=\\\"\", \"[/mail]\",\n \"[code]\", \"[/code]\",\n \"[quote]\", \"[/quote]\",\n '\"]');\n $htmlcode = array(\n \"<ul>\", \"<li>\", \"</ul>\", \n \"<img src=\\\"\", \"\\\">\", \n \"<b>\", \"</b>\", \n \"<u>\", \"</u>\", \n \"<i>\", \"</i>\",\n \"<span style=\\\"color:\", \"</span>\",\n \"<span style=\\\"font-size:\", \"</span>\",\n '<a target=\"_blank\" href=\"', \"</a>\",\n \"<a href=\\\"mailto:\", \"</a>\",\n \"<code>\", \"</code>\",\n \"<blockquote><i>\", \"</i></blockquote>\",\n '\">');\n $newtext = str_replace($bbcode, $htmlcode, $text);\n //$newtext = nl2br($newtext);//second pass\n return $newtext;\n}", "function acf_get_textarea_input($attrs = array())\n{\n}", "function string_textarea( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\treturn $p_string;\r\n}", "function showPreview() {\r\n $tpl = new tpl('gbook');\r\n $tpl->set(\"TEXT\", BBcode(escape($_POST[\"txt\"], \"textarea\")));\r\n $tpl->out('preview');\r\n}", "function txt_bbcode($var) {\n\n $txt = utf8_encode(html_entity_decode($var));\n\n return $txt;\n}", "function handleFormInput($a_text, $a_stripslashes = true)\n\t{\n\t\t$a_text = str_replace(\"<\", \"&lt;\", $a_text);\n\t\t$a_text = str_replace(\">\", \"&gt;\", $a_text);\n\t\tif($a_stripslashes)\n\t\t\t$a_text = ilUtil::stripSlashes($a_text);\n\t\t\n\t\treturn $a_text;\n\t}", "public static function textarea($form, $model, $field) {\n $options = [];\n $template =\"{label}\\n{input}\\n{hint}\\n{error}\";\n\n if (!isset($field['name'])) return; \n\n foreach (['placeholder', 'value', 'id', 'class'] as $key => $value) {\n if (isset($field[$value])) {\n $options[$value] = $field[$value];\n }\n }\n\n $text_area = $form->field($model, $field['name'])->textArea($options);\n $text_area->label($field['label'] ?? false);\n\n return $text_area;\n }", "public function textArea($text){\n $text['label'] = isset($text['label']) ? $text['label'] : 'Enter Password Here: ';\n\t\t$text['value'] = isset($text['value']) ? $text['value'] : '';\n\t\t$text['name'] = isset($text['name']) ? $text['name'] : '';\n\t\t$text['class'] = isset($text['class']) ?\"textarea \".$text['class'] : 'textarea';\n $text['extraAtt'] = isset($text['extraAtt']) ? ' '.$text['extraAtt'] : '';\n $text['onlyField'] = isset($text['onlyField']) ? $text['onlyField'] : false;\n\n if($text[\"onlyField\"]== true){\n return '<textarea class=\"'.$text['class'].'\" name=\"'.$text['name'].'\" id=\"'.$text['name'].'\" '.$text['extraAtt'].' >'.$text['value'].'</textarea>';\n }\n else{\n\t\t\treturn '<div class=\"flclear clearfix\"></div>\n\t\t\t\t<label for=\"'.$text['name'].'\">'.$text['label'].'&nbsp;</label>\n \t <textarea class=\"'.$text['class'].'\" name=\"'.$text['name'].'\" id=\"'.$text['name'].'\" '.$text['extraAtt'].' >'.$text['value'].'</textarea>';\n\t\t}\n\t}", "public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}", "function tlspi_make_text_area() { ?>\n\t<div class=\"wrap\"> \n\t\t<h1>The La Source Newspaper Post Importer</h1> \n \n\t\t<form method=\"post\" action=\"\"> \n\t\t\t<label>copy and paste document here... <br />\n\t\t\t<textarea rows=\"60\" cols=\"100\" name=\"preview\" id=\"code\" ></textarea> </label>\n\t\t\t\n\t\t\t<br> \n\t\t\t<input type =\"submit\" value=\"Preview\" name=\"submit\" class=\"button-primary\"> \n\t\t\t<br>\n\t\t</form> <br> \n\t\t<script>\n\t\t\tvar editor = CodeMirror.fromTextArea(document.getElementById(\"code\"), {\n\t\t\t\tmode: { name: \"xml\", alignCDATA: true},\n\t\t\t\tlineNumbers: true\n\t\t\t});\n\t\t</script>\n\t</div>\n<?php\n}", "function pdfChars_Textarea($string){\n \n\t$string = trim($string);\n\t$string = stripslashes($string);\n\t$string = convertToHtml($string);\n\t\n\t$string = str_replace ('&euro;', '€', $string);\n\t$string = str_replace ('&bull;', '•', $string);\n\t$string = htmlentities($string, ENT_QUOTES, 'UTF-8');\n\t\n\t$string = nl2br($string);\n\t\n\treturn $string;\n}", "function get_textarea_questions($form_id){\n $this->db->select('questions.question_label, questions.question_type, questions.question_id');\n $this->db->from('questions');\n $this->db->where('questions.question_form', $form_id);\n $this->db->where('questions.question_type', 'textarea');\n\n return $this->db->get()->result_array();\n }", "public static function txt2html($txt) {\n\n\t//Kills double spaces and spaces inside tags.\n\t// while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n if( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n\n\t$txt = str_replace(' >','>',$txt);\n\t$txt = str_replace('< ','<',$txt);\n\n\t//Transforms accents in html entities.\n\t$txt = utf8_decode($txt);\n\t$txt = htmlentities($txt);\n\n\t//We need some HTML entities back!\n\t$txt = str_replace('&quot;','\"',$txt);\n\t$txt = str_replace('&lt;','<',$txt);\n\t$txt = str_replace('&gt;','>',$txt);\n\t$txt = str_replace('&amp;','&',$txt);\n\t\n\t//Ajdusts links - anything starting with HTTP opens in a new window\n\t$txt = WA_String::stri_replace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\n\t$txt = WA_String::stri_replace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\n\n\t//Basic formatting\n\t$eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\n\t$html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\n $html = str_replace(\"$eol\",\"<br />\\n\",$html);\n\t$html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\n\t$html = str_replace(\"<p></p>\",\"<p>&nbsp;</p>\",$html);\n\n\t//Wipes <br> after block tags (for when the user includes some html in the text).\n\t$wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\n\n\tfor($x = 0; $x < count($wipebr); $x++) {\n \t $tag = $wipebr[$x];\n \t $html = WA_String::stri_replace(\"<$tag><br />\",\"<$tag>\",$html);\n \t $html = WA_String::stri_replace(\"</$tag><br />\",\"</$tag>\",$html);\n\t}\n\n\treturn $html;\n }", "function tep_cfg_textarea($text) {\n return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);\n}", "function Rec($text)\n {\n $text = htmlspecialchars(trim($text), ENT_QUOTES);\n if (1 === get_magic_quotes_gpc())\n {\n $text = stripslashes($text);\n }\n \n $text = nl2br($text);\n return $text;\n }", "function echo_textarea($array) {\n if (!isset($array[\"prefill\"])) $array[\"prefill\"] = \"\";\n if (!isset($array[\"height\"])) $array[\"height\"] = \"\";\n echo '<div class=\"form-group\"><label for=\"' . hsc($array[\"id\"]) . '\">' . $array[\"title\"] . '</label>';\n if (isset($array[\"width\"]) and $array[\"width\"] != \"\") echo '<div class=\"input-group\" style=\"width:' . hsc($array[\"width\"]) . 'em;\">';\n else echo '<div class=\"input-group\">';\n if ($array[\"height\"] == \"\") $array[\"height\"] = \"5\";\n echo '<textarea id=\"' . hsc($array[\"id\"]) . '\" name=\"' . hsc($array[\"name\"]) . '\" rows=\"' . hsc($array[\"height\"]) . '\" class=\"form-control\"';\n if (isset($array[\"showcounter\"]) and $array[\"showcounter\"]) echo ' onkeyup=\"show_length(value, &quot;' . hsc($array[\"id\"]) . '-counter&quot;);\"';\n if (isset($array[\"disabled\"]) and $array[\"disabled\"]) echo ' disabled=\"disabled\"';\n if (isset($array[\"jspart\"]) and $array[\"jspart\"] != \"\") echo ' ' . $array[\"jspart\"];\n echo \">\";\n echo hsc($array[\"prefill\"]) . '</textarea>';\n echo '</div>';\n if (isset($array[\"showcounter\"]) and $array[\"showcounter\"]) echo '<div id=\"' . hsc($array[\"id\"]) . '-counter\" class=\"small text-right text-md-left text-muted\">現在 - 文字</div>';\n echo '<div id=\"' . hsc($array[\"id\"]) . '-errortext\" class=\"system-form-error\"></div>';\n if (isset($array[\"detail\"])) echo '<small class=\"form-text\">' . $array[\"detail\"] . '</small>';\n echo '</div>';\n}", "function format_text($text, $convert_to_html = true)\r\n{\r\n\tGLOBAL $TRENNZEICHEN;\r\n \tif ($convert_to_html) $text = htmlentities($text);\r\n\t$text = nl2br($text);\r\n\t$text = str_replace(\"\\n\",\"\",$text);\r\n\t$text = str_replace(chr(13),\"\",$text);\r\n\t$text = str_replace($TRENNZEICHEN,\"\",$text);\r\n\t$text = do_ubb($text);\r\n\t$text = trim($text);\r\n\treturn($text);\r\n}", "function dokan_posted_textarea( $key ) {\n $value = isset( $_POST[$key] ) ? trim( $_POST[$key] ) : '';\n\n return esc_textarea( $value );\n}", "function olc_cfg_textarea($text) {\n\treturn olc_draw_textarea_field('configuration_value', false, 50, 5, $text);\n}" ]
[ "0.7058236", "0.6161517", "0.61583763", "0.610909", "0.6058505", "0.602306", "0.5973431", "0.5933202", "0.5923407", "0.58930415", "0.5853826", "0.5842083", "0.57413894", "0.5731666", "0.5707808", "0.5706065", "0.561894", "0.5610119", "0.5604654", "0.5593133", "0.55853754", "0.558276", "0.5576167", "0.5562189", "0.5548305", "0.55392516", "0.55384415", "0.5518156", "0.5515313", "0.5483926" ]
0.678968
1
/ txt_htmlspecialchars Custom version of htmlspecialchars to take into account mb chars / htmlspecialchars including multibyte characters
function txt_htmlspecialchars($t="") { // Use forward look up to only convert & not &#123; $t = preg_replace("/&(?!#[0-9]+;)/s", '&amp;', $t ); $t = str_replace( "<", "&lt;" , $t ); $t = str_replace( ">", "&gt;" , $t ); $t = str_replace( '"', "&quot;", $t ); $t = str_replace( "'", '&#039;', $t ); return $t; // A nice cup of? }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function txt_UNhtmlspecialchars($t=\"\")\n\t{\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\n\t\t$t = str_replace( \"&quot;\", '\"', $t );\n\t\t$t = str_replace( \"&#039;\", \"'\", $t );\n\t\t\n\t\treturn $t;\n\t}", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\n}", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function specialchars($text){\n\t\t$newtext = trim($text);\n\t\t$newtext = strip_tags($newtext);\n\t\t$newtext=htmlspecialchars(str_replace('\\\\', '', $newtext),ENT_QUOTES);\n\t\t$newtext=eregi_replace('&amp;','&',$newtext);\n\t\t//$newtext=nl2br($newtext);\n\t\treturn $newtext;\n\t}", "function pun_htmlspecialchars($str)\r\n{\r\n\t$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);\r\n\t$str = str_replace(array('<', '>', '\"'), array('&lt;', '&gt;', '&quot;'), $str);\r\n\r\n\treturn $str;\r\n}", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function hte($str) {\n return htmlspecialchars($str);\n}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "function decodespecialchars($str){\n\t$str = ereg_replace(\"\\n\",\"\\\\n\",$str);\n\t$str = ereg_replace(\"\\r\",\"\\\\r\",$str);\n\t$str=ereg_replace(\"&#039;\",\"'\",$str);\n\t$str=ereg_replace(\"&amp;\",\"&\",$str);\n\t$str=ereg_replace(\"&#59;\",\"\\;\",$str);\n\t$str=ereg_replace(\"&#35;\",\"#\",$str);\n\t$str=ereg_replace(\"&#34;\",'\"',$str);\n\t$str=ereg_replace(\"&#39;\",\"'\",$str);\n\t$str=ereg_replace(\"&#58;\",\":\",$str);\n\t$str=ereg_replace(\"&#47;\",\"\\/\",$str);\n\t$str=ereg_replace(\"&#33;\",\"!\",$str);\n\t$str=ereg_replace(\"&#63;\",\"\\?\",$str);\n\t//special character\n\t$str=ereg_replace(\"&#8218;\",\"�\",$str);\n\t$str=ereg_replace(\"&#402;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8222;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8230;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8224;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8225;\",\"�\",$str);\n\t$str=ereg_replace(\"&#710;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8240;\",\"�\",$str);\n\t$str=ereg_replace(\"&#352;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8249;\",\"�\",$str);\n\t$str=ereg_replace(\"&#338;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8216;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8217;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8220;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8221;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8226;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8211;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8212;\",\"�\",$str);\n\t$str=ereg_replace(\"&#732;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8482;\",\"�\",$str);\n\t$str=ereg_replace(\"&#353;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8250;\",\"�\",$str);\n\t$str=ereg_replace(\"&#339;\",\"�\",$str);\n\t$str=ereg_replace(\"&#376;\",\"�\",$str);\n\t$str=htmlspecialchars_decode($str);\n\treturn $str;\n}", "function htmlSpecialChars( $text )\n\t{\n\t\t//return preg_replace(\"/&amp;/i\", '&', htmlspecialchars($text, ENT_QUOTES));\n\t\treturn preg_replace(array(\"/&amp;/i\", \"/&nbsp;/i\"), array('&', '&amp;nbsp;'), htmlspecialchars($text, ENT_QUOTES));\n\t}", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "static public function esc($txt) {\n return htmlspecialchars($txt);\n }", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "function htmlchars($string = \"\")\n{\n return htmlspecialchars($string, ENT_QUOTES, \"UTF-8\");\n}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function _xss_sanitization_esc_html( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function e($str) {\n return htmlspecialchars($str);\n}", "function textfilter_specialchars($text){\n\t$text = strip_tags(trim($text));\n\t$text = mb_convert_case($text, MB_CASE_LOWER, \"UTF-8\");\n\treturn $text;\n\t}", "function sterilize($input){\r\n return htmlspecialchars($input);\r\n }", "function replacespecialchars($str){\n\t$str=trim($str);\n\t$str=ereg_replace(\"&quot;\",\"\",$str);\n\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t$str=ereg_replace(\"&\",\"&amp;\",$str);\n\t$str=ereg_replace(\"\\;\",\"&#59;\",$str);\n\t$str=ereg_replace(\"-\",\"\",$str);\n\t$str=ereg_replace(\"#\",\"\",$str);\n\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t$str=ereg_replace('\"',\"\",$str);\n\t$str=ereg_replace(\"'\",\"\",$str);\n\t$str=ereg_replace(\",\",\"\",$str);\n\t$str=ereg_replace(\"!\",\"\",$str);\n\t$str=ereg_replace(\"'\",\"\",$str);\n\t$str=ereg_replace(\"&\",\"\",$str);\n\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t$str=ereg_replace(\":\",\"\",$str);\n\t$str=ereg_replace(\",\",\"\",$str);\n\t$str=ereg_replace(\";\",\"\",$str);\n\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t$str=ereg_replace(\"!\",\"\",$str);\n\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t$str=ereg_replace(\" \",\" \",$str);\n\t$str=ereg_replace(\" \",\" \",$str);\n\t$str=ereg_replace(\"�\",\"&#8218;\",$str);\n\t$str=ereg_replace(\"�\",\"&#402;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8222;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8230;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8224;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8225;\",$str);\n\t$str=ereg_replace(\"�\",\"&#710;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8240;\",$str);\n\t$str=ereg_replace(\"�\",\"&#352;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8249;\",$str);\n\t$str=ereg_replace(\"�\",\"&#338;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8216;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8217;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8220;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8221;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8226;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8211;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8212;\",$str);\n\t$str=ereg_replace(\"�\",\"&#732;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8482;\",$str);\n\t$str=ereg_replace(\"�\",\"&#353;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8250;\",$str);\n\t$str=ereg_replace(\"�\",\"&#339;\",$str);\n\t$str=ereg_replace(\"�\",\"&#376;\",$str);\n\t$str=strtolower($str);\n\treturn $str;\n}" ]
[ "0.7489141", "0.7442882", "0.7271681", "0.72636956", "0.7252097", "0.7232725", "0.71916354", "0.7189217", "0.7167649", "0.71362257", "0.71019214", "0.70363253", "0.70237255", "0.7002638", "0.69754595", "0.697222", "0.6901829", "0.6897342", "0.6884332", "0.68591654", "0.68453", "0.6843354", "0.6830045", "0.6823563", "0.6794935", "0.6794935", "0.6792096", "0.67894286", "0.6785878", "0.67734534" ]
0.76628613
0
/ txt_UNhtmlspecialchars Undoes what the above function does. Yes. / unhtmlspecialchars including multibyte characters
function txt_UNhtmlspecialchars($t="") { $t = str_replace( "&amp;" , "&", $t ); $t = str_replace( "&lt;" , "<", $t ); $t = str_replace( "&gt;" , ">", $t ); $t = str_replace( "&quot;", '"', $t ); $t = str_replace( "&#039;", "'", $t ); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function txt_htmlspecialchars($t=\"\")\n\t{\n\t\t// Use forward look up to only convert & not &#123;\n\t\t$t = preg_replace(\"/&(?!#[0-9]+;)/s\", '&amp;', $t );\n\t\t$t = str_replace( \"<\", \"&lt;\" , $t );\n\t\t$t = str_replace( \">\", \"&gt;\" , $t );\n\t\t$t = str_replace( '\"', \"&quot;\", $t );\n\t\t$t = str_replace( \"'\", '&#039;', $t );\n\t\t\n\t\treturn $t; // A nice cup of?\n\t}", "function pun_htmlspecialchars($str)\r\n{\r\n\t$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);\r\n\t$str = str_replace(array('<', '>', '\"'), array('&lt;', '&gt;', '&quot;'), $str);\r\n\r\n\treturn $str;\r\n}", "public static function fix_text($str) {\r\n\t\treturn htmlspecialchars(utf8_decode($str));\r\n\t}", "function specialchars($text){\n\t\t$newtext = trim($text);\n\t\t$newtext = strip_tags($newtext);\n\t\t$newtext=htmlspecialchars(str_replace('\\\\', '', $newtext),ENT_QUOTES);\n\t\t$newtext=eregi_replace('&amp;','&',$newtext);\n\t\t//$newtext=nl2br($newtext);\n\t\treturn $newtext;\n\t}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function text_tidy($txt = \"\") {\n \n \t$trans = get_html_translation_table(HTML_ENTITIES);\n \t$trans = array_flip($trans);\n \t\n \t$txt = strtr( $txt, $trans );\n \t\n \t$txt = preg_replace( \"/\\s{2}/\" , \"&nbsp; \" , $txt );\n \t$txt = preg_replace( \"/\\r/\" , \"\\n\" , $txt );\n \t$txt = preg_replace( \"/\\t/\" , \"&nbsp;&nbsp;\" , $txt );\n \t//$txt = preg_replace( \"/\\\\n/\" , \"&#92;n\" , $txt );\n \t\n \treturn $txt;\n }", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function decodespecialchars($str){\n\t$str = ereg_replace(\"\\n\",\"\\\\n\",$str);\n\t$str = ereg_replace(\"\\r\",\"\\\\r\",$str);\n\t$str=ereg_replace(\"&#039;\",\"'\",$str);\n\t$str=ereg_replace(\"&amp;\",\"&\",$str);\n\t$str=ereg_replace(\"&#59;\",\"\\;\",$str);\n\t$str=ereg_replace(\"&#35;\",\"#\",$str);\n\t$str=ereg_replace(\"&#34;\",'\"',$str);\n\t$str=ereg_replace(\"&#39;\",\"'\",$str);\n\t$str=ereg_replace(\"&#58;\",\":\",$str);\n\t$str=ereg_replace(\"&#47;\",\"\\/\",$str);\n\t$str=ereg_replace(\"&#33;\",\"!\",$str);\n\t$str=ereg_replace(\"&#63;\",\"\\?\",$str);\n\t//special character\n\t$str=ereg_replace(\"&#8218;\",\"�\",$str);\n\t$str=ereg_replace(\"&#402;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8222;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8230;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8224;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8225;\",\"�\",$str);\n\t$str=ereg_replace(\"&#710;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8240;\",\"�\",$str);\n\t$str=ereg_replace(\"&#352;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8249;\",\"�\",$str);\n\t$str=ereg_replace(\"&#338;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8216;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8217;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8220;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8221;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8226;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8211;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8212;\",\"�\",$str);\n\t$str=ereg_replace(\"&#732;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8482;\",\"�\",$str);\n\t$str=ereg_replace(\"&#353;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8250;\",\"�\",$str);\n\t$str=ereg_replace(\"&#339;\",\"�\",$str);\n\t$str=ereg_replace(\"&#376;\",\"�\",$str);\n\t$str=htmlspecialchars_decode($str);\n\treturn $str;\n}", "function hte($str) {\n return htmlspecialchars($str);\n}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\n}", "function sanitize_utf8($str){\n return htmlentities($str);\n }", "function unformatText ($text) {\n\treturn html_entity_decode (strip_tags ($text), ENT_COMPAT, 'UTF-8');\n}", "function cleanText($text)\n{\n\t$text = strtolower($text);\n\t//$text = iconv('utf-8', 'ascii//TRANSLIT', $text);\n\t$text = preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities($text));\n\t$text = preg_replace(\"#[[:punct:]]#\", \"\", $text);\n\treturn ($text);\n}", "function removeHtmlAccentLigature($str) {\n $str = htmlentities($str, ENT_NOQUOTES, 'utf-8');\n $str = preg_replace('#&([A-Za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml|space);#', '\\1', $str); // Supréssion accent passe 1 \n $str = preg_replace('#&([A-Za-z]{2})(?:lig);#', '\\1', $str); // Transformations des ligatures \n //echo \"Supression des accents HTML : $str<br>\";\n return $str;\n }", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "function ___($text) {\n return htmlspecialchars($text);\n}", "function e($str) {\n return htmlspecialchars($str);\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function rteSafe($strText) {\n $tmpString = $strText;\n\n //convert all types of single quotes\n $tmpString = str_replace(chr(145), chr(39), $tmpString);\n $tmpString = str_replace(chr(146), chr(39), $tmpString);\n $tmpString = str_replace(\"'\", \"&#39;\", $tmpString);\n\n //convert all types of double quotes\n $tmpString = str_replace(chr(147), chr(34), $tmpString);\n $tmpString = str_replace(chr(148), chr(34), $tmpString);\n//\t$tmpString = str_replace(\"\\\"\", \"\\\"\", $tmpString);\n\n //replace carriage returns & line feeds\n $tmpString = str_replace(chr(10), \" \", $tmpString);\n $tmpString = str_replace(chr(13), \" \", $tmpString);\n\n return $tmpString;\n }" ]
[ "0.7914348", "0.7556317", "0.7418623", "0.7351419", "0.7066704", "0.70248836", "0.68657094", "0.6857299", "0.6836749", "0.68365335", "0.6782014", "0.67743665", "0.67698944", "0.6754196", "0.67261845", "0.6693081", "0.66922355", "0.6678459", "0.6660683", "0.6639238", "0.66081166", "0.65913635", "0.6575501", "0.65498304", "0.65488744", "0.65485317", "0.65447384", "0.6533658", "0.6529163", "0.6505962" ]
0.8423929
0
/ return_md5_check md5 hash for server side validation of form / link stuff / Return MD5 hash for use in forms
function return_md5_check() { if ( $this->member['id'] ) { return md5( $this->member['email'].'&'.$this->member['member_login_key'].'&'.$this->member['joined'] ); } else { return md5("this is only here to prevent it breaking on guests"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateMD5Pass() {\n $plaintext = $this->generator->generateString(8, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^+');\n $hash = md5($plaintext);\n return $hash;\n }", "public function hashValidation(){\n\t\t$this->hash_validation = md5(uniqid(rand(), true).$this->email); \n\t\treturn $this->hash_validation;\n\t}", "function canMd5()\n {\n return false;\n }", "function calc_md5_response($trans_id = '', $amount = '') {\r\n if ($amount == '' || $amount == '0') $amount = '0.00';\r\n $validating = md5(MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH . MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN . $trans_id . $amount);\r\n return strtoupper($validating);\r\n }", "function is_md5($str)\n{\n\t//return false;\n\treturn preg_match(\"/^[a-f0-9]{32}$/i\", $str);\n}", "public function getMd5(): string;", "protected function calculateHash()\n {\n return md5((string)$this->toCookie());\n }", "function _digestMd5Login($challenge) {\n $result = $this->_digestmd5_parse_challenge($challenge);\n\n // verify server supports qop=auth\n // $qop = explode(\",\",$result['qop']);\n //if (!in_array(\"auth\",$qop)) {\n // rfc2831: client MUST fail if no qop methods supported\n // return false;\n //}\n $cnonce = base64_encode(bin2hex($this->_hmac_md5(microtime())));\n $ncount = \"00000001\";\n\n /* This can be auth (authentication only), auth-int (integrity protection), or\n auth-conf (confidentiality protection). Right now only auth is supported.\n DO NOT CHANGE THIS VALUE */\n $qop_value = \"auth\";\n\n $digest_uri_value = 'smtp/'.$this->SERVER;\n\n // build the $response_value\n //FIXME This will probably break badly if a server sends more than one realm\n $string_a1 = utf8_encode($this->AUTHID).\":\";\n $string_a1 .= utf8_encode($result['realm']).\":\";\n $string_a1 .= utf8_encode($this->AUTHPWD);\n $string_a1 = $this->_hmac_md5($string_a1);\n $A1 = $string_a1 . \":\" . $result['nonce'] . \":\" . $cnonce;\n $A1 = bin2hex($this->_hmac_md5($A1));\n $A2 = \"AUTHENTICATE:$digest_uri_value\";\n // If qop is auth-int or auth-conf, A2 gets a little extra\n if ($qop_value != 'auth') {\n $A2 .= ':00000000000000000000000000000000';\n }\n $A2 = bin2hex($this->_hmac_md5($A2));\n\n $string_response = $result['nonce'] . ':' . $ncount . ':' . $cnonce . ':' . $qop_value;\n $response_value = bin2hex($this->_hmac_md5($A1.\":\".$string_response.\":\".$A2));\n\n $response = 'charset=utf-8,username=\"' . $this->AUTHID . '\",realm=\"' . $result[\"realm\"] . '\",';\n $response .= 'nonce=\"' . $result['nonce'] . '\",nc=' . $ncount . ',cnonce=\"' . $cnonce . '\",';\n $response .= \"digest-uri=\\\"$digest_uri_value\\\",response=$response_value\";\n $response .= ',qop=' . $qop_value;\n $response = base64_encode($reply);\n return $response . \"\\r\\n\";\n\n}", "public function hasMd5checksum(){\n return $this->_has(3);\n }", "public function hasMd5checksum(){\n return $this->_has(3);\n }", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "public function hasMd5() {\n return $this->_has(4);\n }", "public function getMd5()\n {\n return md5($this->accountNumber.$this->apiKey.$this->submission->get());\n }", "public function hasMd5checksums(){\n return $this->_has(1);\n }", "public function hasMd5checksums(){\n return $this->_has(1);\n }", "public function hasMd5() {\n return $this->_has(7);\n }", "function md5_jlife($pswd_in)\n{\n // echo \"SETTING_md5 = \".SETTING_md5.\" > \";\n // echo \"pswd = \".$pswd_in.\" > \";\n // echo \"is = \".((SETTING_md5) ? md5(md5($pswd_in)) : $pswd_in).\" > \";\n // var_dump($pswd_in);\n return (SETTING_md5) ? md5(md5($pswd_in)) : $pswd_in;\n}", "function verify_hash($hash) // Colorize: green\n { // Colorize: green\n return isset($hash) // Colorize: green\n && // Colorize: green\n is_string($hash) // Colorize: green\n && // Colorize: green\n preg_match(MD5_HASH_REGEXP, $hash); // Colorize: green\n }", "public function hash_check(){\n $this->read_hash_file();\n\n // read all files hashes\n $this->read_directory();\n\n // save updated md5 hashes\n $this->save_hash_file();\n \n // log changes\n if(!empty($this->md5_gen_old)){\n $this->save_log_file();\n\n // email changes\n if($this->email)\n $this->emailChanges(); \n }\n }", "public static function md5() {\n return md5(uniqid(mt_rand(), true));\n }", "function _authDigest_MD5($uid, $pwd, $euser)\n {\n if ( PEAR::isError( $challenge = $this->_doCmd('AUTHENTICATE \"DIGEST-MD5\"') ) ) {\n $this->_error=challenge ;\n return challenge ;\n }\n $challenge = base64_decode( $challenge );\n $digest = &Auth_SASL::factory('digestmd5');\n\n if(PEAR::isError($param=$digest->getResponse($uid, $pwd, $challenge, \"localhost\", \"sieve\" , $euser) )) {\n return $param;\n }\n $auth_str = base64_encode($param);\n\n if ( PEAR::isError($error = $this->_sendStringResponse( $auth_str ) ) ) {\n $this->_error=$error;\n return $error;\n }\n\n if ( PEAR::isError( $challenge = $this->_doCmd() ) ) {\n $this->_error=$challenge ;\n return $challenge ;\n }\n\n if( strtoupper(substr($challenge,0,2))== 'OK' ){\n return true;\n }\n\n /**\n * We don't use the protocol's third step because SIEVE doesn't allow\n * subsequent authentication, so we just silently ignore it.\n */\n if ( PEAR::isError($error = $this->_sendStringResponse( '' ) ) ) {\n $this->_error=$error;\n return $error;\n }\n\n if (PEAR::isError($res = $this->_doCmd() )) {\n return $res;\n }\n }", "public function filecheck() {\r\n\t\treturn md5($this->get('file').$this->config->get('secret').date('Y-m-d'));\r\n\t}", "function _authCRAM_MD5($uid, $pwd, $euser)\n {\n if ( PEAR::isError( $challenge = $this->_doCmd( 'AUTHENTICATE \"CRAM-MD5\"' ) ) ) {\n $this->_error=challenge ;\n return challenge ;\n }\n $challenge=trim($challenge);\n $challenge = base64_decode( trim($challenge) );\n $cram = &Auth_SASL::factory('crammd5');\n if ( PEAR::isError($resp=$cram->getResponse( $uid , $pwd , $challenge ) ) ) {\n $this->_error=$resp;\n return $resp;\n }\n $auth_str = base64_encode( $resp );\n if ( PEAR::isError($error = $this->_sendStringResponse( $auth_str ) ) ) {\n $this->_error=$error;\n return $error;\n }\n\n }", "function _cramMd5Login($challenge){\n $challenge=base64_decode($challenge);\n $hash=bin2hex($this->_hmac_md5($challenge,$this->AUTHPWD));\n $response=base64_encode($this->AUTHID. \" \" . $hash) . \"\\r\\n\";\n return $response;\n }", "public static function md5_hash( $string )\n {\n return '{MD5}'.base64_encode( pack( 'H*', md5( $string ) ) );\n }", "public function get_file_md5() {\n\t\treturn md5_file( $this->file );\n\t}", "public function md5Url($url) {\r\n\t\t$md5edurl['url'] = md5($url);\r\n\r\n\t\t$md5search = $this->find('count', \r\n\t\t\tarray('conditions' => array('unique' => $md5edurl['url'])),\r\n\t\t\tarray('recursive' => -1)\r\n\t\t);\r\n\r\n\t\tif ($md5search > 0) {\r\n\t\t\t$md5edurl['exists'] = true;\r\n\t\t} else {\r\n\t\t\t$md5edurl['exists'] = false;\r\n\t\t}\r\n\r\n\t\treturn $md5edurl;\r\n\t}", "public function checkContentHash() {}", "public function prepare_Security_GetMD5Hash($params)\n\t{\n\t\t$xml_string = \"p_ToHash=\".$params['p_ToHash'].\"\";\n\t\treturn $xml_string;\n\t}", "function rand_md5($length) {\n $max = ceil($length / 32);\n $random = \"\";\n for ($i = 0; $i < $max; $i ++) {\n $random .= md5(microtime(true).mt_rand(10000,90000));\n }\n return substr($random, 0, $length);\n }" ]
[ "0.66176385", "0.66054595", "0.65387625", "0.63927376", "0.63895005", "0.62220514", "0.6186992", "0.61676675", "0.6078118", "0.6078118", "0.6005056", "0.598813", "0.59228694", "0.5911826", "0.5911826", "0.58990574", "0.58788526", "0.58453315", "0.5840223", "0.5833934", "0.58236074", "0.5791256", "0.5781127", "0.5769978", "0.5767001", "0.5752503", "0.5736873", "0.5735979", "0.57171714", "0.5696546" ]
0.7328288
0
Remove trailing comma from comma delim string
function trim_trailing_comma($t) { return preg_replace( "/,$/", "", $t ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _removeCommaForCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return str_replace(',', '', $string);\r\n }", "function stripcomma($str) {\n\treturn str_replace(\",\", \"\", $str);\n}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function stripCSVList($csv_string)\n{\n $arr1 = utf8_explode(',', $csv_string);\n for ($i=0; $i<count($arr1); $i++) {\n $arr1[$i] = trim($arr1[$i]);\n }\n return implode(',',$arr1);\n}", "function clean_comma($t)\n\t{\n\t\treturn preg_replace( \"/,{2,}/\", \",\", $t );\n\t}", "function trim_leading_comma($t)\n\t{\n\t\treturn preg_replace( \"/^,/\", \"\", $t );\n\t}", "function clncomma($myfdval) {\n\t\tif (@ereg(\",,\", $myfdval)) {\n\t\t\t// it has double comma, so clean up\n\t\t\t$samyf = trim($myfdval);\n $samyf = str_replace(\",,\",\",\",$myfdval);\n return $samyf;\n\t\t}\n\t\telse {\n\t\t\treturn $myfdval;\n\t\t}\n\n\t}", "function replacecomma($string) {\n$string = preg_replace('#\\s+#',', ',trim($string));\nreturn $string;\n}", "function cleansep($value)\n{\n\treturn str_replace(array(',',';'), '/', $value);\n}", "public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider() {}", "function removeFromString($str, $item) {\n\t$parts = explode(',', $str);\n\n\twhile(($i = array_search($item, $parts)) !== false) {\n\t\tunset($parts[$i]);\n\t}\n\n\treturn implode(',', $parts);\n}", "protected function _getDelimiter() {\n\t\treturn ',';\n\t}", "private function replaceJSEmbeddedComma( $string ) {\n\t\t\n\t\t\tif ( self::$parse_colon )\n\t\t\t\treturn preg_replace( '/[:]/', ',', $string);\n\t\t\telse return $string;\n\t}", "function nl2comma($text)\n{\n\tif($text != NULL)\n\t{\n\t\t$text \t\t= str_replace(\"\\r\", ', ', $text);\n\t\t$length \t= strlen($text);\n\t\t$lastChar \t= substr($text, -1, 1);\n\t\t$lastChars \t= substr($text, -2, 1);\n\t\tif($lastChar == ',') \t{ $text = substr($text, 0, $length-1); }\n\t\tif($lastChars == ',') \t{ $text = substr($text, 0, $length-2); }\n\t}\n\treturn($text);\n}", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "function mCOMMA(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$COMMA;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:663:3: ( ',' ) \n // Tokenizer11.g:664:3: ',' \n {\n $this->matchChar(44); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function delim( $new_string, $existing_string, $delimiter=',' )\n{\n\t\n\treturn $existing_string . ( ( $existing_string == '' ) ? '' : $delimiter ) . $new_string ;\n\n}", "function _replaceQuoteCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return '\"'.str_replace('\"', \"'\", $string).'\"';\r\n }", "public function trimExplode($delim, $string, $removeEmptyValues=false) {\n\t\t$explodedValues = explode($delim, $string);\n\n\t\t$result = array_map('trim', $explodedValues);\n\n\t\tif ($removeEmptyValues) {\n\t\t\t$temp = array();\n\t\t\tforeach ($result as $value) {\n\t\t\t\tif ($value !== '') {\n\t\t\t\t\t$temp[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result = $temp;\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function wt_explode_values_formatter($value) {\n return trim(str_replace('::separator::', ',', $value));\n }", "function commatize($val) {\n\treturn preg_replace('/ /', ',', $val);\n}", "function clean_perms($str)\n\t{\n\t\t$str = preg_replace( \"/,$/\", \"\", $str );\n\t\t$str = str_replace( \",,\", \",\", $str );\n\n\t\treturn $str;\n\t}", "public function trimExplode($delim, $str, $onlyNonEmptyValues = true)\n\t{\n\t\t$arr = array_map('trim', explode($delim, $str));\n\t\treturn $onlyNonEmptyValues ? array_filter($arr, 'strlen') : $arr;\n\t}", "function splitcomma($x){\n $x = substr($x,1,strlen($x)-2);\n\t$x = explode(',',$x);\n\treturn $x;\n}", "public function fix_comma_number($numberStr) {\n if ($numberStr === null) {\n return null;\n }\n $finalNumberStr = $numberStr;\n while (mb_strpos($finalNumberStr, ',') > -1) {\n $finalNumberStr = str_replace(',', '', $finalNumberStr);\n }\n return $finalNumberStr;\n }", "public function testCommaSeparated()\n {\n $this->assertEquals('1,2', StringFilter::joinValues([1, 2]));\n }", "protected static function convertListToCommaSeparated($text)\n {\n return preg_replace('#[ \\t\\n\\r,]+#', ',', $text);\n }", "function makecomma($input)\n\t{\n\t if(strlen($input)<=2)\n\t { return $input; }\n\t $length=substr($input,0,strlen($input)-2);\n\t $formatted_input = makecomma($length).\",\".substr($input,-2);\n\t return $formatted_input;\n\t}", "public static function quoteCsv($val)\n\t{\n\t\tif (!isset($val))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tif (strpos($val, \"\\n\") !== false || strpos($val, ',') !== false)\n\t\t{\n\t\t\treturn '\"' . str_replace(array('\\\\', '\"'), array('\\\\\\\\', '\"\"'), $val) . '\"';\n\t\t}\n\n\t\treturn $val;\n\t}" ]
[ "0.73379046", "0.6939367", "0.6933451", "0.6933451", "0.6655816", "0.6569281", "0.65320086", "0.63713026", "0.6204611", "0.6056173", "0.60175717", "0.5872748", "0.58319247", "0.5724462", "0.5722973", "0.57110345", "0.566132", "0.5653916", "0.5648075", "0.5589658", "0.5560614", "0.5538383", "0.5534622", "0.55273813", "0.55092156", "0.549557", "0.54780895", "0.5461407", "0.54155374", "0.53813785" ]
0.7083119
1
Remove dupe commas from comma delim string
function clean_comma($t) { return preg_replace( "/,{2,}/", ",", $t ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _removeCommaForCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return str_replace(',', '', $string);\r\n }", "function stripcomma($str) {\n\treturn str_replace(\",\", \"\", $str);\n}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function stripCSVList($csv_string)\n{\n $arr1 = utf8_explode(',', $csv_string);\n for ($i=0; $i<count($arr1); $i++) {\n $arr1[$i] = trim($arr1[$i]);\n }\n return implode(',',$arr1);\n}", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "function clncomma($myfdval) {\n\t\tif (@ereg(\",,\", $myfdval)) {\n\t\t\t// it has double comma, so clean up\n\t\t\t$samyf = trim($myfdval);\n $samyf = str_replace(\",,\",\",\",$myfdval);\n return $samyf;\n\t\t}\n\t\telse {\n\t\t\treturn $myfdval;\n\t\t}\n\n\t}", "function replacecomma($string) {\n$string = preg_replace('#\\s+#',', ',trim($string));\nreturn $string;\n}", "function trim_leading_comma($t)\n\t{\n\t\treturn preg_replace( \"/^,/\", \"\", $t );\n\t}", "public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider() {}", "function clean_perms($str)\n\t{\n\t\t$str = preg_replace( \"/,$/\", \"\", $str );\n\t\t$str = str_replace( \",,\", \",\", $str );\n\n\t\treturn $str;\n\t}", "function trim_trailing_comma($t)\n\t{\n\t\treturn preg_replace( \"/,$/\", \"\", $t );\n\t}", "function commatize($val) {\n\treturn preg_replace('/ /', ',', $val);\n}", "function removeFromString($str, $item) {\n\t$parts = explode(',', $str);\n\n\twhile(($i = array_search($item, $parts)) !== false) {\n\t\tunset($parts[$i]);\n\t}\n\n\treturn implode(',', $parts);\n}", "function havecomma1($mystr) {\n\t\tif (ereg(\",\", $mystr)) {\n\t\t\t// more than one record, so it can be exploded\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function cleansep($value)\n{\n\treturn str_replace(array(',',';'), '/', $value);\n}", "function mCOMMA(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$COMMA;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:663:3: ( ',' ) \n // Tokenizer11.g:664:3: ',' \n {\n $this->matchChar(44); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function replaceJSEmbeddedComma( $string ) {\n\t\t\n\t\t\tif ( self::$parse_colon )\n\t\t\t\treturn preg_replace( '/[:]/', ',', $string);\n\t\t\telse return $string;\n\t}", "function comma_explode( $array_string ){\n\t$new_arr = explode( ',', $array_string );\n\n\t$output = array();\n\n // Clean each item\n\tforeach( $new_arr as $item ){\n\t\t\n // Trim whitespace\n\t\t$new_item = trim( $item );\n\t\t\n // Check the item is not blank\n\t\tif( strlen( $new_item ) > 0 ){\n\t\t\t\n\t\t\t$output[] = $new_item;\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n // Return array\n\treturn $output;\n\t\n\t\n}", "function splitcomma($x){\n $x = substr($x,1,strlen($x)-2);\n\t$x = explode(',',$x);\n\treturn $x;\n}", "public function testCommaSeparated()\n {\n $this->assertEquals('1,2', StringFilter::joinValues([1, 2]));\n }", "function virgule($nombre)\n{\n\t$nombre = preg_replace('#(.+),(.+)#','$1.$2',$nombre);\n\treturn $nombre;\n}", "public function fix_comma_number($numberStr) {\n if ($numberStr === null) {\n return null;\n }\n $finalNumberStr = $numberStr;\n while (mb_strpos($finalNumberStr, ',') > -1) {\n $finalNumberStr = str_replace(',', '', $finalNumberStr);\n }\n return $finalNumberStr;\n }", "public static function tags($commaSepStringOfTags){\n if($commaSepStringOfTags == \"\"){\n return;\n }\n $tags = explode(\",\", $commaSepStringOfTags);\n foreach ($tags as $value) {\n $trimmedTags[] = trim(str_replace(\" \", \"\", $value));\n }\n return $trimmedTags;\n }", "function havecomma($mystr) {\n\t\tif (@ereg(\",,\", $mystr)) {\n\t\t\t// more than one record, so it can be exploded\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function makecomma($input)\n\t{\n\t if(strlen($input)<=2)\n\t { return $input; }\n\t $length=substr($input,0,strlen($input)-2);\n\t $formatted_input = makecomma($length).\",\".substr($input,-2);\n\t return $formatted_input;\n\t}", "function _replaceQuoteCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return '\"'.str_replace('\"', \"'\", $string).'\"';\r\n }", "function fix($str) {\n $trimed = trim($str);\n $replaceCommas = str_replace(\",\", \"\", $trimed);\n return (int) $replaceCommas;\n}", "function arrayify_input_output($input)\n{\n $inputpos = $input;\n $explodeintoarray1 = explode(\";\", $inputpos);\n for($i=0;$i<count($explodeintoarray1);$i++)\n {\n $explodeintoarray2[$i] = explode(\",\", $explodeintoarray1[$i]);\n }\n $explcount = count($explodeintoarray2);\n if(empty($explodeintoarray2[$explcount-1]))\n {\n //unset($explodeintoarray2[$explcount-1]);\n array_pop($explodeintoarray2);\n }\n return $explodeintoarray2;\n}", "protected function wt_explode_values_formatter($value) {\n return trim(str_replace('::separator::', ',', $value));\n }" ]
[ "0.7238915", "0.67976505", "0.6757153", "0.6757153", "0.671613", "0.66964716", "0.66797924", "0.6500081", "0.64840645", "0.64808273", "0.62295586", "0.6069482", "0.6007206", "0.598356", "0.5906284", "0.5882806", "0.5796709", "0.5768036", "0.5709227", "0.57066005", "0.56870455", "0.5676267", "0.56723005", "0.5613916", "0.5573509", "0.5540733", "0.551681", "0.54749733", "0.5470869", "0.5410733" ]
0.7050195
1
Clean perm string (wrapper for comma cleaners)
function clean_perm_string($t) { $t = $this->clean_comma($t); $t = $this->trim_leading_comma($t); $t = $this->trim_trailing_comma($t); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_perms($str)\n\t{\n\t\t$str = preg_replace( \"/,$/\", \"\", $str );\n\t\t$str = str_replace( \",,\", \",\", $str );\n\n\t\treturn $str;\n\t}", "function author_permut($string) {\n $string = trim(str_replace(' ', ' ', $string));\n $string = str_replace(' ', ' ', $string);\n $string = str_replace(' ', ' ', $string);\n $string = str_replace(' ', ' AND ', $string);\n\n return $string;\n}", "function sanitizeOpr( $input ) {\n\t\t$input = trim($input);\n\t\t\n\t\t// Remove all invalid characters\n\t\t// TODO: complete this\n\t\t//$input = preg_replace( '|[^\\w\\s\\[\\]]+|', '', $input );\n\t\t\n\t\t// Truncate to 64 characters\n\t\t$input = substr( $input, 0, 64 );\n\t\t\n\t\treturn $input;\n\t}", "function stripcomma($str) {\n\treturn str_replace(\",\", \"\", $str);\n}", "function clean_comma($t)\n\t{\n\t\treturn preg_replace( \"/,{2,}/\", \",\", $t );\n\t}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function stripcomma($str) {\n\treturn str_replace(',', '', $str);\n}", "function commatize($val) {\n\treturn preg_replace('/ /', ',', $val);\n}", "public function sanitize_input( $input = null ) {\n\n // Convert input to an array\n $input = $input ? explode( ',', $input ) : array();\n\n // Start with empty string\n $sanitized = null;\n\n // Allowed values\n $allowed = array_keys( $this->config['options'] );\n\n foreach ( $input as $input ) {\n if ( in_array( $input, $allowed ) ) {\n $sanitized .= $input . ',';\n }\n }\n\n // Return sanitized value\n return trim( $sanitized, ',' );\n\n }", "function sanitize($input) {\n\t\t$cleaning = $input;\n\t\t\n\t\tswitch ($cleaning) {\n\t\t\tcase trim($cleaning) == \"\":\n\t\t\t\t$clean = false;\n\t\t\t\tbreak;\n\t\t\tcase is_array($cleaning):\n\t\t\t\tforeach($cleaning as $key => $value) {\n\t\t\t\t\t$cleaning[] = sanitize($value);\n\t\t\t\t}\n\t\t\t\t$clean = implode(\",\", $cleaning);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(get_magic_quotes_gpc()) {\n\t\t\t\t\t$cleaning = stripslashes($cleaning);\n\t\t\t\t}\n\t\t\t\t$cleaning = strip_tags($cleaning);\n\t\t\t\t$clean = trim($cleaning);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $clean;\n\t}", "function _removeCommaForCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return str_replace(',', '', $string);\r\n }", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "public function sanitize($s) {\n # make sentence well formatted: \"(A and(B) or C)\" -> \"(A and (B) or C)\"\n #$s = preg_replace($this->PREPROCESS_OPERATORS1, '$1 $2$5$3 $4', $s);\n #$s = preg_replace($this->PREPROCESS_OPERATORS2, '$1 $2$5$3 $4', $s);\n #$s = preg_replace($this->PREPROCESS_OPERATORS3, '$1 $2$5$3 $4', $s);\n # replace operators with empty space\n $s = preg_replace($this->OPERATORS, ' ', $s);\n # prepare to remove exclamation mark, that is used for NOT boolean logic tree\n $s = preg_replace($this->NOT, ' $1 ', $s);\n # prepare to remove ^ mark, that is used for XOR boolean logic tree\n $s = preg_replace($this->XOR, ' $1 ', $s);\n // prepare to remove + mark, that is used for XAND boolean logic tree\n $s = preg_replace($this->XAND, ' $1 ', $s);\n # remove extra double, triple and other longs whitespaces\n # only single spaces between literals are left\n # array filter needs to have strlen to keep 0 numerals!\n return implode(' ', array_filter(explode(' ', $s), 'strlen'));\n }", "protected function cleanStr($str) {\n\t\t$str = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), ' ', trim($str)); \n\t\tif(strlen($str) > $this->maxLineLength) $str = substr($str, 0, $this->maxLineLength); \n\t\tif(strpos($str, ' ^+') !== false) $str = str_replace(' ^=', ' ^ +', $str); // disallowed sequence\n\t\treturn $str; \t\n\t}", "function check_appro($str)\n\t{\n\t\tfor ($i=0; $i<strlen($str); $i++){\n \t\t\tif ($str[$i]==\"`\"){\n \t\t\t$str[$i]='';\n \t\t\t\t\t\t}\n\n\t\t\t}\n\t\t\t\treturn $str;\n\t}", "function replacecomma($string) {\n$string = preg_replace('#\\s+#',', ',trim($string));\nreturn $string;\n}", "function SqlClean($s)\n{\n if(gettype($s) != \"string\") return $s;\n $okay_chars =\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ0123456789\";\n $okay_chars .=\"~`!@#$%^&*()-_=+[]{}\\|;:,.<>/? \"; \n $out = \"\";\n while(!blank($s) && $s !== false)\n {\n $c = substr($s, 0, 1);\n $s = substr($s, 1);\n $w = stripos($okay_chars, $c);\n if($w === FALSE) $out .= ' ';\n else $out .= $c;\n }\n return $out;\n}", "public function filterInput(string $input) : string {\n return trim(preg_replace('/[^a-zA-Z0-9\\s]/', '',$input));\t\n }", "private function _str_replace($p_str){\n\t\t// $to = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');\n\n\t\t// $str = explode(',',str_replace($from, $to, $p_str));\n\n\t\t// return str_replace('/\\s+/', ' ', word_limiter($str[0],7,''));\n\t\treturn preg_replace('/\\s+/', ' ',$p_str);\n\t}", "function clean_array_arguments($argument) {\n\treturn preg_replace('/\\s*=\\s*[\\'|\"](.*)[\\'|\"]\\s*/', '', $argument);\n}", "private function filter() : string\r\n {\r\n return preg_filter('|([^\\(\\)]*)|m', '', $this->string);\r\n }", "function make_clean_str($str) {\n\treturn ucwords(trim(preg_replace('/[ ]+/',' ',preg_replace('/[^0-9a-zA-Z\\+]/',' ',strtolower($str))),' '));\n}", "function cleansep($value)\n{\n\treturn str_replace(array(',',';'), '/', $value);\n}", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "private function sanitiseAuthor($author) {\n\t\treturn preg_replace('/, [0-9 \\.-]+/', '', $author);\n\t}", "public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider() {}", "function removeFromString($str, $item) {\n\t$parts = explode(',', $str);\n\n\twhile(($i = array_search($item, $parts)) !== false) {\n\t\tunset($parts[$i]);\n\t}\n\n\treturn implode(',', $parts);\n}", "function remove_allpuncutation($text)\n{\n\t$otext = $text;\n\t$text = preg_replace('/[^a-zA-Z0-9|+|-|\\*|Š|š|Ž|ž|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|Þ|ß|à|á|â|ã|ä|å|æ|ç|è|é|ê|ë|ì|í|î|ï|ð|ñ|ò|ó|ô|õ|ö|ø|ù|ú|û|ý|þ|ÿ]/is', ' ', $text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\n\treturn $text;\n}", "function split_perm( $perms ){\n\t// setup array format\n\t$result = array(\n\t\t0 => array(\n\t\t\t'users' => array( ),\n\t\t\t'groups' => array( )\n\t\t),\n\t\t1 => array(\n\t\t\t'users' => array( ),\n\t\t\t'groups' => array( )\n\t\t)\n\t);\n\n\t// if no \"|\" symbol, can't process\n\tif( strpos( $perms, '|' ) === false )\n\t\treturn $result;\n\n\t$perms = explode( $perms, '|' );\n\n\tforeach( $perms as $i => $perm ){\n\t\tif( strpos( $perm, '#' ) === false ){\n\t\t\t$result[ $i ][ 'users' ] = explode( ',', $perm );\n\t\t}\n\t\telse{\n\t\t\t$permissions = explode( $perm, '#' );\n\t\t\t$result[ $i ][ 'users' ] = explode( ',', $perm[ 0 ] );\n\t\t\t$result[ $i ][ 'groups' ] = explode( ',', $perm[ 1 ] );\n\t\t}\n\t}\n\n\treturn $result;\n}" ]
[ "0.80324286", "0.5649599", "0.5554309", "0.5442497", "0.5440831", "0.53709614", "0.53709614", "0.5361429", "0.5341913", "0.5298562", "0.52592355", "0.52199924", "0.51745963", "0.5125587", "0.5114021", "0.508036", "0.506441", "0.5055875", "0.50336313", "0.50185037", "0.49913067", "0.49893627", "0.49773517", "0.49541175", "0.4949951", "0.4949786", "0.49207762", "0.4908151", "0.4894207", "0.48758486" ]
0.8108568
0
/ Calculate max post size /
function math_get_post_max_size() { $max_file_size = 16777216; $tmp = 0; $_post = @ini_get('post_max_size'); $_upload = @ini_get('upload_max_filesize'); if ( $_upload > $_post ) { $tmp = $_post; } else { $tmp = $_upload; } if ( $tmp ) { $max_file_size = $tmp; unset($tmp); preg_match( "#^(\d+)(\w+)$#", strtolower($max_file_size), $match ); if ( $match[2] == 'm' ) { $max_file_size = intval( $max_file_size ) * 1024 * 1024; } else if ( $match[2] == 'k' ) { $max_file_size = intval( $max_file_size ) * 1024; } else { $max_file_size = intval( $max_file_size ); } } return $max_file_size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getPostMaxSize(): int\n {\n $result = static::getIniValue('post_max_size');\n $result = Convert::valueToBytes($result);\n\n return $result;\n }", "protected function get_post_max_size()\n {\n return size_inbytes(ini_get(\"post_max_size\")); \n//echo 'display_errors = ' . ini_get('display_errors') . \"\\n\";\n//echo 'register_globals = ' . ini_get('register_globals') . \"\\n\";\n//echo 'post_max_size = ' . ini_get('post_max_size') . \"\\n\";\n//echo 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . \"\\n\";\n//echo 'post_max_size in bytes = ' . size_inbytes(ini_get(\"post_max_size\")); \n }", "function sloodle_get_max_post_upload()\n {\n // Get the sizes of the relevant limits\n $upload_max_filesize = sloodle_convert_file_size_shorthand(ini_get('upload_max_filesize'));\n $post_max_size = sloodle_convert_file_size_shorthand(ini_get('post_max_size'));\n\n // Use the smaller limit\n return min($upload_max_filesize, $post_max_size);\n }", "protected function getPostMaxSize()\n {\n if (is_numeric($postMaxSize = ini_get('post_max_size'))) {\n return (int)$postMaxSize;\n }\n\n $metric = strtoupper(substr($postMaxSize, -1));\n\n switch ($metric) {\n case 'K':\n return (int)$postMaxSize * 1024;\n case 'M':\n return (int)$postMaxSize * 1048576;\n default:\n return (int)$postMaxSize;\n }\n }", "protected function getPostMaxSize(): int\n {\n if (is_numeric($postMaxSize = ini_get('post_max_size'))) {\n return (int) $postMaxSize;\n }\n \n $metric = strtoupper(substr($postMaxSize, -1));\n $postMaxSize = (int) $postMaxSize;\n \n return match ($metric) {\n 'K', 'k' => $postMaxSize * 1024,\n 'M', 'm' => $postMaxSize * 1048576,\n 'G', 'g' => $postMaxSize * 1073741824,\n default => $postMaxSize,\n };\n }", "function __getPostMaxFileSize() {\n return (int)(str_replace('M', '', ini_get('post_max_size')) * 1024 * 1024);//bytes\n }", "public function getPostMaxSize()\n {\n $iniMax = $this->getNormalizedIniPostMaxSize();\n\n if ('' === $iniMax) {\n return null;\n }\n\n if (preg_match('#^(\\d+)([bkmgt])#i', $iniMax, $match)) {\n $shift = array('b' => 0, 'k' => 10, 'm' => 20, 'g' => 30, 't' => 40);\n $iniMax = ($match[1] * (1 << $shift[strtolower($match[2])]));\n }\n\n return (int) $iniMax;\n }", "function getMaxFileSize()\n {\n $val = trim(ini_get('post_max_size'));\n $last = strtolower($val[strlen($val)-1]);\n $val = intval($val);\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n $postMaxSize = $val;\n\n return($postMaxSize);\n }", "static function getSiteMaxSize() {\n return self::getMetaValueRange(PostProperty::META_SIZE, false, 10000000);\n }", "public function getMaxSize() : int{\n return $this->maxSize;\n }", "public static function getMaxUploadSize() {\n\t\treturn min_not_null(array(self::MAX_STORAGE_SIZE, ini_get_bytes('post_max_size')));\n\t}", "static public function getMaxUploadFileSize()\n\t{\n $upload_max_filesize = self::getBytesOfLiteralSizeFormat(ini_get('upload_max_filesize'));\n $post_max_size = self::getBytesOfLiteralSizeFormat(ini_get('post_max_size'));\n\n\t\tif ($upload_max_filesize < $post_max_size) {\n\t\t\t$maxUploadFilesize = $upload_max_filesize;\n\t\t} else {\n\t\t\t$maxUploadFilesize = $post_max_size;\n\t\t}\n\t\treturn $maxUploadFilesize;\n\t}", "public static function get_max_upload_size()\r\n {\r\n // For setting the size limit, we read the ini-configurations.\r\n $l_post_size = isys_convert::to_bytes(ini_get('post_max_size'));\r\n $l_upload_size = isys_convert::to_bytes(ini_get('upload_max_filesize'));\r\n\r\n // Choose the smaller value for \"size limitation\".\r\n if ($l_post_size > $l_upload_size)\r\n {\r\n return $l_upload_size;\r\n } // if\r\n\r\n return $l_post_size;\r\n }", "public function GetMaxSize ();", "protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }", "public function getMaxSize(): int\n {\n return $this->maxSize;\n }", "public function getMaxSize(){\n return $this->maxSize;\n }", "public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }", "public function getMaxSize() {\n\t\t\treturn $this->maxSize >= 0 ? $this->maxSize : $this->getTotalMaxSize();\n\t\t}", "public static function getMaxFileSize()\n\t{\n\t\t// get the value for the maximal uploadable filesize from the php.ini (if available)\n\t\t$umf = ini_get(\"upload_max_filesize\");\n\t\t// get the value for the maximal post data from the php.ini (if available)\n\t\t$pms = ini_get(\"post_max_size\");\n\t\t\n\t\t//convert from short-string representation to \"real\" bytes\n\t\t$multiplier_a=array(\"K\" => 1024, \"M\" => 1024 * 1024, \"G\" => 1024 * 1024 * 1024);\n\t\t\n\t\t$umf_parts=preg_split(\"/(\\d+)([K|G|M])/\", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t$pms_parts=preg_split(\"/(\\d+)([K|G|M])/\", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t\n\t\tif (count($umf_parts) == 2) {\n\t\t\t$umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]];\n\t\t}\n\t\tif (count($pms_parts) == 2) {\n\t\t\t$pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]];\n\t\t}\n\t\t\n\t\t// use the smaller one as limit\n\t\t$max_filesize = min($umf, $pms);\n\t\t\n\t\tif (!$max_filesize) \n\t\t\t$max_filesize=max($umf, $pms);\n\t\t\n\t\treturn $max_filesize;\n\t}", "public function maxUploadSize() {\n $max=ini_get('upload_max_filesize')>(int)ini_get('post_max_size')?(int)ini_get('post_max_size'):(int)ini_get('upload_max_filesize');\n if (config('larapages.media.maxUploadSize') && config('larapages.media.maxUploadSize')<$max) \n $max=config('larapages.media.maxUploadSize');\n return $max;\n }", "public function getMaxSize(): int;", "public function getMaxSize() : int {\n\t\treturn $this->generator->getMaxSize();\n\t}", "public static function getMaxUploadFileSize() {}", "public static function getMaxUploadSize() {\r\n $max_upload = (int)(ini_get('upload_max_filesize'));\r\n $max_post = (int)(ini_get('post_max_size'));\r\n $memory_limit = (int)(ini_get('memory_limit'));\r\n\r\n $upload_mb = min($max_upload, $max_post, $memory_limit);\r\n\t\t$upload_mb = trim($upload_mb);\r\n\r\n return $upload_mb;\r\n }", "function getUploadMaxValue(){\n return str_replace('M', '', getUploadMax()) * 1024;\n }", "public function getMaxSize()\n {\n return self::PREVIEW_SIZE;\n }", "function Wo_MaxFileUpload() {\n $max_upload = Wo_ReturnBytes(ini_get('upload_max_filesize'));\n //select post limit\n $max_post = Wo_ReturnBytes(ini_get('post_max_size'));\n //select memory limit\n $memory_limit = Wo_ReturnBytes(ini_get('memory_limit'));\n // return the smallest of them, this defines the real limit\n return min($max_upload, $max_post, $memory_limit);\n}", "function qa_post_limit_exceeded()\n{\n\tif (in_array($_SERVER['REQUEST_METHOD'], array('POST', 'PUT')) && empty($_POST) && empty($_FILES)) {\n\t\t$postmaxsize = ini_get('post_max_size'); // Gets the current post_max_size configuration\n\t\t$unit = substr($postmaxsize, -1);\n\t\tif (!is_numeric($unit)) {\n\t\t\t$postmaxsize = substr($postmaxsize, 0, -1);\n\t\t}\n\t\t// Gets an integer value that can be compared against the size of the HTTP request\n\t\t$postmaxsize = convert_to_bytes($unit, $postmaxsize);\n\t\treturn $_SERVER['CONTENT_LENGTH'] > $postmaxsize;\n\t}\n}", "public function getMaxSize() {\n return number_format($this->_max / 1024, 1) . ' KB';\n }" ]
[ "0.78163105", "0.7758226", "0.7658557", "0.76306707", "0.75660706", "0.74938804", "0.73693174", "0.7300634", "0.7243103", "0.70668113", "0.705732", "0.7034277", "0.69912714", "0.69554424", "0.69465715", "0.6890318", "0.6883936", "0.6863671", "0.6852488", "0.68366385", "0.682865", "0.68099314", "0.67964476", "0.6790983", "0.6782744", "0.6775322", "0.6764488", "0.67289406", "0.6716074", "0.66817576" ]
0.7920259
0
/ math_strlen_to_bytes / Convert strlen to bytes
function math_strlen_to_bytes( $strlen=0 ) { $dh = pow(10, 0); return round( $strlen / ( pow(1024, 0) / $dh ) ) / $dh; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _strlen($binary_string) {\r\n if (function_exists('mb_strlen')) {\r\n return mb_strlen($binary_string, '8bit');\r\n }\r\n return strlen($binary_string);\r\n }", "public static function bytes($_str) {\n\t\t$_greek='KMGT';\n\t\t$_exp=strpbrk($_str,$_greek);\n\t\treturn pow(1024,strpos($_greek,$_exp)+1)*(int)$_str;\n\t}", "public function getBytes()\n {\n $out = \"\";\n\n $fullBytes = (int)floor($this->size / 8);\n $remainder = $this->size % 8;\n\n for ($i = 0; $i < $fullBytes; $i++) {\n $intIdx = (int)($i * 8 / $this->intSize);\n $mask = 0xff << (((PHP_INT_SIZE-1) - ($i % PHP_INT_SIZE)) * 8);\n\n $out .= chr((($this->data[$intIdx] & $mask) >> (((PHP_INT_SIZE-1) - ($i % PHP_INT_SIZE)) * 8)) & 0xff);\n }\n\n if ($remainder > 0) {\n $lastByte = 0;\n for ($i = 0; $i < $remainder; $i++) {\n $lastByte = $lastByte | ($this->get($fullBytes * 8 + $i) << (7 - $i));\n }\n\n $out .= chr($lastByte);\n }\n\n return $out;\n }", "function benc_str($s) {\n\treturn strlen($s) . \":$s\";\n}", "public static function strBytes($str)\n {\n // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT\n\n // Number of characters in string\n $strlen_var = strlen($str);\n\n // string bytes counter\n $d = 0;\n\n /*\n * Iterate over every character in the string,\n * escaping with a slash or encoding to UTF-8 where necessary\n */\n for($c = 0; $c < $strlen_var; ++$c)\n {\n $ord_var_c = ord($str{$c});\n\n switch(true)\n {\n case(($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):\n // characters U-00000000 - U-0000007F (same as ASCII)\n $d ++;\n break;\n case(($ord_var_c & 0xE0) == 0xC0):\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n $d += 2;\n break;\n case(($ord_var_c & 0xF0) == 0xE0):\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n $d += 3;\n break;\n case(($ord_var_c & 0xF8) == 0xF0):\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n $d += 4;\n break;\n case(($ord_var_c & 0xFC) == 0xF8):\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n $d += 5;\n break;\n case(($ord_var_c & 0xFE) == 0xFC):\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n $d += 6;\n break;\n default:\n $d ++;\n }//switch\n }//for\n\n return number_format($d);\n }", "function bin2bstr($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Pack into a string\r\n\t\t$input = str_split($input, 2);\r\n\t\t$str = '';\r\n\t\tforeach ($input as $v){\r\n\t\t\t$str .= base_convert($v, 2, 16);\r\n\t\t}\r\n\t\t$str = pack('H*', $str);\r\n\t\treturn $str;\r\n\t}", "function php_size_to_bytes($val) {\n $val = trim($val);\n $last = strtolower($val[strlen($val)-1]);\n switch($last) {\n // The 'G' modifier is available since PHP 5.1.0\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n\n return $val;\n }", "function TruncateBytes($string, $len) {\n if (strlen($string) <= $len) {\n return $string;\n }\n if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) {\n return substr($string, 0, $len);\n }\n while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0) {\n \n };\n return substr($string, 0, $len);\n }", "protected function calculateBytesInStr(string &$value): int\n {\n $n = strlen($value); // size base64 string\n $y = 3;\n if (Str::endsWith($value, '==')) {\n $y = 2;\n } elseif (Str::endsWith($value, '=')) {\n $y = 1;\n }\n return (int) ($n * (3 / 4)) - $y; // Calculate file size in bytes\n }", "function toBin($str){\n $str = (string)$str;\n $l = strlen($str);\n $result = '';\n while($l--){\n $result = str_pad(decbin(ord($str[$l])),8,\"0\",STR_PAD_LEFT).$result;\n }\n return $result;\n }", "public static function strlen_in_byte(string $str): int\n {\n if ($str === '') {\n return 0;\n }\n\n if (self::$SUPPORT['mbstring_func_overload'] === true) {\n // \"mb_\" is available if overload is used, so use it ...\n return \\mb_strlen($str, 'CP850'); // 8-BIT\n }\n\n return \\strlen($str);\n }", "function return_bytes($val)\n{\n $val = trim($val);\n $last = strtolower($val[strlen($val)-1]);\n switch($last) {\n // The 'G' modifier is available since PHP 5.1.0\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n return $val;\n}", "function xthreads_size_to_bytes($s) {\r\n\t$s = strtolower(trim($s));\r\n\tif(!$s) return 0;\r\n\t$v = (float)$s;\r\n\t$last = substr($s, -1);\r\n\tif($last == 'b')\r\n\t\t$last = substr($s, -2, 1);\r\n\tswitch($last) {\r\n\t\tcase 'e': $v *= 1024;\r\n\t\tcase 'p': $v *= 1024;\r\n\t\tcase 't': $v *= 1024;\r\n\t\tcase 'g': $v *= 1024;\r\n\t\tcase 'm': $v *= 1024;\r\n\t\tcase 'k': $v *= 1024;\r\n\t}\r\n\treturn (int)round($v);\r\n}", "function return_bytes($val) {\n\t$val = trim($val);\n\t$last = strtolower($val[strlen($val)-1]);\n\tswitch($last) {\n\t\t// The 'G' modifier is available since PHP 5.1.0\n\t\tcase 'g':\n\t\t\t$val *= 1024;\n\t\tcase 'm':\n\t\t\t$val *= 1024;\n\t\tcase 'k':\n\t\t\t$val *= 1024;\n\t}\n\n\treturn $val;\n}", "function xthreads_size_to_bytes($s) {\r\n\t$s = strtolower(trim($s));\r\n\tif(!$s) return 0;\r\n\t$v = floatval($s);\r\n\t$last = substr($s, -1);\r\n\tif($last == 'b')\r\n\t\t$last = substr($s, -2, 1);\r\n\tswitch($last) {\r\n\t\tcase 'e': $v *= 1024;\r\n\t\tcase 'p': $v *= 1024;\r\n\t\tcase 't': $v *= 1024;\r\n\t\tcase 'g': $v *= 1024;\r\n\t\tcase 'm': $v *= 1024;\r\n\t\tcase 'k': $v *= 1024;\r\n\t}\r\n\treturn intval(round($v));\r\n}", "private function toBytes($str)\n\t{\n\t\t$val = trim($str);\n\t\t$last = strtolower($str[strlen($str)-1]);\n\t\tswitch($last) {\n\t\t\tcase 'g': $val *= 1024;\n\t\t\tcase 'm': $val *= 1024;\n\t\t\tcase 'k': $val *= 1024;\n\t\t}\n\t\treturn $val;\n\t}", "private function encodeBytes($input) {\n\t\t$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n\t\t$output = '';\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$c1 = ord($input[$i++]);\n\t\t\t$output .= $itoa64[$c1 >> 2];\n\t\t\t$c1 = ($c1 & 0x03) << 4;\n\t\t\tif ($i >= 16) {\n\t\t\t\t$output .= $itoa64[$c1];\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$c2 = ord($input[$i++]);\n\t\t\t$c1 |= $c2 >> 4;\n\t\t\t$output .= $itoa64[$c1];\n\t\t\t$c1 = ($c2 & 0x0f) << 2;\n\n\t\t\t$c2 = ord($input[$i++]);\n\t\t\t$c1 |= $c2 >> 6;\n\t\t\t$output .= $itoa64[$c1];\n\t\t\t$output .= $itoa64[$c2 & 0x3f];\n\t\t} while (1);\n\t\treturn $output;\n\t}", "private function toBytes($str){\n $val = trim($str);\n $last = strtolower($str[strlen($str)-1]);\n switch($last) {\n case 'g': $val *= 1024;\n case 'm': $val *= 1024;\n case 'k': $val *= 1024; \n }\n return $val;\n }", "protected function toBytes($str){\n\t\t$val = trim($str);\n\t\t$last = strtolower($str[strlen($str)-1]);\n\t\tswitch($last) {\n\t\t\tcase 'g': $val *= 1024;\n\t\t\tcase 'm': $val *= 1024;\n\t\t\tcase 'k': $val *= 1024;\n\t\t}\n\t\treturn $val;\n\t}", "function _twobytes2int_le($s) {\n\treturn (ord(substr($s, 1, 1))<<8) + ord(substr($s, 0, 1));\n}", "function realStringLength($str) {\n return mb_strlen($str, \"UTF-8\");\n}", "private function encodeBytes($input) {\n $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n $output = '';\n $i = 0;\n do {\n $c1 = ord($input[$i++]);\n $output .= $itoa64[$c1 >> 2];\n $c1 = ($c1 & 0x03) << 4;\n if ($i >= 16) {\n $output .= $itoa64[$c1];\n break;\n }\n\n $c2 = ord($input[$i++]);\n $c1 |= $c2 >> 4;\n $output .= $itoa64[$c1];\n $c1 = ($c2 & 0x0f) << 2;\n\n $c2 = ord($input[$i++]);\n $c1 |= $c2 >> 6;\n $output .= $itoa64[$c1];\n $output .= $itoa64[$c2 & 0x3f];\n } while (1);\n\n return $output;\n }", "function safe_strlen( $str, $encoding = false ) {\n\t// Allow for selective testings - \"1\" bit set tests grapheme_strlen(), \"2\" preg_match_all( '/\\X/u' ), \"4\" mb_strlen(), \"other\" strlen().\n\t$test_safe_strlen = getenv( 'PHP_CLI_TOOLS_TEST_SAFE_STRLEN' );\n\n\t// Assume UTF-8 if no encoding given - `grapheme_strlen()` will return null if given non-UTF-8 string.\n\tif ( ( ! $encoding || 'UTF-8' === $encoding ) && can_use_icu() && null !== ( $length = grapheme_strlen( $str ) ) ) {\n\t\tif ( ! $test_safe_strlen || ( $test_safe_strlen & 1 ) ) {\n\t\t\treturn $length;\n\t\t}\n\t}\n\t// Assume UTF-8 if no encoding given - `preg_match_all()` will return false if given non-UTF-8 string.\n\tif ( ( ! $encoding || 'UTF-8' === $encoding ) && can_use_pcre_x() && false !== ( $length = preg_match_all( '/\\X/u', $str, $dummy /*needed for PHP 5.3*/ ) ) ) {\n\t\tif ( ! $test_safe_strlen || ( $test_safe_strlen & 2 ) ) {\n\t\t\treturn $length;\n\t\t}\n\t}\n\t// Legacy encodings and old PHPs will reach here.\n\tif ( function_exists( 'mb_strlen' ) && ( $encoding || function_exists( 'mb_detect_encoding' ) ) ) {\n\t\tif ( ! $encoding ) {\n\t\t\t$encoding = mb_detect_encoding( $str, null, true /*strict*/ );\n\t\t}\n\t\t$length = $encoding ? mb_strlen( $str, $encoding ) : mb_strlen( $str ); // mbstring funcs can fail if given `$encoding` arg that evals to false.\n\t\tif ( 'UTF-8' === $encoding ) {\n\t\t\t// Subtract combining characters.\n\t\t\t$length -= preg_match_all( get_unicode_regexs( 'm' ), $str, $dummy /*needed for PHP 5.3*/ );\n\t\t}\n\t\tif ( ! $test_safe_strlen || ( $test_safe_strlen & 4 ) ) {\n\t\t\treturn $length;\n\t\t}\n\t}\n\treturn strlen( $str );\n}", "public function bytes($len=null){ }", "private function getBytes() \n {\n $bytes = '';\n\n /**\n * To check whether openssl_random_pseudo_bytes exists and also the operation-system is not windows, becaues Open ssl is slow on windows!\n */\n if (function_exists('openssl_random_pseudo_bytes') && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) \n {\n $bytes = openssl_random_pseudo_bytes(18);\n }\n\n if ($bytes === '' && is_readable('/dev/urandom') && ($hRand = @fopen('/dev/urandom', 'rb')) !== FALSE) \n {\n $bytes = fread($hRand, 18);\n fclose($hRand);\n }\n\n if ($bytes === '') \n {\n $key = uniqid($this->prefix, true);\n\n /**\n * 12 rounds of HMAC must be reproduced / created verbatim, no known shortcuts.\n * Salsa20 returns more than enough bytes.\n */\n for ($i = 0; $i < 12; $i++) \n {\n $bytes = hash_hmac('salsa20', microtime() . $bytes, $key, true);\n usleep(10);\n }\n }\n\n return $bytes;\n }", "private static function generateBytes($length)\n {\n if (self::hasOpensslRandomPseudoBytes()) {\n return openssl_random_pseudo_bytes($length);\n }\n\n $bytes = '';\n for ($i = 1; $i <= $length; $i++) {\n $bytes = chr(mt_rand(0, 255)) . $bytes;\n }\n\n return $bytes;\n }", "function bstr2bin($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Unpack as a hexadecimal string\r\n\t\t$value = unpack('H*', $input);\r\n\t\t// Output binary representation\r\n\t\t$value = str_split($value[1], 1);\r\n\t\t$bin = '';\r\n\t\tforeach ($value as $v){\r\n\t\t\t$b = str_pad(base_convert($v, 16, 2), 4, '0', STR_PAD_LEFT);\r\n\t\t\t$bin .= $b;\r\n\t\t}\r\n\t\treturn $bin;\r\n\t}", "function cmpr_strlen( $a, $b ) {\n\t\treturn strlen($b) - strlen($a);\n\t}", "function breach_encode($str)\n{\n if (!function_exists(\"mcrypt_create_iv\")) {\n trigger_error(\n \"Required function is missing: mcrypt_create_iv()\",\n E_USER_ERROR\n );\n }\n\n $pad = mcrypt_create_iv(strlen($str), MCRYPT_DEV_URANDOM);\n $encoded = \"\";\n for ($i = 0; $i < strlen($str); $i++) {\n $encoded .= chr(ord($str[$i]) ^ ord($pad[$i]));\n }\n return bin2hex($pad . $encoded);\n}", "function utf8_strlen(string $str): int\n{\n return \\strlen(\\utf8_decode($str));\n}" ]
[ "0.6343702", "0.6030263", "0.58650285", "0.5813406", "0.57850003", "0.5774222", "0.57621455", "0.57619655", "0.57526517", "0.57500315", "0.57421356", "0.5740826", "0.57345885", "0.5732057", "0.572741", "0.5711843", "0.56680834", "0.5642236", "0.5600801", "0.55793136", "0.55784565", "0.5566809", "0.55458987", "0.5541409", "0.5513674", "0.5510542", "0.55073917", "0.54970837", "0.54789245", "0.5476989" ]
0.86754537
0
/ print_forum_rules Checks and prints forum rules (if required) / Universal routine for printing forum rules
function print_forum_rules($forum) { $ruleshtml = ""; $rules['fid'] = $forum['id']; if ( isset($forum['show_rules']) AND $forum['show_rules'] ) { if ( $forum['show_rules'] == 2 ) { if ( isset($this->vars['forum_cache_minimum']) AND $this->vars['forum_cache_minimum'] ) { $tmp = $this->DB->simple_exec_query( array( 'select' => 'rules_title, rules_text', 'from' => 'forums', 'where' => "id=".$forum['id']) ); $rules['title'] = $tmp['rules_title']; $rules['body'] = $tmp['rules_text']; } else { $tmp = $this->DB->simple_exec_query( array( 'select' => 'rules_text', 'from' => 'forums', 'where' => "id=".$forum['id']) ); $rules['body'] = $tmp['rules_text']; $rules['title'] = $forum['rules_title']; } $ruleshtml = $this->compiled_templates['skin_global']->forum_show_rules_full($rules); } else { if ( isset( $this->vars['forum_cache_minimum'] ) AND $this->vars['forum_cache_minimum'] ) { $tmp = $this->DB->simple_exec_query( array( 'select' => 'rules_title', 'from' => 'forums', 'where' => "id=".$forum['id']) ); $rules['title'] = $tmp['rules_title']; } else { $rules['title'] = $forum['rules_title']; } $ruleshtml = $this->compiled_templates['skin_global']->forum_show_rules_link($rules); } } return $ruleshtml; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function display_forum_rules() {\n ?>\n <ol>\n <?= Lang::get('rules', 'chat_forums_rules') ?>\n </ol>\n <?\n }", "public function printRules() {}", "function local_forumnotices_printforum($frmids) {\n global $DB, $CFG, $USER;\n $config = get_config('local_forumnotices');\n $courseid = $config->courses;\n $table = '';\n // Print the header\n $header = '<table border=\"1\" border-width=\"thin\">\n <tr>\n <th align=\"center\" width=\"15%\">'.get_string('subject', 'local_forumnotices').'</th>\n <th align=\"center\" width=\"75%\">'.get_string('message', 'local_forumnotices').'</th>\n <th align=\"center\" width=\"10%\">'.get_string('user', 'local_forumnotices').'</th>\n </tr>';\n $sql = \"SELECT fn.id,\n fn.subject,\n fn.message,\n fn.forums,\n CONCAT(u.firstname, ' ', u.lastname) as user\n FROM {local_forumnotices} fn\n JOIN {user} u\n ON u.id = fn.userid\n WHERE fn.pastnotices = 0\n ORDER BY 2\";\n $forumlist = $DB->get_records_sql($sql);\n $sql = \"SELECT id, name\n FROM {forum}\n WHERE name NOT IN ('Announcements','Past Notices', 'Staff Notices')\n AND course = $courseid\";\n if (!empty($frmids)) {\n $sql .= \" AND id IN ($frmids) \";\n }\n $sql .= \" ORDER BY id\";\n $forums = $DB->get_records_sql_menu($sql);\n foreach ($forums as $flk => $fld) {\n $index = 0;\n foreach ($forumlist as $fl) {\n $forumarray = explode(\",\", $fl->forums);\n if (in_array($flk, $forumarray)) {\n $classarray[$fld][$index] = $fl->id;\n }\n $index++;\n }\n \n }\n \n require_once(\"$CFG->libdir/pdflib.php\");\n $documentname = 'forumnotices.pdf';\n $pdf = new TCPDF('p', 'mm', 'A4', true, 'UTF-8', false);\n $pdf->SetTitle($documentname);\n $pdf->setPrintHeader(false);\n $pdf->setPrintFooter(false);\n $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);\n $font = 'helvetica';\n $pdf->setFont($font, '', 10);\n $arraykeys = array_keys($classarray);\n $index = 0;\n $today = date('d-m-Y');\n foreach ($classarray as $cla) {\n $pdf->AddPage();\n $pdf->writeHTMLCell(0, 0, 10, 10, $arraykeys[$index], '');\n $pdf->writeHTMLCell(0, 0, 150, 10, 'Date:'.$today, '');\n $table .= $header;\n foreach ($cla as $clk => $cld) {\n $noticerecord = $DB->get_record('local_forumnotices', array('id' => $cld));\n $userdet = $DB->get_record_sql(\"SELECT CONCAT(firstname, lastname) as name FROM {user} WHERE id = $noticerecord->userid\");\n $table .= '<tr>\n <td width=\"15%\">'. $noticerecord->subject .'</td>\n <td width=\"75%\">'. $noticerecord->message .'</td>\n <td width=\"10%\" align=\"center\">'. $userdet->name .'</td>\n </tr>\n ';\n }\n $index++;\n $table .= \"</table>\";\n $pdf->SetXY(10, 20);\n $pdf->writeHTML($table, true, false, true, false, \"\");\n }\n \n //$pdf->writeHTML($table, true, false, true, false, \"\");\n $pdf->Output($documentname, 'I');\n}", "function DisplayForums($parent_id, $forum_id, $title)\n {\n global $DB, $categoryid, $mainsettings, $userinfo, $usersystem;\n\n // SD313: check for view permission for usergroup (id enclosed in pipes!)\n // and moderation status of forums\n $forums_tbl = PRGM_TABLE_PREFIX.'p_forum_forums';\n $posts_tbl = PRGM_TABLE_PREFIX.'p_forum_posts';\n $topics_tbl = PRGM_TABLE_PREFIX.'p_forum_topics';\n $forum_id = (int)$forum_id;\n\n if(empty($parent_id) || !isset($this->conf->forums_cache['parents'][$parent_id])) // SD343: \"isset\"\n {\n $source = array($forum_id);\n }\n else\n {\n $parent_id = (int)$parent_id;\n $source = &$this->conf->forums_cache['parents'][$parent_id];\n }\n\n $output = '';\n $do_body = false;\n if(isset($source) && is_array($source))\n foreach($source as $fid)\n {\n $forum_arr = isset($this->conf->forums_cache['forums'][$fid]) ?\n (array)$this->conf->forums_cache['forums'][$fid] : false;\n if(!$forum_arr) continue;\n $forum_groups = sd_ConvertStrToArray($forum_arr['access_view'],'|');\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($forum_arr['online'])) continue;\n if(!empty($forum_groups) && !count(@array_intersect($userinfo['usergroupids'], $forum_groups)))\n continue;\n }\n\n if(!$do_body)\n {\n $output .= '\n <tbody>';\n $do_body = true;\n }\n\n $external = false;\n $target = '';\n if(!empty($forum_arr['is_category']))\n {\n $link = '#';\n }\n else\n if(empty($forum_arr['link_to']) || !strlen(trim($forum_arr['link_to'])))\n {\n //SD343 SEO Forum Title linking\n $link = $this->conf->RewriteForumLink($fid);\n }\n else\n {\n $external = true;\n $link = trim($forum_arr['link_to']);\n $target = strlen($forum_arr['target']) ? ' target=\"'.$forum_arr['target'].'\" ' : '';\n }\n\n // Display forum image\n $img_col = false;\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n $image = false;\n if(!empty($forum_arr['image']) && !empty($forum_arr['image_h']) && !empty($forum_arr['image_w']))\n {\n $image = $forum_arr['image'].'\" alt=\"\" width=\"'.$forum_arr['image_w'].'\" height=\"'.$forum_arr['image_h'].'\" style=\"border:none\" />';\n }\n if($image) $image = '<img src=\"'.SDUserCache::$img_path.$image;\n $img_col = '<td class=\"col-forum-icon\"><a class=\"forum-title-link\" '.$target.'href=\"'.$link.'\">'. $image.'</a></td>';\n }\n\n $output .= '\n <tr>'.($img_col?$img_col:'').'\n <td class=\"col-forum-title\"><a class=\"forum-title-link\" '.$target.'href=\"'.$link.'\">'.\n (!$forum_arr['online'] ? '<img src=\"'.SDUserCache::$img_path.'lock.png\" alt=\"'.\n strip_alltags($this->conf->plugin_phrases_arr['forum_offline']).'\" />' : '').$forum_arr['title'].'</a>'.\n (strlen($forum_arr['description']) ? ' <p class=\"forum-description\">' . $forum_arr['description'].'</p>' : '');\n\n // Display sub-forums of current forum\n if(!empty($forum_arr['subforums']))\n {\n $sub_links = array();\n foreach($this->conf->forums_cache['parents'][$fid] as $subid)\n {\n $sub_output = '';\n $sub = $this->conf->forums_cache['forums'][$subid];\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($sub['online'])) continue;\n $subforum_groups = sd_ConvertStrToArray($sub['access_view'],'|');\n if(!empty($subforum_groups) && !count(@array_intersect($userinfo['usergroupids'], $subforum_groups)))\n continue;\n }\n\n $image = '';\n if(empty($sub['online']) && (empty($sub['link_to']) || !strlen(trim($sub['link_to']))))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.'lock.png\" width=\"16\" height=\"16\" alt=\"'.\n htmlspecialchars($this->conf->plugin_phrases_arr['forum_offline'], ENT_COMPAT).'\" />';\n }\n else\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n if(!empty($sub['image']) && !empty($sub['image_h']) && !empty($sub['image_w']))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.$sub['image'].'\" alt=\"\" width=\"'.$sub['image_w'].'\" height=\"'.$sub['image_h'].'\" style=\"border:none\" />';\n }\n $descr = strip_tags(str_replace(array('<br>','<br />','&quot;'),array(' ',' ',''), $sub['description']));\n }\n\n if(empty($sub['link_to']) || !strlen(trim($sub['link_to'])))\n {\n $target = '';\n //SD343 SEO Forum Title linking\n $link = $this->conf->RewriteForumLink($sub['forum_id']);\n }\n else\n {\n $link = trim($sub['link_to']);\n $target = strlen($sub['target']) ? ' target=\"'.$sub['target'].'\" ' : '';\n if(!$image)\n $image = '<img src=\"'.SDUserCache::$img_path.'arrow-right.png\" width=\"14\" height=\"14\" alt=\"\" />';\n }\n if($descr = strip_tags(str_replace(array('<br>','<br />','&quot;'),array(' ',' ',' '), $sub['description'])))\n {\n $descr = 'title=\"'.htmlspecialchars($descr).'\" ';\n }\n $sub_output .= $image.'<a class=\"forum-sublink\" '.$target.$descr.'href=\"'.$link.'\">'.$sub['title'].'</a>';\n $sub_links[] = $sub_output;\n }\n if(!empty($sub_links))\n $output .= '\n <p class=\"sub-forums\">'.implode(', ',$sub_links).'</p>';\n unset($sub_links);\n }\n\n $output .= '\n </td>';\n if(!empty($mainsettings['enable_rss_forum']))\n {\n $output .= '\n <td class=\"col-rss\"><a title=\"RSS\" class=\"rss-icon\" href=\"forumrss.php?forum_id=' . $fid . '\">RSS</a></td>';\n }\n\n //SD342: add first 100 chars as link title for preview\n $post_hint = '';\n if(!empty($forum_arr['post_text']))\n $post_hint = SDForumConfig::GetBBCodeExtract($forum_arr['post_text']);\n\n $output .= '\n <td class=\"col-topic-count\">' . number_format($forum_arr['topic_count']) . '</td>\n <td class=\"col-post-count\">' . number_format($forum_arr['post_count']) . '</td>\n <td class=\"col-last-updated\"'.$post_hint.' style=\"cursor:normal\">';\n\n if(!empty($forum_arr['last_post_date']))\n {\n $thread_title = $forum_arr['last_topic_title'];\n //SD370: fetch prefix (if present and uncensored) and display it\n $thread_prefix = '';\n if(!empty($forum_arr['last_topic_id']))\n {\n if($prefix = $this->GetTopicPrefix($forum_arr['last_topic_id']))\n {\n $thread_prefix = str_replace('[tagname]', $prefix['tag'], $prefix['html_prefix']).' ';\n }\n unset($prefix);\n }\n\n if(strlen($thread_title) > 30)\n {\n $space_position = strrpos($thread_title, \" \") - 1;\n //SD343: respect utf-8\n if($space_position === false)\n $space_position = 30;\n else\n $space_position++;\n $thread_title = sd_substr($thread_title, 0, $space_position) . '...';\n }\n\n //SD343 SEO Forum Title linking\n $link = $forum_arr['last_topic_seo_url'];\n $output .= '<a class=\"jump-post-link\" href=\"'.$link.'\">'.$thread_prefix.trim($thread_title).'</a>';\n if(!empty($forum_arr['poster_id']))\n {\n $poster_id = (int)$forum_arr['poster_id'];\n //SD342: user caching\n $poster = SDUserCache::CacheUser($poster_id, $forum_arr['last_post_username'], false);\n $output .= '<br />'.$this->conf->plugin_phrases_arr['posted_by'].' '.$poster['profile_link'];\n }\n else\n {\n $output .= $forum_arr['last_post_username'];\n }\n $output .= '<br />\n ' . $this->conf->GetForumDate($forum_arr['last_post_date']);\n }\n\n $output .= '</td>\n </tr>';\n\n } //while\n\n if($do_body)\n {\n $output .= '\n </tbody>\n <!-- DisplayForums -->\n ';\n return $output;\n }\n return false;\n\n }", "public static function display_golden_rules() {\n $site_name = SITE_NAME;\n $disabled_channel = BOT_DISABLED_CHAN;\n $staffpm = '<a href=\"staffpm.php\">Staff PM</a>';\n $irc = '<a href=\"chat.php\">IRC</a>';\n $vpns_article = '<a href=\"wiki.php?action=article&name=vpns\">Proxy/VPN Tips</a>';\n $ips_article = '<a href=\"wiki.php?action=article&id=95\">Multiple IPs</a>';\n $autofl_article = '<a href=\"wiki.php?action=article&id=66\">Freeleech Autosnatching Policy</a>';\n $bugs_article = '<a href=\"wiki.php?action=article&id=67\">Responsible Disclosure Policy</a>';\n $exploit_article = '<a href=\"wiki.php?action=article&id=68\">Exploit Policy</a>';\n $golden_rules = array(\n [\n 'n' => \"1.1\",\n 'short' => Lang::get('rules', 'short_11'),\n 'long' => Lang::get('rules', 'long_11')\n ],\n [\n 'n' => \"1.2\",\n 'short' => Lang::get('rules', 'short_12'),\n 'long' => Lang::get('rules', 'long_12')\n ],\n [\n 'n' => \"1.3\",\n 'short' => Lang::get('rules', 'short_13'),\n 'long' => Lang::get('rules', 'long_13')\n ],\n [\n 'n' => \"1.4\",\n 'short' => Lang::get('rules', 'short_14'),\n 'long' => Lang::get('rules', 'long_14')\n ],\n [\n 'n' => \"2.1\",\n 'short' => Lang::get('rules', 'short_21'),\n 'long' => Lang::get('rules', 'long_21')\n ],\n [\n 'n' => \"2.2\",\n 'short' => Lang::get('rules', 'short_22'),\n 'long' => Lang::get('rules', 'long_22')\n ],\n [\n 'n' => \"2.3\",\n 'short' => Lang::get('rules', 'short_23'),\n 'long' => Lang::get('rules', 'long_23')\n ],\n [\n 'n' => \"2.4\",\n 'short' => Lang::get('rules', 'short_24'),\n 'long' => Lang::get('rules', 'long_24')\n ],\n [\n 'n' => \"3.1\",\n 'short' => Lang::get('rules', 'short_31'),\n 'long' => Lang::get('rules', 'long_31')\n ],\n [\n 'n' => \"3.2\",\n 'short' => Lang::get('rules', 'short_32'),\n 'long' => Lang::get('rules', 'long_32')\n ],\n [\n 'n' => \"3.3\",\n 'short' => Lang::get('rules', 'short_33'),\n 'long' => Lang::get('rules', 'long_33')\n ],\n [\n 'n' => \"3.4\",\n 'short' => Lang::get('rules', 'short_34'),\n 'long' => Lang::get('rules', 'long_34')\n ],\n [\n 'n' => \"3.5\",\n 'short' => Lang::get('rules', 'short_35'),\n 'long' => Lang::get('rules', 'long_35')\n ],\n [\n 'n' => \"4.1\",\n 'short' => Lang::get('rules', 'short_41'),\n 'long' => Lang::get('rules', 'long_41')\n ],\n [\n 'n' => \"4.2\",\n 'short' => Lang::get('rules', 'short_42'),\n 'long' => Lang::get('rules', 'long_42')\n ],\n [\n 'n' => \"4.3\",\n 'short' => Lang::get('rules', 'short_43'),\n 'long' => Lang::get('rules', 'long_43')\n ],\n [\n 'n' => \"4.4\",\n 'short' => Lang::get('rules', 'short_44'),\n 'long' => Lang::get('rules', 'long_44')\n ],\n [\n 'n' => \"4.5\",\n 'short' => Lang::get('rules', 'short_45'),\n 'long' => Lang::get('rules', 'long_45')\n ],\n [\n 'n' => \"4.6\",\n 'short' => Lang::get('rules', 'short_46'),\n 'long' => Lang::get('rules', 'long_46')\n ],\n [\n 'n' => \"4.7\",\n 'short' => Lang::get('rules', 'short_47'),\n 'long' => Lang::get('rules', 'long_47')\n ],\n [\n 'n' => \"4.8\",\n 'short' => Lang::get('rules', 'short_48'),\n 'long' => Lang::get('rules', 'long_48')\n ],\n [\n 'n' => \"5.1\",\n 'short' => Lang::get('rules', 'short_51'),\n 'long' => Lang::get('rules', 'long_51')\n ],\n [\n 'n' => \"5.2\",\n 'short' => Lang::get('rules', 'short_52'),\n 'long' => Lang::get('rules', 'long_52')\n ],\n [\n 'n' => \"5.3\",\n 'short' => Lang::get('rules', 'short_53'),\n 'long' => Lang::get('rules', 'long_53')\n ],\n [\n 'n' => \"6.1\",\n 'short' => Lang::get('rules', 'short_61'),\n 'long' => Lang::get('rules', 'long_61')\n ],\n [\n 'n' => \"6.2\",\n 'short' => Lang::get('rules', 'short_62'),\n 'long' => Lang::get('rules', 'long_62')\n ],\n [\n 'n' => \"7.0\",\n 'short' => Lang::get('rules', 'short_70'),\n 'long' => Lang::get('rules', 'long_70')\n ],\n [\n 'n' => \"7.1\",\n 'short' => Lang::get('rules', 'short_71'),\n 'long' => Lang::get('rules', 'long_71')\n ]\n );\n echo \"<ul class=\\\"rules golden_rules\\\">\\n\";\n foreach ($golden_rules as $gr) {\n $r_link = \"gr${gr['n']}\";\n echo \"<li id=\\\"${r_link}\\\">\" .\n \"<a href=\\\"#${r_link}\\\" class=\\\"rule_link\\\">${gr['n']}.</a>\" .\n '<div class=\"rule_wrap\">' .\n '<div class=\"rule_short\">' .\n $gr['short'] .\n '</div>' .\n '<div class=\"rule_long\">' .\n $gr['long'] .\n '</div>' .\n '</div>' .\n \"</li>\\n\";\n }\n echo \"</ul>\\n\";\n }", "public static function display_irc_chat_rules() {\n ?>\n <ol>\n <?= Lang::get('rules', 'chat_forums_irc') ?>\n </ol>\n<?\n }", "function caldol_hook_bbp_theme_before_forum_sub_forums(){\n\n\n\t\t\n\n\t\t//echo \"count: \" . bbp_get_forum_subforum_count() . \" --\";\n\n\t\t\n\n\t\t\n\n\t\t$subForumList = bbp_forum_get_subforums();\n\n\t\t\n\n\t\tif(sizeof($subForumList) > 1){\n\n\t\t\techo \"<ul style='margin-left: 20px;'>\";\n\n\t\tforeach($subForumList as $currForum){\n\n\t\t\t//print_r($currForum);\n\n\t\t\t// No link\n\n\t\t\t$retval = false;\n\n\t\t\t\t\n\n\t\t\t// Parse the arguments\n\n\t\t\t$r = bbp_parse_args( $args, array(\n\n\t\t\t\t\t'forum_id' => $currForum->ID,\n\n\t\t\t\t\t'user_id' => 0,\n\n\t\t\t\t\t'before' => '',\n\n\t\t\t\t\t'after' => '',\n\n\t\t\t\t\t'subscribe' => __( 'Subscribe', 'bbpress' ),\n\n\t\t\t\t\t'unsubscribe' => __( 'x', 'bbpress' )\n\n\t\t\t), 'get_forum_subscribe_link' );\n\n\t\t\t\t\n\n\t\t\t\n\n\t\t\t$isSubscribed = bbp_get_forum_subscription_link( $r);\n\n\t\t\t\n\n\t\t\t\t\n\n\t\t\tif(strpos($isSubscribed, 'is-subscribed') != 0){\n\n\t\t\t\n\n\t\t\techo \"<li class='bbp-topic-title'><a href='\" . bbp_get_forum_permalink($currForum->ID) . \"'>\" . $currForum->post_title . \"</a><span class='bbp-topic-action'>&nbsp;&nbsp; \" . $isSubscribed . \" </span></li>\";\n\n\t\t\t}\n\n\t\t\t//print_r($currForum);\n\n\t\t}\n\n\t\t\techo \"</ul>\";\n\n\t\t} // end > 1\n\n\t\t\n\n\t\t\n\n}", "function show_forum_title($category, $forum, $thread, $link_thread=false) {\n if ($category) {\n $is_helpdesk = $category->is_helpdesk;\n } else {\n $is_helpdesk = false;\n }\n\n $where = $is_helpdesk?tra(\"Questions and Answers\"):tra(\"Message boards\");\n $top_url = $is_helpdesk?\"forum_help_desk.php\":\"forum_index.php\";\n\n if (!$forum && !$thread) {\n echo \"<span class=\\\"title\\\">$where</span>\\n\";\n\n } else if ($forum && !$thread) {\n echo \"<span class=title>\";\n echo \"<a href=\\\"$top_url\\\">$where</a> : \";\n echo $forum->title;\n echo \"</span>\";\n } else if ($forum && $thread) {\n echo \"<span class=title>\n <a href=\\\"$top_url\\\">$where</a> : \n <a href=\\\"forum_forum.php?id=\".$forum->id.\"\\\">\", $forum->title, \"</a> : \n \";\n if ($link_thread) {\n echo \"<a href=forum_thread.php?id=$thread->id>\";\n }\n echo cleanup_title($thread->title);\n if ($link_thread) {\n echo \"</a>\";\n }\n echo \"</span>\";\n } else {\n echo \"Invalid thread ID\";\n }\n}", "function process_board($card)\r\r\n{\r\r\n if($card['var']['themecolor']){\r\r\n $color = 'style=\"color:'.$card['var']['themecolor'].'\"';\r\r\n $bordercolor = 'style=\"border-top-color:'.$card['var']['themecolor'].'\"';\r\r\n }\r\r\n\r\r\n $title_link = $card['var']['title_link'] ? $card['var']['title_link'] : 'javascript:void(0);';\r\r\n $header = '<div class=\"news-t\" '.$bordercolor.'><h3>'.\r\r\n '<a '.$color.' href=\"'.$title_link.'\">'.$card['var']['title'].'</a></h3>';\r\r\n if($card['var']['subtitle']){\r\r\n $header .= '<nav class=\"tmore\">';\r\r\n foreach ($card['var']['subtitle'] as $i => $subtitle) {\r\r\n $header .= '<a '.$color.' href=\"'.$card['var']['subtitle_link'][$i].'\">'.$subtitle.'</a>';\r\r\n }\r\r\n $header .= '</nav>';\r\r\n }\r\r\n $header .= '</div>';\r\r\n\r\r\n include_once libfile('function/forumlist');\r\r\n $fids = dintval($card['var']['fids'], TRUE);\r\r\n $forums = C::t('forum_forum')->fetch_all_by_fid($fids);\r\r\n $forum_fields = C::t('forum_forumfield')->fetch_all($fids);\r\r\n foreach($forums as $forum) {\r\r\n\r\r\n if($forum_fields[$forum['fid']]['fid']) {\r\r\n $forum = array_merge($forum, $forum_fields[$forum['fid']]);\r\r\n }\r\r\n $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']);\r\r\n if(!is_array($forum['extra'])) {\r\r\n $forum['extra'] = array();\r\r\n }\r\r\n\r\r\n if($forum['icon']) {\r\r\n $forum['icon'] = get_forumimg($forum['icon']);\r\r\n }\r\r\n $forumlist[ $forum['fid'] ] = $forum;\r\r\n }\r\r\n\r\r\n $list = '<ul class=\"b-l cl\">';\r\r\n foreach ($forumlist as $f) {\r\r\n\r\r\n $link = forum_link($f['fid']);\r\r\n\r\r\n $list .= ' <li><a href=\"'.$link.'\"><img src=\"'.$f['icon'].'\" onerror=\"this.error=null;this.src=\\'source/plugin/xigua_portal/template/cards/board/images/bg.png\\'\"><span class=\"b-tit\">'.$f['name'].'</span></a></li>';\r\r\n }\r\r\n $list .= '</ul>';\r\r\n\r\r\n $card['var']['html'] = $header . $list;\r\r\n\r\r\n return $card;\r\r\n}", "abstract public function print_view_page($forum, $groupid);", "abstract public function print_discussion_page($discussion);", "function DisplayForumCategories()\n {\n global $DB, $categoryid, $mainsettings, $sdlanguage, $sdurl, $userinfo, $usersystem;\n\n //SD343: display optional tag cloud\n $forum_tags = false;\n if(!empty($this->conf->plugin_settings_arr['display_tagcloud']))\n {\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n SD_Tags::$maxentries = 30;\n SD_Tags::$plugins = $this->conf->plugin_id;\n SD_Tags::$tags_title = $sdlanguage['tags_title'];\n SD_Tags::$targetpageid = $categoryid;\n SD_Tags::$tag_as_param = 'tag';\n if($forum_tags = SD_Tags::DisplayCloud(false))\n {\n if(in_array($this->conf->plugin_settings_arr['display_tagcloud'],array(1,3)))\n {\n echo $forum_tags;\n }\n }\n }\n\n echo '\n <table border=\"0\" class=\"forums\" cellpadding=\"0\" cellspacing=\"0\" summary=\"layout\" width=\"100%\"><thead><tr>';\n if(!empty($this->conf->plugin_settings_arr['display_forum_image']))\n {\n echo '<th class=\"col-forum-icon\"> </th>';\n }\n echo '<th class=\"col-forum-title\">'.$this->conf->plugin_phrases_arr['column_forum'].'</th>';\n if(!empty($mainsettings['enable_rss_forum']))\n {\n echo '<th class=\"col-rss\"><a title=\"RSS\" class=\"rss-icon\" href=\"forumrss.php\">RSS</a></th>';\n }\n echo '<th class=\"col-topic-count\">'.$this->conf->plugin_phrases_arr['column_topics'].'</th>\n <th class=\"col-post-count\">'.$this->conf->plugin_phrases_arr['column_posts'].'</th>\n <th class=\"col-last-updated\">'.$this->conf->plugin_phrases_arr['column_last_updated'].'</th>\n </tr></thead>';\n\n if(isset($this->conf) && isset($this->conf->forums_cache['categories'])) //SD343\n foreach($this->conf->forums_cache['categories'] as $fid)\n {\n if(!isset($this->conf->forums_cache['forums'][$fid])) continue; //SD343\n $entry = $this->conf->forums_cache['forums'][$fid];\n\n if(!$this->conf->IsSiteAdmin)\n {\n if(empty($entry['online'])) continue;\n $entry_groups = sd_ConvertStrToArray($entry['access_view'],'|');\n if(!empty($entry_groups) && !count(@array_intersect($userinfo['usergroupids'], $entry_groups)))\n continue;\n }\n\n if(empty($entry['parent_forum_id']) && empty($entry['is_category']))\n {\n if($res = $this->DisplayForums(0,$fid,$entry['title']))\n {\n echo $res;\n }\n continue;\n }\n\n $output = '\n <tbody>\n <tr>\n <td colspan=\"6\" class=\"category-cell\">\n <div class=\"category-title-container\">';\n\n if(strlen($entry['title']))\n {\n $image = '';\n if(!empty($entry['image']) && !empty($entry['image_h']) && !empty($entry['image_w']))\n {\n $image = '<img src=\"'.SDUserCache::$img_path.$entry['image'].'\" alt=\"\" width=\"'.(int)$entry['image_w'].'\" height=\"'.(int)$entry['image_h'].'\" />';\n }\n $output .= '<span class=\"category-image\">'.($image?$image:'&nbsp;').'</span> <span class=\"category-title\">'.$entry['title'].'</span>';\n if(strlen($entry['description']))\n {\n $output .= '\n <span class=\"category-description\">' . $entry['description']. '</span>';\n }\n }\n $output .= '\n </div>\n </td>\n </tr>\n </tbody>';\n\n if($res = $this->DisplayForums($fid,0,$entry['title']))\n {\n echo $output . $res;\n }\n\n } //foreach\n\n echo '\n </table>\n ';\n\n //SD343: display optional tag cloud\n if(!empty($forum_tags) && !empty($this->conf->plugin_settings_arr['display_tagcloud']) &&\n in_array($this->conf->plugin_settings_arr['display_tagcloud'],array(2,3)))\n {\n echo $forum_tags;\n }\n\n }", "function df_fields_rules($fields) {\r\n\t$fields['rules'] = '<h3 id=\"leave-a-reply\">'.__(\"Leave a Reply\",THEME_NAME).'</h3>';\r\n\t$fields['note'] = '<p class=\"comment-notes\">'.__(\"Your email address will not be published. Required fields are marked \",THEME_NAME).'<span>*</span></p>';\r\n\tprint $fields['rules'].$fields['note'];\r\n}", "function Forum_showForum(&$PAGEDATA, &$id) {\n\tWW_addCSS('/ww.plugins/forum/frontend/forum.css');\n\t// { forum data\n\t$forum=dbRow('select * from forums where id='.$id);\n\tif (!$forum || !count($forum)) {\n\t\treturn '<em class=\"error\">Error: this forum does not exist!</em>';\n\t}\n\t$c='<h2 class=\"forum-name\">'.htmlspecialchars($forum['name']).'</h2>';\n\t// }\n\t// { subforums\n\t$subforums=dbAll('select * from forums where parent_id='.$id);\n\tif ($subforums && count($subforums)) {\n\t\treturn 'TODO: subforums';\n\t}\n\t// }\n\t// { threads\n\t$threads=dbAll(\n\t\t'select * from forums_threads '\n\t\t.'where forum_id='.$id.' order by last_post_date desc'\n\t);\n\tif ($threads && count($threads)) {\n\t\t$c.='<table id=\"forum-threads\">'\n\t\t\t.'<tr><th>Topics</th><th>Replies</th>'\n\t\t\t.'<th>Author</th><th>Last Post</th></tr>';\n\t\tforeach ($threads as $thread) {\n\t\t\t$user=User::getInstance($thread['creator_id']);\n\t\t\t$last_user=User::getInstance($thread['last_post_by']);\n\t\t\t$user_name=$user?$user->get('name'):'';\n\t\t\t$last_user_name=$last_user?$last_user->get('name'):'';\n\t\t\t$c.='<tr><td><a href=\"'.$PAGEDATA->getRelativeUrl()\n\t\t\t\t.'?forum-f='.$id.'&amp;forum-t='.$thread['id'].'\">'\n\t\t\t\t.htmlspecialchars($thread['name']).'</td><td>'\n\t\t\t\t.($thread['num_posts']-1).'</td>'\n\t\t\t\t.'<td>'.htmlspecialchars($user_name).'</td><td>'\n\t\t\t\t.Core_dateM2H($thread['last_post_date'], 'datetime').', by '\n\t\t\t\t.htmlspecialchars($last_user_name).'</td></tr>';\n\t\t}\n\t\t$c.='</table>';\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-no-threads\"><p>This forum has no threads in it.'\n\t\t\t.' Be the first to post to it!</p></div>';\n\t}\n\t// }\n\t// { post form\n\tif (isset($_SESSION['userdata']) && $_SESSION['userdata']['id']) {\n\t\t$c.='<div id=\"forum-post-submission-form\"><script defer=\"defer\">var forum_id='\n\t\t\t.$id.';</script></div>';\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/ckeditor.js');\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js');\n\t\tWW_addScript('forum/frontend/forum.js');\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-not-logged-in\">In order to post to this forum,'\n\t\t\t.' you must <a href=\"/_r?type=loginpage\">login'\n\t\t\t.'</a> first.</div>';\n\t}\n\t// }\n\treturn $c;\n}", "function xthreads_buildcache_forums($fp) {\r\n\tglobal $cache;\r\n\t$forums = $cache->read('forums');\r\n\t$xtforums = array();\r\n\trequire_once MYBB_ROOT.'inc/xthreads/xt_phptpl_lib.php';\r\n\tfwrite($fp, '\r\n\t\tfunction xthreads_evalcacheForums($fid) {\r\n\t\t\tswitch($fid) {');\r\n\tforeach($forums as $fid => $forum) {\r\n\t\t$tplprefix = $forum['xthreads_tplprefix'];\r\n\t\txthreads_sanitize_eval($tplprefix);\r\n\t\t$langprefix = $forum['xthreads_langprefix'];\r\n\t\txthreads_sanitize_eval($langprefix);\r\n\t\t\r\n\t\t$settingoverrides = '';\r\n\t\tforeach(explode(\"\\n\", str_replace(\"{\\n}\", \"\\r\", str_replace(\"\\r\", '', $forum['xthreads_settingoverrides']))) as $override) {\r\n\t\t\t$kv = explode('=', str_replace(\"\\r\", \"\\n\", $override), 2);\r\n\t\t\tif(!isset($kv[1])) continue;\r\n\t\t\t$kv[0] = strtr($kv[0], array('\\\\' => '', '\\'' => ''));\r\n\t\t\txthreads_sanitize_eval($kv[1]);\r\n\t\t\t$settingoverrides .= '\\''.$kv[0].'\\' => \"'.$kv[1].'\", ';\r\n\t\t}\r\n\t\t\r\n\t\tif(!xthreads_empty($tplprefix) || !xthreads_empty($langprefix) || $settingoverrides !== '') // slight optimisation: only write if there's something interesting\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\tcase '.$fid.': return array(\r\n\t\t\t\t\t\\'tplprefix\\' => '.(xthreads_empty($tplprefix) ? '\\'\\'' : 'array_map(\\'trim\\', explode(\\',\\', \"'.$tplprefix.'\"))').',\r\n\t\t\t\t\t\\'langprefix\\' => '.(xthreads_empty($langprefix) ? '\\'\\'' : 'array_map(\\'trim\\', explode(\\',\\', \"'.$langprefix.'\"))').',\r\n\t\t\t\t\t\\'settingoverrides\\' => '.($settingoverrides==='' ? '\\'\\'' : 'array('.$settingoverrides.')').',\r\n\t\t\t\t);');\r\n\t\t$xtforum = array(\r\n\t\t\t'defaultfilter_tf' => array(),\r\n\t\t\t'defaultfilter_xt' => array(),\r\n\t\t);\r\n\t\t\r\n\t\tforeach(explode(\"\\n\", str_replace(\"{\\n}\", \"\\r\", str_replace(\"\\r\", '', $forum['xthreads_defaultfilter']))) as $filter) {\r\n\t\t\t$kv = explode('=', str_replace(\"\\r\", \"\\n\", $filter), 2);\r\n\t\t\tif(!isset($kv[1])) continue;\r\n\t\t\t$kv[0] = strtr($kv[0], array('\\\\' => '', '\\'' => ''));\r\n\t\t\t//$kv[0] = urldecode($kv[0]); // - this is not necessary, since $kv[0] can never contain newlines or = signs\r\n\t\t\t$isarray = false;\r\n\t\t\tif($p = strrpos($kv[0], '[')) {\r\n\t\t\t\t$kv[0] = substr($kv[0], 0, $p);\r\n\t\t\t\t$isarray = true;\r\n\t\t\t}\r\n\t\t\tunset($filter_array);\r\n\t\t\tif(substr($kv[0], 0, 5) == '__xt_') {\r\n\t\t\t\t$kv[0] = substr($kv[0], 5);\r\n\t\t\t\tif(in_array($kv[0], array('uid','lastposteruid','icon','prefix')))\r\n\t\t\t\t\t$filter_array =& $xtforum['defaultfilter_xt'];\r\n\t\t\t} else {\r\n\t\t\t\tif(!isset($threadfield_cache))\r\n\t\t\t\t\t$threadfield_cache = xthreads_gettfcache($fid);\r\n\t\t\t\tif(isset($threadfield_cache[$kv[0]]) && $threadfield_cache[$kv[0]]['allowfilter'])\r\n\t\t\t\t\t$filter_array =& $xtforum['defaultfilter_tf'];\r\n\t\t\t}\r\n\t\t\tif(isset($filter_array)) {\r\n\t\t\t\txthreads_sanitize_eval($kv[1]);\r\n\t\t\t\tif($isarray)\r\n\t\t\t\t\t$filter_array[$kv[0]][] = $kv[1];\r\n\t\t\t\telse\r\n\t\t\t\t\t$filter_array[$kv[0]] = $kv[1];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tunset($forum['xthreads_tplprefix'], $forum['xthreads_langprefix'], $forum['xthreads_defaultfilter'], $forum['xthreads_settingoverrides']);\r\n\t\tif(!empty($xtforum)) $xtforums[$fid] = $xtforum;\r\n\t}\r\n\tfwrite($fp, '\r\n\t\t\t} return array(\\'tplprefix\\' => \\'\\', \\'langprefix\\' => \\'\\', \\'settingoverrides\\' => \\'\\');\r\n\t\t}\r\n\t\t\r\n\t\tfunction xthreads_evalcacheForumFilters($fid) {\r\n\t\t\tswitch($fid) {');\r\n\t\t\r\n\t{ // dummy brace\r\n\t\tforeach($xtforums as $fid => &$xtforum) {\r\n\t\t\t// check to see if everything is empty\r\n\t\t\t$allempty = true;\r\n\t\t\tforeach($xtforum as $k => &$filter)\r\n\t\t\t\tif(!empty($filter)) {\r\n\t\t\t\t\t$allempty = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\tif($allempty) continue; // don't write anything if there's nothing interesting to write about\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\tcase '.$fid.': return array(');\r\n\t\t\tforeach($xtforum as $k => &$filter) {\r\n\t\t\t\tfwrite($fp, '\r\n\t\t\t\t\t\\''.$k.'\\' => array(');\r\n\t\t\t\tforeach($filter as $n => &$v) {\r\n\t\t\t\t\tfwrite($fp, '\\''.$n.'\\' => ');\r\n\t\t\t\t\tif(is_array($v))\r\n\t\t\t\t\t\tfwrite($fp, 'array(\"'.implode('\",\"', $v).'\"),');\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tfwrite($fp, '\"'.$v.'\",');\r\n\t\t\t\t}\r\n\t\t\t\tfwrite($fp, '\r\n\t\t\t\t\t),');\r\n\t\t\t}\r\n\t\t\tfwrite($fp, '\r\n\t\t\t\t);');\r\n\t\t}\r\n\t}\r\n\t\r\n\tfwrite($fp, '\r\n\t\t\t} return array(\\'defaultfilter_tf\\' => array(), \\'defaultfilter_xt\\' => array());\r\n\t\t}');\r\n\t$cache->update('forums', $forums);\r\n}", "public function readforums($args=array())\n {\n $permcheck = (isset($args['permcheck'])) ? strtoupper($args['permcheck']): ACCESS_READ;\n if (!empty($permcheck) &&\n ($permcheck <> ACCESS_OVERVIEW) &&\n ($permcheck <> ACCESS_READ) &&\n ($permcheck <> ACCESS_COMMENT) &&\n ($permcheck <> ACCESS_MODERATE) &&\n ($permcheck <> ACCESS_ADMIN) &&\n ($permcheck <> 'NOCHECK') ) {\n return LogUtil::registerError($this->__('Error! The action you wanted to perform was not successful for some reason, maybe because of a problem with what you input. Please check and try again.'));\n }\n \n $where = '';\n if (isset($args['forum_id'])) {\n $where = \"WHERE tbl.forum_id='\". (int)DataUtil::formatForStore($args['forum_id']) .\"' \";\n } elseif (isset($args['cat_id'])) {\n $where = \"WHERE tbl.cat_id='\". (int)DataUtil::formatForStore($args['cat_id']) .\"' \";\n }\n \n if ($permcheck <> 'NOCHECK') {\n $permfilter[] = array('realm' => 0,\n 'component_left' => 'Dizkus',\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'cat_id',\n 'instance_middle' => 'forum_id',\n 'instance_right' => '',\n 'level' => $permcheck);\n } else {\n $permfilter = null;\n }\n \n $joininfo[] = array ('join_table' => 'dizkus_categories',\n 'join_field' => array('cat_title', 'cat_id'),\n 'object_field_name' => array('cat_title', 'cat_id'),\n 'compare_field_table'=> 'cat_id',\n 'compare_field_join' => 'cat_id');\n \n $orderby = 'a.cat_order, tbl.forum_order, tbl.forum_name';\n \n $forums = DBUtil::selectExpandedObjectArray('dizkus_forums', $joininfo, $where, $orderby, -1, -1, '', $permfilter);\n \n for ($i = 0; $i < count($forums); $i++) {\n // rename some fields for BC compatibility\n $forums[$i]['pop3_active'] = $forums[$i]['forum_pop3_active'];\n $forums[$i]['pop3_server'] = $forums[$i]['forum_pop3_server'];\n $forums[$i]['pop3_port'] = $forums[$i]['forum_pop3_port'];\n $forums[$i]['pop3_login'] = $forums[$i]['forum_pop3_login'];\n $forums[$i]['pop3_password'] = $forums[$i]['forum_pop3_password'];\n $forums[$i]['pop3_interval'] = $forums[$i]['forum_pop3_interval'];\n $forums[$i]['pop3_lastconnect'] = $forums[$i]['forum_pop3_lastconnect'];\n $forums[$i]['pop3_matchstring'] = $forums[$i]['forum_pop3_matchstring'];\n $forums[$i]['pop3_pnuser'] = $forums[$i]['forum_pop3_pnuser'];\n $forums[$i]['pop3_pnpassword'] = $forums[$i]['forum_pop3_pnpassword'];\n \n // we re-use the pop3_active field to distinguish between\n // 0 - no external source\n // 1 - mail\n // 2 - rss\n // now\n // to do: rename the db fields: \n $forums[$i]['externalsource'] = $forums[$i]['forum_pop3_active'];\n $forums[$i]['externalsourceurl'] = $forums[$i]['forum_pop3_server'];\n $forums[$i]['externalsourceport'] = $forums[$i]['forum_pop3_port'];\n $forums[$i]['pnuser'] = $forums[$i]['forum_pop3_pnuser'];\n $forums[$i]['pnpassword'] = $forums[$i]['forum_pop3_pnpassword'];\n }\n \n if (count($forums) > 0) {\n if (isset($args['forum_id'])) {\n return $forums[0];\n }\n }\n \n return $forums;\n }", "function asForumTopics($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<tr class='__topic __tid{$data['tid']} <if test=\"!$data['_icon']['is_read']\">unread</if> expandable <if test=\"$data['approved'] != 1\"> moderated</if>' id='trow_{$data['tid']}' data-tid=\"{$data['tid']}\">\n\t<td class='col_f_icon short altrow'>\n\t\t{parse template=\"generateTopicIcon\" group=\"global_other\" params=\"$data['_icon'], $data['_unreadUrl']\"}\n\t</td>\n\t<td>\n\t\t<if test=\"archivedBadge:|:$this->registry->class_forums->fetchArchiveTopicType( $data ) == 'archived'\">\n\t\t\t<span class='ipsBadge ipsBadge_lightgrey'>{$this->lang->words['topic_is_archived']}</span>\n\t\t</if>\n\t\t<if test=\"hasPrefix:|:!empty($data['tags']['formatted']['prefix'])\">\n\t\t\t{$data['tags']['formatted']['prefix']}\n\t\t</if>\n\t\t<h4><a href='{parse url=\"showtopic={$data['tid']}<if test=\"isNewPostTR:|:$this->request['do']=='new_posts' OR $this->request['do']=='active'\">&amp;view=getnewpost<else /><if test=\"resultIsPostTR:|:$data['pid'] AND $data['pid'] != $data['topic_firstpost']\">&amp;view=findpost&amp;p={$data['pid']}</if></if>&amp;hl={$data['cleanSearchTerm']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['view_result']}'>{$data['_shortTitle']}</a></h4>\n\t\t<span class='desc blend_links'>\n\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><span class='desc lighter'>{$this->lang->words['search_aft_in']}</span> <a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t</foreach>\n\t\t</span>\n\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t<br />{$this->lang->words['aft_started_by']} {$data['starter']}, {parse date=\"$data['start_date']\" format=\"DATE\"}\n\t\t\t<if test=\"hasTags:|:count($data['tags']['formatted'])\">\n\t\t\t\t&nbsp;<img src='{$this->settings['img_url']}/icon_tag.png' /> {$data['tags']['formatted']['truncatedWithLinks']}\n\t\t\t</if>\n\t\t</span>\n\t\t<if test=\"multipages:|:isset( $data['pages'] ) AND is_array( $data['pages'] ) AND count( $data['pages'] )\">\n\t\t\t<ul class='mini_pagination toggle_notify_off'>\n\t\t\t<foreach loop=\"pages:$data['pages'] as $page\">\n\t\t\t\t\t<if test=\"haslastpage:|:$page['last']\">\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']} {$this->lang->words['_rarr']}</a></li>\n\t\t\t\t\t<else />\n\t\t\t\t\t\t<li><a href=\"{parse url=\"showtopic={$data['tid']}&amp;st={$page['st']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\" title='{$this->lang->words['topic_goto_page']} {$page['page']}'>{$page['page']}</a></li>\n\t\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t\t</ul>\n\t\t</if>\n\t\t<if test=\"bothSearchUnderTitle:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t<span class='desc lighter blend_links toggle_notify_off'>\n\t\t\t\t<br />{$this->lang->words['n_last_post_by']} {$data['last_poster']},\n\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t</span>\n\t\t</if>\n\t\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t\t{parse template=\"followData\" group=\"search\" params=\"$data['_followData']\"}\n\t\t</if>\n\t</td>\n\t<td class='col_f_preview __topic_preview'>\n\t\t<a href='#' class='expander closed' title='{$this->lang->words['view_topic_preview']}'>&nbsp;</a>\n\t</td>\n\t<td class='col_f_views'>\n\t\t<ul>\n\t\t\t<li>{parse format_number=\"$data['posts']\"} <if test=\"replylang:|:intval($data['posts']) == 1\">{$this->lang->words['reply']}<else />{$this->lang->words['replies']}</if></li>\n\t\t\t<li class='views desc'>{parse format_number=\"$data['views']\"} {$this->lang->words['views']}</li>\n\t\t</ul>\n\t</td>\n\t<td class='col_f_post'>\n\t\t{parse template=\"userSmallPhoto\" group=\"global\" params=\"$data\"}\n\t\t<ul class='last_post ipsType_small'>\n\t\t\t<if test=\"bothSearch:|:IPSSearchRegistry::get('set.searchResultType') == 'both'\">\n\t\t\t\t<li>{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{$this->lang->words['n_posted']} {parse date=\"$data['_post_date']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t<else />\n\t\t\t\t<li>{$data['last_poster']}</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href='{parse url=\"showtopic={$data['tid']}&amp;view=getlastpost\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}' title='{$this->lang->words['goto_last_post']}'>{parse date=\"$data['_last_post']\" format=\"DATE\"}</a>\n\t\t\t\t</li>\n\t\t\t</if>\n\t\t</ul>\n\t</td>\n\t<if test=\"isFollowedStuff:|:count($data['_followData'])\">\n\t\t<td class='col_f_mod'>\n\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$data['_followData']['like_app']}-{$data['_followData']['like_area']}-{$data['_followData']['like_rel_id']}\" />\n\t\t</td>\n\t<else />\n\t\t<if test=\"isAdmin:|:$this->memberData['g_is_supmod']\">\n\t\t\t<td class='col_f_mod'>\n\t\t\t\t<if test=\"isArchivedCb:|:$this->request['search_app_filters']['forums']['liveOrArchive'] == 'archive'\">\n\t\t\t\t\t&nbsp;\n\t\t\t\t<else />\n\t\t\t\t\t<input type='checkbox' class='input_check topic_mod' id='tmod_{$data['tid']}' />\n\t\t\t\t</if>\n\t\t\t</td>\n\t\t</if>\n\t</if>\n</tr>\n<if test=\"$data['pid']\">\n<script type='text/javascript'>\nipb.global.searchResults[ {$data['tid']} ] = { pid: {parse expression=\"intval($data['pid'])\"}, searchterm:\"{$data['cleanSearchTerm']}\" };\n</script>\n</if>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "function plugin_initconfig_forum()\n{\n global $CONF_FORUM, $_FORUM_DEFAULT, $_TABLES;\n\n if (is_array($CONF_FORUM) && (count($CONF_FORUM) > 1)) {\n $_FORUM_DEFAULT = array_merge($_FORUM_DEFAULT, $CONF_FORUM);\n }\n\n $c = config::get_instance();\n $n = 'forum';\n $o = 1;\n if (!$c->group_exists($n)) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $n);\n // ----------------------------------\n $t = 0;\n $c->add('tab_main', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $n, $t);\n $c->add('registration_required', $_FORUM_DEFAULT['registration_required'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('registered_to_post', $_FORUM_DEFAULT['registered_to_post'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_notification', $_FORUM_DEFAULT['allow_notification'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topicreview', $_FORUM_DEFAULT['show_topicreview'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_user_dateformat', $_FORUM_DEFAULT['allow_user_dateformat'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('use_pm_plugin', $_FORUM_DEFAULT['use_pm_plugin'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topics_perpage', $_FORUM_DEFAULT['show_topics_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_posts_perpage', $_FORUM_DEFAULT['show_posts_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_messages_perpage', $_FORUM_DEFAULT['show_messages_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_searches_perpage', $_FORUM_DEFAULT['show_searches_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('showblocks', $_FORUM_DEFAULT['showblocks'], 'select', 0, 0, 6, $o++, true, $n, $t);\n $c->add('usermenu', $_FORUM_DEFAULT['usermenu'], 'select', 0, 0, 7, $o++, true, $n, $t);\n //$c->add('use_themes_template', $_FORUM_DEFAULT['use_themes_template'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('likes_forum', $_FORUM_DEFAULT['likes_forum'], 'select', 0, 0, 41, $o++, true, $n, $t);\n $c->add('recaptcha', $_FORUM_DEFAULT['recaptcha'], 'select', 0, 0, 16, $o++, true, $n, $t);\n // ----------------------------------\n $t = 1;\n $c->add('tab_topicposting', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_topicposting', NULL, 'fieldset', 0, 1, NULL, 0, true, $n, $t);\n $c->add('show_subject_length', $_FORUM_DEFAULT['show_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_username_length', $_FORUM_DEFAULT['min_username_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_subject_length', $_FORUM_DEFAULT['min_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_comment_length', $_FORUM_DEFAULT['min_comment_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('views_tobe_popular', $_FORUM_DEFAULT['views_tobe_popular'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_speedlimit', $_FORUM_DEFAULT['post_speedlimit'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allowed_editwindow', $_FORUM_DEFAULT['allowed_editwindow'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_html', $_FORUM_DEFAULT['allow_html'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_htmlmode', $_FORUM_DEFAULT['post_htmlmode'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('convert_break', $_FORUM_DEFAULT['convert_break'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_censor', $_FORUM_DEFAULT['use_censor'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_glfilter', $_FORUM_DEFAULT['use_glfilter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_geshi', $_FORUM_DEFAULT['use_geshi'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_spamx_filter', $_FORUM_DEFAULT['use_spamx_filter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('show_moods', $_FORUM_DEFAULT['show_moods'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_smilies', $_FORUM_DEFAULT['allow_smilies'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_smilies_plugin', $_FORUM_DEFAULT['use_smilies_plugin'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('avatar_width', $_FORUM_DEFAULT['avatar_width'], 'text', 0, 1, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 2;\n $c->add('tab_centerblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_centerblock', NULL, 'fieldset', 0, 2, NULL, 0, true, $n, $t);\n $c->add('show_centerblock', $_FORUM_DEFAULT['show_centerblock'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_homepage', $_FORUM_DEFAULT['centerblock_homepage'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_numposts', $_FORUM_DEFAULT['centerblock_numposts'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('cb_subject_size', $_FORUM_DEFAULT['cb_subject_size'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_where', $_FORUM_DEFAULT['centerblock_where'], 'select', 0, 2, 5, $o++, true, $n, $t);\n // ----------------------------------\n $t = 3;\n $c->add('tab_sideblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_sideblock', NULL, 'fieldset', 0, 3, NULL, 0, true, $n, $t);\n $c->add('sideblock_numposts', $_FORUM_DEFAULT['sideblock_numposts'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_subject_size', $_FORUM_DEFAULT['sb_subject_size'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_latestpostonly', $_FORUM_DEFAULT['sb_latestpostonly'], 'select', 0, 3, 0, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_settings', NULL, 'fieldset', 0, 5, NULL, 0, true, $n, $t);\n $c->add('sideblock_enable', $_FORUM_DEFAULT['sideblock_enable'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_isleft', $_FORUM_DEFAULT['sideblock_isleft'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_order', $_FORUM_DEFAULT['sideblock_order'], 'text', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_topic_option',$_FORUM_DEFAULT['sideblock_topic_option'],'select', 0, 5, 15, $o++, true, $n, $t);\n $c->add('sideblock_topic', $_FORUM_DEFAULT['sideblock_topic'], '%select', 0, 5, NULL, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_permissions', NULL, 'fieldset', 0, 6, NULL, 0, true, $n, $t);\n $new_group_id = 0;\n if (isset($_GROUPS['Forum Admin'])) {\n $new_group_id = $_GROUPS['Forum Admin'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Forum Admin'\");\n if ($new_group_id == 0) {\n if (isset($_GROUPS['Root'])) {\n $new_group_id = $_GROUPS['Root'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Root'\");\n }\n }\n }\n $c->add('sideblock_group_id', $new_group_id, 'select', 0, 6, NULL, $o++, true, $n, $t);\n $c->add('sideblock_permissions', $_FORUM_DEFAULT['sideblock_permissions'], '@select', 0, 6, 14, $o++, true, $n, $t);\n // ----------------------------------\n $t = 4;\n $c->add('tab_rank', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_rank', NULL, 'fieldset', 0, 4, NULL, 0, true, $n, $t);\n $c->add('level1', $_FORUM_DEFAULT['level1'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2', $_FORUM_DEFAULT['level2'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3', $_FORUM_DEFAULT['level3'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4', $_FORUM_DEFAULT['level4'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5', $_FORUM_DEFAULT['level5'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level1name', $_FORUM_DEFAULT['level1name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2name', $_FORUM_DEFAULT['level2name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3name', $_FORUM_DEFAULT['level3name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4name', $_FORUM_DEFAULT['level4name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5name', $_FORUM_DEFAULT['level5name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 5;\n $c->add('tab_menublock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_menublock_settings', NULL, 'fieldset', 0, 7, NULL, 0, true, $n, $t);\n $c->add('menublock_isleft', $_FORUM_DEFAULT['menublock_isleft'], 'select', 0, 7, 0, $o++, true, $n, $t);\n $c->add('menublock_order', $_FORUM_DEFAULT['menublock_order'], 'text', 0, 7, 0, $o++, true, $n, $t);\n }\n\n return true;\n}", "function _show_topic() {\n\n\t\t$_posts_per_page = !empty(module('forum')->USER_SETTINGS['POSTS_PER_PAGE']) ? module('forum')->USER_SETTINGS['POSTS_PER_PAGE'] : module('forum')->SETTINGS['NUM_POSTS_ON_PAGE'];\n\n\t\tif (!module('forum')->SETTINGS['ALLOW_PRINT_TOPIC']) {\n\t\t\treturn module('forum')->_show_error('Print topic is disabled');\n\t\t}\n\n\t\tmain()->NO_GRAPHICS = true;\n\n\t\t$topic_id = intval($_GET['id']);\n\n\t\t// Get topic info\n\t\t$topic_info = db()->query_fetch('SELECT * FROM '.db('forum_topics').' WHERE id='.intval($topic_id).' LIMIT 1');\n\t\tif (empty($topic_info)) {\n\t\t\treturn '';\n\t\t}\n\t\t?>\n<html>\n<head>\n<title><?php echo $topic_info['name']?></title>\n<style type=\"text/css\">\n<!--\ntd, p, div\n{\n\tfont: 10pt verdana;\n}\n.smallfont\n{\n\tfont-size: 11px;\n}\n.tborder\n{\n\tborder: 1px solid #808080;\n}\n.thead\n{\n\tbackground-color: #EEEEEE;\n}\n.page\n{\n\tbackground-color: #FFFFFF;\n\tcolor: #000000;\n}\n-->\n</style>\n</head>\n<body class=\"page\">\n\t\t<?php\n\n\t\techo \"<a href='\".process_url(\"./?object=forum&action=view_topic&id=\".$topic_id).\"'><b>\".$topic_info[\"name\"].\"</b></a><br/>\".PHP_EOL;\n\t\t// Prepare SQL query\n\t\t$sql = 'SELECT * FROM '.db('forum_posts').' WHERE topic='.$topic_id;\n\t\t$order_by = ' ORDER BY created ASC ';\n\t\tlist($add_sql, $pages, $topic_num_posts) = common()->divide_pages($sql, null, null, $_posts_per_page);\n\n\t\tif (!empty($pages))\n\t\t {\n\t\t\techo '<br /><small>Pages: '.$pages.'</small>'.PHP_EOL;\n\t\t }\n\n\t\techo '<BR>';\n\t\t// Init bb codes module\n\t\t$BB_OBJ = _class('bb_codes');\n\t\t// Process posts\n\t\t$Q = db()->query($sql. $order_by. $add_sql);\n\t\twhile ($post_info = db()->fetch_assoc($Q))\n\t\t {\n\t\t ?>\n<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n <tr>\n\t<td class=\"page\">\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n\t\t <tr valign=\"bottom\">\n\t\t\t<td style=\"font-size:14pt\"><?php echo _prepare_html($post_info['user_name'])?></td>\n\t\t\t<td class=\"smallfont\" align=\"right\"><?php echo _format_date($post_info['created'], 'long')?></td>\n\t\t </tr>\n\t\t</table>\n\t\t<hr/>\n\t\t<div><?php echo $BB_OBJ->_process_text($post_info['text'])?></div>\n\t</td>\n </tr>\n</table>\n<br/>\n\t\t <?php\n\t\t }\n\t\techo '</body></html>';\n\t}", "function Forum_show(&$PAGEDATA) {\n\t$view=0;\n\tif (isset($_REQUEST['forum-t'])) {\n\t\t$view=2;\n\t\t$thread_id=(int)$_REQUEST['forum-t'];\n\t}\n\telse if (isset($_REQUEST['forum-f'])) {\n\t\t$view=1;\n\t\t$forum_id=(int)$_REQUEST['forum-f'];\n\t}\n\tif ($view==0) {\n\t\t$forums=dbAll(\n\t\t\t'select * from forums where parent_id=0 and page_id='.$PAGEDATA->id\n\t\t);\n\t\tif (!$forums) {\n\t\t\tdbQuery(\n\t\t\t\t'insert into forums '.\n\t\t\t\t'values(0,'.$PAGEDATA->id.',0,\"default\", \"1\")'\n\t\t\t);\n\t\t\t$view=1;\n\t\t\t$forum_id=dbLastInsertId();\n\t\t}\n\t\telse {\n\t\t\tif (count($forums)==1) {\n\t\t\t\t$view=1;\n\t\t\t\t$forum_id=$forums[0]['id'];\n\t\t\t}\n\t\t}\n\t}\n\tswitch($view){\n\t\tcase 1: // { specific forum\n\t\t\t$c=Forum_showForum($PAGEDATA, $forum_id);\n\t\tbreak;\n\t\t// }\n\t\tcase 2: // { specific thread\n\t\t\t$c=Forum_showThread($PAGEDATA, $thread_id);\n\t\tbreak;\n\t\t// }\n\t\tdefault: // { show all forums\n\t\t\t$c=Forum_showForums($PAGEDATA, $forums);\n\t\t\t// }\n\t}\n\tif (!isset($PAGEDATA->vars['footer'])) {\n\t\t$PAGEDATA->vars['footer']='';\n\t}\n\treturn $PAGEDATA->render()\n\t\t.$c\n\t\t.$PAGEDATA->vars['footer'];\n}", "function DisplayTopicForm()\n {\n global $DB, $userinfo;\n\n if(!$this->conf->forum_arr['forum_id'])\n {\n // user is trying to break the script\n $this->conf->RedirectPageDefault('<strong>'.$this->conf->plugin_phrases_arr['err_invalid_forum_id'] . '</strong>',true);\n return;\n }\n\n $content = GetVar('forum_post', '', 'string', true, false);\n $title = GetVar('forum_topic_title', '', 'string', true, false);\n $sticky = GetVar('stick_topic', 0, 'bool', true, false)?1:0;\n $closed = GetVar('closed', 0, 'bool', true, false)?1:0;\n $moderate = GetVar('moderate_topic', 0, 'bool', true, false)?1:0;\n $prefix_id = GetVar('prefix_id', 0, 'whole_number', true, false);\n $tags = GetVar('tags', '', 'string', true, false);\n\n //SD343: display prefixes available to user (based on sub-forum/usergroup)\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $tconf = array(\n 'elem_name' => 'prefix_id',\n 'elem_size' => 1,\n 'elem_zero' => 1,\n 'chk_ugroups' => !$this->conf->IsSiteAdmin,\n 'pluginid' => $this->conf->plugin_id,\n 'objectid' => 0,\n 'tagtype' => 2,\n 'ref_id' => 0,\n 'allowed_id' => $this->conf->forum_id,\n 'selected_id' => $prefix_id,\n );\n\n echo '\n <h2>' . $this->conf->forum_arr['title'] . '</h2>\n <form '.($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ? 'id=\"forum-admin\" ':'').\n 'action=\"' . $this->conf->current_page . '\" enctype=\"multipart/form-data\" method=\"post\">\n '.PrintSecureToken(FORUM_TOKEN).'\n <input type=\"hidden\" name=\"forum_action\" value=\"insert_topic\" />\n <input type=\"hidden\" name=\"forum_id\" value=\"'.$this->conf->forum_arr['forum_id'].'\" />\n <div class=\"form-wrap\">\n <h2 style=\"margin:4px\">'.$this->conf->plugin_phrases_arr['new_topic'].'</h2>\n <p style=\"margin:8px 4px 0px 4px\">\n <label>'.$this->conf->plugin_phrases_arr['topic_title'].'</label>\n <input type=\"text\" name=\"forum_topic_title\" value=\"'.$title.'\" /></p>\n ';\n\n DisplayBBEditor(SDUserCache::$allow_bbcode, 'forum_post', $content, FORUM_REPLY_CLASS, 80, 10);\n\n $out = '\n <fieldset>';\n\n $prefix = SD_Tags::GetPluginTagsAsSelect($tconf);\n if(strlen($prefix))\n {\n $out .= '\n <p style=\"padding-top:10px\">\n <label for=\"prefix_id\">\n '.$this->conf->plugin_phrases_arr['topic_prefix'].'\n '.$prefix.'</label></p>';\n }\n\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator)\n {\n $out .= '\n <p style=\"padding-top:10px\">\n <label for=\"ft_sticky\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'sticky.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_sticky\" name=\"stick_topic\" value=\"1\"'.($sticky?' checked=\"checked\"':'').' /> '.\n ($this->conf->plugin_phrases_arr['topic_options_stick_topic']).'</label></p>\n <p style=\"padding-top:10px\">\n <label for=\"ft_closed\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'lock.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_closed\" name=\"closed\" value=\"1\"'.($closed?' checked=\"checked\"':'').' /> '.\n ($this->conf->plugin_phrases_arr['topic_options_lock_topic']).'</label></p>\n <p style=\"padding-top:10px\">\n <label for=\"ft_moderated\"><img alt=\" \" src=\"'.SDUserCache::$img_path.'attention.png\" width=\"16\" height=\"16\" />\n <input type=\"checkbox\" id=\"ft_moderated\" name=\"moderate_topic\" value=\"1\"'.($moderate?' checked=\"checked\"':'').' /> '.\n $this->conf->plugin_phrases_arr['topic_options_moderate_topic'].'</label></p>\n ';\n }\n\n $tag_ug = sd_ConvertStrToArray($this->conf->plugin_settings_arr['tag_submit_permissions'],'|');\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($tag_ug) && @array_intersect($userinfo['usergroupids'], $tag_ug)))\n {\n $out .= '\n <p style=\"padding-top:10px\"><label for=\"ft_tags\">'.$this->conf->plugin_phrases_arr['topic_tags'].'\n <input type=\"text\" id=\"ft_tags\" name=\"tags\" maxlength=\"200\" size=\"35\" value=\"'.$tags.'\" />\n <br />'.$this->conf->plugin_phrases_arr['topic_tags_hint'].'</label></p>';\n }\n\n if(!empty($this->conf->plugin_settings_arr['attachments_upload_path']) &&\n ($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($this->conf->plugin_settings_arr['valid_attachment_types']) &&\n (!empty($userinfo['plugindownloadids']) && @in_array($this->conf->plugin_id, $userinfo['plugindownloadids'])))) )\n {\n $out .= '\n <p style=\"padding-top:10px\"><label for=\"post_attachment\">'.$this->conf->plugin_phrases_arr['upload_attachments'].'\n <input id=\"post_attachment\" name=\"attachment\" type=\"file\" size=\"35\" /> (' .\n $this->conf->plugin_settings_arr['valid_attachment_types'] . ')</label></p>';\n }\n\n $out .= '\n </fieldset>';\n\n if(strlen($out))\n {\n echo '\n <p>'.$out.'</p>';\n }\n\n if(!($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator) ||\n !empty($userinfo['require_vvc'])) //SD340: require_vvc\n {\n DisplayCaptcha(true,'amihuman');\n }\n\n echo '<br />\n <input type=\"submit\" name=\"create_topic\" value=\"'.strip_alltags($this->conf->plugin_phrases_arr['create_topic']).'\" />\n </div>\n </form>\n<script type=\"text/javascript\">\njQuery(document).ready(function() {\n (function($){ $(\"textarea#forum_post\").focus(); })(jQuery);\n});\n</script>\n';\n\n }", "public function displayForumImp()\r\n {\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n $db = \"forumdb\";\r\n\r\n $table = \"forum\";\r\n\r\n $count=1;\r\n $frname=array();\r\n $frdesc=array();\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n else\r\n {\r\n $sql = \"SELECT * FROM $table WHERE sticky='1'\";\r\n $result = $conn->query($sql);\r\n\r\n if ($result->num_rows > 0)\r\n {\r\n // get data of each row\r\n while ($row = $result->fetch_assoc())\r\n {\r\n $frname[$count] = $row['forum_name'];\r\n $frdesc[$count] = $row['forum_desc'];\r\n\r\n $count++;\r\n }\r\n\r\n $CallClassBack = new forumCall();\r\n $CallClassBack->previewForum($frname, $frdesc);\r\n\r\n }\r\n else\r\n {\r\n //echo \"0 results\";\r\n echo \"Be the first the post!\";\r\n }\r\n $conn->close();\r\n }\r\n }", "function ftopics() {\n global $sql;\n \n $qry = $sql->select(\"SELECT s1.*,s2.`kattopic`,s2.`id` as `subid` \"\n . \"FROM `{prefix_forumthreads}` as `s1`, `{prefix_forumsubkats}` as `s2`, {prefix_forumkats} as `s3` \"\n . \"WHERE s1.`kid` = s2.`id` AND s2.`sid` = s3.`id` ORDER BY s1.`lp` DESC LIMIT 100;\");\n\n $f = 0; $ftopics = '';\n if($sql->rowCount()) {\n foreach($qry as $get) {\n if($f == settings::get('m_ftopics')) { break; }\n if(fintern($get['kid'])) {\n $lp = cnt(\"{prefix_forumposts}\", \" WHERE `sid` = ?\",\"id\",array($get['id']));\n $pagenr = ceil($lp/settings::get('m_fposts'));\n $page = !$pagenr ? 1 : $pagenr;\n $info = !settings::get('allowhover') == 1 ? '' : 'onmouseover=\"DZCP.showInfo(\\''.jsconvert(stringParser::decode($get['topic'])).'\\', \\''.\n _forum_kat.';'._forum_posts.';'._forum_lpost.'\\', \\''.stringParser::decode($get['kattopic']).';'.++$lp.';'.\n date(\"d.m.Y H:i\", $get['lp'])._uhr.'\\')\" onmouseout=\"DZCP.hideInfo()\"';\n \n $ftopics .= show(\"menu/forum_topics\", array(\"id\" => $get['id'],\n \"pagenr\" => $page,\n \"p\" => $lp,\n \"titel\" => cut(stringParser::decode($get['topic']),settings::get('l_ftopics')),\n \"info\" => $info,\n \"kid\" => $get['kid']));\n $f++;\n }\n }\n }\n\n return empty($ftopics) ? '<center style=\"margin:2px 0\">'._no_entrys.'</center>' : '<table class=\"navContent\" cellspacing=\"0\">'.$ftopics.'</table>';\n}", "function local_forumnotices_printstaffnotices() {\n global $DB, $CFG, $USER;\n $config = get_config('local_forumnotices');\n $courseid = $config->courses;\n $table = '';\n // Print the header\n $header = '<table border=\"1\" border-width=\"thin\">\n <tr>\n <th align=\"center\" width=\"15%\">'.get_string('subject', 'local_forumnotices').'</th>\n <th align=\"center\" width=\"75%\">'.get_string('message', 'local_forumnotices').'</th>\n <th align=\"center\" width=\"10%\">'.get_string('user', 'local_forumnotices').'</th>\n </tr>';\n\n $sql = \"SELECT fn.id,\n fn.subject,\n fn.message,\n fn.forums,\n CONCAT(u.firstname, ' ', u.lastname) as user\n FROM {local_forumnotices} fn\n JOIN {user} u\n ON u.id = fn.userid\n WHERE fn.pastnotices = 0\n ORDER BY 2\";\n $forumlist = $DB->get_records_sql($sql);\n $sql = \"SELECT id, name\n FROM {forum}\n WHERE name IN ('Staff Notices')\n AND course = $courseid\n ORDER BY id\";\n $forums = $DB->get_records_sql_menu($sql);\n foreach ($forums as $flk => $fld) {\n $index = 0;\n foreach ($forumlist as $fl) {\n $forumarray = explode(\",\", $fl->forums);\n if (in_array($flk, $forumarray)) {\n $classarray[$fld][$index] = $fl->id;\n }\n $index++;\n }\n\n }\n\n require_once(\"$CFG->libdir/pdflib.php\");\n $documentname = 'staffnotices.pdf';\n $pdf = new TCPDF('p', 'mm', 'A4', true, 'UTF-8', false);\n $pdf->SetTitle($documentname);\n $pdf->setPrintHeader(false);\n $pdf->setPrintFooter(false);\n $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);\n $font = 'helvetica';\n $pdf->setFont($font, '', 10);\n $arraykeys = array_keys($classarray);\n $index = 0;\n $today = date('d-m-Y');\n foreach ($classarray as $cla) {\n $pdf->AddPage();\n $pdf->writeHTMLCell(0, 0, 10, 10, $arraykeys[$index], '');\n $pdf->writeHTMLCell(0, 0, 150, 10, 'Date:'.$today, '');\n $table .= $header;\n foreach ($cla as $clk => $cld) {\n $noticerecord = $DB->get_record('local_forumnotices', array('id' => $cld));\n $userdet = $DB->get_record_sql(\"SELECT CONCAT(firstname, lastname) as name FROM {user} WHERE id = $noticerecord->userid\");\n $table .= '<tr>\n <td width=\"15%\">'. $noticerecord->subject .'</td>\n <td width=\"75%\">'. $noticerecord->message .'</td>\n <td width=\"10%\">'. $userdet->name .'</td>\n </tr>\n ';\n }\n $index++;\n $table .= \"</table>\";\n $pdf->SetXY(10, 20);\n $pdf->writeHTML($table, true, false, true, false, \"\");\n }\n\n //$pdf->writeHTML($table, true, false, true, false, \"\");\n $pdf->Output($documentname, 'I');\n}", "public function get_rules()\n\t{\n\t\t$this->layout->with('title', 'Rules')\n\t\t\t\t\t ->nest('content', 'rules');\n\t}", "function list_firewall_rules(string $projectId)\n{\n // List all firewall rules defined for the project using Firewalls Client.\n $firewallClient = new FirewallsClient();\n $firewallList = $firewallClient->list($projectId);\n\n print('--- Firewall Rules ---' . PHP_EOL);\n foreach ($firewallList->iterateAllElements() as $firewall) {\n printf(' - %s : %s : %s' . PHP_EOL, $firewall->getName(), $firewall->getDescription(), $firewall->getNetwork());\n }\n}", "function access($table, $usergroup, $forums, $acl_label_data, $acl_field)\r\n{\r\n\tglobal $db;\r\n\t\r\n\t$sql = \"SELECT * FROM $table WHERE $usergroup[0] IN (\" . (is_array($usergroup[1]) ? implode(', ', $usergroup[1]) : $usergroup[1]) . \") AND forum_id IN (\" . (is_array($forums) ? implode(', ', $forums) : $forums) . \")\";\r\n\tif ( !($result = $db->sql_query($sql)) )\r\n\t{\r\n\t\tmessage(GENERAL_ERROR, 'SQL Error', '', __LINE__, __FILE__, $sql);\r\n\t}\r\n\t\r\n\t$access = $_forum_id = $_usergrps = '';\r\n\t\r\n\twhile ( $rows = $db->sql_fetchrow($result) )\r\n\t{\r\n\t\t$main\t= ( sizeof($forums) > 1 && sizeof($usergroup[1]) < 2 ) ? $rows[$usergroup[0]] : $rows['forum_id'];\r\n\t\t$parent\t= ( sizeof($forums) > 1 && sizeof($usergroup[1]) < 2 ) ? $rows['forum_id'] : $rows[$usergroup[0]];\r\n\t\t\r\n\t\t$_forum_id[] = $rows['forum_id'];\r\n\t\t$_usergrps[] = $rows[$usergroup[0]];\r\n\t\r\n\t\tif ( $rows['label_id'] != 0 )\r\n\t\t{\r\n\t\t\tif ( isset($acl_label_data[$rows['label_id']]) )\r\n\t\t\t{\r\n\t\t\t\t$access[$main][$parent] = $acl_label_data[$rows['label_id']];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $rows['auth_option_id'] != 0 && isset($acl_field[$rows['auth_option_id']]) )\r\n\t\t{\r\n\t\t\t$access[$main][$parent][$acl_field[$rows['auth_option_id']]] = $rows['auth_value'];\r\n\t\t}\r\n\t}\r\n\t\r\n#\tdebug($usergroup, '$usergroup');\r\n#\tdebug($forums, '$forums');\r\n\t\r\n#\tdebug(count(array_unique($_forum_id)), 'access _forum_id 1');\r\n#\tdebug(count(array_unique($_usergrps)), 'access _usergrps 1');\r\n\t\r\n\tif ( $_forum_id || $_usergrps )\r\n\t{\r\n\t\t$cnt_forum_id = count(array_unique($_forum_id));\r\n\t\t$cnt_usergrps = count(array_unique($_usergrps));\r\n\t\t\r\n\t\t$main\t= ( sizeof($forums) > 1 && sizeof($usergroup[1]) < 2 ) ? $usergroup[1] : $forums;\r\n\t\t$parent\t= ( sizeof($forums) > 1 && sizeof($usergroup[1]) < 2 ) ? $forums : $usergroup[1];\r\n\t\t\r\n\t#\tdebug($access, 'access function 1');\r\n\t#\tdebug($main, 'access main 1');\r\n\t#\tdebug($parent, 'access parent 1');\r\n\t\t\r\n\t\tif ( $access )\r\n\t\t{\r\n\t\t\tif ( is_array($main) )\r\n\t\t\t{\r\n\t\t\t\tforeach ( $main as $m_id )\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ( $parent as $p_id )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( !isset($access[$m_id][$p_id]) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ( $acl_field as $f_name )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$access[$m_id][$p_id][$f_name] = 0;\r\n\t\t\t\t\t\t\t#\t$access[$forum_id][$usergroup_id][$f_name] = 0;\r\n\t\t\t\t\t\t\t#\tdebug($f_name, 'test 1234');\r\n\t\t\t\t\t\t\t#\tdebug($access[$m_id][$p_id][$f_name], 'test 1234');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t/*\r\n\t\r\n\tif ( is_array($forums) )\r\n\t{\r\n\t\tforeach ( $forums as $forum_id )\r\n\t\t{\r\n\t\t\tif ( !isset($access[$forum_id]) )\r\n\t\t\t{\r\n\t\t\t\tforeach ( $usergroup[1] as $usergroup_id )\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ( $acl_field as $f_name )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$access[$forum_id][$usergroup_id][$f_name] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t*/\r\n\t\r\n\t\r\n\t\r\n#\tdebug($access, 'access function 2');\r\n\t\r\n\treturn $access;\r\n}", "function group_forum_crumbs() {\n\t\t\n\t\t// Setup the empty trail\n\t\t$forum_trail = array();\n\t\t\n\t\t// Group forum root\n\t\tif ( NULL == bp_action_variable() ) :\n\t\t\t$forum_trail[] = 'Forum';\n\t\t\n\t\t// Group forum subcomponent\n\t\telse :\n\t\t\t$forum_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/\" title=\"Group Forum\">Forum</a>';\n\t\t\t\n\t\t// Single Topic\n\t\tif ( bp_is_action_variable( 'topic' , 0 ) ) :\n\t\t\t$topic_info = apoc_get_group_topic_info();\n\t\t\t\t\t\n\t\t\t// Edit Topic\n\t\t\tif ( bp_is_action_variable( 'edit' , 2 ) ) :\n\t\t\t\t$forum_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/topic/' . $topic_info->url . '\" title=\"' . $topic_info->title . '\">' . $topic_info->title . '</a>';\n\t\t\t\t$forum_trail[] = 'Edit Topic';\n\t\t\t\t\n\t\t\telse :\n\t\t\t\t$forum_trail[] = $topic_info->title;\n\t\t\tendif; \n\t\t\t\n\t\t\t// Edit Reply\n\t\t\telseif ( bp_is_action_variable( 'reply' , 0 ) ) :\n\t\t\t\t$topic_info = apoc_get_group_reply_info();\n\t\t\t\t\n\t\t\t\tif ( bp_is_action_variable( 'edit' , 2 ) ) :\n\t\t\t\t\t$forum_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/topic/' . $topic_info->url . '\" title=\"' . $topic_info->title . '\">' . $topic_info->title . '</a>';\n\t\t\t\t\t$forum_trail[] = 'Edit Reply';\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\n\t\tendif;\n\t\t\n\t\t// Return the group forum crumbs\n\t\treturn $forum_trail;\n\t}", "function target_add_forum($forum)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $forum['name']);\n\n\tif (!isset($GLOBALS['cat_map'][ $forum['cat_id'] ])) {\n\t\tpf('WARNING: Create category for uncategorized forum.');\n\t\t$cat_id = q_singleval('SELECT MAX(id)+1 from '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat');\n\t\tif (!$cat_id) $cat_id = 1;\n\t\ttarget_add_cat(array('id'=>$cat_id, 'name'=>'Uncategorized Forums', 'description'=>'', 'view_order'=>$cat_id));\n\t\t$GLOBALS['cat_map'][ $forum['cat_id'] ] = $cat_id;\n\t}\n\n\t$forum_opt = 16;\t// Set tag_style to BBCode.\n\tif (!empty($forum['post_passwd'])) {\n\t\t$forum_opt |= 4;\t// Enable passwd_posting.\n\t}\n\n\t$frm = new fud_forum();\n\t$frm->cat_id = $GLOBALS['cat_map'][ $forum['cat_id'] ];\n\t$frm->name = $forum['name'];\n\t$frm->descr = $forum['description'];\n\t$frm->view_order = $forum['view_order'];\n\t$frm->post_passwd = $forum['post_passwd'];\n\t$frm->url_redirect = $forum['url_redirect'];\n\t$frm->forum_opt = $forum_opt;\n\t$frm->max_attach_size = 0;\t// No limit.\n\t$frm->max_file_attachments = 5;\t// Sensible default.\n\t$id = $frm->add('LAST');\n\t$GLOBALS['forum_map'][ (int)$forum['id'] ] = $id;\n/*\nfud_use('forum_adm.inc', true);\nfud_use('groups_adm.inc', true);\nfud_use('groups.inc');\n$nf = new fud_forum;\n// $cat_id, $name, $descr, $parent, $url_redirect, $post_passwd, $forum_icon,\n// $forum_opt, $date_created, $message_threshold, $max_attach_size,\n// $max_file_attachments\n$nf->cat_id = $GLOBALS['cat_map'][$c->pid];\n$nf->name = $c->name;\n$nf->description = $c->description;\n$nf->view_order = $c->disporder;\n$nf->post_passwd = $c->password;\n// $nf->cat_opt = 1|2;\n$GLOBALS['forum_map'][$c->fid] = $nf->add('LAST');\n*/\n}", "public function all_aboutUs_rules_info(){\r\n $query = \"SELECT * FROM tbl_aboutus_rules WHERE publication_status = 1\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }" ]
[ "0.7692964", "0.67140275", "0.6067672", "0.59104633", "0.5745487", "0.5745173", "0.5573034", "0.5502718", "0.5443599", "0.53879005", "0.53557545", "0.53541476", "0.53082126", "0.5292551", "0.5232031", "0.5207413", "0.51806974", "0.51325005", "0.51291597", "0.5127964", "0.5105022", "0.5059677", "0.5050463", "0.5026001", "0.50216204", "0.5007198", "0.50017464", "0.49871492", "0.4967307", "0.4963495" ]
0.8324201
0
/ hdl_ban_line() : Get / set ban info Returns array on get and string on "set" / Get / set member's ban info
function hdl_ban_line($bline) { if ( is_array( $bline ) ) { // Set ( 'timespan' 'unit' ) $factor = $bline['unit'] == 'd' ? 86400 : 3600; $date_end = time() + ( $bline['timespan'] * $factor ); return time() . ':' . $date_end . ':' . $bline['timespan'] . ':' . $bline['unit']; } else { $arr = array(); list( $arr['date_start'], $arr['date_end'], $arr['timespan'], $arr['unit'] ) = explode( ":", $bline ); return $arr; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_ban_details() {\n\tglobal $db;\n\tglobal $attempted_user_id;\n\n\t$prepared = $db->prepare(\"\n\t\t\tSELECT date_time, until_date_time, reason\n\t\t\tFROM user_bans\n\t\t\tWHERE user_id = ? AND\n\t\t\t\tdate_time >= ALL (\n\t\t\t\t\t\tSELECT date_time\n\t\t\t\t\t\tFROM user_bans\n\t\t\t\t\t\tWHERE user_id = ?\n\t\t\t\t\t\t)\n\t\t\");\n\n\t$prepared->bind_param('ii', $attempted_user_id, $attempted_user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\t$prepared->bind_result(\n\t\t$date_time,\n\t\t$until_date_time,\n\t\t$reason\n\t);\n\n\t$prepared->fetch();\n\n\t$prepared->free_result();\n\n\treturn (object) array(\n\t\t\t'date_time'\t\t\t=> $date_time,\n\t\t\t'until_date_time'\t=> $until_date_time,\n\t\t\t'reason'\t\t\t=> $reason\n\t\t);\n}", "private function _getBans()\r\n\t{\r\n\t\t$ban_file_name = md5($this->CI->config->config['encryption_key'].$this->ban_file);\r\n\t\t\r\n\t\t// Check if the cache file previously exists\r\n\t\tif(file_exists(CACHEPATH . $ban_file_name))\r\n\t\t{\r\n\t\t\t// Dont wast time with the DB, load the cached version\r\n\t\t\t$this->ban_list = unserialize(base64_decode($this->CI->load->file(CACHEPATH . $ban_file_name, true)));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get group object from DB\r\n\t\t\t$bans = $this->db->get_where('bans', array('type' => 'user'));\r\n\t\t\tforeach($bans->result() as $ban)\r\n\t\t\t{\r\n\t\t\t\t$this->ban_list[] = array('ip' => $ban->ip, 'time' => $ban->time, 'type' => 'user');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Save the group object to cache for increased performance\r\n\t\t\tfile_put_contents(CACHEPATH . $ban_file_name, base64_encode(serialize($this->ban_list)));\r\n\t\t}\r\n\t}", "function obtain_user_ban_info($user_id, $lastvisit, $user_posts, $user_type, $poster_avatar)\r\n{\r\n\tglobal $db, $user, $config, $template, $phpbb_root_path;\r\n\t$user->add_lang('mods/inactive_users');\r\n\t$current_time = time();\r\n\t$inactive_data = array();\r\n\t//We obtain the excluded user_id list to exempt them from this mod\r\n\t$excluded_user_ids = array(); \r\n\t$excluded_user_ids = ($config['inactive_users_exc_ids']) ? explode(\",\", $config['inactive_users_exc_ids']) : array();\r\n\t$avatar_img = $phpbb_root_path . 'images/avatars/';\r\n\t$avatar_width = $avatar_height = 100;\r\n\t$banned_users[] = '';\r\n\tif (in_array($user_id, $excluded_user_ids))\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\telse if ($config['inactive_users_excl_prof_ban'])\r\n\t{\r\n\t\t//Run the sql to see if the is banned\r\n\t\t$sql = 'SELECT ban_userid, ban_end\r\n\t\t\tFROM ' . BANLIST_TABLE . '\r\n\t\t\tWHERE (ban_end > ' . time() . ' OR ban_end = 0)\r\n\t\t\t\tAND ban_userid = ' . $user_id . '';\r\n\t\t\t\r\n\t\t$result = $db->sql_query($sql);\r\n\t\r\n\t\t$banned_users[] = '';\r\n\t\tif ($row = $db->sql_fetchrow($result))\r\n\t\t{\r\n\t\t\t$banned_users[$row['ban_userid']] = $row['ban_end'];\r\n\t\t}\r\n\t\t$db->sql_freeresult($result);\r\n\t}\r\n\t\r\n\tif ($config['inactive_users_no_avatar'] && !$poster_avatar)\r\n\t{\r\n\t\t//We assing two default avatars first: 25 posts is the thereshold\r\n\t\tif ($user_posts < 25)\r\n\t\t{\r\n\t\t\t$avatar_img = $phpbb_root_path . 'images/avatars/not_selected_new.gif';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$avatar_img = $phpbb_root_path . 'images/avatars/not_selected.gif';\r\n\t\t}\r\n\t\t$inactive_data = array(\r\n\t\t\t\t'AVATAR_IMG'\t\t=> '<img src=\"' . $avatar_img . '\" width=\"' . $avatar_width . '\" height=\"' . $avatar_height . '\" alt=\"' . $user->lang['USER_AVATAR'] . '\" />',\r\n\t\t);\t\t\r\n\t}\t\r\n\r\n\tif (isset($banned_users[$user_id]) && $config['inactive_users_excl_prof_ban'])\r\n\t{\r\n\t\tif ($banned_users[$user_id] == 0)\r\n\t\t{\r\n\t\t\t$avatar_img = $phpbb_root_path . 'images/avatars/banned.gif';\r\n\t\t\t$inactive_data = array(\r\n\t\t\t\t'RANK_TITLE'\t\t=> $user->lang['USER_BANNED'],\r\n\t\t\t\t'RANK_IMG'\t\t\t=> '',\r\n\t\t\t\t'RANK_IMG_SRC'\t\t=> '',\r\n\t\t\t\t'AVATAR_IMG'\t\t=> ($config['inactive_users_avatar_prof_enable']) ? '<img src=\"' . $avatar_img . '\" width=\"' . $avatar_width . '\" height=\"' . $avatar_height . '\" alt=\"' . $user->lang['USER_AVATAR'] . '\" />' : $poster_avatar,\t\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t\telse if ($banned_users[$user_id] > time())\r\n\t\t{\r\n\t\t\t$avatar_img = $phpbb_root_path . 'images/avatars/suspended.gif';\r\n\t\t\t$inactive_data = array(\r\n\t\t\t\t'RANK_TITLE'\t\t=> sprintf($user->lang['USER_SUSPENDED'], $user->format_date($banned_users[$user_id], $format = 'd-m, H:i', true)),// $rank_title,\r\n\t\t\t\t'RANK_IMG'\t\t\t=>'',\r\n\t\t\t\t'RANK_IMG_SRC'\t\t=> '',\r\n\t\t\t\t'AVATAR_IMG'\t\t=> ($config['inactive_users_avatar_prof_enable']) ? '<img src=\"' . $avatar_img . '\" width=\"' . $avatar_width . '\" height=\"' . $avatar_height . '\" alt=\"' . $user->lang['USER_AVATAR'] . '\" />' : $poster_avatar,\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\telse if ($user_type == USER_INACTIVE)\r\n\t{\r\n\t\t$avatar_img = $phpbb_root_path . 'images/avatars/deactivated.gif';\r\n\t\t$inactive_data = array(\r\n\t\t\t'RANK_TITLE'\t\t=> $user->lang['USER_DEACTIVE'],\r\n\t\t\t'RANK_IMG'\t\t\t=> '',\r\n\t\t\t'RANK_IMG_SRC'\t\t=> '',\r\n\t\t\t'AVATAR_IMG'\t\t=> ($config['inactive_users_avatar_prof_enable']) ? '<img src=\"' . $avatar_img . '\" width=\"' . $avatar_width . '\" height=\"' . $avatar_height . '\" alt=\"' . $user->lang['USER_AVATAR'] . '\" />' : $poster_avatar,\r\n\t\t\t'SIGNATURE'\t\t\t=> '',\r\n\t\t);\t\r\n\t\t\t\r\n\t}\r\n\telse if ($config['inactive_users_excl_prof_time'] && $lastvisit != 0 && ($current_time - $lastvisit) > ($config['inactive_users_period'] * 2592000))\r\n\t{\r\n\t\t$avatar_img = $phpbb_root_path . 'images/avatars/inactive.gif';\r\n\t\t$inactive_data = array(\r\n\t\t\t'RANK_TITLE'\t=> sprintf($user->lang['USER_INACTIVE'], round(($current_time - $lastvisit)/2592000)),\r\n\t\t\t'RANK_IMG'\t\t\t=>'',\r\n\t\t\t'RANK_IMG_SRC'\t\t=> '',\r\n\t\t\t'AVATAR_IMG'\t=> (!$config['inactive_users_avatar_prof_enable']) ? $poster_avatar : '<img src=\"' . $avatar_img . '\" width=\"' . $avatar_width . '\" height=\"' . $avatar_height . '\" alt=\"' . $user->lang['USER_AVATAR'] . '\" />',\r\n\t\t);\r\n\t}\r\n\r\n\treturn $inactive_data;\r\n\r\n}", "function Blocks_userapi_get($args)\n{\n // Argument check\n if (!isset($args['bid']) || !is_numeric($args['bid'])) {\n return LogUtil::registerArgsError();\n }\n\n // Return the item array\n return pnBlockGetInfo($args['bid']);\n}", "public function getIban()\n {\n return $this->iban;\n }", "function get_ban_list($game_id) {\n\t\t//return $this->db->select('player.player_id', 'player.username', 'banned.ban_id_player', 'banned.ban_game', 'banned.ban_reason', 'banned.ban_date')->from('player', 'banned')->where(['player.player_id' => 'banned.ban_id_player'])->get();\n\t\treturn $this->db->select('p.player_id, p.username, b.*')->from('player p')->join('banned b', 'p.player_id = b.ban_id_player', 'LEFT')->where('b.ban_game = '.$game_id)->order_by('ban_date', 'DESC')->get();\n\t}", "public static function getInfo(){ //функция для получения массива общей информации из бд\n \n $db = Db::getConnection(); //инициализируем подключение к бд\n \n $info = array(); //инициализируем переменную \n \n $result = $db->query('SELECT * FROM info'); // получаем из базы список\n \n $result->setFetchMode(PDO::FETCH_ASSOC);\n \n $row = $result->fetch();\n foreach ($row as $key => $value) { //перебираем массив полученный из бд и формируем массив для вывода на страницу сайта\n $info[$key] = $value;\n }\n \n return $info; //возвращаем массив\n }", "public function isBanned(){\n return $this->banned;\n }", "public function actionBanned()\n\t{\n\t\t$model = CoreSettings::findOne(1);\n if ($model === null) {\n $model = new CoreSettings();\n }\n\t\t$model->scenario = CoreSettings::SCENARIO_BANNED;\n\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n // $postData = Yii::$app->request->post();\n // $model->load($postData);\n // $model->order = $postData['order'] ? $postData['order'] : 0;\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Spam & banning setting success updated.'));\n return $this->redirect(['banned']);\n\n } else {\n if (Yii::$app->request->isAjax) {\n return \\yii\\helpers\\Json::encode(\\app\\components\\widgets\\ActiveForm::validate($model));\n }\n }\n }\n\t\t\n\t\t$this->view->title = Yii::t('app', 'Spam & Banning Tools');\n\t\t$this->view->description = Yii::t('app', '{app-name} platform are often the target of aggressive spam tactics. This most often comes in the form of fake user accounts and spam in comments. On this page, you can manage various anti-spam and censorship features. Note: To turn on the signup image verification feature (a popular anti-spam tool), see the {setting} page.', ['app-name' => Yii::$app->name, 'setting' => Html::a(Yii::t('app', 'Signup Setting'), Url::to(['signup']))]);\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_banned', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function bmwClubInfo() {\n return [\n 'bmw_club_info' => [\n '#type' => 'frontendapi_address_element',\n '#country' => $this->t('Belarus'),\n '#link_text' => 'BMW club Belarus',\n '#link_url' => 'http://bmwclub.by',\n ],\n ];\n }", "public function getBannedAccountsList() {\n\t\t$result = $this->db->queryFetch(\"SELECT \"._CLMN_MEMBID_.\", \"._CLMN_USERNM_.\", \"._CLMN_EMAIL_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_BLOCCODE_.\" = 1 ORDER BY \"._CLMN_MEMBID_.\" ASC\");\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}", "public function info_blast_credit_balance() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/info/blast_credit_balance.json\");\n }", "public function getBanco() {\n return $this->banco;\n }", "public function getBoletoInformation()\n {\n return array(\n '341' => 'Itau',\n '033' => 'Santander',\n '237' => 'Bradesco',\n '001' => 'Banco do Brasil',\n '399' => 'HSBC ',\n '104' => 'Caixa',\n '745' => 'CitiBank'\n );\n }", "function suipcontrol_getmoduleinfo(){\n\t$block3IP = substr($_SERVER['REMOTE_ADDR'],0,strrpos($_SERVER['REMOTE_ADDR'],\".\"));\n\t$info = array(\n\t\t\"name\"=>\"Superuser IP Access Control\",\n\t\t\"version\"=>\"1.0\",\n\t\t\"author\"=>\"Eric Stevens\",\n\t\t\"category\"=>\"Administrative\",\n\t\t\"download\"=>\"core_module\",\n\t\t\"prefs\"=>array(\n\t\t\t\"SuperUser IP Control User Preferences,title\",\n\t\t\tarray(\"IP from which you might sign on. Enter partial IP's for a subnet and separate ranges with commas; semicolons; or spaces. `nFor example; if you wanted to allow aaa.bbb.ccc.1 through aaa.bbb.ccc.255; enter aaa.bbb.ccc. and the entire subnet will match.`n`n You're on %s now; recommend using %s if this is you.`n `bCaution`b: entering bad data here might block you out of most superuser activities!,note\", $_SERVER['REMOTE_ADDR'], $block3IP), //default to XXX.XXX.XXX. for the current user's IP address.\n\t\t\t\"ips\"=>\"IPs|$block3IP\",\n\t\t\t\"tempauthorize\"=>\"Temporary authorization code,viewonly|\",\n\t\t\t\"tempip\"=>\"Temporarily authorized IP|\",\n\t\t\t\"authemail\"=>\"Temp authorization email address,|\",\n\t\t),\n\t);\n\treturn $info;\n}", "function get_banned_user_list()\r\n{\r\n\tglobal $db, $user, $phpbb_root_path, $phpEx;\r\n\t$user->add_lang('mods/inactive_users');\r\n\r\n\t$sql = 'SELECT ban_userid, ban_end\r\n\t\tFROM ' . BANLIST_TABLE . '\r\n\t\tWHERE (ban_end > ' . time() . ' OR ban_end = 0)\r\n\t\t\tAND ban_exclude <> 1'; \r\n\t$result = $db->sql_query($sql, 3600);\r\n\t//To disable 3600 seconds cache, comment the line above and uncomment the line below\r\n\t//$result = $db->sql_query($sql);\r\n\t\r\n\t$banned_users[] = '';\r\n\twhile ($row = $db->sql_fetchrow($result))\r\n\t{\r\n\t\t$banned_users[$row['ban_userid']] = $row['ban_end'];\r\n\t}\t\r\n\t$db->sql_freeresult($result);\r\n\t\r\n\treturn $banned_users;\r\n\t\r\n}", "public function ban();", "private function getLedgerInfoBankStatement($set) {\n $this->db->getLedgerInfoBankStatement($set, $this->allledgers, $this->ledgername, $this->ledgersDetail, $this->balancesheet, $this->bankstatement);\n $len = count($this->ledgername);\n for ($i = 0; $i < $len; $i++) {\n $a = array();\n array_push($this->sortedLedger, $a);\n }\n }", "public function get($args)\n {\n // Argument check\n if (!isset($args['bid']) || !is_numeric($args['bid'])) {\n return LogUtil::registerArgsError();\n }\n\n // Return the item array\n return BlockUtil::getBlockInfo($args['bid']);\n }", "private function _putBans()\r\n\t{\r\n\t\t$ban_file_name = md5($this->CI->config->config['encryption_key'].$this->ban_file);\r\n\t\t\r\n\t\t// Get group object from DB\r\n\t\t$bans = $this->db->get_where('bans', array('type' => 'user'));\r\n\t\tforeach($bans->result() as $ban)\r\n\t\t{\r\n\t\t\t$this->ban_list[$ban->ip] = array('ip' => $ban->ip, 'time' => $ban->time, 'type' => 'user');\r\n\t\t}\r\n\t\t\r\n\t\t// Save the group object to cache for increased performance\r\n\t\tfile_put_contents(CACHEPATH . $ban_file_name, base64_encode(serialize($this->ban_list)));\r\n\t}", "function get_ban_reason()\n\t{\n\t\treturn $this->_ban_reason;\n\t}", "final public function blacklistInfo():array{\n $bl = $this->db->select('bl_id,bl_user_black,u_nombres,u_apellidos,YEAR(CURDATE())-YEAR(u_fecnac) as edad,iu_img','jc_blacklist LEFT JOIN jc_usuarios ON bl_user_black=u_id LEFT JOIN jc_images_users ON iu_id_user=bl_user_black AND iu_tipo=2','bl_user_main='.$this->user.'');\n try {\n \n if (!$bl) {\n throw new Exception('You do not have people on your blacklist yet');\n } \n\n } catch (Exception $e) {\n return ['success'=>0,'message'=>$e->getMessage()];\n }\n\n return ['success'=>1,'message'=>'You have people on your blacklist','data'=>$bl];\n }", "function infoarray()\n\t\t{\n\t\t$a = array();\n\t\tforeach(explode(\"\\n\", $this->me['info']) as $line)\n\t\t\t{\n\t\t\tpreg_match('/(^[^=]*) = (.*$)/', trim($line), $matches);\n\t\t\tif(count($matches) > 2)\n\t\t\t\t{\n\t\t\t\t$a[$matches[1]] = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\t\treturn $a;\n\t\t}", "function abandoncastle_getmoduleinfo(){\n\t$info = array(\n\t\t\"name\"=>\"Abandoned Castle Maze\",\n\t\t\"version\"=>\"2.13\",\n\t\t\"author\"=>\"`#Lonny Luberts modified by `2Oliver Brendel\",\n\t\t\"category\"=>\"PQcomp\",\n\t\t\"download\"=>\"http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=28\",\n\t\t\"vertxtloc\"=>\"http://www.pqcomp.com/\",\n\t\t\"prefs\"=>array(\n\t\t\t\"Abandoned Module User Preferences,title\",\n\t\t\t\"wasfound\"=>\"User found the Abandoned Castle?,bool|0\",\n\t\t\t\"maze\"=>\"Maze|\",\n\t\t\t\"mazeturn\"=>\"Maze Return,int|0\",\n\t\t\t\"pqtemp\"=>\"Temporary Information,viewonly\",\n\t\t\t\"enteredtoday\"=>\"User has entered the castle today,bool|0\",\n\t\t\t\"super\"=>\"Superuser Features,bool|0\",\n\t\t),\n\t\t\"settings\"=>array(\n\t\t\t\"Abandoned Castle Settings,title\",\n\t\t\t\"castleloc\"=>\"Where does the Abandonded Castle appear,location|\".getsetting(\"villagename\", LOCATION_FIELDS),\n\t\t\t\"dkenter\"=>\"Minimum Number of Dragon Kills to Enter Castle,range,0,100,1|9\",\n\t\t\t\"forestvil\"=>\"Yes = Forest Event No = Village Nav,bool|0\",\n\t\t)\n\t);\n\treturn $info;\n}", "function buddyListArray($user=NULL, $request=0){\n if(empty($user)){\n $user= getUser();\n }else{\n //check privacy rights!\n $privacy = new userPrivacy($user);\n if(!$privacy->proofRight('buddylist')){\n return array();\n }\n }\n $db = new db();\n $buddyListQuery = $db->shiftResult($db->select('buddylist', array('owner', $user, '&&', 'request', $request)), 'owner');\n $buddies = array();\n foreach($buddyListQuery AS $buddylistData){\n $buddies[] = (int)$buddylistData['buddy'];\n }\n\n return $buddies;\n\n }", "function tammuz_block_info() {\r\n\t$blocks = array();\r\n\t\r\n\r\n\t$blocks['add_journey'] = array(\r\n\t\t// The name that will appear in the block list.\r\n\t\t'info' => t('Add a journey to the customer'),\r\n\t\t// Default setting.\r\n\t\t'cache' => DRUPAL_CACHE_PER_ROLE,\r\n\t);\r\n\treturn $blocks;\r\n}", "public function isBanned()\n {\n return $this->is_banned;\n }", "public function procBanUser() {//IF time permits, re-implement using new User classes\r\n global $session;\r\n\n /* Username error checking */\n $field = \"banuser\"; //Use the field for username\r\n $subuser = $this->_checkUsername($field);\r\n\n if($subuser == $session->user->username) { /* Make sure no one tries and ban themselves */\n $session->form->setError($field, \"* You can't ban yourself!<br />\");\n }\n\r\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Ban user from member system */\r\n \t$uid = $session->database->getUID($subuser);\n $session->database->removeUser($uid, DB_TBL_ADMINS);\r\n $session->database->removeUser($uid, DB_TBL_TELLERS);\r\n $session->database->removeUser($uid, DB_TBL_CUSTOMERS);\r\n\r\n $q = \"INSERT INTO \".DB_TBL_BANNED_USERS.\" VALUES ('$subuser', $session->time)\";\r\n $session->database->query($q);\n }\n header(\"Location: \".$session->referrer);\r\n }", "public function getBanco($verificacao = false);", "public function getBlockInfo();" ]
[ "0.58328915", "0.5735105", "0.5495862", "0.53169316", "0.52010196", "0.51457804", "0.5079786", "0.50600076", "0.50500613", "0.50407135", "0.50392884", "0.5015863", "0.50074345", "0.5000198", "0.4990977", "0.49891025", "0.4988547", "0.49453074", "0.49094975", "0.4886552", "0.48815206", "0.48762524", "0.48649696", "0.48510444", "0.4845725", "0.4820027", "0.48144424", "0.48106825", "0.4806115", "0.47958013" ]
0.61241597
0
/ do_number_format() : Nice little sub to handle common stuff / Wrapper for number_format
function do_number_format($number) { if ( $this->vars['number_format'] != 'none' ) { return number_format($number , 0, '', $this->num_format); } else { return $number; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatNumber($number);", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "public function numberFormatDataProvider() {}", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function number_format_i18n($number, $decimals = 0)\n {\n }", "function format_number(int|float|string $input, int|bool|null $decimals = 0, string $decimal_separator = null, string $thousand_separator = null): string|null\n{\n if (is_string($input)) {\n if (!is_numeric($input)) {\n trigger_error(sprintf('%s(): Invalid non-numeric input', __function__));\n return null;\n }\n\n $input += 0;\n }\n\n $export = var_export($input, true);\n\n // Auto-detect decimals.\n if (is_true($decimals)) {\n $decimals = strlen(stracut($export, '.'));\n }\n\n // Prevent corruptions.\n if ($decimals > PRECISION) {\n $decimals = PRECISION;\n }\n\n $ret = number_format($input, (int) $decimals, $decimal_separator, $thousand_separator);\n\n // Append \".0\" for eg: 1.0 & upper NAN/INF.\n if (!$decimals && !is_int($input) && strlen($export) == 1) {\n $ret .= '.0';\n } elseif ($ret == 'inf' || $ret == 'nan') {\n $ret = strtoupper($ret);\n }\n\n return $ret;\n}", "function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}", "function money_format($format, $number) {\r\n\t\tif (function_exists('money_format')) {\r\n\t\t\treturn money_format($format, $number);\r\n\t\t}\r\n\t\tif (setlocale(LC_MONETARY, 0) == 'C') {\r\n\t\t\tsetlocale(LC_MONETARY, '');\r\n\t\t\t//return number_format($number, 2);\r\n\t\t}\r\n\r\n\t\t$locale = localeconv();\r\n\r\n\t\t$regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'\r\n\t\t\t\t. '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\r\n\r\n\t\tpreg_match_all($regex, $format, $matches, PREG_SET_ORDER);\r\n\r\n\t\tforeach ($matches as $fmatch) {\r\n\t\t\t$value = floatval($number);\r\n\t\t\t$flags = array(\r\n\t\t\t\t\t'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ? $match[1]\r\n\t\t\t\t\t\t\t: ' ',\r\n\t\t\t\t\t'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ? $match[0]\r\n\t\t\t\t\t\t\t: '+',\r\n\t\t\t\t\t'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'isleft' => preg_match('/\\-/', $fmatch[1]) > 0);\r\n\t\t\t$width = trim($fmatch[2]) ? (int) $fmatch[2] : 0;\r\n\t\t\t$left = trim($fmatch[3]) ? (int) $fmatch[3] : 0;\r\n\t\t\t$right = trim($fmatch[4]) ? (int) $fmatch[4]\r\n\t\t\t\t\t: $locale['int_frac_digits'];\r\n\t\t\t$conversion = $fmatch[5];\r\n\r\n\t\t\t$positive = true;\r\n\t\t\tif ($value < 0) {\r\n\t\t\t\t$positive = false;\r\n\t\t\t\t$value *= -1;\r\n\t\t\t}\r\n\t\t\t$letter = $positive ? 'p' : 'n';\r\n\r\n\t\t\t$prefix = $suffix = $cprefix = $csuffix = $signal = '';\r\n\r\n\t\t\t$signal = $positive ? $locale['positive_sign']\r\n\t\t\t\t\t: $locale['negative_sign'];\r\n\t\t\tswitch (true) {\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 1\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$prefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 2\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$suffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 3\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$cprefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 4\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$csuffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $flags['usesignal'] == '(':\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 0:\r\n\t\t\t\t$prefix = '(';\r\n\t\t\t\t$suffix = ')';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (!$flags['nosimbol']) {\r\n\t\t\t\t$currency = $cprefix\r\n\t\t\t\t\t\t. ($conversion == 'i' ? $locale['int_curr_symbol']\r\n\t\t\t\t\t\t\t\t: $locale['currency_symbol']) . $csuffix;\r\n\t\t\t} else {\r\n\t\t\t\t$currency = '';\r\n\t\t\t}\r\n\t\t\t$space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\r\n\r\n\t\t\t$value = number_format($value, $right,\r\n\t\t\t\t\t$locale['mon_decimal_point'],\r\n\t\t\t\t\t$flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\r\n\t\t\t$value = @explode($locale['mon_decimal_point'], $value);\r\n\r\n\t\t\t$n = strlen($prefix) + strlen($currency) + strlen($value[0]);\r\n\t\t\tif ($left > 0 && $left > $n) {\r\n\t\t\t\t$value[0] = str_repeat($flags['fillchar'], $left - $n)\r\n\t\t\t\t\t\t. $value[0];\r\n\t\t\t}\r\n\t\t\t$value = implode($locale['mon_decimal_point'], $value);\r\n\t\t\tif ($locale[\"{$letter}_cs_precedes\"]) {\r\n\t\t\t\t$value = $prefix . $currency . $space . $value . $suffix;\r\n\t\t\t} else {\r\n\t\t\t\t$value = $prefix . $value . $space . $currency . $suffix;\r\n\t\t\t}\r\n\t\t\tif ($width > 0) {\r\n\t\t\t\t$value = str_pad($value, $width, $flags['fillchar'],\r\n\t\t\t\t\t\t$flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);\r\n\t\t\t}\r\n\r\n\t\t\t$format = str_replace($fmatch[0], $value, $format);\r\n\t\t}\r\n\t\treturn $format;\r\n\t}", "function format_number($value=0)\n{\n\tif ((is_numeric( $value ) AND floor( $value ) != $value)) {\n\t\treturn number_format($value, 2, '.', ',');\n\t} else {\n\t\treturn number_format($value);\n\t}\n}", "function international_num_format($input, $decimals = 2)\n\t{\n\t\tglobal $config;\n\n\t\tswitch ($config['number_format_style']) {\n\t\t\tcase '2': // spain, germany\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3': // estonia\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '4': // france, norway\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '5': // switzerland\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, \",\", \"'\");\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, \",\", \"'\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '6': // kazahistan\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ',');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ',');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\treturn $output;\n\t}", "function format( $number , $format=null )\n {\n if( $format == null ){\n $format = $this->getFormat();\n }\n\n // handle custom formats too\n if ($format >= I18N_CUSTOM_FORMATS_OFFSET) {\n if (isset($this->_customFormats[$format])) {\n $numberFormat = $this->_customFormats[$format];\n }\n } else {\n $numberFormat = $this->_localeObj->numberFormat[$format]; \n }\n return call_user_func_array( 'number_format' , array_merge( array($number),$numberFormat) );\n }", "function money_format($format, $number)\n{\n $regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'.\n '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\n if (setlocale(LC_MONETARY, 0) == 'C') {\n setlocale(LC_MONETARY, '');\n }\n $locale = localeconv();\n preg_match_all($regex, $format, $matches, PREG_SET_ORDER);\n foreach ($matches as $fmatch) {\n $value = floatval($number);\n $flags = array(\n 'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ?\n $match[1] : ' ',\n 'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\n 'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ?\n $match[0] : '+',\n 'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\n 'isleft' => preg_match('/\\-/', $fmatch[1]) > 0\n );\n $width = trim($fmatch[2]) ? (int)$fmatch[2] : 0;\n $left = trim($fmatch[3]) ? (int)$fmatch[3] : 0;\n $right = trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits'];\n $conversion = $fmatch[5];\n\n $positive = true;\n if ($value < 0) {\n $positive = false;\n $value *= -1;\n }\n $letter = $positive ? 'p' : 'n';\n\n $prefix = $suffix = $cprefix = $csuffix = $signal = '';\n\n $signal = $positive ? $locale['positive_sign'] : $locale['negative_sign'];\n switch (true) {\n case $locale[\"{$letter}_sign_posn\"] == 1 && $flags['usesignal'] == '+':\n $prefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 2 && $flags['usesignal'] == '+':\n $suffix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 3 && $flags['usesignal'] == '+':\n $cprefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 4 && $flags['usesignal'] == '+':\n $csuffix = $signal;\n break;\n case $flags['usesignal'] == '(':\n case $locale[\"{$letter}_sign_posn\"] == 0:\n $prefix = '(';\n $suffix = ')';\n break;\n }\n if (!$flags['nosimbol']) {\n $currency = $cprefix .\n ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']) .\n $csuffix;\n } else {\n $currency = '';\n }\n $space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\n\n $value = number_format($value, $right, $locale['mon_decimal_point'],\n $flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\n $value = @explode($locale['mon_decimal_point'], $value);\n\n $n = strlen($prefix) + strlen($currency) + strlen($value[0]);\n if ($left > 0 && $left > $n) {\n $value[0] = str_repeat($flags['fillchar'], $left - $n) . $value[0];\n }\n $value = implode($locale['mon_decimal_point'], $value);\n if ($locale[\"{$letter}_cs_precedes\"]) {\n $value = $prefix . $currency . $space . $value . $suffix;\n } else {\n $value = $prefix . $value . $space . $currency . $suffix;\n }\n if ($width > 0) {\n $value = str_pad($value, $width, $flags['fillchar'], $flags['isleft'] ?\n STR_PAD_RIGHT : STR_PAD_LEFT);\n }\n\n $format = str_replace($fmatch[0], $value, $format);\n }\n return $format;\n}", "function numberformat($qwe,$asd)\r\n{\r\n if($qwe==0)$zxc='0'; \r\n else{\r\n $zxc=number_format($qwe,$asd);\r\n }\r\n return $zxc;\r\n}", "function format_number(float $num, int $precision = 1, ?string $locale = null, array $options = []): string\n {\n // If locale is not passed, get from the default locale that is set from our config file\n // or set by HTTP content negotiation.\n $locale ??= Locale::getDefault();\n\n // Type can be any of the NumberFormatter options, but provide a default.\n $type = (int) ($options['type'] ?? NumberFormatter::DECIMAL);\n\n $formatter = new NumberFormatter($locale, $type);\n\n // Try to format it per the locale\n if ($type === NumberFormatter::CURRENCY) {\n $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $options['fraction']);\n $output = $formatter->formatCurrency($num, $options['currency']);\n } else {\n // In order to specify a precision, we'll have to modify\n // the pattern used by NumberFormatter.\n $pattern = '#,##0.' . str_repeat('#', $precision);\n\n $formatter->setPattern($pattern);\n $output = $formatter->format($num);\n }\n\n // This might lead a trailing period if $precision == 0\n $output = trim($output, '. ');\n\n if (intl_is_failure($formatter->getErrorCode())) {\n throw new BadFunctionCallException($formatter->getErrorMessage());\n }\n\n // Add on any before/after text.\n if (isset($options['before']) && is_string($options['before'])) {\n $output = $options['before'] . $output;\n }\n\n if (isset($options['after']) && is_string($options['after'])) {\n $output .= $options['after'];\n }\n\n return $output;\n }", "function numberFormat($amount) {\n try {\n return number_format($amount);\n } catch (Exception $e) {\n return $amount;\n }\n }", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "function tfnm_format_number( $number, $decimal_places ){\n\n\t// Checking it is in fact a number before formatting to be safe.\n\tif( is_int( $number ) || is_float( $number ) ){\n\t\treturn number_format( $number, $decimal_places, '.', ',' );\n\t}\n\n\t// Just return what was inputted if it fails the checks above.\n\treturn $number;\n}", "public function formatNumber($value)\n\t{\n\t\treturn $value;\n\t}", "function smarty_modifier_number_format($string, $places=2, $dec=\",\", $thoussep=\" \")\n{\n if (!$string) return $string;\n return number_format($string, $places, $dec, $thoussep);\n}", "protected function numberFormatter($n) {\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),1).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),1).' milliarder';\r\n else if($n>1000000) return round(($n/1000000),1).' millioner';\r\n else if($n>1000) return round(($n/1000),1).' tusind';\r\n\r\n return number_format($n);\r\n }", "function FormatNumber($number, $decimals = 0)\n{\n if (is_numeric($number)) {\n return number_format($number, $decimals, ',', '.');\n } else {\n return number_format(0, $decimals, ',', '.');\n }\n}", "function yourls_number_format_i18n( $number, $decimals = 0 ) {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\t$formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] );\n\treturn yourls_apply_filter( 'number_format_i18n', $formatted );\n}", "public function testFormat() {\n\t\t$is = $this->Numeric->format('22');\n\t\t$expected = '22,00';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 1]);\n\t\t$expected = '22,3';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -1]);\n\t\t$expected = '20';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -2]);\n\t\t$expected = '0';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 3]);\n\t\t$expected = '22,300';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('abc', ['places' => 2]);\n\t\t$expected = '---';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t/*\n\t\t$is = $this->Numeric->format('12.2', array('places'=>'a'));\n\t\t$expected = '12,20';\n\t\t$this->assertEquals($expected, $is);\n\t\t*/\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'before' => 'EUR ']);\n\t\t$expected = 'EUR 22,30';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => ' EUR']);\n\t\t$expected = '22,30 EUR';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => 'x', 'before' => 'v']);\n\t\t$expected = 'v22,30x';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t#TODO: more\n\n\t}", "protected function formatNumber(string $number, NumberFormat $numberFormat, array $options = []): string\n {\n $parsedPattern = $this->getParsedPattern($numberFormat, $options['style']);\n // Start by rounding the number, if rounding is enabled.\n if (is_int($options['rounding_mode'])) {\n $number = Calculator::round($number, $options['maximum_fraction_digits'], $options['rounding_mode']);\n }\n $negative = (Calculator::compare('0', $number, 12) == 1);\n // Ensure that the value is positive and has the right number of digits.\n $signMultiplier = $negative ? '-1' : '1';\n $number = bcdiv($number, $signMultiplier, $options['maximum_fraction_digits']);\n // Split the number into major and minor digits.\n $numberParts = explode('.', $number);\n $majorDigits = $numberParts[0];\n // Account for maximumFractionDigits = 0, where the number won't\n // have a decimal point, and $numberParts[1] won't be set.\n $minorDigits = isset($numberParts[1]) ? $numberParts[1] : '';\n\n if ($options['use_grouping'] && $parsedPattern->isGroupingUsed()) {\n // Reverse the major digits, since they are grouped from the right.\n $majorDigits = array_reverse(str_split($majorDigits));\n // Group the major digits.\n $groups = [];\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getPrimaryGroupSize());\n while (!empty($majorDigits)) {\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getSecondaryGroupSize());\n }\n // Reverse the groups and the digits inside of them.\n $groups = array_reverse($groups);\n foreach ($groups as &$group) {\n $group = implode(array_reverse($group));\n }\n // Reconstruct the major digits.\n $majorDigits = implode(',', $groups);\n }\n\n if ($options['minimum_fraction_digits'] < $options['maximum_fraction_digits']) {\n // Strip any trailing zeroes.\n $minorDigits = rtrim($minorDigits, '0');\n if (strlen($minorDigits) < $options['minimum_fraction_digits']) {\n // Now there are too few digits, re-add trailing zeroes\n // until the desired length is reached.\n $neededZeroes = $options['minimum_fraction_digits'] - strlen($minorDigits);\n $minorDigits .= str_repeat('0', $neededZeroes);\n }\n }\n\n // Assemble the final number and insert it into the pattern.\n $number = strlen($minorDigits) ? $majorDigits . '.' . $minorDigits : $majorDigits;\n $pattern = $negative ? $parsedPattern->getNegativePattern() : $parsedPattern->getPositivePattern();\n $number = preg_replace('/#(?:[\\.,]#+)*0(?:[,\\.][0#]+)*/', $number, $pattern);\n $number = $this->localizeNumber($number, $numberFormat);\n\n return $number;\n }", "function erp_number_format_i18n( $number ) {\n // cast as string\n $number = (string) $number;\n\n // check if . exist\n if ( strpos( $number, '.' ) !== false ) {\n $extract = explode( '.', $number );\n if ( isset( $extract[1] ) && absint( $extract[1] > 0 ) ) {\n return number_format_i18n( $number, 1 );\n }\n }\n return number_format_i18n( $number );\n}", "function formatInIndianStyle($num){\n\t $pos = strpos((string)$num, \".\");\n\t if ($pos === false) { $decimalpart=\"00\";}\n\t else { $decimalpart= substr($num, $pos+1, 2); $num = substr($num,0,$pos); }\n\n\t if(strlen($num)>3 & strlen($num) <= 12){\n\t\t\t\t $last3digits = substr($num, -3 );\n\t\t\t\t $numexceptlastdigits = substr($num, 0, -3 );\n\t\t\t\t $formatted = makecomma($numexceptlastdigits);\n\t\t\t\t $stringtoreturn = $formatted.\",\".$last3digits.\".\".$decimalpart ;\n\t }elseif(strlen($num)<=3){\n\t\t\t\t $stringtoreturn = $num.\".\".$decimalpart ;\n\t }elseif(strlen($num)>12){\n\t\t\t\t $stringtoreturn = number_format($num, 2);\n\t }\n\n\t if(substr($stringtoreturn,0,2)==\"-,\"){$stringtoreturn = \"-\".substr($stringtoreturn,2 );}\n\t return $stringtoreturn;\n\t}", "function format_number($number, $divider = ',') {\n\t$number = intval(trim($number)) . '';\n\t$return = '';\n\t$len = strlen($number);\n\tfor($i = $len - 1, $j = 1; $i >= 0; $i--, $j++) {\n\t\t$return = ($j % 3 == 0 && $j != $len ? $divider : '') . $number[$i] . $return;\n\t}\n\treturn $return;\n}", "abstract function format();", "private static function numberFormat($number)\r\n {\r\n if (!is_string($number))\r\n return number_format($number, 2, ',', ' ');\r\n else\r\n return $number;\r\n }", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}" ]
[ "0.7478701", "0.7382876", "0.70564854", "0.7047208", "0.69407696", "0.68458503", "0.6827686", "0.6807814", "0.6779187", "0.67558783", "0.6690288", "0.6668437", "0.6636343", "0.6611882", "0.6569659", "0.6516594", "0.648652", "0.6468827", "0.64682114", "0.645923", "0.644641", "0.6359569", "0.6309426", "0.6308522", "0.62708366", "0.6262574", "0.623172", "0.62191635", "0.620085", "0.61942685" ]
0.7553891
0
/ hdl_forum_read_cookie() / Get / set forum read cookie
function hdl_forum_read_cookie($set="") { if ( $set == "" ) { // Get cookie and return array... if ( $fread = $this->my_getcookie('forum_read') ) { if( $fread != "-1" ) { $farray = unserialize(stripslashes($fread)); if ( is_array($farray) and count($farray) > 0 ) { foreach( $farray as $id => $stamp ) { $this->forum_read[ intval($id) ] = intval($stamp); } } } } return TRUE; } else { // Set cookie... $fread = addslashes(serialize($this->forum_read)); $this->my_setcookie('forum_read', $fread); return TRUE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readCookie() {\n\t\treturn unserialize($_COOKIE[$this->cookieName]);\n\t}", "function my_getcookie($name)\n {\n \tif ( isset($_COOKIE[$this->vars['cookie_id'].$name]) )\n \t{\n \t\tif ( ! in_array( $name, array('topicsread', 'forum_read') ) )\n \t\t{\n \t\t\treturn $this->parse_clean_value(urldecode($_COOKIE[$this->vars['cookie_id'].$name]));\n \t\t}\n \t\telse\n \t\t{\n \t\t\treturn urldecode($_COOKIE[$this->vars['cookie_id'].$name]);\n \t\t}\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n }", "public function getCookie() {\n\t\t$ret_val = false;\n\t\tif ($this->_cookie instanceof Http\\Cookie\\Iface\\Base) {\n\t\t\t$ret_val = $this->_cookie;\n\t\t}\n\t\treturn $ret_val;\n\t}", "static function viaRemember()\n\t{\n\t\treturn self::$cookie;\n\t}", "function set_usercookies() {\r\n\t\tglobal $login_name, $login_password, $lang, $actual_user_is_admin, $actual_user_is_logged_in, $actual_user_id, $actual_user_name, $actual_user_showname, $actual_user_passwd_md5, $actual_user_lang, $actual_user_online_id, $_COOKIE;\r\n\t\r\n\t\t$actual_user_online_id = \"\";\r\n\t\t$actual_user_is_admin = false;\r\n\t\t$actual_user_is_logged_in = false;\r\n\t\t$actual_user_id = 0;\r\n\t\t//\r\n\t\t// FIX ME: get this by default config or by HTTP headers of the client\r\n\t\t//\r\n\t\t$actual_user_lang = 'de'; \r\n\t\t$actual_user_name = '';\r\n\t\t$actual_user_showname = '';\r\n\t\t$actual_user_passwd_md5 = '';\r\n\t\t$languages = array('de', 'en');\r\n\t\t//\r\n\t\t// Check: has the user changed the language by hand?\r\n\t\t//\r\n\t\tif(isset($lang)) {\r\n\t\t\tif(in_array($lang, $languages))\r\n\t\t\t\t$actual_user_lang = $lang;\r\n\t\t}\r\n\t\t//\r\n\t\t// Get the language from the cookie if it' s not changed\r\n\t\t//\r\n\t\telseif(isset($_COOKIE['CMS_user_lang'])) {\r\n\t\t\tif(in_array($_COOKIE['CMS_user_lang'], $languages))\r\n\t\t\t\t$actual_user_lang = $_COOKIE['CMS_user_lang'];\r\n\t\t}\r\n\t\t//\r\n\t\t// Set the cookie (for the next 93(= 3x31) Days)\r\n\t\t//\r\n\t\tsetcookie('CMS_user_lang', $actual_user_lang, time() + 8035200); \r\n\t\t//\r\n\t\t// Tells the cookie: \"the user is logged in!\"?\r\n\t\t//\r\n\t\tif(isset($_COOKIE['CMS_user_cookie'])) {\r\n\t\t\t$data = explode('|', $_COOKIE['CMS_user_cookie']);\r\n\t\t\t$actual_user_online_id = @$data[0];\r\n\t\t\t$actual_user_name = @$data[1];\r\n\t\t\t$actual_user_passwd_md5 = @$data[2];\r\n\t\t}\r\n\t\t//\r\n\t\t// Tries somebody to log in?\r\n\t\t//\r\n\t\tif(isset($login_name) && isset($login_password)) {\r\n\t\t\t$actual_user_name = $login_name;\r\n\t\t\t$actual_user_passwd_md5 = md5($login_password);\r\n\t\t}\r\n\t\t\r\n\t\tif($actual_user_online_id == '')\r\n\t\t\t$actual_user_online_id = md5(uniqid(rand()));\r\n\t\t//\r\n\t\t// Check: is the user really logged in?\r\n\t\t//\r\n\t\tif($actual_user_name != \"\" && $actual_user_passwd_md5 != \"\") {\r\n\t\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM \" . DB_PREFIX . \"users\r\n\t\t\t\tWHERE user_name='$actual_user_name' AND user_password='$actual_user_passwd_md5'\";\r\n\t\t\t$original_user_result = db_result($sql);\r\n\t\t\t$original_user = mysql_fetch_object($original_user_result);\r\n\t\t\tif(@$original_user->user_name == '') {\r\n\t\t\t\t$actual_user_is_admin = false;\r\n\t\t\t\t$actual_user_is_logged_in = false;\r\n\t\t\t\t$actual_user_name = '';\r\n\t\t\t\t$actual_user_passwd_md5 = '';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$actual_user_is_logged_in = true;\r\n\t\t\t\t$actual_user_showname = $original_user->user_showname;\r\n\t\t\t\t$actual_user_id = $original_user->user_id;\r\n\t\t\t\tif($original_user->user_admin == 'y')\r\n\t\t\t\t\t$actual_user_is_admin = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsetcookie('CMS_user_cookie',$actual_user_online_id . '|' . $actual_user_name . '|' . $actual_user_passwd_md5, time() + 14400);\r\n\t}", "public function getCookie()\n {\n return $this->cookie;\n }", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "protected function _getCookie()\n {\n if (!is_null($this->content))\n {\n return $this->content;\n }\n\n $cookie = null;\n $this->content = new \\stdClass;\n\n if (!empty($_COOKIE[$this->name]))\n {\n $cookie = $_COOKIE[$this->name];\n }\n\n if (!empty($cookie) && (substr_count($cookie, '|') >= 2))\n {\n list($digest, $expire, $data) = explode('|', $cookie, 3);\n\n // Check data expiration and integrity\n if (!empty($digest) && !empty($data) && !empty($expire) \n && ($expire > round((time() - $this->start_timestamp) / 60))\n && hash_equals($digest, hash_hmac($this->digest_method, $expire . '|' . $data, $this->secret)))\n {\n if (substr($data, 0, 1) == '{')\n {\n $this->content = (object) json_decode($data, true);\n }\n elseif (function_exists('msgpack_unpack'))\n {\n $this->content = (object) msgpack_unpack($data);\n }\n\n // If the cookie will expire soon we try to renew it first\n if ($this->auto_renew && ($expire - round((time() - $this->start_timestamp)/60) <= $this->auto_renew))\n {\n $this->save();\n }\n }\n else\n {\n // Invalid cookie: just remove it\n $this->save();\n }\n }\n\n return $this->content;\n }", "public function get_cookies()\n {\n }", "public function getCookie() {\n return $this->cookie;\n }", "function cookie ($name) {\n\t\treturn @$this->cookie[$name];\n\t}", "public function get($cookieName);", "function myGetcookie($name){\r\n\t\tif(isset($_COOKIE[$name])){\r\n\t\t\treturn urldecode($_COOKIE[$name]);\r\n\t\t}else{\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "function getFromCookies() {\r\n\t\t//Data stored in cache as a cookie.\r\n\t\t$this->phone_number = $_COOKIE['phoneNumber'];\r\n\t\t$this->email = $_COOKIE['email'];\r\n\t}", "function getCookie($username, $pass) {\n\t\t\t\tglobal $botinfo, $clientinfo, $Crono;\n\t\tconsole( \"Attempting to get Certificate.. \", \"Core\");\n\t\t// Method to get the cookie! Yeah! :D\n\t\t// Our first job is to open an SSL connection with our host.\n\t\t$this->socket = fsockopen(\"ssl://www.deviantart.com\", 443);\n\t\tconsole( \"[Cookie] - Opened socket!\", \"Core\");\n\t\t// If we didn't manage that, we need to exit!\n\t\tif($this->socket === false) {\n\t\tconsole( \"Error: Please check your internet connection!\", \"Core\");\n\t\t}\n\t\t// Fill up the form payload\n\t\t$POST = '&username='.urlencode($username);\n\t\t$POST.= '&password='.urlencode($pass);\n\t\t$POST.= '&remember_me=1';\n\t\t// And now we send our header and post data and retrieve the response.\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"www.deviantart.com\",\n\t\t\t\"/users/login\",\n\t\t\t\"http://www.deviantart.com/users/rockedout\",\n\t\t\t$POST\n\t\t);\n\t \n\t\t// Now that we have our data, we can close the socket.\n\t\tfclose ($this->socket);\n\t\t// And now we do the normal stuff, like checking if the response was empty or not.\n\t\tif(empty($response))\n\t\treturn 'No response returned from the server';\n\t\tif(stripos($response, 'set-cookie') === false)\n\t\treturn 'No cookie returned';\n\t\t// Grab the cookies from the header\n\t\t$response=explode(\"\\r\\n\", $response);\n\t\t$cookie_jar = array();\n\t\tforeach ($response as $line)\n\t\t\tif (strpos($line, \"Set-Cookie:\")!== false)\n\t\t\t\t$cookie_jar[] = substr($line, 12, strpos($line, \"; \")-12);\n\n\t\t// Using these cookies, we're gonna go to chat.deviantart.com and get\n\t\t// our authtoken from the dAmn client.\n\t\tif (($this->socket = @fsockopen(\"ssl://www.deviantart.com\", 443)) == false)\n\t\t return 'Could not open an internet connection';\n\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"chat.deviantart.com\",\n\t\t\t\"/chat/\",\n\t\t\t\"http://chat.deviantart.com\",\n\t\t\tnull,\n\t\t\t$cookie_jar\n\t\t);\n\n\t\t// Now search for the authtoken in the response\n\t\t$cookie = null;\n\t\tif (($pos = strpos($response, \"dAmn_Login( \")) !== false)\n\t\t{\n\t\t\t$response = substr($response, $pos+12);\n\t\t\t$cookie = substr($response, strpos($response, \"\\\", \")+4, 32);\n\t\t}\n\t\telse return 'No authtoken found in dAmn client';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Because errors still happen, we need to make sure we now have an array!\n\t\tif(!$cookie)\n\t\treturn 'Malformed cookie returned';\n\t\t// We got a valid cookie!\n\t\tglobal $dAmn, $running;\n\t\t$running = true;\n\t\t$dAmn->cookie = $cookie;\n\t\treturn $cookie;\n\t\tconsole( \"Cookie: \".$cookie, \"Connection\"\t\t);\n\t}", "public function cookie($name='') {\n\t\t$this->cookie[$name] = (isset($_COOKIE[$name])) ?\n\t\t\t$_COOKIE[$name] : NULL;\n\t\t\t\n\t\treturn $this->cookie;\n\t}", "public function get_cookie($name){\n\t\t$this->load->helper('cookie');\n\t\tif ($this->input->cookie($name,true)!=NULL) {\n\t\t\techo $this->input->cookie($name,true);\n\t\t}else{\n\t\t\techo \"no cookie\";\n\t\t}\n\t}", "public function get($name)\n {\n return $this->cookieManager->getCookie($name);\n }", "function get_member_cookie()\n{\n global $SITE_INFO;\n if (empty($SITE_INFO['user_cookie'])) {\n $SITE_INFO['user_cookie'] = 'cms_member_id';\n }\n return $SITE_INFO['user_cookie'];\n}", "public function getCOOKIE($name) { return $this->getGLOBAL('_COOKIE', $name); }", "abstract public function getCookie($skin);", "public function markRead ()\n\t{\n\t\tif (isset($_COOKIE[\"read\"]) && $_COOKIE[\"read\"] == 1)\n\t\t{\n\t\t\t$Statement = $this->Database->prepare(\"UPDATE messages SET unread = 0 WHERE reciever = ?\");\n\t\t\t$Statement->execute(array($this->id));\n\t\t\tsetcookie('read', 0, time()-3600);\n\t\t}\n\t}", "public static function get($name){\n\t\treturn $_COOKIE[$name];\n\t}", "public function read($id) {\n $crypto = $this->psl['crypt/crypto'];\r\n $store = $this->psl['store'];\n\n /* If no cookie is set, just drop it! */\r\n if(!isset($_COOKIE[$this->name])) {\r\n return false;\r\n }\r\n\r\n /* Read from store and decrypt. */\r\n try {\r\n $sessData = $store->read('session', $_COOKIE[$this->name]);\r\n\r\n if($sessData !== false ) {\r\n $return = $crypto->decrypt($sessData, $this->secret);\r\n } else {\r\n $return = false;\r\n }\r\n return $return;\r\n } catch (\\phpSec\\Exception $e) {\r\n return false;\r\n }\n }", "public function getCookie(): array;", "function get_cookie($name)\n{\n if (isset($_COOKIE[$name])) {\n return json_decode(base64_decode(stripslashes($_COOKIE[$name])), true);\n }\n\n return array();\n}", "public function get()\n {\n return $this->cookieManager->getCookie(self::COOKIE_NAME);\n }", "public function getCookie($index=null){\n $result = null;\n if (isset($index)){\n $result = $_COOKIE[$index];\n }else{\n $result = $_COOKIE; \n }\n return $result;\n }", "public function getCookie($name){\n\n return self::$oCRNRSTN_ENV->oCOOKIE_MGR->getCookie($name);\n\n }", "function loadCookie($id){\r\n\t$cook=\"r$id\";\t\r\n\tif(isset($_COOKIE[$cook])){\t\t\r\n\t\treturn $_COOKIE[$cook]*1;\t\r\n\t}\r\n\telse return -1; //can vote now\r\n}" ]
[ "0.70679516", "0.65579987", "0.612599", "0.6030521", "0.59607434", "0.5951908", "0.59397715", "0.59289515", "0.59198904", "0.59173423", "0.5908738", "0.58618", "0.58382803", "0.58349866", "0.582548", "0.5819383", "0.5816389", "0.57587874", "0.57579595", "0.5715935", "0.57038647", "0.5695676", "0.5694551", "0.5690671", "0.5683522", "0.5680242", "0.56722325", "0.5670933", "0.56686515", "0.56523" ]
0.74936503
0
/ Show NORMAL created security image(s)... / Show antispam bot GIF image numbers
function show_gif_img($this_number="") { $numbers = array( 0 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKsOnmqSPjtT1ZdnnjCUqBQAOw==', 1 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUjAEWyMqoXIprRkjxtZJWrz3iCBQAOw==', 2 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKubnpPzRQvoVbvyrDHiWAAAOw==', 3 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKbaHgRyUZtmlPtlfnnMiGUFADs=', 4 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjAN5mLDtjFJMRjpj1Rv6v1SHN0IFADs=', 5 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhA+Bpxn/DITL1SRjnps63l1M9RQAOw==', 6 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjIEYyWwH3lNyrQTbnVh2Tl3N5wQFADs=', 7 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhI9pwbztAAwP1napnFnzbYEYWAAAOw==', 8 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKubHgSPWXoxVUxC33FZZCkFADs=', 9 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDA6hyJabnnISnsnybXdS73hcZlUFADs=', ); @header("Content-Type: image/gif"); echo base64_decode($numbers[ $this_number ]); exit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_image()\n\t{\n\t\tif ( $this->ipsclass->input['rc'] == \"\" )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Get the info from the db\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t \t\t\t\t 'from' => 'reg_antispam',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"regid='\".trim($this->ipsclass->txt_alphanumerical_clean($this->ipsclass->input['rc'])).\"'\"\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t \n\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Using GD?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['bot_antispam'] == 'gd' )\n\t\t{\n\t\t\t$this->ipsclass->show_gd_img($row['regcode']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Using normal then, check for \"p\"\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->input['p'] == \"\" )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$p = intval($this->ipsclass->input['p']) - 1; //substr starts from 0, not 1 :p\n\t\t\t\n\t\t\t$this_number = substr( $row['regcode'], $p, 1 );\n\t\t\t\n\t\t\t$this->ipsclass->show_gif_img($this_number);\n\t\t}\n\t}", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "function MakeGifImages()\n{\n $loc = 'badges_showall.php->MakeAllBadges';\n $sql = 'SELECT * FROM UserView ORDER BY BadgeID';\n $result = SqlQuery($loc, $sql);\n $nempty = 0;\n $nmade = 0;\n $nfail = 0;\n while($row = $result->fetch_assoc()) \n {\n if($row[\"Active\"] == false) continue;\n $tags = ArrayFromSlashStr($row[\"Tags\"]);\n if(!in_array(\"member\", $tags)) continue;\n $badgeid = $row[\"BadgeID\"];\n if(empty($badgeid)) {$nempty++; continue; }\n $r = MakeGif($row);\n if($r === true) $nmade++;\n else $nfail++;\n }\n $status = 'Images Made: ' . $nmade . ', Members without BadgeIDs: ' . $nempty;\n if($nfail > 0) $status .= ', Failures: ' . $nfail . '. (See sys log!)';\n log_msg($loc, array('All gif images made!', $status));\n return $status;\n}", "public function showImage()\n {\n $gif = new AnimatedGif($this->frames, $this->delays, $this->loops);\n $gif->display();\n }", "function print_images()\n {\n $images = $this->service->imageList();\n $image_choice = 0;\n foreach ($images as $image) {\n printf(\"%d) %s: Image %s requires min. %dMB of RAM and %dGB of disk\\n\",\n $image_choice, $image->id, $image->name, $image->minRam,\n $image->minDisk);\n $image_choice += 1;\n }\n }", "protected function writeGifAndPng() {}", "function getStatusImage(){\r\n\t\t$retval=\"gray.gif\";\r\n\t\tswitch ($this->status) {\r\n\t\t\tcase 0: $retval = \"black.gif\";break;\r\n\t\t\tcase 1: $retval = \"red.gif\";break;\r\n\t\t\tcase 2: $retval = \"orange.gif\";break;\r\n\t\t\tcase 3: $retval = \"yellow.gif\";break;\r\n\t\t\tcase 4: $retval = \"lila.gif\";break;\r\n\t\t\tcase 5: $retval = \"green.gif\";break;\r\n\t\t\tdefault: $retval=\"gray.gif\";\r\n\t\t}\r\n\t\treturn $retval;\r\n\t}", "function xstats_displayMovieGif( $gameId ) {\n//the movie could be generated by calling http://<host>/extend/moviegif/movie.php?fu=1&spiel=<gameId>\n $filename = '../moviegif/files/moviegif_'.$gameId.'.gif';\n if( file_exists( $filename )) {\n echo '<img src=\"'.$filename.'\" class=\"beveled\">';\n }\n}", "public function showImage()\n {\n }", "function pixel_page() {\n $data = [\n 'time' => date('m/d/Y H:i:s'),\n 'url' => \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\",\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'referer' => $_SERVER['HTTP_REFERER'],\n 'useragent' => $_SERVER['HTTP_USER_AGENT'],\n 'browser' => get_browser(null, true),\n 'tags' => (isset($_GET['tags']))?$_GET['tags']:'',\n ];\n store_log($data);\n\n // from https://stackoverflow.com/a/18852257/2496217\n // return 1x1 pixel transparent gif\n header(\"Content-type: image/gif\");\n // needed to avoid cache time on browser side\n header(\"Content-Length: 42\");\n header(\"Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate\");\n header(\"Expires: Wed, 11 Jan 2000 12:59:00 GMT\");\n header(\"Last-Modified: Wed, 11 Jan 2006 12:59:00 GMT\");\n header(\"Pragma: no-cache\");\n\n // from https://stackoverflow.com/a/51021174/2496217\n echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');\n}", "protected function show()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n $this->sendHeader('gif');\n imagegif($this->image, '');\n break;\n \n case 'image/jpeg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/jpg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/png':\n $this->sendHeader('png');\n imagepng($this->image, '', round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n }", "function xstats_getShipIconWithExp( $race, $picturesmall, $experience, $ownerindex) {\n include ('../../inc.conf.php');\n return( xstats_getShipIcon( $race, $picturesmall, $ownerindex).'<img src=\"../../bilder/icons/erf_'.$experience.'.gif\" class=\"padded\" />' );\n}", "public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }", "public function create_image(){\n\t\t$md5_hash = md5(rand(0,999));\n\t\t$security_code = substr($md5_hash, 15, 5);\n\t\t$this->Session->write('security_code',$security_code);\n\t\t$width = 80;\n\t\t$height = 22;\n\t\t$image = ImageCreate($width, $height);\n\t\t$black = ImageColorAllocate($image, 37, 170, 226);\n\t\t$white = ImageColorAllocate($image, 255, 255, 255);\n\t\tImageFill($image, 0, 0, $black);\n\t\tImageString($image, 5, 18, 3, $security_code, $white);\n\t\theader(\"Content-Type: image/jpeg\");\n\t\tImageJpeg($image);\n\t\tImageDestroy($image);\n\t}", "public function display()\n {\n header(\"Content-Type: image/png; name=\\\"barcode.png\\\"\");\n imagepng($this->_image);\n }", "function writeGifData() {\n header(\"Content-Type: image/gif\");\n header(\"Cache-Control: \" .\n \"private, no-cache, no-cache=Set-Cookie, proxy-revalidate\");\n header(\"Pragma: no-cache\");\n header(\"Expires: Wed, 17 Sep 1975 21:32:10 GMT\");\n echo join($GLOBALS['GIF_DATA']);\n }", "function show( $img )\n {\n\t\theader( \"Content-type: image/\" . substr( $img, strlen( $img ) - 4, 4 ) == \"jpeg\" ? \"jpeg\" : substr( $img, strlen( $img ) - 3, 3 ) );\n \treadfile( $img );\n }", "function xstats_getShipIcon( $race, $picturesmall, $ownerindex) {\n include ('../../inc.conf.php');\n return( '<img src=\"../../daten/'.$race.'/bilder_schiffe/'.$picturesmall.'\" height=\"24\" border=\"1\" style=\"border:1px solid '.$spielerfarbe[$ownerindex].'\">' );\n}", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "function loadIcon16($name) {\n echo \"<img src=\\\"icos/16-$name.png\\\" alt=\\\"\\\" width=\\\"16\\\" height=\\\"16\\\">\";\n }", "public function setGOnHandImgs(){\n $gOnHandImgs=\"\";\n if (!empty($this->gOnHand)){\n $komas=explode(\",\",$this->gOnHand);\n $class=\"\";\n\n foreach($komas as $koma){\n $pngimg=$this->filePathKoma;\n $pngimg.=\"G\";\n $komatopng=$this->komatopng($koma);\n $komadata=$this->komatopng(strtolower($koma));\n $pngimg.=$komatopng;\n $imageTag= $this->makeImageTag($class,$pngimg,$komadata);\n $gOnHandImgs.=$imageTag;\n }\n }\n return $gOnHandImgs;\n }", "function cpl_wra() {\n\t//You May NOT Edit It!\n\techo \"<img src='http://www.auburnflame.com/brk1.gif'>\";\n}", "function L_getImage($number) {\n\t\t\n\t\tglobal $post;\n\t\t$img = '';\n\t\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\t\t$img = $matches [1] [$number];\n\n\t\treturn $img;\n\t\n\t}", "function print_visitor_badge($visit_data ) {\n\t$picture_filename = path_join(conf('picture.dir'),\n\t\tsubstr($visit_data['id'], -1 ), $visit_data['id'].'.jpg');\n\n\t$date = date('Y-m-d', $visit_data['end_date']);\n\t$nr = $visit_data['id'];\n\t$bin_dir = getenv('BLABGEN_BIN');\n\n\textract($visit_data);\n\t$cmd = \"$bin_dir/\".conf('print.badge_cmd');\n\t$cmd = sprintf($cmd, $picture_filename, $name,\n\t\t$company, $nr, $date, conf('print.name'));\n\tlog_msg(LOG_DEBUG, \"Print: $cmd\");\n\texec_cmd($cmd);\n}", "function affiche_image(){\n\t\tglobal $infos_id;\n\t\tif($infos_id['grade']==0){\n\t\t\treturn\"<img src='ressources/membre.png' title='Membre' alt='Membre'>\";\n\t\t}\n\t\tif($infos_id['grade']==10){\n\t\t\treturn \"<img src='ressources/users.png' title='Conseil' alt='Membre du conseil'>\";\n\t\t}\n\t\tif($infos_id['grade']==20){\n\t\t\treturn \"<img src='ressources/admin.png' title='Vice président' alt='Vice président'>\";\n\t\t}\n\t\tif($infos_id['grade']==30){\n\t\t\treturn \"<img src='ressources/boss.png' title='Président' alt='Président'>\";\n\t\t}\n\t}", "public function showImageFromGet() {\n\n\t\t// $imageFilename = UniteFunctionsRev::getGetVar(\"img\");\n\t\t$imageID = intval( UniteFunctionsRev::getGetVar( 'img' ) );\n\t\t$maxWidth = UniteFunctionsRev::getGetVar( 'w',-1 );\n\t\t$maxHeight = UniteFunctionsRev::getGetVar( 'h',-1 );\n\t\t$type = UniteFunctionsRev::getGetVar( 't','' );\n\n\t\t// set effect\n\t\t$effect = UniteFunctionsRev::getGetVar( 'e' );\n\t\t$effectArgument1 = UniteFunctionsRev::getGetVar( 'ea1' );\n\n\t\tif ( ! empty( $effect ) ) {\n\t\t\t$this->setEffect( $effect,$effectArgument1 ); }\n\n\t\t$this->showImageByID( $imageID );\n\t\techo 'sechs<br>';\n\t\t// $this->showImage($imageFilename,$maxWidth,$maxHeight,$type);\n\t}", "static public function outputBlankGif()\n {\n $sBlankGifBase64 = 'R0lGODlhAQABAID/AP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n $sBlankGif = base64_decode($sBlankGifBase64);\n \n header('Content-Type: image/gif');\n header('Content-Length: ' . strlen($sBlankGif));\n echo $sBlankGif;\n exit;\n }", "public function getNekoImg() {\n\t\t$imgData = $this->getPhotosData();\n\t\t$this->chkFlickrErr($imgData);\n\n\t\t$this->setPhotoData($imgData);\n\n\t\t$userInfo = $this->getUserInfo();\n\t\t$this->chkFlickrErr($userInfo);\n\n\t\t$this->setUserData($userInfo);\n\n\t\t$this->createImgUri();\n\t\t$this->getImgSize();\n\n\t\t$this->setCreditInfo();\n\t\t$this->createImgTag();\n\n\t\t$imgNeko = $this->imgNeko;\n\t\t$creditInfo = $this->creditInfo;\n\t\t$this->Controller->set(compact(\"imgNeko\", \"creditInfo\"));\n\t}", "function displayImageInformation()\n {\n // query the number of saved images of the account\n $savedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'SAVED'\") or die(mysql_error());\n \n // query the number of deleted images of the account\n $deletedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n // calculate the number of images\n $savedImagesCount = mysql_num_rows($savedImagesQuery);\n $deletedImagesCount = mysql_num_rows($deletedImagesQuery);\n $totalImagesCount = $savedImagesCount + $deletedImagesCount;\n \n // calculate the hard disk space the saved image has used\n $savedImagesFileSize = 0;\n \n for($i=0; $i<$savedImagesCount ; $i++)\n {\n // incrementally compute the file sizes of each saved images in Kilobytes\n // 1 KB = 1024 bytes\n $savedImagePath = mysql_result($savedImagesQuery,$i,\"path\");\n $savedImagesFileSize = $savedImagesFileSize + ((filesize($savedImagePath)) / 1024);\n }\n \n // calculate the hard disk space the deleted image has used\n $deletedImagesFileSize = 0;\n \n for($i=0; $i<$deletedImagesCount; $i++)\n {\n // incrementally compute the file sizes of each deleted images in kilobytes\n // 1 KB = 1024 bytes\n $deletedImagePath = mysql_result($deletedImagesQuery,$i,\"path\");\n $deletedImagesFileSize = $deletedImagesFileSize + ((filesize($deletedImagePath)) / 1024);\n }\n \n // compute the total disk space that is being used\n $totalImagesFileSize = $savedImagesFileSize + $deletedImagesFileSize;\n \n // display the images information\n echo \"\n <p>Image Information</p>\n <p id='box'>\n Saved Images : \".$savedImagesCount.\" (\".round($savedImagesFileSize,2).\" KB)<br>\n Deleted Images : \".$deletedImagesCount.\" (\".round($deletedImagesFileSize,2).\" KB)<br><br>\n Total Images : \".$totalImagesCount.\" (\".round($totalImagesFileSize,2).\" KB)<br>\n </p>\";\n \n return;\n }" ]
[ "0.6741958", "0.6249568", "0.61823595", "0.6075554", "0.5984578", "0.59358746", "0.5921543", "0.5892696", "0.5882633", "0.5837331", "0.58194435", "0.581534", "0.5800001", "0.5739532", "0.5713731", "0.5693112", "0.5677502", "0.56435317", "0.5635442", "0.5623787", "0.5618256", "0.5602062", "0.55870104", "0.5586742", "0.5573223", "0.557153", "0.55705273", "0.55617774", "0.5558571", "0.5557855" ]
0.65845346
1
/ Creates a profile link if member is a reg. member, else just show name / Create profile link
function make_profile_link($name, $id="") { if ($id > 0) { return "<a href='{$this->base_url}showuser=$id'>$name</a>"; } else { return $name; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _wp_credits_add_profile_link(&$display_name, $username, $profiles)\n {\n }", "public function link() {\n return isset($this->_adaptee->user_info['user_username']) ? \"profile.php?user=\".$this->_adaptee->user_info['user_username'] : null;\n }", "public function getProfileLink()\n\t{\n\t\treturn site_url('profile/' . $this->hash);\n\t}", "function socialnetwork_writeLink($member_id, $modulo, $type, $image = false, $ref = false, $tb = false, $class=\"\",$user=true) {\n\t\tif ($member_id == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t$account = new Account($member_id);\n\t\t$profile = new Profile($member_id);\n\t\t$contact = db_getFromDB(\"contact\", \"account_id\", db_formatNumber($member_id), \"1\");\n\n\t\t$name_title = string_htmlentities(string_ucwords($profile->nickname && $account->has_profile == \"y\"? $profile->nickname: $contact->first_name.\" \".$contact->last_name));\n\t\tif ($profile->getNumber(\"account_id\") > 0){\n\t\t\t$name_link = string_ucwords($profile->nickname && $account->has_profile == \"y\"? $profile->nickname: $contact->first_name.\" \".$contact->last_name);\n\t\t}\n\n\t\tif ($account->has_profile == 'y' && SOCIALNETWORK_FEATURE == \"on\" && $account->getNumber(\"id\") > 0) {\n\t\t\t\n\t\t\tif (MODREWRITE_FEATURE == \"on\") {\n\t\t\t\tif (is_numeric($image)) {\n\t\t\t\t\t$imgObj = new Image($image, true);\n\t\t\t\t\tif ($imgObj->imageExists()) {\n\t\t\t\t\t\tif ($ref == true) {\n\t\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html');\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" onclick=\\\"urlRedirect('javascript:void(0);');\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$link .= $imgObj->getTag(true, PROFILE_IMAGE_WIDTH, PROFILE_IMAGE_HEIGHT);\n\t\t\t\t\t\t$link .= \"</a>\";\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($ref == true) {\n\t\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html');\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" onclick=\\\"urlRedirect('javascript:void(0);');\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($profile->facebook_image) {\n\t\t\t\t\t\t\timage_getNewDimension(PROFILE_IMAGE_WIDTH, PROFILE_IMAGE_HEIGHT, $profile->facebook_image_width ? $profile->facebook_image_width : 100, $profile->facebook_image_height ? $profile->facebook_image_height : 100, $newWidth, $newHeight);\n\t\t\t\t\t\t\t$link .= \"<img width=\\\"$newWidth\\\" height=\\\"$newHeight\\\" src=\\\"\".$profile->facebook_image.\"\\\" border=\\\"0\\\" title=\\\"\".$name_title.\"\\\" alt=\\\"\".$name_title.\"\\\" />\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (string_strpos($_SERVER[\"PHP_SELF\"], \"sitemgr\") || string_strpos($_SERVER[\"PHP_SELF\"], \"members\")){\n\t\t\t\t\t\t\t\t$link .= \"<span class=\\\"no-image no-link\\\"></span>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link .= \"<span class=\\\"no-image\\\"></span>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$link .= \"</a>\";\n\n\t\t\t\t\t}\n\t\t\t\t} else if (!$image && !$ref) {\n\t\t\t\t\tif ($tb == true) {\n\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html');\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" onclick=\\\"urlRedirect('javascript:void(0);');\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($user){\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ($ref == true) {\n\t\t\t\t\tif ($user){\n\t\t\t\t\t\t$link = SOCIALNETWORK_URL.\"/\".$profile->getString(\"friendly_url\").\".html\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$link = \"href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (is_numeric($image)) {\n\t\t\t\t\t$imgObj = new Image($image, true);\n\t\t\t\t\tif ($imgObj->imageExists()) {\n\t\t\t\t\t\tif ($ref == true) {\n\t\t\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"');\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$link .= $imgObj->getTag(true, PROFILE_IMAGE_WIDTH, PROFILE_IMAGE_HEIGHT);\n\t\t\t\t\t\t$link .= \"</a>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($ref == true) {\n\t\t\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"');\\\"title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"\\\"title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\";\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($profile->facebook_image) {\n\t\t\t\t\t\t\timage_getNewDimension(PROFILE_IMAGE_WIDTH, PROFILE_IMAGE_HEIGHT, $profile->facebook_image_width, $profile->facebook_image_height, $newWidth, $newHeight);\n\t\t\t\t\t\t\t$link .= \"<img width=\\\"$newWidth\\\" height=\\\"$newHeight\\\" src=\\\"\".$profile->facebook_image.\"\\\" border=\\\"0\\\" alt=\\\"\".$profile->nickname.\"\\\" />\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link .= \"<img width=\\\"\".PROFILE_IMAGE_WIDTH.\"\\\" height=\\\"\".PROFILE_IMAGE_HEIGHT.\"\\\" src=\\\"\".DEFAULT_URL.\"/images/profile_noimage.gif\\\" border=\\\"0\\\" alt=\\\"No Image\\\" />\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$link .= \"</a>\";\n\t\t\t\t\t}\n\t\t\t\t} else if (!$image && !$ref) {\n\t\t\t\t\tif ($tb == true) {\n\t\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" onclick=\\\"urlRedirect('\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"');\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($user) { \n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"\".SOCIALNETWORK_URL.\"/index.php?id=\".$member_id.\"\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$link = \"<a \".$class.\" href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\" title=\\\"\".$name_title.\"\\\">\".$name_link.\"</a>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ($ref == true) {\n\t\t\t\t\tif ($user) {\n\t\t\t\t\t\t$link = SOCIALNETWORK_URL.\"/index.php?id=\".$member_id;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$link = \"href=\\\"javascript:void(0);\\\" style=\\\"cursor:default\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tif (SOCIALNETWORK_FEATURE == \"on\" && $ref) {\n\t\t\t\t$link = \"<img width=\\\"\".PROFILE_IMAGE_WIDTH.\"\\\" height=\\\"\".PROFILE_IMAGE_HEIGHT.\"\\\" src=\\\"\".DEFAULT_URL.\"/images/profile_noimage.gif\\\" border=\\\"0\\\" alt=\\\"No Image\\\" />\";\n\t\t\t} else {\n\t\t\t\tif ($name_link){\n\t\t\t\t\t$link = \"<strong>\".$name_link.\"</strong>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $link;\n\t}", "function _fix_links_callback_member($m)\n\t{\n\t\treturn 'index.php?page=members&type=view&id='.strval(import_id_remap_get('member',strval($m[2]),true));\n\t}", "private function display()\n\t{\n\t\t//get member params\n\t\t$rparams = new \\Hubzero\\Config\\Registry($this->member->get('params'));\n\n\t\t//get profile plugin's params\n\t\t$params = $this->params;\n\t\t$params->merge($rparams);\n\n\t\t$xreg = null;\n\n\t\t$fields = Components\\Members\\Models\\Profile\\Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->ordered();\n\t\t\t}])\n\t\t\t->where('action_edit', '!=', Components\\Members\\Models\\Profile\\Field::STATE_HIDDEN)\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\tif (App::get('session')->get('registration.incomplete'))\n\t\t{\n\t\t\t$xreg = new \\Components\\Members\\Models\\Registration();\n\t\t\t$xreg->loadProfile($this->member);\n\n\t\t\t$check = $xreg->check('update');\n\n\t\t\t// Validate profile data\n\t\t\t// @TODO Move this to central validation model (e.g., registraiton)?\n\n\t\t\t// Compile profile data\n\t\t\t$profile = array();\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t$profile[$field->get('name')] = $this->member->get($field->get('name'));\n\t\t\t}\n\n\t\t\t// Validate profile fields\n\t\t\t$form = new Hubzero\\Form\\Form('profile', array('control' => 'profile'));\n\t\t\t$form->load(Components\\Members\\Models\\Profile\\Field::toXml($fields, 'edit', $profile));\n\t\t\t$form->bind(new Hubzero\\Config\\Registry($profile));\n\n\t\t\tif (!$form->validate($profile))\n\t\t\t{\n\t\t\t\t$check = false;\n\n\t\t\t\tforeach ($form->getErrors() as $key => $error)\n\t\t\t\t{\n\t\t\t\t\tif ($error instanceof Hubzero\\Form\\Exception\\MissingData)\n\t\t\t\t\t{\n\t\t\t\t\t\t$xreg->_missing[$key] = (string)$error;\n\t\t\t\t\t}\n\n\t\t\t\t\t$xreg->_invalid[$key] = (string)$error;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no errors, redirect to where they were going\n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\tApp::get('session')->set('registration.incomplete', 0);\n\t\t\t\tApp::redirect($_SERVER['REQUEST_URI']);\n\t\t\t}\n\t\t}\n\n\t\t$view = $this->view('default', 'index')\n\t\t\t->set('params', $params)\n\t\t\t->set('option', 'com_members')\n\t\t\t->set('profile', $this->member)\n\t\t\t->set('fields', $fields)\n\t\t\t->set('completeness', $this->getProfileCompleteness($fields, $this->member))\n\t\t\t->set('registration_update', $xreg);\n\n\t\treturn $view\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->loadTemplate();\n\t}", "function op_api_member($member)\n{\n if (!$member)\n {\n return null;\n }\n\n $viewMemberId = sfContext::getInstance()->getUser()->getMemberId();\n\n $memberImageFileName = $member->getImageFileName();\n if (!$memberImageFileName)\n {\n $memberImage = op_image_path('no_image.gif', true);\n }\n else\n {\n $memberImage = sf_image_path($memberImageFileName, array('size' => '48x48'), true);\n }\n\n $relation = null;\n if ((string)$viewMemberId !== (string)$member->getId())\n {\n $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($viewMemberId, $member->getId());\n }\n\n $selfIntroduction = $member->getProfile('op_preset_self_introduction', true);\n\n return array(\n 'id' => $member->getId(),\n 'profile_image' => $memberImage,\n 'screen_name' => $member->getConfig('op_screen_name', $member->getName()),\n 'name' => $member->getName(),\n 'profile_url' => op_api_member_profile_url($member->getId()),\n 'friend' => $relation ? $relation->isFriend() : false,\n 'blocking' => $relation ? $relation->isAccessBlocked() : false,\n 'self' => $viewMemberId === $member->getId(),\n 'friends_count' => $member->countFriends(),\n 'self_introduction' => $selfIntroduction ? (string)$selfIntroduction : null,\n );\n}", "function profileUrl()\r\n {\r\n return \"/user/show/{$this->id}\";\r\n }", "public function profile($username = null) {\n return '<a href=\"'.url('user/'.$this->id.'/'.$this->username).'\" style=\"color:'.$this->group->color.'\">'.($username ?? $this->username).'</a>';\n }", "function view_profile_link($actions, $user_object) {\n\n\t$actions['view_profile'] = \"<a class='view_profile' href='\" . site_url('author/'.$user_object->data->user_login) . \"'>\" . __( 'View Profile', 'cgc_ub' ) . \"</a>\";\n\treturn $actions;\n\n}", "protected function _member_profile_url($id)\n {\n return get_forum_base_url() . '/member.php?action=profile&uid=' . strval($id);\n }", "protected function _fix_links_callback_member($m)\n {\n return 'index.php?action=profile;u=' . strval(import_id_remap_get('member', strval($m[2]), true));\n }", "public function create_profile($member, $profile=null, $payment) {\n $refId = 'ref' . time();\n\n // Create a Customer Profile Request\n // 1. (Optionally) create a Payment Profile\n // 2. (Optionally) create a Shipping Profile\n // 3. Create a Customer Profile (or specify an existing profile)\n // 4. Submit a CreateCustomerProfile Request\n // 5. Validate Profile ID returned\n\n // Create a new CustomerPaymentProfile object\n $paymentProfile = new AnetAPI\\CustomerPaymentProfileType();\n $paymentProfile->setCustomerType('individual');\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($payment['card_number']);\n $creditCard->setExpirationDate($payment['exp_date']);\n $creditCard->setCardCode($payment['cvv2']);\n // Add the payment data to a paymentType object\n $paymentCreditCard = new AnetAPI\\PaymentType();\n $paymentCreditCard->setCreditCard($creditCard);\n $paymentProfile->setPayment($paymentCreditCard);\n $paymentProfile->setDefaultpaymentProfile(true);\n\n if($profile) {\n // Set the customer's Bill To address\n $billTo = new AnetAPI\\CustomerAddressType();\n $billTo->setFirstName($profile['first_name']);\n $billTo->setLastName($profile['last_name']);\n //$billTo->setCompany($profile['company']);\n $billTo->setAddress($profile['address']);\n $billTo->setCity($profile['city']);\n $billTo->setState($profile['state']);\n $billTo->setZip($profile['zipcode']);\n //$billTo->setCountry('USA');\n //$billTo->setPhoneNumber(\"888-888-8888\");\n //$billTo->setfaxNumber(\"999-999-9999\");\n $paymentProfile->setBillTo($billTo);\n }\n\n $paymentProfiles[] = $paymentProfile;\n\n // Create a new CustomerProfileType and add the payment profile object\n $customerProfile = new AnetAPI\\CustomerProfileType();\n $customerProfile->setDescription(\"unibox customer profile\");\n $customerProfile->setMerchantCustomerId($member['member_id']);\n $customerProfile->setEmail($member['email']);\n $customerProfile->setpaymentProfiles($paymentProfiles);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateCustomerProfileRequest();\n $request->setMerchantAuthentication($this->ma);\n $request->setRefId($refId);\n $request->setProfile($customerProfile);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateCustomerProfileController($request);\n $response = $controller->executeWithApiResponse($this->apiurl);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\")) {\n $paymentProfiles = $response->getCustomerPaymentProfileIdList();\n $ret = [\n 'status' => 0,\n 'profileId' => $response->getCustomerProfileId(),\n 'paymentProfileId' => $paymentProfiles[0],\n ];\n } else {\n $errorMessages = $response->getMessages()->getMessage();\n $ret = [\n 'status' => 1,\n 'err' => $errorMessages[0]->getCode(),\n 'msg' => $errorMessages[0]->getText(),\n ];\n }\n return $ret;\n }", "public static function profile_link( $subscription ) {\n\t\tif ( wcs_is_subscription( $subscription ) && 'paypal' == $subscription->get_payment_method() ) {\n\n\t\t\t$paypal_profile_id = wcs_get_paypal_id( $subscription );\n\n\t\t\tif ( ! empty( $paypal_profile_id ) ) {\n\n\t\t\t\t$url = '';\n\n\t\t\t\tif ( false === wcs_is_paypal_profile_a( $paypal_profile_id, 'billing_agreement' ) ) {\n\t\t\t\t\t// Standard subscription\n\t\t\t\t\t$url = 'https://www.paypal.com/?cmd=_profile-recurring-payments&encrypted_profile_id=' . $paypal_profile_id;\n\t\t\t\t} else if ( wcs_is_paypal_profile_a( $paypal_profile_id, 'billing_agreement' ) ) {\n\t\t\t\t\t// Reference Transaction subscription\n\t\t\t\t\t$url = 'https://www.paypal.com/?cmd=_profile-merchant-pull&encrypted_profile_id=' . $paypal_profile_id . '&mp_id=' . $paypal_profile_id . '&return_to=merchant&flag_flow=merchant';\n\t\t\t\t}\n\n\t\t\t\techo '<div class=\"address\">';\n\t\t\t\techo '<p class=\"paypal_subscription_info\"><strong>';\n\t\t\t\techo esc_html( __( 'PayPal Subscription ID:', 'woocommerce-subscriptions' ) );\n\t\t\t\techo '</strong>';\n\t\t\t\tif ( ! empty( $url ) ) {\n\t\t\t\t\techo '<a href=\"' . esc_url( $url ) . '\" target=\"_blank\">' . esc_html( $paypal_profile_id ) . '</a>';\n\t\t\t\t} else {\n\t\t\t\t\techo esc_html( $paypal_profile_id );\n\t\t\t\t}\n\t\t\t\techo '</p></div>';\n\t\t\t}\n\t\t}\n\n\t}", "public function renderMemberProfile($string) {\r\n\t$ids = explode('-', $string);\r\n\t$kid = $ids[0];\r\n\ttry {\r\n\t $userData = $this->getUserModel()->getUserByKid((int) $kid);\r\n\t $profileData = $this->getUserModel()->getWebProfilesFluent((int) $kid)->execute()->fetch();\r\n\t} catch (Exception $ex) {\r\n\t $this->flashMessage('Omlouváme se, ale požadovaná data nelze získat. Zkuste to prosím znovu nebo později.', 'error');\r\n\t Debugger::log($ex->getMessage(), Debugger::ERROR);\r\n\t $this->redirect('Homepage:default');\r\n\t}\r\n\r\n\tdump(\"PICTURE\");\r\n\r\n\t$this->template->profile_req = $userData->profile_required;\r\n\r\n\r\n\t$this->template->publicData = array('name' => $userData->name,\r\n\t 'surname' => $userData->surname,\r\n\t 'year' => $userData->year,\r\n\t 'nick' => $userData->nick,\r\n\t 'signature' => $userData->signature,\r\n\t 'city' => $userData->city);\r\n\t$profileData->offsetUnset('kid');\r\n\t$profileData->offsetUnset('city');\r\n\t$profileData->offsetUnset('job');\r\n\t$profileData->offsetUnset('last_updated');\r\n\t$profileData->offsetUnset('contact');\r\n\t$this->template->profileData = $profileData;\r\n\r\n\t// TODO rights 0 1 2\r\n\t$this->template->levelOneData = array('job' => $userData->job,\r\n\t 'phone' => $userData->phone);\r\n\r\n\t// TODO rights 3 4\r\n\t$this->template->levelTwoData = array('address' => $userData->address,\r\n\t 'postalCode' => $userData->postal_code,\r\n\t 'contName' => $userData->contperson_name,\r\n\t 'contPhone' => $userData->contperson_phone,\r\n\t 'contEmail' => $userData->contperson_email);\r\n }", "function getProfileInfo($member)\n\t\t{\n\t\n\t\t $query = \"SELECT * FROM tbl_member WHERE `user_name` = '\".$member.\"'\";\n\t\t $rs\t\t=\t$this->Execute($query);\n\t\t return $this->_getPageArray($rs, 'Subscriber');\n\t\t}", "function profile(){\n\nglobal $user, $conn, $dbtables, $logged_in, $globals, $l, $AEF_SESS, $theme;\nglobal $member, $smileys, $smileycode, $smileyimages, $tree;\n\t\n\t//Load the Language File\n\tif(!load_lang('profile')){\n\t\n\t\treturn false;\n\t\t\n\t}\n\t\n\t//The name of the file\n\t$theme['init_theme'] = 'profile';\n\t\n\t//The name of the Page\n\t$theme['init_theme_name'] = 'Profile Theme';\n\t\n\t//Array of functions to initialize\n\t$theme['init_theme_func'] = array('profile_theme');\n\t\n\t/////////////////////////////////////////\n\t//This section is only for users\n\tif(!$user['can_view_profile']){\n\t\n\t\t//Show a major error and return\n\t\treporterror($l['cant_view_profile_title'], $l['cant_view_profile']);\n\t\t\t\n\t\treturn false;\n\t\n\t}\n\t/////////////////////////////////////////\t\n\t\n\tif(!empty($_GET['mid']) && trim($_GET['mid']) && is_numeric(trim($_GET['mid']))){\n\t\n\t\t$mid = (int) inputsec(htmlizer(trim($_GET['mid'])));\n\t\t\n\t}else{\n\t\n\t\t//Show a major error and return\n\t\treporterror($l['no_member_specified_title'], $l['no_member_specified']);\n\t\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n\t\n\t//Select the users profile\t\n\t$qresult = makequery(\"SELECT u.id, u.username, u.email, u.r_time, u.lastlogin, u.lastlogin_1, \n\t\t\tu.posts, u.realname, u.users_text, u.gender, u.birth_date, u.customtitle, u.location,\n\t\t\tu.www, u.timezone, u.gmail, u.icq, u.aim, u.yim, u.msn, u.sig, u.avatar, u.avatar_type,\n\t\t\tu.avatar_width, u.avatar_height, u.ppic, u.ppic_type, u.ppic_width, u.ppic_height, \n\t\t\tu.hideemail, u.u_member_group, ug.*\n\t\t\tFROM \".$dbtables['users'].\" u\n\t\t\tLEFT JOIN \".$dbtables['user_groups'].\" ug ON (ug.member_group = u.u_member_group)\n\t\t\tWHERE u.id = '$mid'\");\n\t\t\t\n\tif(mysql_num_rows($qresult) < 1){\n\t\n\t\t//Show a major error and return\n\t\treporterror($l['no_member_found_title'], $l['no_member_found']);\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n\t$member = mysql_fetch_assoc($qresult);\n\t\n\t$tree = array();//Board tree for users location\n\t$tree[] = array('l' => $globals['index_url'],\n\t\t\t\t\t'txt' => $l['index']);\n\t$tree[] = array('l' => $globals['index_url'].'mid='.$mid,\n\t\t\t\t\t'txt' => $member['username'],\n\t\t\t\t\t'prefix' => $l['viewing_prefix']);\n\t\n\t/////////////////////////////\n\t// What are you doing dude?\n\t/////////////////////////////\n\t\n\t$globals['last_activity'] = 'pro';\n\t\n\t//He is viewing the profile\n\t$globals['activity_id'] = $member['id'];\n\t\n\t$globals['activity_text'] = $member['username'];\n\t\n\t\n\t//Is avatars allowed globally\n\tif(!empty($member['avatar']) && $globals['showavatars']){\n\t\n\t\t$avatar = array('avatar' => $member['avatar'],\n\t\t\t\t\t'avatar_type' => $member['avatar_type'],\n\t\t\t\t\t'avatar_width' => $member['avatar_width'],\n\t\t\t\t\t'avatar_height' => $member['avatar_height']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t$member['avatarurl'] = urlifyavatar(100, $avatar);\n\t\n\t}\n\t\n\t\n\t//Load the personal pictures\n\tif(!empty($member['ppic'])){\n\t\n\t\t$ppic = array('ppic' => $member['ppic'],\n\t\t\t\t\t'ppic_type' => $member['ppic_type'],\n\t\t\t\t\t'ppic_width' => $member['ppic_width'],\n\t\t\t\t\t'ppic_height' => $member['ppic_height']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t$member['ppicurl'] = urlifyppic(100, $ppic);\n\t\n\t}\n\n\t\n\t//Hide the members email if set\n\tif($member['hideemail'] == 1){\n\t\t\t\n\t\t$member['email'] = '';\n\t\n\t}\n\t\n\t\n\t$showsmileys = ($logged_in ? ( $user['showsmileys'] == 1 ? true : ($user['showsmileys'] == 2 ? false : $globals['usesmileys']) ) : $globals['usesmileys']);\n\t\n\t//Are we to use smileys ?\n\tif($globals['usesmileys'] && $showsmileys){\n\t\n\t\tif(!getsmileys()){\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}\n\t\n\t$member['sig'] = parse_special_bbc($member['sig']);\t\n\t\n\t$member['sig'] = format_text($member['sig']);\n\t\n\t$member['sig'] = parse_br($member['sig']);\n\t\n\t//What about smileys in sigs\n\tif($globals['usesmileys'] && $showsmileys){\n\t\n\t\t$member['sig'] = smileyfy($member['sig']);\n\t\n\t}\n\t\n\t$theme['call_theme_func'] = 'profile_theme';\n\t\n}", "public function create_member_profile()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n $data = [];\n\n if (Request::has('group_id')) {\n if ( ! Session::access('can_admin_mbr_groups')) {\n return Cp::unauthorizedAccess();\n }\n\n $data['group_id'] = Request::input('group_id');\n }\n\n // ------------------------------------\n // Instantiate validation class\n // ------------------------------------\n\n $VAL = new ValidateAccount(\n [\n 'request_type' => 'new', // new or update\n 'require_password' => false,\n 'screen_name' => Request::input('screen_name'),\n 'password' => Request::input('password'),\n 'password_confirm' => Request::input('password_confirm'),\n 'email' => Request::input('email'),\n ]\n );\n\n $VAL->validateScreenName();\n $VAL->validateEmail();\n $VAL->validatePassword();\n\n // ------------------------------------\n // Display error is there are any\n // ------------------------------------\n\n if (count($VAL->errors()) > 0) {\n return Cp::errorMessage($VAL->errors());\n }\n\n // Assign the query data\n $data['password'] = Hash::make(Request::input('password'));\n $data['ip_address'] = Request::ip();\n $data['unique_id'] = Uuid::uuid4();\n $data['join_date'] = Carbon::now();\n $data['email'] = Request::input('email');\n $data['screen_name'] = Request::input('screen_name');\n\n // Was a member group ID submitted?\n $data['group_id'] = ( ! Request::input('group_id')) ? 2 : Request::input('group_id');\n\n // Create records\n $member_id = DB::table('members')->insertGetId($data);\n DB::table('member_data')->insert(['member_id' => $member_id]);\n DB::table('member_homepage')->insert(['member_id' => $member_id]);\n\n $message = __('members.new_member_added');\n\n // Write log file\n Cp::log($message.' '.$data['email']);\n\n // Update global stat\n Stats::update_member_stats();\n\n // Build success message\n return $this->view_all_members($message.' <b>'.stripslashes($data['screen_name']).'</b>');\n }", "public function createProfile($admin = false);", "public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}", "function apply_add_profile(&$character, $profile)\n {\n $err = array();\n if (is_valid_pname($profile, $err))\n if ($character->GrantAccessTo($profile))\n return true;\n return false;\n }", "public function createWithSocialProvider($name, $email, $avatar, $profile, $relation);", "function new_member_profile_form()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$body_props = \" onload=\\\"document.forms[0].email.focus();\\\"\";\n\n $title = __('members.register_member');\n\n // Build the output\n $r = Cp::formOpen(['action' => 'C=Administration'.AMP.'M=members'.AMP.'P=register_member']);\n\n $r .= Cp::quickDiv('tableHeading', $title);\n $r .= Cp::div('box');\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password'),\n Cp::input_pass('password', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password_confirm'),\n Cp::input_pass('password_confirm', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.screen_name'),\n Cp::input_text('screen_name', '', '40', '50', 'input', '300px')\n );\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '45%', '', '', 'top');\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '100', 'input', '300px')\n );\n\n // Member groups assignment\n if (Session::access('can_admin_mbr_groups')) {\n $query = DB::table('member_groups')\n ->select('group_id', 'group_name')\n ->orderBy('group_name');\n\n if (Session::userdata('group_id') != 1)\n {\n $query->where('is_locked', 'n');\n }\n\n $query = $query->get();\n\n if ($query->count() > 0)\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::quickDiv('defaultBold', __('account.member_group_assignment'))\n );\n\n $r .= Cp::input_select_header('group_id');\n\n foreach ($query as $row)\n {\n $selected = ($row->group_id == 5) ? 1 : '';\n\n // Only SuperAdmins can assigned SuperAdmins\n if ($row->group_id == 1 AND Session::userdata('group_id') != 1) {\n continue;\n }\n\n $r .= Cp::input_select_option($row->group_id, $row->group_name, $selected);\n }\n\n $r .= Cp::input_select_footer();\n }\n }\n\n $r .= '</div>'.PHP_EOL;\n\n // Submit button\n\n $r .= Cp::itemgroup( '',\n Cp::required(1).'<br><br>'.Cp::input_submit(__('cp.submit'))\n );\n $r .= '</form>'.PHP_EOL;\n\n\n Cp::$title = $title;\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem($title);\n Cp::$body = $r;\n }", "function getUserlink($id, $name = '')\n{\n\tif(!$name)\n\t\t$name = getUsername($id);\n\n\tif($name)\n\t\treturn makeLink($name, 'a=viewuserdetails&user=' . $id, SECTION_USER);\n\telse\n\t\treturn 'Guest';\n}", "public function add_member_login_link_text() {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"ast-woo-form-actions\">\n\t\t\t\t\t%1$s\n\t\t\t\t\t<a href=\"#ast-woo-login\" data-type=\"do-login\" class=\"ast-woo-account-form-link\">\n\t\t\t\t\t\t%2$s\n\t\t\t\t\t</a>\n\t\t\t\t</p>',\n\t\t\t\tapply_filters( 'astra_addon_woo_account_login_heading', __( 'Already a member?', 'astra-addon' ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\tapply_filters( 'astra_addon_woo_account_login_trigger', __( 'Login', 'astra-addon' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t);\n\t\t}", "public function profile(){\n\t\t$this->common_lib->profile($this->user,$this->menu,$this->group->name);\n\t}", "function createMemberUserAccount($memberNumber, $lastName) {\n\t\tglobal $link;\n\t\t\n\t\t$param_username = $memberNumber;\n\t\t$param_password = password_hash($lastName, PASSWORD_DEFAULT); // Creates a password hash\n\n\n\t\t// Prepare an insert statement\n $query = 'INSERT INTO users (username, password) VALUES (\"'.$param_username.'\", '.'\"'.$param_password.'\")';\n\t\t$statement = $link->prepare($query);\n\t\t//echo $query;\n\t\t$statement->execute();\n\t\t$statement->close();\n}", "public function manage_members()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "function profileTabs($selected) {\n\t\tglobal $HTML;\n\n\t\t$_ = '';\n\t\t\n\t\t$_ .= '<ul class=\"tabs\">';\n\t\t\t$_ .= $HTML->link(\"Profile\", \"/janitor/admin/profile\", array(\"wrapper\" => \"li.profile\".($selected == \"profile\" ? \".selected\" : \"\")));\n\n\t\t\tif(defined(\"SITE_ITEMS\") && SITE_ITEMS):\n\t\t\t\t$_ .= $HTML->link(\"Content\", \"/janitor/admin/profile/content\", array(\"wrapper\" => \"li.content\".($selected == \"content\" ? \".selected\" : \"\")));\n\n\t\t\t\t// readstates not available for guest user\n\t\t\t\t// $_ .= $HTML->link(\"Readstates\", \"/janitor/admin/profile/readstates\", array(\"wrapper\" => \"li.readstates\".($selected == \"readstates\" ? \".selected\" : \"\")));\n\n\t\t\tendif;\n\n\t\t\t// maillist not available for guest user\n\t\t\tif(defined(\"SITE_SIGNUP\") && SITE_SIGNUP):\n\t\t\t\t$_ .= $HTML->link(\"Maillists\", \"/janitor/admin/profile/maillists\", array(\"wrapper\" => \"li.maillist\".($selected == \"maillists\" ? \".selected\" : \"\")));\n\t\t\tendif;\n\n\t\t\t// orders not available for guest user\n\t\t\tif(defined(\"SITE_SHOP\") && SITE_SHOP):\n\t\t\t\t$_ .= $HTML->link(\"Orders\", \"/janitor/admin/profile/orders/list\", array(\"wrapper\" => \"li.orders\".($selected == \"orders\" ? \".selected\" : \"\")));\n\t\t\tendif;\n\n\t\t\t// subscriptions not available for guest user\n\t\t\tif(defined(\"SITE_SUBSCRIPTIONS\") && SITE_SUBSCRIPTIONS):\n\t\t\t\t$_ .= $HTML->link(\"Subscriptions\", \"/janitor/admin/profile/subscription/list\", array(\"wrapper\" => \"li.subscriptions\".($selected == \"subscriptions\" ? \".selected\" : \"\")));\n\t\t\tendif;\n\n\t\t\t// membership not available for guest user\n\t\t\tif(defined(\"SITE_MEMBERS\") && SITE_MEMBERS):\n\t\t\t\t$_ .= $HTML->link(\"Membership\", \"/janitor/admin/profile/membership/view\", array(\"wrapper\" => \"li.membership\".($selected == \"membership\" ? \".selected\" : \"\")));\n\t\t\tendif;\n\n\t\t$_ .= '</ul>';\n\t\t\n\t\treturn $_;\n\t}", "public function createFamilyLink($memberid, $linkmember, $relationship)\n {\n $memberid = db::escapechars($memberid);\n $linkmember = db::escapechars($linkmember);\n $relationship = db::escapechars($relationship);\n \n $sql = \"INSERT INTO familyconstruct SET\n fromID='$memberid',\n toID='$linkmember',\n relationship='$relationship'\n \";\n \n $addmember = db::execute($sql);\n \n // Add the reverse relationship - work out what the reverse is before applying the modification\n if($relationship == \"Parent\"){\n $reverserelationship = \"Child\";\n }\n elseif($relationship == \"Child\"){\n $reverserelationship = \"Parent\";\n }\n else{\n $reverserelationship = $relationship;\n }\n \n $sql = \"INSERT INTO familyconstruct SET\n toID='$memberid',\n fromID='$linkmember',\n relationship='$reverserelationship'\n \";\n \n \n \n if($addmember){\n $this->logevent('Family Construct', $_SESSION['Kusername'].' Added a new family link', 'Members');\n \n $addreverse = db::execute($sql);\n if($addreverse){\n $this->logevent('Family Construct', $_SESSION['Kusername'].' Added a new family link (reverse entry)', 'Members');\n return true;\n }\n else{\n $this->logerror('Family Construct', $_SESSION['Kusername'].' Failed in trying to add a new family link (reverse entry)', 'Members');\n return false;\n }\n }\n else{\n $this->logerror('Family Construct', $_SESSION['Kusername'].' Failed in trying to add a new family link', 'Members');\n return false;\n }\n\n }" ]
[ "0.712588", "0.6562196", "0.62130606", "0.6108036", "0.6036663", "0.60321003", "0.59910464", "0.5988555", "0.5964628", "0.5962871", "0.5954015", "0.59387624", "0.59182394", "0.5818499", "0.580157", "0.5768296", "0.5761606", "0.5755277", "0.5741926", "0.5735296", "0.5728884", "0.57220656", "0.5663251", "0.56603223", "0.5656295", "0.56528085", "0.5651442", "0.5644279", "0.5626786", "0.5626357" ]
0.68021137
1
/ Applies group suffix/prefix to a name / Format name based on group suffix/prefix
function make_name_formatted($name, $group_id="", $prefix="", $suffix="") { if ( isset( $this->vars['ipb_disable_group_psformat'] ) and $this->vars['ipb_disable_group_psformat'] ) { return $name; } if( !$group_id ) { $group_id = 0; } if( !$prefix ) { if( $this->cache['group_cache'][ $group_id ]['prefix'] ) { $prefix = $this->cache['group_cache'][ $group_id ]['prefix']; } } if( !$suffix ) { if( $this->cache['group_cache'][ $group_id ]['suffix'] ) { $suffix = $this->cache['group_cache'][ $group_id ]['suffix']; } } return $prefix.$name.$suffix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groups_parse_name($format, $groupnumber) {\n if (strstr($format, '@') !== false) { // Convert $groupnumber to a character series\n $letter = 'A';\n for($i=0; $i<$groupnumber; $i++) {\n $letter++;\n }\n $str = str_replace('@', $letter, $format);\n } else {\n $str = str_replace('#', $groupnumber+1, $format);\n }\n return($str);\n}", "public function formatName($name);", "function formatName(array $name)\r\n {\r\n return $name['last_name'] . ' ' . preg_replace('/\\b([A-Z]).*?(?:\\s|$)+/','$1',$name['first_name']);\r\n }", "function FormatName ($name) {\n\t\n\t\t//\tStart by lower casing the name\n\t\t$name=MBString::ToLower(MBString::Trim($name));\n\t\t\n\t\t//\tFilter the name through\n\t\t//\tthe substitutions\n\t\tforeach (array(\n\t\t\t'(?<=^|\\\\W)(\\\\w)' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)O\\'\\\\w' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)(Ma?c)(\\\\w)' => function ($matches) {\treturn $matches[1].MBString::ToUpper($matches[2]);\t}\n\t\t) as $pattern=>$substitution) {\n\t\t\n\t\t\t$pattern='/'.$pattern.'/u';\n\t\t\t\n\t\t\t$name=(\n\t\t\t\t($substitution instanceof Closure)\n\t\t\t\t\t?\tpreg_replace_callback($pattern,$substitution,$name)\n\t\t\t\t\t:\tpreg_replace($pattern,$substitution,$name)\n\t\t\t);\n\t\t\n\t\t}\n\t\t\n\t\t//\tReturn formatted name\n\t\treturn $name;\n\t\n\t}", "private static function format($name, $value)\n {\n return $value ?: ucwords(str_replace('_', ' ', $name));\n }", "abstract protected function prefixName($name);", "abstract protected function prefixName($name);", "function joinName ($parts, string $format = DEFAULT_FORMAT) {\n if (is_array($parts)) {\n $parts = (object)$parts;\n }\n\n $formatFields = [\n 'S' => 'surname',\n 'N' => 'name',\n 'P' => 'patronymic'\n ];\n\n return implode(' ', array_map(function ($formatLetter) use ($parts, $formatFields) {\n $field = $formatFields[$formatLetter];\n return $parts->$field;\n }, str_split($format)));\n}", "function SM_prettyName($name) {\n\n // firstName = First Name\n if (preg_match(\"/[a-z][A-Z]/\",$name)) {\n $name = preg_replace(\"/([a-z])([A-Z])/\",\"\\\\1%\\\\2\",$name);\n $wordList = explode('%',$name);\n $name = '';\n foreach ($wordList as $word) {\n $name .= ucfirst($word).' ';\n }\n chop($name);\n }\n // FirstName = First Name\n elseif (preg_match(\"/[A-Z][a-z]/\",$name)) { \n $name = preg_replace(\"/([A-Z])([a-z])/\",\"\\\\1%\\\\2\",$name);\n \n $wordList = explode('%',$name);\n $name = '';\n foreach ($wordList as $word) {\n $name .= ucfirst($word).' ';\n }\n }\n // address1 = Address 1\n // address2 = Address 2\n elseif (preg_match(\"/^(\\w+)(\\d)\\$/\",$name,$m)) {\n $name = ucfirst($m[1]).' '.$m[2];\n }\n // sometext = Sometext\n else {\n $name = ucfirst($name);\n }\n \n // strip a trailing _idxNum\n if (preg_match(\"/^(.+)_idx\\s*Num\\s*\\$/\",$name,$m)) {\n $name = $m[1];\n } \n \n return trim($name);\n\n}", "protected function _formatModuleName($name)\n {\n $name = strtolower($name);\n $name = str_replace(array('-', '.'), ' ', $name);\n $name = ucwords($name);\n $name = str_replace(' ', '', $name);\n return $name;\n }", "public function format()\n {\n $formattedString = join('_', $this->toLower());\n if (strpos($formattedString, '_') === 0) {\n $formattedString = substr($formattedString, 1);\n }\n\n return $formattedString;\n }", "public function getFormatName();", "private function formatFilename() {\n return $this->prefix . $this->name . \".\" . $this->extension;\n }", "protected function helper_fullname_format() {\n\n $fake = new stdClass();\n $fake->lastname = 'LLLL';\n $fake->firstname = 'FFFF';\n $fullname = get_string('fullnamedisplay', '', $fake);\n if (strpos($fullname, 'LLLL') < strpos($fullname, 'FFFF')) {\n return 'lf';\n } else {\n return 'fl';\n }\n }", "protected function _formatName($unformatted, $isAction = false)\n {\n // preserve directories\n if (!$isAction) {\n $segments = explode($this->getPathDelimiter(), (string) $unformatted);\n } else {\n $segments = (array) $unformatted;\n }\n\n foreach ($segments as $key => $segment) {\n $segment = str_replace($this->getWordDelimiter(), ' ', strtolower($segment));\n $segment = preg_replace('/[^a-z0-9 ]/', '', $segment);\n $segments[$key] = str_replace(' ', '', ucwords($segment));\n }\n\n return implode('_', $segments);\n }", "function getGroupShortName($group)\n {\n return '';\n }", "protected function formatName($name)\n {\n return str_replace(['-', '_'], ' ', ucfirst(trim($name)));\n }", "function makename($base, $att, $num) {\r\n return sprintf(\"%s[%s_%d]\", $base, $att, $num);\r\n }", "public function getNameSuffix ();", "static function format_nfp_name($nfp) {\n $name = '';\n if(!empty($nfp->prefix)) {\n $name .= $nfp->prefix . ' ';\n }\n if(!empty($nfp->first_name)) {\n if(strlen($name)) {\n $name .= ' ';\n }\n $name .= $nfp->first_name;\n }\n if(!empty($nfp->last_name)) {\n if(strlen($name)) {\n $name .= ' ';\n }\n $name .= $nfp->last_name;\n }\n return $name;\n }", "function nameFormatAnglo($str) {\n // allow ' (apostrophe) and - (hyphen) as valid char in name\n $str = preg_replace(\"/[^a-zA-Z'-]/\", \"\", $str);\n $str = strtolower($str);\n $str = ucfirst($str);\n // specific: need check for \"O'Conner\" etc, capitalised after the apostrophe.\n if (strpos($str, \"'\") == 1) {\n $str = join(\"'\", array_map(\"ucfirst\", array_map(\"strtolower\", explode(\"'\", $str))));\n }\n // or have a hyphenated name\n if (strpos($str, \"-\") !== FALSE) {\n $str = join(\"-\", array_map(\"ucfirst\", array_map(\"strtolower\", explode(\"-\", $str))));\n }\n return $str;\n }", "abstract public function getGroupName();", "function makeformatstring($names){\n\t$formatstring = '';\n foreach ($names as $name=>$type) {\n \tif($type=='@'){\n \t\t$formatstring .= $type.substr($name,2).\"/\";\n \t} else {\n \t\t$formatstring .= $type.$name.\"/\";\n \t}\n \t\n }\n return $formatstring;\n}", "public function getFormatNameAttribute()\n {\n $name = $this->car_mark->name .' '. $this->car_model->name .' '. $this->year_begin;\n //todo\n // In the future, the name will contain the country. But now the functionality of the country's work has not been approved. When it is approved how the country is assigned to the product, then this code will be uncommented\n// if(!empty($this->country_id)) {\n// $name = $name .'('.__('main.car_from').' '.$this->country->name.')';\n// }\n return $name;\n }", "public function _convertToNameFormat($id)\n\t{\n\t\treturn preg_replace('/\\.([A-Za-z0-9_\\-]+)/', '[$1]', $id);\n\t}", "public function prefixName($name, $separator = \".\", $greet = \"Dear\") {\r\n if ($name == \"John Doe\") {\r\n $prefix = \"Mr\";\r\n } elseif ($name == \"Jane Doe\") {\r\n $prefix = \"Mrs\";\r\n } else {\r\n $prefix = \"\";\r\n }\r\n return \"{$greet} {$prefix}{$separator} {$name}\";\r\n }", "function faculty_get_faculty_name( $format = 'short', $id = null ) {\n $name = get_field( 'name', $id );\n $first = empty( $name[0]['first'] ) ? '' : $name[0]['first'];\n $middle = empty( $name[0]['middle'] ) ? '' : $name[0]['middle'];\n $last = empty( $name[0]['last'] ) ? '' : $name[0]['last'];\n $prefix = empty( $name[0]['prefix'] ) ? '' : $name[0]['prefix'];\n $suffix = empty( $name[0]['suffix'] ) ? '' : $name[0]['suffix'];\n\n if ( $format == 'formal' ) {\n if ( ! empty( $suffix ) ) {\n return $prefix . ' ' . $first . ' ' . $last . ', ' . $suffix;\n } else {\n return $prefix . ' ' . $first . ' ' . $last;\n }\n } elseif ( $format == 'full' ) {\n return $first . ' ' . $middle . ' ' . $last;\n } else {\n return $first . ' ' . $last;\n }\n}", "function Name(){\n\t\tif(!$this->title) {\n\t\t\t$fs = $this->FieldSet();\n\t\t\t$compositeTitle = '';\n\t\t\t$count = 0;\n\t\t\tforeach($fs as $subfield){\n\t\t\t\t$compositeTitle .= $subfield->Name();\n\t\t\t\tif($subfield->Name()) $count++;\n\t\t\t}\n\t\t\tif($count == 1) $compositeTitle .= 'Group';\n\t\t\treturn ereg_replace(\"[^a-zA-Z0-9]+\",\"\",$compositeTitle);\n\t\t}\n\n\t\treturn ereg_replace(\"[^a-zA-Z0-9]+\",\"\",$this->title);\t\n\t}", "abstract function normalizedName();", "private function nameify($name) {\n return sprintf('%s[%s]', $this->namebase(), $name);\n }" ]
[ "0.7272613", "0.72037756", "0.65467787", "0.6517537", "0.64772165", "0.6327596", "0.6327596", "0.6211675", "0.6166117", "0.61619455", "0.61562914", "0.6134823", "0.6040787", "0.6005512", "0.6001644", "0.5975976", "0.57749987", "0.5724283", "0.5714113", "0.5710126", "0.5709448", "0.57089543", "0.5704364", "0.5691666", "0.5681677", "0.5641017", "0.5638905", "0.5632076", "0.5630216", "0.56081367" ]
0.79561496
0
/ text_tidy: Takes raw text from the DB and makes it all nice and pretty which also parses unHTML'd characters. Use this with caution! / Takes raw text from the DB and makes it all nice and pretty which also parses unHTML'd characters. Use this with caution!
function text_tidy($txt = "") { $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip($trans); $txt = strtr( $txt, $trans ); $txt = preg_replace( "/\s{2}/" , "&nbsp; " , $txt ); $txt = preg_replace( "/\r/" , "\n" , $txt ); $txt = preg_replace( "/\t/" , "&nbsp;&nbsp;" , $txt ); //$txt = preg_replace( "/\\n/" , "&#92;n" , $txt ); return $txt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _tidy_cleanup_callback($text = '')\n {\n if ( ! class_exists('tidy') || ! extension_loaded('tidy')) {\n return $text;\n }\n $tidy_default_config = [\n 'alt-text' => '',\n 'output-xhtml' => true,\n ];\n $tidy = new tidy();\n $tidy->parseString($text, $this->_TIDY_CONFIG ?: $tidy_default_config, conf('charset'));\n $tidy->cleanRepair();\n return $tidy;\n }", "function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')){ \n tidy_set_encoding(\"{$this->_options[\"Encoding\"]}\"); \n foreach($this->_tidy_config as $k => $v) { \n tidy_setopt($k, $v); \n } \n tidy_parse_string($this->_html); \n tidy_clean_repair(); \n $this->_html = tidy_get_output(); \n } \n else { \n error_log(\"Tidy is not supported on this platform. Basic Cleaning is applied.\"); \n } \n } \n else { \n $tidy = new tidy; \n $tidy -> parseString($this->_html, $this->_tidy_config, \"{$this->_options[\"Encoding\"]}\"); \n $tidy -> cleanRepair(); \n $this -> html = $tidy; \n } \n }", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\r\n }", "function make_safe($text) {\n\t// make_safe MUST be called AFTER db_connect()\n\t// database must be connected to use escape string function\n\t\n\t$text = stripslashes($text);\n\t$text = htmlentities($text);\n\t$text = strip_tags($text);\n\t$text = $GLOBALS['db_connection'] -> real_escape_string($text);\n\treturn $text;\n}", "function tidy_str($str)\n\t{\n\t\tglobal $_CONFIG;\n\t\tif ($_CONFIG->tidy_html__or(true)) {\n\t\t\t$tidy = new tidy();\n\t\t\t$tidy->parseString($str, $_CONFIG->tidy_config__or(array()));\n\t\t\tif ($tidy->cleanRepair()) {\n\t\t\t\tfb(tidy_get_error_buffer($tidy), 'Tidy Errors');\n\t\t\t\treturn (string)$tidy;\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "function template_text_format($text)\n {\n // Remove Escape Character Slashes\n $text = trim(stripslashes($text));\n // Get rid of carriage returns\n $text = str_replace(\"\\r\",\"\",$text);\n // Strip out all html except simple text formatting\n $text = htmlentities($text);\n // Convert urls to hyperlinks\n $text = eregi_replace(\"((http://)|(https://).[^\\s]+)\\ \",\"<a href=\\\"\\\\0\\\">\\\\0</a>\",$text); \n\n if ($_SESSION['prefs']['disable_wrap'] != \"t\") {\n $lines = explode(\"\\n\",$text);\n $text = \"\";\n\n $wrap = preg_match(\"/[0-9]+/\",$_SESSION['prefs']['word_wrap']) ? $_SESSION['prefs']['word_wrap'] : 80;\n foreach ($lines as $key => $val) {\n if (empty($val)) {\n $text .= \"\\n\";\n } else {\n if (strlen($val) > $wrap) {\n $val = wordwrap($val,$wrap,\"\\n\",TRUE);\n }\n\n $text .= stripslashes($val).\"\\n\";\n }\n }\n \n $text = \"<pre>$text</pre>\";\n } else {\n // Replace newlines with <br />'s\n $text = str_replace(\"\\n\",\"<br />\",$text);\n }\n return $text;\n }", "function phpTrafficA_cleanTextBasic($text) {\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "public static function txt2html($txt) {\n\n\t//Kills double spaces and spaces inside tags.\n\t// while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n if( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n\n\t$txt = str_replace(' >','>',$txt);\n\t$txt = str_replace('< ','<',$txt);\n\n\t//Transforms accents in html entities.\n\t$txt = utf8_decode($txt);\n\t$txt = htmlentities($txt);\n\n\t//We need some HTML entities back!\n\t$txt = str_replace('&quot;','\"',$txt);\n\t$txt = str_replace('&lt;','<',$txt);\n\t$txt = str_replace('&gt;','>',$txt);\n\t$txt = str_replace('&amp;','&',$txt);\n\t\n\t//Ajdusts links - anything starting with HTTP opens in a new window\n\t$txt = WA_String::stri_replace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\n\t$txt = WA_String::stri_replace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\n\n\t//Basic formatting\n\t$eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\n\t$html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\n $html = str_replace(\"$eol\",\"<br />\\n\",$html);\n\t$html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\n\t$html = str_replace(\"<p></p>\",\"<p>&nbsp;</p>\",$html);\n\n\t//Wipes <br> after block tags (for when the user includes some html in the text).\n\t$wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\n\n\tfor($x = 0; $x < count($wipebr); $x++) {\n \t $tag = $wipebr[$x];\n \t $html = WA_String::stri_replace(\"<$tag><br />\",\"<$tag>\",$html);\n \t $html = WA_String::stri_replace(\"</$tag><br />\",\"</$tag>\",$html);\n\t}\n\n\treturn $html;\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function smartify($text) {\n\t// Add hair spaces around en and em dashes.\n\t$content = preg_replace('/(\\S)(---|--|—|–)(\\S)/', '$1&#8202;$2&#8202;$3', $text);\n\t// // Parse content with smartypants\n\treturn smartypants($content);\n}", "function tidyHTML($code = '', $fullDocument = false) {\n $cmd = 'tidy -q --show-body-only 1 --indent 1 --indent-attributes 0 -w 0 --char-encoding raw';\n $descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), // // stdin est un pipe où le processus va lire\n 1 => array(\"pipe\", \"w\"), // stdout est un pipe où le processus va écrire\n 2 => array(\"file\", \"/tmp/error-output.txt\", \"a\") // stderr est un fichier\n );\n\n $cwd = '/tmp';\n $env = array();\n\n $process = proc_open($cmd, $descriptorspec, $pipes, $cwd, $env);\n\n if (is_resource($process)) {\n // $pipes ressemble à :\n // 0 => fichier accessible en écriture, connecté à l'entrée standard du processus fils\n // 1 => fichier accessible en lecture, connecté à la sortie standard du processus fils\n // Toute erreur sera ajoutée au fichier /tmp/error-output.txt\n\n // Tidy a besoin de son petit doctype quand même...\n if($fullDocument) {\n fwrite($pipes[0], $code);\n } else {\n fwrite($pipes[0], '<!doctype html><title></title><body>'.$code.'</body>');\n }\n fclose($pipes[0]);\n\n $content = stream_get_contents($pipes[1]);\n fclose($pipes[1]);\n\n // Il est important que vous fermiez les pipes avant d'appeler\n // proc_close afin d'éviter un verrouillage.\n $return_value = proc_close($process);\n\n // return $content\n return str_replace(' ', \"\\t\", $content);\n }\n}", "function tidy_clean_repair(tidy $object) {}", "function tidy_get_html(tidy $object) {}", "private function htmltidy_php() {\r\n\t\t$this->logMsg(\"=== htmltidy_php ===\");\r\n\t\tif(!is_callable('tidy_parse_string')) {\r\n\t\t\t$this->logMsg('tidy_parse_string() is not callable! Maybe the tidy extension is not installed.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// added (2011-06-29)\r\n\t\tif($this->WET === \"WET\" || $this->config['WET'] === \"WET\") {\r\n\t\t\t$this->config['htmltidy']['anchor-as-name'] = 0;\r\n\t\t}\r\n\t\tReTidy::set_HTML5();\r\n\t\t//ReTidy::tidy_comments();\r\n\t\tReTidy::encode_character_entities_in_comments();\r\n\t\t$tidy = tidy_parse_string($this->code, $this->config['htmltidy'], $this->config['htmltidy']['input-encoding']);\r\n\t\t//var_dump($tidy); // tidy error reporting\r\n\t\tif(!$tidy) {\r\n\t\t\t$this->logMsg('tidy_parse_string() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!$tidy->cleanRepair()) {\r\n\t\t\t$this->logMsg('$tidy->cleanRepair() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->logMsg('Status: '. $tidy->getStatus() . \"\\nErrors: \" . tidy_error_count($tidy) . \"\\nWarnings: \" . tidy_warning_count($tidy));\r\n\t\tif($this->config['show_tidy_errors']) {\r\n\t\t\t$this->logMsg(\"--- Error buffer --- \\n\" . $tidy->errorBuffer . \"\\n --- Error buffer end ---\");\r\n\t\t}\r\n\t\t$this->code = tidy_get_output($tidy);\r\n\t\tif(!$this->code) {\r\n\t\t\t$this->logMsg('Warning! HTML Tidy output is empty.');\r\n\t\t}\r\n\t\t// perhaps we should just say if not utf8?\r\n\t\tif(($this->config['encoding'] === \"iso-8859-1\" ||\r\n\t\t$this->config['encoding'] === \"us-ascii\" ||\r\n\t\t$this->config['encoding'] === \"windows-1252\") && $this->config['do_not_encode_character_entities'] !== true) {\r\n\t\t\tReTidy::encode_character_entities();\r\n\t\t}\r\n\t\t// HTML5 specific fix (tidy and basically everything else do not support HTML5)\r\n\t\t//var_dump($this->config['HTML5']);\r\n\t\t//var_dump($this->config);\r\n\t\t//var_dump(ReTidy::get_HTML5());\r\n\t\tif(ReTidy::get_HTML5()) {\r\n\t\t\t//print(\"here--4300--2\");\r\n\t\t\t$this->code = ReTidy::str_replace_first('<meta />', '<meta charset=\"' . $this->config['encoding'] . '\" />', $this->code);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function unformatText ($text) {\n\treturn html_entity_decode (strip_tags ($text), ENT_COMPAT, 'UTF-8');\n}", "public function sOptimizeText($text)\n {\n $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');\n $text = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $text);\n $text = preg_replace('!<[^>]*?>!u', ' ', $text);\n $text = preg_replace('/\\s\\s+/u', ' ', $text);\n $text = trim($text);\n\n return $text;\n }", "private function normalizeMarkedUpText( $wikiText ) {\n\t\t$wikiText = $this->safeUnicodeOutput( $wikiText );\n\t\treturn $this->addNewLineAtEnd( $wikiText );\n\t}", "function xmltidy( $content ) {\r\n if (extension_loaded('tidy')) {\r\n $config = array( 'input-xml'=>true, 'output-xml'=>true, 'indent'=>true, 'wrap'=>0 );\r\n $tidy = new tidy;\r\n $tidy->parseString($content, $config, 'utf8');\r\n $tidy->cleanRepair();\r\n return $tidy->value;\r\n }\r\n else {\r\n return $content;\r\n }\r\n }", "function phpTrafficA_cleanText($text) {\n$text = str_replace(\"&\", \"&amp;\", $text);\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function apachesolr_clean_text($text) {\r\n // Add spaces before stripping tags to avoid running words together.\r\n $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());\r\n // Decode entities and then make safe any < or > characters.\r\n return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');\r\n}", "function sanitize($data) \n{\n\treturn htmlentities(strip_tags(mysql_real_escape_string($data)));\n}", "function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}", "function sanitize($data) {\n return htmlentities(strip_tags(mysql_real_escape_string($data)));\n }", "function tidy_is_xhtml(tidy $object) {}", "public static function texturize($text) {\n\t\t$next = true;\n\t\t$output = '';\n\t\t$curl = '';\n\t\t$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t$stop = count($textarr);\n\t\n\t\t$static_characters = array_merge(array('---', ' -- ', '--', 'xn&#8211;', '...', '``', '\\'s', '\\'\\'', ' (tm)'), $cockney); \n\t\t$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', 'xn--', '&#8230;', '&#8220;', '&#8217;s', '&#8221;', ' &#8482;'), $cockneyreplace);\n\t\n\t\t$dynamic_characters = array('/\\'(\\d\\d(?:&#8217;|\\')?s)/', '/(\\s|\\A|\")\\'/', '/(\\d+)\"/', '/(\\d+)\\'/', '/(\\S)\\'([^\\'\\s])/', '/(\\s|\\A)\"(?!\\s)/', '/\"(\\s|\\S|\\Z)/', '/\\'([\\s.]|\\Z)/', '/(\\d+)x(\\d+)/');\n\t\t$dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1&#8220;$2', '&#8221;$1', '&#8217;$1', '$1&#215;$2');\n\t\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$curl = $textarr[$i];\n\t\n\t\t\tif (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag\n\t\t\t\t// static strings\n\t\t\t\t$curl = str_replace($static_characters, $static_replacements, $curl);\n\t\t\t\t// regular expressions\n\t\t\t\t$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);\n\t\t\t} elseif (strpos($curl, '<code') !== false || strpos($curl, '<pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) {\n\t\t\t\t$next = false;\n\t\t\t} else {\n\t\t\t\t$next = true;\n\t\t\t}\n\t\n\t\t\t$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);\n\t\t\t$output .= $curl;\n\t\t}\n\t\n\t\treturn $output;\n\t}", "function normalizeString(string $text)\n{\n $text = preg_replace('/\\n|^\\'|\\'$|^\\\"|\\\"$/', '', $text);\n $text = preg_replace('/\\s+/', ' ', $text);\n return $text;\n}", "function text($text) {\n\t\t// Removing html tags\n\t\t$text = strip_tags($text);\n\t\t// Removing line breaks and tabs\n\t\t$text = preg_replace('/[\\n\\r\\t]+/',' ',$text);\n\t\t// Removing extra spaces\n\t\t$text = preg_replace('/ {2,}/',' ',$text);\n\t\treturn $text;\n\t}", "function _sanitize_text_fields($str, $keep_newlines = \\false)\n {\n }" ]
[ "0.67308736", "0.66743225", "0.6578449", "0.6482732", "0.64156663", "0.6259048", "0.6259048", "0.61170304", "0.6088428", "0.60818374", "0.60723275", "0.60427237", "0.5961922", "0.5941549", "0.5933677", "0.59253585", "0.58589697", "0.585109", "0.5800855", "0.5782319", "0.57571983", "0.5756579", "0.5751061", "0.5745693", "0.5738359", "0.5735277", "0.5732903", "0.57310927", "0.57241786", "0.5722335" ]
0.7109709
0
/ Build up page span links / Build up page span links
function build_pagelinks($data) { $data['leave_out'] = isset($data['leave_out']) ? $data['leave_out'] : ''; $data['no_dropdown'] = isset($data['no_dropdown']) ? intval( $data['no_dropdown'] ) : 0; $data['USE_ST'] = isset($data['USE_ST']) ? $data['USE_ST'] : ''; $work = array( 'pages' => 0, 'page_span' => '', 'st_dots' => '', 'end_dots' => '' ); $section = !$data['leave_out'] ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10 $use_st = !$data['USE_ST'] ? 'st' : $data['USE_ST']; //----------------------------------------- // Get the number of pages //----------------------------------------- if ( $data['TOTAL_POSS'] > 0 ) { $work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] ); } $work['pages'] = $work['pages'] ? $work['pages'] : 1; //----------------------------------------- // Set up //----------------------------------------- $work['total_page'] = $work['pages']; $work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1; //----------------------------------------- // Next / Previous page linkie poos //----------------------------------------- $previous_link = ""; $next_link = ""; if ( $work['current_page'] > 1 ) { $start = $data['CUR_ST_VAL'] - $data['PER_PAGE']; $previous_link = $this->compiled_templates['skin_global']->pagination_previous_link("{$data['BASE_URL']}&amp;$use_st=$start"); } if ( $work['current_page'] < $work['pages'] ) { $start = $data['CUR_ST_VAL'] + $data['PER_PAGE']; $next_link = $this->compiled_templates['skin_global']->pagination_next_link("{$data['BASE_URL']}&amp;$use_st=$start"); } //----------------------------------------- // Loppy loo //----------------------------------------- if ($work['pages'] > 1) { $work['first_page'] = $this->compiled_templates['skin_global']->pagination_make_jump($work['pages'], $data['no_dropdown']); if ( 1 < ($work['current_page'] - $section)) { $work['st_dots'] = $this->compiled_templates['skin_global']->pagination_start_dots($data['BASE_URL']); } for( $i = 0, $j= $work['pages'] - 1; $i <= $j; ++$i ) { $RealNo = $i * $data['PER_PAGE']; $PageNo = $i+1; if ($RealNo == $data['CUR_ST_VAL']) { $work['page_span'] .= $this->compiled_templates['skin_global']->pagination_current_page( ceil( $PageNo ) ); } else { if ($PageNo < ($work['current_page'] - $section)) { // Instead of just looping as many times as necessary doing nothing to get to the next appropriate number, let's just skip there now $i = $work['current_page'] - $section - 2; continue; } // If the next page is out of our section range, add some dotty dots! if ($PageNo > ($work['current_page'] + $section)) { $work['end_dots'] = $this->compiled_templates['skin_global']->pagination_end_dots("{$data['BASE_URL']}&amp;$use_st=".($work['pages']-1) * $data['PER_PAGE']); break; } $work['page_span'] .= $this->compiled_templates['skin_global']->pagination_page_link("{$data['BASE_URL']}&amp;$use_st={$RealNo}", ceil( $PageNo ) ); } } $work['return'] = $this->compiled_templates['skin_global']->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL'], $data['no_dropdown'], $use_st); } else { $work['return'] = $data['L_SINGLE']; } return $work['return']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateLinks()\n\t{\n\t\t// Additional pages are the total minus the current page\n\t\t$iAdditional\t= $this->iToShow - 1;\n\n\t\t// Figure out how many additional pages to show\n\t\t$iToShow\t\t= ($this->iTotal <= $iAdditional) ? ($this->iTotal - 1) : $iAdditional;\n\n\t\t// Get the pre and post lengths\n\t\tif($iToShow % 2 == 0) {\n\t\t\t$iPre\t= $iToShow / 2;\n\t\t\t$iPost\t= $iPre;\n\t\t} else {\n\t\t\t$iPre\t= floor($iToShow / 2);\n\t\t\t$iPost\t= $iPre + 1;\n\t\t}\n\n\t\t// If the current page is less than the pre pages\n\t\tif($this->iPage <= $iPre)\n\t\t{\n\t\t\t$iPre\t= $this->iPage - 1;\n\t\t\t$iPost\t= $iToShow - $iPre;\n\t\t}\n\t\t// Else if the total pages minus the current page is less than the\n\t\t//\tpost pages\n\t\tif($this->iTotal - $this->iPage <= $iPost)\n\t\t{\n\t\t\t$iPost\t= $this->iTotal - $this->iPage;\n\t\t\t$iPre\t= $iToShow - $iPost;\n\t\t}\n\n\t\t// Init the links array\n\t\t$this->aLinks\t= array(\n\t\t\t'previous'\t\t=> false,\n\t\t\t'first'\t\t\t=> false,\n\t\t\t'pre'\t\t\t=> array(),\n\t\t\t'current'\t\t=> '',\n\t\t\t'post'\t\t\t=> array(),\n\t\t\t'last'\t\t\t=> false,\n\t\t\t'next'\t\t\t=> false\n\t\t);\n\n\t\t// If the page isn't 1\n\t\tif($this->iPage > 1)\n\t\t{\n\t\t\t// Add the previous button\n\t\t\t$this->aLinks['previous'] = array(\n\t\t\t\t'text'\t=> $this->iPage - 1,\n\t\t\t\t'url'\t=> (($this->iPage - 1 == 1) ? $this->aOptions['primary_url'] : $this->sURL . ($this->iPage - 1) . '/') . $this->sQuery,\n\t\t\t\t'index' => (($this->iPage - 1) > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the page is greater than the pre length\n\t\tif($this->iPage - 1 > $iPre)\n\t\t{\n\t\t\t// Add the first page\n\t\t\t$this->aLinks['first'] = array(\n\t\t\t\t'text'\t=> 1,\n\t\t\t\t'url'\t=> $this->aOptions['primary_url'] . $this->sQuery,\n\t\t\t\t'index' => (1 > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// Add the previous pages\n\t\tfor($i = $this->iPage - $iPre; $i < $this->iPage; ++$i)\n\t\t{\n\t\t\t$this->aLinks['pre'][]\t= array(\n\t\t\t\t'text'\t=> $i,\n\t\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t\t'index' => ($i > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// Add the current page\n\t\t$this->aLinks['current'] = array(\n\t\t\t'text'\t=> $this->iPage,\n\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t'index' => ($this->iPage > $this->aOptions['index_limit']) ? false : true\n\t\t);\n\n\t\t// Add the next pages\n\t\t$iForCond\t= $this->iPage + $iPost + 1;\n\t\tfor($i = $this->iPage + 1; $i < $iForCond; ++$i)\n\t\t{\n\t\t\t$this->aLinks['post'][] = array(\n\t\t\t\t'text'\t=> $i,\n\t\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t\t'index' => ($i > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the last page isn't visible\n\t\tif($this->iTotal > $this->iPage + $iPost)\n\t\t{\n\t\t\t// And the last page\n\t\t\t$this->aLinks['last']\t= array(\n\t\t\t\t'text'\t=> $this->iTotal,\n\t\t\t\t'url'\t=> $this->sURL . $this->iTotal . '/' . $this->sQuery,\n\t\t\t\t'index' => ($this->iTotal > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the current page isn't the last page\n\t\tif($this->iTotal != $this->iPage)\n\t\t{\n\t\t\t// Show the next page\n\t\t\t$this->aLinks['next']\t= array(\n\t\t\t\t'text'\t=> $this->iPage + 1,\n\t\t\t\t'url'\t=> $this->sURL . ($this->iPage + 1) . '/' . $this->sQuery,\n\t\t\t\t'index' => (($this->iPage + 1) > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\t}", "protected function createPageLinks()\n {\n $pageLinks = array();\n\n if ($this->totalPages > 10) {\n $startRange = $this->page - floor($this->range/2);\n $endRange = $this->page + floor($this->range/2);\n\n //Start range\n if ($startRange <= 0) {\n $startRange = 1;\n $endRange += abs($startRange) + 1;\n }\n\n // End range\n if ($endRange > $this->totalPages) {\n $startRange -= $endRange - $this->totalPages;\n $endRange = $this->totalPages;\n }\n\n // Range\n $range = range($startRange, $endRange);\n\n // Add first page\n $this->pageLinks[] = array(\n 'page' => 1,\n 'uri' => $this->createUri(1)\n );\n\n foreach ($range as $page) {\n // Skip for first and last page\n if ($page == 1 or $page == $this->totalPages) {\n continue;\n }\n\n $this->pageLinks[] = array(\n 'page' => $page,\n 'uri' => $this->createUri($page)\n );\n }\n\n // Add last page\n $this->pageLinks[] = array(\n 'page' => $this->totalPages,\n 'uri' => $this->createUri($this->totalPages)\n );\n } else {\n for ($i = 1; $i <= $this->totalPages; $i++) {\n $this->pageLinks[] = array(\n 'page' => $i,\n 'uri' => $this->createUri($i)\n );\n }\n }\n }", "function show_page_links($base_url, $num_items, $per_page, $page)\n{\n //$base_url contains the address of the page and the order it is called with\n //e.g., 'asc' or 'desc' - the page handles this so we have to worry about it.\n\n $total_pages = ceil($num_items/$per_page);\n\n if ($total_pages == 1)\n {\n return '';\n }\n\n //initialize our $page_string variable wich will hold the links\n $page_string = '<p><span class=\"page_numbers\">';\n\n //SHOW UP TO 4 LINKS ON EITHER SIDE OF THE CURRENT PAGE\n\n //get the number of page links are available after the current page\n $num_succeeding_links = $total_pages - $page;\n\n //get the number of preceding links available before the current page\n $num_preceding_links = $page -1;\n\n //calculate our start and end values\n $start = $page - 4;\n if ( $start < 1)\n {\n $start = 1;\n }\n //if we have less than 10 total_page, use the number we have ($total_pages)\n $end = $total_pages;\n //but if end is more than 9 higher than $start, make $end 9 higher than $start\n //we only want to show 10 records per page (e.g., 1..10)\n if ( ($end - $start) > 9 )\n {\n $end= $start + 9;\n }\n\n //if the total number of succeeding links exceeds 4 show 4 and a >> at the end\n //the >> at the end is just the 5th succeeding link\n //do the same for preceding links if they are more than 4\n if ($total_pages > 10 && $page > 1) //don't show first page link except when we're not the first page\n {\n //create a << which points to the first page\n $page_string .= '<a title=\"first page\" href=\"'.$base_url.'&page=1\">&lt;&lt;</a>&nbsp;&nbsp;';\n //create a < which points to the current page -1 (shifts us left one)\n $val = $page-1;\n $page_string .= '<a title=\"previous page\" href=\"'.$base_url.'&page='.$val.'\">&lt;</a>&nbsp;&nbsp;';\n }\n for ($i=$start; $i<=$end; $i++)\n {\n if ($i == $page)\n {\n $page_string .= \" <b>[$i]</b> \";\n }\n else\n {\n $page_string .= ' <a title=\"page ' . $i . '\" href=\"'.$base_url.'&page='.$i.'\">'.$i.'</a> ';\n }\n }\n if ($total_pages > 10 && $page < $total_pages) //don't show last page link except when we're not on the last page\n {\n //create a > which points to the current page +1 (shifts us right one)\n $val = $page + 1;\n $page_string .= '&nbsp;&nbsp;<a title=\"next page\" href=\"'.$base_url.'&page='.$val.'\">&gt</a>';\n\n //create a >> which point to the last page\n $page_string .= '&nbsp;&nbsp;<a title=\"last page\" href=\"'.$base_url.'&page='.$total_pages.'\">&gt;&gt</a> ';\n }\n\n $page_string .= '</span></p>';\n\n return $page_string;\n\n}", "function create_links()\n\t{\n\t\t$totalItems = $this->total_records;\n\t\t$perPage = $this->size;\n\t\t$currentPage = $this->page;\n\t\t$link = $this->link;\n\t\t$totalPages = floor($totalItems / $perPage);\n\t\t$totalPages += ($totalItems % $perPage != 0) ? 1 : 0;\n\n\t\tif ($totalPages < 1 || $totalPages == 1){\n\t\t\treturn null;\n\t\t}\n\n\t\t$output = null;\t\t\t\t\n\t\t$loopStart = 1; \n\t\t$loopEnd = $totalPages;\n\n\t\tif ($totalPages > 5)\n\t\t{\n\t\t\tif ($currentPage <= 3)\n\t\t\t{\n\t\t\t\t$loopStart = 1;\n\t\t\t\t$loopEnd = 5;\n\t\t\t}\n\t\t\telse if ($currentPage >= $totalPages - 2)\n\t\t\t{\n\t\t\t\t$loopStart = $totalPages - 4;\n\t\t\t\t$loopEnd = $totalPages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loopStart = $currentPage - 2;\n\t\t\t\t$loopEnd = $currentPage + 2;\n\t\t\t}\n\t\t}\n\n\t\tif ($loopStart != 1){\n\t\t\t$output .= sprintf('<li class=\"disabledpage\"> <a href=\"' . $link . '\">&#171;</a> </li>', '1');\n\t\t}\n\t\t\n\t\tif ($currentPage > 1){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._previous_.'</a> </li>', $currentPage - 1);\n\t\t}\n\t\t\n\t\tfor ($i = $loopStart; $i <= $loopEnd; $i++)\n\t\t{\n\t\t\tif ($i == $currentPage){\n\t\t\t\t$output .= '<li class=\"currentpage\">' . $i . '</li> ';\n\t\t\t} else {\n\t\t\t\t$output .= sprintf('<li><a href=\"' . $link . '\">', $i) . $i . '</a> </li> ';\n\t\t\t}\n\t\t}\n\n\t\tif ($currentPage < $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._next_.'</a> </li>', $currentPage + 1);\n\t\t}\n\t\t\n\t\tif ($loopEnd != $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">&#187;</a> </li>', $totalPages);\n\t\t}\n\n\t\treturn '<div class=\"pagination\"><ul>' . $output . '</ul></div>';\n\t}", "function numbered_in_page_links( $args = array () )\n{\n $defaults = array(\n 'before' => '<div class=\"page-links\"><i class=\"icon-menu-3 pageLinksToggle\"></i><ul class=\"subpage-list\">' \n , 'after' => '</ul></div>'\n , 'link_before' => '<li>'\n , 'link_after' => '</li>'\n , 'pagelink' => '%'\n , 'echo' => 1\n // element for the current page\n , 'highlight' => 'b'\n );\n\n $r = wp_parse_args( $args, $defaults );\n $r = apply_filters( 'wp_link_pages_args', $r );\n extract( $r, EXTR_SKIP );\n\n global $page, $numpages, $multipage, $more, $pagenow;\n\n if ( ! $multipage )\n {\n return;\n }\n\n $output = $before;\n\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\n {\n $j = str_replace( '%', $i, $pagelink );\n $output .= ' ';\n\n if ( $i != $page || ( ! $more && 1 == $page ) )\n {\n $output .= \"{$link_before}\". _wp_link_page( $i ) . \"{$j}</a>{$link_after}\";\n }\n else\n { // highlight the current page\n // not sure if we need $link_before and $link_after\n $output .= \"{$link_before}<$highlight>{$j}</$highlight>{$link_after}\";\n }\n }\n\n print $output . $after;\n}", "function link_pages($before = '<br />', $after = '<br />', $next_or_number = 'number', $nextpagelink = 'next page', $previouspagelink = 'previous page', $pagelink = '%', $more_file = '')\n {\n }", "function page_links($url, $nitems, $items_per_page, $start){\n // How many pages to potentially show before and after this one:\n $preshow = 3;\n $postshow = 3;\n\n $x = \"\";\n \n if ($nitems <= $items_per_page) return \"\";\n $npages = ceil($nitems / $items_per_page);\n $curpage = ceil($start / $items_per_page);\n\n // If this is not the first page, display \"previous\"\n //\n if ($curpage > 0){\n $x .= page_link(\n $url, $curpage-1, $items_per_page,\n tra(\"Previous\").\" &middot; \"\n );\n }\n\n if ($curpage - $preshow > 0) {\n $x .= page_link($url, 0, $items_per_page, \"1\");\n if ($curpage - $preshow > 1) {\n $x .= \" . . . \";\n } else {\n $x .= \" &middot; \";\n }\n }\n // Display a list of pages surrounding this one\n //\n for ($i=$curpage-$preshow; $i<=$curpage+$postshow; $i++){\n $page_str = (string)($i+1);\n if ($i < 0) continue;\n if ($i >= $npages) break;\n\n if ($i == $curpage) {\n $x .= \"<b>$page_str</b>\";\n } else {\n $x .= page_link($url, $i, $items_per_page, $page_str);\n }\n if ($i == $npages-1) break;\n if ($i == $curpage+$postshow) break;\n $x .= \" &middot; \";\n }\n\n if ($curpage + $postshow < $npages-1) {\n $x .= \" . . . \";\n $x .= page_link($url, $npages-1, $items_per_page, $npages);\n }\n // If there is a next page\n //\n if ($curpage < $npages-1){\n $x .= page_link(\n $url, $curpage+1, $items_per_page,\n \" &middot; \".tra(\"Next\")\n );\n }\n $x .= \"\\n\";\n return $x;\n}", "public function provideTestLinks() {\n\t\t$extraPages = [\n\t\t\t'Elephant Page' => 'Content'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to redirect to content page without display title\n\t\t$extraPages = [\n\t\t\t'Elephant Page' => 'Content',\n\t\t\t'Redirect To Elephant Page' => '#REDIRECT [[Elephant Page]]'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Redirect_To_Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to user page without display title\n\t\t$extraPages = [\n\t\t\t'User:Elephant Page' => 'Content'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to content page with display title\n\t\t$extraPages = [\n\t\t\t'Dingo Page' => '{{DISPLAYTITLE:Zebra}}'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to redirect to content page with display title\n\t\t$extraPages = [\n\t\t\t'Dingo Page' => '{{DISPLAYTITLE:Zebra}}',\n\t\t\t'Redirect To Dingo Page' => '#REDIRECT [[Dingo Page]]'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Redirect_To_Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to user page with display title\n\t\t$extraPages = [\n\t\t\t'User:Dingo Page' => '{{DISPLAYTITLE:Zebra}}'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\t}", "function create_links()\n\t{\n\t\t$output = '';\n\t\t\n\t\t/*if($this->block > 1){\n\t\t\t$this->prev = $this->first-1; \n\t\t\t$output .= '<a href=\"'.$this->url.'/page/1\" class=\"pBtn prev2\">처음</a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"class=\"pBtn prev2\">처음</a>'.chr(10);\n }*/\n\n\t\tif($this->page>1){\n\t\t\t$this->go_page=$this->page-1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->go_page.$this->querystring.'\"><img src=\"'.$this->theme.'/images/prev1.gif\" alt=\"Prev\" /></a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"><img src=\"'.$this->theme.'/images/prev1.gif\" alt=\"Prev\" /></a>'.chr(10);\n\t\t}\n\t\t\n\t\t$pgNum = '';\n\t\tfor($this->pagelnk=$this->first+1; $this->pagelnk <= $this->last; $this->pagelnk++)\n\t\t{\n\t\t\tif($this->first+1 < $this->pagelnk) $pgNum .= \"\t\"; \n\t\t\tif($this->pagelnk==$this->page){\n\t\t\t\t$pgNum .='<strong>'.$this->pagelnk.'</strong>'.chr(10);\n\t\t\t}else{\n\t\t\t\t$pgNum .='<a href=\"'.$this->url.'/page/'.$this->pagelnk.$this->querystring.'\">'.$this->pagelnk.'</a>'.chr(10);\n\t\t\t}\n \n if($this->paglnk!=$this->first+1 && $this->paglnk!=$this->last){\n $pgNum .= '';\n }\n\t\t}\n\t\t\n\t\t//$output .= $pgNum;\n $output .= '<span class=\"num\">'.$pgNum.'</span>';\n\n\t\tif($this->total_page>$this->page){\n\t\t\t$this->go_page=$this->page+1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->go_page.$this->querystring.'\"><img src=\"'.$this->theme.'/images/next1.gif\" alt=\"Next\" /></a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"><img src=\"'.$this->theme.'/images/next1.gif\" alt=\"Next\" /></a>'.chr(10);\n\t\t}\n\n\t\t/*if($this->block < $this->total_block){\n\t\t\t$this->next=$this->last+1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->total_page.'\" class=\"pBtn next2\">마지막</a>';\n\t\t}else{\n $output .= '<a href=\"javascript:void(0);\" class=\"pBtn next2\">마지막</a>';\n }*/\n\t\t\n\t\tif($this->total_page <= 1) $output =null;\n\n\t\treturn $output;\n\t}", "function create_links() {\n $total_rows = $this->total_rows;\n if ($total_rows == 0) {\n return '';\n }\n\n // Calculate the total number of pages\n $CI = & get_instance();\n $_quantity = $CI->_quantity;\n $per_page = $this->per_page;\n $num_pages = ceil($total_rows / $per_page);\n\n // Is there only one page? Hm... nothing more to do here then.\n if ($num_pages == 1) {\n return '';\n }\n\n // Determine the current page number.\n $_offset = $CI->_offset;\n $cur_page = $_quantity == -1 ? -1 : floor($CI->_offset / $per_page) + 1;\n\n // And here we go...\n $output = '';\n\n // Render the \"First\" link\n if ($cur_page != 1) {\n $i = 0;\n $output .= $this->first_tag_open . $i . $this->first_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"previous\" link\n if ($cur_page != 1 && $_quantity != -1) {\n $i = $_offset - $per_page;\n $output .= $this->prev_tag_open . $i . $this->prev_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Write the digit links\n $output .= \"<select tabindex='-1'>\";\n $start = 1;\n $end = $per_page;\n if ($_quantity == -1)\n $output .= '<option selected=\"selected\" > - </option>';\n for ($loop = 1; $loop <= $num_pages; $loop++) {\n if ($end > $total_rows)\n $end = $total_rows;\n $output .= '<option value=\"' . (($loop - 1) * $per_page) . '\" ' . ($loop == $cur_page ? \"selected='selected'\" : \"\") . ' >Trang ' . $loop . '/' . $num_pages . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $start . \"-\" . $end . '/' . $total_rows . '</option>';\n $start+=$per_page;\n $end+=$per_page;\n }\n $output .= \"</select>\";\n\n // Render the \"next\" link\n if ($cur_page != $num_pages && $_quantity != -1) {\n $i = $_offset + $per_page;\n $output .= $this->next_tag_open . $i . $this->next_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"Last\" link\n if ($cur_page != $num_pages) {\n $i = ($num_pages - 1) * $per_page;\n $output .= $this->last_tag_open . $i . $this->last_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Add the wrapper HTML if exists\n $output = $this->full_tag_open . $output . str_replace(array(\"{class}\", \"{style}\"), array(($_quantity == -1 ? \"ui-state-hover\" : \"icon\"), ($_quantity == -1 ? \"cursor:default\" : \"\")), $this->full_tag_close);\n\n return $output;\n }", "public function create_links()\n {\n $totalPages = floor($this->total_records / $this->size);\n $totalPages += ($this->total_records % $this->size != 0) ? 1 : 0;\n if($totalPages < 1 || $totalPages == 1)\n return null;\n $output = null;\n $loopStart = 1;\n $loopEnd = $totalPages;\n if($totalPages > 5){\n if($this->page <= 3){\n $loopStart = 1;\n $loopEnd = 5;\n } else if($this->page >= $totalPages - 2){\n $loopStart = $totalPages - 4;\n $loopEnd = $totalPages;\n } else{\n $loopStart = $this->page - 2;\n $loopEnd = $this->page + 2;\n }\n }\n if($loopStart != 1){\n $output .= sprintf('<a id=\"back\" href=\"' . $this->link . '\">&#171;</a>', '1');\n }\n if($this->page > 1){\n $output .= sprintf('<a id=\"prev\" href=\"' . $this->link . '\">' . __('Previous') . '</a>', $this->page - 1);\n }\n for($i = $loopStart; $i <= $loopEnd; $i++){\n if($i == $this->page){\n $output .= '<a class=\"on\">' . $i . '</a>';\n } else{\n $output .= sprintf('<a href=\"' . $this->link . '\">', $i) . $i . '</a>';\n }\n }\n if($this->page < $totalPages){\n $output .= sprintf('<a id=\"next\" href=\"' . $this->link . '\">' . __('Next') . '</a>', $this->page + 1);\n }\n if($loopEnd != $totalPages){\n $output .= sprintf('<a id=\"forward\" href=\"' . $this->link . '\">&#187;</a>', $totalPages);\n }\n return '<div id=\"pagination\"><ul><li>' . $output . '</li></ul></div>';\n }", "function truethemes_link_pages($args = '') {\n\n$defaults = array(\n 'before' => '<div class=\"karma-pages\">',\n 'after' => '</div>',\n 'link_before' => '<span class=\"page\">',\n 'link_after' => '</span>',\n 'next_or_number' => 'number',\n\t'pagelink' => '%'\n);\n\n\t$r = wp_parse_args( $args, $defaults );\n\t$r = apply_filters( 'wp_link_pages_args', $r );\n\textract( $r, EXTR_SKIP );\n\n\tglobal $page, $numpages, $multipage, $more, $pagenow;\n\t \n\t$output = '';\n\tif ( $multipage ) {\n\t\tif ( 'number' == $next_or_number ) {\n\t\t $output .= $before;\n\t\t\t$output .= \"<span class='pages'>Page \".$page.\" of \".$numpages.\"</span>\";\n\t\t\tfor ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {\n\t\t\t\t$j = str_replace('%',$i,$pagelink);\n\t\t\t\t$output .= ' ';\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) ) {\n\t\t\t\t\t$output .= _truethemes_link_page($i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//current page <span> class\n\t\t\t\tif($i == $page){\n\t\t\t\t$link_before = '<span class=\"current\">';\n\t\t\t\t}else{\n\t\t\t\t$link_before = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//current page <span> class\n\t\t\t\tif($i == $page){\n\t\t\t\t$link_after = '</span>';\n\t\t\t\t}else{\n\t\t\t\t$link_after = '';\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t$output .= $link_before . $j . $link_after;\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) )\n\t\t\t\t\t$output .= '</a>';\n\t\t\t}\n\t\t\t$output .= $after;\n\t\t} \n\n\t}\n\n\t\techo $output;\n}", "function numbered_in_page_links( $args = array () )\r\n{\r\n $defaults = array(\r\n 'before' => '<p>' . __('Pages:', 'framework')\r\n , 'after' => '</p>'\r\n , 'link_before' => ''\r\n , 'link_after' => ''\r\n , 'pagelink' => '%'\r\n , 'echo' => 1\r\n // element for the current page\r\n , 'highlight' => 'span'\r\n );\r\n\r\n $r = wp_parse_args( $args, $defaults );\r\n $r = apply_filters( 'wp_link_pages_args', $r );\r\n extract( $r, EXTR_SKIP );\r\n\r\n global $page, $numpages, $multipage, $more, $pagenow;\r\n\r\n if ( ! $multipage )\r\n {\r\n return;\r\n }\r\n\r\n $output = $before;\r\n\r\n for ( $i = 1; $i < ( $numpages + 1 ); $i++ )\r\n {\r\n $j = str_replace( '%', $i, $pagelink );\r\n $output .= ' ';\r\n\r\n if ( $i != $page || ( ! $more && 1 == $page ) )\r\n {\r\n $output .= _wp_link_page( $i ) . \"{$link_before}{$j}{$link_after}</a>\";\r\n }\r\n else\r\n { // highlight the current page\r\n // not sure if we need $link_before and $link_after\r\n $output .= \"<$highlight>{$link_before}{$j}{$link_after}</$highlight>\";\r\n }\r\n }\r\n\r\n print $output . $after;\r\n}", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "function create_links()\n\t{\n\t\t// If our item count or per-page total is zero there is no need to continue.\n\t\tif ($this->total_rows == 0 OR $this->per_page == 0)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Calculate the total number of pages\n\t\t$num_pages = ceil($this->total_rows / $this->per_page);\n\n\t\t// Is there only one page? Hm... nothing more to do here then.\n\t\tif ($num_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Set the base page index for starting page number\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\t$base_page = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$base_page = 0;\n\t\t}\n\n\t\t// Determine the current page number.\n\t\t$CI =& get_instance();\n\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\tif ($CI->input->get($this->query_string_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->input->get($this->query_string_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($CI->uri->segment($this->uri_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->uri->segment($this->uri_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Set current page to 1 if using page numbers instead of offset\n\t\tif ($this->use_page_numbers AND $this->cur_page == 0)\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t$this->num_links = (int)$this->num_links;\n\n\t\tif ($this->num_links < 1)\n\t\t{\n\t\t\tshow_error('Your number of links must be a positive number.');\n\t\t}\n\n\t\tif ( ! is_numeric($this->cur_page))\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t// Is the page number beyond the result range?\n\t\t// If so we show the last page\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\tif ($this->cur_page > $num_pages)\n\t\t\t{\n\t\t\t\t$this->cur_page = $num_pages;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->cur_page > $this->total_rows)\n\t\t\t{\n\t\t\t\t$this->cur_page = ($num_pages - 1) * $this->per_page;\n\t\t\t}\n\t\t}\n\n\t\t$uri_page_number = $this->cur_page;\n\t\t\n\t\tif ( ! $this->use_page_numbers)\n\t\t{\n\t\t\t$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);\n\t\t}\n\n\t\t// Calculate the start and end numbers. These determine\n\t\t// which number to start and end the digit links with\n\t\t$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;\n\t\t$end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;\n\n\t\t// Is pagination being used over GET or POST? If get, add a per_page query\n\t\t// string. If post, add a trailing slash to the base URL if needed\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url).'&amp;'.$this->query_string_segment.'=';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url, '/') .'/';\n\t\t}\n\n\t\t// And here we go...\n\t\t$output = '';\n\n\t\t// Render the \"First\" link\n\t\tif ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))\n\t\t{\n\t\t\t$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;\n\t\t\t$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href=\"'.$first_url.'\">'.$this->first_link.'</a>'.$this->first_tag_close;\n\t\t}\n\n\t\t// Render the \"previous\" link\n\t\tif ($this->prev_link !== FALSE AND $this->cur_page != 1)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - $this->per_page;\n\t\t\t}\n\n\t\t\tif ($i == 0 && $this->first_url != '')\n\t\t\t{\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$i.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\n\t\t}\n\n\t\t// Render the pages\n\t\tif ($this->display_pages !== FALSE)\n\t\t{\n\t\t\t// Write the digit links\n\t\t\tfor ($loop = $start -1; $loop <= $end; $loop++)\n\t\t\t{\n\t\t\t\tif ($this->use_page_numbers)\n\t\t\t\t{\n\t\t\t\t\t$i = $loop;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$i = ($loop * $this->per_page) - $this->per_page;\n\t\t\t\t}\n\n\t\t\t\tif ($i >= $base_page)\n\t\t\t\t{\n\t\t\t\t\tif ($this->cur_page == $loop)\n\t\t\t\t\t{\n\t\t\t\t\t\t$output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$n = ($i == $base_page) ? '' : $i;\n\n\t\t\t\t\t\tif ($n == '' && $this->first_url != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$loop.'</a>'.$this->num_tag_close;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;\n\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$n.'\">'.$loop.'</a>'.$this->num_tag_close;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Render the \"next\" link\n\t\tif ($this->next_link !== FALSE AND $this->cur_page < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $this->cur_page + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($this->cur_page * $this->per_page);\n\t\t\t}\n\n\t\t\t$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->next_link.'</a>'.$this->next_tag_close;\n\t\t}\n\n\t\t// Render the \"Last\" link\n\t\tif ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $num_pages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = (($num_pages * $this->per_page) - $this->per_page);\n\t\t\t}\n\t\t\t$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->last_link.'</a>'.$this->last_tag_close;\n\t\t}\n\n\t\t// Kill double slashes. Note: Sometimes we can end up with a double slash\n\t\t// in the penultimate link so we'll kill all double slashes.\n\t\t$output = preg_replace(\"#([^:])//+#\", \"\\\\1/\", $output);\n\n\t\t// Add the wrapper HTML if exists\n\t\t$output = $this->full_tag_open.$output.$this->full_tag_close;\n\n\t\treturn $output;\n\t}", "public function getPagesLinks()\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t// Yjsg instance\r\n\t\t$yjsg = Yjsg::getInstance(); \r\n\t\t\r\n\t\t// Build the page navigation list.\r\n\t\t$data = $this->_buildDataObject();\r\n\r\n\t\t$list = array();\r\n\t\t$list['prefix'] = $this->prefix;\r\n\r\n\t\t$itemOverride = false;\r\n\t\t$listOverride = false;\r\n\r\n\t\t$chromePath \t= JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';\r\n\t\t//yjsg start\r\n\t\tif (!file_exists($chromePath)){\r\n\t\t\tif($yjsg->preplugin()){\r\n\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//yjsg end\r\n\t\tif (file_exists($chromePath))\r\n\t\t{\r\n\t\t\tinclude_once $chromePath;\r\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive'))\r\n\t\t\t{\r\n\t\t\t\t$itemOverride = true;\r\n\t\t\t}\r\n\t\t\tif (function_exists('pagination_list_render'))\r\n\t\t\t{\r\n\t\t\t\t$listOverride = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Build the select list\r\n\t\tif ($data->all->base !== null)\r\n\t\t{\r\n\t\t\t$list['all']['active'] = true;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['all']['active'] = false;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\r\n\t\t}\r\n\r\n\t\tif ($data->start->base !== null)\r\n\t\t{\r\n\t\t\t$list['start']['active'] = true;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['start']['active'] = false;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\r\n\t\t}\r\n\t\tif ($data->previous->base !== null)\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = true;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = false;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\r\n\t\t}\r\n\r\n\t\t$list['pages'] = array(); //make sure it exists\r\n\t\tforeach ($data->pages as $i => $page)\r\n\t\t{\r\n\t\t\tif ($page->base !== null)\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = true;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = false;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data->next->base !== null)\r\n\t\t{\r\n\t\t\t$list['next']['active'] = true;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['next']['active'] = false;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\r\n\t\t}\r\n\r\n\t\tif ($data->end->base !== null)\r\n\t\t{\r\n\t\t\t$list['end']['active'] = true;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['end']['active'] = false;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\r\n\t\t}\r\n\r\n\t\tif ($this->total > $this->limit)\r\n\t\t{\r\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "function bootstrap_link_pages($args = '') {\r\n\t$defaults = array(\r\n\t\t'before' => '', 'after' => '',\r\n\t\t'link_before' => '', 'link_after' => '',\r\n\t\t'next_or_number' => 'number', 'nextpagelink' => __('Next page'),\r\n\t\t'previouspagelink' => __('Previous page'), 'pagelink' => '%',\r\n\t\t'echo' => 1\r\n\t);\r\n\r\n\t$r = wp_parse_args( $args, $defaults );\r\n\t$r = apply_filters( 'wp_link_pages_args', $r );\r\n\textract( $r, EXTR_SKIP );\r\n\r\n\tglobal $page, $numpages, $multipage, $more, $pagenow;\r\n\r\n\t$output = '';\r\n\tif ( $multipage ) {\r\n\t\tif ( 'number' == $next_or_number ) {\r\n\t\t\t$output .= $before;\r\n\t\t\t$output .= '<div class=\"pagination\"><ul>';\r\n\t\t\tfor ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {\r\n\t\t\t\t$j = str_replace('%',$i,$pagelink);\r\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) ) {\r\n\t\t\t\t\t$output .= '<li>' . _wp_link_page($i);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$output .= '<li class=\"active\"><span>';\r\n\t\t\t\t$output .= $link_before . $j . $link_after;\r\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) )\r\n\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\telse {\r\n\t\t\t\t\t$output .= '</span>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= '</li>';\r\n\t\t\t}\r\n\t\t\t$output .= '</ul></div>';\r\n\t\t\t$output .= $after;\r\n\t\t} else {\r\n\t\t\tif ( $more ) {\r\n\t\t\t\t$output .= $before;\r\n\t\t\t\t$i = $page - 1;\r\n\t\t\t\tif ( $i && $more ) {\r\n\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t$output .= $link_before. $previouspagelink . $link_after . '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$i = $page + 1;\r\n\t\t\t\tif ( $i <= $numpages && $more ) {\r\n\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t$output .= $link_before. $nextpagelink . $link_after . '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= $after;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif ( $echo )\r\n\t\techo $output;\r\n\r\n\treturn $output;\r\n}", "function generate_page_links($user_search, $sort, $cur_page, $num_pages) {\n $page_links = '<p>';\n\n // Generate \"previous page\" link if page is not the first page\n if ($cur_page > 1) {\n // Generate back arrow as an HTML link\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . ($cur_page - 1) . '\"><-</a> ';\n } else {\n // Generate back arrow as a non-HTML link\n $page_links .= '<- ';\n }\n\n // Generate page links for each individual page\n for ($index = 1; $index <= $num_pages; $index++) {\n // Generate clickable link if page is not current page\n if ($index == $cur_page) {\n $page_links .= ' ' . $index;\n } else {\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . $index . '\"> ' . $index . '</a> ';\n }\n }\n\n // Generate clickable link if current page is not the last page\n if ($cur_page < $num_pages) {\n // Generate back arrow as an HTML link\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . ($cur_page + 1) . '\"> -></a> ';\n } else {\n // Generate back arrow as a non-HTML link\n $page_links .= ' ->';\n }\n\n $page_links .= '</p>';\n\n return $page_links;\n }", "private function prepareInternalLinkAnnotation($text) {\n $this->appendText(\" \");\n $fromHOffset = $this->hOffset;\n $linkAreas = array(/* page, left, bottom, right, top */);\n\n // If more than one text line to append\n while ($text = $this->appendOneLine($text)) {\n // Create link\n $linkAreas[] = array($this->currentPage,\n self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n\n // Prepare the next line\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $fromHOffset = $this->hOffset;\n }\n\n // Prepare link\n $linkAreas[] = array($this->currentPage,\n self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n\n return $linkAreas;\n }", "function pagelinks($base_url, $total_results)\n\t\t{ \n\t\t\tif ($this->mmhclass->info->config['seo_urls'] == '1') {\n\t\t\t\t$base_url .= ((strpos($base_url, \"?\") === false) ? \"\" : \"&amp;\");\n\t\t\t }else{$base_url .= ((strpos($base_url, \"?\") === false) ? \"?\" : \"&amp;\");\n\t\t\t}\n\t\t\t$total_pages = ceil($total_results / $this->mmhclass->info->config['max_results']);\n\t\t\t$current_page = (($this->mmhclass->info->current_page > $total_pages) ? $total_pages : $this->mmhclass->info->current_page); \n\t\t\t\n\t\t\tif ($total_pages < 2) {\n\t\t\t\t$template_html = $this->mmhclass->lang['3384'];\n\t\t\t} else {\n\t\t\t\tif ($this->mmhclass->info->config['seo_urls'] == '1') {\n\t\t\t\t\t$template_html = (($current_page > 1) ? sprintf($this->mmhclass->lang['3484'], sprintf(\"%s%s\", $base_url, ($this->mmhclass->info->current_page - 1))) : NULL);\n\t\t\t\t}else {$template_html = (($current_page > 1) ? sprintf($this->mmhclass->lang['3484'], sprintf(\"%spage=%s\", $base_url, ($this->mmhclass->info->current_page - 1))) : NULL);}\n\t\t\t\tfor ($i = 1; $i <= $total_pages; $i++) {\n\t\t\t\t\tif ($i == $current_page) {\n\t\t\t\t\t\t$template_html .= sprintf(\"<strong>%s</strong>\", $this->mmhclass->funcs->format_number($i));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($i < ($current_page - 5)) { continue; }\n\t\t\t\t\t\tif ($i > ($current_page + 5)) { break; }\n\t\t\t\t\t\tif ($this->mmhclass->info->config['seo_urls'] == '1') {\n\t\t\t\t\t\t\t$template_html .= sprintf(\"<a href=\\\"%s%s\\\">%s</a>\", $base_url, $i, $this->mmhclass->funcs->format_number($i));\n\t\t\t\t\t\t}else{$template_html .= sprintf(\"<a href=\\\"%spage=%s\\\">%s</a>\", $base_url, $i, $this->mmhclass->funcs->format_number($i));}\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($this->mmhclass->info->config['seo_urls'] == '1') {\n\t\t\t\t\t$template_html .= (($current_page < $total_pages) ? sprintf($this->mmhclass->lang['5475'], sprintf(\"%s%s\", $base_url, ($this->mmhclass->info->current_page + 1))) : NULL);\n\t\t\t\t}else{\n\t\t\t\t\t$template_html .= (($current_page < $total_pages) ? sprintf($this->mmhclass->lang['5475'], sprintf(\"%spage=%s\", $base_url, ($this->mmhclass->info->current_page + 1))) : NULL);\n\t\t\t\t}\n\t\t\t\t$template_html = sprintf($this->mmhclass->lang['7033'], $current_page, $total_pages, $template_html);\n\t\t\t\t /* Go To Page */\n if(isset($this->mmhclass->input->get_vars['page']) && !is_numeric($this->mmhclass->input->get_vars['page'])){\n // $this->mmhclass->templ->error(\"Page must be a number!<br /><br /><a href=\\\"javascript:void(0);\\\" onclick=\\\"history.go(-1);\\\">Return to Previous Page</a>\", true);\n\t$this->mmhclass->input->get_vars['page'] = 0;\n } else {\n\n $query = $_SERVER[\"QUERY_STRING\"];\n\n $string = ((empty($query)) ? NULL : \"?\" . $query);\n\n $currentFile = $_SERVER[\"SCRIPT_NAME\"];\n $parts = Explode('/', $currentFile);\n $currentFile = $parts[count($parts) - 1];\n $action = $currentFile . $string;\n\n $get_val = $this->mmhclass->input->get_vars['act'];\n $gal_val = (int)$this->mmhclass->input->get_vars['gal'];\n $cat_val = (int)$this->mmhclass->input->get_vars['cat'];\n $get_var = ((empty($get_val)) ? NULL : \"<input type=\\\"hidden\\\" name=\\\"act\\\" value=\\\"{$get_val}\\\">\");\n $gal_var = ((empty($gal_val)) ? NULL : \"<input type=\\\"hidden\\\" name=\\\"gal\\\" value=\\\"{$gal_val}\\\">\");\n $cat_var = ((empty($cat_val)) ? NULL : \"<input type=\\\"hidden\\\" name=\\\"cat\\\" value=\\\"{$cat_val}\\\">\");\n $hidn_vars = $get_var . $gal_var . $cat_var;\n\tif ($this->mmhclass->info->config['seo_urls'] == '1') {\n\t\t// $template_html .= \"<form action=\\\"{$base_url}\\\" method=\\\"get\\\" id=\\\"form\\\">{$hidn_vars}&nbsp;|&nbsp;Go to page:&nbsp;<input type=\\\"text\\\" name=\\\"/\\\" value=\\\"\\\" size=\\\"3\\\">&nbsp;<input class=\\\"button1\\\" type=\\\"submit\\\" value=\\\"Go\\\" /></form>\";\n\t}else {\n $template_html .= \"<form action=\\\"{$action}\\\" method=\\\"get\\\" id=\\\"form\\\">{$hidn_vars}&nbsp;|&nbsp;Go to page:&nbsp;<input type=\\\"text\\\" name=\\\"page\\\" value=\\\"\\\" size=\\\"3\\\">&nbsp;<input class=\\\"button1\\\" type=\\\"submit\\\" value=\\\"Go\\\" /></form>\";\n\t}\n }\n /* /END Go To Page */\n\t\t\t}\n\t\t\t\n\t\t\treturn sprintf($this->mmhclass->lang['5834'], $template_html);\n\t\t}", "private function gen_nav_links()\n\t{\n\t\t$this->template->assign_block_vars('navlinks', array(\n\t\t\t'S_IS_CAT'\t\t=> true,\n\t\t\t'S_IS_LINK'\t\t=> false,\n\t\t\t'S_IS_POST'\t\t=> false,\n\t\t\t'FORUM_NAME'\t=> $this->user->lang('BLOG_MAIN'),\n\t\t\t'FORUM_ID'\t\t=> -1,\n\t\t\t'U_VIEW_FORUM'\t=> append_sid('blog'),\n\t\t));\n\t}", "public static function links()\n\t{\n\t\t$all_pages = ceil(self::$total / self::$limit);\n\t\t$current_page = ceil(self::$offset / self::$limit);\n\n\t\t$string = '<nav class=\"paginator\"><ul>';\n\n\t\tif($current_page > 1)\n\t\t{\n\t\t\t$string .= '<li>' . self::link(\"Pr&eacute;c&eacute;dente\", ($current_page - 1) * self::$limit) . '</li>';\n\t\t}\n\n\t\t$from_page = max($current_page - 3, 0);\n\t\t$to_page = min($current_page + 3, $all_pages-1);\n\n\t\tfor($i = $from_page; $i < $to_page; $i++)\n\t\t{\n\t\t\t$string .= '<li ' . ($current_page == $i ? 'class=\"current\"' : '') . '>' . self::link($i + 1, $i * self::$limit) . '</li>';\n\t\t}\n\t\t\n\n\t\tif(($current_page + 1) !== $all_pages)\n\t\t{\n\t\t\t$string .=\"<li>...</li>\";\n\t\t\t$string .= '<li>' . self::link(round(self::$total/self::$limit)+1, round(self::$total/self::$limit)*self::$limit ) . '</li>';\n\t\t\t$string .= '<li>' . self::link(\"Suivante\", ($current_page + 1) * self::$limit) . '</li>';\n\t\t}\t\t\n\n\t\t//self::$url=preg_replace(\"/\\&offset=[0-9]*/\",\"\",self::$url);\n\t\t//$string .='<li><a href=\"' . self::$url . '?offset=' . round(self::$total/self::$limit)*self::$limit . '\"> Derni&egrave;re </a>';\n\t\t$string .= '</ul></nav>';\n\t\t//$string .= self::$total . \" \" .self::$offset . \" \" . self::$url . \" \" . self::$limit;\n\n\t\treturn $string;\n\t}", "function mxpress_link_pages() {\r\n global $mx_state, $wp_query, $more, $post;\r\n $defaults = array(\r\n 'before' => '<p>' . __('Pages:'), 'after' => '</p>',\r\n 'link_before' => '', 'link_after' => '',\r\n 'next_or_number' => 'number', 'nextpagelink' => __('Next page'),\r\n 'previouspagelink' => __('Previous page'), 'pagelink' => '%',\r\n 'echo' => 1\r\n );\r\n\r\n $r = wp_parse_args($args, $defaults);\r\n $r = apply_filters('wp_link_pages_args', $r);\r\n extract($r, EXTR_SKIP);\r\n//var_dump($wp_query);\r\n $page = ($wp_query->query_vars['page']) ? $wp_query->query_vars['page'] : 1;\r\n $numpages = $mx_state['num_pages'];\r\n\r\n global $post;\r\n $post_id = $post->ID;\r\n $content_saved = get_post_meta($post_id, '_mxpress_content', true);\r\n if ($content_saved != '') {\r\n $content_ar = unserialize($content_saved);\r\n $numpages = count($content_ar);\r\n $multipage = true;\r\n }\r\n\r\n\t$output = '';\r\n\t\r\n\tif ($numpages > 1)\r\n\t{\t\t\r\n\t\tif ($multipage) {\r\n\t\t\tif ('number' == $next_or_number) {\r\n\t\t\t\t$output .= $before;\r\n\t\t\t\tfor ($i = 1; $i < ($numpages + 1); $i = $i + 1) {\r\n\t\t\t\t\t$j = str_replace('%', $i, $pagelink);\r\n\t\t\t\t\t$output .= ' ';\r\n\t\t\t\t\tif (($i != $page) || ((!$more) && ($page == 1))) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= $link_before . $j . $link_after;\r\n\t\t\t\t\tif (($i != $page) || ((!$more) && ($page == 1)))\r\n\t\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= $after;\r\n\t\t\t} else {\r\n\t\t\t\tif ($more) {\r\n\t\t\t\t\t$output .= $before;\r\n\t\t\t\t\t$i = $page - 1;\r\n\t\t\t\t\tif ($i && $more) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t\t$output .= $link_before . $previouspagelink . $link_after . '</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i = $page + 1;\r\n\t\t\t\t\tif ($i <= $numpages && $more) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t\t$output .= $link_before . $nextpagelink . $link_after . '</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= $after;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($echo)\r\n\t\t\techo $output;\r\n\t}\r\n\r\n return $output;\r\n}", "function makeLinks($linkArray)\r\n{\r\n $myReturn = '';\r\n\r\n foreach($linkArray as $url => $text)\r\n {\r\n if($url == THIS_PAGE)\r\n {//selected page - add class reference\r\n\t \t$myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\r\n \t}else{\r\n\t \t$myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\r\n \t} \r\n }\r\n \r\n return $myReturn;\r\n}", "function quasar_get_link_pages(){\n\tglobal $post;\n\tif(!$post) return;\n\t\n\twp_link_pages( \n\t\tarray( \n\t\t\t'before'\t\t\t=>\t'<div class=\"quasar-pagination quasar-link_pages\">', \n\t\t\t'after'\t\t\t\t=>\t'</div><div class=\"clear\"></div>', \n\t\t\t'link_before'\t\t=>\t'<span class=\"page-numbers\">', \n\t\t\t'link_after'\t\t=>\t'</span>',\n\t\t\t'previouspagelink'\t=>\t'« '.__('Previous','quasar'),\n\t\t\t'nextpagelink'\t\t=>\t__('Next','quasar').' »',\n\t\t) \n\t);\n}", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "function section_pages($atts)\n{\n\textract( shortcode_atts( array(\n\t\t'jumplink' => '',\n\t\t'linkname' => '',\n\t), $atts ) );\n\n\tglobal $post;\n\t$ID = $post->ID;\n\t$thispage = '<li><a href=\"#'.$jumplink.'\">'.$linkname.'</a></li>';\n\t$pages = wp_list_pages('title_li=&sort_column=menu_order&depth=1&child_of='.$ID.'&echo=0');\n\treturn $thispage.$pages;\n}", "function studiare_wp_link_pages() {\n\t$defaults = array(\n\t\t'before' => '<div class=\"page-numbers studiare_wp_link_pages\">',\n\t\t'after' => '</div>',\n\t\t'link_before' => '<div class=\"page-number\">',\n\t\t'link_after' => '</div>',\n\t\t'next_or_number' => 'number',\n\t\t'separator' => ' ',\n\t\t'nextpagelink' => esc_html__('Next page', 'studiare'),\n\t\t'previouspagelink' => esc_html__('Previous page', 'studiare'),\n\t\t'pagelink' => '%',\n\t\t'echo' => 1\n\t);\n\n\twp_link_pages($defaults);\n}", "function display_links_version2($max_page_links, $parameters = '') {\n global $request_type;\n $display_links_string = '';\n $class = '';\n\n if (zen_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';\n\n \n // check if number_of_pages > $max_page_links\n $cur_window_num = intval($this->current_page_number / $max_page_links);\n if ($this->current_page_number % $max_page_links) $cur_window_num++;\n\n $max_window_num = intval($this->number_of_pages / $max_page_links);\n if ($this->number_of_pages % $max_page_links) $max_window_num++; \n // previous window of pages\n if ($cur_window_num > 1) \n {\n \t$previous_window_cur = \n \t$display_links_string .= '<p class=\"b\"><a href=\"' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=1', $request_type) . '\" title=\" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' \"><img border=\"0\" src=\"/images/pre0.gif\"></a></p>'; \t\n }\n else \n {\n \t$display_links_string .= '<p class=\"b\"><img border=\"0\" src=\"/images/pre.gif\"></p>';\n }\n \n // previous button - not displayed on first page\n if ($this->current_page_number > 1) \n {\n \t$display_links_string .= '<p class=\"b\"><a href=\"' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '\" title=\" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' class=\"pp\"><img border=\"0\" src=\"/images/pre_10.gif\"></a></p>'; \n }\n else \n {\n \t$display_links_string .= '<p class=\"b\"><img border=\"0\" src=\"/images/pre_1.gif\"></p>';\n }\n \n for($i=1;$i <= $this->number_of_pages;$i++){\n\t\t\t$pageSplit[] = array('id' => $i,'text'=>$i);\n\t}\n\t$display_links_string .='<p class=\"listspan\">';\n // page nn button\n $half_none_cur_window_num = intval(($max_page_links-1)/2);\n $half_none_cur_window_num = $half_none_cur_window_num==0?1:$half_none_cur_window_num ;\n $left_start_at_page=0;\n if ( $this->current_page_number<$half_none_cur_window_num)\n {\n \t$left_start_at_page = 1;\n }\n elseif (($this->number_of_pages- $this->current_page_number)<=$half_none_cur_window_num)\n {\n \t$left_start_at_page = $this->current_page_number-($max_page_links-($this->number_of_pages- $this->current_page_number));\n }\n else \n {\n \t$left_start_at_page = $this->current_page_number-$half_none_cur_window_num-1;\n }\n $left_start_at_page = $left_start_at_page<0?1:$left_start_at_page;\n for ($jump_to_page = $left_start_at_page; ($jump_to_page <= $left_start_at_page+$max_page_links) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) { \n if ($jump_to_page == $this->current_page_number) {\n $display_links_string .= '<strong class=\"r\">' . $jump_to_page . '</strong>&nbsp;&nbsp;';\n } else {\n $display_links_string .= '<a href=\"' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '\" title=\" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' \">' . $jump_to_page . '</a>';\n }\n } \n $display_links_string .='</p>';\n // next button\n if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) \n {\n \t$display_links_string .= '<p class=\"b\"><a href=\"' . zen_href_link($_GET['main_page'], $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '\" title=\" ' . PREVNEXT_TITLE_NEXT_PAGE . ' \"><img border=\"0\" src=\"/images/next0.gif\"></a></p>';\n }\n else \n {\n \t$display_links_string .= '<p class=\"b\"><img border=\"0\" src=\"/images/next.gif\"></p>';\n }\n \n // next window of pages\n if ($cur_window_num < $max_window_num) \n {\n \t$display_links_string .= '<p class=\"b\"><a href=\"' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $this->number_of_pages, $request_type) . '\" title=\" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' \"><img border=\"0\" src=\"/images/next_10.gif\"></a></p>';\n }\n else \n {\n \t$display_links_string .= '<p class=\"b\"><img border=\"0\" src=\"/images/next_1.gif\"></p>';\n }\n\n // go to the page\n $display_links_string .= '<p>&nbsp;Go To&nbsp;';\n $display_links_string .= zen_draw_pull_down_menu('page',$pageSplit,isset($_GET['page'])?$_GET['page']:'','onchange=\"changePage(this,\\''.cleanSameArg('page').'\\');\" class=\"select1\" rel=\"dropdown\"').'</p>';\n \n if ($display_links_string == '&nbsp;<strong class=\"current\">1</strong>&nbsp;') {\n return '&nbsp;';\n } else {\n return $display_links_string;\n }\n }" ]
[ "0.67063576", "0.6638719", "0.65785736", "0.64954096", "0.6469011", "0.64381135", "0.6429237", "0.64281005", "0.63935435", "0.63454455", "0.6302978", "0.62771684", "0.62650526", "0.62264335", "0.6210543", "0.616929", "0.61340696", "0.61256015", "0.6121608", "0.61183316", "0.6113293", "0.6109327", "0.6053003", "0.6030789", "0.602586", "0.601831", "0.60179347", "0.6005256", "0.5990753", "0.5990076" ]
0.7007468
0
/ Build the forum jump menu / Build jump menu $html = 0 means don't return the select html stuff $html = 1 means return the jump menu with select and option stuff
function build_forum_jump($html=1, $override=0, $remove_redirects=0) { $the_html = ""; if ($html == 1) { $the_html = "<form onsubmit=\"if(document.jumpmenu.f.value == -1){return false;}\" action='{$this->base_url}act=SF' method='get' name='jumpmenu'> <input type='hidden' name='act' value='SF' />\n<input type='hidden' name='s' value='{$this->session_id}' /> <select name='f' onchange=\"if(this.options[this.selectedIndex].value != -1){ document.jumpmenu.submit() }\" class='dropdown'> <optgroup label=\"{$this->lang['sj_title']}\"> <option value='sj_home'>{$this->lang['sj_home']}</option> <option value='sj_search'>{$this->lang['sj_search']}</option> <option value='sj_help'>{$this->lang['sj_help']}</option> </optgroup> <optgroup label=\"{$this->lang['forum_jump']}\">"; } $the_html .= $this->forums->forums_forum_jump($html, $override, $remove_redirects); if ($html == 1) { $the_html .= "</optgroup>\n</select>&nbsp;<input type='submit' value='{$this->lang['jmp_go']}' class='button' /></form>"; } return $the_html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _board_fast_nav_box() {\n\t\t// Create site jump array\n\t\t$site_jump_array = array(\n\t\t\t'sj_home'\t=> 'Forum Home',\n\t\t\t'sj_search'\t=> 'Search',\n\t\t\t'sj_help'\t=> 'Help',\n\t\t);\n\t\t// Prepare array for processing (to avoid slow manipulations)\n\t\tforeach ((array)module('forum')->_forums_array as $_info) {\n\t\t\t// Skip non-active forums\n\t\t\tif ($_info['status'] != 'a') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cat_info = module('forum')->_forum_cats_array[$_info['category']];\n\t\t\t// Skip non-active categories\n\t\t\tif ($cat_info['status'] != 'a') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->_forum_parents[$_info['parent']][$_info['id']] = $_info['category'];\n\t\t\t$this->_forum_cat_names[$_info['category']] = $cat_info['name'];\n\t\t}\n\t\t// Create forum jump array\n\t\t$forum_jump_array = $this->_prepare_parents_for_select();\n\t\t// Try to set selected index\n\t\tif ($_GET['action'] == 'show' && empty($_GET['id']))\t\t$selected = 'sj_home';\n\t\telseif ($_GET['action'] == 'show' && !empty($_GET['id']))\t$selected = 'cat_'.$_GET['id'];\n\t\telseif ($_GET['action'] == 'search')\t\t\t\t\t\t$selected = 'sj_search';\n\t\telseif ($_GET['action'] == 'help')\t\t\t\t\t\t\t$selected = 'sj_help';\n\t\telseif ($_GET['action'] == 'view_forum')\t\t\t\t\t$selected = $_GET['id'];\n\t\telseif ($_GET['action'] == 'view_topic')\t\t\t\t\t$selected = module('forum')->_topic_info['forum'];\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t$selected = 'sj_home';\n\t\t// Process main template\n\t\t$replace = array(\n\t\t\t'form_action'\t=> './?object=forum&action=site_jump'._add_get(array('page')),\n\t\t\t'fast_nav_box'\t=> common()->select_box('fast_nav', array('Site Jump' => $site_jump_array, 'Forum Jump' => $forum_jump_array), $selected, false, 2, \n\t\t\t\t\" onchange=\\\"if(this.options[this.selectedIndex].value != -1){ document.jumpmenu.submit() }\\\"\", false),\n\t\t);\n\t\treturn tpl()->parse('forum'.'/board_fast_nav', $replace);\n\t}", "function menu_select($start_id,$direction,$number_levels,$only_active,$menu_only,$exclude_subseiten)\n{\n//$start_id ist die ID, von der weg geprüft werden soll.\n//$direction ist entweder \"up\" oder \"down\".\n//$numer_levels ist ein numerischer Wert, der nur bei \"down\" relevanz hat. Er gibt an, wie viele Ebenen durchsucht werden sollen.\n//$only active ist enteder \"1\" oder was anderes. Nur wenn es \"1\" ist, werden nur die aktiven Einträge druchsucht. \n//$menu_only ist entweder \"1\" oder \"2\" oder was anderes. Nur wenn es \"1\" ist, werden nur die Menüeinträge gezeigt. Wenn es \"2\" ist, werden nur jene Einträge wieder gegeben, die selbst kein Meunü sind.\n//Aufrufen durch: print_r(menu_select('46','down','1','',''));\n\tunset($GLOBALS['menu_select_siblings']);\n\tunset($GLOBALS['menu_select_parent']);\n\tif($only_active==\"1\"){$search_append_string=\"and (active_startdate<=now() or active_startdate='0000-00-00') and (active_enddate>=now() or active_enddate='0000-00-00') and active='A'\";}\n\tif($menu_only==\"1\"){$search_append_string=$search_append_string.\" and display='1'\";}\n\tif($exclude_subseiten==\"1\"){$search_append_string=$search_append_string.\" and search_type not like '%Subseiten%'\";}\n\n\t$i=-1;\n\tif(function_exists('menu_select_siblings')){unset ($menu_select_siblings);} else\n\t{\n\t\tfunction menu_select_siblings($parent_id,$number_levels,$i,$search_append_string,$menu_only)\n\t\t{\n\t\t\t$i=$i+1;\n\t\t\tif($i<$number_levels or $number_levels==0 or $number_levels==\"\")\n\t\t\t{\n\t\t\t\tglobal $menu_select_siblings;\n\t\t\t\t$sibling_query=mysql_query(\"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\") or die (\"sibling_query: \".mysql_error());\n\t\t\t\techo $parent_id;\n\t\t\t\tif($parent_id==3) {echo \"hh\";echo \"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\";}\n\t\t\t\t\n\t\t\t\twhile($sibling_query_result=mysql_fetch_assoc($sibling_query))\n\t\t\t\t{\n\t\t\t\t\tif(($menu_only==2 and $sibling_query_result['display']==0) or $menu_only!=2){//if the selector menu only is set to 2, only those items are recorded that are actually NOT menus.\n\t\t\t\t\t\t$menu_select_siblings['id'][] = $sibling_query_result['id'];\n\t\t\t\t\t\t$menu_select_siblings['description'][] = $sibling_query_result['description'];\n\t\t\t\t\t\t$menu_select_siblings['googleurl'][] = find_googleurl($sibling_query_result['id']);\t\t\t\n\t\t\t\t\t\t$menu_select_siblings['level_down'][] = $i;\t\n\t\t\t\t\t}\n\t\t\t\t\tmenu_select_siblings($sibling_query_result['id'],$number_levels,$i,$search_append_string,$menu_only);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn($menu_select_siblings);\n\t\t}\n\t}\n\t\n\tif(function_exists('menu_select_parents')){} else\n\t{\n\t\tfunction menu_select_parents($sibling_id, $only_active_string)\n\t\t{\tif($sibling_id==\"\" or $sibling_id==\"0\" or !$sibling_id){} else\n\t\t\t{\n\t\t\t\tglobal $menu_select_parent;\n\t\t\t\t$parent_query=mysql_query(\"select id, parent_id, description from menu where id=$sibling_id $search_append_string order by sort\") or die (\"parent_query: \".mysql_error());\n\t\t\t\twhile($parent_query_result=mysql_fetch_assoc($parent_query))\n\t\t\t\t{\n\t\t\t\t\tif($parent_query_result[id]==0){break;}\n\t\t\t\t\t$menu_select_parent['id'][] = $parent_query_result['id'];\n\t\t\t\t\t$menu_select_parent['description'][] = $parent_query_result['description'];\n\t\t\t\t\t$menu_select_parent['googleurl'][] = find_googleurl($parent_query_result['id']);\t\t\t\n\t\t\t\t\tmenu_select_parents($parent_query_result[parent_id],$search_append_string);\n\t\t\t\t}\n\t\t\t\treturn($menu_select_parent);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif($direction==\"up\"){return(menu_select_parents($start_id,$search_append_string));}\n\telseif($direction==\"down\"){return(menu_select_siblings($start_id,$number_levels,$i,$search_append_string,$menu_only));}\n}", "function generate_menu_list($obj, $list_name, $menu_value, $default_value = \" - Select One - \")\n{\n\t$menu = array();\n\t$menu_HTML = \"<ul id='menu' class='clear'>\n\t\t<li><a href='javascript:void(0)'>\".$default_value.\"</a>\";\n\t\n\t#Get the first level menu item\n\t$first_level_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_menu_items', array('menufield'=>'firstlevel', 'parentfield'=>'menuname', 'parentvalue'=>$list_name)));\n\t$first_level = $first_level_result->result_array();\n\t\n\tif(!empty($first_level))\n\t{\n\t\t$menu['level1'] = $first_level;\n\t\tforeach($first_level AS $menu_item)\n\t\t{\n\t\t\t#Get the second level menu item\n\t\t\t$second_level_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_menu_items', array('menufield'=>'secondlevel', 'parentfield'=>'firstlevel', 'parentvalue'=>$menu_item['firstlevel'])));\n\t\t\t$second_level = $second_level_result->result_array();\n\t\t\t\n\t\t\tif(!empty($second_level))\n\t\t\t{\n\t\t\t\t$menu['level2'][$menu_item['firstlevel']] = $second_level;\n\t\t\t\tif(!empty($second_level))\n\t\t\t\t{\n\t\t\t\t\tforeach($second_level AS $menu2_item)\n\t\t\t\t\t{\n\t\t\t\t\t\t#Get the third level menu item\n\t\t\t\t\t\t$third_level_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_menu_items', array('menufield'=>'thirdlevel', 'parentfield'=>'secondlevel', 'parentvalue'=>$menu2_item['secondlevel'])));\n\t\t\t\t\t\t$third_level = $third_level_result->result_array();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($third_level))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$menu['level3'][$menu2_item['secondlevel']] = $third_level;\n\t\t\t\t\t\t\tforeach($third_level AS $menu3_item)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t#Get the third level menu item\n\t\t\t\t\t\t\t\t$fourth_level_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_menu_items', array('menufield'=>'fourthlevel', 'parentfield'=>'thirdlevel', 'parentvalue'=>$menu3_item['thirdlevel'])));\n\t\t\t\t\t\t\t\t$fourth_level = $fourth_level_result->result_array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($fourth_level))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$menu['level4'][$menu3_item['thirdlevel']] = $fourth_level;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\t#The menu HTML\n\tif(!empty($menu['level1']))\n\t{\n\t\t$menu_HTML .= \"<ul>\";\n\t\tforeach($menu['level1'] AS $item)\n\t\t{\n\t\t\t#echo \"<BR><BR>== \";print_r($item);\n\t\t\tif(!empty($menu['level2'][$item['firstlevel']]))\n\t\t\t{\n\t\t\t\t$menu_HTML .= \"<li><a href='javascript:void(0)'>\".$item['firstlevel'].\"</a><ul>\";\n\t\t\t\t\t\n\t\t\t\t\t#Second level items\n\t\t\t\t\tforeach($menu['level2'][$item['firstlevel']] AS $item2)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!empty($menu['level3'][$item2['secondlevel']]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$menu_HTML .= \"<li><a href='javascript:void(0)'>\".$item2['secondlevel'].\"</a><ul>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#Third level items\n\t\t\t\t\t\t\tforeach($menu['level3'][$item2['secondlevel']] AS $item3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!empty($menu['level4'][$item3['thirdlevel']]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$menu_HTML .= \"<li><a href='javascript:void(0)'>\".$item3['thirdlevel'].\"</a><ul>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t#Fourth level items\n\t\t\t\t\t\t\t\t\tforeach($menu['level4'][$item3['thirdlevel']] AS $item4)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$menu_HTML .= \"<li><a href=\\\"javascript:selectAndRefresh('\".$menu_value.\"_div', '\".$item4['fourthlevel'].\"', '\".$menu_value.\"')\\\">\".$item4['fourthlevel'].\"</a></li>\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$menu_HTML .= \"<li><a href=\\\"javascript:selectAndRefresh('\".$menu_value.\"_div', '\".$menu_value.\"', '\".$item3['thirdlevel'].\"')\\\">\".$item3['thirdlevel'].\"</a></li>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$menu_HTML .= \"</ul></li>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$menu_HTML .= \"<li><a href=\\\"javascript:selectAndRefresh('\".$menu_value.\"_div', '\".$menu_value.\"', '\".$item2['secondlevel'].\"')\\\">\".$item2['secondlevel'].\"</a></li>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$menu_HTML .= \"</ul></li>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$menu_HTML .= \"<li><a href=\\\"javascript:selectAndRefresh('\".$menu_value.\"_div', '\".$menu_value.\"', '\".$item['firstlevel'].\"')\\\">\".$item['firstlevel'].\"</a></li>\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$menu_HTML .= \"</ul>\";\n\t}\n\t\n\t$menu_HTML .= \"</li></ul>\";\n\t\n\treturn $menu_HTML;\n}", "public function render()\n {\n $fromListTree = array();\n $this->getFromListTree($fromListTree);\n $style = $this->getStyle();\n $func = $this->getFunction();\n $valueList = array(); $valueArray = array();\n $this->getFromList($valueList, $this->getSelectedList());\n foreach ($valueList as $vl) {\n $valueArray[] = $vl['val'];\n }\n $sHTML = \"<script>\n \t\t\t\tvar \".$this->m_Name.\"_optlist = new Array(); \n \t\t\t\tvar \".$this->m_Name.\"_optlist_default = new Array();\n \t\t\t</script>\";\n $sHTML .= \"<div name=\\\"\" . $this->m_Name . \"\\\" ID=\\\"\" . $this->m_Name .\"\\\" $this->m_HTMLAttr $style>\";\n\t\t$sHTML .= \"<ul>\";\n\t\t$i = 0;\n foreach ($fromListTree as $treeNode)\n {\n\n //$sHTML .= \"<input type=\\\"checkbox\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"<br/>\";\n $sHTML .= \"<li style=\\\"padding-top:10px;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<strong>\".$treeNode['txt'].\"</strong>\".\"</li>\";\n $sublist = array();\n $this->getDOFromList($sublist, $this->getSelectFrom().\",[folder_id]='\".$treeNode['id'].\"'\");\n foreach($sublist as $option){\n $test = array_search($option['val'], $valueArray);\n\t if ($test === false)\n\t {\n\t $selectedStr = '';\n\t }\n\t else\n\t {\n\t $selectedStr = \"CHECKED\";\n\t $sHTML .= \"<script>\".$this->m_Name.\"_optlist_default.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n\t } \t\n \t$sHTML .= \"<li><label style=\\\"float:none;color:#888888;display:inline;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<input type=\\\"checkbox\\\" id=\\\"\".$this->m_Name.\"_\".$i.\"\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"</label></li>\";\n \t$sHTML .= \"<script>\".$this->m_Name.\"_optlist.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n \t$i++;\n }\n \n }\n $sHTML .= \"</ul></div>\";\n return $sHTML;\n }", "function menu_builder(){\n $v_result;\n require_once('dbconn.php');\n $mysql_conn = conn();\n try{\n $sql_menu = \" select \".\n \" pid, \".\n \" case when id = pid then \".\n \" 'root' \".\n \" else \".\n \" 'leaf' \".\n \" end as root_leaf, \".\n \" item_name, item_url, \".\n \" js_function_name \".\n \" from rrb_sys_menu \".\n \" where status = 1 \".\n \" order by id \";\n $mysql_conn->query(\"SET NAMES 'utf8'\");\n\n $v_i= 0;\n if ($results_menu=$mysql_conn->query($sql_menu) ) {\n while ($row_menu = mysqli_fetch_assoc($results_menu)){\n\n if ($row_menu['root_leaf'] == \"leaf\") {\n $v_i=$v_i+1;\n if ($v_i == 1){\n $v_menu_text2 = $v_menu_text2.\"{text: '\".$row_menu['item_name'] .\"' ,handler: \".$row_menu['js_function_name'] . \"}\\n\";\n } else {\n $v_menu_text2 = $v_menu_text2.\",{text: '\".$row_menu['item_name'] .\"' ,handler: \".$row_menu['js_function_name'] . \"}\\n\";\n };\n $v_menu_functions = $v_menu_functions .\"function \". $row_menu['js_function_name'] .\"(item){ window.location = '\". $row_menu['item_url'] .\"'; }\\n\";\n }; \n\n\n }\n\n $v_menu_text1 = \"var menu = new Ext.menu.Menu({ style: {overflow: 'visible'},\n items: [\";\n $v_menu_text3 = \" ] });\";\n\n\n $v_result = $v_menu_functions .\" \". $v_menu_text1 .\" \".$v_menu_text2.\" \". $v_menu_text3;\n\n \n \n }else{\n $v_result = \"{success:false,errors:{reason:'Ошибка! '}}\";\n }\n \n } catch (Exception $e){\n echo 'Выброшено исключение: ', $e->getMessage(), \"\\n\";\n }\n$mysql_conn->close(); \nreturn $v_result; \n \n \n \n}", "function select_menu_families($selected, $htmlname, $dirmenuarray)\r\n {\r\n\t\t// phpcs:enable\r\n\t\tglobal $langs,$conf;\r\n\r\n //$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set\r\n\t\t$expdevmenu=array();\r\n\r\n\t\t$menuarray=array();\r\n\r\n\t\tforeach($dirmenuarray as $dirmenu)\r\n\t\t{\r\n foreach ($conf->file->dol_document_root as $dirroot)\r\n {\r\n $dir=$dirroot.$dirmenu;\r\n if (is_dir($dir))\r\n {\r\n\t $handle=opendir($dir);\r\n\t if (is_resource($handle))\r\n\t {\r\n\t \t\t\twhile (($file = readdir($handle))!==false)\r\n\t \t\t\t{\r\n\t \t\t\t\tif (is_file($dir.\"/\".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')\r\n\t \t\t\t\t{\r\n\t \t\t\t\t\t$filelib=preg_replace('/(_backoffice|_frontoffice)?\\.php$/i','',$file);\r\n\t \t\t\t\t\tif (preg_match('/^index/i',$filelib)) continue;\r\n\t \t\t\t\t\tif (preg_match('/^default/i',$filelib)) continue;\r\n\t \t\t\t\t\tif (preg_match('/^empty/i',$filelib)) continue;\r\n\t \t\t\t\t\tif (preg_match('/\\.lib/i',$filelib)) continue;\r\n\t \t\t\t\t\tif (empty($conf->global->MAIN_FEATURES_LEVEL) && in_array($file,$expdevmenu)) continue;\r\n\r\n\t \t\t\t\t\t$menuarray[$filelib]=1;\r\n\t \t\t\t\t}\r\n\t \t\t\t\t$menuarray['all']=1;\r\n\t \t\t\t}\r\n\t \t\t\tclosedir($handle);\r\n\t }\r\n }\r\n }\r\n\t\t}\r\n\r\n\t\tksort($menuarray);\r\n\r\n\t\t// Affichage liste deroulante des menus\r\n print '<select class=\"flat\" id=\"'.$htmlname.'\" name=\"'.$htmlname.'\">';\r\n $oldprefix='';\r\n\t\tforeach ($menuarray as $key => $val)\r\n\t\t{\r\n\t\t\t$tab=explode('_',$key);\r\n\t\t\t$newprefix=$tab[0];\r\n\t\t\tprint '<option value=\"'.$key.'\"';\r\n if ($key == $selected)\r\n\t\t\t{\r\n\t\t\t\tprint '\tselected';\r\n\t\t\t}\r\n\t\t\tprint '>';\r\n\t\t\tif ($key == 'all') print $langs->trans(\"AllMenus\");\r\n\t\t\telse print $key;\r\n\t\t\tprint '</option>'.\"\\n\";\r\n\t\t}\r\n\t\tprint '</select>';\r\n }", "function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='')\r\n {\r\n\t\t// phpcs:enable\r\n global $langs,$conf;\r\n\r\n // Clean parameters\r\n\r\n\r\n // Check parameters\r\n if (! is_array($dirmenuarray)) return -1;\r\n\r\n\t\t$menuarray=array();\r\n foreach ($conf->file->dol_document_root as $dirroot)\r\n {\r\n foreach($dirmenuarray as $dirtoscan)\r\n {\r\n $dir=$dirroot.$dirtoscan;\r\n //print $dir.'<br>';\r\n if (is_dir($dir))\r\n {\r\n \t $handle=opendir($dir);\r\n \t if (is_resource($handle))\r\n \t {\r\n \t while (($file = readdir($handle))!==false)\r\n \t {\r\n \t if (is_file($dir.\"/\".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && substr($file, 0, 5) != 'index')\r\n \t {\r\n \t if (preg_match('/lib\\.php$/i',$file)) continue;\t// We exclude library files\r\n \t if (preg_match('/eldy_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t\t// We exclude all menu manager files\r\n \t if (preg_match('/auguria_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t// We exclude all menu manager files\r\n \t if (preg_match('/smartphone_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t// We exclude all menu manager files\r\n\r\n \t $filelib=preg_replace('/\\.php$/i','',$file);\r\n \t \t\t\t\t$prefix='';\r\n \t \t\t\t\t// 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other\r\n \t \t\t\t\tif (preg_match('/^eldy/i',$file)) $prefix='0';\r\n else if (preg_match('/^smartphone/i',$file)) $prefix='2';\r\n \t \t\t\t\telse $prefix='3';\r\n\r\n \t if ($file == $selected)\r\n \t {\r\n \t \t\t\t\t\t$menuarray[$prefix.'_'.$file]='<option value=\"'.$file.'\" selected>'.$filelib.'</option>';\r\n \t }\r\n \t else\r\n \t {\r\n \t $menuarray[$prefix.'_'.$file]='<option value=\"'.$file.'\">'.$filelib.'</option>';\r\n \t }\r\n \t }\r\n \t }\r\n \t closedir($handle);\r\n \t }\r\n }\r\n }\r\n }\r\n\t\tksort($menuarray);\r\n\r\n\t\t// Output combo list of menus\r\n print '<select class=\"flat\" id=\"'.$htmlname.'\" name=\"'.$htmlname.'\"'.($moreattrib?' '.$moreattrib:'').'>';\r\n $oldprefix='';\r\n\t\tforeach ($menuarray as $key => $val)\r\n\t\t{\r\n\t\t\t$tab=explode('_',$key);\r\n\t\t\t$newprefix=$tab[0];\r\n\t\t\tif ($newprefix=='1' && ($conf->global->MAIN_FEATURES_LEVEL < 1)) continue;\r\n\t\t\tif ($newprefix=='2' && ($conf->global->MAIN_FEATURES_LEVEL < 2)) continue;\r\n\t\t\tif ($newprefix != $oldprefix)\t// Add separators\r\n\t\t\t{\r\n\t\t\t\t// Affiche titre\r\n\t\t\t\tprint '<option value=\"-1\" disabled>';\r\n\t\t\t\tif ($newprefix=='0') print '-- '.$langs->trans(\"VersionRecommanded\").' --';\r\n if ($newprefix=='1') print '-- '.$langs->trans(\"VersionExperimental\").' --';\r\n\t\t\t\tif ($newprefix=='2') print '-- '.$langs->trans(\"VersionDevelopment\").' --';\r\n\t\t\t\tif ($newprefix=='3') print '-- '.$langs->trans(\"Other\").' --';\r\n\t\t\t\tprint '</option>';\r\n\t\t\t\t$oldprefix=$newprefix;\r\n\t\t\t}\r\n\t\t\tprint $val.\"\\n\";\t// Show menu entry\r\n\t\t}\r\n\t\tprint '</select>';\r\n }", "function mnu_EchoQuicklinks($selmenuitem)\n{\n if (isset($selmenuitem['quicklinks'])) {\n echo '<div style=\"float:right;font-family:sans-serif;font-size:small;\">' . \"\\n\";\n echo '<br/>' . \"\\n\";\n echo '<table cellpadding=\"0\" cellspacing=\"0\" id=\"quicklinksbox\">' . \"\\n\";\n echo '<tr><td id=\"quicklinkstop\">Strony zwiazane z OC.pl:</td></tr>' . \"\\n\";\n\n for ($i = 0; $i < count($selmenuitem['quicklinks']); $i++) {\n if ($i == 0) {\n echo '<tr><td class=\"navilevel2n\" style=\"padding-top:1ex;\">';\n } else {\n echo '<tr><td class=\"navilevel2n\">';\n }\n\n if (mb_substr($selmenuitem['quicklinks'][$i]['href'], 0, 7) == \"http://\") {\n echo '<a href=\"' . $selmenuitem['quicklinks'][$i]['href'] . '\" target=\"_blank\">';\n } else {\n echo '<a href=\"' . $selmenuitem['quicklinks'][$i]['href'] . '\">';\n }\n\n echo htmlspecialchars($selmenuitem['quicklinks'][$i]['text'], ENT_COMPAT, 'UTF-8') . '</a></td></tr>' . \"\\n\";\n }\n\n echo '<tr><td class=\"navi2bottom\">&nbsp;</td></tr>' . \"\\n\";\n echo '</table>' . \"\\n\";\n echo '</div>' . \"\\n\";\n }\n}", "function mnu_EchoMainMenu($selmenuid)\n{\n global $menu;\n for ($i = 0; $i < count($menu); $i++) {\n if ($menu[$i]['visible'] == true) {\n if (!isset($menu[$i]['newwindow']))\n $menu[$i]['newwindow'] = false;\n if ($menu[$i]['newwindow'] == true)\n $target_blank = \"target='_blank'\";\n else\n $target_blank = \"\";\n\n if ($menu[$i]['siteid'] == $selmenuid || is_array($menu[$i]['siteid']) && in_array($selmenuid, $menu[$i]['siteid'])) {\n echo '<li><a class=\"selected bg-green06\" href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n } else {\n echo '<li><a ' . $target_blank . ' href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n }\n }\n }\n}", "public function build_menu_page() {\n\n\t\t\t$tabindex = 0;\n\t\t\t$temp = array();\n\t\t\t$hidden = array();\n\t\t\t$this->data = get_option($this->slug.'_fields');\n\t\t\t\n\t\t\t$output = '';\n\t\t\t$output .= '<!-- wrap starts -->'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<div class=\"wrap\">'.\"\\n\";\n\n\t\t\t$output .= '<h1>'.$this->options['title'].'</h1>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'<form method=\"post\" action=\"'.$_SERVER['REQUEST_URI'].'\" enctype=\"multipart/form-data\">'.\"\\n\\n\";\n\n\t\t\tforeach ($this->data as $section => $fields) {\n\n\t\t\t\t$output .= \"\\t\".'<h2 class=\"title\" id=\"'.sanitize_title($section).'\">'.$section.'</h2>'.\"\\n\\n\";\n\n\t\t\t\t$output .= \"\\t\".'<table class=\"form-table theme-form-table\">'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'<tbody>'.\"\\n\";\n\n\t\t\t\tforeach ($fields as $id => $field) {\n\n\t\t\t\t\tif ($field['type'] != 'hidden') {\n\n\t\t\t\t\t\t$tabindex += 1;\n\t\t\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\n\t\t\t\t\t\t$description = (isset($field['description']) && !empty($field['description'])) ? '<span class=\"description\" id=\"'.Field::get_label_name($field['label']).'-info\">'.$field['description'].'</span>' : '';\n\t\t\t\t\t\t$toggle = (isset($field['description']) && !empty($field['description'])) ? '<a class=\"toggle\" data-toggle=\"form-description\" data-target=\"'.Field::get_label_name($field['label']).'-info\" title=\"'.__('Show info.', 'admin translation').'\">'.__('[+] Info', 'admin translation').'</a>' : '';\n\n\t\t\t\t\t\t$output .= \"\\t\".'<tr valign=\"top\">'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<th class=\"scope-one\" scope=\"row\"><label'.Field::get_label_error($field['label']).' for=\"'.Field::get_label_name($field['label']).'\">'.$field['name'].' <cite></cite></label></th>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-two\">'.Field::get_field($this->slug, $field, $value).'<div class=\"field-info\">'.$description.'</div></td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-three\">'.$toggle.'</td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td>&nbsp;</td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'</tr>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tarray_push($hidden, $field);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$output .= \"\\t\".'</tbody>'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'</table>'.\"\\n\\n\";\n\t\t\t\t$output .= \"\\t\".'<hr />'.\"\\n\\n\";\n\t\t\t}\n\n\t\t\t$output .= isset($_REQUEST['page']) ? \"\\t\".wp_nonce_field($_REQUEST['page']).\"\\n\" : '';\n\n\t\t\tforeach ($hidden as $id => $field) {\n\n\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\t\t\t\t\n\t\t\t\t$output .= Field::get_field($this->slug, $field, $value);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"\\t\".'<input type=\"hidden\" id=\"updating\" name=\"updating\" value=\"1\" />'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<p class=\"submit\"><input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button button-primary\" value=\"'.__('Save Changes', 'admin translation').'\" /></p>'.\"\\n\";\n\t\t\t$output .= \"\\t\".'</form>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'</div>'.\"\\n\";\n\t\t\t$output .= '<!-- wrap ends -->'.\"\\n\\n\";\n\n\t\t\t$output .= Field::get_form_feedback();\n\t\t\t\n\t\t\tValidation::reset_error();\n\n\t\t\techo $output;\n\t\t}", "public function buildMenu() {\n $content = array();\n\n $headers = array(\n t(\"Menu keuze\"),\n t(\"Functie\"), \n );\n $rows[] = array(\n t(\"<b>Tabel beheer</b>\"),\n t(\"\"),\n );\n $rows[]= array(\n t(\"<a href= ezac/leden/>Leden administratie</a>\"),\n t(\"Inzage en wijzigen leden informatie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/leden/update>Lid toevoegen</a>\"),\n t(\"Invoeren gegevens nieuw lid\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/kisten/>Vloot administratie</a>\"),\n t(\"Inzage en wijzigen vloot informatie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/kisten/update>Kist toevoegen</a>\"),\n t(\"Invoeren gegevens nieuw vliegtuig\"),\n );\n $rows[] = array(\n t(\"<b>Startadministratie</b>\"),\n t(\"\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/starts>Startadministratie</a>\"),\n t(\"Overzicht startadministratie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/starts/create/>Start invoer</a>\"),\n t(\"Invoeren nieuwe start\"),\n );\n $rows[] = array(\n t(\"<b>Voortgang / Bevoegdheden administratie</b>\"),\n t(\"\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/vba>Overzicht</a>\"),\n t(\"Overzicht VBA gegevens\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/vba>Invoeren</a>\"),\n t(\"Invoeren verslagen en bevoegdheden\"),\n );\n\n $table = array(\n '#type' => 'table',\n '#caption' => t(\"EZAC administratie hoofdmenu\"),\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('Geen gegevens beschikbaar.'),\n '#sticky' => TRUE,\n '#prefix' => '<div id=\"menu-div\">',\n '#suffix' => '</div>',\n '#weight' => 2,\n );\n\n return $table;\n }", "function getSfMenu($selected) {\n $activeMenusAndLinkContent = getActiveMenuAndLinkContent();\n $activeMenus = $activeMenusAndLinkContent['results'];\n $link_content_id = $activeMenusAndLinkContent['link_contents_id'];\n $link_content_details = getLinkContentDetails($link_content_id);\n \n// Format our active menus for sturcturing a tree for main menu\n $formatedMenus = formatTree($activeMenus, 1);\n $menuStr = \"<ul id='nav'>\";\n foreach ($formatedMenus as $menu) {\n if (!empty($menu['submenu'])) {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected) {\n $mnuclass = \"class='active'\";\n } elseif (is_submenu_selected($menu['submenu'], $selected, $link_content_details)) {\n $mnuclass = \"class='active'\";\n }\n\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a>';\n $menuStr.=\"<ul>\";\n foreach ($menu['submenu'] as $submenu) {\n $submnuclass = \"\";\n $p = $link_content_details[$submenu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($submenu['type'] == \"external\") {\n $link = $submenu['external_link'];\n }\n if ($submenu['type'] == \"category\") {\n $link = \"index.php?p=allproducts&c=\".$submenu['menu_id'];\n }\n if ($p == $selected)\n $submnuclass = \"class='sub_active'\";\n\n $menuStr.='<li ' . $submnuclass . '><a href = \"' . $link . '\">' . $submenu['menu_name'] . '</a></li>';\n }\n $menuStr.=\"</ul></li>\";\n } else {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected)\n $mnuclass = \"class='active'\";\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a><li>';\n }\n }\n $menuStr.=\"</ul>\";\n return $menuStr;\n}", "function build_dropdown ($name = false, $class=\"\", $default=0)\n {\n // Start building the tree from the top branch\n\n $options = $this->_dropdown_branch($default);\n\n // Return output\n if ($name)\n {\n \t$return = '<select name=\"'.$name . '\"';\n \t$return .= ( empty( $class ) ) ? '>' : ' class=\"' . $class . '\">';\n \t$return .= $options.'</select>';\n return $return;\n }\n else\n {\n return $options;\n } \n }", "function main()\t{\n\t\tglobal $LANG;\n\t\t$this->searchitem = (string)t3lib_div::_GP('searchitem');\n\t\t\t// Draw the body.\n\t\t$this->content.='\n\t\t\t<body scroll=\"auto\" id=\"typo3-browse-links-php\">\n\t\t\t<form name=\"organisationform\" action=\"\" method=\"post\">\n\n\t\t\t<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_letter_text').':</h3>\n\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"typo3-tree\">\n\t\t\t\t<tr class=\"bgColor\">\n\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t';\n\n\t\t$script=basename(PATH_thisScript);\n\t\t\n\t\t\n\t\t//render A-Z list\n\t\tforeach($this->arrAlphabet as $char){\n\t\t\tif($this->getEmployeeByLetter($char)){\n\t\t\t\t$this->content .= '<a href=\"#\" onclick=\"add_options_refresh(\\''.$char.'\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$char.'</a>';\n\t\t\t}else{\n\t\t\t\t$this->content .= '<span style=\"color:#066\">'.$char.'</span>';\n\t\t\t}\n\t\t\t$this->content .= ' ';\n\t\t}\n\t\t\t\n\t\tif($this->getEmployeeByLetter('other')){\n\t\t\t$this->content .= '<a href=\"#\" onclick=\"add_options_refresh(\\'other\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$LANG->getLL('all_abc_wizards.other').'</a>';\n\t\t}else{\n\t\t\t$this->content .= '<span style=\"color:#066\">'.$LANG->getLL('all_abc_wizards.other').'</span>';\n\t\t}\n\t\t\t\n\n\t\t$this->content.='\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"searchitem\" id=\"searchitem\" value=\"'.$this->searchitem.'\"> <br />\n\t\t\t\t\t\t<a href=\"#\" onclick=\"add_options_refresh(\\'searchitem\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$LANG->getLL('all_abc_wizards.search').'</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t';\n\n\t\t\t// Stores selected letter in variable.\n\t\t$letter = (string)t3lib_div::_GP('letter');\n\n\t\t\t// Only display second selectorbox if a letter is selected.\n\t\tif ($letter=='') {\n\t\t\t// do nothing\n\t\t} else {\n\t\t\tif ($letter != \"other\" and $letter != \"searchitem\") {\n\t\t\t\t$this->content.='<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_supervisor_text').''.$letter.':</h3>';\n\t\t\t} else {\n\t\t\t\t$this->content.='<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_supervisor_text_no_abc').':</h3>';\n\t\t\t}\n\t\t\t$this->content.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"typo3-tree\">\n\t\t\t\t<tr class=\"bgColor\">\n\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t';\n\n\t\t\t\t// Gets all employees beginning with the chosen letter.\n\t\t\t$this->content.=$this->getSupervisors($letter);\n\n\t\t\t\t// Displays a OK-Button to save the selected supervisor.\n\t\t\t$this->content.='\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\n\t\t\t<input type=\"button\" name=\"Return\" value=\"'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.OK_Button').'\" onclick=\"return save_and_quit();\">\n\t\t';\n\t\t}\n\n\t\t\t// Displays a Cancel-Button at the end of the Page to exit the wizard without changing anything.\n\t\t$this->content.='\n\t\t<input type=\"button\" name=\"cancel\" value=\"'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.Cancel_Button').'\" onclick=\"parent.close();\">\n\t\t</form>\n\t\t</body>\n\t\t</html>\n\t\t';\n\t}", "function menuHtml(){\n //Recupera o menu de acordo com o sistema e usuario.\n $menus = carregarMenus($_SESSION['sisid'], $_SESSION['usucpf']);\n\n //Monta o html com os menus principais. Se tiver este menu tiver itens chama o metodo de montar o html de itens de menu com todos os itens deste menu principal.\n $menusHtml = '';\n foreach ($menus as $menu) {\n\n if (empty($menu['mnuidpai'])) {\n if ($menu['itensMenu'] && count($menu['itensMenu']) > 0) {\n $menusHtml .= '<li class=\"dropdown\">';\n $menusHtml .= '<a class=\"dropdown-toggle\" href=\"#\" data-toggle=\"dropdown\">';\n $menusHtml .= $menu['mnuhtml'];\n $menusHtml .= '<b class=\"caret\"></b>';\n $menusHtml .= '</a>';\n $menusHtml .= '<ul class=\"dropdown-menu\">';\n\n // Monta o html com os itens deste menu principal recursivamente de maneira infinita.\n $menusHtml .= menuItemHtml($menu['itensMenu']);\n\n $menusHtml .= '</ul>';\n $menusHtml .= '</li>';\n } else {\n $menusHtml .= '<li>';\n $menusHtml .= '<a href=\"#\">';\n $menusHtml .= $menu['mnuhtml'];\n $menusHtml .= '</a>';\n $menusHtml .= '</li>';\n }\n\n $menusHtml .= \"\";\n }\n }\n\n return $menusHtml;\n }", "function setMenu($kode_jabatan){\r\n\t\t \r\n\t\t \r\n\t\t$sql = \" SELECT M.KODE_MENU , M.NAMA_MENU, M.KODE_MENU_INDUK, MJ.KODE_MENU as KODE_MENU_MJ FROM EP_MS_MENU M \r\n\t\t\t\t\tLEFT JOIN (SELECT KODE_MENU FROM EP_MS_MENU_JABATAN WHERE KODE_JABATAN = \".$kode_jabatan.\" ) MJ ON M.KODE_MENU = MJ.KODE_MENU\t\r\n\t\t\t\t\tSTART WITH M.KODE_MENU = 0 \r\n\t\t\t\t\tCONNECT BY PRIOR M.KODE_MENU = M.KODE_MENU_INDUK \r\n\t\t\t\t\tORDER BY M.URUT \";\r\n \t\t\r\n \t\t$query = $this->db->query($sql);\r\n \t\t\r\n\t\t$arrModule = array(); \r\n\t\t$xml = new DOMDocument( \"1.0\", \"ISO-8859-15\" );\t \r\n\t\t// $this->addLi($xml, 0,\"\", \"T\" , \"Menu Management\",\"\",\"\");\r\n\t\tforeach ($query->result_array() as $row)\r\n\t\t{\r\n\t\t\t // $arrModule[$row['KODE_MENU']] = $row['NAMA_MENU'];\r\n\t\t\t \r\n\t\t\t if ( $row['KODE_MENU_INDUK'] == 0 ) {\r\n\t\t\t\t$this->addLi($xml, $row['KODE_MENU'] ,$row['KODE_MENU_INDUK'], \"F\" , $row['NAMA_MENU'],\"\" . \"href\" , $row['KODE_MENU_MJ'] );\r\n\t\t\t } else {\r\n\t\t\t\t//$this->addLi($xml, $row['KODE_MENU'] ,'00000000', \"D\" , $row['NAMA_MENU'],\"\" . \"href\");\r\n\t\t\t\t$this->addLi($xml, $row['KODE_MENU'] , $row['KODE_MENU_INDUK'] , \"D\" , $row['NAMA_MENU'], \"\" , $row['KODE_MENU_MJ']);\r\n\t\t\t\t//$this->addLi($xml, $row['mod_code'], substr($row['mod_code'],0,2) . '000000' , \"D\" , $row['mod_name'], base_url() .\"index.php/\" . $row['mod_url']);\r\n\t\t\t }\r\n\t\t}\r\n\t\t$str = $xml->saveXML();\r\n\t\t\r\n\t\treturn $str;\t\r\n\t\t \r\n \r\n\t}", "function ShowVerMenu111()\n{\n\tif (getPara('vermenu','value1')==1)\n\t{\t\n\t\tinclude(\"dbconnect.php\");\n\t\t$str1=\"select * from menu where vermenu=1 order by menuorder \";\n\t\t$result=mysql_query($str1) or\n\t\t\tdie(mysql_error());\n\t\t$id=intval(mysql_real_escape_string($_REQUEST['id'])) ;\n\t\t$pr=intval(mysql_real_escape_string($_REQUEST['pr'])) ;\t\n\t\t\n\t\techo('<tr><td height=\"28\" valign=\"top\"><DIV class=glossymenu>');\n\t\t$submenucount=0;\n\t\twhile($row=mysql_fetch_array($result))\n\t\t{\n\t\n\t\t\tswitch ($row['menutype'])\n\t\t\t{\n\t\t\t\tcase 0: //Muc chinh, trang chu, lien ket den trang index.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"index.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t\tcase 1://Muc con, chua tin tuc con 1 newsgroup, lien ket den trang newsgroup.php\n\t\t\t\t\t$submenucount++;\n\t\t\t\t\techo('<LI><A href=\"newsgroup.php?id='.$row['menuid'].'&pr='.$row['parent'].'\">&nbsp;&nbsp;&nbsp;&nbsp;'.$row['menutitle'].'</A>'); \n\t\t\t\t\tbreak; \n\t\t\t\tcase 2://Muc con, lien ket den trang noi dung cuc bo content.php\n\t\t\t\t\t$submenucount++;\n\t\t\t\t\techo('<LI><A href=\"content.php?id='.$row['menuid'].'&pr='.$row['parent'].'\">&nbsp;&nbsp;&nbsp;&nbsp;'.$row['menutitle'].'</A>'); \n\t\t\t\t\tbreak; \t\t\t\t\t\t\n\t\t\t\tcase 3://Muc CHINH, khong co lien ket\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo(' submenuheader\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"\">'.$row['menutitle'].'</a></EM><DIV class=submenu><UL>'); \n\t\t\t\t\tbreak;\n\t\t\t\tcase 4://Muc CHINH, lien ket ngoai\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"'.$row['link'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t\tcase 5://Muc CHINH, lien ket den trang noi dung cuc bo content.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"content.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6://Muc CHINH, lien ket den trang van ban phap luat lawdocument.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"lawdocument.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7://Muc CHINH, lien ket den trang hoi dap faq.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"faq.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8://Muc CHINH, lien ket den trang lien he contact.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"contact.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 9://Muc CHINH, lien ket den trang so do website webstruct.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"webstruct.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 10://Muc CHINH, trang danh muc cac lien ket, lien ket den trang list.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"list.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\t\n\t\t\t\tcase 11://Muc CHINH, trang lich cong tac, lien ket den trang timetable.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"timetable.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\t\n\t\t\t\tcase 12://Muc CHINH, trang danh ba doanh nghiep, lien ket den trang orglist.php\n\t\t\t\t\tif ($submenucount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$submenucount=0;\n\t\t\t\t\t\techo('</UL></DIV>');\n\t\t\t\t\t}\n\t\t\t\t\techo('<EM class=\"menuitem');echo(template());echo('\"><img src=\"image/point.jpg\" />&nbsp;&nbsp;<a class=\"mainnav\" href=\"orglist.php?id='.$row['menuid'].'\">'.$row['menutitle'].'</a></EM>');\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tcase 13://Muc con, chua tin tuc rss, lien ket den trang rssnews.php\n\t\t\t\t\t$submenucount++;\n\t\t\t\t\techo('<LI><A href=\"rssnews.php?id='.$row['menuid'].'&pr='.$row['parent'].'\">&nbsp;&nbsp;&nbsp;&nbsp;'.$row['menutitle'].'</A>');\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\techo('</DIV></td></tr>');\n\t\n\t\tmysql_free_result($result);\n\t}\t\t\n}", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "function create_options($key, $field) {\n\t\t// defaults\n $defaults = array(\n 'show_target' => false,\n 'default_target' => '_self',\n 'show_title' => false,\n 'classes' => array(),\n );\n\t\t\n $field = array_merge($defaults, $field);\n\n\t\t?> \n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Show target'); ?></label>\n <p class=\"description\"><?php _e('Allow the user to select if the link opens in a new window, etc.'); ?></p>\n </td>\n <td>\n <input type=\"checkbox\" name=\"fields[<?php echo $key; ?>][show_target]\" value=\"1\" <?php if($field['show_target']) echo 'checked=\"checked\"'; ?> />\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Default target'); ?></label>\n </td>\n <td>\n <select name=\"fields[<?php echo $key; ?>][default_target]\">\n <?php foreach( ACF_Link_Field::$targets as $k => $l ): ?>\n <option value=\"<?php echo $k; ?>\" <?php if($k == $field['default_target']) echo 'selected=\"selected\"'; ?>><?php _e($l); ?></option>\n <?php endforeach; ?>\n </select>\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Show title attribute'); ?></label>\n <p class=\"description\"><?php _e('Allow the user to provided text for the title attribute.'); ?></p>\n </td>\n <td>\n <input type=\"checkbox\" name=\"fields[<?php echo $key; ?>][show_title]\" value=\"1\" <?php if($field['show_title']) echo 'checked=\"checked\"'; ?> />\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Styles'); ?></label>\n <p class=\"description\"><?php _e('Provided classes for the user to select a style.<br/><br/>btn-big : Big button'); ?></p>\n </td>\n <td>\n <textarea name=\"fields[<?php echo $key; ?>][classes]\" ><?php \n foreach( $field['classes'] as $class => $label ) {\n echo \"$class : $label\\n\";\n }\n ?></textarea>\n </td>\n </tr>\n\n\t\t<?php\n\t}", "function buildTopicsMenu($topic)\n{\n\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n $column = &$pntable['topics_column'];\n $toplist =& $dbconn->Execute(\"SELECT $column[topicid], $column[topictext], $column[topicname]\n FROM $pntable[topics] ORDER BY $column[topictext]\");\n echo '<strong>'._TOPIC.'</strong>&nbsp;'\n .'<select name=\"topic\">';\n echo \"<option value=\\\"\\\">\"._SELECTTOPIC.\"</option>\\n\";\n\n while(list($topicid, $topics, $topicname) = $toplist->fields) {\n if (pnSecAuthAction(0, 'Topics::Topic', \"$topicname::$topicid\", ACCESS_COMMENT)) {\n $sel='';\n if ($topicid == $topic) {\n $sel='selected=\"selected\"';\n }\n echo '<option value=\"'.pnVarPrepForDisplay($topicid).'\" '.$sel.'>'.pnVarPrepForDisplay($topics).'</option>'.\"\\n\";\n }\n $toplist->MoveNext();\n }\n echo '</select><br />';\n}", "function build_shop_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$shop_list = \"<select name='business_id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$shop_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$shop_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$shop_list .= \"<option value=''>\".$lang['Select_A_Business'].\"</option>\";\n\t\t\t$shop_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title \n\t \t\tFROM \" . GARAGE_BUSINESS_TABLE . \" WHERE retail_shop = 1 OR web_shop = 1\n\t\t\tORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $shop = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$shop_list .= \"<option value='\".$shop['id'].\"'>\".$shop['title'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$shop_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'SHOP_LIST' => $shop_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "function category_browsing_options_form()\r\n\t//admin options for category_browsing_options module\r\n\t{\r\n\t\t$this->body .= \"<tr><td class=\\\"col_hdr\\\" colspan=\\\"2\\\" style=\\\"width: 100%; font-weight: bold; text-align: center;\\\">Options selected below will be applied to the Category Browsing Options Module</td></tr>\";\r\n\t\t$show_options = array (\r\n\t\t\t'cat_browse_opts_as_ddl' => $this->db->get_site_setting('cat_browse_opts_as_ddl'),\r\n\t\t\t'cat_browse_all_listings' => $this->db->get_site_setting('cat_browse_all_listings'),\r\n\t\t\t'cat_browse_end_today' => $this->db->get_site_setting('cat_browse_end_today'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_class_only' => $this->db->get_site_setting('cat_browse_class_only'),\r\n\t\t\t'cat_browse_auc_only' => $this->db->get_site_setting('cat_browse_auc_only'),\r\n\t\t\t'cat_browse_buy_now' => $this->db->get_site_setting('cat_browse_buy_now'),\r\n\t\t\t'cat_browse_buy_now_only' => $this->db->get_site_setting('cat_browse_buy_now_only'),\r\n\t\t\t'cat_browse_auc_bids' => $this->db->get_site_setting('cat_browse_auc_bids'),\r\n\t\t\t'cat_browse_auc_no_bids' => $this->db->get_site_setting('cat_browse_auc_no_bids')\r\n\t\t\t\r\n\t\t);\r\n\t\t$ddlTooltip = geoHTML::showTooltip('Show as Dropdown', 'Choose yes to display the module\\'s options in a dropdown list, or no to show them as a text-based, delimeter-separated list.');\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_opts_as_ddl\",\"Show as Dropdown $ddlTooltip\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_all_listings\",\"All listings\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_end_today\",\"Listings Ending within 24 hours\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_has_pics\",\"Listings with Photos\");\r\n\t\t\r\n\t\tif(geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_class_only\",\"Classifieds only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_only\",\"Auctions only\");\r\n\t\t}\r\n\t\tif(geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now\",\"Auctions using Buy Now\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now_only\",\"Auctions using Buy Now Only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_bids\",\"Auctions with Bids\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_no_bids\",\"Auctions without Bids\");\r\n\t\t}\r\n\t\t\r\n\t}", "function build_category_html($selected)\n\t{\n\t\tglobal $template, $db;\n\n\t $html = '<select name=\"category_id\" class=\"forminput\">';\n\t\n\t $sql = \"SELECT * FROM \" . GARAGE_CATEGORIES_TABLE . \" ORDER BY title ASC\";\n\t\n\t \tif ( !($result = $db->sql_query($sql)) )\n\t \t{\n\t \tmessage_die(GENERAL_ERROR, 'Could not category of mods for vehicle', '', __LINE__, __FILE__, $sql);\n\t \t}\n\t\n\t while ( $row = $db->sql_fetchrow($result) ) \n\t\t{\n\t\t\t$select = ( $selected == $row['id'] ) ? ' selected=\"selected\"' : '';\n\t\t\t$html .= '<option value=\"' . $row['id'] . '\"' . $select . '>' . $row['title'] . '</option>';\n\t }\n\t\n\t $html .= '</select>';\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'CATEGORY_LIST' => $html)\n\t\t);\n\t\n\t\treturn ;\n\t}", "function build_garage_install_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$garage_install_list = \"<select name='install_business_id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$garage_install_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$garage_install_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$garage_install_list .= \"<option value=''>\".$lang['Select_A_Business'].\"</option>\";\n\t\t\t$garage_install_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE garage = 1 ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $garage_list = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$garage_install_list .= \"<option value='\".$garage_list['id'].\"'>\".$garage_list['title'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$garage_install_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'GARAGE_INSTALL_LIST' => $garage_install_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "function propanel_siteoptions_machine($options) {\n \n $counter = 0;\n\t$menu = '';\n\t$output = '';\n\tforeach ($options as $value) {\n\t \n\t\t$counter++;\n\t\t$val = '';\n\t\t//Start Heading\n\t\t if ( $value['type'] != \"heading\" )\n\t\t {\n\t\t \t$class = ''; if(isset( $value['class'] )) { $class = $value['class']; }\n\t\t\t//$output .= '<div class=\"section section-'. $value['type'] .'\">'.\"\\n\".'<div class=\"option-inner\">'.\"\\n\";\n\t\t\t$output .= '<div class=\"section section-'.$value['type'].' '. $class .'\">'.\"\\n\";\n\t\t\t$output .= '<h4 class=\"heading\">'. $value['name'] .'</h3>'.\"\\n\";\n\t\t\t$output .= '<div class=\"option\">'.\"\\n\" . '<div class=\"controls\">'.\"\\n\";\n\n\t\t } \n\t\t //End Heading\n\t\t$select_value = ''; \n\t\tswitch ( $value['type'] ) {\n\t\t\n\t\tcase 'text':\n\t\t\t$val = $value['std'];\n\t\t\t$std = get_option($value['id']);\n\t\t\tif ( $std != \"\") { $val = $std; }\n\t\t\t$output .= '<input class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" type=\"'. $value['type'] .'\" value=\"'. $val .'\" />';\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'select':\n\n\t\t\t$output .= '<select class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\">';\n\t\t\n\t\t\t$select_value = get_option($value['id']);\n\t\t\t \n\t\t\tforeach ($value['options'] as $option) {\n\t\t\t\t\n\t\t\t\t$selected = '';\n\t\t\t\t\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t if ( $select_value == $option) { $selected = ' selected=\"selected\"';} \n\t\t\t } else {\n\t\t\t\t\t if ( isset($value['std']) )\n\t\t\t\t\t\t if ($value['std'] == $option) { $selected = ' selected=\"selected\"'; }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $output .= '<option'. $selected .'>';\n\t\t\t\t $output .= $option;\n\t\t\t\t $output .= '</option>';\n\t\t\t \n\t\t\t } \n\t\t\t $output .= '</select>';\n\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t//@since 2.0 added by denzel to allow value different from label.\n\t\tcase 'select-advance':\n\n\t\t\t$output .= '<select class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\">';\n\t\t\n\t\t\t$select_value = get_option($value['id']);\n\t\t\t \n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t\n\t\t\t\t$selected = '';\n\t\t\t\t\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t if ( $select_value == $key) { $selected = ' selected=\"selected\"';} \n\t\t\t } else {\n\t\t\t\t\t if ( isset($value['std']) )\n\t\t\t\t\t\t if ($value['std'] == $key) { $selected = ' selected=\"selected\"'; }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $output .= '<option value=\"'. $key .'\" '. $selected .'>';\n\t\t\t\t $output .= $option;\n\t\t\t\t $output .= '</option>';\n\t\t\t \n\t\t\t } \n\t\t\t $output .= '</select>';\n\n\t\t\t\n\t\tbreak;\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'fontsize':\n\t\t\n\t\t/* Font Size */\n\t\t\t$val = $default['size'];\n\t\t\tif ( $typography_stored['size'] != \"\") { $val = $typography_stored['size']; }\n\t\t\t$output .= '<select class=\"of-typography of-typography-size\" name=\"'. $value['id'].'_size\" id=\"'. $value['id'].'_size\">';\n\t\t\t\tfor ($i = 9; $i < 71; $i++){ \n\t\t\t\t\tif($val == $i){ $active = 'selected=\"selected\"'; } else { $active = ''; }\n\t\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . $active . '>'. $i .'px</option>'; }\n\t\t\t$output .= '</select>';\n\t\t\n\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"multicheck\":\n\t\t\n\t\t\t$std = $value['std']; \n\t\t\t\n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t$tt_key = $value['id'] . '_' . $key;\n\t\t\t$saved_std = get_option($tt_key);\n\t\t\t\t\t\n\t\t\tif(!empty($saved_std)) \n\t\t\t{ \n\t\t\t\t if($saved_std == 'true'){\n\t\t\t\t\t $checked = 'checked=\"checked\"'; \n\t\t\t\t } \n\t\t\t\t else{\n\t\t\t\t\t $checked = ''; \n\t\t\t\t } \n\t\t\t} \n\t\t\telseif( $std == $key) {\n\t\t\t $checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$checked = ''; }\n\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'. $tt_key .'\" id=\"'. $tt_key .'\" value=\"true\" '. $checked .' /><label for=\"'. $tt_key .'\">'. $option .'</label><br />';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'textarea':\n\t\t\t\n\t\t\t$cols = '8';\n\t\t\t$ta_value = '';\n\t\t\t\n\t\t\tif(isset($value['std'])) {\n\t\t\t\t\n\t\t\t\t$ta_value = $value['std']; \n\t\t\t\t\n\t\t\t\tif(isset($value['options'])){\n\t\t\t\t\t$ta_options = $value['options'];\n\t\t\t\t\tif(isset($ta_options['cols'])){\n\t\t\t\t\t$cols = $ta_options['cols'];\n\t\t\t\t\t} else { $cols = '8'; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t$std = get_option($value['id']);\n\t\t\t\tif( $std != \"\") { $ta_value = stripslashes( $std ); }\n\t\t\t\t$output .= '<textarea class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" cols=\"'. $cols .'\" rows=\"8\">'.$ta_value.'</textarea>';\n\t\t\t\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"radio\":\n\t\t\t\n\t\t\t $select_value = get_option( $value['id']);\n\t\t\t\t \n\t\t\t foreach ($value['options'] as $key => $option) \n\t\t\t { \n\n\t\t\t\t $checked = '';\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t\tif ( $select_value == $key) { $checked = ' checked'; } \n\t\t\t\t } else {\n\t\t\t\t\tif ($value['std'] == $key) { $checked = ' checked'; }\n\t\t\t\t }\n\t\t\t\t$output .= '<input class=\"of-input of-radio\" type=\"radio\" name=\"'. $value['id'] .'\" value=\"'. $key .'\" '. $checked .' />' . $option .'<br />';\n\t\t\t\n\t\t\t}\n\t\t\t \n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"checkbox\": \n\t\t\n\t\t $std = $value['std']; \n\t\t \n\t\t $saved_std = get_option($value['id']);\n\t\t \n\t\t $checked = '';\n\t\t\t\n\t\t\tif(!empty($saved_std)) {\n\t\t\t\tif($saved_std == 'true') {\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t $checked = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $std == 'true') {\n\t\t\t $checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$checked = '';\n\t\t\t}\n\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" value=\"true\" '. $checked .' />';\n\n\t\tbreak;\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"upload\":\n\t\t\t\n\t\t\t$output .= propanel_siteoptions_uploader_function($value['id'],$value['std'],null);\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"upload_min\":\n\t\t\t\n\t\t\t$output .= propanel_siteoptions_uploader_function($value['id'],$value['std'],'min');\n\t\t\t\n\t\tbreak;\n\t\tcase \"color\":\n\t\t\t$val = $value['std'];\n\t\t\t$stored = get_option( $value['id'] );\n\t\t\tif ( $stored != \"\") { $val = $stored; }\n\t\t\t$output .= '<div id=\"' . $value['id'] . '_picker\" class=\"colorSelector\"><div></div></div>';\n\t\t\t$output .= '<input class=\"of-color\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" type=\"text\" value=\"'. $val .'\" />';\n\t\tbreak; \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t\n\t\tcase \"images\":\n\t\t\t$i = 0;\n\t\t\t$select_value = get_option( $value['id']);\n\t\t\t\t \n\t\t\tforeach ($value['options'] as $key => $option) \n\t\t\t { \n\t\t\t $i++;\n\n\t\t\t\t $checked = '';\n\t\t\t\t $selected = '';\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t\tif ( $select_value == $key) { $checked = ' checked'; $selected = 'of-radio-img-selected'; } \n\t\t\t\t } else {\n\t\t\t\t\t\tif ($value['std'] == $key) { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telseif ($i == 1 && !isset($select_value)) { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telseif ($i == 1 && $value['std'] == '') { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telse { $checked = ''; }\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$output .= '<span>';\n\t\t\t\t$output .= '<input type=\"radio\" id=\"of-radio-img-' . $value['id'] . $i . '\" class=\"checkbox of-radio-img-radio\" value=\"'.$key.'\" name=\"'. $value['id'].'\" '.$checked.' />';\n\t\t\t\t$output .= '<div class=\"of-radio-img-label\">'. $key .'</div>';\n\t\t\t\t$output .= '<img src=\"'.$option.'\" alt=\"\" class=\"of-radio-img-img '. $selected .'\" onClick=\"document.getElementById(\\'of-radio-img-'. $value['id'] . $i.'\\').checked = true;\" />';\n\t\t\t\t$output .= '</span>';\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\tbreak; \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"info\":\n\t\t\t$default = $value['std'];\n\t\t\t$output .= $default;\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t \n\t\t\n\t\tcase \"heading\":\n\t\t\t\n\t\t\tif($counter >= 2){\n\t\t\t $output .= '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$jquery_click_hook = ereg_replace(\"[^A-Za-z0-9]\", \"\", strtolower($value['name']) );\n\t\t\t$jquery_click_hook = \"of-option-\" . $jquery_click_hook;\n\t\t\t$menu .= '<li><a title=\"'. $value['name'] .'\" href=\"#'. $jquery_click_hook .'\">'. $value['name'] .'</a></li>';\n\t\t\t$output .= '<div class=\"group\" id=\"'. $jquery_click_hook .'\"><h2>'.$value['name'].'</h2>'.\"\\n\";\n\t\tbreak; \n\t\t} \n\t\t\n\t\t// if TYPE is an array, formatted into smaller inputs... ie smaller values\n\t\tif ( is_array($value['type'])) {\n\t\t\tforeach($value['type'] as $array){\n\t\t\t\n\t\t\t\t\t$id = $array['id']; \n\t\t\t\t\t$std = $array['std'];\n\t\t\t\t\t$saved_std = get_option($id);\n\t\t\t\t\tif($saved_std != $std){$std = $saved_std;} \n\t\t\t\t\t$meta = $array['meta'];\n\t\t\t\t\t\n\t\t\t\t\tif($array['type'] == 'text') { // Only text at this point\n\t\t\t\t\t\t \n\t\t\t\t\t\t $output .= '<input class=\"input-text-small of-input\" name=\"'. $id .'\" id=\"'. $id .'\" type=\"text\" value=\"'. $std .'\" />'; \n\t\t\t\t\t\t $output .= '<span class=\"meta-two\">'.$meta.'</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tif ( $value['type'] != \"heading\" ) { \n\t\t\tif ( $value['type'] != \"checkbox\" ) \n\t\t\t\t{ \n\t\t\t\t$output .= '<br/>';\n\t\t\t\t}\n\t\t\tif(!isset($value['desc'])){ $explain_value = ''; } else{ $explain_value = $value['desc']; } \n\t\t\t$output .= '</div><div class=\"explain\">'. $explain_value .'</div>'.\"\\n\";\n\t\t\t$output .= '<div class=\"clear\"> </div></div></div>'.\"\\n\";\n\t\t\t}\n\t \n\t}\n $output .= '</div>';\n return array($output,$menu);\n\n}", "function buildMenu($parent, $menu)\n {\n $html = \"\";\n if (isset($menu['parents'][$parent])) {\n foreach ($menu['parents'][$parent] as $itemId) {\n $href = '';\n $title_text = '';\n $active = '';\n if (!isset($menu['parents'][$itemId])) {\n $href = $this->url . $menu['items'][$itemId][$this->link_Column];\n $title_text = stripslashes($menu['items'][$itemId][$this->title_Column]);\n if ($this->active_link == $menu['items'][$itemId][$this->link_Column]) {\n $active = $this->active_class;\n }\n\n $parent_html = str_replace(array('{href}', '{link_text}', '{title}', '{has_child}', '{active_class}'), array($href, $title_text, $title_text, $this->has_child_html, $active), $this->parent_li_start);\n\n if (count($this->search) > 0) {\n foreach ($this->search as $k => $s) {\n $parent_html = str_replace($s, $menu['items'][$itemId][$this->replace[$k]], $parent_html);\n }\n }\n $html .= $parent_html;\n\n if (!empty($this->call_func)) {\n $html .= call_user_func($this->call_func, $menu['items'][$itemId], $this->selected);\n }\n $html .= $this->parent_li_end;\n\n }\n if (isset($menu['parents'][$itemId])) {\n $href = $this->url . $menu['items'][$itemId][$this->link_Column];\n $title_text = stripslashes($menu['items'][$itemId][$this->title_Column]);\n if ($this->active_link == $menu['items'][$itemId][$this->link_Column]) {\n $active = $this->active_class;\n }\n\n $parent_html = str_replace(array('{href}', '{link_text}', '{title}', '{has_child}', '{active_class}'), array($href, $title_text, $title_text, $this->has_child_html,$active), $this->child_li_start);\n if (count($this->search) > 0) {\n foreach ($this->search as $k => $s) {\n $parent_html = str_replace($s, $menu['items'][$itemId][$this->replace[$k]], $parent_html);\n }\n }\n $html .= $parent_html;\n if (!empty($this->call_func)) {\n $html .= call_user_func($this->call_func, $menu['items'][$itemId], $this->selected);\n }\n\n $html .= $this->child_ul_start;\n $html .= $this->buildMenu($itemId, $menu);\n $html .= $this->child_ul_end;\n $html .= $this->child_li_end;\n\n }\n }\n }\n return $html;\n }", "function showNavigation() {\n $action = $this->action;\n $start = $this->start;\n $amount = $this->amount;\n $minamount = $this->minamount;\n $maxamount = $this->maxamount;\n $blogid = $this->blogid;\n $search = hsc($this->search);\n $itemid = $this->itemid;\n\n $prev = $start - $amount;\n if ($prev < $minamount) $prev=$minamount;\n\n $enable_cat_select = in_array($action , array('itemlist' , 'browseownitems'));\n if ($enable_cat_select)\n $catid = isset($_POST['catid']) ? max(0,intval($_POST['catid'])) : 0;\n\n // maxamount not used yet\n // if ($start + $amount <= $maxamount)\n $next = $start + $amount;\n // else\n // $next = $start;\n\n ?>\n <table class=\"navigation\">\n <tr><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"submit\" value=\"&lt;&lt; <?php echo _LISTS_PREV?>\" />\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $prev; ?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input name=\"amount\" size=\"3\" value=\"<?php echo $amount; ?>\" /> <?php echo _LISTS_PERPAGE?>\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $start; ?>\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"submit\" value=\"&gt; <?php echo _LISTS_CHANGE?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <?php if ($enable_cat_select) echo $this->getFormSelectCategoryBlog($action, $blogid , $catid); ?>\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"0\" />\n <input type=\"text\" name=\"search\" value=\"<?php echo $search; ?>\" size=\"16\" />\n <input type=\"submit\" value=\"&gt; <?php echo _LISTS_SEARCH?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"submit\" value=\"<?php echo _LISTS_NEXT?> &gt; &gt;\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $next; ?>\" />\n </div></form>\n </td></tr>\n </table>\n <?php }", "function showHTMLNavigationMenu() {\r\n\t// postavljamo polje sa navigacijskim linkovima\r\n\t$menu = array(\r\n\t\t'/bankomati_RTM1/index2.php' => 'Početna',\r\n\t\t'/bankomati_RTM1/bankomati/bankomati_prikaz.php' => 'Baza bankomata',\r\n\t\t'/bankomati_RTM1/punjenja/punjenja_prikaz.php' => 'Punjenje bankomata',\r\n\t\t'/bankomati_RTM1/punjenja_baza/punjenja_prikaz.php' => 'Baza punjenja'\r\n\t\t\r\n\t);\r\n\r\n\t// generiramo HTML linkove i spremamo ih u array\r\n\t$linkovi_arr = array();\r\n\tforeach ($menu as $link => $naslov) {\r\n\t\t$linkovi_arr[] = '<a href=\"' . $link . '\">' . $naslov . '</a>';\r\n\t}\r\n\r\n\t// sada prikažemo imlodirani array sa separatorima i horizontalkom za razdvajanje\r\n\techo implode(' || ', $linkovi_arr);\r\n\techo '<hr/>';\r\n}", "function dropdown_menu($p_title, $p_items, $p_color = '', $p_icon = '', $p_class = ''){\n\t$t_padding_button = '0px';\n\t$t_padding_icon_left = '0px';\n\t$t_padding_icon_right = '10px';\n\n\tif($p_color == ''){\n\t\t$t_padding_button = '10px';\n\t\t$t_padding_icon_left = '5px';\n\t\t$t_padding_icon_right = '5px';\n\t}\n\n\t# button group and navigation bar header\n\techo '<div class=\"btn-group\">';\n\techo '<ul class=\"nav ace-nav\" style=\"padding-left:'. $t_padding_button . ';padding-right:' . $t_padding_button . '\">';\n\n\t# color\n\tif($p_color != '')\n\t\techo '<li class=\"' . $p_color . '\">';\n\n\techo '<a data-toggle=\"dropdown\" href=\"#\" class=\"dropdown-toggle\">';\n\n\t# title icon\n\tif($p_icon != '')\n\t\techo '<i class=\"ace-icon fa ' . $p_icon . '\" style=\"padding-right:' . $t_padding_icon_right . '\"></i>';\n\n\t# title\n\techo $p_title . '<i class=\"ace-icon ' . $p_color . ' fa fa-angle-down\" style=\"padding-left:' . $t_padding_icon_left . '\"></i>';\n\techo '</a>';\n\n\t# menu items\n\techo '<ul class=\"dropdown-menu scrollable-menu ' . $p_class . '\">';\n\n\tforeach($p_items as $t_item){\n\t\t$t_label = $t_item['label'];\n\t\t$t_data = $t_item['data'];\n\n\t\tif($t_label == 'header'){\n\t\t\techo '<li class=\"dropdown-header\">' . $t_data . '</li>';\n\t\t}\n\t\telse if($t_label == 'divider'){\n\t\t\techo '<li class=\"divider\"/>';\n\t\t}\n\t\telse if($t_label == 'bare'){\n\t\t\techo $t_data;\n\t\t}\n\t\telse{\n\t\t\t$t_class = '';\n\n\t\t\tif(isset($t_data['class']))\n\t\t\t\t$t_class = 'class=\"' . $t_data['class'] . '\"';\n\n\t\t\techo '<li><a ' . $t_class . ' href=\"' . $t_data['link'] . '\">';\n\n\t\t\tif(isset($t_data['icon']) && $t_data['icon'] != '')\n\t\t\t\techo '<i class=\"ace-icon fa ' . $t_data['icon'] . '\" style=\"padding-right:5px\"></i>';\n\t\t\t\t\n\t\t\techo $t_label;\n\t\t\techo '</a></li>';\n\t\t}\n\t}\n\n\techo '</ul>';\n\n\tif($p_color)\n\t\techo '</li>';\n\n\techo '</ul>';\n\techo '</div>';\n}", "public function buildMenu($params)\n {\n\n $iconMenu = '<i class=\"icon-reorder\" ></i>';\n $iconClose = '<i class=\"icon-remove \" ></i>';\n $iconEntity = $this->view->icon('control/entity.png' , 'Entity' );\n\n $entries = new TArray();\n\n $this->content = <<<HTML\n\n <div class=\"inline\" >\n <button\n class=\"wcm wcm_control_dropmenu wgt-button\"\n id=\"{$this->id}-control\"\n wgt_drop_box=\"{$this->id}\" ><i class=\"icon-reorder\" ></i> {$this->view->i18n->l('Menu','wbf.label')}</button>\n <var id=\"{$this->id}-control-cfg-dropmenu\" >{\"triggerEvent\":\"mouseover\",\"closeOnLeave\":\"true\"}</var>\n </div>\n\n <div class=\"wgt-dropdownbox\" id=\"{$this->id}\" >\n <ul>\n <li>\n <a class=\"wgtac_close\" ><i class=\"icon-remove\" ></i> {$this->view->i18n->l('Close', 'wbf.label')}</a>\n </li>\n </ul>\n </div>\n\nHTML;\n\n $this->content .= $this->crumbs;\n\n $this->content .= <<<HTML\n<div class=\"right\" >\n <input\n type=\"text\"\n id=\"wgt-input-webfrap_navigation_search-tostring\"\n name=\"key\"\n class=\"large wcm wcm_ui_autocomplete wgt-ignore\" />\n <var class=\"wgt-settings\" >\n {\n \"url\" : \"ajax.php?c=Webfrap.Navigation.search&amp;key=\",\n \"type\" : \"ajax\"\n }\n </var>\n <button\n id=\"wgt-button-webfrap_navigation_search\"\n class=\"wgt-button append\"\n >\n <i class=\"icon-search\" ></i> Search\n </button>\n\n</div>\nHTML;\n\n }" ]
[ "0.6058666", "0.60178965", "0.5940343", "0.5935906", "0.5905077", "0.58860296", "0.5878154", "0.58754545", "0.5836456", "0.5830238", "0.5822447", "0.57571167", "0.575532", "0.5742538", "0.5730543", "0.5719432", "0.57138675", "0.5708429", "0.5697653", "0.5676176", "0.56688136", "0.5666734", "0.566548", "0.5664387", "0.56415415", "0.56219196", "0.5621721", "0.5617137", "0.56137305", "0.5607436" ]
0.8024555
0
/ Clean email / Clean email address
function clean_email($email = "") { $email = trim($email); $email = str_replace( " ", "", $email ); //----------------------------------------- // Check for more than 1 @ symbol //----------------------------------------- if ( substr_count( $email, '@' ) > 1 ) { return FALSE; } $email = preg_replace( "#[\;\#\n\r\*\'\"<>&\%\!\(\)\{\}\[\]\?\\/\s]#", "", $email ); if ( preg_match( "/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/", $email) ) { return $email; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize_email($email)\n {\n }", "function sanitizeEmail() {\n $pattern = \"/^[A-Z0-9._%+\\-]+@[A-Z0-9.\\-]+\\.[A-Z]{2,}$/i\";\n if (preg_match($pattern, $this->email)) {\n $this->email = filter_var($this->email, FILTER_SANITIZE_EMAIL);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function filterEmail($email, $chars = ''){\r\n $email = trim(str_replace( array(\"\\r\",\"\\n\"), '', $email ));\r\n if( is_array($chars) ) $email = str_replace( $chars, '', $email );\r\n $email = preg_replace( '/(cc\\s*\\:|bcc\\s*\\:)/i', '', $email );\r\n return $email;\r\n}", "function sanitize_email( $email ) {\n\t// Test for the minimum length the email can be\n\tif ( strlen( $email ) < 3 ) {\n\t\t/**\n\t\t * Filter a sanitized email address.\n\t\t *\n\t\t * This filter is evaluated under several contexts, including 'email_too_short',\n\t\t * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',\n\t\t * 'domain_no_periods', 'domain_no_valid_subs', or no context.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $email The sanitized email address.\n\t\t * @param string $email The email address, as provided to sanitize_email().\n\t\t * @param string $message A message to pass to the user.\n\t\t */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_too_short' );\n\t}\n\n\t// Test for an @ character after the first position\n\tif ( strpos( $email, '@', 1 ) === false ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_no_at' );\n\t}\n\n\t// Split out the local and domain parts\n\tlist( $local, $domain ) = explode( '@', $email, 2 );\n\n\t// LOCAL PART\n\t// Test for invalid characters\n\t$local = preg_replace( '/[^a-zA-Z0-9!#$%&\\'*+\\/=?^_`{|}~\\.-]/', '', $local );\n\tif ( '' === $local ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );\n\t}\n\n\t// DOMAIN PART\n\t// Test for sequences of periods\n\t$domain = preg_replace( '/\\.{2,}/', '', $domain );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );\n\t}\n\n\t// Test for leading and trailing periods and whitespace\n\t$domain = trim( $domain, \" \\t\\n\\r\\0\\x0B.\" );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );\n\t}\n\n\t// Split the domain into subs\n\t$subs = explode( '.', $domain );\n\n\t// Assume the domain will have at least two subs\n\tif ( 2 > count( $subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );\n\t}\n\n\t// Create an array that will contain valid subs\n\t$new_subs = array();\n\n\t// Loop through each sub\n\tforeach ( $subs as $sub ) {\n\t\t// Test for leading and trailing hyphens\n\t\t$sub = trim( $sub, \" \\t\\n\\r\\0\\x0B-\" );\n\n\t\t// Test for invalid characters\n\t\t$sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );\n\n\t\t// If there's anything left, add it to the valid subs\n\t\tif ( '' !== $sub ) {\n\t\t\t$new_subs[] = $sub;\n\t\t}\n\t}\n\n\t// If there aren't 2 or more valid subs\n\tif ( 2 > count( $new_subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );\n\t}\n\n\t// Join valid subs into the new domain\n\t$domain = join( '.', $new_subs );\n\n\t// Put the email back together\n\t$email = $local . '@' . $domain;\n\n\t// Congratulations your email made it!\n\t/** This filter is documented in wp-includes/formatting.php */\n\treturn apply_filters( 'sanitize_email', $email, $email, null );\n}", "function sEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_SANITIZE_EMAIL );\r\n\t\t \r\n\t\t}", "public function sanitizeEmail($data){\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\n return $data;\n }", "function sanitize_email(string $text = '')\n{\n return filter_var(strtolower(trim($text)), FILTER_SANITIZE_EMAIL);\n}", "private function filtrarEmail($original_email)\n{\n $clean_email = filter_var($original_email,FILTER_SANITIZE_EMAIL);\n if ($original_email == $clean_email && filter_var($original_email,FILTER_VALIDATE_EMAIL))\n {\n return $original_email;\n }\n\n}", "public function filterEmail($email) {\n \n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n \n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return \"$email\"; \n } else {\n die(\"$email is Invalid email\");\n }\n\n }", "function string_email( $p_string ) \r\n{\r\n\t$p_string = string_strip_hrefs( $p_string );\r\n\treturn $p_string;\r\n}", "function sanitize_email($value)\n{\n return filter_var($value, FILTER_SANITIZE_EMAIL);\n}", "protected static function filter_sanitize_email($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_EMAIL); \n\t}", "public function testEmail() {\n $this->assertEquals('[email protected]', Sanitize::email('em<a>[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('email+t(a)[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('em\"ail+t(a)[email protected]'));\n }", "protected function cleanEmail($email) {\n\t\tif(is_array($email)) {\n\t\t\t$cleanEmails = array();\n\t\t\tforeach($email as $em) {\n\t\t\t\t$cleanEmails[] = (preg_match('/\\<(.*?)\\>/', $em, $match)) ? $match[1] : $em;\n\t\t\t}\n\t\t\treturn $cleanEmails;\n\t\t}\n\t\telse {\n\t\t\t$cleanEmail = (preg_match('/\\<(.*?)\\>/', $email, $match)) ? $match[1] : $email;\n\t\t\treturn $cleanEmail;\n\t\t}\n\t}", "function cleanInput ($input) { // meie e-mail jõuab siia ning salvestatakse inputi sisse\n\n //input = sisestatud e-mail\n\n $input = trim ($input);\n $input = stripslashes ($input); //võtab kaldkriipsud ära\n $input = htmlspecialchars ($input); //\n return $input;\n}", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "function charrestore_validemail($email)\n{\n\t$is_valid = TRUE;\n\t$atIndex = strrpos($email, \"@\");\n\tif( is_bool($atIndex) && !$atIndex )\n\t{\n\t\t$is_valid = FALSE;\n\t}\n\telse\n\t{\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif( $localLen < 1 || $localLen > 64 )\n\t\t{\n\t\t\t// local part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $domainLen < 1 || $domainLen > 255 )\n\t\t{\n\t\t\t// domain part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $local[0] == '.' || $local[$localLen-1] == '.' )\n\t\t{\n\t\t\t// local part starts or ends with '.'\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $local) )\n\t\t{\n\t\t\t// local part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain) )\n\t\t{\n\t\t\t// character not valid in domain part\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $domain))\n\t\t{\n\t\t\t// domain part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local)) )\n\t\t{\n\t\t\t// character not valid in local part unless \n\t\t\t// local part is quoted\n\t\t\tif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t\t{\n\t\t\t\t$is_valid = FALSE;\n\t\t\t}\n\t\t}\n\t\tif ($is_valid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) )\n\t\t{\n\t\t\t// domain not found in DNS\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t}\n\treturn $is_valid;\n}", "public function filterEmail($email)\n {\n $rule = array(\n \"\\r\" => '',\n \"\\n\" => '',\n \"\\t\" => '',\n '\"' => '',\n ',' => '',\n '<' => '',\n '>' => ''\n );\n $email = strtr($email, $rule);\n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n return $email;\n }", "function checkEmail($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function mangle_email($s) {\r\n\treturn preg_match('/([^@\\s]+)@([-a-z0-9]+\\.)+[a-z]{2,}/is', '<$1@...>', $s);\r\n}", "public function TestEmail($data) {\r\n $data = trim($data);\r\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\r\n $data = filter_var($data,FILTER_VALIDATE_EMAIL);\r\n return $data;\r\n }", "function check_email($data){\n if(isset($data)){\n $sanitized = filter_var($data, FILTER_SANITIZE_EMAIL);\n if (filter_var($sanitized, FILTER_VALIDATE_EMAIL)){\n $data = $sanitized;\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n } \n }\n}", "private function cleanEmail($email)\n { \n foreach($email as $email)\n $return[] = trim(strtolower($email));\n \n return $return;\n }", "function UnMangle($email)\n{\n\tif (AT_MANGLE != \"\")\n\t\t$email = str_replace(AT_MANGLE,\"@\",$email);\n\treturn ($email);\n}", "function is_email_address_unsafe($user_email)\n {\n }", "public function email()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_EMAIL);\n\t}", "function MaskUserEMail($email){\n\n\t\t$maskedEMail = '';\n\t\t$positionOfAt = strpos($email, '@');\n\t\t$maskedEMail .= substr($email, 0,1);\n\t\tfor($i=1; $i < strlen($email); $i++) {\n\t\t\tif($i < $positionOfAt-1 || $i > $positionOfAt + 1)\n\t\t\t\t$maskedEMail .= '*';\n\t\t\telse\n\t\t\t\t$maskedEMail .= substr($email, $i,1);\n\t\t}\n\t\t$maskedEMail .= substr($email, $i-1,1);\n\t\treturn $maskedEMail;\n\t}", "function vEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_VALIDATE_EMAIL );\r\n\t\t \r\n\t\t}", "public function test_sanitized_email() {\n\t\t$actual = wp_create_user_request( 'some(email<withinvalid\\[email protected]', 'export_personal_data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( '[email protected]', $post->post_title );\n\t}", "function clean_string($string)\n{\n $bad = array(\"content-type\", \"bcc:\", \"to:\", \"cc:\", \"href\");\n return str_replace($bad, \"\", $string);\n}" ]
[ "0.769066", "0.7650318", "0.7590176", "0.75405896", "0.75123405", "0.74787223", "0.7404086", "0.72803605", "0.7268289", "0.7249504", "0.7205801", "0.71603775", "0.7108046", "0.69973475", "0.6991326", "0.6958369", "0.69326776", "0.6932009", "0.69287056", "0.6891735", "0.68669254", "0.68216664", "0.67611665", "0.67252356", "0.67012566", "0.66542345", "0.6648461", "0.6627998", "0.65974236", "0.6572645" ]
0.7857631
0
/ Returns the offset needed and stuff quite groovy. / Calculates the user's time offset
function get_time_offset() { $r = 0; $r = ( (isset($this->member['time_offset']) AND $this->member['time_offset'] != "") ? $this->member['time_offset'] : $this->vars['time_offset'] ) * 3600; if ( $this->vars['time_adjust'] ) { $r += ($this->vars['time_adjust'] * 60); } if ( isset($this->member['dst_in_use']) AND $this->member['dst_in_use'] ) { $r += 3600; } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_system_gmt_offset() {\n static $offset = null;\n\n if($offset === null) {\n $timezone_offset = ConfigOptions::getValue('time_timezone');\n $dst = ConfigOptions::getValue('time_dst');\n\n $offset = $dst ? $timezone_offset + 3600 : $timezone_offset;\n } // if\n\n return $offset;\n }", "public function getTimezoneOffset()\n\t{\n\t\t$user_tz = date_default_timezone_get();\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\tif ($viewer -> getIdentity())\n\t\t{\n\t\t\t$user_tz = $viewer -> timezone;\n\t\t}\n\t\t//user time zone\n\t\tdate_default_timezone_set($user_tz);\n\n\t\t$t1 = strtotime('2010-10-10 00:00:00');\n\t\tdate_default_timezone_set('UTC');\n\t\t$t2 = strtotime('2010-10-10 00:00:00');\n\t\treturn (int)(($t2 - $t1) / 3600);\n\t}", "function getTimeOffset()\n {\n return $this->_props['TimeOffset'];\n }", "function getTimezoneOffset() {\n\t\tglobal $wpdb;\n\t\t//calculate mysql timezone offset by converting MySQL's \n\t\t// NOW() to a timestamp and subtracting UTC current time\n\t\t// from it. Note: conversion to timestamp is affected by\n\t\t// PHP TZ setting, so remove that offset from calculation\n\t\t$tzoffset=false;\n\t\t$mysql_now = $wpdb->get_var(\"SELECT NOW() AS mysql_now\");\n\t\t$now = ((int)(time()/1800))*1800; //truncate to 1/2 hour\n\t\tif ($mysql_now!=\"\") {\n\t\t\tif (function_exists('date_timestamp_get')) {\n\t\t\t\t$mysql_dt = new DateTime($mysql_now);\n\t\t\t\t$mysql_time = $mysql_dt->getTimestamp();\n\t\t\t\t$adjust = $mysql_dt->getOffset();\n\t\t\t} else {\n\t\t\t\t$mysql_time = strtotime($mysql_now);\n\t\t\t\t$adjust = (int)date('Z');\n\t\t\t}\n\t\t\t$tzoffset = ((int)($mysql_time/1800))*1800 - $now;\n\t\t\tif (is_numeric($adjust)) $tzoffset += $adjust;\n\t\t}\n\t\treturn $tzoffset;\n\t}", "function get_user_gmt_offset($user = null) {\n static $offset = array();\n\n if(!instance_of($user, 'User')) {\n $user = get_logged_user();\n } // if\n\n if(!instance_of($user, 'User')) {\n return get_system_gmt_offset();\n } // if\n\n if(!isset($offset[$user->getId()])) {\n $timezone_offset = UserConfigOptions::getValue('time_timezone', $user);\n $dst = UserConfigOptions::getValue('time_dst', $user);\n\n $offset[$user->getId()] = $dst ? $timezone_offset + 3600 : $timezone_offset;\n } // if\n\n return $offset[$user->getId()];\n }", "function getOffset(){\r\n $t=time()+microtime()-$this->api->start_time;\r\n $res=$t-$this->offset;\r\n $this->offset=$t;\r\n return $res;\r\n }", "function getTimeZoneOffset($timezone = 'GMT') {\r\r\n \r\r\n /** TimeZone Information */\r\r\n $_WorldTimeZoneInformation = array (\r\r\n \r\r\n 'Australian Central Daylight Time' => array (\r\r\n 'offset' => '+10.30', \r\r\n 'timezone' => 'ACDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ashmore and Cartier Islands Time' => array (\r\r\n 'offset' => '+8.00', \r\r\n 'timezone' => 'ACIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Standard Time' => array (\r\r\n 'offset' => '+9.30', \r\r\n 'timezone' => 'ACST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Acre Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'ACT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Western Daylight Time' => array (\r\r\n 'offset' => '+9.45', \r\r\n 'timezone' => 'ACWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Western Standard Time' => array (\r\r\n 'offset' => '+8.45', \r\r\n 'timezone' => 'ACWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Arabia Daylight Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'ADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Atlantic Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Eastern Daylight Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'AEDT',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Australian Eastern Standard Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'AEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Afghanistan Time' => array (\r\r\n 'offset' => '+4.30', \r\r\n 'timezone' => 'AFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Alaska Daylight Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'AKDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Alaska Standard Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'AKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Armenia Daylight Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'AMDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Armenia Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'AMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Anadyr’ Summer Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'ANAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Anadyr’ Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'ANAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Apo Island Time' => array (\r\r\n 'offset' => '+8.15', \r\r\n 'timezone' => 'APO',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Argentina Daylight Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'ARDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Argentina Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ART',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Al Manamah Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Arabia Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Arabic Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Atlantic Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Western Daylight Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'AWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Western Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'AWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azores Daylight Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'AZODT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azores Standard Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'AZOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azerbaijan Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'AZST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azerbaijan Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'AZT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Baker Island Time' => array (\r\r\n 'offset' => '-12', \r\r\n 'timezone' => 'BIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bangladesh Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Eastern Standard Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'BEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brunei Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'BDT',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'British Indian Ocean Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BIOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bolivia Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'BOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazilia Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'BRST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazilia Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'BRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'British Summer Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'BST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bhutan Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BTT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Western Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'BWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Western Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'BWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chinese Antarctic Standard Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'CAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Africa Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'CAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cocos Islands Time' => array (\r\r\n 'offset' => '+6.30', \r\r\n 'timezone' => 'CCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Daylight Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'CDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Europe Summer Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'CEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Europe Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'CET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Greenland Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'CGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Greenland Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'CGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chatham Island Daylight Time' => array (\r\r\n 'offset' => '+13.45', \r\r\n 'timezone' => 'CHADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chatham Island Standard Time' => array (\r\r\n 'offset' => '+12.45', \r\r\n 'timezone' => 'CHAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chamorro Standard Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'ChST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Clipperton Island Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'CIST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cook Island Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'CKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chile Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'CLDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chile Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'CLST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Colombia Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'COT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Standard Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'CST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'China Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'CST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cape Verde Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'CVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Christmas Island Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'CXT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Davis Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'DAVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'District de Terre Adélie Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'DTAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Easter Island Daylight Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'EADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Easter Island Standard Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'EAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Africa Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'EAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ecuador Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'ECT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Daylight Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'EDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Europe Summer Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'EEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Europe Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'EET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Greenland Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'EGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Greenland Summer Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'EGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Kazakhstan Standard Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'EKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Standard Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'EST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Fiji Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'FJT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Falkland Island Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'FKDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Falkland Island Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'FKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Galapagos Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'GALT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Georgia Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'GET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'French Guiana Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'GFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gilbert Island Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'GILT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gambier Island Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'GIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Greenwich Meantime' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'GMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gulf Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'GST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'South Georgia and the South Sandwich Islands' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'GST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Guyana Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'GYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hawaii - Aleutian Daylight Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'HADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hawaii - Aleutian Standard Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'HAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hong Kong Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'HKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Heard and McDonald Islands Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'HMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îles Crozet Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'ICT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Indochina Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'ICT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ireland Daylight Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'IDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Israel Daylight Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'IDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îran Daylight Time' => array (\r\r\n 'offset' => '+4.30', \r\r\n 'timezone' => 'IRDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Irkutsk Summer Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'IRKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Irkutsk Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'IRKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îran Standard Time' => array (\r\r\n 'offset' => '+3.30', \r\r\n 'timezone' => 'IRST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Indian Standard Time' => array (\r\r\n 'offset' => '+5.30', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ireland Standard Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Israel Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Juan Fernandez Islands Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'JFDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Juan Fernandez Islands Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'JFST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Japan Standard Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'JST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kyrgyzstan Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'KGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kyrgyzstan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'KGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Krasnoyarsk Summer Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'KRAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Krasnoyarsk Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'KRAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kosrae Standard Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'KOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Khovd Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'KOVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Khovd Summer Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'KOVST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Korea Standard Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'KST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Lord Howe Daylight Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'LHDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Lord Howe Standard Time' => array (\r\r\n 'offset' => '+10.30', \r\r\n 'timezone' => 'LHST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Line Island Time' => array (\r\r\n 'offset' => '+14', \r\r\n 'timezone' => 'LINT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Sri Lanka Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'LKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Magadan Island Summer Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'MAGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Magadan Island Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'MAGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mawson Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'MAWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Macclesfield Bank Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MBT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mountain Daylight Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'MDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Marquesas Islands Time' => array (\r\r\n 'offset' => '-9.30', \r\r\n 'timezone' => 'MIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Marshall Islands Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'MHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Myanmar Time' => array (\r\r\n 'offset' => '+6.30', \r\r\n 'timezone' => 'MMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mongolia Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MNT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mongolia Summer Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'MNST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Moscow Summer Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'MSD',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Moscow Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'MSK',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mountain Standard Time' => array (\r\r\n 'offset' => '-7', \r\r\n 'timezone' => 'MST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mauritius Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'MUST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mauritius Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'MUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Maldives Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'MVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Malaysia Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Caledonia Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'NCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Newfoundland Daylight Time' => array (\r\r\n 'offset' => '-2.30', \r\r\n 'timezone' => 'NDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Norfolk Time' => array (\r\r\n 'offset' => '+11.30', \r\r\n 'timezone' => 'NFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Nepal Time' => array (\r\r\n 'offset' => '+5.45', \r\r\n 'timezone' => 'NPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Nauru Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'NRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Novosibirsk Summer Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'NOVST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Novosibirsk Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'NOVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Newfoundland Standard Time' => array (\r\r\n 'offset' => '-3.30', \r\r\n 'timezone' => 'NST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Niue Time' => array (\r\r\n 'offset' => '-11', \r\r\n 'timezone' => 'NUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Zealand Daylight Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'NZDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Zealand Standard Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'NZST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Omsk Summer Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'OMSK',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Omsk Standard Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'OMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pacific Daylight Time' => array (\r\r\n 'offset' => '-7', \r\r\n 'timezone' => 'PDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Petropavlovsk Summer Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'PETST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Peru Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'PET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Petropavlovsk Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'PETT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Papua New Guinea Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'PGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Phoenix Island Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'PHOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Philippines Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paracel Islands Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Peter Island Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pratas Islands' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pakistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'PKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pakistan Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'PKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pierre & Miquelon Daylight Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'PMDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pierre & Miquelon Standard Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'PMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pohnpei Standard Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'PONT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pacific Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'PST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pitcairn Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'PST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Palau Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'PWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paraguay Summer Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'PYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paraguay Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'PYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Réunion Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'RET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Rothera Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ROTT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samara Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'SAMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samara Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'SAMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'South Africa Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'SAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Solomon Island Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'SBT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Santa Claus Delivery Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'SCDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Santa Claus Standard Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'SCST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Seychelles Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'SCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Singapore Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Spratly Islands Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Sierra Leone Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'SLT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Suriname Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'SRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samoa Standard Time' => array (\r\r\n 'offset' => '-11', \r\r\n 'timezone' => 'SST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Scarborough Shoal Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Syrian Summer Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'SYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Syrian Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'SYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tahiti Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'AHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'French Southern and Antarctic Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tajikistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TJT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tokelau Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'TKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Turkmenistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tonga Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'TOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Timor Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'TPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Truk Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'TRUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tuvalu Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'TVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Taiwan Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'TWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Universal Coordinated Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'UTC',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uruguay Standard Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'UYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uruguay Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'UYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uzbekistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'UZT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vladivostok Summer Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'VLAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vladivostok Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'VLAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vostok Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'VOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Venezuela Standard Time' => array (\r\r\n 'offset' => '-4.30', \r\r\n 'timezone' => 'VST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vanuatu Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'VUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Africa Summer Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'WAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Africa Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'WAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Europe Summer Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'WEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Europe Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'WET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Wallis and Futuna Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'WFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Barat' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'WIB',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Timur' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'WIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Tengah' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'WITA',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'West Kazakhstan Standard Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'WKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yakutsk Summer Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'YAKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yakutsk Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'YAKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yap Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'YAPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yekaterinburg Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'YEKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yekaterinburg Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'YEKT',\r\r\n 'enabled' => true,\r\r\n ), \r\r\n );\r\r\n \r\r\n\r\r\n /** Find Timezone Offset */\r\r\n foreach ($_WorldTimeZoneInformation as $timezone_name => $timezone_info) {\r\r\n if ($timezone_info['enabled']) {\r\r\n if ($timezone_info['timezone'] == strtoupper($timezone)) {\r\r\n return $timezone_info['offset'];\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n return 0;\r\r\n }", "function getOffset() {\n\t\treturn ((float) $this->_offset) / 3600.0;\n\t}", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "private function get_offset() {\n\t\treturn ( (time() - $this->skew) % ($this->lifetime + $this->skew) );\n\t}", "function date_tz_offset($timestamp, $from_tz, $to_tz='') {\n\tif($to_tz == '') $to_tz = $GLOBALS['env']['timezone'];\n\n\tif(function_exists('date_offset_get')) {\n\t\t$from_dtz = new DateTimeZone($from_tz);\n\t\t$to_dtz = new DateTimeZone($to_tz);\n\t\t$from_dt = new DateTime(app_date('Y-m-d H:i', $timestamp), $from_dtz);\n\t\t$to_dt = new DateTime('now', $to_dtz);\n\t\t$offset = $from_dtz->getOffset($from_dt) - $to_dtz->getOffset($to_dt);\n\t} else { // PHP version 4\n\t\t$timezone_offsets = array (\n\t\t\t'-43200' => ' Etc/GMT+12',\n\t\t\t'-39600' => ' Etc/GMT+11, MIT, Pacific/Apia, Pacific/Midway, Pacific/Niue, Pacific/Pago Pago, Pacific/Samoa, US/Samoa',\n\t\t\t'-36000' => ' -America/Adak, -America/Atka, Etc/GMT+10, HST, Pacific/Fakaofo, Pacific/Honolulu, Pacific/Johnston, Pacific/Rarotonga, Pacific/Tahiti, SystemV/HST10, -US/Aleutian, US/Hawaii',\n\t\t\t'-34200' => ' Pacific/Marquesas',\n\t\t\t'-32400' => ' -AST, -America/Anchorage, -America/Juneau, -America/Nome, -America/Yakutat, Etc/GMT+9, Pacific/Gambier, SystemV/YST9, -SystemV/YST9YDT, -US/Alaska',\n\t\t\t'-28800' => ' -America/Dawson, -America/Ensenada, -America/Los Angeles, -America/Tijuana, -America/Vancouver, -America/Whitehorse, -Canada/Pacific, -Canada/Yukon, Etc/GMT+8, -Mexico/BajaNorte, -PST, -PST8PDT, Pacific/Pitcairn, SystemV/PST8, -SystemV/PST8PDT, -US/Pacific, -US/Pacific-New',\n\t\t\t'-25200' => ' -America/Boise, -America/Cambridge Bay, -America/Chihuahua, America/Dawson Creek, -America/Denver, -America/Edmonton, America/Hermosillo, -America/Inuvik, -America/Mazatlan, America/Phoenix, -America/Shiprock, -America/Yellowknife, -Canada/Mountain, Etc/GMT+7, -MST, -MST7MDT, -Mexico/BajaSur, -Navajo, PNT, SystemV/MST7, -SystemV/MST7MDT, US/Arizona, -US/Mountain',\n\t\t\t'-21600' => ' America/Belize, -America/Cancun, -America/Chicago, America/Costa Rica, America/El Salvador, America/Guatemala, America/Managua, -America/Menominee, -America/Merida, America/Mexico City, -America/Monterrey, -America/North Dakota/Center, -America/Rainy River, -America/Rankin Inlet, America/Regina, America/Swift Current, America/Tegucigalpa, -America/Winnipeg, -CST, -CST6CDT, -Canada/Central, Canada/East-Saskatchewan, Canada/Saskatchewan, -Chile/EasterIsland, Etc/GMT+6, Mexico/General, -Pacific/Easter, Pacific/Galapagos, SystemV/CST6, -SystemV/CST6CDT, -US/Central',\n\t\t\t'-18000' => ' America/Bogota, America/Cayman, -America/Detroit, America/Eirunepe, America/Fort Wayne, -America/Grand Turk, America/Guayaquil, -America/Havana, America/Indiana/Indianapolis, America/Indiana/Knox, America/Indiana/Marengo, America/Indiana/Vevay, America/Indianapolis, -America/Iqaluit, America/Jamaica, -America/Kentucky/Louisville, -America/Kentucky/Monticello, America/Knox IN, America/Lima, -America/Louisville, -America/Montreal, -America/Nassau, -America/New York, -America/Nipigon, America/Panama, -America/Pangnirtung, America/Port-au-Prince, America/Porto Acre, America/Rio Branco, -America/Thunder Bay, Brazil/Acre, -Canada/Eastern, -Cuba, -EST, -EST5EDT, Etc/GMT+5, IET, Jamaica, SystemV/EST5, -SystemV/EST5EDT, US/East-Indiana, -US/Eastern, US/Indiana-Starke, -US/Michigan',\n\t\t\t'-14400' => ' America/Anguilla, America/Antigua, America/Aruba, -America/Asuncion, America/Barbados, America/Boa Vista, America/Caracas, -America/Cuiaba, America/Curacao, America/Dominica, -America/Glace Bay, -America/Goose Bay, America/Grenada, America/Guadeloupe, America/Guyana, -America/Halifax, America/La Paz, America/Manaus, America/Martinique, America/Montserrat, America/Port of Spain, America/Porto Velho, America/Puerto Rico, -America/Santiago, America/Santo Domingo, America/St Kitts, America/St Lucia, America/St Thomas, America/St Vincent, America/Thule, America/Tortola, America/Virgin, -Antarctica/Palmer, -Atlantic/Bermuda, -Atlantic/Stanley, Brazil/West, -Canada/Atlantic, -Chile/Continental, Etc/GMT+4, PRT, SystemV/AST4, -SystemV/AST4ADT',\n\t\t\t'-12600' => ' -America/St Johns, -CNT, -Canada/Newfoundland',\n\t\t\t'-10800' => ' AGT, -America/Araguaina, America/Belem, America/Buenos Aires, America/Catamarca, America/Cayenne, America/Cordoba, -America/Fortaleza, -America/Godthab, America/Jujuy, -America/Maceio, America/Mendoza, -America/Miquelon, America/Montevideo, America/Paramaribo, -America/Recife, America/Rosario, -America/Sao Paulo, -BET, -Brazil/East, Etc/GMT+3',\n\t\t\t '-7200' => ' America/Noronha, Atlantic/South Georgia, Brazil/DeNoronha, Etc/GMT+2',\n\t\t\t '-3600' => ' -America/Scoresbysund, -Atlantic/Azores, Atlantic/Cape Verde, Etc/GMT+1',\n\t\t\t '0' => ' Africa/Abidjan, Africa/Accra, Africa/Bamako, Africa/Banjul, Africa/Bissau, Africa/Casablanca, Africa/Conakry, Africa/Dakar, Africa/El Aaiun, Africa/Freetown, Africa/Lome, Africa/Monrovia, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao Tome, Africa/Timbuktu, America/Danmarkshavn, -Atlantic/Canary, -Atlantic/Faeroe, -Atlantic/Madeira, Atlantic/Reykjavik, Atlantic/St Helena, -Eire, Etc/GMT, Etc/GMT+0, Etc/GMT-0, Etc/GMT0, Etc/Greenwich, Etc/UCT, Etc/UTC, Etc/Universal, Etc/Zulu, -Europe/Belfast, -Europe/Dublin, -Europe/Lisbon, -Europe/London, -GB, -GB-Eire, GMT, GMT0, Greenwich, Iceland, -Portugal, UCT, UTC, Universal, -WET, Zulu',\n\t\t\t '3600' => ' Africa/Algiers, Africa/Bangui, Africa/Brazzaville, -Africa/Ceuta, Africa/Douala, Africa/Kinshasa, Africa/Lagos, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Ndjamena, Africa/Niamey, Africa/Porto-Novo, Africa/Tunis, -Africa/Windhoek, -Arctic/Longyearbyen, -Atlantic/Jan Mayen, -CET, -ECT, Etc/GMT-1, -Europe/Amsterdam, -Europe/Andorra, -Europe/Belgrade, -Europe/Berlin, -Europe/Bratislava, -Europe/Brussels, -Europe/Budapest, -Europe/Copenhagen, -Europe/Gibraltar, -Europe/Ljubljana, -Europe/Luxembourg, -Europe/Madrid, -Europe/Malta, -Europe/Monaco, -Europe/Oslo, -Europe/Paris, -Europe/Prague, -Europe/Rome, -Europe/San Marino, -Europe/Sarajevo, -Europe/Skopje, -Europe/Stockholm, -Europe/Tirane, -Europe/Vaduz, -Europe/Vatican, -Europe/Vienna, -Europe/Warsaw, -Europe/Zagreb, -Europe/Zurich, -MET, -Poland',\n\t\t\t '7200' => ' -ART, Africa/Blantyre, Africa/Bujumbura, -Africa/Cairo, Africa/Gaborone, Africa/Harare, Africa/Johannesburg, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka, Africa/Maputo, Africa/Maseru, Africa/Mbabane, Africa/Tripoli, -Asia/Amman, -Asia/Beirut, -Asia/Damascus, -Asia/Gaza, -Asia/Istanbul, -Asia/Jerusalem, -Asia/Nicosia, -Asia/Tel Aviv, CAT, -EET, -Egypt, Etc/GMT-2, -Europe/Athens, -Europe/Bucharest, -Europe/Chisinau, -Europe/Helsinki, -Europe/Istanbul, -Europe/Kaliningrad, -Europe/Kiev, -Europe/Minsk, -Europe/Nicosia, -Europe/Riga, -Europe/Simferopol, -Europe/Sofia, Europe/Tallinn, -Europe/Tiraspol, -Europe/Uzhgorod, Europe/Vilnius, -Europe/Zaporozhye, -Israel, Libya, -Turkey',\n\t\t\t '10800' => ' Africa/Addis Ababa, Africa/Asmera, Africa/Dar es Salaam, Africa/Djibouti, Africa/Kampala, Africa/Khartoum, Africa/Mogadishu, Africa/Nairobi, Antarctica/Syowa, Asia/Aden, -Asia/Baghdad, Asia/Bahrain, Asia/Kuwait, Asia/Qatar, Asia/Riyadh, EAT, Etc/GMT-3, -Europe/Moscow, Indian/Antananarivo, Indian/Comoro, Indian/Mayotte, -W-SU',\n\t\t\t '11224' => ' Asia/Riyadh87, Asia/Riyadh88, Asia/Riyadh89, Mideast/Riyadh87, Mideast/Riyadh88, Mideast/Riyadh89',\n\t\t\t '12600' => ' -Asia/Tehran, -Iran',\n\t\t\t '14400' => ' -Asia/Aqtau, -Asia/Baku, Asia/Dubai, Asia/Muscat, -Asia/Tbilisi, -Asia/Yerevan, Etc/GMT-4, -Europe/Samara, Indian/Mahe, Indian/Mauritius, Indian/Reunion, -NET',\n\t\t\t '16200' => ' Asia/Kabul',\n\t\t\t '18000' => ' -Asia/Aqtobe, Asia/Ashgabat, Asia/Ashkhabad, -Asia/Bishkek, Asia/Dushanbe, Asia/Karachi, Asia/Samarkand, Asia/Tashkent, -Asia/Yekaterinburg, Etc/GMT-5, Indian/Kerguelen, Indian/Maldives, PLT',\n\t\t\t '19800' => ' Asia/Calcutta, IST',\n\t\t\t '20700' => ' Asia/Katmandu',\n\t\t\t '21600' => ' Antarctica/Mawson, Antarctica/Vostok, -Asia/Almaty, Asia/Colombo, Asia/Dacca, Asia/Dhaka, -Asia/Novosibirsk, -Asia/Omsk, Asia/Thimbu, Asia/Thimphu, BST, Etc/GMT-6, Indian/Chagos',\n\t\t\t '23400' => ' Asia/Rangoon, Indian/Cocos',\n\t\t\t '25200' => ' Antarctica/Davis, Asia/Bangkok, Asia/Hovd, Asia/Jakarta, -Asia/Krasnoyarsk, Asia/Phnom Penh, Asia/Pontianak, Asia/Saigon, Asia/Vientiane, Etc/GMT-7, Indian/Christmas, VST',\n\t\t\t '28800' => ' Antarctica/Casey, Asia/Brunei, Asia/Chongqing, Asia/Chungking, Asia/Harbin, Asia/Hong Kong, -Asia/Irkutsk, Asia/Kashgar, Asia/Kuala Lumpur, Asia/Kuching, Asia/Macao, Asia/Manila, Asia/Shanghai, Asia/Singapore, Asia/Taipei, Asia/Ujung Pandang, Asia/Ulaanbaatar, Asia/Ulan Bator, Asia/Urumqi, Australia/Perth, Australia/West, CTT, Etc/GMT-8, Hongkong, PRC, Singapore',\n\t\t\t '32400' => ' Asia/Choibalsan, Asia/Dili, Asia/Jayapura, Asia/Pyongyang, Asia/Seoul, Asia/Tokyo, -Asia/Yakutsk, Etc/GMT-9, JST, Japan, Pacific/Palau, ROK',\n\t\t\t '34200' => ' ACT, -Australia/Adelaide, -Australia/Broken Hill, Australia/Darwin, Australia/North, -Australia/South, -Australia/Yancowinna',\n\t\t\t '36000' => ' -AET, Antarctica/DumontDUrville, -Asia/Sakhalin, -Asia/Vladivostok, -Australia/ACT, Australia/Brisbane, -Australia/Canberra, -Australia/Hobart, Australia/Lindeman, -Australia/Melbourne, -Australia/NSW, Australia/Queensland, -Australia/Sydney, -Australia/Tasmania, -Australia/Victoria, Etc/GMT-10, Pacific/Guam, Pacific/Port Moresby, Pacific/Saipan, Pacific/Truk, Pacific/Yap',\n\t\t\t '37800' => ' -Australia/LHI, -Australia/Lord Howe',\n\t\t\t '39600' => ' -Asia/Magadan, Etc/GMT-11, Pacific/Efate, Pacific/Guadalcanal, Pacific/Kosrae, Pacific/Noumea, Pacific/Ponape, SST',\n\t\t\t '41400' => ' Pacific/Norfolk',\n\t\t\t '43200' => ' -Antarctica/McMurdo, -Antarctica/South Pole, -Asia/Anadyr, -Asia/Kamchatka, Etc/GMT-12, Kwajalein, -NST, -NZ, -Pacific/Auckland, Pacific/Fiji, Pacific/Funafuti, Pacific/Kwajalein, Pacific/Majuro, Pacific/Nauru, Pacific/Tarawa, Pacific/Wake, Pacific/Wallis',\n\t\t\t '45900' => ' -NZ-CHAT, -Pacific/Chatham',\n\t\t\t '46800' => ' Etc/GMT-13, Pacific/Enderbury, Pacific/Tongatapu',\n\t\t\t '50400' => ' Etc/GMT-14, Pacific/Kiritimati, null, localize/timezone'\n\t\t);\n\n\t\t$from_offset = 0;\n\t\t$to_offset = 0;\n\t\tforeach($timezone_offsets as $offset => $zones) {\n\n\t\t\tif($from_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($from_tz)) !== false) $from_offset = $offset;\n\t\t\t}\n\n\t\t\tif($to_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($to_tz)) !== false) $to_offset = $offset;\n\t\t\t}\n\t\t}\n\n\t\t$old_tz = @ini_get('date.timezone');\n\t\tif($old_tz == '') $old_tz = $GLOBALS['env']['timezone'];\n\t\t@ini_set('date.timezone', $from_tz);\n\t\t@putenv('TZ='.$from_tz);\n\n\t\tif(app_date('I', $timestamp)) $from_offset += 3600;\n\n\t\t@ini_set('date.timezone', $old_tz);\n\t\t@putenv('TZ='.$old_tz);\n\n\t\t$offset = ($from_offset - $to_offset);\n\t}\n\n\treturn $offset;\n}", "private function getGMTOffset() {\n $utcOffset = get_option('gmt_offset', null);\n return $utcOffset != null ? ($utcOffset * 60 * 60) : 0;\n }", "public function getUtcOffset(){\n $datetime = new DateTime('now', 'UTC');\n return parent::getOffset($datetime);\n }", "function iabstract_time() {\n $gmt_offset_in_hours = +1; // for GMT-+1 (EDIT this value) \n return time() + $gmt_offset_in_hours * HOUR_IN_SECONDS; \n}", "function wp_timezone_override_offset()\n {\n }", "public function offset()\n {\n if ($this->timezone) {\n return (new DateTime(Chronos::now()->format('Y-m-d H:i:s'), new DateTimeZone($this->timezone)))->getOffset() / 60 / 60;\n }\n\n return 0;\n }", "function getTime($offset){\n $hours = date('h');\n $minutes = (date('i') > 30) ? '30' : '00';\n $minutes = $minutes + $offset;\n if($minutes >= 60){\n $hours = $hours + (int)($minutes / 60);\n if($hours > 12)\n $hours -= 12;\n $minutes = $minutes % 60;\n }\n $minutes = ($minutes==0) ? '00' : $minutes;\n return \"$hours:$minutes\" . date('A');\n}", "private function getTimeZoneOffset()\n {\n if (null === $this->offset) {\n $time = new \\DateTime('now', new \\DateTimeZone($this->localeSettings->getTimeZone()));\n $this->offset = $time->format('P');\n }\n\n return $this->offset;\n }", "function get_timezone ()\n{\n\tglobal $user_data, $default_timezone, $time_zone, $time_zone_offset, $time_zone_list, $time_zone_dst;\n\n\t$time_zone = (empty($user_data['time_zone'])\n\t\t? (empty($default_timezone)\n\t\t\t? 0\n\t\t\t: $default_timezone)\n\t\t: $user_data['time_zone']);\n\n\t// TZ is valid...\n\tif (isset($time_zone_list[$time_zone]))\n\t{\n\t\t$time_zone_offset = $time_zone_list[$time_zone][0] * 3600;\n\t}\n\t// TZ not found/set in the array\n\telse\n\t{\n\t\t$time_zone = 'N/A';\n\t}\n}", "function get_offset_time($offset_str, $factor=1)\n {\n if (preg_match('/^([0-9]+)\\s*([smhdw])/i', $offset_str, $regs))\n {\n $amount = (int)$regs[1];\n $unit = strtolower($regs[2]);\n }\n else\n {\n $amount = (int)$offset_str;\n $unit = 's';\n }\n \n $ts = mktime();\n switch ($unit)\n {\n case 'w':\n $amount *= 7;\n case 'd':\n $amount *= 24;\n case 'h':\n $amount *= 60;\n case 'm':\n $amount *= 60;\n case 's':\n $ts += $amount * $factor;\n }\n\n return $ts;\n}", "public function getGMTOffset();", "protected static function _offset( $ts, $dir=1 ) { return $ts + ( $dir * get_option( 'gmt_offset', 0 ) * HOUR_IN_SECONDS ); }", "protected function interval_offset() {\n\t\t// Run two minutes later.\n\t\treturn 120;\n\t}", "public static function getTimestampOffset()\n {\n return self::$settings[1];\n }", "function get_display_offset( $pUser = FALSE ) {\n\t\treturn $this->mServerTimestamp->get_display_offset( $pUser );\n\t}", "function formatTimezoneOffset($offset=false) {\n\t\t$tzoffset = false;\n\t\tif (preg_match('/^[\\-+]?[0-9\\.]+$/',$offset)>0) { //must be a number\n\t\t\t//convert seconds to hours:min\n\t\t\t$n=false;\n\t\t\tif ($offset > 12 || $offset < -12) {\n\t\t\t\t$noffset = $offset/3600;\n\t\t\t} else {\n\t\t\t\t$noffset = $offset;\n\t\t\t}\n\t\t\t$n = strpos($noffset,'.');\n\t\t\tif ($n !== false) {\n\t\t\t\t$offset_hrs = substr($noffset,0,$n);\n\t\t\t\t$offset_min = (int)substr($noffset,$n+1)*6;\n\t\t\t} else {\n\t\t\t\t$offset_hrs = $noffset;\n\t\t\t\t$offset_min = 0;\n\t\t\t}\n\t\t\tif ($offset < 0) {\n\t\t\t\t$tzoffset = sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t}\n\t\t} elseif (preg_match('/^([\\-+])?(\\d{1,2})?\\:(\\d{2})/',$offset,$match)>0) {\n\t\t\tif (empty($match[2])) $match[2] = \"0\";\n\t\t\tif (!empty($match[1]) && $match[1]==\"-\") {\n\t\t\t\t$tzoffset = \"-\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t}\n\t\t}\n\t\treturn $tzoffset;\n\t}", "function getTime($offset = 0, $format = 'H:i:s')\n {\n return date($format, strtotime($offset.' minutes'));\n }", "public static function time_offset($t, $f = 'h:ma M. j Y T'){\n\t$o = time() - $t;\n\tswitch($o){\n\t\tcase($o <= 1): return \"just now\"; break;\n\t\tcase($o < 20): return $o . \" seconds ago\"; break;\n\t\tcase($o < 40): return \"half a minute ago\"; break;\n\t\tcase($o < 60): return \"less than a minute ago\"; break;\n\t\tcase($o <= 90): return \"1 minute ago\"; break;\n\t\tcase($o <= 59*60): return round($o / 60) . \" minutes ago\"; break;\n\t\tcase($o <= 60*60*1.5): return \"1 hour ago\"; break;\n\t\tcase($o <= 60*60*24): return round($o / 60 / 60) . \" hours ago\"; break;\n\t\tcase($o <= 60*60*24*1.5): return \"1 day ago\"; break;\n\t\tcase($o < 60*60*24*7): return round($o / 60 / 60 / 24) . \" days ago\"; break;\n\t\tcase($o <= 60*60*24*9): return \"1 week ago\"; break;\n\t\tdefault: return date($f, $t);\n\t}\n }", "function getUTCOffset($value, $timestamp = null)\n {\n if ($value === null) {\n return 0;\n } else {\n list($sign, $hours, $minutes) = sscanf($value, '%1s%2d%2d');\n return ($sign == '+' ? 1 : -1) * ($hours * 60 * 60) + ($minutes * 60);\n }\n }", "private function user_local_request_time()\n\t{\n\t\t$formatted = sprintf(\n\t\t\t'%s-%s-%s %s:%s %s',\n\t\t\tdate('Y', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('m', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('d', $_SERVER['REQUEST_TIME']),\n\t\t\t$this->input->post('timecard_hour'),\n\t\t\t$this->input->post('timecard_min'),\n\t\t\t$this->input->post('timecard_pmam')\n\t\t);\n\n\t\treturn Carbon::createFromFormat('Y-m-d h:i A', $formatted);\n\t}" ]
[ "0.7599222", "0.73604554", "0.73411685", "0.72180235", "0.71558046", "0.7072217", "0.69586015", "0.69037575", "0.6803715", "0.6792604", "0.67925674", "0.6673445", "0.66606", "0.66570705", "0.6635666", "0.658613", "0.65816456", "0.65641135", "0.653456", "0.64793414", "0.64484143", "0.64327484", "0.6421539", "0.63987726", "0.6327204", "0.63229734", "0.62533784", "0.62471503", "0.62039065", "0.61753505" ]
0.8399742
0
/ My gmmktime() PHP func seems buggy / My gmmktime() PHP func seems buggy
function date_gmmktime( $hour=0, $min=0, $sec=0, $month=0, $day=0, $year=0 ) { // Calculate UTC time offset $offset = date( 'Z' ); // Generate server based timestamp $time = mktime( $hour, $min, $sec, $month, $day, $year ); // Calculate DST on / off $dst = intval( date( 'I', $time ) - date( 'I' ) ); return $offset + ($dst * 3600) + $time; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MyDateTimestamp($date)\r\n{\r\n\treturn gmmktime(\r\n\t\tsubstr($date, 11, 2), //h\r\n\t\tsubstr($date, 14, 2), //i\r\n\t\tsubstr($date, 17, 2), //s\r\n\t\tsubstr($date, 5, 2), //m\r\n\t\tsubstr($date, 8, 2), //d\r\n\t\tsubstr($date, 0, 4) //y\r\n\t);\r\n}", "function gmt_time() {\r\n\t\t$now = time ();\r\n\t\t$tz = $this->gmt_timezone ();\r\n\t\t$seconds = 3600 * $tz;\r\n\t\treturn $now - $seconds;\r\n\t}", "function gmtime() {\n return time()-date('Z');\n }", "function gmtime($dTimestamp = '', $bAssoc = 0) {\n\t// Evaluate how much difference there is between local and GTM/UTC\n\t// Don't forget to correct for daylight saving time...\n\t$aNow = localtime();\n\t$iDelta = gmmktime(1, 1, 1, 1, 1, 1970, $aNow[8]) - mktime(1, 1, 1, 1, 1,\n1970, $aNow[8]);\n\n\tif (!$bAssoc) {\n\t\tif ($dTimestamp == '') {\n\t\t\treturn localtime(time() - $iDelta, 0);\n\t\t} else {\n\t\t\treturn localtime($dTimestamp - $iDelta, 0);\n\t\t}\n\t} else {\n\t\t// For associative array, add full year index\n\t\tif ($dTimestamp == '') {\n\t\t\t$aGMTTime = localtime(time() - $iDelta, 1);\n\t\t} else {\n\t\t\t$aGMTTime = localtime($dTimestamp - $iDelta, 1);\n\t\t}\n\t\t$aGMTTime['tm_fyear'] = $aGMTTime['tm_year'] + 1900;\n\t\treturn $aGMTTime;\n\t} // End [IF] return associative array?\n}", "function date_getgmdate( $gmt_stamp )\n {\n \t$tmp = gmdate( 'j,n,Y,G,i,s,w,z,l,F,W,M', $gmt_stamp );\n \t\n \tlist( $day, $month, $year, $hour, $min, $seconds, $wday, $yday, $weekday, $fmon, $week, $smon ) = explode( ',', $tmp );\n \t\n \treturn array( 0 => $gmt_stamp,\n \t\t\t\t \"seconds\" => $seconds, //\tNumeric representation of seconds\t0 to 59\n\t\t\t\t\t \"minutes\" => $min, //\tNumeric representation of minutes\t0 to 59\n\t\t\t\t\t \"hours\"\t => $hour,\t //\tNumeric representation of hours\t0 to 23\n\t\t\t\t\t \"mday\"\t => $day, //\tNumeric representation of the day of the month\t1 to 31\n\t\t\t\t\t \"wday\"\t => $wday, // Numeric representation of the day of the week\t0 (for Sunday) through 6 (for Saturday)\n\t\t\t\t\t \"mon\"\t => $month, // Numeric representation of a month\t1 through 12\n\t\t\t\t\t \"year\"\t => $year, // A full numeric representation of a year, 4 digits\tExamples: 1999 or 2003\n\t\t\t\t\t \"yday\"\t => $yday, // Numeric representation of the day of the year\t0 through 365\n\t\t\t\t\t \"weekday\" => $weekday, //\tA full textual representation of the day of the week\tSunday through Saturday\n\t\t\t\t\t \"month\"\t => $fmon, // A full textual representation of a month, such as January or Mar\n\t\t\t\t\t \"week\" => $week, // Week of the year\n\t\t\t\t\t \"smonth\" => $smon\n\t\t\t\t\t);\n }", "function _get_time()\n{\n $_mtime = microtime();\n $_mtime = explode(\" \", $_mtime);\n\n return (double) ($_mtime[1]) + (double) ($_mtime[0]);\n}", "function getSystemTime()\n{\n $time = @gettimeofday();\n $resultTime = $time['sec'] * 1000;\n $resultTime += floor($time['usec'] / 1000);\n return $resultTime;\n}", "function sys_time($timestamp)\n\t{\n\t\treturn call_user_func_array('gmmktime', explode(', ', date('H, i, s, m, d, Y', $timestamp - intval($this->timeshift()))));\n\t}", "function db2gmtime($var){\n global $cfg;\n if(!$var) return;\n \n $dbtime=is_int($var)?$var:strtotime($var);\n return $dbtime-($cfg->getMysqlTZoffset()*3600);\n }", "public static function timestamp() {}", "function now(): float\n{\n return (float) \\hrtime(true) / 1_000_000_000;\n}", "function getrsstime($d) \r\n{ \r\n $parts=explode(' ',$d); \r\n $month=$parts[2]; \r\n $monthreal=getmonth($month);\r\n $time=explode(':',$parts[4]); \r\n $date=\"$parts[3]-$monthreal-$parts[1] $time[0]:$time[1]:$time[2]\"; \r\n return $date;\r\n}", "function getStartMicrotime();", "function uwa_gmdate($format, $timestamp=false) {\n\tif(!$timestamp) $timestamp = date_time_get_time();\n\t\n\tif(function_exists('adodb_gmdate')) {\t// We can have problems with mktime when using dates before 1970 or hight 2038\n\t\t$func_name = 'adodb_gmdate';\n\t} else {\n\t\t$func_name = 'gmdate';\n\t}\n\treturn $func_name($format, $timestamp);\n}", "private function _mktime(){\n\t\t$this->_timestamp = self::mktime($this->_month, $this->_day, $this->_year);\n\t}", "function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}", "abstract public function toMilliseconds();", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "function date2jd()\n{\n\t@list($y,$m,$d,$h,$i,$s) = func_get_args();\n\n\tif( $m < 3.0 ) {\n\t\t$y -= 1.0;\n\t\t$m += 12.0;\n\t}\n\n\t$jd = (int)( 365.25 * $y );\n\t$jd += (int)( $y / 400.0 );\n\t$jd -= (int)( $y / 100.0 );\n\t$jd += (int)( 30.59 * ( $m-2.0 ) );\n\t$jd += 1721088;\n\t$jd += $d;\n\n\t$t = $s / 3600.0;\n\t$t += $i /60.0;\n\t$t += $h;\n\t$t = $t / 24.0;\n\n\t$jd += $t;\n\treturn( $jd );\n}", "private static function generate_timestamp()\n {\n return time();\n }", "public static function milliseconds() {}", "function create_date($format, $gmepoch, $tz)\n{\n// Begin PNphpBB2 Module\n/*\n\tglobal $board_config, $lang;\n\tstatic $translate;\n\n\tif ( empty($translate) && $board_config['default_lang'] != 'english' )\n\t{\n\t\t@reset($lang['datetime']);\n\t\twhile ( list($match, $replace) = @each($lang['datetime']) )\n\t\t{\n\t\t\t$translate[$match] = $replace;\n\t\t}\n\t}\n\n\treturn ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));\n*/\n\treturn ml_ftime($format, GetUserTime( $gmepoch ));\n// End PNphpBB2 Module\n}", "function dec_time()\n{\n $ds = 86400; // total seconds in day\n $dt = microtime(true) - mktime(0,0,0);\n\n $hs = $ds / pow(10,1);\n $ms = $ds / pow(10,3);\n $ss = $ds / pow(10,5);\n\n $hour = floor($dt/$hs);\n $min = floor($dt/$ms) - ($hour * 100);\n $sec = floor($dt/$ss) - ($hour * 10000) - ($min * 100);\n //$usec = floor($dt/$us) - ($hour * 10000) - ($min * 100);\n\n return sprintf('%01d',$hour).'h '.sprintf('%02d',$min).'m '.sprintf('%02d',$sec).'s';\n}", "private static function generate_timestamp() {\n return time();\n }", "private function getMicrotime()\n {\n $mtime = microtime();\n $mtime = explode(\" \",$mtime);\n $mtime = $mtime[1] + $mtime[0];\n\n return $mtime;\n }", "function iabstract_time() {\n $gmt_offset_in_hours = +1; // for GMT-+1 (EDIT this value) \n return time() + $gmt_offset_in_hours * HOUR_IN_SECONDS; \n}", "function persian_mktime($hour='', $min='', $sec='', $mon='', $day='', $year='', $is_dst=-1){\n $j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);\n\n if ( (string) $hour == '') { $hour = persian_date_utf('H'); }\n if ( (string) $min == '') { $min = persian_date_utf('i'); }\n if ( (string) $sec == '') { $sec = persian_date_utf('s'); }\n if ( (string) $day == '') { $day = persian_date_utf('j'); }\n if ( (string) $mon == '') { $mon = persian_date_utf('n'); }\n if ( (string) $year == '') { $year = persian_date_utf('Y'); }\n\n /*\n an ugly, beta code snippet to support days <= zero!\n it should work, but days in one or more months should calculate!\n */\n\n /*\n if($day <= 0){\n // change sign\n $day = abs($day);\n\n // calculate months and days that shall decrease\n // this do-while has a lot of errors!!!\n do{\n // $month_days = $j_days_in_month[$mon]\n $months = floor($day/30);\n $days = $day % 30;\n }while();\n\n $mon -= $months;\n $day -= $days;\n if ($day < 1) {\n $mon--;\n }\n }\n */\n\n if ($mon <= 0){\n // change sign\n $mon = abs($mon);\n\n // calculate years and months that shall decrease\n $years = floor($mon/12);\n $months = $mon % 12;\n\n $year -= $years;\n $mon -= $months;\n if ($mon < 1) {\n $year--;\n $mon += 12;\n }\n }\n\n if ($day < 1) {\n $temp_month = $mon-1;\n $temp_year = $year;\n if($temp_month <= 0){\n $temp_month = 12;\n $temp_year--;\n }\n if ($temp_month>1 && (($temp_year%4==0 && $temp_year%100!=0) || ($temp_year%400==0))){\n $j_days_in_month[12] = 30;\n }else{\n $j_days_in_month[12] = 29;\n }\n $day += $j_days_in_month[$temp_month];\n }\n\n list($year, $mon, $day) = p2g($year, $mon, $day);\n return mktime($hour, $min, $sec, $mon, $day, $year, $is_dst);\n}", "function FIFOToEpochTime($DateTime)\n{\n\tlist($Day, $Month, $Year, $Hour, $Minute, $Second)=sscanf($DateTime, \"%02d/%02d/%04d %02d:%02d:%02d\");\n\treturn(gmmktime($Hour, $Minute, $Second, $Month, $Day, $Year));\n}", "private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}", "function current_time($type, $gmt = 0)\n {\n }" ]
[ "0.6772348", "0.6141193", "0.609432", "0.6057421", "0.6042489", "0.6040829", "0.60127544", "0.6006567", "0.59505653", "0.58714557", "0.58088505", "0.5751597", "0.5751479", "0.57382655", "0.57295775", "0.5725695", "0.57236636", "0.56813794", "0.5648627", "0.5630009", "0.56291497", "0.56260496", "0.56244147", "0.55890775", "0.5535086", "0.5490684", "0.54740286", "0.54713184", "0.5456734", "0.5454158" ]
0.73694915
0
/ parse_incoming_recursively / Recursively cleans keys and values and inserts them into the input array
function parse_incoming_recursively( &$data, $input=array(), $iteration = 0 ) { // Crafty hacker could send something like &foo[][][][][][]....to kill Apache process // We should never have an input array deeper than 10.. if( $iteration >= 10 ) { return $input; } if( count( $data ) ) { foreach( $data as $k => $v ) { if ( is_array( $v ) ) { //$input = $this->parse_incoming_recursively( $data[ $k ], $input ); $input[ $k ] = $this->parse_incoming_recursively( $data[ $k ], array(), $iteration+1 ); } else { $k = $this->parse_clean_key( $k ); $v = $this->parse_clean_value( $v ); $input[ $k ] = $v; } } } return $input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addArray($incoming_data, $incoming_indent) {\n\t//--\n\t// print_r ($incoming_data);\n\t//--\n\tif(Smart::array_size($incoming_data) > 1) {\n\t\treturn $this->addArrayInline ($incoming_data, $incoming_indent);\n\t} //end if\n\t//--\n\t$key = key($incoming_data);\n\t$value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;\n\tif($key === '__!YAMLZero') {\n\t\t$key = '0';\n\t} //end if\n\t//--\n\tif($incoming_indent == 0 && !$this->yaml_contains_group_alias && !$this->yaml_contains_group_anchor) { // Shortcut for root-level values.\n\t\tif($key || $key === '' || $key === '0') {\n\t\t\t$this->result[$key] = $value;\n\t\t} else {\n\t\t\t$this->result[] = $value;\n\t\t\tend($this->result);\n\t\t\t$key = key($this->result);\n\t\t} //end if else\n\t\t$this->path[$incoming_indent] = $key;\n\t\treturn;\n\t} //end if\n\t//--\n\t$history = array();\n\t//-- Unfolding inner array tree.\n\t$history[] = $tmp_arr = $this->result;\n\tforeach($this->path as $z => $k) {\n\t\t$history[] = $tmp_arr = $tmp_arr[$k];\n\t} //end foreach\n\t//--\n\tif($this->yaml_contains_group_alias) {\n\t\t$value = $this->referenceContentsByAlias($this->yaml_contains_group_alias);\n\t\t$this->yaml_contains_group_alias = false;\n\t} //end if\n\t//-- Adding string or numeric key to the innermost level or $this->arr.\n\tif(is_string($key) && $key == '<<') {\n\t\tif(!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ();\n\t\t} //end if\n\t\t$tmp_arr = array_merge($tmp_arr, $value);\n\t} elseif($key || $key === '' || $key === '0') {\n\t\tif (!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ($key=>$value);\n\t\t} else {\n\t\t\t$tmp_arr[$key] = $value;\n\t\t} //end if else\n\t} else {\n\t\tif(!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ($value); $key = 0;\n\t\t} else {\n\t\t\t$tmp_arr[] = $value;\n\t\t\tend($tmp_arr);\n\t\t\t$key = key($tmp_arr);\n\t\t} //end if else\n\t} //end if else\n\t//--\n\t$reverse_path = array_reverse($this->path);\n\t$reverse_history = array_reverse($history);\n\t$reverse_history[0] = $tmp_arr;\n\t$cnt = Smart::array_size($reverse_history) - 1;\n\tfor($i=0; $i<$cnt; $i++) {\n\t\t$reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i];\n\t} //end for\n\t$this->result = $reverse_history[$cnt];\n\t$this->path[$incoming_indent] = $key;\n\t//--\n\tif($this->yaml_contains_group_anchor) {\n\t\t$this->yaml_arr_saved_groups[$this->yaml_contains_group_anchor] = $this->path;\n\t\tif(is_array ($value)) {\n\t\t\t$k = key($value);\n\t\t\tif(!is_int ($k)) {\n\t\t\t\t$this->yaml_arr_saved_groups[$this->yaml_contains_group_anchor][$incoming_indent + 2] = $k;\n\t\t\t} //end if\n\t\t} //end if\n\t\t$this->yaml_contains_group_anchor = false;\n\t} //end if\n\t//--\n}", "function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}", "function clean_global_array($arr)\n\t{\n\t\t$clean_arr = array();\n\t\tforeach($arr as $key => $value)\n\t\t{\n\t\t\t$clean_arr[] = \n\t\t\t\tfilter_input_array(\n\t\t\t\t\tINPUT_POST,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"$key\" => array(\n\t\t\t\t\t\t\t'filter' => FILTER_CALLBACK,\n\t\t\t\t\t\t\t'options' => 'clean_input'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\t\t$clean_array = array();\n\t\t// this loop to make this array n instead of n^2\n\t\tforeach($clean_arr as $key => $value)\n\t\t{\n\t\t\tforeach($value as $k => $val)\n\t\t\t$clean_array[$k] = $val;\n\t\t}\n\t\treturn $clean_array;\n\t}", "function sanitizeArray($data = array())\r\n{\r\n foreach ($data as $k => $v) {\r\n if (!is_array($v) && !is_object($v)) { // deep enough to only be values? sanitize them now.\r\n $data[$k] = sanitizeValue($v);\r\n }\r\n if (is_array($v)) { // go deeper\r\n $data[$k] = sanitizeArray($v);\r\n }\r\n }\r\n return $data;\r\n}", "function parseIncoming(){\r\n\t\t# THIS NEEDS TO BE HERE!\r\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\r\n\r\n \t\tif(is_array($_GET)){\r\n\t\t\twhile(list($k, $v) = each($_GET)){\r\n\t\t\t\tif(is_array($_GET[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_GET[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Overwrite GET data with post data\r\n\t\tif(is_array($_POST)){\r\n\t\t\twhile(list($k, $v) = each($_POST)){\r\n\t\t\t\tif(is_array($_POST[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_POST[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->input['requestMethod'] = strtolower($_SERVER['REQUEST_METHOD']);\r\n//\t\techo '<pre>'.print_r($this->input, 1).'</pre>';exit;\r\n\t}", "function sanitizeArray( &$data, $whatToKeep )\n{\n $data = array_intersect_key( $data, $whatToKeep ); \n \n foreach ($data as $key => $value) {\n\n $data[$key] = sanitizeOne( $data[$key] , $whatToKeep[$key] );\n\n }\n}", "private function _clean_input_data($str)\n {\n if (is_array($str))\n {\n $new_array = array();\n foreach ($str as $key => $val)\n {\n $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n return $new_array;\n }\n\n /* We strip slashes if magic quotes is on to keep things consistent\n\n NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and\n it will probably not exist in future versions at all.\n */\n if (get_magic_quotes_gpc())\n {\n $str = stripslashes($str);\n }\n\n // Clean UTF-8 if supported\n $str = $this->clean_string($str);\n // Remove control characters\n $str = $this->remove_invisible_characters($str);\n\n // Should we filter the input data?\n if ($this->_enable_xss === true)\n {\n $str = $this->xss_clean($str);\n }\n\n\n // Standardize newlines if needed\n if ($this->_standardize_newlines == true)\n {\n if (strpos($str, \"\\r\") !== false)\n {\n $str = str_replace(array(\"\\r\\n\", \"\\r\", \"\\r\\n\\n\"), PHP_EOL, $str);\n }\n }\n\n return $str;\n }", "private function fixExplodeFields($input){\n foreach($this->explodeFields as $field){\n if(empty($input[$field]))\n $input[$field] = array();\n else{\n if(substr($input[$field],0,1) == $this->explodeDelimiter){\n $input[$field] = substr($input[$field],1,-1);\n }\n $fld = explode($this->explodeDelimiter,$input[$field]);\n $f = array();\n foreach($fld as $k => $v){\n $f[$k] = trim($v);\n }\n $input[$field] = $f;\n unset($f,$fld,$k,$v);\n }\n }\n return $input;\n }", "private function keyvalSeparate($input){\n unset($this->keys);\n unset($this->values); \n \n foreach($input as $key => $value){\n $this->keys[] = $key;\n $this->values[] = $value;\n } \n }", "function parseIncomingData($origArr = array()) {\n\t\tglobal $TYPO3_DB;\n\n\t\tstatic $adodbTime = null;\n\n\t\t$parsedArr = array();\n\t\t$parsedArr = $origArr;\n\t\tif (is_array($this->conf['parseFromDBValues.'])) {\n\t\t\treset($this->conf['parseFromDBValues.']);\n\t\t\twhile (list($theField, $theValue) = each($this->conf['parseFromDBValues.'])) {\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',', $theValue, 1);\n\t\t\t\tforeach($listOfCommands as $k2 => $cmd) {\n\t\t\t\t\t$cmdParts = split(\"\\[|\\]\", $cmd); // Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd) {\n\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'adodb_date':\n\t\t\t\t\t\tif (!is_object($adodbTime))\t{\n\t\t\t\t\t\t\tinclude_once(PATH_BE_srfeuserregister.'pi1/class.tx_srfeuserregister_pi1_adodb_time.php');\n\n\t\t\t\t\t\t\t// prepare for handling dates before 1970\n\t\t\t\t\t\t\t$adodbTime = t3lib_div::makeInstance('tx_srfeuserregister_pi1_adodb_time');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = $adodbTime->adodb_date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$fieldsList = array_keys($parsedArr);\n\t\tforeach ($this->tca->TCA['columns'] as $colName => $colSettings) {\n\t\t\tif (in_array($colName, $fieldsList) && $colSettings['config']['type'] == 'select' && $colSettings['config']['MM']) {\n\t\t\t\tif (!$parsedArr[$colName]) {\n\t\t\t\t\t$parsedArr[$colName] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$valuesArray = array();\n\t\t\t\t\t$res = $TYPO3_DB->exec_SELECTquery(\n\t\t\t\t\t\t'uid_local,uid_foreign,sorting',\n\t\t\t\t\t\t$colSettings['config']['MM'],\n\t\t\t\t\t\t'uid_local='.intval($parsedArr['uid']),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'sorting');\n\t\t\t\t\twhile ($row = $TYPO3_DB->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$valuesArray[] = $row['uid_foreign'];\n\t\t\t\t\t}\n\t\t\t\t\t$parsedArr[$colName] = implode(',', $valuesArray);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $parsedArr;\n\t}", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "private function _clean_input_data($str) {\n\t\tif (is_array($str)) {\n\t\t\t$new_array = array();\n\t\t\tforeach ($str as $key => $val) {\n\t\t\t\t$new_array [ $this->_clean_input_keys($key) ] = $this->_clean_input_data($val);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}\n\n\t\t// We strip slashes if magic quotes is on to keep things consistent\n\t\tif ($this->quotes_gpc) {\n\t\t\t$str = stripslashes($str);\n\t\t}\n\n\t\t// Should we filter the input data?\n\t\tif ($this->use_xss_clean === true) {\n\t\t\t$str = Request::$xss_cleaner->xss_clean($str);\n\t\t}\n\n\t\t// Standardize newlines\n\t\tif (strpos($str, \"\\r\") !== false) {\n\t\t\t$str = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $str);\n\t\t}\n\n\t\treturn $str;\n\t}", "protected function _clean_input_data($str)\n {\n if (is_array($str))\n {\n $new_array = array();\n foreach (array_keys($str) as $key)\n {\n $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($str[$key]);\n }\n return $new_array;\n }\n\n /* We strip slashes if magic quotes is on to keep things consistent\n\n NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and\n it will probably not exist in future versions at all.\n */\n if ( ! is_php('5.4') && get_magic_quotes_gpc())\n {\n $str = stripslashes($str);\n }\n\n // Clean UTF-8 if supported\n if (UTF8_ENABLED === TRUE)\n {\n $str = $this->uni->clean_string($str);\n }\n\n // Remove control characters\n $str = remove_invisible_characters($str, FALSE);\n\n // Standardize newlines if needed\n if ($this->_standardize_newlines === TRUE)\n {\n return preg_replace('/(?:\\r\\n|[\\r\\n])/', PHP_EOL, $str);\n }\n\n return $str;\n }", "public function convert($input)\n {\n if (!is_array($input)) {\n throw new UnexpectedTypeException($input, 'array');\n }\n\n $return = [];\n\n //remove any fields not required\n foreach ($input as $key => $val) {\n if (is_array($val)) {\n $fieldsToKeep = $this->fieldsToKeep[$key];\n $return[$key] = array_map(function ($nestedItem) use ($fieldsToKeep) {\n return array_intersect_key($nestedItem, array_flip($fieldsToKeep));\n }, $val);\n } else {\n if (array_key_exists($key, $this->fieldsToKeep)) {\n $return[$key] = $val;\n }\n }\n }\n\n //add missing values\n foreach ($this->fieldsToKeep as $keyField => $valueField) {\n if (is_array($valueField)) {\n if (!isset($return[$keyField])) {\n $return[$keyField] = [];\n } else {\n if (!is_array($return[$keyField])) {\n throw new UnexpectedTypeException($return[$keyField], 'array');\n }\n\n foreach ($valueField as $nestedField) {\n $return[$keyField] = array_map(function ($item) use ($nestedField) {\n if (!array_key_exists($nestedField, $item)) {\n $item[$nestedField] = $this->defaultValue;\n }\n return $item;\n }, $return[$keyField]);\n }\n }\n\n } else {\n if (!array_key_exists($keyField, $return)) {\n $return[$keyField] = $this->defaultValue;\n }\n }\n }\n\n return $return;\n }", "protected function _clean_input_data($str)\n\t{\n\t\tif (is_array($str))\n\t\t{\n\t\t\t$new_array = array();\n\t\t\tforeach (array_keys($str) as $key)\n\t\t\t{\n\t\t\t\t$new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($str[$key]);\n\t\t\t}\n\t\t\treturn $new_array;\n\t\t}\n\n\t\t// Remove control characters\n\t\t$str = remove_invisible_characters($str, FALSE);\n\n\t\t// Standardize newlines if needed\n\t\treturn preg_replace('/(?:\\r\\n|[\\r\\n])/', PHP_EOL, $str);\n\n\t}", "private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }", "function ppCleanData($postarray) {\n array_walk($postarray,'ppCleanField');\n return $postarray;\n}", "protected function _parse(){\n\t\tforeach ($this->dataArray['tables']['nat']['default-chains'] as $a => &$b){\n\t\t\t$b['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($b['rules'], $b['iptables-rules']);\n\t\t}\n\t\t\n\t\t// Now the IP chains...\n\t\tforeach ($this->dataArray['tables']['nat']['ip-chains'] as &$e){\n\t\t\t$e['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($e['rules'], $e['iptables-rules']);\n\t\t}\n\t\t\n\t\t// And finally, the others...\n\t\tforeach ($this->dataArray['tables']['nat']['other-chains'] as $h => &$i){\n\t\t\t$i['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($i['rules'], $i['iptables-rules']);\n\t\t}\n\t}", "function sanitizeArray( $arr ) {\n if (is_array($arr)) {\n foreach($arr as $key => &$data) {\n if (is_array($data)) {\n $data = sanitizeArray($data);\n } else {\n try {\n $json = json_decode( $data , true);\n if (is_array($json)) {\n $data = sanitizeArray( $json );\n continue;\n }\n } catch(Exception $e) {\n $data = sanitize($data);\n }\n }\n }\n }\n return $arr;\n}", "public function processDatamap_preProcessFieldArray(array &$incomingFieldArray, $table, $id, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parentObject) {\n\t\tif (\n\t\t\t$table === 'tt_content' &&\n\t\t\tsubstr($id, 0, 3) === 'NEW' &&\n\t\t\t$incomingFieldArray['pid'] < 0 &&\n\t\t\t! ( isset($incomingFieldArray['kbnescefe_parentElement']) && isset($incomingFieldArray['kbnescefe_parentPosition']) )\n\t\t) {\n\t\t\t$afterUid = abs($incomingFieldArray['pid']);\n\t\t\t$afterRecord = BackendUtility::getRecord('tt_content', $afterUid);\n\t\t\t$incomingFieldArray['kbnescefe_parentElement'] = $afterRecord['kbnescefe_parentElement'];\n\t\t\t$incomingFieldArray['kbnescefe_parentPosition'] = $afterRecord['kbnescefe_parentPosition'];\n\t\t\t$incomingFieldArray['colPos'] = $afterRecord['colPos'];\n\t\t}\n\t\tif (is_array(static::$dataMapDefaults[$table])) {\n\t\t\t$incomingFieldArray = array_replace($incomingFieldArray, static::$dataMapDefaults[$table]);\n\t\t}\n\t}", "function remove_empty_items($old_array, $mantain_keys=FALSE)\n{\n\t$new_array = array();\n\tforeach($old_array AS $key=>$value)\n\t{\n\t\tif(trim($value) != ''){\n\t\t\tif($mantain_keys)\n\t\t\t{\n\t\t\t\t$new_array[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($new_array, $value);\n\t\t\t}\n\t\t}\n\t}\n\treturn $new_array;\n}", "function _prep_args($args)\n\t{\n\t\t// If there is no $args[0], skip this and treat as an associative array\n\t\t// This can happen if there is only a single key, for example this is passed to table->generate\n\t\t// array(array('foo'=>'bar'))\n\t\tif (isset($args[0]) AND (count($args) == 1 && is_array($args[0])))\n\t\t{\n\t\t\t// args sent as indexed array\n\t\t\tif ( ! isset($args[0]['data']))\n\t\t\t{\n\t\t\t\tforeach ($args[0] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val) && isset($val['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$args[$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$args[$key] = array('data' => $val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($args as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$args[$key] = array('data' => $val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $args;\n\t}", "protected function _cleanupData($data) {\n\t\tif (!$data && !is_array($data)) {\n\t\t\treturn array();\n\t\t}\n\t\t$skipFields = $this->_skipFields;\n\t\tif (!$skipFields || !is_array($skipFields)) {\n\t\t\t$skipFields = array();\n\t\t}\n\t\t$clearedData = array();\n\t\tforeach ($data as $key => $value) {\n\t\t\tif (!in_array($key, $this->_globalSkipFields) && !in_array($key, $skipFields) && !is_array($value) && !is_object($value)) {\n\t\t\t\t$clearedData[$key] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $clearedData;\n\t}", "public function dataFix($data)\n {\n $items = [];\n\n if (!empty($data) && is_array($data)) {\n foreach ($data as $item) {\n if (!empty($item['value'])) {\n if (!empty($item['key']))\n $items[$item['key']] = $item['value'];\n else\n $items[$item['value']] = $item['value'];\n }\n }\n }\n\n return $items;\n }", "public function flushParsedKeys()\n {\n $this->parsed = [];\n }", "abstract public function parseInput(array $input): array;", "private static function space_filter_keys($array, &$keys, $ancestor_key = \"\")\n {\t\t\t\n foreach($array as $key => $value){\n \n // skip the numerical indices\n if(!is_numeric($key))\n $new_key = $ancestor_key\n . ((!empty($ancestor_key)) ? \".\" : \"\")\n . $key;\n else\n $new_key = $ancestor_key;\n \n // don't push the key if it is already present\n if(!in_array($new_key, $keys))\t\t\t\t\t\t\t\t\t\n array_push($keys, $new_key);\n \n if(is_array($value))\n self::space_filter_keys($value, $keys, $new_key);\t\t\t\t\t\t\t\t\t\n }\t\t\t\t\n }", "private function __parse_intput() {\n $requests = JsonParser::decode($this->__raw_input);\n if (is_array($requests) === false or\n empty($requests[0])) {\n $requests = array($requests);\n }\n return ($requests);\n }", "function grabbing_parser($grabbing_array) {\n $grabbing_array = change_array_key($grabbing_array,'grabbing_text','text');\n $grabbing_array = change_array_key($grabbing_array,'grabbing_title','title');\n $grabbing_array = change_array_key($grabbing_array,'grabbing_batch','batch');\n $grabbing_array = change_array_key($grabbing_array,'time_stamp','timestamp');\n $user_info = get_userdata($grabbing_array['userID']);\n $username = $user_info->first_name . \" \" . $user_info->last_name;\n $grabbing_array['username'] = $username;\n $grabbing_array['is_hallitus'] = boolval($grabbing_array['is_hallitus']);\n $grabbing_array['userID'] = intval($grabbing_array['userID']);\n return $grabbing_array;\n}", "protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }" ]
[ "0.60829383", "0.5887225", "0.55282664", "0.5389894", "0.53524494", "0.5308951", "0.5277775", "0.5273033", "0.5268283", "0.5245436", "0.5217512", "0.5200399", "0.51693547", "0.51646817", "0.5145068", "0.51392764", "0.51145387", "0.51015264", "0.5095265", "0.50755227", "0.50574976", "0.50564414", "0.5032701", "0.5031097", "0.5011418", "0.49978662", "0.4993779", "0.49670076", "0.49601856", "0.49596426" ]
0.6924176
0
/ Clean evil tags / Clean possible javascipt codes
function clean_evil_tags( $t ) { $t = preg_replace( "/javascript/i" , "j&#097;v&#097;script", $t ); $t = preg_replace( "/alert/i" , "&#097;lert" , $t ); $t = preg_replace( "/about:/i" , "&#097;bout:" , $t ); $t = preg_replace( "/onmouseover/i", "&#111;nmouseover" , $t ); $t = preg_replace( "/onclick/i" , "&#111;nclick" , $t ); $t = preg_replace( "/onload/i" , "&#111;nload" , $t ); $t = preg_replace( "/onsubmit/i" , "&#111;nsubmit" , $t ); $t = preg_replace( "/<body/i" , "&lt;body" , $t ); $t = preg_replace( "/<html/i" , "&lt;html" , $t ); $t = preg_replace( "/document\./i" , "&#100;ocument." , $t ); return $t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function xss_clean($var) {\r\n\treturn preg_replace('/(java|vb)script/i', '\\\\1 script', utf8_htmlspecialchars($var));\r\n}", "function remove_php_tags(&$code) {\r\n\r\n\t\t\t\t// This matches the information gathered from the internal PHP lexer\r\n\t\t\t\t$match = array(\r\n\t\t\t\t\t'#<([\\?%])=?.*?\\1>#s',\r\n\t\t\t\t\t'#<script\\s+language\\s*=\\s*([\"\\']?)php\\1\\s*>.*?</script\\s*>#s',\r\n\t\t\t\t\t'#<\\?php(?:\\r\\n?|[ \\n\\t]).*?\\?>#s'\r\n\t\t\t\t);\r\n\r\n\t\t\t$code = preg_replace($match, '', $code);\r\n\t}", "function clean_extraneous_inline() {\r\n\t}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "function wpse_allowedtags() {\n return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>';\n}", "function clean_script_tag($input) {\n $input = str_replace(\"type='text/javascript' \", '', $input);\n return str_replace(\"'\", '\"', $input);\n}", "function xss_html_clean( $html )\n\t{\n\t\t//-----------------------------------------\n\t\t// Opening script tags...\n\t\t// Check for spaces and new lines...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\" , \"&lt;script\" , $html );\n\t\t$html = preg_replace( \"#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\", \"&lt;/script\", $html );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Basics...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $html );\n\t\t$html = preg_replace( \"/alert/i\" , \"&#097;lert\" , $html );\n\t\t$html = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $html );\n\t\t$html = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $html );\n\t\t$html = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $html );\n\t\t$html = preg_replace( \"/onload/i\" , \"&#111;nload\" , $html );\n\t\t$html = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $html );\n\t\t$html = preg_replace( \"/<body/i\" , \"&lt;body\" , $html );\n\t\t$html = preg_replace( \"/<html/i\" , \"&lt;html\" , $html );\n\t\t$html = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $html );\n\t\t\n\t\treturn $html;\n\t}", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function clean_script_tag( $input ) {\n\t$input = str_replace( \"type='text/javascript' \", '', $input );\n\n\treturn str_replace( \"'\", '\"', $input );\n}", "public function removeCode()\n\t{\n\t\t// This is useful for saving space.\n\t\t// This function is useful when dealing with \"composite pages\" i.e.\n\t\t// the processor would:\n\t\t// -- fetch the code from the content,\n\t\t// -- load the code in the PHP machine using \"eval\"\n\t\t// -- strip the content from the code\n\t\t// -- invoke the callback with, as parameters, the source page & \n\t\t// this page's content \n\t\t$content = preg_replace(\"/\\<php(.*)php\\>/siU\",\"\", $this->content);\n\t\t$this->content = $content;\n\t}", "function codeTagFilter($text)\r\n{\r\n\t$pattern = '%(<code>)(.*?)(</code>)%se';\r\n\t$replace = \"'\\\\1'.htmlentities(codeTagFilter('\\\\2')).'\\\\3'\";\r\n\treturn stripslashes(preg_replace($pattern, $replace, $text));\r\n}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function cleanLeftoverJunk(&$string)\n\t{\n\t\t$string = preg_replace('#<\\!-- (START|END): SRC_[^>]* -->#', '', $string);\n\n\t\tif (strpos($string, $this->src_params->tag_character_start . '/' . $this->src_params->syntax_word) === false)\n\t\t{\n\t\t\t$this->unprotectTags($string);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$regex = $this->src_params->regex;\n\t\tif (@preg_match($regex . 'u', $string))\n\t\t{\n\t\t\t$regex .= 'u';\n\t\t}\n\n\t\t$string = preg_replace(\n\t\t\t$regex,\n\t\t\t'<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::_('SRC_CODE_REMOVED_NOT_ENABLED') . ' -->',\n\t\t\t$string\n\t\t);\n\n\t\t$this->unprotectTags($string);\n\t}", "function smarty_postfilter_strip($compiled, &$smarty)\n{\n\treturn preg_replace('/<\\?php\\s+\\?>/', '', $compiled);\n}", "function unescape_invalid_shortcodes($content)\n {\n }", "function dumb($data){\n highlight_string(\"<?php\\n \" . var_export($data, true) . \"?>\");\n echo '<script>document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\")[1].remove() ;document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\")[document.getElementsByTagName(\"code\")[0].getElementsByTagName(\"span\").length - 1].remove() ; </script>';\n die();\n }", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "function tac_tidy_scrip_tag( $tag, $handle ) {\n\treturn preg_replace( \"/type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}", "function doTagStuff(){}", "function cleanInput($input) \n{\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n $output = preg_replace($search, '', $input);\n return $output;\n}", "public function doXHTML_cleaning() {}", "public static function cleanOut($s) {\n $s = str_replace('//<?php', '//', $s);\n $s = str_replace('<?php', '', $s);\n return $s;\n }", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "function cleanInput ($input) {\n\t \n\t\t$search = array(\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t\t);\n\n\t\treturn preg_replace($search, '', $input);\n\t}", "function limpiahtml($salida){\n $regex = \"/<script.*?>.*?<\\/script>/ims\";\n preg_match_all($regex, $salida, $matches, null, 0);\n if(count($matches)>0){\n $tags2add = \"\"; \n foreach($matches[0] as $tag){\n if(!strstr($tag, \"inmovil\")){\n $retag = $tag;\n $tag = JSMin::minify($tag);\n $tags2add .= $tag;\n $salida = str_replace($retag, \"\", $salida);\n }\n }\n } \n $salida = minify_html($salida);\n\n\n $salida = str_replace(array(\"</body>\"),array($tags2add.\"</body>\"),$salida);\n return $salida;\n echo preg_last_error();\n}", "function funky_javascript_fix($text)\n {\n }", "function cleanInput($input) {\n\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $output = preg_replace($search, '', $input);\n return $output;\n}", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}" ]
[ "0.73697287", "0.66786855", "0.6586153", "0.6528951", "0.64891165", "0.6432465", "0.64196044", "0.6373935", "0.63127214", "0.6304424", "0.6282587", "0.6265657", "0.62566864", "0.6248505", "0.6242657", "0.62215096", "0.61893976", "0.6185675", "0.61794484", "0.61550945", "0.61527824", "0.6126558", "0.609933", "0.60586995", "0.6042453", "0.60301965", "0.6009503", "0.60010207", "0.59999025", "0.59793943" ]
0.7643503
0
/ MEMBER FUNCTIONS / Set up defaults for a guest user
function set_up_guest($name='Guest') { return array( 'name' => $name, 'members_display_name' => $name, '_members_display_name' => $name, 'id' => 0, 'password' => '', 'email' => '', 'title' => '', 'mgroup' => $this->vars['guest_group'], 'view_sigs' => $this->vars['guests_sig'], 'view_img' => $this->vars['guests_img'], 'view_avs' => $this->vars['guests_ava'], 'member_forum_markers' => array(), 'avatar' => '', 'member_posts' => '', 'member_group' => $this->cache['group_cache'][$this->vars['guest_group']]['g_title'], 'member_rank_img' => '', 'member_joined' => '', 'member_location' => '', 'member_number' => '', 'members_auto_dst' => 0, 'has_blog' => 0, 'has_gallery' => 0, 'is_mod' => 0, 'last_visit' => 0, 'login_anonymous' => '', 'mgroup_others' => '', 'org_perm_id' => '', '_cache' => array( 'qr_open' => 0 ), 'auto_track' => 0, 'ignored_users' => NULL, 'members_editor_choice' => 'std', '_cache' => array( 'friends' => array() ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function setGuest() {\n if ( Config::get('guest') !== true ) {\n User::setError('Der Gastzugang wurde deaktiviert!');\n return;\n }\n $_SESSION['user']['verified'] = 'no';\n $_SESSION['user']['guest'] = true;\n }", "public function getDefaultUserState();", "function wp_install_defaults($user_id)\n {\n }", "private function _setDefaultUser()\n {\n $user = User::getDefaultUser();\n Globals::setUser($user);\n Zend_Auth::getInstance()->clearIdentity();\n }", "function get_guest() {\n return get_complete_user_data('username', 'guest');\n}", "function _setDefaults() {}", "public function applyDefaultValues()\n\t{\n\t\t$this->st_usuario = true;\n\t}", "public function load_with_defaults ()\n {\n parent::load_with_defaults ();\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', User_email_scrambled);\n\n $this->set_required ('password1', true);\n $this->set_required ('password2', true);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n }", "function wp_user_settings()\n {\n }", "function setup_userdata($for_user_id = 0)\n {\n }", "protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }", "function get_user_setting($name, $default_value = \\false)\n {\n }", "protected function createDefaultUser() {\n User::create([\n 'name' => 'Admin',\n 'puntaje' => 1,\n 'lastname' => 'Admin',\n 'nacimiento' => Carbon::now(),\n 'fecha_visita' => Carbon::now(),\n 'email' => '[email protected]',\n 'equipo_id' => 1,\n 'password' => Hash::make('123456789')\n ]); \n }", "public function init() {\n\t\twp_get_current_user();\n\t}", "private function init_user() {\n global $USER, $DB;\n\n $userdata = new stdClass;\n $userdata->username = 'user';\n $userid = user_create_user($userdata);\n $USER = $DB->get_record('user', array('id' => $userid));\n context_user::instance($USER->id);\n }", "function th_login_form_defaults( $defaults ) {\n $defaults['label_username'] = 'Email Address';\n return $defaults;\n}", "function ks_blankgravatar( $avatar_defaults ) {\n\t$myavatar = get_template_directory_uri() . '/img/gravatar.jpg';\n\t$avatar_defaults[ $myavatar ] = \"Custom Gravatar\";\n\n\treturn $avatar_defaults;\n}", "function seun_edit_user_options() {\n\n\t\t\tglobal $user_id;\n\n\t\t\t$user_id = isset($user_id) ? (int) $user_id : 0;\n\n\t\t\tif ( ! current_user_can('edit_users') )\n\t\t\t\treturn;\n\n\t\t\tif ( ! ($userdata = get_userdata( $user_id ) ) )\n\t\t\t\treturn;\n\n\t\t\t$default_user_nicename = sanitize_title( $userdata->user_login );\n\n\t\t\techo '<h3>'.__('User Nicename', 'seun').'</h3>'\n\t\t\t\t.'<table class=\"form-table\">'.\"\\n\"\n\t\t\t\t\t.'<tr>'.\"\\n\"\n\t\t\t\t\t\t.'<th><label for=\"user_nicename\">'.__('User nicename/slug', 'seun').'</label></th>'.\"\\n\"\n\t\t\t\t\t\t.'<td>'\n\t\t\t\t\t\t\t.'<input id=\"user_nicename\" name=\"user_nicename\" class=\"regular-text code\" type=\"text\" value=\"'.sanitize_title($userdata->user_nicename, $default_user_nicename).'\"/> '\n\t\t\t\t\t\t\t.'<span class=\"description\">('.sprintf(__('Leave empty for default value: %s', 'seun'), $default_user_nicename).')</span> '\n\t\t\t\t\t\t\t.'<a href=\"'.get_author_posts_url($user_id).'\">'.__('Your Profile').'</a> '\n\t\t\t\t\t\t.\"</td>\\n\"\n\t\t\t\t\t.'</tr>'.\"\\n\"\n\t\t\t\t.'</table>'.\"\\n\";\n\n\t\t}", "function setDefaults()\n {\n }", "function user_init($env, $vars) {\n $user = UserFactory::current($env);\n // TODO: fix cookies.\n\t//setcookie('user', NULL, $env->getData('session_lifetime', 86400));\n}", "function session_defaults() {\n\t$_SESSION['logged'] = false;\n\t$_SESSION['uid'] = 0;\n\t$_SESSION['username'] = '';\n\t$_SESSION['email'] = '';\n\t$_SESSION['cookie'] = 0;\n}", "function wp_super_edit_set_user_default() {\n\tglobal $wp_super_edit, $wp_super_edit_tinymce_default;\n\n\t// Output buffering to get default TinyMCE init - Since it's the core editor we want the DFW(distraction free writing)\n\tob_start();\n\tif ( function_exists( 'wp_editor' ) ) \n\t\twp_editor( '', 'null', array( 'dfw' => true ) );\n\telse\n\t\twp_tiny_mce();\n\tob_end_clean();\n\t\t\n\t$wp_super_edit->register_user_settings( 'wp_super_edit_default', 'Default Editor Settings', $wp_super_edit_tinymce_default, 'single' );\n\n\t$wp_super_edit->set_option( 'tinymce_scan', $wp_super_edit_tinymce_default );\n\t$wp_super_edit->set_option( 'management_mode', 'single' );\n\t\n\t/**\n\t* Remove old options for versions 2.2\n\t*/\t\n\tdelete_option( 'wp_super_edit_tinymce_scan' );\n\t\n\t/**\n\t* Remove old options for versions 1.5 \n\t*/\t\n\tdelete_option( 'superedit_options' );\n\tdelete_option( 'superedit_buttons' );\n\tdelete_option( 'superedit_plugins' );\n}", "function Users_init(&$options, $memberInfo, &$args){\n\n\t\treturn TRUE;\n\t}", "public static function initFeUser() {}", "protected function renderUserSetup() {}", "protected function setupUsers() {\n $this->translator = $this->drupalCreateUser($this->getTranslatorPermissions(), 'translator');\n $this->editor = $this->drupalCreateUser($this->getEditorPermissions(), 'editor');\n $this->administrator = $this->drupalCreateUser($this->getAdministratorPermissions(), 'administrator');\n $this->drupalLogin($this->translator);\n }", "protected function setDefaults()\n {\n return;\n }", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "function install_blog_defaults($blog_id, $user_id)\n {\n }", "protected function setDefaults(): void {\n\t\t$fromEmail = Configure::read('Config.systemEmail');\n\t\tif ($fromEmail) {\n\t\t\t$fromName = Configure::read('Config.systemName');\n\t\t} else {\n\t\t\t$fromEmail = Configure::read('Config.adminEmail');\n\t\t\t$fromName = Configure::read('Config.adminName');\n\t\t}\n\t\tif ($fromEmail) {\n\t\t\t$this->setFrom($fromEmail, $fromName);\n\t\t}\n\t}" ]
[ "0.6581884", "0.6566193", "0.655729", "0.6526153", "0.6416496", "0.6355108", "0.6351415", "0.63000035", "0.62995017", "0.62742853", "0.62547874", "0.62404156", "0.623751", "0.6208677", "0.619307", "0.61585796", "0.61277634", "0.6113799", "0.6109703", "0.6072137", "0.60711396", "0.60704803", "0.60041076", "0.59635633", "0.5944338", "0.59240437", "0.5923339", "0.5910067", "0.5902652", "0.5890784" ]
0.65721273
1
/ Show Board Offline / Show board offline message
function board_offline() { $this->quick_init(); //----------------------------------------- // Get offline message (not cached) //----------------------------------------- $row = $this->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key='offline_msg'" ) ); $this->load_language("lang_error"); $msg = preg_replace( "/\n/", "<br />", stripslashes( $row['conf_value'] ) ); $html = $this->compiled_templates['skin_global']->board_offline( $msg ); $print = new display(); $print->ipsclass =& $this; $print->add_output($html); $print->do_output( array( 'OVERRIDE' => 1, 'TITLE' => $this->lang['offline_title'], ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_offline_messages() {\n\t\t$sender = $this->request->param('id');\n\t\t$offline_messages = ORM::factory('Message')->get_offline_messages($this->_current_user->id, $sender);\n\t\t$this->_set_msg('Offline Messages Retrieved', 'success', $offline_messages);\n\t}", "function LUTB_BoardIndex()\n{\n\tglobal $context, $modSettings;\n\tBoardIndex();\n\t$context['users_online'] = !empty($context['users_online']) && allowedTo('who_view') && !empty($modSettings['who_enabled']);\n}", "function board_list(){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$head = \"\";\n\t\t$body='';\n\t\t\n\t\t$indice = indice_board();\n\n\n\t\t$q_new = $db->DoQuery(\"SELECT count(*) AS cnt FROM {$prefix}boardunread WHERE user='{$x7s->username}'\");\n\t\t$new_msg = $db->Do_Fetch_Assoc($q_new);\n\n\t\t$body=\"<b>Ci sono $new_msg[cnt] messaggi nuovi</b>\";\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}", "public static function getOfflineMessage() {\n $configModel = new \\App\\Configurations();\n echo $configModel->get(\\Config::get('configurations.open_time_msg_key'));\n }", "function online_offline_status ($user_id, $forum_mod)\n{\n \tglobal $lang, $board_config, $userdata, $images, $phpbb_theme, $phpEx;\n\t$status['color'] = '';\n\tif ( $user_id['user_id'] != ANONYMOUS )\n\t{\n\t\tif ( $user_id['user_allow_viewonline'] && !$board_config['pnphpbb2_members_online'] )\n\t\t{\n\t\t\tif ( $user_id['user_session_time'] >= (time()-60) )\n\t \t \t{\n\t\t\t\t// Check admin/mod status\n\t\t\t\tif ( $user_id['user_level'] == ADMIN )\n\t\t\t\t{\n\t\t\t\t\t$status['image'] = ( $images['user_admin'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_admin'] . '\" alt=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" title=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor3'] . '\"';\n\t\t\t\t}\n\t\t\t\telse if ( $forum_mod )\n\t\t\t\t{\n\t\t\t \t\t$status['image'] = ( $images['user_mod'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_mod'] . '\" alt=\"' . $lang['Moderator'] . '\" title=\"' . $lang['Moderator'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor2'] . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t$status['image'] = ( $images['user_online'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_online'] . '\" alt=\"' . $lang['Online'] . '\" title=\"' . $lang['Online'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t}\t\n\t\t\t\t$status['text'] = $lang['Status'] . '<b><a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"' . $status['color'] . '>' . $lang['Online'] . '</a></b>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t\t\t\t$status['text'] = $lang['Status'] . $lang['Offline'];\n\t\t\t\t$status['image'] = ( $images['user_offline'] ) ? '<img src=\"' . $images['user_offline'] . '\" alt=\"' . $lang['Offline'] . '\" title=\"' . $lang['Offline'] . '\" hspace=\"3\" align=\"top\" />' : '';\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$status['text'] = \"\";\n\t\t$status['image'] = \"\";\n\t}\n\t\n\treturn $status;\n}", "public function setStatusOffline()\r\n {\r\n return $this->exec('status_offline');\r\n }", "function realmstatus($realm) {\r\n\r\n\tglobal $realm, $realmd_host, $realmd_user, $realmd_pass, $realmd_db, $theme;\r\n\t\r\n\t$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\r\n\tif (!socket_connect($socket,$realm['address'],$realm['port'])) {\r\n\t\treturn '<img src=\"themes/'.$theme.'/images/offline.png\">';\r\n\t}\r\n\telse {\r\n\t\treturn '<img src=\"themes/'.$theme.'/images/online.png\">';\r\n\t}\r\n\t\r\n}", "function messaging_show_online_dot() {\n\t\tif ( $this->is_hidden_status( um_user('ID') ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$args['is_online'] = UM()->Online()->is_online( um_user('ID') );\n\n\t\tob_start();\n\n\t\tUM()->get_template( 'online-marker.php', um_online_plugin, $args, true );\n\n\t\tob_end_flush();\n\t}", "function isOffline() \n\t{\n\t\treturn ($this->status == self::STATUS_OFFLINE) ? true : false;\n\t}", "function show_board($bid){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$indice=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}boards WHERE id='{$bid}'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t\n\t\tif(!$row){\n\t\t\t$body=\"La board richiesta non esiste\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$head=\"Errore\";\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$board['name']=$row['name'];\n\t\t$board['id']=$row['id'];\n\t\t$board['user_group']=$row['user_group'];\n\t\t$board['readonly']=$row['readonly'];\n\t\t\n\t\t\n\t\t$head=\"Board \".$board['name'];\n\t\t\n\t\t\n\n\t\tif(!checkAuth($bid)){\n\t\t\t$body=\"Non sei autorizzato a vedere questa board\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!isset($_GET['message'])){\n\t\t\tshow_all_messages($board);\n\t\t}\n\t\telse{\n\t\t\tshow_single_message($_GET['message'],$board);\n\t\t}\n\t\t\n\t\t\n\t}", "public function isOffline()\n {\n return $this->offline;\n }", "public function onlineAction() {}", "public function offline($onoff = 0, $message = ''){\r\n if(!empty($message)){\r\n $command = sprintf(\"%s/%s %d '%s'\", $this->path, 'drush vset --yes maintenance_mode', $onoff, $message);\r\n }else {\r\n $command = sprintf(\"%s/%s %d\", $this->path, 'drush vset --yes maintenance_mode', $onoff);\r\n }\r\n return $this->exec([$command, false]);\r\n }", "public static function getOnlineMessage() {\n $configModel = new \\App\\Configurations();\n echo $configModel->get(\\Config::get('configurations.online_msg_key'));\n }", "public function ShowDetail(){\n \n \n \n echo \"<div id='online'>Online : \" . $this->User_Online . \"</div>\";\n \n }", "function messaging_show_online_dot_js() {\n\t\tob_start(); ?>\n\n\t\t<span class=\"um-online-status <# if ( conversation.online ) { #>online<# } else { #>offline<# } #>\"><i class=\"um-faicon-circle\"></i></span>\n\n\t\t<?php ob_end_flush();\n\t}", "protected function prepareSeeOfflineComment(){\n $this->htmlSeeOfflineComment($this->offlineComment());\n }", "public static function maintenance_mode()\n\t{\n\t\t$maintenance_mode = Config::get('site.maintenance_mode', FALSE);\n\t\t$message = Config::get('site.offline_message', FALSE);\n\t\t$message = (empty($message) OR ! $message) ? Gleez::MAINTENANCE_MESSAGE : $message;\n\t\t$request = Request::initial();\n\n\t\tif ($maintenance_mode AND ($request instanceof Request) AND ($request->controller() != 'user' AND $request->action() != 'login') AND !ACL::check('administer site') AND $request->controller() != 'media')\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(503, __($message));\n\t\t}\n\t}", "function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}", "function show_all_messages($board){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\n\t\t$head=\"Board \".$board['name'];\n\t\t$body=\"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n function do_delete(url){\n if(!confirm('Vuoi davvero cancellare il messaggio?'))\n return;\n\n window.location.href=url;\n }\n </script>\n\t\t\";\n\t\t$indice = indice_board();\n\t\t\n\t\t$maxmsg=10;\n\t\t$navigator='<p style=\"text-align: center;\">';;\n\t\t\n\t\tif(isset($_GET['startfrom'])){\n\t\t\t$limit=$_GET['startfrom'];\n\t\t}\n\t\telse\n\t\t\t$limit=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT count(*) AS total FROM {$prefix}boardmsg WHERE board='{$board['id']}' AND father='0'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t$total = $row['total'];\n\t\t\n\t\tif($total > $maxmsg){\n\t\t\t$i=0;\n\t\t\twhile($total > 0){\n\t\t\t\tif((isset($_GET['startfrom']) && $_GET['startfrom'] == $i) || (!isset($_GET['startfrom']) && $i == 0))\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&startfrom=$i\\\"><b>[\".($i+1).\"]</b></a> \";\n\t\t\t\telse\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&startfrom=$i\\\">\".($i+1).\"</a> \";\n\t\t\t\t$i++;\n\t\t\t\t$total -= $maxmsg;\n\t\t\t\t\n\t\t\t}\n\t\t\t$navigator.=\"</p>\";\n\t\t}\n\t\t\n\t\t\t\n\t\t$limit_min = $limit * $maxmsg;\n\t\t$limit_max = $maxmsg;\t\t\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}boardmsg \n\t\t\t\tWHERE board='{$board['id']}' \n\t\t\t\tAND father='0' ORDER BY last_update DESC LIMIT $limit_min, $limit_max\");\n\n\t\t\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<a href=./index.php?act=boards&send=\".$board['id'].\">Nuova comunicazione</a><br>\";\n\t\t}\n\t\t\n\t\t$body.=$navigator;\n\t\t$unreads = get_unread();\n\t\twhile($row = $db->Do_Fetch_Assoc($query)){\n\t\t\t$q_new = $db->DoQuery(\"SELECT count(*) AS cnt FROM {$prefix}boardmsg msg, {$prefix}boardunread un\n\t\t\t\t\t\tWHERE\tmsg.id=un.id\n\t\t\t\t\t\tAND un.user='{$x7s->username}'\n\t\t\t\t\t\tAND board='{$board['id']}' AND father='$row[id]'\");\n\t\t\t$new_replies = $db->Do_Fetch_Assoc($q_new);\n\t\t\t\n\t\t\t$unread='';\n\t\t\tif(isset($unreads[$row['id']]))\n\t\t\t\t$unread = \"<b>(Nuovo) </b>\";\n\n\t\t\tif($new_replies['cnt']>0){\n\t\t\t\t$unread .= \"<b>(Nuove repliche: $new_replies[cnt])</b>\";\n\t\t\t}\n\t\t\t\n\t\t\t$nb = board_msg_split($row['body']);\n\t\t\t$msg = $nb[0];\n\t\t\t$object = $nb[1];\n\t\t\t$msgid=$row['id'];\n\t\t\t$user=$row['user'];\n\n\t\t\tif ($row['anonymous']) {\n\t\t\t\tif (checkIfMaster()) {\n\t\t\t\t\t$user .= \" (anonimo)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$user = \"Anonimo\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$body.=\"<p>\".$user.\"<br><a href=./index.php?act=boards&board=\".$board['id'].\"&message=\".$row['id'].\">\n\t\t\t\t <b>\".$object.\"</b> \".$unread.\"</a>\";\n\t\t\t\t\n\t\t\tif(checkIfMaster()){\n\t\t\t\t$startfrom = \"\";\n\t\t\t\tif (isset($_GET['startfrom']))\n\t\t\t\t\t$startfrom = \"&startfrom=\".$_GET['startfrom'];\n\n\t\t\t\t$body.=\" <a href=\\\"#\\\" onClick=\\\"javascript: do_delete('./index.php?act=boards&delete=$msgid$startfrom')\\\">[Delete]</a>\";\n\t\t\t\t$body.=\" <a href=./index.php?act=boards&move=$msgid>[Sposta]</a>\";\n }\n\t\t\t\n\t\t\t$body.=\"</p><hr>\";\n\t\t\n\t\t}\n\t\t$body.=$navigator;\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<br><br><a href=./index.php?act=boards&send=\".$board['id'].\">Nuova comunicazione</a><br>\";\n\t\t}\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}", "public function isOnline() {}", "public function setOffline($value)\n {\n $this->offline = $value;\n }", "public function getOfflineInfo()\n {\n $additional_data = $this->getAdditionalData();\n if (isset($additional_data['offline_info']['data'])) {\n return $additional_data['offline_info']['data'];\n }\n\n return false;\n }", "function board( $args )\n\t{\n\t // get board id\n\t $board_id = (int) $args['id'];\n\t \n\t // get board info\n\t $boards_model = $this->app->\n\t model('forum_boards','forum/models');\n\t \n\t // get board item\n\t $board = $boards_model->get_item( $board_id );\n\t \n\t // check if records found\n\t if( count($board) == 0 ){\n\t \n\t // st page title to reflect\n\t $this->view->add('page_title','Unknown board');\n\t $this->view->add('board_description','None');\n\t $this->view->add('board_name','Unknown');\n\t } else {\n\t \n\t // set page title\n\t $this->view->add('page_title','Viewing threads\n\t in message board: ' . $board[0]['name'] );\n\t $this->view->add('board_description',\n\t $board[0]['description']);\n\t $this->view->add('board_name',\n\t $board[0]['name']);\n\t }\n\t \n\t // get threads\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t // add the threads to the page\n\t $this->view->add('threads_result',\n\t $threads_model->get_threads($board_id) );\n\t \n\t \n\t /* -----------------------\n\t * Add actions to the view\n\t */\n\t \n\t // index action\n\t $this->view->add('index_action',\n\t $this->app->form_path('forum'));\n\t \n\t // create a new thread action\n\t $this->view->add('add_action',\n\t $this->app->form_path('forum/newthread/'.$board_id));\n\t \n\t // search the forum action\n\t $this->view->add('search_action',\n\t $this->app->form_path('forum/search'));\n\t \n\t // add thread action to view\n\t $this->view->add('thread_action',\n $this->app->form_path('forum/thread'));\n \t\n\t}", "protected function _users_online_url()\n {\n return get_forum_base_url() . '/online.php';\n }", "public function show()\n {\n //the board string is used in the view\n $data = $this->getBoardAsString();\n require VIEW_PATH.'web.php';\n\n }", "function os_offline($params) {\n\t\tparent::setName('os_offline');\t\t\n\t\tparent::os_payment();\t\t\t\t\n\t\tparent::setCreditCard(false);\t\t\n \tparent::setCardType(false);\n \tparent::setCardCvv(false);\n \tparent::setCardHolderName(false);\t\n \t$this->order_status = $params->get('order_status');\n\t}", "public function isOnline() {\n }", "function um_online_show_status( $value, $data ) {\n\t\tif ( $this->is_hidden_status( um_user('ID') ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$args['is_online'] = UM()->Online()->is_online( um_user('ID') );\n\n\t\tob_start();\n\n\t\tUM()->get_template( 'online-text.php', um_online_plugin, $args, true );\n\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "function isOffline()\n{\n $connected = checkdnsrr(\"google.com\");\n\n if ($connected) {\n return false;\n }\n\n return true;\n}" ]
[ "0.6826253", "0.64398205", "0.64027977", "0.6251923", "0.6168884", "0.6125532", "0.6123772", "0.6099643", "0.6003086", "0.59283787", "0.5870367", "0.5771556", "0.5735616", "0.5711155", "0.56820774", "0.55978817", "0.55594736", "0.5534723", "0.5512475", "0.55120397", "0.54879993", "0.5467032", "0.5464772", "0.541662", "0.5403013", "0.53988177", "0.5394871", "0.5389928", "0.53705853", "0.5339412" ]
0.857349
0
/ Array filter: Clean read topics / Array sort Used to remove out of date topic marking entries
function array_filter_clean_read_topics ( $var ) { global $ipsclass; return $var > $ipsclass->vars['db_topic_read_cutoff']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sf_clean_topic_subs()\n{\n\tglobal $wpdb;\n\n\t# build list of topics with subscriptions\n\t$topics = $wpdb->get_results(\"SELECT topic_id, topic_subs FROM \".SFTOPICS.\" WHERE topic_subs IS NOT NULL;\");\n\tif(!$topics) return;\n\n\tforeach($topics as $topic)\n\t{\n\t\t$nvalues = array();\n\t\t$cvalues = explode('@', $topic->topic_subs);\n\t\t$nvalues[0] = $cvalues[0];\n\t\tforeach($cvalues as $cvalue)\n\t\t{\n\t\t\t$notfound = true;\n\t\t\tforeach($nvalues as $nvalue)\n\t\t\t{\n\t\t\t\tif($nvalue == $cvalue) $notfound = false;\n\t\t\t}\n\t\t\tif($notfound) $nvalues[]=$cvalue;\n\t\t}\n\t\t$nvaluelist = implode('@', $nvalues);\n\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_subs='\".$nvaluelist.\"' WHERE topic_id=\".$topic->topic_id);\n\t}\n\treturn;\n}", "function UnreadTopics()\n{\n\tglobal $board, $txt, $scripturl, $db_prefix, $sourcedir;\n\tglobal $ID_MEMBER, $user_info, $context, $modSettings;\n\n\t// Guests can't have unread things, we don't know anything about them.\n\tis_not_guest();\n\n\t$context['sub_template'] = $_REQUEST['action'] == 'unread' ? 'unread' : 'replies';\n\t$context['showing_all_topics'] = isset($_GET['all']);\n\tif ($_REQUEST['action'] == 'unread')\n\t\t$context['page_title'] = $context['showing_all_topics'] ? $txt['unread_topics_all'] : $txt['unread_topics_visit'];\n\telse\n\t\t$context['page_title'] = $txt['unread_replies'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''),\n\t\t'name' => $context['page_title']\n\t);\n\n\tloadTemplate('Recent');\n\n\t$is_topics = $_REQUEST['action'] == 'unread';\n\n\t// Are we specifying any specific board?\n\tif (!empty($board))\n\t\t$query_this_board = 'b.ID_BOARD = ' . $board;\n\telse\n\t{\n\t\t$query_this_board = $user_info['query_see_board'];\n\n\t\t// Don't bother to show deleted posts!\n\t\tif (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)\n\t\t\t$query_this_board .= '\n\t\t\t\tAND b.ID_BOARD != ' . $modSettings['recycle_board'];\n\t}\n\n\t// This part is the same for each query.\n\t$select_clause = '\n\t\t\t\tms.subject AS firstSubject, ms.posterTime AS firstPosterTime, ms.ID_TOPIC, t.ID_BOARD, b.name AS bname,\n\t\t\t\tt.numReplies, t.numViews, ms.ID_MEMBER AS ID_FIRST_MEMBER, ml.ID_MEMBER AS ID_LAST_MEMBER,\n\t\t\t\tml.posterTime AS lastPosterTime, IFNULL(mems.realName, ms.posterName) AS firstPosterName,\n\t\t\t\tIFNULL(meml.realName, ml.posterName) AS lastPosterName, ml.subject AS lastSubject,\n\t\t\t\tml.icon AS lastIcon, ms.icon AS firstIcon, t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS lastModifiedTime,\n\t\t\t\tIFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS isRead, LEFT(ml.body, 384) AS lastBody, LEFT(ms.body, 384) AS firstBody,\n\t\t\t\tml.smileysEnabled AS lastSmileys, ms.smileysEnabled AS firstSmileys, t.ID_FIRST_MSG, t.ID_LAST_MSG';\n\n\tif ($context['showing_all_topics'] || !$is_topics)\n\t{\n\t\tif (!empty($board))\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(logTime)\n\t\t\t\tFROM {$db_prefix}log_mark_read\n\t\t\t\tWHERE ID_MEMBER = $ID_MEMBER\n\t\t\t\t\tAND ID_BOARD = $board\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(lmr.logTime)\n\t\t\t\tFROM {$db_prefix}boards AS b\n\t\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_MEMBER = $ID_MEMBER AND lmr.ID_BOARD = b.ID_BOARD)\n\t\t\t\tWHERE $user_info[query_see_board]\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT MIN(logTime)\n\t\t\tFROM {$db_prefix}log_topics\n\t\t\tWHERE ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\tlist ($earliest_time2) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\tif ($earliest_time2 < $earliest_time)\n\t\t\t$earliest_time = (int) $earliest_time2;\n\t\telse\n\t\t\t$earliest_time = (int) $earliest_time;\n\t}\n\n\tif ($is_topics)\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\" . ($context['showing_all_topics'] ? \"\n\t\t\t\tAND ml.posterTime >= $earliest_time\" : \"\n\t\t\t\tAND t.ID_LAST_MSG > $_SESSION[ID_MSG_LAST_VISIT]\") . \"\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t}\n\telse\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_MEMBER_UPDATED != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ml.posterTime >= $earliest_time\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'], $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT DISTINCT t.ID_TOPIC\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE ml.ID_MEMBER != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t\t$topics = array();\n\t\twhile ($row = mysql_fetch_assoc($request))\n\t\t\t$topics[] = $row['ID_TOPIC'];\n\t\tmysql_free_result($request);\n\n\t\t// Sanity... where have you gone?\n\t\tif (empty($topics))\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC IN (\" . implode(', ', $topics) . \")\n\t\t\t\tAND t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT \" . count($topics), __FILE__, __LINE__);\n\t}\n\n\t$context['topics'] = array();\n\t$topic_ids = array();\n\twhile ($row = mysql_fetch_assoc($request))\n\t{\n\t\tif ($row['ID_POLL'] > 0 && $modSettings['pollMode'] == '0')\n\t\t\tcontinue;\n\n\t\t$topic_ids[] = $row['ID_TOPIC'];\n\n\t\t// Clip the strings first because censoring is slow :/. (for some reason?)\n\t\t$row['firstBody'] = strip_tags(strtr(doUBBC($row['firstBody'], $row['firstSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['firstBody']) > 128)\n\t\t\t$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';\n\t\t$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['lastBody']) > 128)\n\t\t\t$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';\n\n\t\t// Do a bit of censoring...\n\t\tcensorText($row['firstSubject']);\n\t\tcensorText($row['firstBody']);\n\n\t\t// But don't do it twice, it can be a slow ordeal!\n\t\tif ($row['ID_FIRST_MSG'] == $row['ID_LAST_MSG'])\n\t\t{\n\t\t\t$row['lastSubject'] = $row['firstSubject'];\n\t\t\t$row['lastBody'] = $row['firstBody'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcensorText($row['lastSubject']);\n\t\t\tcensorText($row['lastBody']);\n\t\t}\n\n\t\t// Decide how many pages the topic should have.\n\t\t$topic_length = $row['numReplies'] + 1;\n\t\tif ($topic_length > $modSettings['defaultMaxMessages'])\n\t\t{\n\t\t\t$tmppages = array();\n\t\t\t$tmpa = 1;\n\t\t\tfor ($tmpb = 0; $tmpb < $topic_length; $tmpb += $modSettings['defaultMaxMessages'])\n\t\t\t{\n\t\t\t\t$tmppages[] = '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.' . $tmpb . ';topicseen\">' . $tmpa . '</a>';\n\t\t\t\t$tmpa++;\n\t\t\t}\n\t\t\t// Show links to all the pages?\n\t\t\tif (count($tmppages) <= 5)\n\t\t\t\t$pages = '&#171; ' . implode(' ', $tmppages);\n\t\t\t// Or skip a few?\n\t\t\telse\n\t\t\t\t$pages = '&#171; ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];\n\n\t\t\tif (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])\n\t\t\t\t$pages .= ' &nbsp;<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all\">' . $txt[190] . '</a>';\n\t\t\t$pages .= ' &#187;';\n\t\t}\n\t\telse\n\t\t\t$pages = '';\n\n\t\t// And build the array.\n\t\t$context['topics'][$row['ID_TOPIC']] = array(\n\t\t\t'id' => $row['ID_TOPIC'],\n\t\t\t'first_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['firstPosterName'],\n\t\t\t\t\t'id' => $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_FIRST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '\" title=\"' . $txt[92] . ' ' . $row['firstPosterName'] . '\">' . $row['firstPosterName'] . '</a>' : $row['firstPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['firstPosterTime']),\n\t\t\t\t'timestamp' => $row['firstPosterTime'],\n\t\t\t\t'subject' => $row['firstSubject'],\n\t\t\t\t'preview' => $row['firstBody'],\n\t\t\t\t'icon' => $row['firstIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen\">' . $row['firstSubject'] . '</a>'\n\t\t\t),\n\t\t\t'last_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['lastPosterName'],\n\t\t\t\t\t'id' => $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_LAST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'] . '\">' . $row['lastPosterName'] . '</a>' : $row['lastPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['lastPosterTime']),\n\t\t\t\t'timestamp' => $row['lastPosterTime'],\n\t\t\t\t'subject' => $row['lastSubject'],\n\t\t\t\t'preview' => $row['lastBody'],\n\t\t\t\t'icon' => $row['lastIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'],\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'] . '\">' . $row['lastSubject'] . '</a>'\n\t\t\t),\n\t\t\t'newtime' => $row['isRead'],\n\t\t\t'new_href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.from' . $row['isRead'] . ';topicseen#new',\n\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new',\n\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new\">' . $row['firstSubject'] . '</a>',\n\t\t\t'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['isSticky']),\n\t\t\t'is_locked' => !empty($row['locked']),\n\t\t\t'is_poll' => $modSettings['pollMode'] == '1' && $row['ID_POLL'] > 0,\n\t\t\t'is_hot' => $row['numReplies'] >= $modSettings['hotTopicPosts'],\n\t\t\t'is_very_hot' => $row['numReplies'] >= $modSettings['hotTopicVeryPosts'],\n\t\t\t'is_posted_in' => false,\n\t\t\t'icon' => $row['firstIcon'],\n\t\t\t'subject' => $row['firstSubject'],\n\t\t\t'pages' => $pages,\n\t\t\t'replies' => $row['numReplies'],\n\t\t\t'views' => $row['numViews'],\n\t\t\t'board' => array(\n\t\t\t\t'id' => $row['ID_BOARD'],\n\t\t\t\t'name' => $row['bname'],\n\t\t\t\t'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0\">' . $row['bname'] . '</a>'\n\t\t\t)\n\t\t);\n\n\t\tdetermineTopicClass($context['topics'][$row['ID_TOPIC']]);\n\t}\n\tmysql_free_result($request);\n\n\tif ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))\n\t{\n\t\t$result = db_query(\"\n\t\t\tSELECT ID_TOPIC\n\t\t\tFROM {$db_prefix}messages\n\t\t\tWHERE ID_TOPIC IN (\" . implode(', ', $topic_ids) . \")\n\t\t\t\tAND ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif (empty($context['topics'][$row['ID_TOPIC']]['is_posted_in']))\n\t\t\t{\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['is_posted_in'] = true;\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['class'] = 'my_' . $context['topics'][$row['ID_TOPIC']]['class'];\n\t\t\t}\n\t\t}\n\t\tmysql_free_result($result);\n\t}\n\n\t$context['topics_to_mark'] = implode('-', $topic_ids);\n}", "function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001)\n{\n\tglobal $config, $db, $user;\n\n\t$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;\n\n\t// Data array we're going to return\n\t$unread_topics = array();\n\n\tif (empty($sql_sort))\n\t{\n\t\t$sql_sort = 'ORDER BY t.topic_last_post_time DESC';\n\t}\n\n\tif ($config['load_db_lastread'] && $user->data['is_registered'])\n\t{\n\t\t// Get list of the unread topics\n\t\t$last_mark = $user->data['user_lastmark'];\n\n\t\t$sql_array = array(\n\t\t\t'SELECT'\t\t=> 't.topic_id, t.topic_last_post_time, tt.mark_time as topic_mark_time, ft.mark_time as forum_mark_time',\n\n\t\t\t'FROM'\t\t\t=> array(TOPICS_TABLE => 't'),\n\n\t\t\t'LEFT_JOIN'\t\t=> array(\n\t\t\t\tarray(\n\t\t\t\t\t'FROM'\t=> array(TOPICS_TRACK_TABLE => 'tt'),\n\t\t\t\t\t'ON'\t=> \"tt.user_id = $user_id AND t.topic_id = tt.topic_id\",\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'FROM'\t=> array(FORUMS_TRACK_TABLE => 'ft'),\n\t\t\t\t\t'ON'\t=> \"ft.user_id = $user_id AND t.forum_id = ft.forum_id\",\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'WHERE'\t\t\t=> \"\n\t\t\t\t(\n\t\t\t\t(tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR\n\t\t\t\t(tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR\n\t\t\t\t(tt.mark_time IS NULL AND ft.mark_time IS NULL AND t.topic_last_post_time > $last_mark)\n\t\t\t\t)\n\t\t\t\t$sql_extra\n\t\t\t\t$sql_sort\",\n\t\t);\n\n\t\t$sql = $db->sql_build_query('SELECT', $sql_array);\n\t\t$result = $db->sql_query_limit($sql, $sql_limit);\n\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t$topic_id = (int) $row['topic_id'];\n\t\t\t$unread_topics[$topic_id] = ($row['topic_mark_time']) ? (int) $row['topic_mark_time'] : (($row['forum_mark_time']) ? (int) $row['forum_mark_time'] : $last_mark);\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t}\n\telse if ($config['load_anon_lastread'] || $user->data['is_registered'])\n\t{\n\t\tglobal $tracking_topics;\n\n\t\tif (empty($tracking_topics))\n\t\t{\n\t\t\t$tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true);\n\t\t\t$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();\n\t\t}\n\n\t\tif (!$user->data['is_registered'])\n\t\t{\n\t\t\t$user_lastmark = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$user_lastmark = (int) $user->data['user_lastmark'];\n\t\t}\n\n\t\t$sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time\n\t\t\tFROM ' . TOPICS_TABLE . ' t\n\t\t\tWHERE t.topic_last_post_time > ' . $user_lastmark . \"\n\t\t\t$sql_extra\n\t\t\t$sql_sort\";\n\t\t$result = $db->sql_query_limit($sql, $sql_limit);\n\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t$forum_id = (int) $row['forum_id'];\n\t\t\t$topic_id = (int) $row['topic_id'];\n\t\t\t$topic_id36 = base_convert($topic_id, 10, 36);\n\n\t\t\tif (isset($tracking_topics['t'][$topic_id36]))\n\t\t\t{\n\t\t\t\t$last_read = base_convert($tracking_topics['t'][$topic_id36], 36, 10) + $config['board_startdate'];\n\n\t\t\t\tif ($row['topic_last_post_time'] > $last_read)\n\t\t\t\t{\n\t\t\t\t\t$unread_topics[$topic_id] = $last_read;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (isset($tracking_topics['f'][$forum_id]))\n\t\t\t{\n\t\t\t\t$mark_time = base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'];\n\n\t\t\t\tif ($row['topic_last_post_time'] > $mark_time)\n\t\t\t\t{\n\t\t\t\t\t$unread_topics[$topic_id] = $mark_time;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$unread_topics[$topic_id] = $user_lastmark;\n\t\t\t}\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t}\n\n\treturn $unread_topics;\n}", "public function filterSpecificCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"world news\" || $cat == \"football\"/* ||$cat == \"fashion\" || $cat == \"technology\"*/){\n //test fashion whs technology $numb raus? film und politics guuut 0.8\n $newArray[$key] = $value;\n }\n\n /* if($cat == \"sport\"|| $cat == \"football\" || $cat == \"culture\" || $cat == \"art and design\"){\n $newArray[$key] = $value;\n }*/\n\n /*if( $cat == \"sport\" || $cat == \"uk news\" || $cat == \"opinion\" || $cat == \"society\" || $cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" || $cat == \"life and style\" || $cat == \"environment\" || $cat == \"technology\"\n ||$cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" || $cat == \"film\" || $cat == \"books\"\n ||$cat == \"us news\" || $cat == \"football\" || $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"/*){ //20 categories\n $newArray[$key] = $value;\n }*/\n\n /* if( $cat == \"us news\" || $cat == \"technology\" || $cat == \"science\" || $cat == \"sport\" || $cat == \"opinion\" ||\n $cat == \"world news\" || $cat == \"football\" || $cat == \"politics\" || $cat == \"fashion\" || $cat == \"television & radio\"\n ||$cat == \"culture\" || $cat == \"environment\" || $cat == \"art and design\" || $cat == \"life and style\" || $cat == \"travel\"/*\n || $cat == \"books\" || $cat == \"uk news\" || $cat == \"business\" || $cat == \"film\" || $cat == \"society\"){ //20 categories\n $newArray[$key] = $value;\n }\n */\n\n }\n\n\n return $newArray;\n }", "function MaintainRemoveOldPosts()\n{\n\t// Actually do what we're told!\n\tloadSource('RemoveTopic');\n\tRemoveOldTopics2();\n}", "function _build_topics_query()\n\t{\n\t\t$topics=$this->topics;//must always be an array\n\n\t\tif (!is_array($topics))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//remove topics that are not numeric\n\t\t$topics_clean=array();\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\tif (is_numeric($topic) )\n\t\t\t{\n\t\t\t\t$topics_clean[]=$topic;\n\t\t\t}\n\t\t}\n\n\t\tif ( count($topics_clean)>0)\n\t\t{\n\t\t\t$topics=implode(' OR ',$topics_clean);\n\n\t\t\tif ($topics)\n\t\t\t{\n\t\t\t\treturn sprintf(' topics_id:(%s)',$topics);\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function filterRoughCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = explode(\" \",$value->getArticleID()->getCategory())[0];\n if($cat == \"football\" ||$cat == \"world\" ||$cat == \"sport\" || $cat == \"uk-news\" ||$cat == \"fashion\"){ //5 categories\n $newArray[$key] = $value;\n }\n\n /*if($cat == \"uk-news\" ||$cat == \"world\" ||$cat == \"sport\" || $cat == \"football\" ||$cat == \"opinion\" ||\n $cat == \"culture\" || $cat == \"fashion\" ||$cat == \"business\" ||$cat == \"lifeandstyle\" || $cat == \"environment\"\n || $cat == \"technology\" || $cat == \"travel\"){ //12 categories\n $newArray[$key] = $value;\n }*/\n }\n return $newArray;\n }", "function readDirectory($Category, $numLow, $numHigh, $SplitThis, $TopicsPerPage) {\n\t$handle = opendir($Category);\n\t\twhile (false !== ($topics = readdir($handle))) { \n \t\t\tif ($topics != \".\" && $topics != \"..\") { \n\t\t\t\t$topicName = $Category.\"/\".$topics;\n \t\t\t\t$topicTime = filemtime($topicName);\n \t\t\t\t$topicArray[$topics] = $topicTime; \n\t\t\t}\n\t\t}\n\n\tarsort($topicArray);\n\n\t$numberOfTopics = sizeOf($topicArray);\n\n\tprint \"&numTopicsAll=$numberOfTopics&\";\n\n// The rest of this is just getting the topics ordered for each page - Basically it's set at 11/per page as default\n// You can change this in the top settings - however it's recommended to leave as is.\n// Probably a little easy way of doing this - but anways.\nif ($numberOfTopics <= $TopicsPerPage) {\n\t$Pages \t\t= 1;\n} \n\nif ($numberOfTopics > $TopicsPerPage) {\n\t$Page \t\t= ($numberOfTopics / $TopicsPerPage);\n\t$Pages \t\t= floor($Page)+1;\n}\n\n$PageNumber \t\t= $numHigh / $TopicsPerPage;\n\nif ($numberOfTopics > $numHigh) {\n\t\n\t$numDup \t= (($TopicsPerPage * $PageNumber));\n\n\t$numLDup \t= ($numLow + 1);\n} \n\nif ($numberOfTopics <= $numHigh) {\n\t$numDup \t= ($TopicsPerPage-($numHigh-$numberOfTopics));\n\t$numDup \t= (($numDup + $numLow));\n\t$numLDup \t= ($numLow + 1);\n}\n\t$Count \t\t= 1;\n\n\tforeach ($topicArray as $key => $value) {\n\n \t\t$thisTopicName \t= $key;\n \t\t$thisTopicTime \t= $value;\n \t\t$thisTopicTime \t= date(\"n/j/Y\", $thisTopicTime);\n\n\t\t$nameArray \t= split (\"_\", $thisTopicName);\n\n\t\t$TopicSubject \t= str_replace(\"-\", \" \", $nameArray[2]);\n\t\t$TopicName \t= str_replace(\"-\", \" \", $nameArray[1]);\n\t\t$TopicSubject \t= str_replace(\".txt\", \"\", $TopicSubject);\n\n \t\t$topicCreated \t= date(\"n/j/Y\", $nameArray[0]);\n\t\t$topicStartedBy = $TopicName;\n\n\t\t$fp = fopen( $Category.\"/\".$thisTopicName,\"r\"); \n\t\t$numReplysTopics = fread($fp, 80000); \n\t\tfclose( $fp );\n\n\t\t$numReplysTopicsArray \t= split ($SplitThis, $numReplysTopics);\n\t\t$numReplysLocal \t= count($numReplysTopicsArray) - 1;\n\t\t$numReplysGlobal \t= $numReplysGlobal + $numReplysLocal;\n\n\t\tprint \"&Topic$Count=$TopicSubject&lastModified$Count=$thisTopicTime&File$Count=$thisTopicName&topicCreated$Count=$topicCreated&numReplys$Count=$numReplysLocal&topicStartedBy$Count=$topicStartedBy&\";\n\t$Count = $Count + 1;\n\t\t\n\t}\n\tclosedir ($handle);\n\tprint \"&TotalPosts=$numReplysGlobal&NumLow=$numLow&NumHigh=$numHigh&Pages=$Pages&numLow=$numLow&numLDup=$numLDup&numDup=$numDup&Go=Yes&\";\n}", "function parse_json_topics($topics, $isUpdate) {\n\t$failures = array();//contains nodes that could not be created because of missing parent.\n\t$keys = array_keys($topics);\n\t$newEntries = array();\n\t$updates = array();\n\t//process each node in turn\n\tfor ($k = 0; $k < count($keys); $k++) {\n\t\t$key = $keys[$k];\n\t\techo '<br/>importing ' . $k;\n\t\t$resourceSlug = substr(strrchr(remove_last_slash($key),\"/\"),1);\n\t\techo '<br/>slug ' . $resourceSlug;\n\t\t$title = $topics[$key][\"http://www.w3.org/2004/02/skos/core#prefLabel\"][0][\"value\"];\n\t\tif ($k == 0)\n\t\t\t$title = $topics[$key][\"http://purl.org/dc/elements/1.1/title\"][0][\"value\"];\n\t\techo '<br/>title ' . $title . '<br/>';\n\t\t$parentUri = remove_last_slash($topics[$key][\"http://www.w3.org/2004/02/skos/core#broader\"][0][\"value\"]);\n\t\t$parent = 0;\n\t\t//If the uploaded document specifies a parent for this node...\n\t\tif ($parentUri != null) {\n\t\t\t$parentSlug = substr(strrchr($parentUri,\"/\"),1);\n\t\t\techo '<br/>parentSlug ' . $parentSlug;\n\t\t\t$term = get_term_by( \"slug\", $parentSlug, \"asn_topic_index\");\n\t\t\t//if the parent is found in the taxonomy, set the parent. Otherwise record this as a failed entry\n\t\t\tif ($term !== false) {\n\t\t\t\t$parent = (int)$term->term_id;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$failures[] = $k;\n\t\t\t}\t\n\t\t}\n\t\t//If this node is not a failed entry...\n\t\tif (array_search($k,$failures) === false) {\n\t\t\t//insert the node if it does not already exist. Otherwise, update the existing node with the values in the document\n\t\t\tif (!check_existing_standards($resourceSlug, false)) {\n\t\t\t\t$cid = wp_insert_term(\n\t\t\t\t\t$title,\n\t\t\t\t\t\"asn_topic_index\",\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'description' => $title,\n\t\t\t\t\t\t'slug' => $resourceSlug,\n\t\t\t\t\t\t'parent' => $parent\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif (is_wp_error( $cid ) )\n\t\t\t\t{\n\t\t\t\t\techo \" error: \" . $cid->get_error_message();\n\t\t\t\t\tif (strlen($title) > 200) {\n\t\t\t\t\t\t$name = substr($title, 0, 200);\n\t\t\t\t\t\twp_insert_term(\n\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\t\"asn_topic_index\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'description' => $title,\n\t\t\t\t\t\t\t\t'slug' => $resourceSlug,\n\t\t\t\t\t\t\t\t'parent' => $parent\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\techo $resourceSlug . \" name had to be shortened!\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($isUpdate) {\n\t\t\t\t\t$newEntries[] = array(\"Name\" => $title, \"Id\" => $resourceSlug, \"Parent\" => $parent);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$term = get_term_by( \"slug\", $resourceSlug, \"asn_topic_index\");\n\t\t\t\t$termUpdate = 0;\n\t\t\t\tif (html_entity_decode(substr($term->name, 0, 200)) != html_entity_decode($substr($title, 0, 200))) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('name' => $substr($title, 0, 200)));\n\t\t\t\t}\n\t\t\t\tif (html_entity_decode($term->description) != html_entity_decode($description) && $title != html_entity_decode($title)) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('description' => $title));\n\t\t\t\t}\n\t\t\t\tif (html_entity_decode($term->parent) != html_entity_decode($parent)) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('parent' => $parent));\n\t\t\t\t}\n\t\t\t\tif ($termUpdate > 0)\n\t\t\t\t\t$updates[] = array(\"id\" => $resourceSlug, \"name\" => $title);\n\t\t\t}\n\t\t}\n\t}\n\t//Notify the uploader of any modifications and any failed nodes\n\tif ($isUpdate && count($newEntries) > 0 || count($updates) > 0)\n\t\tnotify_modifications($newEntries, $updates);\n\tif (count($failures) > 0) {\n\t\techo \"failures:\";\n\t\tprint_r($failures);\t\n\t}\n\t\n}", "protected function buildCleanedTopicList($topics = array())\n {\n\n // generate valid subscription list\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n /** @var \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage $topicList */\n $topicList = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\n // check if given topics exists and set them to subscription\n foreach ($topics as $topicId) {\n\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\Topic $topic */\n if ($topic = $this->topicRepository->findByUid($topicId)) {\n $topicList->attach($topic);\n }\n }\n\n return $topicList;\n //===\n }", "function soft_delete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->soft_delete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> $user->data['user_id'],\r\n\t\t\t\t'topic_deleted_time'\t=> time(),\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->soft_delete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count + 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "function undelete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> 0,\r\n\t\t\t\t'topic_deleted_time'\t=> 0,\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->undelete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t$this->update_first_post_topic($id);\r\n\t\t\t\t$this->update_last_post_topic($id);\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count - 1\r\n\t\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "function remove_ignored_keywords_from_array($keywords_array)\n\t{\n\t\t//Load all short search terms we wish to ignore\n\t\t$path_and_filename = SITE_ROOT_DIR . '/config/ignored_search_terms.txt';\n\t\tif(!file_exists($path_and_filename))\n\t\t{\n\t\t\ttrigger_error('ignored search terms config file is missing',E_USER_WARNING);\n\t\t\treturn $keywords_array;\n\t\t}\n\t\t\t\n\t\t$ignored_search_terms = file_get_contents($path_and_filename);\n\t\t$ignored_search_terms_as_array = explode(',',$ignored_search_terms);\n\n\t\t//Remove ignored search terms\n\t\t$clean_keywords = array_diff($keywords_array,$ignored_search_terms_as_array);\n\t\n\t\t//Remove short keywords < 2 chars\n\t\t$long_keywords = array_filter($clean_keywords,create_function('$keyword','return strlen($keyword) > 2;'));\n\t\t$nice_keywords = array_filter($long_keywords,create_function('$keyword','return strlen($keyword) < 15;'));\n\t\t\n\t\treturn $nice_keywords;\t\t\t\n\t}", "public function getTopics() {\n $names = [];\n foreach ($this->topics as $topic) {\n $names[] = $topic->entity->topic->entity->name->value;\n }\n sort($names);\n return $names;\n }", "public function clearTopics()\n {\n $this->collTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "public function run()\n {\n $topicComments = [\n [\n 'cmnt' => 'I was never mad at him.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'ABSOLUTELY HE SHOULD WORK AGAIN! Hes an alcoholic bi-polar. Anything else? I mean the man has been one of the most charming and unpretentious big stars of my generation. Bad husband? Ok, but thats not our business. The thing is he never beat her, and he still is in good relations with his first wife where he went to when his world crashed down, so hes not a monster. He got screwed.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'I liked a lot of his movies before his \"breakdown\" or whatever it was. The guy obviously has some issues - and once they go beyond personal or relationship stuff (i.e. getting into public displays of racism or antisemitism) it can cause irreparable damage.',\n 'sub' => ['He said some things about gays that got him in trouble, and he certainly isnt the first person to comment or bitch about jews in hollywood. Now I dont mean to sound like Archie Bunker but Mel Gibson is from Australia. Now Hit Girl can pummel me publicly for saying this if Im wrong, but most australian men are veeeery chauvanistic and act tough i.e. talk bad about gays. Thats just the way they are, it doesnt mean theyre evil. You know what I mean?',\n ]\n ],\n [\n 'cmnt' => '10 years latter? wow you hold a grudge a long time :)',\n 'sub' => [\n 'Hahaha I phrased that wrong I\\'ve never really cared that much because I can separate art from personality, but I respect people who can\\'t. :)',\n 'Ya, I was just funnin\\' ya. I like Mel! Good director, great actor. So he said a few stupid things when he was drunk an angry. Most everybody in Hollywood has done that. He should have made the 4th Mad Max picture. But I bet he\\'s got some projects going. ',\n 'Mm. I loved Tom Hardys portrayal, but I have to agree. It would have revitalized his career. Hardy would be a star regardless.',\n 'You\\'re telling me you\\'d buy a 59 year old Max doing the things that Hardy did in Fury Road? \\'Cause I sure as hell wouldn\\'t. It\\'d be pathetic. Just like the last Indy movie and the last Terminator movie. '\n ]\n ],\n [\n 'cmnt' => 'As long as he promises not to make a \"Passion of the Christ II\" and maybe finds a way to make a second \"Payback\", sure.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'As long as he does not commit anything prison worthy, why not? ',\n 'sub' => []\n ],\n [\n 'cmnt' => 'I think Mel Gibson should have played Max in Fury Road and Tom Hardy could have been his second-in-command. I would not have been opposed to Tom Hardy having more screen time than Mel Gibson, either. Tom Hardy just doesn\\'t feel like Max to me. ',\n 'sub' => []\n ],\n [\n 'cmnt' => 'No, it would have to be a totally different film. Or have Gibson be his dad or grandfather in supporting role. Sort of like they did with the last Star War films. ',\n 'sub' => []\n ],\n [\n 'cmnt' => 'I swear we typed that at the same time, SC must be reading my mind. ',\n 'sub' => []\n ],\n [\n 'cmnt' => 'I don\\'t know if Tom Hardy should have necessarily been Max\\'s son, but maybe fans could speculate to themselves that he is. ',\n 'sub' => []\n ],\n [\n 'cmnt' => 'I kind of like the idea that there are many different interpretations of Max in the universe. I think Miller once said this awhile back, that their all the same Max\\'s, but it\\'s just how the people view him. I don\\'t know I maybe spouting a bunch of stupid bs, but I could have sworn I read it somewhere. ',\n 'sub' => []\n ],\n [\n 'cmnt' => \"Certainly. I have a friend with very different political opinions of my own who once said that he \\\"hated it when people had to go away for saying the wrong thing.\\\" I've always liked the way he put that.\\n\\n\n\nMel Gibson said a lot of things I don't like, and so have a lot of other people whose art I don't admire and whose presence I don't miss. But overall, I like the cultural trade of a world where we hear offensive things a bit more often and don't need to banish the people who say them from the public eye. I'd like to see a sharper distinction between speech and speaker, and just a generally higher cultural tolerance for even the things we don't like.\",\n 'sub' => ['Well said. Your friend was a smart man.']\n ],\n [\n 'cmnt' => 'Yes! He\\'s one of my favorite actors and I think many people respect him enough to forgive him for something that happened ten years ago. ',\n 'sub' => []\n ],\n\n ];\n\n $voteComments = [\n [\n 'cmnt' => 'I propose to present the keyboard or SSD. I think it will be a good gift for him.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'Let\\'s think. Maybe it is worth presenting something else?',\n 'sub' => []\n ],\n [\n 'cmnt' => 'He likes to play shooters.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'Gaming mouse?!',\n 'sub' => []\n ],\n [\n 'cmnt' => 'Oh, no! I think the HD webcam will be more useful for him.',\n 'sub' => []\n ],\n [\n 'cmnt' => 'If you don\\'t accept any variant, please, offer another.',\n 'sub' => []\n ],\n ];\n\n $users = User::all();\n\n $topic = Topic::where('id', 1)->first();\n $addMin = 2;\n $addSec = 0;\n $time = $topic->created_at;\n\n foreach ($topicComments as $topicComment) {\n $comment = factory(Comment::class)->make();\n $comment->content_origin = $topicComment['cmnt'];\n $comment->content_generated = MarkdownService::baseConvert($topicComment['cmnt']);\n $randomUser = $users->random();\n $comment->user()->associate($randomUser);\n $comment->created_at = $time->addMinutes($addMin)->addSeconds($addSec);\n $addMin = rand(1, 15);\n $addSec = rand(5, 25);\n $comment->save();\n $topic->comments()->save($comment);\n $topic->updated_at = $comment->updated_at;\n $topic->save();\n $subCommentStartTime = $comment->created_at;\n foreach ($topicComment['sub'] as $subComment) {\n $childComment = factory(Comment::class)->make();\n $childComment->content_origin = $subComment;\n $childComment->content_generated = MarkdownService::baseConvert($subComment);\n $randomUser = $users->random();\n $childComment->user()->associate($randomUser);\n $addMin = rand(2, 40);\n $addSec = rand(5, 25);\n $childComment->created_at = $subCommentStartTime->addMinutes($addMin)->addSeconds($addSec);\n $childComment->save();\n $topic->comments()->save($childComment);\n $topic->updated_at = $childComment->updated_at;\n $topic->save();\n $comment->comments()->save($childComment);\n }\n }\n\n $vote = Vote::where('id', 1)->first();\n $addMin = 2;\n $addSec = 0;\n $time = $vote->created_at;\n $vote->created_at = $time-> subHours(3);\n\n\n $usersIds = $vote->votePermissions->pluck('user_id')->all();\n $users = User::whereIn('id', $usersIds)->get();\n\n foreach ($voteComments as $voteComment) {\n $comment = factory(Comment::class)->make();\n $comment->content_origin = $voteComment['cmnt'];\n $comment->content_generated = MarkdownService::baseConvert($voteComment['cmnt']);\n $randomUser = $users->random();\n $comment->user()->associate($randomUser);\n $comment->created_at = $time->addMinutes($addMin)->addSeconds($addSec);\n $addMin = rand(1, 15);\n $addSec = rand(5, 25);\n $comment->save();\n $vote->comments()->save($comment);\n $vote->updated_at = $comment->updated_at;\n $vote->save();\n }\n\n\n// foreach ($topics as $topic) {\n// $commentCount = rand(1, 5);\n// $comments = factory(Comment::class, $commentCount)->make();\n// if (!$comments instanceof Collection) {\n// $comments = new Collection([$comments]);\n// }\n// $comments->each(function ($comment) use ($users) {\n// $randomUser = $users->random();\n// $comment->user()->associate($randomUser);\n// $comment->save();\n// });\n//\n// $topic->comments()->saveMany($comments);\n// }\n\n// foreach ($votes as $vote) {\n// $commentCount = rand(1, 5);\n// $comments = factory(Comment::class, $commentCount)\n// ->make();\n// if (!$comments instanceof Collection) {\n// $comments = new Collection([$comments]);\n// }\n// $comments->each(function ($comment) use ($users) {\n// $randomUser = $users->random();\n// $comment->user()->associate($randomUser);\n// $comment->save();\n// });\n//\n// $vote->comments()->saveMany($comments);\n// }\n\n// foreach ($voteItems as $voteItem) {\n// $commentCount = rand(1, 5);\n// $comments = factory(Comment::class, $commentCount)\n// ->make();\n// if (!$comments instanceof Collection) {\n// $comments = new Collection([$comments]);\n// }\n// $comments->each(function ($comment) use ($users) {\n// $randomUser = $users->random();\n// $comment->user()->associate($randomUser);\n// $comment->save();\n// });\n//\n// $voteItem->comments()->saveMany($comments);\n// }\n\n }", "public function cleanup()\n\t{\n\t\t$ArticlesLatest = Article::where('status', 'read')->where('star_ind', '0')->orderBy('created_at', 'desc')->select('id')->take(10000)->get();\n\t\t$ArticlesStar = Article::where('star_ind', '1')->select('id')->get();\n\t\t$ArticlesUnread = Article::where('status', 'unread')->select('id')->get();\n\n\t\t//create new empty array to store id's\n\t\t$cleanup_item_ids = [];\n\n\t\t//store id's from ArticlesStar in cleanup_item_ids\n\t\tif (!empty($ArticlesStar)) {\n\t\t\tforeach ($ArticlesStar as $Article) {\n\t\t\t\tarray_push($cleanup_item_ids, $Article->id);\n\t\t\t}\n\t\t}\n\n\t\t//store id's from ArticlesLatest in cleanup_item_ids\n\t\tif (!empty($ArticlesLatest)) {\n\t\t\tforeach ($ArticlesLatest as $Article) {\n\t\t\t\tarray_push($cleanup_item_ids, $Article->id);\n\t\t\t}\n\t\t}\n\n\t\t//store id's from ArticlesUnread in cleanup_item_ids\n\t\tif (!empty($ArticlesUnread)) {\n\t\t\tforeach ($ArticlesUnread as $Article) {\n\t\t\t\tarray_push($cleanup_item_ids, $Article->id);\n\t\t\t}\n\t\t}\n\n\t\t//delete items that are not in cleanup_item_ids array\n\t\tArticle::whereNotIn('id', $cleanup_item_ids)->delete();\n\t}", "function getTopicsReadArray($forumID) {\n\t\tglobal $DB;\n\t\t\n\t\t$topicsRead = array();\n\t\t\n\t\t// Topic or Forum?\n\t\t$sql = \"SELECT topic_ids FROM `\" . DBTABLEPREFIX . \"topics_read` WHERE user_id='\" . $_SESSION['userid'] . \"' AND forum_id='\" . $forumID . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\twhile ($row = $DB->fetch_array($result)) {\n\t\t\t\t$topicsRead = unserialize($row['topic_ids']);\n\t\t\t}\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\treturn $topicsRead;\n\t}", "function markTopicRead($forumID, $topicID) {\n\t\tglobal $DB;\n\t\t\n\t\t// Pull our read topics information so we can work with it\n\t\t$topicsRead = getTopicsReadArray($forumID);\n\t\t\t\n\t\t// Kill our read row in the DB\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics_read` WHERE user_id='\" . $_SESSION['userid'] . \"' AND forum_id='\" . $forumID . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Set this topic read time to right now\n\t\t$topicsRead[$topicID] = time();\n\t\t\n\t\t// Clean out any bad topics (they were probably deleted\n\t\t$topicsRead = array_filter($topicsRead, \"topicExists\");\n\t\t\t\n\t\t// We disable this since we don't want to escape our topic_ids field\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t//$result = $DB->query_insert(\"topics_read\", array('user_id' => $_SESSION['userid'], 'forum_id' => $forumID, 'topic_ids' => serialize($topicsRead)));\n\t\t\n\t\t// Warp everything up and save it\n\t\t$sql = \"INSERT INTO `\" . DBTABLEPREFIX . \"topics_read` (user_id, forum_id, topic_ids) VALUES ('\" . $_SESSION['userid'] . \"', '\" . $forumID . \"', '\" . serialize($topicsRead) . \"')\";\n\t\t$result = $DB->query($sql);\n\t}", "function filter_words($wordArray, $rules)\n\t{\n\t\t\n\t\tforeach ($rules as $rule) {\n\t\t\t$rule = array_map(\"trim\", explode(\"=\", $rule));\n\t\t\t//echo print_r($rule) . \"<br>\";\n\t\t\t$newArray = array();\n\t\t\tswitch ($rule[0]) {\n\t\t\t\t\n\t\t\t\tcase 'Case_insensitive' :\n\t\t\t\tif ($rule[1]) {\n\t\t\t\t\tforeach ($wordArray as $word => $occurrences) {\n\t\t\t\t\t\tif ($word === strtolower($word)) {\n\t\t\t\t\t\t\tif (isset($wordArray[ucwords($word)])) {\n\t\t\t\t\t\t\t\t$newArray[$word] = $wordArray[ucwords($word)] + $occurrences;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$newArray[$word] = $occurrences;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarsort($newArray);\n\t\t\t\t\t$wordArray = $newArray;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"higher_than\" :\n\t\t\t\tforeach ($wordArray as $word => $occurrences) {\n\t\t\t\t\tif ($occurrences > $rule[1]) {\n\t\t\t\t\t\t$newArray[$word] = $occurrences;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$wordArray = $newArray;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"exclude\" :\n\t\t\t\t$wordsToExclude = array_map(\"trim\", explode(\",\", $rule[1]));\n\t\t\t\t\n\t\t\t\tforeach ($wordArray as $word => $occurrences) {\n\t\t\t\t\tif (!(in_array($word, $wordsToExclude))) {\n\t\t\t\t\t\t$newArray[$word] = $occurrences;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$wordArray = $newArray;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"longer_than\" :\n\t\t\t\tforeach ($wordArray as $word => $occurrences) {\n\t\t\t\t\tif (strlen($word) > $rule[1]) {\n\t\t\t\t\t\t$newArray[$word] = $occurrences;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$wordArray = $newArray;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"max\" :\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($wordArray as $word => $occurrences) {\n\t\t\t\t\tif ($i < $rule[1]) {\n\t\t\t\t\t\t$newArray[$word] = $occurrences;\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$wordArray = $newArray;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $wordArray;\n\t}", "function cleanT($tArr) {\r\n for($a = count($tArr); $a > 0; $a--) {\r\n if (strcmp($tArr[$a-1], '')) {\r\n break;\r\n } else {\r\n unset($tArr[$a-1]);\r\n }\r\n }\r\n return $tArr;\r\n }", "public function cleanBookmarks()\n {\n $this->arrayClean($this->_bookmarks);\n }", "public function show_forum_topics($name, $limit, $start, &$max_rows, $filter_topic_title = '', $show_first_posts = false, $date_key = 'lasttime', $hot = false, $filter_topic_description = '')\n {\n if (is_integer($name)) {\n $id_list = 'fid=' . strval($name);\n } elseif (!is_array($name)) {\n $id = $this->forum_id_from_name($name);\n if (is_null($id)) {\n return null;\n }\n $id_list = 'fid=' . strval($id);\n } else {\n $id_list = '';\n foreach (array_keys($name) as $id) {\n if ($id_list != '') {\n $id_list .= ' OR ';\n }\n $id_list .= 'fid=' . strval($id);\n }\n if ($id_list == '') {\n return null;\n }\n }\n\n $topic_filter = ($filter_topic_title != '') ? 'AND subject LIKE \\'' . db_encode_like($filter_topic_title) . '\\'' : '';\n $topic_filter .= ' ORDER BY ' . (($date_key == 'lasttime') ? 'lastpost' : 'lastpost') . ' DESC';\n\n $rows = $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'threads WHERE (' . $id_list . ') ' . $topic_filter, $limit, $start);\n $max_rows = $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'threads WHERE (' . $id_list . ') ' . $topic_filter);\n $i = 0;\n $firsttime = array();\n $username = array();\n $memberid = array();\n $datetimes = array();\n $rs = array();\n while (array_key_exists($i, $rows)) {\n $r = $rows[$i];\n\n $id = $r['tid'];\n\n $r['topic_time'] = $r['dateline'];\n $r['topic_poster'] = $r['uid'];\n $r['last_poster'] = $r['lastposteruid'];\n $r['last_time'] = $r['lastpost'];\n\n $firsttime[$id] = $r['dateline'];\n\n $post_rows = $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'posts p WHERE tid=' . strval($id) . ' AND message NOT LIKE \\'' . db_encode_like(substr(do_lang('SPACER_POST', '', '', '', get_site_default_lang()), 0, 20) . '%') . '\\' ORDER BY dateline DESC', 1);\n\n if (!array_key_exists(0, $post_rows)) {\n $i++;\n continue;\n }\n $r2 = $post_rows[0];\n\n $username[$id] = $r2['username'];\n $username[$id] = $r2['uid'];\n $datetimes[$id] = $r2['dateline'];\n $rs[$id] = $r;\n\n $i++;\n }\n if ($i > 0) {\n arsort($datetimes);\n $i = 0;\n $out = array();\n if (count($datetimes) > 0) {\n foreach ($datetimes as $id => $datetime) {\n $r = $rs[$id];\n\n $out[$i] = array();\n $out[$i]['id'] = $id;\n $out[$i]['num'] = $r['replies'] + 1;\n $out[$i]['title'] = $r['subject'];\n $out[$i]['description'] = $r['subject'];\n $out[$i]['firsttime'] = $r['dateline'];\n $out[$i]['firstusername'] = $r['username'];\n $out[$i]['lastusername'] = $r['lastposter'];\n $out[$i]['firstmemberid'] = $r['uid'];\n $out[$i]['lastmemberid'] = $r['lastposteruid'];\n $out[$i]['lasttime'] = $r['lastpost'];\n $out[$i]['closed'] = ($r['visible'] == 1);\n\n $fp_rows = $this->connection->query('SELECT subject,message,uid FROM ' . $this->connection->get_table_prefix() . 'posts p WHERE message NOT LIKE \\'' . db_encode_like(substr(do_lang('SPACER_POST', '', '', '', get_site_default_lang()), 0, 20) . '%') . '\\' AND dateline=' . strval($firsttime[$id]) . ' AND tid=' . strval($id), 1);\n\n if (!array_key_exists(0, $fp_rows)) {\n unset($out[$i]);\n continue;\n }\n $out[$i]['firsttitle'] = $fp_rows[0]['subject'];\n if ($show_first_posts) {\n global $LAX_COMCODE;\n $temp = $LAX_COMCODE;\n $LAX_COMCODE = true;\n $out[$i]['firstpost'] = $fp_rows[0]['message'];\n $LAX_COMCODE = $temp;\n }\n\n $i++;\n if ($i == $limit) {\n break;\n }\n }\n }\n\n return $out;\n }\n return null;\n }", "function filter_rules_sort() {\n\tglobal $g, $config, $configname;\n\t\n\t/* mark each rule with the sequence number (to retain the order while sorting) */\n\tfor ($i = 0; isset($config['filter'][$configname][$i]); $i++)\n\t\t$config['filter'][$configname][$i]['seq'] = $i;\n\t\n\tfunction filtercmp($a, $b) {\n\t\tif ($a['interface'] == $b['interface'])\n\t\t\treturn $a['seq'] - $b['seq'];\n\t\telse\n\t\t\treturn -strcmp($a['interface'], $b['interface']);\n\t}\n\t\n\tusort($config['filter'][$configname], \"filtercmp\");\n\t\n\t/* strip the sequence numbers again */\n\tfor ($i = 0; isset($config['filter'][$configname][$i]); $i++)\n\t\tunset($config['filter'][$configname][$i]['seq']);\n}", "public function get_forum_topic_posts($topic_id, &$count, $max = 100, $start = 0, $mark_read = true, $reverse = false)\n {\n if (is_null($topic_id)) {\n return (-2);\n }\n\n $order = $reverse ? 'dateline DESC' : 'dateline';\n $rows = $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'posts WHERE tid=' . (string)intval($topic_id) . ' AND message NOT LIKE \\'' . db_encode_like(substr(do_lang('SPACER_POST', '', '', '', get_site_default_lang()), 0, 20) . '%') . '\\' ORDER BY ' . $order, $max, $start);\n $count = $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'posts WHERE tid=' . (string)intval($topic_id) . ' AND message NOT LIKE \\'' . db_encode_like(substr(do_lang('SPACER_POST', '', '', '', get_site_default_lang()), 0, 20) . '%') . '\\'');\n\n $out = array();\n foreach ($rows as $myrow) {\n $temp = array();\n $temp['title'] = $myrow['subject'];\n if (is_null($temp['title'])) {\n $temp['title'] = '';\n }\n global $LAX_COMCODE;\n $temp2 = $LAX_COMCODE;\n $LAX_COMCODE = true;\n $temp['message'] = $myrow['message'];\n $LAX_COMCODE = $temp2;\n $temp['member'] = $myrow['uid'];\n $temp['date'] = $myrow['dateline'];\n\n $out[] = $temp;\n }\n\n return $out;\n }", "function removeduptags(&$queryDetails)\r\n{ $tagz = array();\r\nforeach ($queryDetails as $t => $tn)\r\n{\r\n\tif (in_array($tn, $tagz))\r\n\t\tunset($queryDetails[$t]);\r\n\telse\r\n\t\tarray_push($tagz,$tn);\r\n}\r\n}", "public function getTopics()\n {\n return [\n 'topicName' => 1\n ];\n }", "public function filterTwentyCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"sport\" ||$cat == \"uk news\" ||$cat == \"opinion\" || $cat == \"society\" ||$cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" ||$cat == \"life and style\" ||$cat == \"environment\" || $cat == \"technology\"\n || $cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" ||$cat == \"film\" || $cat == \"books\"\n || $cat == \"us news\" ||$cat == \"football\"|| $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"){ //20 categories\n $newArray[$key] = $value;\n }\n }\n\n return $newArray;\n }", "function netrics_clear_month_data( $query_ids = null ) {\n if ( ! isset( $query_ids->posts ) ) {\n $query_ids = netrics_get_pubs_ids( 2000 );\n }\n\n $log = '';\n foreach ( $query_ids->posts as $post_id ) {\n $del_articles = delete_post_meta( $post_id, 'nn_articles_new' );\n $del_errors = delete_post_meta( $post_id, 'nn_error' );\n $del_flag = wp_remove_object_terms( $post_id, array( 6178, 6179 ), 'flag' ); //'0Feed' and '1PageSpeed'.\n\n $log .= \"$post_id $del_articles/$del_errors/$del_flag\";\n }\n\n return $log;\n}", "private function thread_sort($sort ,$filter) {\n\t\t$this->clean($filter, 'keyword');\n\t\tif (substr($sort, 7) == 'R') {\n\t\t\t$method = 'REFERENCES';\n\t\t}\n\t\telse {\n\t\t\t$method = 'ORDEREDSUBJECT';\n\t\t}\n\t\t$command = 'UID THREAD '.$method.' US-ASCII '.$filter.\"\\r\\n\";\n\t\t$this->send_command($command);\n\t\t$res = $this->get_response();\n\t\t$status = $this->check_response($res);\n\t\t$uid_string = '';\n\t\tforeach ($res as $val) {\n\t\t\tif (strtoupper(substr($val, 0, 8)) == '* THREAD') {\n\t\t\t\t$uid_string .= ' '.substr($val, 8);\n\t\t\t}\n\t\t}\n\t\tunset($res);\n\t\t$uids = array();\n\t\t$thread_data = array();\n\t\t$uid_string = str_replace(array(' )', ' ) ', ')', ' (', ' ( ', '( '), array(')', ')', ')', '(', '(', '('), $uid_string);\n\t\t$branches = array();\n\t\t$level = 0;\n\t\t$thread = 0;\n\t\t$last_id = 0;\n\t\t$offset = 0;\n\t\t$parents = array();\n\t\twhile($uid_string) {\n\t\t\tswitch ($uid_string{0}) {\n\t\t\t\tcase ' ':\n\t\t\t\t\t$level++;\n\t\t\t\t\t$offset++;\n\t\t\t\t\t$parents[$level] = $last_id;\n\t\t\t\t\t$uid_string = substr($uid_string, 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '(':\n\t\t\t\t\t$level++;\n\t\t\t\t\tif ($level == 2) {\n\t\t\t\t\t\t$parents[$level] = $thread;\n\t\t\t\t\t}\n\t\t\t\t\t$uid_string = substr($uid_string, 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ')':\n\t\t\t\t\t$uid_string = substr($uid_string, 1);\n\t\t\t\t\tif ($offset) {\n\t\t\t\t\t\t$level -= $offset;\n\t\t\t\t\t\t$offset = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$level--;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (preg_match(\"/^(\\d+)/\", $uid_string, $matches)) {\n\t\t\t\t\t\tif ($level == 1) {\n\t\t\t\t\t\t\t$thread = $matches[1];\n\t\t\t\t\t\t\t$parents = array(1 => 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($parents[$level])) {\n\t\t\t\t\t\t\tif (isset($parents[$level - 1])) {\n\t\t\t\t\t\t\t\t$parents[$level] = $parents[$level - 1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$parents[$level] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$thread_data[$thread][$matches[1]] = array('parent' => $parents[$level], 'level' => $level, 'thread' => $thread);\n\t\t\t\t\t\t$parents[$level] = $thread;\n\t\t\t\t\t\t$last_id = $matches[1];\n\t\t\t\t\t\t$uid_string = substr($uid_string, strlen($matches[1]));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 'BUG'.$uid_string.\"\\r\\n\";\n\t\t\t\t\t\t;\n\t\t\t\t\t\t$uid_string = substr($uid_string, 1);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$thread_data = array_reverse($thread_data);\n\t\t$new_thread_data = array();\n\t\t$threads = array();\n\t\tforeach ($thread_data as $vals) {\n\t\t\tforeach ($vals as $i => $v) {\n\t\t\t\t$uids[] = $i;\n\t\t\t\tif ($v['parent'] && isset($new_thread_data[$v['parent']])) {\n\t\t\t\t\tif (isset($new_thread_data[$v['thread']]['reply_count'])) {\n\t\t\t\t\t\t$new_thread_data[$v['thread']]['reply_count']++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$new_thread_data[$v['thread']]['reply_count'] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$threads[] = $i;\n\t\t\t\t}\n\t\t\t\t$new_thread_data[$i] = $v;\n\t\t\t}\n\t\t}\n\t\treturn array('uids' => $uids, 'total' => count($uids), 'thread_data' => $new_thread_data,\n\t\t\t\t\t\t'sort' => $sort, 'filter' => $filter, 'timestamp' => time(), 'threads' => $threads);\n\n\t}" ]
[ "0.593098", "0.57363254", "0.56610435", "0.54275805", "0.53746545", "0.5298118", "0.529116", "0.52805614", "0.5219392", "0.5215844", "0.5167548", "0.51316875", "0.5129999", "0.5082503", "0.5039974", "0.50357306", "0.5028455", "0.5026263", "0.5009636", "0.49974746", "0.49606907", "0.4955322", "0.4925337", "0.4916446", "0.4913317", "0.49107227", "0.489392", "0.4887436", "0.4884965", "0.4879375" ]
0.7080641
0
/ Memory debug, make flag /
function memory_debug_make_flag() { if ( IPS_MEMORY_DEBUG_MODE AND function_exists( 'memory_get_usage' ) ) { return memory_get_usage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_debug_flag()\n {\n }", "public function enableDebug();", "public function enableDebug() {}", "public function enableDebugMode() {}", "function debug_log($input,$debugflag=\"log\",$die=false){\n\tif(true){\n\t\t@$fp=fopen($_SERVER['DOCUMENT_ROOT'].\"/debug.txt\",'a');\n\t\t$val = vardump($input,$debugflag);\n\t\t$val = str_replace(\"__set_state\",\"\",$val);\n\t\t$val = str_replace(\"stdClass::(array(\",\"object((\",$val);\n\t\tfwrite($fp,$val);\n\t\tfclose($fp);\n\t\tif($die){\n\t\t\techo \"stoped\";\n\t\t\tdie();\n\t\t}\n\t}\n}", "public function debug();", "public function debug();", "public function isDebug();", "public function isDebug();", "function debugOn()\n\t{\n\t\t$this->bDebug = true;\n\t}", "function setDebug(){\n if(isset($_GET['debug']) && $_GET['debug']==\"true\"){\n return true;\n }\n return false;\n }", "public static function debug() : bool\n {\n }", "public function isDebug()\n {\n }", "public function setDebugMode( $enable=false );", "static public function setDebug($on=false){\n \tif (self::$_is_debug != (bool) $on){\n \t\tself::$_is_debug = (bool) $on;\n \t\tself::regenerate();\n \t}\n }", "function debug($string = '', $data = [])\n{\n if (DEBUG) {\n output(trim('[D ' . get_memory_used() . '] ' . $string) . \"\\n\");\n if (!empty($data)) {\n output(print_r($data, 1));\n }\n return true;\n }\n return false;\n}", "function emdebug($income_details = null, $debug_type = null){\n\tmdebug($income_details, $debug_type);\n\texit;\n}", "function turnOnDebugMode()\n {\n $this->debugmode = true;\n }", "public function enableDebug() : void\n {\n $this->debug = TRUE;\n }", "function Debug($debug, $msg = \"Debugging\"){\n\tif(ENV == PRODUCTION && (!isset($_GET['debug'])) ){\n\t\treturn;\n\t}\n\n\techo '<pre class=\"debug\">';\n\techo '<h2>'.$msg.'</h2>';\n\tprint_r($debug);\n\techo '</pre>';\n}", "function debug() {\r\n//\tif (!$debug_mode) {\r\n//\t\treturn;\r\n//\t}\r\n\techo '<pre>';\r\n\tforeach (func_get_args() as $var) {\r\n\t\t$psfix = str_repeat('-', 40);\r\n\t echo \"<span style='font-size: 18px; color:blue;'>\".\r\n\t \"debug: $psfix I were newbility line separator $psfix\".\r\n\t \"</span>\\n\";\r\n\t echo(var_dump($var));\r\n\t}\r\n echo '</pre>';\r\n}", "function disableDebug($value = true) {\n\t\t$GLOBALS['amfphp']['disableDebug'] = $value;\n\t}", "public static function debug_data()\n {\n }", "public function debug($var){\n\t\tif ($this->env['debug'] !== false){\n\t\t\techo \"<pre>\";\n\t\t\tprint_r($var);\n\t\t\techo \"</pre>\";\n\t\t}\n\t}", "public function getDebug();", "public function setdebug($d = true){\n\t\t$this->debug = $d;\n\t}", "static function isFastRebuild(){\n\t\treturn defined('_developer_run_');\n\t}", "function testDebugHighlander() {\n if (is_callable(array('Debug', '__construct'))) {\n $this->fail();\n }\n if (is_callable(array('Debug', '__clone'))) {\n $this->fail();\n }\n $this->pass();\n }", "public function EnableDebug()\n {\n $this->_debug = true;\n return;\n }", "function apc_cache_debug ($msg, $important=false) {\n\tif ($important || (defined('APC_CACHE_DEBUG') && APC_CACHE_DEBUG)) { \n\t\terror_log(\"yourls_apc_cache: \" . $msg);\n\t}\n}" ]
[ "0.66465527", "0.6631657", "0.6547354", "0.6503889", "0.646646", "0.64273906", "0.64273906", "0.638843", "0.638843", "0.6372217", "0.6238503", "0.61784923", "0.6171984", "0.6164617", "0.6130939", "0.61150026", "0.6009149", "0.5996731", "0.59750265", "0.5970247", "0.59397024", "0.58906454", "0.5878658", "0.5816158", "0.5804603", "0.58030874", "0.58020335", "0.57949156", "0.5772089", "0.57718766" ]
0.7166614
0
/ LEGACY MODE STUFF / / Require, parse and return an array containing the language stuff / LEGACY MODE: load_words
function load_words($current_lang_array, $area, $lang_type) { require ROOT_PATH."cache/lang_cache/".$lang_type."/".$area.".php"; foreach ($lang as $k => $v) { $current_lang_array[$k] = stripslashes($v); } unset($lang); return $current_lang_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllWords(){\n $handle = fopen(\"assets/en-US.dic\", \"r\");\n $words = [];\n $i=0;\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n $line = trim(preg_replace('/\\s\\s+/', ' ', $line));\n $line = strtolower($line);\n $yy = strpos($line, \"'\");\n if(!is_numeric($yy) && strlen($line) < 15 && strlen($line) > 2){\n $words[] = $line;\n }\n }\n fclose($handle);\n return ['status'=>1, 'message'=>'Success', 'body'=>$words];\n } else {\n return ['status'=>0, 'message'=>'Error', 'body'=>'Unable to read dictionary file!'];\n }\n }", "function words_init() {\r\n\t\tif(!isset($this->words_array)) {\r\n\t\t\tif($this->language === \"french\") {\r\n\t\t\t\t//$this->words_array = explode(\"\\n\", utf8_encode(file_get_contents(\"acronyms/fra/mots.txt\")));\r\n\t\t\t\t//$this->entitied_words_array = explode(\"\\n\", utf8_encode(htmlentities(file_get_contents(\"acronyms/fra/mots.txt\"))));\r\n\t\t\t\t//$this->words_array = explode(\"\\n\", iconv(\"iso-8859-1\", $this->config['encoding'] . \"//TRANSLIT\", file_get_contents(\"acronyms/fra/mots.txt\")));\r\n\t\t\t\t$this->words_array = explode(\"\\n\", file_get_contents('abbr' . DS . 'fra' . DS . 'mots.txt'));\r\n\t\t\t\t$this->entitied_words_array = explode(\"\\n\", htmlentities(file_get_contents('abbr' . DS . 'fra' . DS . 'mots.txt')));\r\n\t\t\t} else { // default is english\r\n\t\t\t\t//$this->words_array = explode(\"\\r\\n\", utf8_encode(file_get_contents(\"acronyms/eng/words.txt\")));\r\n\t\t\t\t//$this->entitied_words_array = explode(\"\\r\\n\", utf8_encode(htmlentities(file_get_contents(\"acronyms/eng/words.txt\"))));\r\n\t\t\t\t//$this->words_array = explode(\"\\r\\n\", iconv(\"iso-8859-1\", $this->config['encoding'] . \"//TRANSLIT\", file_get_contents(\"acronyms/eng/words.txt\")));\r\n\t\t\t\t$this->words_array = explode(\"\\r\\n\", file_get_contents('abbr' . DS . 'eng' . DS . 'words.txt'));\r\n\t\t\t\t$this->entitied_words_array = explode(\"\\r\\n\", htmlentities(file_get_contents('abbr' . DS . 'eng' . DS . 'words.txt')));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!isset($this->stop_words_array)) {\r\n\t\t\tif($this->language === \"french\") {\r\n\t\t\t\t$this->stopWordsFile = 'abbr' . DS . 'fra' . DS . 'stop_words.txt';\r\n\t\t\t} else { // default to english\r\n\t\t\t\t$this->stopWordsFile = 'abbr' . DS . 'eng' . DS . 'stop_words_small.txt';\r\n\t\t\t}\r\n\t\t\t//$this->stop_words_array = explode(\"\\r\\n\", utf8_encode(file_get_contents($this->stopWordsFile)));\r\n\t\t\t//$this->entitied_stop_words_array = explode(\"\\r\\n\", utf8_encode(htmlentities(file_get_contents($this->stopWordsFile))));\r\n\t\t\t//$this->stop_words_array = explode(\"\\r\\n\", iconv(\"iso-8859-1\", $this->config['encoding'] . \"//TRANSLIT\", file_get_contents($this->stopWordsFile)));\r\n\t\t\t$this->stop_words_array = explode(\"\\r\\n\", file_get_contents($this->stopWordsFile));\r\n\t\t\t$this->entitied_stop_words_array = explode(\"\\r\\n\", htmlentities(file_get_contents($this->stopWordsFile)));\r\n\t\t}\r\n\t\tif(!isset($this->french_headings_normalization_exceptions)) {\r\n\t\t\t$this->french_headings_normalization_exceptions = array(\r\n\t\t\t// search => replace\r\n\t\t\t'comité de surveillance des activités de renseignement de sécurité' => 'Comité de surveillance des activités de renseignement de sécurité',\r\n\t\t\t'comit&eacute; de surveillance des activit&eacute;s de renseignement de s&eacute;curit&eacute;' => 'Comit&eacute; de surveillance des activit&eacute;s de renseignement de s&eacute;curit&eacute;',\r\n\t\t\t'commission d\\'examen des plaintes concernant la police militaire' => 'Commission d\\'examen des plaintes concernant la police militaire',\r\n\t\t\t'service des poursuites pénales du Canada' => 'Service des poursuites pénales du Canada',\r\n\t\t\t'service des poursuites p&eacute;nales du Canada' => 'Service des poursuites p&eacute;nales du Canada',\r\n\t\t\t'agence parcs canada' => 'Agence Parcs Canada',\r\n\t\t\t'parcs canada' => 'Parcs Canada',\r\n\t\t\t\r\n\t\t\t'canada' => 'Canada',\r\n\t\t\t'parlement' => 'Parlement',\r\n\t\t\t\r\n\t\t\t'québec' => 'Québec',\r\n\t\t\t'qu&eacute;bec' => 'Qu&eacutebec',\r\n\t\t\t'ontario' => 'Ontario',\r\n\t\t\t'colombie-britannique' => 'Colombie-Britannique',\r\n\t\t\t'alberta' => 'Alberta',\r\n\t\t\t'saskatchewan' => 'Saskatchewan',\r\n\t\t\t'manitoba' => 'Manitoba',\r\n\t\t\t'nouveau-brunswick' => 'Nouveau-brunswick',\r\n\t\t\t'île-du-prince-édouard' => 'Île-du-Prince-Édouard',\r\n\t\t\t'&icirc;le-du-prince-&eacute;douard' => '&Icirc;le-du-Prince-&Eacute;douard',\r\n\t\t\t'nouvelle-écosse' => 'Nouvelle-Écosse',\r\n\t\t\t'nouvelle-&eacute;cosse' => 'Nouvelle-&Eacute;cosse',\r\n\t\t\t'terre-neuve' => 'Terre-Neuve',\r\n\t\t\t'yukon' => 'Yukon',\r\n\t\t\t'territoires du nord-ouest' => 'Territoires du Nord-Ouest',\r\n\t\t\t'nunavut' => 'Nunavut',\r\n\t\t\t\r\n\t\t\t'ottawa' => 'Ottawa',\r\n\t\t\t'toronto' => 'Toronto',\r\n\t\t\t'montréal' => 'Montréal',\r\n\t\t\t'montr&eacute;al' => 'Montr&eacute;al',\r\n\t\t\t'vancouver' => 'Vancouver',\r\n\t\t\t\r\n\t\t\t'majesté' => 'Majesté',\r\n\t\t\t'majest&eacute;' => 'Majest&eacute;',\r\n\t\t\t'directeur général' => 'Directeur général',\r\n\t\t\t'directeur g&eacute;n&eacute;ral' => 'Directeur g&eacute;n&eacute;ral',\r\n\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t}", "static public function words() : array {\n return [\n \"абажур\",\n \"абзац\",\n \"абонент\",\n \"абрикос\",\n \"абсурд\",\n \"авангард\",\n \"август\",\n \"авиация\",\n \"авоська\",\n \"автор\",\n \"агат\",\n \"агент\",\n \"агитатор\",\n \"агнец\",\n \"агония\",\n \"агрегат\",\n \"адвокат\",\n \"адмирал\",\n \"адрес\",\n \"ажиотаж\",\n \"азарт\",\n \"азбука\",\n \"азот\",\n \"аист\",\n \"айсберг\",\n \"академия\",\n \"аквариум\",\n \"аккорд\",\n \"акробат\",\n \"аксиома\",\n \"актер\",\n \"акула\",\n \"акция\",\n \"алгоритм\",\n \"алебарда\",\n \"аллея\",\n \"алмаз\",\n \"алтарь\",\n \"алфавит\",\n \"алхимик\",\n \"алый\",\n \"альбом\",\n \"алюминий\",\n \"амбар\",\n \"аметист\",\n \"амнезия\",\n \"ампула\",\n \"амфора\",\n \"анализ\",\n \"ангел\",\n \"анекдот\",\n \"анимация\",\n \"анкета\",\n \"аномалия\",\n \"ансамбль\",\n \"антенна\",\n \"апатия\",\n \"апельсин\",\n \"апофеоз\",\n \"аппарат\",\n \"апрель\",\n \"аптека\",\n \"арабский\",\n \"арбуз\",\n \"аргумент\",\n \"арест\",\n \"ария\",\n \"арка\",\n \"армия\",\n \"аромат\",\n \"арсенал\",\n \"артист\",\n \"архив\",\n \"аршин\",\n \"асбест\",\n \"аскетизм\",\n \"аспект\",\n \"ассорти\",\n \"астроном\",\n \"асфальт\",\n \"атака\",\n \"ателье\",\n \"атлас\",\n \"атом\",\n \"атрибут\",\n \"аудитор\",\n \"аукцион\",\n \"аура\",\n \"афера\",\n \"афиша\",\n \"ахинея\",\n \"ацетон\",\n \"аэропорт\",\n \"бабушка\",\n \"багаж\",\n \"бадья\",\n \"база\",\n \"баклажан\",\n \"балкон\",\n \"бампер\",\n \"банк\",\n \"барон\",\n \"бассейн\",\n \"батарея\",\n \"бахрома\",\n \"башня\",\n \"баян\",\n \"бегство\",\n \"бедро\",\n \"бездна\",\n \"бекон\",\n \"белый\",\n \"бензин\",\n \"берег\",\n \"беседа\",\n \"бетонный\",\n \"биатлон\",\n \"библия\",\n \"бивень\",\n \"бигуди\",\n \"бидон\",\n \"бизнес\",\n \"бикини\",\n \"билет\",\n \"бинокль\",\n \"биология\",\n \"биржа\",\n \"бисер\",\n \"битва\",\n \"бицепс\",\n \"благо\",\n \"бледный\",\n \"близкий\",\n \"блок\",\n \"блуждать\",\n \"блюдо\",\n \"бляха\",\n \"бобер\",\n \"богатый\",\n \"бодрый\",\n \"боевой\",\n \"бокал\",\n \"большой\",\n \"борьба\",\n \"босой\",\n \"ботинок\",\n \"боцман\",\n \"бочка\",\n \"боярин\",\n \"брать\",\n \"бревно\",\n \"бригада\",\n \"бросать\",\n \"брызги\",\n \"брюки\",\n \"бублик\",\n \"бугор\",\n \"будущее\",\n \"буква\",\n \"бульвар\",\n \"бумага\",\n \"бунт\",\n \"бурный\",\n \"бусы\",\n \"бутылка\",\n \"буфет\",\n \"бухта\",\n \"бушлат\",\n \"бывалый\",\n \"быль\",\n \"быстрый\",\n \"быть\",\n \"бюджет\",\n \"бюро\",\n \"бюст\",\n \"вагон\",\n \"важный\",\n \"ваза\",\n \"вакцина\",\n \"валюта\",\n \"вампир\",\n \"ванная\",\n \"вариант\",\n \"вассал\",\n \"вата\",\n \"вафля\",\n \"вахта\",\n \"вдова\",\n \"вдыхать\",\n \"ведущий\",\n \"веер\",\n \"вежливый\",\n \"везти\",\n \"веко\",\n \"великий\",\n \"вена\",\n \"верить\",\n \"веселый\",\n \"ветер\",\n \"вечер\",\n \"вешать\",\n \"вещь\",\n \"веяние\",\n \"взаимный\",\n \"взбучка\",\n \"взвод\",\n \"взгляд\",\n \"вздыхать\",\n \"взлетать\",\n \"взмах\",\n \"взнос\",\n \"взор\",\n \"взрыв\",\n \"взывать\",\n \"взятка\",\n \"вибрация\",\n \"визит\",\n \"вилка\",\n \"вино\",\n \"вирус\",\n \"висеть\",\n \"витрина\",\n \"вихрь\",\n \"вишневый\",\n \"включать\",\n \"вкус\",\n \"власть\",\n \"влечь\",\n \"влияние\",\n \"влюблять\",\n \"внешний\",\n \"внимание\",\n \"внук\",\n \"внятный\",\n \"вода\",\n \"воевать\",\n \"вождь\",\n \"воздух\",\n \"войти\",\n \"вокзал\",\n \"волос\",\n \"вопрос\",\n \"ворота\",\n \"восток\",\n \"впадать\",\n \"впускать\",\n \"врач\",\n \"время\",\n \"вручать\",\n \"всадник\",\n \"всеобщий\",\n \"вспышка\",\n \"встреча\",\n \"вторник\",\n \"вулкан\",\n \"вурдалак\",\n \"входить\",\n \"въезд\",\n \"выбор\",\n \"вывод\",\n \"выгодный\",\n \"выделять\",\n \"выезжать\",\n \"выживать\",\n \"вызывать\",\n \"выигрыш\",\n \"вылезать\",\n \"выносить\",\n \"выпивать\",\n \"высокий\",\n \"выходить\",\n \"вычет\",\n \"вышка\",\n \"выяснять\",\n \"вязать\",\n \"вялый\",\n \"гавань\",\n \"гадать\",\n \"газета\",\n \"гаишник\",\n \"галстук\",\n \"гамма\",\n \"гарантия\",\n \"гастроли\",\n \"гвардия\",\n \"гвоздь\",\n \"гектар\",\n \"гель\",\n \"генерал\",\n \"геолог\",\n \"герой\",\n \"гешефт\",\n \"гибель\",\n \"гигант\",\n \"гильза\",\n \"гимн\",\n \"гипотеза\",\n \"гитара\",\n \"глаз\",\n \"глина\",\n \"глоток\",\n \"глубокий\",\n \"глыба\",\n \"глядеть\",\n \"гнать\",\n \"гнев\",\n \"гнить\",\n \"гном\",\n \"гнуть\",\n \"говорить\",\n \"годовой\",\n \"голова\",\n \"гонка\",\n \"город\",\n \"гость\",\n \"готовый\",\n \"граница\",\n \"грех\",\n \"гриб\",\n \"громкий\",\n \"группа\",\n \"грызть\",\n \"грязный\",\n \"губа\",\n \"гудеть\",\n \"гулять\",\n \"гуманный\",\n \"густой\",\n \"гуща\",\n \"давать\",\n \"далекий\",\n \"дама\",\n \"данные\",\n \"дарить\",\n \"дать\",\n \"дача\",\n \"дверь\",\n \"движение\",\n \"двор\",\n \"дебют\",\n \"девушка\",\n \"дедушка\",\n \"дежурный\",\n \"дезертир\",\n \"действие\",\n \"декабрь\",\n \"дело\",\n \"демократ\",\n \"день\",\n \"депутат\",\n \"держать\",\n \"десяток\",\n \"детский\",\n \"дефицит\",\n \"дешевый\",\n \"деятель\",\n \"джаз\",\n \"джинсы\",\n \"джунгли\",\n \"диалог\",\n \"диван\",\n \"диета\",\n \"дизайн\",\n \"дикий\",\n \"динамика\",\n \"диплом\",\n \"директор\",\n \"диск\",\n \"дитя\",\n \"дичь\",\n \"длинный\",\n \"дневник\",\n \"добрый\",\n \"доверие\",\n \"договор\",\n \"дождь\",\n \"доза\",\n \"документ\",\n \"должен\",\n \"домашний\",\n \"допрос\",\n \"дорога\",\n \"доход\",\n \"доцент\",\n \"дочь\",\n \"дощатый\",\n \"драка\",\n \"древний\",\n \"дрожать\",\n \"друг\",\n \"дрянь\",\n \"дубовый\",\n \"дуга\",\n \"дудка\",\n \"дукат\",\n \"дуло\",\n \"думать\",\n \"дупло\",\n \"дурак\",\n \"дуть\",\n \"духи\",\n \"душа\",\n \"дуэт\",\n \"дымить\",\n \"дыня\",\n \"дыра\",\n \"дыханье\",\n \"дышать\",\n \"дьявол\",\n \"дюжина\",\n \"дюйм\",\n \"дюна\",\n \"дядя\",\n \"дятел\",\n \"егерь\",\n \"единый\",\n \"едкий\",\n \"ежевика\",\n \"ежик\",\n \"езда\",\n \"елка\",\n \"емкость\",\n \"ерунда\",\n \"ехать\",\n \"жадный\",\n \"жажда\",\n \"жалеть\",\n \"жанр\",\n \"жара\",\n \"жать\",\n \"жгучий\",\n \"ждать\",\n \"жевать\",\n \"желание\",\n \"жемчуг\",\n \"женщина\",\n \"жертва\",\n \"жесткий\",\n \"жечь\",\n \"живой\",\n \"жидкость\",\n \"жизнь\",\n \"жилье\",\n \"жирный\",\n \"житель\",\n \"журнал\",\n \"жюри\",\n \"забывать\",\n \"завод\",\n \"загадка\",\n \"задача\",\n \"зажечь\",\n \"зайти\",\n \"закон\",\n \"замечать\",\n \"занимать\",\n \"западный\",\n \"зарплата\",\n \"засыпать\",\n \"затрата\",\n \"захват\",\n \"зацепка\",\n \"зачет\",\n \"защита\",\n \"заявка\",\n \"звать\",\n \"звезда\",\n \"звонить\",\n \"звук\",\n \"здание\",\n \"здешний\",\n \"здоровье\",\n \"зебра\",\n \"зевать\",\n \"зеленый\",\n \"земля\",\n \"зенит\",\n \"зеркало\",\n \"зефир\",\n \"зигзаг\",\n \"зима\",\n \"зиять\",\n \"злак\",\n \"злой\",\n \"змея\",\n \"знать\",\n \"зной\",\n \"зодчий\",\n \"золотой\",\n \"зомби\",\n \"зона\",\n \"зоопарк\",\n \"зоркий\",\n \"зрачок\",\n \"зрение\",\n \"зритель\",\n \"зубной\",\n \"зыбкий\",\n \"зять\",\n \"игла\",\n \"иголка\",\n \"играть\",\n \"идея\",\n \"идиот\",\n \"идол\",\n \"идти\",\n \"иерархия\",\n \"избрать\",\n \"известие\",\n \"изгонять\",\n \"издание\",\n \"излагать\",\n \"изменять\",\n \"износ\",\n \"изоляция\",\n \"изрядный\",\n \"изучать\",\n \"изымать\",\n \"изящный\",\n \"икона\",\n \"икра\",\n \"иллюзия\",\n \"имбирь\",\n \"иметь\",\n \"имидж\",\n \"иммунный\",\n \"империя\",\n \"инвестор\",\n \"индивид\",\n \"инерция\",\n \"инженер\",\n \"иномарка\",\n \"институт\",\n \"интерес\",\n \"инфекция\",\n \"инцидент\",\n \"ипподром\",\n \"ирис\",\n \"ирония\",\n \"искать\",\n \"история\",\n \"исходить\",\n \"исчезать\",\n \"итог\",\n \"июль\",\n \"июнь\",\n \"кабинет\",\n \"кавалер\",\n \"кадр\",\n \"казарма\",\n \"кайф\",\n \"кактус\",\n \"калитка\",\n \"камень\",\n \"канал\",\n \"капитан\",\n \"картина\",\n \"касса\",\n \"катер\",\n \"кафе\",\n \"качество\",\n \"каша\",\n \"каюта\",\n \"квартира\",\n \"квинтет\",\n \"квота\",\n \"кедр\",\n \"кекс\",\n \"кенгуру\",\n \"кепка\",\n \"керосин\",\n \"кетчуп\",\n \"кефир\",\n \"кибитка\",\n \"кивнуть\",\n \"кидать\",\n \"километр\",\n \"кино\",\n \"киоск\",\n \"кипеть\",\n \"кирпич\",\n \"кисть\",\n \"китаец\",\n \"класс\",\n \"клетка\",\n \"клиент\",\n \"клоун\",\n \"клуб\",\n \"клык\",\n \"ключ\",\n \"клятва\",\n \"книга\",\n \"кнопка\",\n \"кнут\",\n \"князь\",\n \"кобура\",\n \"ковер\",\n \"коготь\",\n \"кодекс\",\n \"кожа\",\n \"козел\",\n \"койка\",\n \"коктейль\",\n \"колено\",\n \"компания\",\n \"конец\",\n \"копейка\",\n \"короткий\",\n \"костюм\",\n \"котел\",\n \"кофе\",\n \"кошка\",\n \"красный\",\n \"кресло\",\n \"кричать\",\n \"кровь\",\n \"крупный\",\n \"крыша\",\n \"крючок\",\n \"кубок\",\n \"кувшин\",\n \"кудрявый\",\n \"кузов\",\n \"кукла\",\n \"культура\",\n \"кумир\",\n \"купить\",\n \"курс\",\n \"кусок\",\n \"кухня\",\n \"куча\",\n \"кушать\",\n \"кювет\",\n \"лабиринт\",\n \"лавка\",\n \"лагерь\",\n \"ладонь\",\n \"лазерный\",\n \"лайнер\",\n \"лакей\",\n \"лампа\",\n \"ландшафт\",\n \"лапа\",\n \"ларек\",\n \"ласковый\",\n \"лауреат\",\n \"лачуга\",\n \"лаять\",\n \"лгать\",\n \"лебедь\",\n \"левый\",\n \"легкий\",\n \"ледяной\",\n \"лежать\",\n \"лекция\",\n \"лента\",\n \"лепесток\",\n \"лесной\",\n \"лето\",\n \"лечь\",\n \"леший\",\n \"лживый\",\n \"либерал\",\n \"ливень\",\n \"лига\",\n \"лидер\",\n \"ликовать\",\n \"лиловый\",\n \"лимон\",\n \"линия\",\n \"липа\",\n \"лирика\",\n \"лист\",\n \"литр\",\n \"лифт\",\n \"лихой\",\n \"лицо\",\n \"личный\",\n \"лишний\",\n \"лобовой\",\n \"ловить\",\n \"логика\",\n \"лодка\",\n \"ложка\",\n \"лозунг\",\n \"локоть\",\n \"ломать\",\n \"лоно\",\n \"лопата\",\n \"лорд\",\n \"лось\",\n \"лоток\",\n \"лохматый\",\n \"лошадь\",\n \"лужа\",\n \"лукавый\",\n \"луна\",\n \"лупить\",\n \"лучший\",\n \"лыжный\",\n \"лысый\",\n \"львиный\",\n \"льгота\",\n \"льдина\",\n \"любить\",\n \"людской\",\n \"люстра\",\n \"лютый\",\n \"лягушка\",\n \"магазин\",\n \"мадам\",\n \"мазать\",\n \"майор\",\n \"максимум\",\n \"мальчик\",\n \"манера\",\n \"март\",\n \"масса\",\n \"мать\",\n \"мафия\",\n \"махать\",\n \"мачта\",\n \"машина\",\n \"маэстро\",\n \"маяк\",\n \"мгла\",\n \"мебель\",\n \"медведь\",\n \"мелкий\",\n \"мемуары\",\n \"менять\",\n \"мера\",\n \"место\",\n \"метод\",\n \"механизм\",\n \"мечтать\",\n \"мешать\",\n \"миграция\",\n \"мизинец\",\n \"микрофон\",\n \"миллион\",\n \"минута\",\n \"мировой\",\n \"миссия\",\n \"митинг\",\n \"мишень\",\n \"младший\",\n \"мнение\",\n \"мнимый\",\n \"могила\",\n \"модель\",\n \"мозг\",\n \"мойка\",\n \"мокрый\",\n \"молодой\",\n \"момент\",\n \"монах\",\n \"море\",\n \"мост\",\n \"мотор\",\n \"мохнатый\",\n \"мочь\",\n \"мошенник\",\n \"мощный\",\n \"мрачный\",\n \"мстить\",\n \"мудрый\",\n \"мужчина\",\n \"музыка\",\n \"мука\",\n \"мумия\",\n \"мундир\",\n \"муравей\",\n \"мусор\",\n \"мутный\",\n \"муфта\",\n \"муха\",\n \"мучить\",\n \"мушкетер\",\n \"мыло\",\n \"мысль\",\n \"мыть\",\n \"мычать\",\n \"мышь\",\n \"мэтр\",\n \"мюзикл\",\n \"мягкий\",\n \"мякиш\",\n \"мясо\",\n \"мятый\",\n \"мячик\",\n \"набор\",\n \"навык\",\n \"нагрузка\",\n \"надежда\",\n \"наемный\",\n \"нажать\",\n \"называть\",\n \"наивный\",\n \"накрыть\",\n \"налог\",\n \"намерен\",\n \"наносить\",\n \"написать\",\n \"народ\",\n \"натура\",\n \"наука\",\n \"нация\",\n \"начать\",\n \"небо\",\n \"невеста\",\n \"негодяй\",\n \"неделя\",\n \"нежный\",\n \"незнание\",\n \"нелепый\",\n \"немалый\",\n \"неправда\",\n \"нервный\",\n \"нести\",\n \"нефть\",\n \"нехватка\",\n \"нечистый\",\n \"неясный\",\n \"нива\",\n \"нижний\",\n \"низкий\",\n \"никель\",\n \"нирвана\",\n \"нить\",\n \"ничья\",\n \"ниша\",\n \"нищий\",\n \"новый\",\n \"нога\",\n \"ножницы\",\n \"ноздря\",\n \"ноль\",\n \"номер\",\n \"норма\",\n \"нота\",\n \"ночь\",\n \"ноша\",\n \"ноябрь\",\n \"нрав\",\n \"нужный\",\n \"нутро\",\n \"нынешний\",\n \"нырнуть\",\n \"ныть\",\n \"нюанс\",\n \"нюхать\",\n \"няня\",\n \"оазис\",\n \"обаяние\",\n \"обвинять\",\n \"обгонять\",\n \"обещать\",\n \"обжигать\",\n \"обзор\",\n \"обида\",\n \"область\",\n \"обмен\",\n \"обнимать\",\n \"оборона\",\n \"образ\",\n \"обучение\",\n \"обходить\",\n \"обширный\",\n \"общий\",\n \"объект\",\n \"обычный\",\n \"обязать\",\n \"овальный\",\n \"овес\",\n \"овощи\",\n \"овраг\",\n \"овца\",\n \"овчарка\",\n \"огненный\",\n \"огонь\",\n \"огромный\",\n \"огурец\",\n \"одежда\",\n \"одинокий\",\n \"одобрить\",\n \"ожидать\",\n \"ожог\",\n \"озарение\",\n \"озеро\",\n \"означать\",\n \"оказать\",\n \"океан\",\n \"оклад\",\n \"окно\",\n \"округ\",\n \"октябрь\",\n \"окурок\",\n \"олень\",\n \"опасный\",\n \"операция\",\n \"описать\",\n \"оплата\",\n \"опора\",\n \"оппонент\",\n \"опрос\",\n \"оптимизм\",\n \"опускать\",\n \"опыт\",\n \"орать\",\n \"орбита\",\n \"орган\",\n \"орден\",\n \"орел\",\n \"оригинал\",\n \"оркестр\",\n \"орнамент\",\n \"оружие\",\n \"осадок\",\n \"освещать\",\n \"осень\",\n \"осина\",\n \"осколок\",\n \"осмотр\",\n \"основной\",\n \"особый\",\n \"осуждать\",\n \"отбор\",\n \"отвечать\",\n \"отдать\",\n \"отец\",\n \"отзыв\",\n \"открытие\",\n \"отмечать\",\n \"относить\",\n \"отпуск\",\n \"отрасль\",\n \"отставка\",\n \"оттенок\",\n \"отходить\",\n \"отчет\",\n \"отъезд\",\n \"офицер\",\n \"охапка\",\n \"охота\",\n \"охрана\",\n \"оценка\",\n \"очаг\",\n \"очередь\",\n \"очищать\",\n \"очки\",\n \"ошейник\",\n \"ошибка\",\n \"ощущение\",\n \"павильон\",\n \"падать\",\n \"паек\",\n \"пакет\",\n \"палец\",\n \"память\",\n \"панель\",\n \"папка\",\n \"партия\",\n \"паспорт\",\n \"патрон\",\n \"пауза\",\n \"пафос\",\n \"пахнуть\",\n \"пациент\",\n \"пачка\",\n \"пашня\",\n \"певец\",\n \"педагог\",\n \"пейзаж\",\n \"пельмень\",\n \"пенсия\",\n \"пепел\",\n \"период\",\n \"песня\",\n \"петля\",\n \"пехота\",\n \"печать\",\n \"пешеход\",\n \"пещера\",\n \"пианист\",\n \"пиво\",\n \"пиджак\",\n \"пиковый\",\n \"пилот\",\n \"пионер\",\n \"пирог\",\n \"писать\",\n \"пить\",\n \"пицца\",\n \"пишущий\",\n \"пища\",\n \"план\",\n \"плечо\",\n \"плита\",\n \"плохой\",\n \"плыть\",\n \"плюс\",\n \"пляж\",\n \"победа\",\n \"повод\",\n \"погода\",\n \"подумать\",\n \"поехать\",\n \"пожимать\",\n \"позиция\",\n \"поиск\",\n \"покой\",\n \"получать\",\n \"помнить\",\n \"пони\",\n \"поощрять\",\n \"попадать\",\n \"порядок\",\n \"пост\",\n \"поток\",\n \"похожий\",\n \"поцелуй\",\n \"почва\",\n \"пощечина\",\n \"поэт\",\n \"пояснить\",\n \"право\",\n \"предмет\",\n \"проблема\",\n \"пруд\",\n \"прыгать\",\n \"прямой\",\n \"психолог\",\n \"птица\",\n \"публика\",\n \"пугать\",\n \"пудра\",\n \"пузырь\",\n \"пуля\",\n \"пункт\",\n \"пурга\",\n \"пустой\",\n \"путь\",\n \"пухлый\",\n \"пучок\",\n \"пушистый\",\n \"пчела\",\n \"пшеница\",\n \"пыль\",\n \"пытка\",\n \"пыхтеть\",\n \"пышный\",\n \"пьеса\",\n \"пьяный\",\n \"пятно\",\n \"работа\",\n \"равный\",\n \"радость\",\n \"развитие\",\n \"район\",\n \"ракета\",\n \"рамка\",\n \"ранний\",\n \"рапорт\",\n \"рассказ\",\n \"раунд\",\n \"рация\",\n \"рвать\",\n \"реальный\",\n \"ребенок\",\n \"реветь\",\n \"регион\",\n \"редакция\",\n \"реестр\",\n \"режим\",\n \"резкий\",\n \"рейтинг\",\n \"река\",\n \"религия\",\n \"ремонт\",\n \"рента\",\n \"реплика\",\n \"ресурс\",\n \"реформа\",\n \"рецепт\",\n \"речь\",\n \"решение\",\n \"ржавый\",\n \"рисунок\",\n \"ритм\",\n \"рифма\",\n \"робкий\",\n \"ровный\",\n \"рогатый\",\n \"родитель\",\n \"рождение\",\n \"розовый\",\n \"роковой\",\n \"роль\",\n \"роман\",\n \"ронять\",\n \"рост\",\n \"рота\",\n \"роща\",\n \"рояль\",\n \"рубль\",\n \"ругать\",\n \"руда\",\n \"ружье\",\n \"руины\",\n \"рука\",\n \"руль\",\n \"румяный\",\n \"русский\",\n \"ручка\",\n \"рыба\",\n \"рывок\",\n \"рыдать\",\n \"рыжий\",\n \"рынок\",\n \"рысь\",\n \"рыть\",\n \"рыхлый\",\n \"рыцарь\",\n \"рычаг\",\n \"рюкзак\",\n \"рюмка\",\n \"рябой\",\n \"рядовой\",\n \"сабля\",\n \"садовый\",\n \"сажать\",\n \"салон\",\n \"самолет\",\n \"сани\",\n \"сапог\",\n \"сарай\",\n \"сатира\",\n \"сауна\",\n \"сахар\",\n \"сбегать\",\n \"сбивать\",\n \"сбор\",\n \"сбыт\",\n \"свадьба\",\n \"свет\",\n \"свидание\",\n \"свобода\",\n \"связь\",\n \"сгорать\",\n \"сдвигать\",\n \"сеанс\",\n \"северный\",\n \"сегмент\",\n \"седой\",\n \"сезон\",\n \"сейф\",\n \"секунда\",\n \"сельский\",\n \"семья\",\n \"сентябрь\",\n \"сердце\",\n \"сеть\",\n \"сечение\",\n \"сеять\",\n \"сигнал\",\n \"сидеть\",\n \"сизый\",\n \"сила\",\n \"символ\",\n \"синий\",\n \"сирота\",\n \"система\",\n \"ситуация\",\n \"сиять\",\n \"сказать\",\n \"скважина\",\n \"скелет\",\n \"скидка\",\n \"склад\",\n \"скорый\",\n \"скрывать\",\n \"скучный\",\n \"слава\",\n \"слеза\",\n \"слияние\",\n \"слово\",\n \"случай\",\n \"слышать\",\n \"слюна\",\n \"смех\",\n \"смирение\",\n \"смотреть\",\n \"смутный\",\n \"смысл\",\n \"смятение\",\n \"снаряд\",\n \"снег\",\n \"снижение\",\n \"сносить\",\n \"снять\",\n \"событие\",\n \"совет\",\n \"согласие\",\n \"сожалеть\",\n \"сойти\",\n \"сокол\",\n \"солнце\",\n \"сомнение\",\n \"сонный\",\n \"сообщать\",\n \"соперник\",\n \"сорт\",\n \"состав\",\n \"сотня\",\n \"соус\",\n \"социолог\",\n \"сочинять\",\n \"союз\",\n \"спать\",\n \"спешить\",\n \"спина\",\n \"сплошной\",\n \"способ\",\n \"спутник\",\n \"средство\",\n \"срок\",\n \"срывать\",\n \"стать\",\n \"ствол\",\n \"стена\",\n \"стихи\",\n \"сторона\",\n \"страна\",\n \"студент\",\n \"стыд\",\n \"субъект\",\n \"сувенир\",\n \"сугроб\",\n \"судьба\",\n \"суета\",\n \"суждение\",\n \"сукно\",\n \"сулить\",\n \"сумма\",\n \"сунуть\",\n \"супруг\",\n \"суровый\",\n \"сустав\",\n \"суть\",\n \"сухой\",\n \"суша\",\n \"существо\",\n \"сфера\",\n \"схема\",\n \"сцена\",\n \"счастье\",\n \"счет\",\n \"считать\",\n \"сшивать\",\n \"съезд\",\n \"сынок\",\n \"сыпать\",\n \"сырье\",\n \"сытый\",\n \"сыщик\",\n \"сюжет\",\n \"сюрприз\",\n \"таблица\",\n \"таежный\",\n \"таинство\",\n \"тайна\",\n \"такси\",\n \"талант\",\n \"таможня\",\n \"танец\",\n \"тарелка\",\n \"таскать\",\n \"тахта\",\n \"тачка\",\n \"таять\",\n \"тварь\",\n \"твердый\",\n \"творить\",\n \"театр\",\n \"тезис\",\n \"текст\",\n \"тело\",\n \"тема\",\n \"тень\",\n \"теория\",\n \"теплый\",\n \"терять\",\n \"тесный\",\n \"тетя\",\n \"техника\",\n \"течение\",\n \"тигр\",\n \"типичный\",\n \"тираж\",\n \"титул\",\n \"тихий\",\n \"тишина\",\n \"ткань\",\n \"товарищ\",\n \"толпа\",\n \"тонкий\",\n \"топливо\",\n \"торговля\",\n \"тоска\",\n \"точка\",\n \"тощий\",\n \"традиция\",\n \"тревога\",\n \"трибуна\",\n \"трогать\",\n \"труд\",\n \"трюк\",\n \"тряпка\",\n \"туалет\",\n \"тугой\",\n \"туловище\",\n \"туман\",\n \"тундра\",\n \"тупой\",\n \"турнир\",\n \"тусклый\",\n \"туфля\",\n \"туча\",\n \"туша\",\n \"тыкать\",\n \"тысяча\",\n \"тьма\",\n \"тюльпан\",\n \"тюрьма\",\n \"тяга\",\n \"тяжелый\",\n \"тянуть\",\n \"убеждать\",\n \"убирать\",\n \"убогий\",\n \"убыток\",\n \"уважение\",\n \"уверять\",\n \"увлекать\",\n \"угнать\",\n \"угол\",\n \"угроза\",\n \"удар\",\n \"удивлять\",\n \"удобный\",\n \"уезд\",\n \"ужас\",\n \"ужин\",\n \"узел\",\n \"узкий\",\n \"узнавать\",\n \"узор\",\n \"уйма\",\n \"уклон\",\n \"укол\",\n \"уксус\",\n \"улетать\",\n \"улица\",\n \"улучшать\",\n \"улыбка\",\n \"уметь\",\n \"умиление\",\n \"умный\",\n \"умолять\",\n \"умысел\",\n \"унижать\",\n \"уносить\",\n \"уныние\",\n \"упасть\",\n \"уплата\",\n \"упор\",\n \"упрекать\",\n \"упускать\",\n \"уран\",\n \"урна\",\n \"уровень\",\n \"усадьба\",\n \"усердие\",\n \"усилие\",\n \"ускорять\",\n \"условие\",\n \"усмешка\",\n \"уснуть\",\n \"успеть\",\n \"усыпать\",\n \"утешать\",\n \"утка\",\n \"уточнять\",\n \"утро\",\n \"утюг\",\n \"уходить\",\n \"уцелеть\",\n \"участие\",\n \"ученый\",\n \"учитель\",\n \"ушко\",\n \"ущерб\",\n \"уютный\",\n \"уяснять\",\n \"фабрика\",\n \"фаворит\",\n \"фаза\",\n \"файл\",\n \"факт\",\n \"фамилия\",\n \"фантазия\",\n \"фара\",\n \"фасад\",\n \"февраль\",\n \"фельдшер\",\n \"феномен\",\n \"ферма\",\n \"фигура\",\n \"физика\",\n \"фильм\",\n \"финал\",\n \"фирма\",\n \"фишка\",\n \"флаг\",\n \"флейта\",\n \"флот\",\n \"фокус\",\n \"фольклор\",\n \"фонд\",\n \"форма\",\n \"фото\",\n \"фраза\",\n \"фреска\",\n \"фронт\",\n \"фрукт\",\n \"функция\",\n \"фуражка\",\n \"футбол\",\n \"фыркать\",\n \"халат\",\n \"хамство\",\n \"хаос\",\n \"характер\",\n \"хата\",\n \"хватать\",\n \"хвост\",\n \"хижина\",\n \"хилый\",\n \"химия\",\n \"хирург\",\n \"хитрый\",\n \"хищник\",\n \"хлам\",\n \"хлеб\",\n \"хлопать\",\n \"хмурый\",\n \"ходить\",\n \"хозяин\",\n \"хоккей\",\n \"холодный\",\n \"хороший\",\n \"хотеть\",\n \"хохотать\",\n \"храм\",\n \"хрен\",\n \"хриплый\",\n \"хроника\",\n \"хрупкий\",\n \"художник\",\n \"хулиган\",\n \"хутор\",\n \"царь\",\n \"цвет\",\n \"цель\",\n \"цемент\",\n \"центр\",\n \"цепь\",\n \"церковь\",\n \"цикл\",\n \"цилиндр\",\n \"циничный\",\n \"цирк\",\n \"цистерна\",\n \"цитата\",\n \"цифра\",\n \"цыпленок\",\n \"чадо\",\n \"чайник\",\n \"часть\",\n \"чашка\",\n \"человек\",\n \"чемодан\",\n \"чепуха\",\n \"черный\",\n \"честь\",\n \"четкий\",\n \"чехол\",\n \"чиновник\",\n \"число\",\n \"читать\",\n \"членство\",\n \"чреватый\",\n \"чтение\",\n \"чувство\",\n \"чугунный\",\n \"чудо\",\n \"чужой\",\n \"чукча\",\n \"чулок\",\n \"чума\",\n \"чуткий\",\n \"чучело\",\n \"чушь\",\n \"шаблон\",\n \"шагать\",\n \"шайка\",\n \"шакал\",\n \"шалаш\",\n \"шампунь\",\n \"шанс\",\n \"шапка\",\n \"шарик\",\n \"шасси\",\n \"шатер\",\n \"шахта\",\n \"шашлык\",\n \"швейный\",\n \"швырять\",\n \"шевелить\",\n \"шедевр\",\n \"шейка\",\n \"шелковый\",\n \"шептать\",\n \"шерсть\",\n \"шестерка\",\n \"шикарный\",\n \"шинель\",\n \"шипеть\",\n \"широкий\",\n \"шить\",\n \"шишка\",\n \"шкаф\",\n \"школа\",\n \"шкура\",\n \"шланг\",\n \"шлем\",\n \"шлюпка\",\n \"шляпа\",\n \"шнур\",\n \"шоколад\",\n \"шорох\",\n \"шоссе\",\n \"шофер\",\n \"шпага\",\n \"шпион\",\n \"шприц\",\n \"шрам\",\n \"шрифт\",\n \"штаб\",\n \"штора\",\n \"штраф\",\n \"штука\",\n \"штык\",\n \"шуба\",\n \"шуметь\",\n \"шуршать\",\n \"шутка\",\n \"щадить\",\n \"щедрый\",\n \"щека\",\n \"щель\",\n \"щенок\",\n \"щепка\",\n \"щетка\",\n \"щука\",\n \"эволюция\",\n \"эгоизм\",\n \"экзамен\",\n \"экипаж\",\n \"экономия\",\n \"экран\",\n \"эксперт\",\n \"элемент\",\n \"элита\",\n \"эмблема\",\n \"эмигрант\",\n \"эмоция\",\n \"энергия\",\n \"эпизод\",\n \"эпоха\",\n \"эскиз\",\n \"эссе\",\n \"эстрада\",\n \"этап\",\n \"этика\",\n \"этюд\",\n \"эфир\",\n \"эффект\",\n \"эшелон\",\n \"юбилей\",\n \"юбка\",\n \"южный\",\n \"юмор\",\n \"юноша\",\n \"юрист\",\n \"яблоко\",\n \"явление\",\n \"ягода\",\n \"ядерный\",\n \"ядовитый\",\n \"ядро\",\n \"язва\",\n \"язык\",\n \"яйцо\",\n \"якорь\",\n \"январь\",\n \"японец\",\n \"яркий\",\n \"ярмарка\",\n \"ярость\",\n \"ярус\",\n \"ясный\",\n \"яхта\",\n \"ячейка\",\n \"ящик\" \n ];\n }", "function getWords() {\r\r\n\t\t$arr = array();\r\r\n\t\tif ($this->table != '' && $this->field != '') {\r\r\n\t\t\t$sql = 'SELECT '.KT_escapeFieldName($this->field).' AS myfield FROM '.$this->table; \r\r\n\t\t\t$rs = $this->tNG->connection->Execute($sql);\r\r\n\t\t\tif ($this->tNG->connection->errorMsg()!='') {\r\r\n\t\t\t\t$this->error = new tNG_error('BADWORDS_SQL_ERROR', array(), array($this->tNG->connection->errorMsg(), $sql));\r\r\n\t\t\t\treturn $arr;\r\r\n\t\t\t}\r\r\n\t\t\twhile (!$rs->EOF) {\r\r\n\t\t\t\t$arr[] = trim($rs->Fields('myfield'));\r\r\n\t\t\t\t$rs->MoveNext();\r\r\n\t\t\t}\r\r\n\t\t\t$rs->Close();\r\r\n\t\t} else {\r\r\n\t\t\t$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tNG_ChkForbiddenWords.txt';\r\r\n\t\t \tif (!file_exists($file)) {\r\r\n\t\t \t\t$this->error = new tNG_error('BADWORDS_FILE_ERROR', array(), array($file));\r\r\n\t\t \treturn $arr;\r\r\n\t\t \t}\r\r\n\t\t \tif ($fd = @fopen($file, 'rb')) {\r\r\n\t\t\t\twhile (!feof ($fd)) {\r\r\n\t\t \t\t\t$tmp = fgets($fd, 4096);\r\r\n\t\t \t\t\t$tmp = addcslashes($tmp, '/.()[]{}|^$');\r\r\n\t\t \t\t\tif (trim($tmp) != '') {\r\r\n\t\t \t\t\t\t$arrTmp = explode(',', $tmp);\r\r\n\t\t \t\t\tforeach ($arrTmp as $k => $v) {\r\r\n\t\t \t\t\t\t$arr[] = trim($v);\r\r\n\t\t \t\t \t}\r\r\n\t\t \t\t}\r\r\n\t\t \t}\r\r\n\t\t \tfclose ($fd);\r\r\n\t\t \t} else {\r\r\n\t\t \t$this->error = new tNG_error('BADWORDS_FILE_ERROR', array(), array($file));\r\r\n\t\t\t\treturn $arr;\r\r\n\t\t \t}\r\r\n\t\t}\r\r\n\t\treturn $arr;\r\r\n\t}", "public function WordCollection()\n {\n $myWords = parent::WordCollection();\n\n if(!$myWords->loadedFromFile())\n {\n // English Words\n $myWords->addText(\"en-us\", \"TITLE\", \"Module Login\");\n\n // Portuguese Words\n $myWords->addText(\"pt-br\", \"TITLE\", \"Módulo de Login\");\n }\n\n return $myWords;\n }", "function parse_words()\n\t{\n\t\t//list of commonly used words\n\t\t// this can be edited to suit your needs\n\t\t$common = array(\"able\", \"about\", \"above\", \"act\", \"add\", \"afraid\", \"after\", \"again\", \"against\", \"age\", \"ago\", \"agree\", \"all\", \"almost\", \"alone\", \"along\", \"already\", \"also\", \"although\", \"always\", \"am\", \"amount\", \"an\", \"and\", \"anger\", \"angry\", \"animal\", \"another\", \"answer\", \"any\", \"appear\", \"apple\", \"are\", \"arrive\", \"arm\", \"arms\", \"around\", \"arrive\", \"as\", \"ask\", \"at\", \"attempt\", \"aunt\", \"away\", \"back\", \"bad\", \"bag\", \"bay\", \"be\", \"became\", \"because\", \"become\", \"been\", \"before\", \"began\", \"begin\", \"behind\", \"being\", \"bell\", \"belong\", \"below\", \"beside\", \"best\", \"better\", \"between\", \"beyond\", \"big\", \"body\", \"bone\", \"born\", \"borrow\", \"both\", \"bottom\", \"box\", \"boy\", \"break\", \"bring\", \"brought\", \"bug\", \"built\", \"busy\", \"but\", \"buy\", \"by\", \"call\", \"came\", \"can\", \"cause\", \"choose\", \"close\", \"close\", \"consider\", \"come\", \"consider\", \"considerable\", \"contain\", \"continue\", \"could\", \"cry\", \"cut\", \"dare\", \"dark\", \"deal\", \"dear\", \"decide\", \"deep\", \"did\", \"die\", \"do\", \"does\", \"dog\", \"done\", \"doubt\", \"down\", \"during\", \"each\", \"ear\", \"early\", \"eat\", \"effort\", \"either\", \"else\", \"end\", \"enjoy\", \"enough\", \"enter\", \"even\", \"ever\", \"every\", \"except\", \"expect\", \"explain\", \"fail\", \"fall\", \"far\", \"fat\", \"favor\", \"fear\", \"feel\", \"feet\", \"fell\", \"felt\", \"few\", \"fill\", \"find\", \"fit\", \"fly\", \"follow\", \"for\", \"forever\", \"forget\", \"from\", \"front\", \"gave\", \"get\", \"gives\", \"goes\", \"gone\", \"good\", \"got\", \"gray\", \"great\", \"green\", \"grew\", \"grow\", \"guess\", \"had\", \"half\", \"hang\", \"happen\", \"has\", \"hat\", \"have\", \"he\", \"hear\", \"heard\", \"held\", \"hello\", \"help\", \"her\", \"here\", \"hers\", \"high\", \"hill\", \"him\", \"his\", \"hit\", \"hold\", \"hot\", \"how\", \"however\", \"I\", \"if\", \"ill\", \"in\", \"indeed\", \"instead\", \"into\", \"iron\", \"is\", \"it\", \"its\", \"just\", \"keep\", \"kept\", \"knew\", \"know\", \"known\", \"late\", \"least\", \"led\", \"left\", \"lend\", \"less\", \"let\", \"like\", \"likely\", \"likr\", \"lone\", \"long\", \"look\", \"lot\", \"make\", \"many\", \"may\", \"me\", \"mean\", \"met\", \"might\", \"mile\", \"mine\", \"moon\", \"more\", \"most\", \"move\", \"much\", \"must\", \"my\", \"near\", \"nearly\", \"necessary\", \"neither\", \"never\", \"next\", \"no\", \"none\", \"nor\", \"not\", \"note\", \"nothing\", \"now\", \"number\", \"of\", \"off\", \"often\", \"oh\", \"on\", \"once\", \"only\", \"or\", \"other\", \"ought\", \"our\", \"out\", \"please\", \"prepare\", \"probable\", \"pull\", \"pure\", \"push\", \"put\", \"raise\", \"ran\", \"rather\", \"reach\", \"realize\", \"reply\", \"require\", \"rest\", \"run\", \"said\", \"same\", \"sat\", \"saw\", \"say\", \"see\", \"seem\", \"seen\", \"self\", \"sell\", \"sent\", \"separate\", \"set\", \"shall\", \"she\", \"should\", \"side\", \"sign\", \"since\", \"so\", \"sold\", \"some\", \"soon\", \"sorry\", \"stay\", \"step\", \"stick\", \"still\", \"stood\", \"such\", \"sudden\", \"suppose\", \"take\", \"taken\", \"talk\", \"tall\", \"tell\", \"ten\", \"than\", \"thank\", \"that\", \"the\", \"their\", \"them\", \"then\", \"there\", \"therefore\", \"these\", \"they\", \"this\", \"those\", \"though\", \"through\", \"till\", \"to\", \"today\", \"told\", \"tomorrow\", \"too\", \"took\", \"tore\", \"tought\", \"toward\", \"tried\", \"tries\", \"trust\", \"try\", \"turn\", \"two\", \"under\", \"until\", \"up\", \"upon\", \"us\", \"use\", \"usual\", \"various\", \"verb\", \"very\", \"visit\", \"want\", \"was\", \"we\", \"well\", \"went\", \"were\", \"what\", \"when\", \"where\", \"whether\", \"which\", \"while\", \"white\", \"who\", \"whom\", \"whose\", \"why\", \"will\", \"with\", \"within\", \"without\", \"would\", \"yes\", \"yet\", \"you\", \"young\", \"your\", \"br\", \"img\", \"p\",\"lt\", \"gt\", \"quot\", \"copy\");\n\t\t//create an array out of the site contents\n\t\t$s = split(\" \", $this->contents);\n\t\t//initialize array\n\t\t$k = array();\n\t\t//iterate inside the array\n\t\tforeach( $s as $key=>$val ) {\n\t\t\t//delete single or two letter words and\n\t\t\t//Add it to the list if the word is not\n\t\t\t//contained in the common words list.\n\t\t\tif(mb_strlen(trim($val)) >= $this->wordLengthMin && !in_array(trim($val), $common) && !is_numeric(trim($val))) {\n\t\t\t\t$k[] = trim($val);\n\t\t\t}\n\t\t}\n\t\t//count the words\n\t\t$k = array_count_values($k);\n\t\t//sort the words from\n\t\t//highest count to the\n\t\t//lowest.\n\t\t$occur_filtered = $this->occure_filter($k, $this->wordOccuredMin);\n\t\tarsort($occur_filtered);\n\n\t\t$imploded = $this->implode(\", \", $occur_filtered);\n\t\t//release unused variables\n\t\tunset($k);\n\t\tunset($s);\n\n\t\treturn $imploded;\n\t}", "public function getTwords() {\n $this->tlist = getTranslatables($this->langtag);\n }", "private function internal_translate_words() {\n global $DB;\n $this->translated = false;\n\n // Get list of all words used.\n $allwords = array();\n foreach (array_merge($this->terms, $this->negativeterms) as $term) {\n $allwords = array_merge($allwords, $term->words);\n }\n $allwords = array_unique($allwords);\n if (count($allwords) === 0) {\n return array(false, null);\n }\n\n // OK, great, now let's build a query for all those words.\n list ($wordlistwhere, $wordlistwherearray) =\n $DB->get_in_or_equal($allwords);\n $words = $DB->get_records_select('local_ousearch_words',\n 'word ' . $wordlistwhere, $wordlistwherearray, '', 'word,id');\n\n // Convert words to IDs.\n $newterms = array();\n $lastmissed = '';\n foreach ($this->terms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = true;\n $lastmissed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term...\n if ($missed) {\n // Required term? Not going to find anything then.\n if ($term->required || !self::SUPPORTS_OR) {\n return array(false, $lastmissed);\n }\n // If not required, just dump that term.\n } else {\n $newterms[] = $term;\n }\n }\n // Must have some (positive) terms.\n if (count($newterms) == 0) {\n return array(false, $lastmissed);\n }\n $this->terms = $newterms;\n\n $newterms = array();\n foreach ($this->negativeterms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term, dump it.\n if (!$missed) {\n $newterms[] = $term;\n }\n }\n $this->negativeterms = $newterms;\n $this->translated = true;\n return array(true, true);\n }", "function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "function get_bad_words()\n {\n // Init bad word array and _lang var\n $this->bad_word_array = array();\n \n $sql = \"\n SELECT \n word \n FROM\n {$GLOBALS['B']->sys['db']['table_prefix']}bad_words\";\n\n $result = $GLOBALS['B']->db->query($sql); \n if (DB::isError($result)) \n {\n trigger_error($result->getMessage().\"\\n\\nSQL: \".$sql.\"\\n\\nFILE: \".__FILE__.\"\\nLINE: \".__LINE__, E_USER_ERROR);\n } \n\n while($row = &$result->FetchRow( DB_FETCHMODE_ASSOC ))\n {\n $this->bad_word_array[stripslashes($row['word'])] = TRUE;\n }\n }", "protected function fetchSpecialWords() {\n\t\t$path = parent::getI18Nsetting('locales_path') . '/' . $this->translator->getTranslatorLocale()->getI18Nlocale() . '/words.ini' ;\n\t\t$this->special_words = parse_ini_file($path, TRUE);\n\t\treturn (boolean) TRUE;\n\t}", "protected function loadLanguage($filename)\n\t{\n\t\t$strings = false;\n\n\t\tif (file_exists($filename))\n\t\t{\n\t\t\t$strings = $this->parseFile($filename);\n\t\t}\n\n\t\treturn $strings;\n\t}", "public function languages();", "private static function loadLanguage($lang){\n\t\t$descriptions = array();\n\n\t\t$locale = 'locale/'.$lang.'.php';\n\t\trequire($locale);\n\n\t\treturn (object)$descriptions;\n\t}", "public function dataSampleWords() \n {\n Inflector::reset();\n \n // in the format array('singular', 'plural') \n return array(\n array('categoria', 'categorias'),\n array('house', 'houses'),\n array('powerhouse', 'powerhouses'),\n array('Bus', 'Buses'),\n array('bus', 'buses'),\n array('menu', 'menus'),\n array('news', 'news'),\n array('food_menu', 'food_menus'),\n array('Menu', 'Menus'),\n array('FoodMenu', 'FoodMenus'),\n array('quiz', 'quizzes'),\n array('matrix_row', 'matrix_rows'),\n array('matrix', 'matrices'),\n array('vertex', 'vertices'),\n array('index', 'indices'),\n array('Alias', 'Aliases'),\n array('Media', 'Media'),\n array('NodeMedia', 'NodeMedia'),\n array('alumnus', 'alumni'),\n array('bacillus', 'bacilli'),\n array('cactus', 'cacti'),\n array('focus', 'foci'),\n array('fungus', 'fungi'),\n array('nucleus', 'nuclei'),\n array('octopus', 'octopuses'),\n array('radius', 'radii'),\n array('stimulus', 'stimuli'),\n array('syllabus', 'syllabi'),\n array('terminus', 'termini'),\n array('virus', 'viri'),\n array('person', 'people'),\n array('glove', 'gloves'),\n array('crisis', 'crises'),\n array('tax', 'taxes'),\n array('wave', 'waves'),\n array('bureau', 'bureaus'),\n array('cafe', 'cafes'),\n array('roof', 'roofs'),\n array('foe', 'foes'),\n array('cookie', 'cookies'),\n array('identity', 'identities'),\n array('criteria', 'criterion'),\n array('curve', 'curves'),\n array('', ''),\n );\n }", "public function wordEngine(){\n $getSomeWords = $this->getSomeWords();\n if(!$getSomeWords['status']){\n return $getSomeWords;\n }\n $words = $getSomeWords['body'];\n $result = $this->matrixMaker($words);\n $matrix = $result['matrix'];\n $info = $result['info'];\n return ['status'=>1, 'words'=>$words, 'matrix'=>$matrix, 'info'=>$info];\n }", "public function parseLanguages()\n {\n $languages = array();\n $modelArray = $this->model->toRdfPhp();\n $textAnnotationsLanguage = $this->model->resourcesMatching(DCTerms::TYPE, array('type' => 'uri', 'value' => DCTerms::LINGUISTIC_SYSTEM));\n foreach ($textAnnotationsLanguage as $taLangResource) {\n $taProperties = $modelArray[$taLangResource->getUri()];\n $lang = isset($taProperties[DCTerms::LANGUAGE][0]['value']) ? $taProperties[DCTerms::LANGUAGE][0]['value'] : '';\n if (!empty($lang) && !in_array($lang, $languages))\n array_push($languages, $lang);\n }\n\n return $languages;\n }", "public static function loadLanguages()\n\t{\n\t\tself::$_LANGUAGES = array();\n\t\t$result = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'Language`');\n\t\tforeach ($result AS $row)\n\t\t\tself::$_LANGUAGES[(int)$row['LanguageId']] = $row;\n\t}", "function _load_languages()\r\n\t{\r\n\t\t// Load the form validation language file\r\n\t\t$this->lang->load('form_validation');\r\n\r\n\t\t// Load the DataMapper language file\r\n\t\t$this->lang->load('datamapper');\r\n\t}", "function languages()\n {\n $defaults = array('en');\n $langs = array();\n\n // get aspell dictionaries\n exec('aspell dump dicts', $dicts);\n if (!empty($dicts)) {\n $seen = array();\n foreach ($dicts as $lang) {\n $lang = preg_replace('/-.*$/', '', $lang);\n $langc = strlen($lang) == 2 ? $lang.'_'.strtoupper($lang) : $lang;\n if (!$seen[$langc]++)\n $langs[] = $lang;\n }\n $langs = array_unique($langs);\n }\n else {\n $langs = $defaults;\n }\n\n return $langs;\n }", "public function getWords(): array\n {\n return $this->getWordList();\n }", "function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}", "public function Load ($language,$limit = null) {\n\t\t$this->load->library(\"sentence\");\n\t\t$SentenceTemplate = new Sentence();\n\t\tif (!is_null($limit)) {\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t$query = $this->db->from($SentenceTemplate->Database_Table)->select(\"id\")->where(array(\"language\" => $language))->get();\n\t\t$rows = array();\n\t\tif ($query->num_rows() === false || $query->num_rows() == 0) return false;\n\t\tforeach ($query->result() as $row) {\n\t\t\t$Sentence = new Sentence();\n\t\t\t$Sentence->Load($row->id);\n\t\t\t$rows[] = $Sentence;\n\t\t}\n\t\treturn $rows;\n\t}", "public function words()\n {\n return self::create('',$this->provider->words()); \n }", "function getDictionary ()\n\t{\n\t\t$dictionary = array ();\n\t\tinclude ('framework/i18n/dictionary_en.php');\n\t\t$file = 'framework/i18n/dictionary_'.$_SESSION['brimLanguage'].'.php';\n\t\tif (file_exists ($file))\n\t\t{\n\t\t\tinclude ($file);\n\t\t}\n\t\treturn $dictionary;\n\t}", "public function load($textDomain, $language);", "function __($word) {\n global $cfg;\n if (isset($_GET['lang'])) {\n include(\"langs/\".$_GET['lang'].\".php\");\n } else include(\"langs/\".$cfg[\"default_language\"].\".php\"); \n\n return isset($translations[$word]) ? $translations[$word] : $word;\n}", "function idx_getPageWords($page){\n global $conf;\n $word_idx = file($conf['cachedir'].'/word.idx');\n $swfile = DOKU_INC.'inc/lang/'.$conf['lang'].'/stopwords.txt';\n if(@file_exists($swfile)){\n $stopwords = file($swfile);\n }else{\n $stopwords = array();\n }\n\n $body = rawWiki($page);\n $body = strtr($body, \"\\r\\n\\t\", ' ');\n $tokens = explode(' ', $body);\n $tokens = array_count_values($tokens); // count the frequency of each token\n\n $words = array();\n foreach ($tokens as $word => $count) {\n $word = utf8_strtolower($word);\n\n // simple filter to restrict use of utf8_stripspecials\n if (preg_match('/\\W/', $word)) {\n $arr = explode(' ', utf8_stripspecials($word,' ','._\\-:'));\n $arr = array_count_values($arr);\n\n foreach ($arr as $w => $c) {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$w] = $c + (isset($words[$w]) ? $words[$w] : 0);\n }\n } else {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0);\n }\n }\n\n // arrive here with $words = array(word => frequency)\n\n $index = array(); //resulting index\n foreach ($words as $word => $freq) {\n\tif (is_int(array_search(\"$word\\n\",$stopwords))) continue;\n $wid = array_search(\"$word\\n\",$word_idx);\n if(!is_int($wid)){\n $word_idx[] = \"$word\\n\";\n $wid = count($word_idx)-1;\n }\n $index[$wid] = $freq;\n }\n\n // save back word index\n $fh = fopen($conf['cachedir'].'/word.idx','w');\n if(!$fh){\n trigger_error(\"Failed to write word.idx\", E_USER_ERROR);\n return false;\n }\n fwrite($fh,join('',$word_idx));\n fclose($fh);\n\n return $index;\n}", "public function readFileByWord() {\r\n\t\tif ($this->exists) {\r\n\t\t\t$filecontents = file_get_contents ( $this->filename );\r\n\t\t\t$words = preg_split ( '/[\\s]+/', $filecontents, - 1, PREG_SPLIT_NO_EMPTY );\r\n\t\t\treturn $words;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "static function get_words_of_list($list_id) {\n global $con;\n $sql = \"SELECT `id`, `list`, `language1`, `language2` FROM `word` WHERE `list` = \".$list_id.\" AND `status` = 1 ORDER BY `id` DESC\";\n $query = mysqli_query($con, $sql);\n $output = array();\n while ($row = mysqli_fetch_assoc($query)) {\n array_push($output, new Word($row['id'], $row['list'], $row['language1'], $row['language2']));\n }\n return $output;\n }" ]
[ "0.74533975", "0.70110345", "0.6868285", "0.6794794", "0.66867", "0.6633132", "0.6555122", "0.6388225", "0.6385643", "0.6364116", "0.6306736", "0.6220428", "0.61480373", "0.6105883", "0.61049896", "0.6093", "0.60501057", "0.60137355", "0.59984267", "0.59851307", "0.5953104", "0.5895983", "0.58843863", "0.587452", "0.58693206", "0.5833948", "0.5830194", "0.58150613", "0.5813242", "0.5812973" ]
0.70823926
1
/ Redirect: parse_clean_value / LEGACY MODE: clean_value (alias of parse_clean_value)
function clean_value( $t ) { return $this->parse_clean_value( $t ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function parseCleanValue($val) {\r\n\t\tif ($val == '') {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\t\t\t$val = stripslashes($val);\r\n\t\t\t$val = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $val);\r\n\t\t}\r\n\t\t$val = str_replace(\"&#032;\", \" \", $val);\r\n\t\t$val = str_replace(\"&\", \"&amp;\", $val);\r\n\t\t$val = str_replace(\"<!--\", \"&#60;&#33;--\", $val);\r\n\t\t$val = str_replace(\"-->\", \"--&#62;\", $val);\r\n\t\t$val = preg_replace(\"/<script/i\", \"&#60;script\", $val);\r\n\t\t$val = str_replace(\">\", \"&gt;\", $val);\r\n\t\t$val = str_replace(\"<\", \"&lt;\", $val);\r\n\t\t$val = str_replace('\"', \"&quot;\", $val);\r\n\t\t$val = str_replace(\"$\", \"&#036;\", $val);\r\n\t\t$val = str_replace(\"\\r\", \"\", $val); // Remove tab chars\r\n\t\t$val = str_replace(\"!\", \"&#33;\", $val);\r\n\t\t$val = str_replace(\"'\", \"&#39;\", $val); // for SQL injection security\r\n\r\n\t\t// Recover Unicode\r\n\t\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val);\r\n\t\t// Trying to fix HTML entities without ;\r\n\t\t$val = preg_replace(\"/&#(\\d+?)([^\\d;])/i\", \"&#\\\\1;\\\\2\", $val);\r\n\r\n\t\treturn $val;\r\n\t}", "function parse_clean_value($val)\n {\n \tif ( $val == \"\" )\n \t{\n \t\treturn \"\";\n \t}\n \n \t$val = str_replace( \"&#032;\", \" \", $this->txt_stripslashes($val) );\n \t\n \tif ( isset($this->vars['strip_space_chr']) AND $this->vars['strip_space_chr'] )\n \t{\n \t\t$val = str_replace( chr(0xCA), \"\", $val ); //Remove sneaky spaces\n \t}\n \t\n \t// As cool as this entity is...\n \t\n \t$val = str_replace( \"&#8238;\"\t\t, ''\t\t\t , $val );\n \t\n \t$val = str_replace( \"&\"\t\t\t\t, \"&amp;\" , $val );\n \t$val = str_replace( \"<!--\"\t\t\t, \"&#60;&#33;--\" , $val );\n \t$val = str_replace( \"-->\"\t\t\t, \"--&#62;\" , $val );\n \t$val = preg_replace( \"/<script/i\"\t, \"&#60;script\" , $val );\n \t$val = str_replace( \">\"\t\t\t\t, \"&gt;\" , $val );\n \t$val = str_replace( \"<\"\t\t\t\t, \"&lt;\" , $val );\n \t$val = str_replace( '\"'\t\t\t\t, \"&quot;\" , $val );\n \t$val = str_replace( \"\\n\"\t\t\t, \"<br />\" , $val ); // Convert literal newlines\n \t$val = str_replace( \"$\"\t\t\t\t, \"&#036;\" , $val );\n \t$val = str_replace( \"\\r\"\t\t\t, \"\" , $val ); // Remove literal carriage returns\n \t$val = str_replace( \"!\"\t\t\t\t, \"&#33;\" , $val );\n \t$val = str_replace( \"'\"\t\t\t\t, \"&#39;\" , $val ); // IMPORTANT: It helps to increase sql query safety.\n \t\n \t// Ensure unicode chars are OK\n \t\n \tif ( $this->allow_unicode )\n\t\t{\n\t\t\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Try and fix up HTML entities with missing ;\n\t\t\t//-----------------------------------------\n\n\t\t\t$val = preg_replace( \"/&#(\\d+?)([^\\d;])/i\", \"&#\\\\1;\\\\2\", $val );\n\t\t}\n \t\n \treturn $val;\n }", "function clean($value) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n if (!is_numeric($value)) $value = addslashes($value);\n return $value;\n}", "function clean_input( $value ) {\n if ( is_numeric( $value ) ) {\n return( $value );\n }\n // Strip slashes if necessary\n if ( get_magic_quotes_gpc( ) ) {\n $value = stripslashes( $value );\n }\n // Make sure no sql-dangerous code gets through\n $value = mysql_real_escape_string( $value );\n // Strip HTML tags, to be sure\n // May need another routine to allow input of HTML\n $value = strip_tags( $value );\n \n return( $value );\n }", "function parseCleanValue($v){\r\n\t\tif($v == \"\"){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$v = str_replace(\"&#032;\", \" \", $v);\r\n\t\t$v = str_replace(\"&\" , \"&amp;\" , $v);\r\n\t\t$v = str_replace(\"<!--\" , \"&#60;&#33;--\" , $v);\r\n\t\t$v = str_replace(\"-->\" , \"--&#62;\" , $v);\r\n\t\t$v = preg_replace(\"/<script/i\" , \"&#60;script\" , $v);\r\n\t\t$v = str_replace(\">\" , \"&gt;\" , $v);\r\n\t\t$v = str_replace(\"<\" , \"&lt;\" , $v);\r\n\t\t$v = str_replace(\"\\\"\" , \"&quot;\" , $v);\r\n\t\t$v = preg_replace(\"/\\n/\" , \"<br />\" , $v); // Convert literal newlines\r\n\t\t$v = preg_replace(\"/\\\\\\$/\" , \"&#036;\" , $v);\r\n\t\t$v = preg_replace(\"/\\r/\" , \"\" , $v); // Remove literal carriage returns\r\n\t\t$v = str_replace(\"!\" , \"&#33;\" , $v);\r\n\t\t$v = str_replace(\"'\" , \"&#39;\" , $v); // IMPORTANT: It helps to increase sql query safety.\r\n\t\t// Ensure unicode chars are OK\r\n\t\t$v = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $v);\r\n\t\t// Strip slashes if not already done so.\r\n\t\tif($this->get_magic_quotes){\r\n\t\t\t$v = stripslashes($v);\r\n\t\t}\r\n\t\t// Swap user entered backslashes\r\n\t\t$v = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $v);\r\n\t\treturn $v;\r\n\t}", "public function sanitize($value);", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "public function cleanValue($value)\n {\n $value = $this->toPhp($value);\n $this->validate($value);\n return $value;\n }", "public function cleanValue($value)\n\t\t{\n\t\t\tif ($value !== null)\n\t\t\t{\n\t\t\t\tif (is_string($value))\n\t\t\t\t\t$value = $this->convertToCurrentEncoding($value);\n\t\t\t\tif (get_magic_quotes_gpc())\n\t\t\t\t\t$value = stripslashes($value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}", "function replace_invalid_values($value,$opt){\n\n if(is_string($value)){\n $value = preg_replace(\"/&/\", \"&amp;\", $value);\n $value = preg_replace(\"/</\", \"&lt;\", $value);\n $value = preg_replace(\"/>/\", \"&gt;\", $value);\n $value = preg_replace(\"/\\\"/\", \"&quot;\", $value);\n $value = preg_replace(\"/\\'/\", \"&quot;\", $value);\n }\n return $value;\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "private function sanitiseValue($value)\n {\n // Handle poorly encoded documents. We always use UTF8\n $value = utf8_encode($value);\n\n // Remove the = and \" from a CSV value like =\"VALUE\", which can be used to trick\n // Excel into keeping numbers sanely.\n $value = preg_replace('/^=\"(.*)\"$/', '\\1', $value);\n\n // Trim whitespace and quotes from around values.\n $value = trim($value, \" \\t\\n\\r\\0\\x0B\\\"'\");\n\n return $value;\n }", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function sanitize($value)\n {\n }", "function clean($value = \"\") {\r\n $value = trim($value);\r\n $value = stripslashes($value);\r\n $value = strip_tags($value);\r\n $value = htmlspecialchars($value);\r\n \r\n\t\treturn $value;\t\t\r\n}", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "private function cleanValue($value) {\n if (is_array($value)) {\n foreach ($value as $key => $v) {\n $value[$key] = $this->cleanValue($v);\n }\n } else {\n if (strpos($value, ArrayHelper::PHP_CONTENT) === 0) {\n $value = substr($value, strlen(ArrayHelper::PHP_CONTENT));\n }\n }\n \n return $value;\n }", "protected function doClean( $value )\r\n {\r\n\r\n $minField = $this->getOption( 'min_field' );\r\n $maxField = $this->getOption( 'max_field' );\r\n\r\n $value[$minField] = $this->getOption( 'min')->clean( isset( $value[$minField] ) ? $value[$minField] : null );\r\n $value[$maxField] = $this->getOption( 'max')->clean( isset( $value[$maxField] ) ? $value[$maxField] : null );\r\n\r\n if ( $value[$minField] && $value[$maxField] )\r\n {\r\n $v = new sfValidatorSchemaCompare(\r\n $minField, sfValidatorSchemaCompare::LESS_THAN_EQUAL, $maxField,\r\n array( 'throw_global_error' => true ), array( 'invalid' => $this->getMessage( 'invalid' ) )\r\n );\r\n $v->clean( $value );\r\n }\r\n\r\n return $value;\r\n\r\n }", "function trim_value(&$value) \r\n { \r\n $value = trim($value); \r\n }", "function parseValue($value);", "public function sanitize($value)\n\t{\n\t\treturn null;\n\t}", "function sanitizeHTMLValue($value) \n{ \treturn (isset($value) ? trim(htmlentities(stripslashes($value), ENT_QUOTES, 'UTF-8')) : NULL);\n}", "function simpleCleanInput($input){\n\t\tif(!is_null($input)){\n\t\t\t$value = $input;\n\t\t\t$value = @strip_tags($value);\t\n\t\t\t$value = @stripslashes($value);\n\t\t\t$value = trim($value);\n\t\t\tif(!empty($value)){\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function clean_saved_value() {\n\t\tif ( $this->saved_value !== '' ) {\n\t\t\tif ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) {\n\t\t\t\tFrmAppHelper::unserialize_or_decode( $this->saved_value );\n\t\t\t}\n\n\t\t\tif ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) {\n\t\t\t\t$this->saved_value = '';\n\t\t\t}\n\t\t}\n\t}", "public function sanitize ( $mValue )\n {\n return $mValue;\n }", "function cleanVal ($val)\n{\n return encodeURI($val);\n}", "private static function sanitize(&$value, $regexp, $defaultvalue)\n {\n if (self::is_assoc($value)) {\n foreach (array_keys($value) as $key) {\n self::sanitize($value[$key], $regexp, $defaultvalue);\n }\n } elseif (is_array($value)) {\n for ($i=0;$i<count($value);$i++) {\n self::sanitize($value[$i], $regexp, $defaultvalue);\n }\n } elseif (is_string($value)) {\n $value = trim($value);\n\n if ($value == 'null') {\n // exception for javascript serialization of null-values\n $value = null;\n } elseif ($regexp && !preg_match($regexp, $value)) {\n $value = $defaultvalue;\n }\n }\n }", "public function sanitize($value)\r\n\t{\r\n\t\tarray_walk(\r\n\t\t\t$value,\r\n\t\t\tfunction(&$value) {\r\n\t\t\t\t$value=trim($value);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\treturn $value;\r\n\t}", "public function sanitize($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_STRING);\n\t}" ]
[ "0.7048118", "0.69167346", "0.6893351", "0.6892381", "0.68438137", "0.6841219", "0.67210394", "0.66282237", "0.6612994", "0.660389", "0.6512946", "0.65092206", "0.6399245", "0.6399245", "0.63564014", "0.6351395", "0.6295476", "0.62567157", "0.62445295", "0.62093127", "0.6199125", "0.61650693", "0.61595124", "0.6146891", "0.61421895", "0.6136588", "0.6132139", "0.61262155", "0.6125412", "0.61190885" ]
0.7183627
0
Get form page actions block.
protected function getFormPageActionsBlock() { return $this->blockFactory->create( \Magento\Backend\Test\Block\FormPageActions::class, ['element' => $this->_rootElement->find($this->newAttributeBlock, Locator::SELECTOR_XPATH)] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormAction() { return $this->_formAction; }", "public function getFormActions()\n {\n return $this->form->getActions();\n }", "public function action()\n {\n return $this->_actions;\n }", "public function getFrontEndActions();", "public function Admin_Action_ShowBlockForm() {\n $ssf = new SendStudio_Functions ( );\n $action = 'new';\n $GLOBALS ['blockid'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? $_GET ['id'] : md5(rand ( 1, 100000000 ));\n $GLOBALS ['tagid'] = (isset ( $_GET ['tagId'] ) && $_GET ['tagId'] > 0) ? $_GET ['tagId'] : 0;\n $GLOBALS ['blockaction'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? 'edit' : 'new';\n $GLOBALS ['BlockEditor'] = $ssf->GetHTMLEditor ( '', false, 'blockcontent', 'exact', 260, 630 );\n $GLOBALS ['CustomDatepickerUI'] = $this->template_system->ParseTemplate('UI.DatePicker.Custom_IEM', true);\n $this->template_system->ParseTemplate ( 'dynamiccontentblocks_form' );\n }", "function actions() {\n return array(\n 'block' => array(\n 'class' => 'application.modules.admin.components.actions.BlockAction',\n 'modelClass' => 'Page',\n 'message_block' => Yii::t('infoMessages', 'Контент разблокирован!'),\n 'errorMessage_block' => Yii::t('infoMessages', 'Произошла ошибка при разблокировании контента!'),\n 'message_unBlock' => Yii::t('infoMessages', 'Контент заблокирован!'),\n 'errorMessage_unBlock' => Yii::t('infoMessages', 'Произошла ошибка при блокировании контента!'),\n ),\n 'markAsDeleted' => array(\n 'class' => 'application.modules.admin.components.actions.MarkAsDeletedAction',\n 'modelClass' => 'Pages',\n 'message_mark' => Yii::t('infoMessages', 'Страница удалена!'),\n 'errorMessage_mark' => Yii::t('infoMessages', 'Произошла ошибка при удалении страницы!'),\n )\n );\n }", "public function getCMSActions()\n {\n if (Permission::check('ADMIN') || Permission::check('THEME_CONFIG_PERMISSION')) {\n $actions = new FieldList(\n FormAction::create('save_templateconfig', _t('TemplateConfig.SAVE', 'Save'))\n ->addExtraClass('btn-primary font-icon-save')\n );\n } else {\n $actions = FieldList::create();\n }\n $this->extend('updateCMSActions', $actions);\n\n return $actions;\n }", "protected function getActions() {}", "function getFormAction()\n {\n return $this->getAttribute(\"formaction\");\n }", "public function FormAction()\n {\n if ($this->formActionPath) {\n return $this->formActionPath;\n }\n\n // Get action from request handler link\n return $this->getRequestHandler()->Link();\n }", "public function get_implemented_form_actions()\n {\n $actions = new TableFormActions(__NAMESPACE__, self::TABLE_IDENTIFIER);\n \n if ($this->get_component()->is_allowed(WeblcmsRights::EDIT_RIGHT))\n {\n $actions->add_form_action(\n new TableFormAction(\n $this->get_component()->get_url(\n array(Manager::PARAM_ACTION => Manager::ACTION_DOWNLOAD_SUBMISSIONS)), \n Translation::get('DownloadSubmissionsSelected'), \n false));\n }\n \n return $actions;\n }", "public function getActions(){\r\n\t\t\r\n\t\t\treturn $this->_actions;\r\n\t\t}", "function getAction () {return $this->getFieldValue ('action');}", "public function display_page_actions() {\n\t\tprintf(\n\t\t\t'<form action=\"%s\" method=\"post\">',\n\t\t\tesc_url( admin_url( 'admin-post.php?action=' . self::POST_ACTION_ID ) )\n\t\t);\n\n\t\techo '<input type=\"hidden\" name=\"page\" value=\"custom-table\"/>';\n\t\twp_nonce_field( self::POST_ACTION_ID );\n\n\t\techo '<p class=\"submit\">';\n\t\tsubmit_button(\n\t\t\tesc_html__( 'Add Entry', 'autowpdb-example-plugin' ),\n\t\t\t'primary',\n\t\t\t'add_entry',\n\t\t\tfalse\n\t\t);\n\t\tif ( ! empty( $this->table_contents ) ) {\n\t\t\techo ' ';\n\t\t\tsubmit_button(\n\t\t\t\tesc_html__( 'Delete Oldest Entry', 'autowpdb-example-plugin' ),\n\t\t\t\t'',\n\t\t\t\t'delete_entry',\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\t\techo '</p>';\n\t\techo '</form>';\n\t}", "public Function getActions(){\n\t\treturn $this->actions;\n\t}", "function actions()\n {\n return[];\n }", "public function getActions();", "public function getActions();", "public function getActions() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'action'=>\"nav_primary_client\",\n\t\t\t\t'uri'=>\"plugin/knowledgebase/client_main/\",\n\t\t\t\t'name'=>Language::_(\"KnowledgebasePlugin.client_main\", true)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'action' => \"nav_secondary_staff\",\n\t\t\t\t'uri' => \"plugin/knowledgebase/admin_main/\",\n\t\t\t\t'name' => Language::_(\"KnowledgebasePlugin.admin_main\", true),\n\t\t\t\t'options' => array('parent' => \"tools/\")\n\t\t\t)\t\t\t\n\t\t);\n\t}", "public function getActions() {\n\n\t}", "protected function getFormAction(){\n return (\n (\n $this->_action!==NULL &&\n is_string($this->_action) &&\n strlen(trim($this->_action))\n )\n ?$this->_action\n :$this->setFormAction()\n );\n }", "public function getActions() {\n\t\treturn array(\n\t\t\t// Client Nav\n\t\t\tarray(\n\t\t\t\t'action'=>\"widget_client_home\",\n\t\t\t\t'uri'=>\"plugin/client_notices/client_widget/\",\n\t\t\t\t'name'=>Language::_(\"ClientNoticesPlugin.widget_client_home.index\", true)\n\t\t\t),\n\t\t\t// Staff Nav\n array(\n 'action' => \"nav_secondary_staff\",\n 'uri' => \"plugin/client_notices/admin_main/index/\",\n 'name' => Language::_(\"ClientNoticesPlugin.nav_secondary_staff.index\", true),\n 'options' => array(\n\t\t\t\t\t'parent' => \"clients/\"\n\t\t\t\t)\n ),\n\t\t\t// Client Profile Action Link\n\t\t\tarray(\n\t\t\t\t'action' => \"action_staff_client\",\n\t\t\t\t'uri' => \"plugin/client_notices/admin_main/add/\",\n\t\t\t\t'name' => Language::_(\"ClientNoticesPlugin.action_staff_client.add\", true),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'class' => \"invoice\"\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function pageAction()\n {\n return $this->indexAction();\n }", "public function getActions()\n {\n return $this->actions;\n }", "public function getActions()\n {\n return $this->actions;\n }", "public function getActions()\n {\n return $this->actions;\n }", "public function get_actions(): array;", "protected function createEditPageAction() {\n\t\t$noJsEdit = $this->getMFConfig()->get( 'MFAllowNonJavaScriptEditing' );\n\t\t$additionalClass = $noJsEdit ? ' nojs-edit' : '';\n\n\t\treturn [\n\t\t\t'id' => 'ca-edit',\n\t\t\t'text' => '',\n\t\t\t'itemtitle' => $this->msg( 'mobile-frontend-pageaction-edit-tooltip' ),\n\t\t\t'class' => MobileUI::iconClass( 'edit-enabled', 'element' . $additionalClass ),\n\t\t\t'links' => [\n\t\t\t\t'edit' => [\n\t\t\t\t\t'href' => $this->getTitle()->getLocalURL( [ 'action' => 'edit', 'section' => 0 ] )\n\t\t\t\t],\n\t\t\t],\n\t\t\t'is_js_only' => !$noJsEdit\n\t\t];\n\t}", "public function getAction()\n {\n return $this->m_action;\n }", "public function getActions()\n\t{\n\t\treturn $this->actions;\n\t}" ]
[ "0.6527125", "0.6358015", "0.63297474", "0.6216374", "0.6193797", "0.611197", "0.599742", "0.5904043", "0.5853768", "0.5814876", "0.5798893", "0.5770226", "0.5760509", "0.5755289", "0.56951076", "0.56939214", "0.5667278", "0.5667278", "0.56645757", "0.565387", "0.5625051", "0.56185395", "0.5610488", "0.56044734", "0.56044734", "0.56044734", "0.55930156", "0.5571818", "0.5551766", "0.5540417" ]
0.81792843
0
Creates a reset database form. Creates a form to reset the database. The form contains a reset button and a message area if reset of database was successful or not.
public function createResetNewsBlogsDbForm($title, $message=null) { if ($this->isAdminMode()) { $output = <<<EOD <form method=post> <fieldset> <legend>$title</legend> <p>Vill du återställa nyhetsdatabasen till dess grundvärden?<p> <p>All övrig data vill bli förlorad!<p> <p><input type='submit' name='reset' value='Återställ'/></p> <output>Meddelande: {$message}</output> </fieldset> </form> EOD; } else { $output = "<p>Du måste vara inloggad som admin för att kunna sätta databasen till dess grundvärden!</p>"; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetForm()\n\t{\n\t\tparent::resetForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}", "public function resetActionPost(): object\n {\n // Framework variables\n $dbConfig = $this->app->configuration->load(\"database\");\n $request = $this->app->request;\n\n // Verifies if reset form was submitted\n if ($request->getPost(\"reset\") == \"Reset database\") {\n $output = $this->content->resetDatabase($dbConfig);\n }\n\n // Redirects\n return $this->app->response->redirect(\"admin/reset\", $output);\n }", "public function resetDatabase(): void\n {\n $this->exec('DELETE FROM fo_forms');\n $this->exec('ALTER TABLE fo_forms AUTO_INCREMENT=1000');\n }", "public function resetActionPost()\n {\n $this->app->session->start();\n\n // Restore the database to its original settings\n $file = ANAX_INSTALL_PATH . \"/sql/movie/setup.sql\";\n $mysql = \"mysql\";\n $output = null;\n $databaseConfig = $this->app->configuration->load(\"database\")[\"config\"];\n\n // Extract hostname and databasename from dsn\n $dsnDetail = [];\n preg_match(\"/mysql:host=(.+);dbname=([^;.]+)/\", $databaseConfig[\"dsn\"], $dsnDetail);\n $host = $dsnDetail[1];\n $database = $dsnDetail[2];\n $login = $databaseConfig[\"username\"];\n $password = $databaseConfig[\"password\"];\n\n if ($this->app->request->getPost(\"reset\")) {\n $command = \"$mysql -h{$host} -u{$login} -p{$password} $database < $file 2>&1\";\n $output = [];\n $status = null;\n exec($command, $output, $status);\n $output = \"<p>The command was: <code>$command</code>.<br>The command exit status was $status.\"\n . \"<br>The output from the command was:</p><pre>\"\n . print_r($output, 1);\n $this->app->session->set(\"output\", $output);\n }\n\n\n return $this->app->response->redirect(\"movie/reset\");\n }", "public function resetAction()\n {\n // STAGE 3: Choose, create, and optionally update models using business logic.\n $registry = Zend_Registry::getInstance();\n $db = $registry['db'];\n // if the DB is not configured to handle \"large\" queries, then we need to feed it bite-size queries\n $filename = $registry['configDir'] . 'zfdemo.' . $registry['config']->db->type . '.sql';\n $statements = preg_split('/;\\n/', file_get_contents($filename, false));\n foreach ($statements as $blocks) {\n $sql = '';\n foreach (explode(\"\\n\", $blocks) as $line) {\n if (empty($line) || !strncmp($line, '--', 2)) {\n continue;\n }\n $sql .= $line . \"\\n\";\n }\n $sql = trim($sql);\n if (!empty($sql)) {\n $db->query($sql);\n }\n }\n // STAGE 4: Apply business logic to create a presentation model for the view.\n $this->view->filename = $filename;\n // STAGE 5: Choose view and submit presentation model to view.\n $this->renderToSegment('body');\n }", "function create_db_form()\n {\n //returning from form\n if (!empty($_POST)){\n $dbname=$_POST['dbname'];\n\n if ($this->dbforge->create_database($dbname))\n {\n $s='Database created!';\n\n $s.='SUCCESSFULLY CREATED NEW DATA BASE WITH NAME '.$dbname;\n $s.='<hr />';\n $s.=anchor('admin/dbutil/create-db','click here to create another one');\n $s.='<hr />';\n }\n }\n else\n {\n $dbname='database name default';\n\n $this->load->helper('form');\n $s=form_open('admin/dbutil/create-db/1');\n $data = array(\n 'name' => 'dbname',\n 'id' => 'dbname',\n 'value' => $dbname,\n 'maxlength' => '100',\n 'size' => '50',\n 'style' => 'width:50%',\n );\n $s.=form_input($data);\n $data = array(\n 'name' => 'button',\n 'id' => 'button',\n 'value' => 'true',\n 'type' => 'submit',\n 'content' => 'create'\n );\n $s.=form_button($data);\n $s.=form_close();\n $s.='<hr/>';\n }\n\n return $s;\n }", "public function resetForm() {\n\n\t\tforeach ( $this->getOptionsList() as $element ) {\n\t\t\t$element->reset();\n\t\t}\n\t\t$this->setLastAction( self::ACTION_RESET );\n\n\t\t$custom_style = new Custom_CSS_Style();\n\t\t$custom_style->reinit();\n\t}", "public function resetAction()\n\t{\n\t\t// validate that we have the necessary unique_id\n\t\tif (empty($this->_params['id']) || strlen($this->_params['id']) != 32) {\n\t\t\t$this->_helper->FlashMessenger(array('error' => 'You do not have access to view the previous page. Please verify your URL is correct and try again.'));\n\t\t\t$this->_redirect('/admin/');\n\t\t}\n\n\t\t// validate that the unique_id exists and hasn't expired\n\t\t$AuthUser = new Auth_Model_User();\n\t\t$status_code = $AuthUser->reset_password($this->_params['id']);\n\t\t$this->_validateStatusCode($status_code);\n\n\t\t// handle login request\n\t\t$request = $this->getRequest();\n\t\tif ($request->isPost()) {\n\n\t\t\t// ensure we have a valid token\n\t\t\tif ($this->isCsrfTokenValid()) {\n\t\t\t\t// validate the return code\n\t\t\t\t$status_code = $AuthUser->reset_password($this->_params['id'], $request->getPost());\n\t\t\t\t$this->_validateStatusCode($status_code);\n\n\t\t\t\t// on success\n\t\t\t\t$this->_helper->FlashMessenger(array('success' => 'Your password has successfully been reset.'));\n\t\t\t\t$this->_redirect('/admin/');\n\t\t\t} else {\n\t\t\t\t$this->_helper->FlashMessenger(array('error' => 'You session has expired.'));\n\t\t\t}\n\n\t\t}\n\n\t\t$this->view->id = $this->_params['id'];\n\t\t$this->view->title = \"Reset Password\";\n\t\t$this->disableLayout();\n\t}", "public function generateNewsBlogsAdminForm()\n {\n $form = null;\n if ($this->isUserMode()) {\n\n $resetDbButton = null;\n if ($this->isAdminMode()) {\n $resetDbButton =<<<EOD\n <button type=\"button\" onClick=\"parent.location='content_reset.php'\">Återställ databas</button>\nEOD;\n }\n\n $form .= <<<EOD\n <form class='news-blogs-admin-form'>\n <fieldset>\n <legend>Administrera nyheter</legend>\n <button type=\"button\" onClick=\"parent.location='content_create.php'\">Lägg in ny nyhet</button>\n {$resetDbButton}\n </fieldset>\n </form>\nEOD;\n }\n\n return $form;\n\n }", "public function resetAction()\n\t{\n\t\t$this->view->headTitle(\"Reset your password\");\n\t\n\t\t//If form is submitted, reset the password\n\t\tif($this->getRequest()->isPost()){\n\t\t\n\t\t\t//Validation\n\t\t\t//Password must be between 6-20 characters\n\t\t\t$valid_pswd = new Zend_Validate_StringLength(6, 20);\n\t\t\tif(! $valid_pswd->isValid($this->_request->getPost('password'))){\n\t\t\t\t$this->view->errors[] = \"Password must be at least 6 characters.\";\n\t\t\t}\n\t\t\t\n\t\t\t//Password must match\n\t\t\tif($this->_request->getPost('password') != \n\t\t\t $this->_request->getPost('password2')){\n\t\t\t\t$this->view->errors[] = \"Your passwords do not match.\";\n\t\t\t}\n\t\t\t\n\t\t\t//No errors, so update the password\n\t\t\tif(count($this->view->errors) == 0){\n\t\t\t\t\n\t\t\t\t//Find user row to update via registration_key column\n\t\t\t\t$user = new Default_Model_User();\n\t\t\t\t$resultRow = $user->getUserByRegkey($this->_request->getPost('key'));\n\t\t\t\t\n\t\t\t\tif(count($resultRow) == 1){\n\t\t\t\t\t$resultRow->password = md5($this->_request->getPost('password'));\n\t\t\t\t\t$resultRow->save();\n\t\t\t\t\t$this->view->updated = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else{ //Errors, so pass key back to form\n\t\t\t\t$this->view->success = 1;\n\t\t\t\t$this->view->key = $this->_request->getPost('key');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t// User has clicked the emailed password recovery link. Find the user\n\t\t\t// using the recovery key, and prepare the password reset form\n\t\t\t\n\t\t\t//Retrieve key from url\n\t\t\t$recoveryKey = $this->getRequest()->getParam('key');\n\t\t\t\n\t\t\t$user = new Default_Model_User();\n\t\t\t$resultRow = $user->getUserByRegkey($recoveryKey);\n\t\t\t\n\t\t\t\tif(count($resultRow)){\n\t\t\t\t\t$resultRow->save();\n\t\t\t\t\t$this->view->success = 1;\n\t\t\t\t\t$this->view->key = $recoveryKey;\n\t\t\t\t} else{\n\t\t\t\t\t$this->view->errors[] = \"Unable to locate password recovery key.\";\n\t\t\t\t}\n\t\t\n\t\t} //end else\n\t}", "public function showResetForm()\n {\n // if user is logged in, do not let him access this page\n if( Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $userID = SCMUtility::cleanText($_GET['userID']);\n $token = SCMUtility::stripTags($_GET['token']);\n\n if( ! $this->isOnResetPasswordSession($token) )\n {\n $this->resetPasswordSessionDeactivate();\n\n SCMUtility::setFlashMessage('Invalid Token or token has expired!');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $this->resetPasswordSessionDeactivate();\n\n View::make('templates/front/reset-password-form.php',compact('userID'));\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "public function getFormId() {\n return 'tfa_settings_reset_form';\n }", "public function create()\n\t{\n\t\t//creating the view to allow users to reset their password\n\t\treturn View::make('password_resets.create');\n\t}", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "function dblog_clear_log_form($form) {\n $form['dblog_clear'] = array(\n '#type' => 'fieldset',\n '#title' => t('Clear log messages'),\n '#description' => t('This will permanently remove the log messages from the database.'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['dblog_clear']['clear'] = array(\n '#type' => 'submit',\n '#value' => t('Clear log messages'),\n '#submit' => array('dblog_clear_log_submit'),\n );\n\n return $form;\n}", "public function CreateForm();", "public function createForm();", "public function createForm();", "public function p_reset() {\n\n\t\tforeach($_POST as $key => $value){\n\t\t\tif((empty($value)) || (!$value) || (trim($value) == \"\") ){\n\t\t\t\t# Send them back to the login page\n\t\t\t\tRouter::redirect(\"/users/resetp/error\");\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t# Encrypt the password \n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n\t\tDB::instance(DB_NAME)->update(\"users\", $_POST, 'WHERE user_id = '.$this->user->user_id);\n\n\t\t# Send them back to the main index.\n\t\tRouter::redirect('/users/login');\n\n\t}", "public function new () : void\n {\n // add a user\n $ResetUserPassword = new ResetUserPassword($this->session, $this->router);\n $ResetUserPassword->new();\n\n // form\n $form = new ForgetForm($_POST, $ResetUserPassword->getErrors());\n\n // url of the current page\n $url = $this->router->url(\"password_new\");\n\n // flash message\n $flash = $this->session->generateFlash();\n\n $title = App::getInstance()->setTitle(\"Forget\")->getTitle();\n $bodyClass = strtolower($title);\n\n\n $this->render('security/password/new', $this->router, $this->session, compact('form', 'url', 'title', 'bodyClass', 'flash'));\n }", "public function setup($form)\n {\n session_unset();\n \n $name = $form['name'];\n $desc = $form['desc']; \n \n $dbname = str_replace(' ', '', $name);\n\n $newdb = new mysqli($this->config['db_addr'], $this->config['db_user'], $this->config['db_pass']);\n \n $q = \"drop database if exists \".$dbname.\";\";\n $newdb->query($q);\n \n $q = \"create database \".$dbname.\";\"; \n $newdb->query($q);\n \n $newdb->close();\n \n // overwrite config\n $this->change_database($dbname);\n \n // create new tables\n $this->fill_db();\n \n // create blank timeslots (could define default times)\n $this->create_times(\"2017-05-15 12:00:00\", \"2017-08-15 12:00:00\");\n \n $q = $this->db->prepare(\"INSERT INTO Business (businessName, businessDesc) VALUES (?, ?)\");\n $q->bind_param('ss', $name, $desc);\n $q->execute();\n \n $dummy_ph = \"0\";\n $dummy_addr = \"nowhere\";\n \n $q = $this->db->prepare(\"INSERT INTO BusinessOwner (fName, lName, email, password, address, phoneNo) VALUES (?, ?, ?, ?, ?, ?)\");\n $q->bind_param('ssssss', $form['fname'], $form['lname'], $this->config['admin'], $this->config['pass'], $dummy_addr, $dummy_ph);\n $q->execute();\n\n unset($_POST);\n \n $masterdb = new mysqli($this->config['db_addr'], $this->config['db_user'], $this->config['db_pass'], \"master\");\n\n $q = $masterdb->prepare(\"INSERT INTO business (dbname, name) VALUES (?, ?)\");\n $q->bind_param('ss', $dbname, $name);\n $q->execute();\n\n $this->redirect(\"login.php\");\n }", "public function reset()\n {\n return view('admin.root.reset');\n }", "public function passwordformAction(){\n\t\t/*if($this->_request->getParam('error')){\n\t\t\t$this->view->assign('messages',$this->_messages->getMessages());\n\t\t}*/\n\t\t\t\t\n\t\t$form = new Bel_Forms_Builder('passreset_form','/usermanagement/profile/savepassword');\n\t\t$this->view->assign('form',$form);\n\t\t$this->view->display('forms/ajax.tpl');\t\t\n\t}", "public function resetp($error = NULL){\n\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_users_resetp');\n\t\t$this->template->title = \"Reset\";\n\t\t\n\t\t# Pass data to the view\n\t\t$this->template->content->error = $error;\n\n\t\t# Render template\n\t\techo $this->template;\n\t}", "function sexy_reset_tag($value = 'Reset', $options = array())\n{\n return sexy_button_to_function( $value, \"var form = this; \".\n \"while(null != (form = form.parentNode)) if( form.nodeName == 'FORM') \".\n \"if( (form.onreset && form.onreset()) || (!(form.onreset)) ) form.reset();\",\n $options );\n}", "public function resetActionGet()\n {\n $title = \"Reset the database\";\n $output = $this->app->session->get(\"output\") ?: \" \";\n\n $this->app->session->destroy();\n\n $this->app->page->add(\"movie/reset\", [\n \"output\" => $output,\n ]);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }", "public function echoDataBase()\n\t\t{\n\t\t\t$query = \"SELECT * FROM `BreakingNews`\";\n\n\t\t\t$result = $this->connection->query($query);\n\t\t\techo '<section>';\n\t\t\techo '<form action=\"\" method=\"post\" id=\"form1\">';\n\t\t\t$i = 0;\n\t\t\twhile ($row = $result->fetch_assoc())\n\t\t\t{\n\n\t\t\t\tforeach($row as $newsStory) {\n\t\t\t\t\techo '<button class=\"storyNum\" type=\"button\" disabled>'.$i.'</button>';\n\t\t\t\t\techo '<textarea name=\"'.$i.'\" class=\"options\" rows=\"4\" cols=\"100\" maxlength=\"200\">'.$newsStory.'</textarea><br/>';\n\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo '<p>';\n\t\t\techo '<label for=\"numStory\" class=\"label\">Elegir que noticia quieres borrar: </label>';\n\t\t\techo '<input type=\"text\" id=\"numStory\" class=\"field\" name=\"numStory\" value=\"\" size=\"4\" placeholder=\"1\"/>';\n\t\t\techo '</p>';\n\t\t\techo '<p>';\n\t\t\techo '<small class=\"notification\">Solo se puede añadir una noticia a la vez.<br/>Si quiere que las noticias se guarden usar el boton de modificación</small>';\n\t\t\techo '</p>';\n\t\t\techo '<input type=\"image\" onclick=\"submitForm(\\'php/insertStory.php\\')\" src=\"./img/add.jpg\" alt=\"Añadir Noticia\" title=\"Añadir Noticia\" name=\"add\">';\n\t\t\techo '<input type=\"image\" onclick=\"submitForm(\\'php/modifyStory.php\\')\" src=\"./img/modify.png\" alt=\"Modificar Noticia\" title=\"Modificar Noticia\" name=\"modify\">';\n\t\t\techo '<input type=\"image\" onclick=\"submitForm(\\'php/deleteStory.php\\')\" src=\"./img/cancel.jpg\" alt=\"Eliminar Noticia\" title=\"Eliminar Noticia\" name=\"remove\">';\n\n\t\t\techo'<button type=\"button\" id=\"FinishButton\" onclick=\"finalize()\"/>Finalizar</button>';\n\n\t\t\techo '</section>';\n\t\t\techo '</form>';\n\n\t\t}", "function DBreset()\n{\n\tlocation.replace(\"reset.php\");\n}" ]
[ "0.6050242", "0.6033843", "0.6029044", "0.5998147", "0.59335464", "0.57948536", "0.5757854", "0.57460815", "0.57289606", "0.57036906", "0.56775093", "0.5638375", "0.55843174", "0.5541784", "0.554089", "0.5525237", "0.5503507", "0.5477007", "0.5477007", "0.54608816", "0.54547036", "0.544577", "0.54305905", "0.5422083", "0.5414756", "0.5413987", "0.53838176", "0.53774035", "0.5332748", "0.532947" ]
0.6306356
0
Helper function to prevent published to be update at edit of content. Checks if the operation is a create or edit. If the operation is to edit the content, it sets readonly if the published parameter exists to prevent if the parameter is already set when edit the content.
private function preventPublishedBeUpdatedAtEdit($params, $isCreate) { $readonly = null; if (!$isCreate) { if (isset($params['published']) && !empty($params['published'])) { $readonly = "readonly"; } } return $readonly; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isReadOnly() {}", "public function isReadOnly() {}", "public function isReadOnly() {}", "public function isEditable($operation = OperationTypes::OP_UPDATE, $ignore_op = FALSE);", "public function isReadOnly();", "public function isReadOnly();", "public function isReadOnly();", "public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isEditOnlyMode();", "protected function canEdit() {}", "public function isReadOnly()\n {\n }", "abstract function allowEditAction();", "public function isModifyProtected() {\n\t\treturn $this->getModifyProtected();\n\t}", "public function isReadOnly(): bool;", "public function isReadOnly() {\n\t\treturn false;\n\t}", "public function just_editing_post() {\n\t\tdefine('suppress_newpost_action', TRUE);\n\t}", "public function _addOrEdit() {\n\t\tif($this->getRequest()->getParam('id')) { return true; } else { return false; }\n\t}", "public function canBeEdited()\n {\n return false;\n }", "public function getReadOnlyFlag() {}", "public function isReadonly()\n {\n return false;\n }", "function wp_readonly($readonly_value, $current = \\true, $display = \\true)\n {\n }", "public function readOnly()\n {\n return !$this->_allowModifications;\n }", "public function define_readonly($p_readonly)\r\n\t\t{\r\n\t\t\t$this->c_readonly = $p_readonly;\r\n\t\t}", "public function canPublish($member = null)\n {\n return $this->owner->isEditable();\n }", "public function isEditAction() {}", "public function setReadOnly($flag);", "public function can_edit() {\n return true;\n }", "public function isReadonly(): bool;", "private function _validateModifiable()\n {\n if(!($this->_getDataSource() instanceof wCrudAdapter))\n {\n throw new Exception('Object is read-only.');\n }\n }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }" ]
[ "0.62388414", "0.62388414", "0.62378716", "0.6223756", "0.6202735", "0.6202735", "0.6202735", "0.6053376", "0.5953704", "0.5887115", "0.5856313", "0.57913524", "0.57852364", "0.57243407", "0.57008815", "0.56343454", "0.56305", "0.56158626", "0.56027496", "0.55959105", "0.5585979", "0.55659455", "0.5563752", "0.5541839", "0.5527474", "0.5507234", "0.5505391", "0.54992497", "0.54809564", "0.54736906" ]
0.66084963
0
Helper function to generate radio buttons for news blogs categories. Creates radio buttons for all available news blogs categories found in database. Has function to generate radio buttons, where the radio button is already set, for all categories connected to the news blog.
private function generateCategoryRadioButtons($newsBlogCategory=null) { $radioButtons = null; $categories = $this->fetchAllCategories(); if (!isset($newsBlogCategory)) { $newsBlogCategory = end($categories); } foreach ($categories as $key => $category) { if (strcmp($category, $newsBlogCategory) === 0) { $radioButtons .= "<label><input type='radio' name='category' value='{$category}' checked='checked' />{$category}</label>\n"; } else { $radioButtons .= "<label><input type='radio' name='category' value='{$category}' />{$category}</label>\n"; } } return $radioButtons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRadios($hiddenName, $outerIndex)\n{\n\t// Loop through and generate all radio buttons, giving unique names \n\tfor($i = 1; $i <= 4; $i++)\n\t{\n\t\t$id = \"radio\" . $outerIndex . $i;\n\t\t$name = \"radio\" . $outerIndex;\n\t\t\n\t\tif(isset($_REQUEST[$name]))\n\t\t\t$currentSelected = $_REQUEST[$name];\n\t\telse\n\t\t\t$currentSelected = \"\";\n\t\t\n\t\techo \"<p>\\n\";\n\t\t$checked = (strcmp($currentSelected, $id) == 0) ? \"checked\" : \"\";\n\t\techo \"<input type=\\\"radio\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$id\\\" $checked>\\n\";\n\t\t\n\t\tif($i == 1)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/egypt.jpg\\\"/>\\n\";\n\t\telse if($i == 2)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/disney.jpg\\\"/>\\n\";\n\t\telse if($i == 3)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/theater_masks.jpg\\\"/>\\n\";\n\t\telse\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/wookie.jpg\\\"/>\\n\";\n\t\t\n\t\techo \"</p>\\n\";\n\t}\n}", "private function generateFilterTypeCheckBoxes($newsBlogFilterType=null)\n {\n $checkBox = null;\n $filterTypes = $this->fetchFilterTypes();\n foreach ($filterTypes as $key => $filterType) {\n if ($this->shouldSetBoxBeSet($newsBlogFilterType, $filterType)) {\n $checkBox .= \"<label><input type='checkbox' name='filter[]' value='{$filterType}' checked='checked' />{$filterType}</label>\\n\";\n } else {\n $checkBox .= \"<label><input type='checkbox' name='filter[]' value='{$filterType}' />{$filterType}</label>\\n\";\n }\n }\n\n return $checkBox;\n }", "function radioButtonList($name,$values,$labels,$selected=\"\",$ids)\n\t{\n\t\t$name = $name;\n\n\t\t$str = '<div class=\"radioButton-list\" >';\n\n\t\tfor($i = 0; $i < sizeof($values); $i++){\n\t\t\tif($values[$i] == $selected){\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], $values[$i], $ids[$i], $labels[$i]);\n\t\t\t}else{\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], \"\", $ids[$i], $labels[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$str .= '</div>';\n\n\t\treturn $str;\n\t}", "public static function listCategoriesCheckboxes($categoryArr)\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_categories where published = '1'\");\n $count_categories = $db->loadResult();\n $parentArr = self::loadCategoryBoxes($categoryArr);\n ob_start();\n ?>\n <input type=\"checkbox\" name=\"check_all_cats\" id=\"check_all_cats\" value=\"1\" checked\n onclick=\"javascript:checkCats()\"/>&nbsp;&nbsp;<strong><?php echo JText::_('OS_CATEGORIES')?></strong>\n <input type=\"hidden\" name=\"count_categories\" id=\"count_categories\" value=\"<?php echo $count_categories?>\"/>\n <BR/>\n <?php\n for ($i = 0; $i < count($parentArr); $i++) {\n echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $parentArr[$i];\n echo \"<BR />\";\n }\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }", "function generate_category_content()\n {\n global $conf, $page;\n\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1 )\n {\n $this->build_nav_bar(CWEEK, array()); // week nav bar 1-53\n }\n if ( count($page['chronology_date'])==2 )\n {\n $this->build_nav_bar(CDAY); // days nav bar Mon-Sun\n }\n $this->build_next_prev();\n return false;\n }", "public function listarNiveles () {\n\t $this->listarCursos(); // llama a la función que lista los cursos\n\t $cursosDados = array_unique($this->listaDeCursos['nivel']);\n\t $this->listaDeNiveles[\"nivel\"] = array_filter($cursosDados, function($var) {return !is_null($var); });\n\t // $this->listaDeNiveles[\"nivel\"] = array_filter(array_unique($this->listaDeCursos['nivel']), function($value) { return $value !== ''; })\t \n\t sort($this->listaDeNiveles[\"nivel\"]);\n\t foreach($this->listaDeNiveles[\"nivel\"] as $clave => $valor) {\n\t\t $this->listaDeNiveles[\"input\"][$clave]=\n\t\t \t '<input type=\"radio\" id=\"'.$valor.'\" name=\"niveles\"><label for=\"'.$valor.'\">'.$valor.'</label>';\n\t }\n\t}", "protected function createRadioList($config)\n {\n if (empty($config['tmpl'])) {\n $config['tmpl'] = ARCH_PATH.'/theme/form/radiolist.php';\n }\n $config['class'] = empty($config['class']) ? \n 'radio' : $config['class'];\n return $this->createCheckList($config);\n }", "function scrappy_get_radios($id) {\n $args = array(\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'category' => '',\n 'category_name' => '',\n 'orderby' => 'meta_value',\n 'order' => 'DESC',\n 'include' => '',\n 'exclude' => '',\n 'meta_key' => '',\n 'meta_value' => '',\n 'post_type' => 'radio',\n 'post_mime_type' => '',\n 'post_parent' => '',\n 'author'\t => '',\n 'author_name'\t => '',\n 'post_status' => 'publish',\n 'suppress_filters' => true,\n /*'tax_query' => array(\n array(\n 'taxonomy' => 'radio_category',\n 'field' => 'id',\n 'terms' => 2\n )\n ),*/\n 'meta_key' => 'scrappy_url',\n );\n if ( $id ) {\n $args['post__in'] = ( is_array($id) ? $id : array($id));\n }\n return get_posts( $args );\n}", "function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }", "function generate_category_content()\n {\n global $conf, $page;\n\n $view_type = $page['chronology_view'];\n if ($view_type==CAL_VIEW_CALENDAR)\n {\n global $template;\n $tpl_var = array();\n if ( count($page['chronology_date'])==0 )\n {//case A: no year given - display all years+months\n if ($this->build_global_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==1 )\n {//case B: year given - display all days in given year\n if ($this->build_year_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n $this->build_nav_bar(CYEAR); // years\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==2 )\n {//case C: year+month given - display a nice month calendar\n if ( $this->build_month_calendar($tpl_var) )\n {\n $template->assign('chronology_calendar', $tpl_var);\n }\n $this->build_next_prev();\n return true;\n }\n }\n\n if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)\n {\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1)\n {\n $this->build_nav_bar(CMONTH); // month\n }\n if ( count($page['chronology_date'])==2 )\n {\n $day_labels = range( 1, $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR] ,$page['chronology_date'][CMONTH] ) );\n array_unshift($day_labels, 0);\n unset( $day_labels[0] );\n $this->build_nav_bar( CDAY, $day_labels ); // days\n }\n $this->build_next_prev();\n }\n return false;\n }", "public function showAllCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,true);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }", "function drawMultiRadioBoxes($baseName,$selectedItem, $items, $valueColumnName, $titleColumnName, $options=null) {\n\n\t\t$sortBy = $options['sortBy'];\n\t\tif (!$sortBy)\n\t\t\t$sortBy = 'value';\n\t\t\n\t\t$optionType = $options['type'];\n\t\tif ($optionType=='radio' or empty($optionType)) {\n\t\t\t$optionType = 'radio';\n\t\t} else {\n\t\t\t$baseName.='[]';\n\t\t}\n\t\t\n\t\t//echo $optionType;\n\t\t\n\t\tif (!is_array($selectedItem))\n\t\t\t$selectedItems[] = $selectedItem;\n\t\telse\n\t\t\t$selectedItems = $selectedItem;\n\t\t\n\t\t$displayMode = $options['displayMode'];\n\t\tif (!$displayMode)\n\t\t\t$displayMode = 'table';\n\t\t\n\t\t$template['table'] = array(\n\t\t\t'mainWrapper' => '<table %wrapperAttributes%>%contents%</table>',\n\t\t\t'contents' => '<tr>%fields%</tr>',\n\t\t\t'fields' => '<td>%field%</td>',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t$template['normal'] = array(\n\t\t\t'mainWrapper' => '<p>%contents%</p>',\n\t\t\t'contents' => '%fields%',\n\t\t\t'fields' => '%field%<br />',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t\n\t\tif (is_array($options[$displayMode])){\n\t\t\t$attributes = array_merge($template[$displayMode]['defaultAttributes'], $options[$displayMode]);\n\t\t\t$wrapperAttributes = cmfcHtml::attributesToHtml($attributes);\n\t\t}\n\t\telseif (is_string($options[$displayMode]))\n\t\t\t$wrapperAttributes = $options[$displayMode];\n\t\t\n\t\tif (is_array($options['inputAttributes']))\n\t\t\t$inputAttributes = cmfcHtml::attributesToHtml($options['inputAttributes']);\n\t\telseif (is_string($options['inputAttributes']))\n\t\t\t$inputAttributes = $options['inputAttributes'];\n\t\t\n\t\t$numColumns = $options['columns'];\n\t\tif (!$numColumns)\n\t\t\t$numColumns = 5;\n\t\t\n\t\tif (is_string($items)){\n\t\t\t$items = cmfcMySql::getRowsCustom($items);\n\t\t}\n\t\t\n\t\t$counter = 0;\n\t\t$contents = '';\n\t\tif (is_array($items)){\n\t\t\t//cmfcHtml::printr($items);\n\t\t\tswitch ($sortBy){\n\t\t\tcase 'title':\n\t\t\t\t$items = cmfcArray::sortItems($items, $titleColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'value':\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t}\n\t\t\t//cmfcHtml::printr($items);\n\t\t\t//cmfcHtml::printr( $options);\n\t\t\tforeach ($items as $item) {\n\t\t\t\t//cmfcHtml::printr($item);\n\t\t\t\t//echo $numColumns;\n\t\t\t\t$counter ++;\n\t\t\t\t\n\t\t\t\tif (in_array($item[$valueColumnName], $selectedItems) )\n\t\t\t\t\t$checked='checked=\"checked\"';\n\t\t\t\telse \n\t\t\t\t\t$checked='';\n\t\t\t\t\n\t\t\t\tif (in_array($optionType, array('checkbox', 'radio')) ){\n\t\t\t\t\t$value = $item[$valueColumnName];\n\t\t\t\t\t$field = '<input '.$inputAttributes.\n\t\t\t\t\t\t'name=\"'.$baseName.'\" id=\"'.$baseName.$counter.'\" type=\"'.$optionType.'\" value=\"'.$value.'\" '.$checked.'>&nbsp;<label for=\"'.$baseName.$counter.'\">';\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($options['strongItems']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($value, $options['strongItems'])) {\n\t\t\t\t\t\t\t$itemTitleColumnName = \"<b>\".$item[$titleColumnName].\"</b>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t}\n\t\t\t\t\t$field .= $itemTitleColumnName;\n\t\t\t\t\t$field .= '</label>';\n\t\t\t\t}\n\t\t\t\telseif ($optionType == 'custom'){\n\t\t\t\t\tif ($checked)\n\t\t\t\t\t\t$tag = $options['tag']['selected'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$tag = $options['tag']['notSelected'];\n\t\t\t\t\t\n\t\t\t\t\t$value = $item[$titleColumnName];\n\t\t\t\t\t$tag = str_replace('%value%', $value, $tag);\n\t\t\t\t\t$tag = str_replace('%inputAttributes%', $inputAttributes, $tag);\n\t\t\t\t\t\n\t\t\t\t\t$field = $tag;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= str_replace('%field%', $field, $template[$displayMode]['fields']);\n\t\t\t\t\n\t\t\t\tif ($counter % $numColumns == 0) {\n\t\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t\t\t$html = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($html){\n\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t}\n\t\t\t$result = str_replace('%contents%', $contents, $template[$displayMode]['mainWrapper']);\n\t\t}\n\t\telse{\n\t\t\t$result = 'no valid items';\n\t\t}\n\t\treturn $result;\n\t}", "function getSearchEngines($name)\n{\n $sql = \"SELECT * FROM search_engines ORDER BY NAME ASC \";\n $count = 0;\n\n $rows = fetchAll($sql);\n\n if (!empty($rows)) {\n echo \"<ul class=\\\"ul_check\\\">\";\n\n foreach ($rows as $row) {\n echo \"<th>\";\n $count = $count + 1;\n echo \"<label for=\\\"{$name}#\" . $row['id'] . \"\\\" class=\\\"radio-inline\\\">\";\n echo \"<input type=\\\"radio\\\"name=\\\"{$name}\\\"id=\\\"{$name}#\" . $row['id'] . \"\\\"value=\\\"\" . $row['id'] . \"\\\"\";\n echo stickyRadio(\"{$name}\", $row['id']);\n echo \" /><span>\" . $row['name'] . \"</span></label>\";\n\n echo \"</th>\";\n if (($count % 2) == 0) {\n echo \"</tr> <tr> \";\n }\n }\n echo \"</ul>\";\n }\n return isset($out) ? $out : null;\n}", "public function postController_beforeFormInputs_handler($sender, $args) {\n $sender->ShowCategorySelector = false;\n $categories = CategoryModel::getByPermission();\n\n $categories = array_column($categories, 'Name', 'CategoryID');\n\n echo '<div class=\"P\">';\n echo '<div class=\"Category\">';\n echo $sender->Form->label('Category', 'CategoryID');\n foreach ($categories as $categoryID => $categoryName) {\n $id = 'CategoryID'.$categoryID;\n echo $sender->Form->radio(\n 'CategoryID',\n '',\n [\n 'value' => $categoryID,\n 'class' => 'Hidden',\n 'id' => $id\n ]\n );\n echo $sender->Form->label(\n $categoryName,\n '',\n [\n 'class' => 'CategoryButton',\n 'for' => $id\n ]\n );\n }\n echo '</div></div>';\n }", "function ciniki_recipes_web_categories($ciniki, $settings, $tnid) {\n\n $strsql = \"SELECT DISTINCT category AS name \"\n . \"FROM ciniki_recipes \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"AND category <> '' \"\n . \"ORDER BY category \"\n . \"\";\n \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.recipes', array(\n array('container'=>'categories', 'fname'=>'name', 'name'=>'category',\n 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok');\n }\n $categories = $rc['categories'];\n\n //\n // Load highlight images\n //\n foreach($categories as $cnum => $cat) {\n //\n // Look for the highlight image, or the most recently added image\n //\n $strsql = \"SELECT ciniki_recipes.primary_image_id, ciniki_images.image \"\n . \"FROM ciniki_recipes, ciniki_images \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND category = '\" . ciniki_core_dbQuote($ciniki, $cat['category']['name']) . \"' \"\n . \"AND ciniki_recipes.primary_image_id = ciniki_images.id \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"ORDER BY (ciniki_recipes.webflags&0x10) DESC, \"\n . \"ciniki_recipes.date_added DESC \"\n . \"LIMIT 1\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'image');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['image']) ) {\n $categories[$cnum]['category']['image_id'] = $rc['image']['primary_image_id'];\n } else {\n $categories[$cnum]['category']['image_id'] = 0;\n }\n }\n\n return array('stat'=>'ok', 'categories'=>$categories); \n}", "function RadioBox($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "function mk_radio( $myTitle, $myName, $myValue, $myChek1, $myChek2, $myDesc1, $myDesc2 ){\n\t#initialize needed variables\n\t$str = $chekd1 = $chekd2 = '';\n\n\tif ($myValue == $myChek1) { $chekd1 = \"checked='checked'\"; }else{$chekd2 = \"checked='checked'\";}\n\n\t$str .= '<div class=\"row hoverHighlight\">\n\t\t\t<div class=\"col-sm-3 text-right text-muted\">\n\t\t\t\t<p class=\"text-right\">\n\t\t\t\t\t<strong>' . ucwords($myTitle) . ': </strong>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t<p>';\n\t\t\t\t$str .= \"<label>\n\t\t\t\t\t<input type='radio' value='{$myChek1}' name='{$myName}' {$chekd1}> &nbsp; {$myDesc1} &nbsp; &nbsp; </label>\n\t\t\t\t\t<input type='radio' value='{$myChek2}' name='{$myName}' {$chekd2}> &nbsp; {$myDesc2} </label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\";\n\n\treturn $str;\n}", "public function showTVShowCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>TV Shows</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,false);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }", "public static function renderCategories() \n {\n $categories = self::find()->indexBy('category_id')->asArray()->all();\n foreach($categories as $category) {\n ?>\n <li class=\"b-categories__item b-categories__<?= $category[\"name\"]; ?> transition3\">\n <ul class=\"submenu\">\n <li>\n <?= Html::a(\n Html::tag('span', mb_strtoupper($category[\"title\"]),\n ['class' => 'b-categories__link']),\n ['category/view', 'id' => $category['category_id']],\n ['class' => [$category[\"name\"], 'b-categories__alink']]\n ) ?>\n </li>\n </ul>\n </li>\n <?php\n }\n }", "public static function buildCategoriesList($build_controls, $category_type = 0, $refer_to = 0){\n\t\t$result = '';\n\t\t$items = Category::select('id','title','slug','img_url','enabled','created_at','updated_at');\n\t\tif($category_type != 0){\n\t\t\t$items = $items->where('category_type','=',$category_type);\n\t\t}\n\t\t$items = $items->where('refer_to','=',$refer_to)\n\t\t\t->orderBy('position','asc')\n\t\t\t->get();\n\t\tif(!empty($items->all())){\n\t\t\t$result = '<ul>';\n\t\t\tforeach($items as $item){\n\t\t\t\t$enabled = [\n\t\t\t\t\t'class'\t\t\t=> ($item->enabled == 1)? '': ' disabled',\n\t\t\t\t\t'triggerClass'\t=> ($item->enabled == 1)? 'fa-check': 'fa-ban',\n\t\t\t\t];\n\n\t\t\t\t$img_url = '';\n\t\t\t\tif(!empty($item->img_url) && (self::stringIsJson($item->img_url))){\n\t\t\t\t\t$img = json_decode($item->img_url);\n\t\t\t\t\t$img_url = '<img src=\"'.$img->src.'\" alt=\"'.$img->alt.'\">';\n\t\t\t\t}\n\n\t\t\t\t$result .= '<li data-id=\"'.$item->id.'\">\n\t\t\t\t\t<div class=\"category-wrap'.$enabled['class'].'\">\n\t\t\t\t\t\t<div class=\"category-title\">';\n\t\t\t\tif($build_controls){\n\t\t\t\t\t$result .= '\n\t\t\t\t\t\t\t<div class=\"sort-controls\">\n\t\t\t\t\t\t\t\t<div class=\"urdl-wrap\">\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item\"></div>\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item fa fa-angle-up\"></div>\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"urdl-wrap\">\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item fa fa-angle-left\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"item\"></div>\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item fa fa-angle-right\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"urdl-wrap\">\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item\"></div>\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item fa fa-angle-down\"></div>\n\t\t\t\t\t\t\t\t\t<div data-direction class=\"item\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>';\n\t\t\t\t}\n\t\t\t\t$result .= '\n\t\t\t\t\t\t\t<div class=\"title-wrap\" title=\"title\">'.$item->title.'</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"category-slug\" title=\"link\">'.$item->slug.'</div>\n\t\t\t\t\t\t<div class=\"category-image\">'.$img_url.'</div>\n\t\t\t\t\t\t<div class=\"timestamps\">\n\t\t\t\t\t\t\t<p>Создан: '.$item->created_at.'</p>\n\t\t\t\t\t\t\t<p>Изменен: '.$item->updated_at.'</p>\n\t\t\t\t\t\t</div>';\n\t\t\t\tif($build_controls){\n\t\t\t\t\t$result .= '\n\t\t\t\t\t\t<div class=\"category-controls\">\n\t\t\t\t\t\t\t<a class=\"fa '.$enabled['triggerClass'].'\" href=\"#\" title=\"enabled\"></a>\n\t\t\t\t\t\t\t<a class=\"edit fa fa-pencil-square-o\" href=\"'.route('admin.category.edit',$item->id).'\" title=\"Edit\"></a>\n\t\t\t\t\t\t\t<a class=\"drop fa fa-times\" href=\"#\" title=\"drop\"></a>\n\t\t\t\t\t\t</div>';\n\t\t\t\t}\n\t\t\t\t$result .= '</div>';\n\t\t\t\tif(Category::select('id')->where('refer_to','=',$refer_to)->count() > 0){\n\t\t\t\t\t$result .= self::buildCategoriesList($build_controls, $category_type, $item->id);\n\t\t\t\t}\n\t\t\t\t$result .= '</li>';\n\t\t\t}\n\t\t\t$result .= '</ul>';\n\t\t}\n\t\treturn $result;\n\t}", "public function createHTML () {\r\n\t\t\r\n\t\t//Declare STD Object $res\r\n\t\t$res = $this->blogstate->blogStatement();\r\n\r\n\t\t$blogPost = \"\";\r\n\r\n\t\t//Adding news items contained in $res variable.\r\n\t\tforeach($res AS $key => $val) {\r\n\t\t\t$catLink = \"\";\r\n\t\t\t$categoryAnchors = explode(\",\",($val->category));\r\n\t\t\t\r\n\t\t\tforeach($categoryAnchors as $catVal) {\r\n\t\t\t\t$catLink .= \"<a href='\". $this->db->getQueryString(array('genre' => $catVal)) .\"'>$catVal</a> &nbsp;\";\r\n\t\t\t}\r\n\r\n\t\t\t//Calling the function handleString to handle the $val-data variable with the chosen filters.\r\n \t\t\t$blogPost .= \"\r\n \t\t\t\t<div class='one-blog-post'>\r\n \t\t\t\t\t<h2><a href='newsitem.php?slug=\". $val->slug .\"'>{$val->title}</a></h2>\r\n \t\t\t\t\t<p>{$this->handleString($val->DATA, $val->slug, $val->FILTER)}</p>\r\n\r\n \t\t\t\t\t<div class='container-fluid'>\r\n \t\t\t\t\t\t<p class='pull-right'>Kategori: \". $catLink .\" &nbsp; Publicerad: {$val->published}</p>\r\n \t\t\t\t\t</div>\r\n \t\t\t\t</div>\";\r\n\t\t}\r\n\r\n\t\t//Adding HTML markup to $out.\r\n\t\t$out = \"\r\n\t\t\t\t<div class='container-fluid text-center show-all-movies'>\r\n\t\t\t\t\tNyheter\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t<div class='blog-posts'> \t\r\n\t\t\t\t\t{$blogPost}\r\n\t\t\t\t</div>\r\n\t\t\";\r\n\t\treturn $out;\r\n\t}", "function bt_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'hide_empty' => 1,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'all_the_cool_cats', $all_the_cool_cats );\n\t}\n\n\tif ( '1' != $all_the_cool_cats ) {\n\t\t// This blog has more than 1 category so _s_categorized_blog should return true\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so _s_categorized_blog should return false\n\t\treturn false;\n\t}\n}", "function simplenews_admin_categories() {\n $form['#tree'] = TRUE;\n if ($newsletters = entity_load('simplenews_newsletter')) {\n foreach ($newsletters as $newsletter) {\n $form[$newsletter->newsletter_id]['#newsletter'] = $newsletter;\n $form[$newsletter->newsletter_id]['name'] = array('#markup' => check_plain($newsletter->name));\n $form[$newsletter->newsletter_id]['weight'] = array('#type' => 'weight', '#delta' => 10, '#default_value' => $newsletter->weight);\n $form[$newsletter->newsletter_id]['edit'] = array(\n '#type' => 'link',\n '#title' => t('edit newsletter'),\n '#href' => \"admin/config/services/simplenews/categories/$newsletter->newsletter_id/edit\",\n );\n }\n }\n\n // Only make this form include a submit button and weight if more than one\n // newsletter exists.\n if (count($newsletters) > 1) {\n $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));\n }\n elseif (!empty($newsletters)) {\n $form[$newsletter->newsletter_id]['weight'] = array('#type' => 'value', '#value' => 0);\n }\n return $form;\n}", "public function get_sidebar_categories(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>{{categories-title}}:</td></tr><tr class=\"wm-widget-info\"><td>';\n\n $categories = get_the_category();\n $output = '';\n foreach( $categories as $category ){\n $id = get_cat_ID( $category->name );\n $url = get_category_link( $id );\n $output .= '<span class=\"wm-tags\"><a href=\"' . $url . '\">' . $category->name . '</a></span>, ';\n }\n\n if( count( $categories ) > 1 ){\n /** Replace the categories title to be plural. */\n $html = str_replace( '{{categories-title}}', 'Categories', $html );\n } else {\n /** Replace the categories title to be singular. */\n $html = str_replace( '{{categories-title}}', 'Category', $html );\n }\n\n /** Remove the extra comma and space from the loop and close the HTML. */\n $html .= substr( $output, 0, strlen( $output ) - 2 ) . '</td></tr>';\n return $html;\n }", "public function create()\n {\n $data = \"\";\n $categories = Category::where('parent_id', '0')->get();\n foreach($categories as $value){\n $data .= '<div class=\"category_item mt-2\" data-id=\"'.$value->id.'\">\n <label class=\"mb-1\"><input type=\"checkbox\" class=\"category_item\" name=\"category[]\" value=\"'.$value->id.'\" />'.$value->name.'</label>';\n $count = Category::where('parent_id', $value->id)->count();\n if($count > 0){\n $data .= $this->getCategories($value->id);\n }\n $data .= '</div>'; \n }\n return view('create', compact('data'));\n }", "function circle_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'circle_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'circle_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so circle_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so circle_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "public static function renderRadio();", "public function addMultipleCategoriesToGroup();", "static public function ctrCrearCategorias(){\n\t\t//$i += 1;\n\t\t//$respuesta = array();\n\t\t\n\t\t\n\t\t//var_dump($respuesta1[$i]);\n\n if (isset($_POST[\"nuevaCategoria\"])) {\n\t\t\t\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t\t$tabla1 = \"categorias\";\n\t\t\t\t\t$respuesta1 = ModeloCategorias::MdlMostrarCategorias123($tabla1);\n\n\t\t\t\t\tforeach ($respuesta1 as $key => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strtoupper($_POST[\"nuevaCategoria\"]) == strtoupper($value[\"categoria\"])){\n\t\t\t\t\t\t\t$respuesta12 = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($respuesta12){\n\n\t\t\t\t\t\techo'<script>\n\t\t\t\n\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡La categoria ya existe en la bd!\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t\t}).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\t\t\t\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t$tabla = \"categorias\";\n\t\t\t\t\t\t\t$datos = $_POST[\"nuevaCategoria\"];\n\t\t\t\t\t\t\t$respuesta = ModeloCategorias::mdlIngresarCategoria($tabla,$datos);\n\t\t\t\n\t\t\t\t\t\t\tif ($respuesta == \"ok\") {\n\t\t\t\t\t\t\t\techo '<script>\n\t\t\t\n\t\t\t\t\t\t\t\tswal({\n\t\t\t\n\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡La categoria a sido guardado correctamente!\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\n\t\t\t\t\t\t\t\t}).then(function(result){\n\t\t\t\n\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t}else{\n\t\t\t\t\techo'<script>\n\t\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t\t title: \"¡El nombre no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\t\n\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\n\t\t\t\t\t </script>';\n\t\t\t\t}\n\n\t\t\t\n \n }\n\n\t}", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}" ]
[ "0.52064836", "0.49694917", "0.48947316", "0.48776603", "0.48648077", "0.48622644", "0.48484185", "0.4789536", "0.4768624", "0.47145632", "0.47071362", "0.46905714", "0.4683797", "0.4676859", "0.46667105", "0.4637696", "0.46282452", "0.4607321", "0.45954877", "0.45910627", "0.45894706", "0.4564095", "0.4533037", "0.45312265", "0.45287308", "0.45181656", "0.45116767", "0.4510857", "0.45103517", "0.44909495" ]
0.78439355
0
Helper function to generate check boxes for filter types. Creates check boxes for all available filter types found in database. Has function to generate check boxes, where the check box is already checked, for all filter types connected to the news blog.
private function generateFilterTypeCheckBoxes($newsBlogFilterType=null) { $checkBox = null; $filterTypes = $this->fetchFilterTypes(); foreach ($filterTypes as $key => $filterType) { if ($this->shouldSetBoxBeSet($newsBlogFilterType, $filterType)) { $checkBox .= "<label><input type='checkbox' name='filter[]' value='{$filterType}' checked='checked' />{$filterType}</label>\n"; } else { $checkBox .= "<label><input type='checkbox' name='filter[]' value='{$filterType}' />{$filterType}</label>\n"; } } return $checkBox; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildFilterSelectTable($filterType, $dbTable, $fields, $selectType = \"checkbox\", $formID = \"reportData\") {\n\t\t//reports.php \t\t- USED TO GENERATE FILTER SELECTION TABLES IN FILTER SELECT TABS\n\t\t//dataCleaner.php \t- USED TO GENERATE SELECTABLE LOOKUP TABLE\n\t\tglobal $db_conn;\n\n\t\t//Opening Table Tag\n\t\techo '<table id=\"' . $filterType . 'FilterSelectTable\" class=\"filterSelectTable\">';\n\n\t\t//First Row (Select All Row) ONLY IF $selectType == \"checkbox\"\n\t\tif ($selectType == \"checkbox\") {\n\t\t\techo '<tr class=\"filterSelectAllRow\">';\n\t\t\techo \t'<td><input type=\"checkbox\" id=\"' . $filterType . '_all\" class=\"selectAll\" form=\"' . $formID . '\" name=\"' . $filterType . '_all\" filterType=\"' . $filterType . '\" checked /></td>';\n\t\t\techo \t'<td colspan=\"' . count($fields) . '\">Select/Deselect All</td>';\n\t\t\techo '</tr>';\n\t\t}\n\t\t\n\t\t//Second Row (Headings)\n\t\techo '<tr class=\"filterSelectTitleRow\">';\n\t\techo \t'<td></td>';\n\t\tforeach($fields as $field) {\n\t\t\techo \t'<td>' . getComment($dbTable, $field) . '</td>';\n\t\t}\n\t\techo '</tr>';\n\n\t\t//Build Body of Table\n\n\t\t//Build SQL\n\t\t$filterSQL = 'SELECT ID, ';\n\t\tforeach($fields as $field) {\n\t\t\t$filterSQL .= $field . ', ';\n\t\t}\n\t\t$filterSQL = rtrim($filterSQL, \", \");\n\t\t$filterSQL .= ' FROM ' . $dbTable . ' GROUP BY ' . $fields[0] . ' ORDER BY ID;';\n\n\t\t$filterQuery = mysqli_query($db_conn, $filterSQL);\n\t\t\t\t\n\t\t//$firstIsSelectAll REMOVED FROM FUNCTIONALITY BECAUSE RADIO BUTTON FILTER SELECTS DO NOT NEED A SELECT ALL\n\t\t//$firstIsSelectAll = $selectType == \"radio\" ? \"_all\" : \"\"; //If $selectType is 'radio', then the first choice is the 'Select All' choice\n\t\twhile ($row = mysqli_fetch_row($filterQuery)) {\n\t\t\t$property = ($row[0] == \"1\" ? \"checked\" : \"\");\n\t\t\t$property = ($selectType == \"checkbox\" ? \"checked\" : $property);\n\n\t\t\techo '<tr>';\n\t\t\techo '<td><input type=\"' . $selectType . '\" form=\"' . $formID . '\" class=\"' . $filterType . '\" name=\"' . $filterType /*. $firstIsSelectAll*/ . '\" value=\"' . $row[0] . '\" ' . $property . ' /></td>';\n\n\t\t\t//$firstIsSelectAll = \"\"; //Only the first radio button can be select all. This line has no effect if $selectType == \"checkbox\"\n\n\t\t\tfor ($i = 1; $i < count($row); $i++) {\n\t\t\t\techo '<td>' . $row[$i] . '</td>';\n\t\t\t}\n\n\t\t\techo '</tr>';\n\t\t}\n\n\t\techo '</table>';\n\t}", "function theme_webform_edit_file($form) {\r\n $javascript = '\r\n <script type=\"text/javascript\">\r\n function check_category_boxes () {\r\n var checkValue = !document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[1]).checked;\r\n for(var i=1; i < arguments.length; i++) {\r\n document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[i]).checked = checkValue;\r\n }\r\n }\r\n </script>\r\n ';\r\n drupal_set_html_head($javascript);\r\n\r\n // Format the components into a table.\r\n $per_row = 5;\r\n $rows = array();\r\n foreach (element_children($form['extra']['filtering']['types']) as $key => $filtergroup) {\r\n $row = array();\r\n $first_row = count($rows);\r\n if ($form['extra']['filtering']['types'][$filtergroup]['#type'] == 'checkboxes') {\r\n // Add the title.\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n $row[] = '&nbsp;';\r\n // Convert the checkboxes into individual form-items.\r\n $checkboxes = expand_checkboxes($form['extra']['filtering']['types'][$filtergroup]);\r\n // Render the checkboxes in two rows.\r\n $checkcount = 0;\r\n $jsboxes = '';\r\n foreach (element_children($checkboxes) as $key) {\r\n $checkbox = $checkboxes[$key];\r\n if ($checkbox['#type'] == 'checkbox') {\r\n $checkcount++;\r\n $jsboxes .= \"'\". $checkbox['#return_value'] .\"',\";\r\n if ($checkcount <= $per_row) {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n elseif ($checkcount == $per_row + 1) {\r\n $rows[] = array('data' => $row, 'style' => 'border-bottom: none;');\r\n $row = array(array('data' => '&nbsp;'), array('data' => '&nbsp;'));\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n else {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n }\r\n }\r\n // Pretty up the table a little bit.\r\n $current_cell = $checkcount % $per_row;\r\n if ($current_cell > 0) {\r\n $colspan = $per_row - $current_cell + 1;\r\n $row[$current_cell + 1]['colspan'] = $colspan;\r\n }\r\n // Add the javascript links.\r\n $jsboxes = drupal_substr($jsboxes, 0, drupal_strlen($jsboxes) - 1);\r\n $rows[] = array('data' => $row);\r\n $select_link = ' <a href=\"javascript:check_category_boxes(\\''. $filtergroup .'\\','. $jsboxes .')\">(select)</a>';\r\n $rows[$first_row]['data'][1] = array('data' => $select_link, 'width' => 40);\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n }\r\n elseif ($filtergroup != 'size') {\r\n // Add other fields to the table (ie. additional extensions).\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n unset($form['extra']['filtering']['types'][$filtergroup]['#title']);\r\n $row[] = array(\r\n 'data' => drupal_render($form['extra']['filtering']['types'][$filtergroup]),\r\n 'colspan' => $per_row + 1,\r\n );\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n $rows[] = array('data' => $row);\r\n }\r\n }\r\n $header = array(array('data' => t('Category'), 'colspan' => '2'), array('data' => t('Types'), 'colspan' => $per_row));\r\n\r\n // Create the table inside the form.\r\n $form['extra']['filtering']['types']['table'] = array(\r\n '#value' => theme('table', $header, $rows)\r\n );\r\n\r\n $output = drupal_render($form);\r\n\r\n // Prefix the upload location field with the default path for webform.\r\n $output = str_replace('Upload Directory: </label>', 'Upload Directory: </label>'. file_directory_path() .'/webform/', $output);\r\n\r\n return $output;\r\n}", "function lib4ridora_construct_publication_type_filter($form_state) {\n // Collect the selected values.\n $genres = array();\n foreach ($form_state['values']['pub_type'] as $genre) {\n if ($genre) {\n $genres[] = $genre;\n }\n }\n\n // Exit early if no check box was selected.\n if (empty($genres)) {\n return \"\";\n }\n\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n $publication_type_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_type', 'mods_genre_ms'));\n\n $field_names = array_fill(0, count($genres), $publication_type_field);\n\n $filters = array_map(\"lib4ridora_construct_solr_statement\", $field_names, $genres);\n\n return lib4ridora_construct_filter_string_from_array($filters);\n}", "function buildFilterUI($dbh, $template, $vars) {\r\n $states = getRepresentedStates($dbh);\r\n for ($i=0; $i<count($states); $i++) {\r\n $states[$i]['selected'] = \"\";\r\n if (in_array($states[$i]['state'], $vars['states'])) {\r\n $states[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n \r\n $countries = getRepresentedCountries($dbh);\r\n for ($i=0; $i<count($countries); $i++) {\r\n $countries[$i]['selected'] = \"\";\r\n if (in_array($countries[$i]['country'], $vars['countries'])) {\r\n $countries[$i]['selected'] = \"selected\";\r\n }\r\n \r\n }\r\n \r\n $developers = getRepresenteddevelopers($dbh);\r\n for ($i=0; $i<count($developers); $i++) {\r\n $developers[$i]['selected'] = \"\";\r\n if (in_array($developers[$i]['id'], $vars['developers'])) {\r\n $developers[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n\r\n $sources = getRepresentedsources($dbh);\r\n for ($i=0; $i<count($sources); $i++) {\r\n $sources[$i]['selected'] = \"\";\r\n if (in_array($sources[$i]['id'], $vars['sources'])) {\r\n $sources[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n \r\n $template->get('state-list')->loop($states);\r\n $template->get('country-list')->loop($countries);\r\n $template->get('developer-list')->loop($developers);\r\n $template->get('sources-list')->loop($sources);\r\n \r\n if ($vars['filter-state'] == \"on\") {\r\n $template->get('state-checked')->unmute();\r\n }\r\n \r\n if ($vars['filter-developer'] == \"on\") {\r\n $template->get('developer-checked')->unmute();\r\n }\r\n \r\n if ($vars['filter-source'] == \"on\") {\r\n $template->get('source-checked')->unmute();\r\n }\r\n if ($vars['filter-country'] == \"on\") {\r\n $template->get('country-checked')->unmute();\r\n }\r\n // Pedigree filters\r\n //$template->get('country-list')->loop(getRepresentedCountries($dbh));\r\n //$template->get('developer-list')->loop(getRepresentedDevelopers($dbh));\r\n //$template->get('sources-list')->loop(getRepresentedSources($dbh));\r\n \r\n // Stock filters\r\n $template->get('developer_options')->replace(getDeveloperOptions($dbh)); \r\n $template->get('type_options')->replace(getTypeOptions($dbh)); \r\n $template->get('linkage_options')->replace(getLinkageOptions($dbh)); \r\n $template->get('karyotype_options')->replace(getKaryotypeOptions($dbh)); \r\n \r\n }", "function getFilters() {\r\n global $filterList;\r\n foreach ($filterList as $filter) {\r\n echo getSelectionOptions($filter);\r\n }\r\n echo '<button type=\"submit\" value=\"submit\">Save Filters</button>';\r\n }", "private function generate_filter_dropdowns() {\n $html = '';//no html\n \n //instance filter dropdown\n $instance_config = $this->get_settings_config_data();//get instance config\n if(isset($instance_config) && isset($instance_config->data)//if config exists, and data has been saved\n && count($instance_config->data) > 0) {//there is actually a filter saved\n \n $text = get_string('instance_filters', 'block_dd_content');//get label text\n $html .= $this->generate_filter_dropdown($text, $instance_config->data);//generate dropdown\n }\n\n //global filter dropdown\n $global_config_data = dd_content_get_admin_config();//grab global block config DATA (not the config itself)\n if(count($global_config_data) > 0) {//if a filter exists\n \n $text = get_string('global_filters', 'block_dd_content');//get global filter label\n $html .= $this->generate_filter_dropdown($text, $global_config_data);//create dropdown\n }\n \n \n return $html;\n }", "function columns_filter ( $columns ) {\r\n\r\n\t\t$columns = array(\r\n\t\t\t'cb'\t\t\t\t\t=> '<input type=\"checkbox\" />',\r\n\t\t\t'listing_thumbnail'\t\t=> __( 'Thumbnail', 'apl' ),\r\n\t\t\t'title'\t\t\t\t\t=> __( 'Listing Title', 'apl' ),\r\n\t\t\t'listing_details'\t\t=> __( 'Details', 'apl' ),\r\n\t\t\t'listing_features'\t\t=> __( 'Features', 'apl' ),\r\n\t\t\t'listing_categories'\t=> __( 'Categories', 'apl' )\r\n\t\t);\r\n\r\n\t\treturn $columns;\r\n\r\n\t}", "function kcsite_add_new_type_filter() {\n\n\t$taxonomyObject = get_terms('new-type', array('hide_empty' => 0));\n\t$options = array(array('ID' => 0, 'name' => pll__('Naujienos tipas')));\n\t$i=1;\n\tforeach ($taxonomyObject as $key => $val) {\n\t\t$options[$i]['slug'] = $val->slug; \n\t\t$options[$i]['name'] = $val->name; \n\t\t$i++;\n\t}\n\t// print_r($taxonomyObject);\n\n\t$m = isset( $_GET['_NewType'] ) ? $_GET['_NewType'] : 0;\n\t?>\n\n\t<select id=\"new-type-filter\" name='_NewType'>\n\t<?php\n\tforeach ($options as $val) {\n\t\tprintf( \"<option %s value='%s'>%s</option>\\n\",\n\t\t\tselected( $m, $val['slug'], false ),\n\t\t\tesc_attr( $val['slug']),\n\t\t\t$val['name']\n\t\t);\n\t}\n\t?>\n\t</select>\n\t<?php\n}", "public function lp_rating_types_html( $args ) { \n $post_types = get_post_types( array( 'public' => true ), 'objects' );\n \n // get the value of the setting we've registered with register_setting()\n $rating_types = get_option('lp_rating_types', array());\n \n if( ! empty( $post_types ) ) {\n foreach ( $post_types as $key => $value ) {\n $isChecked = in_array( $key, $rating_types );\n echo '<input ' . ( $isChecked ? 'checked=\"checked\"' : '' ) . ' type=\"checkbox\" name=\"lp_rating_types[]\" value=\"' . $key . '\" /> ' . $value->label . '<br/>';\n }\n }\n }", "public static function _tableFilters($filters) {\n\t\t$advansed_filters = array();\n\t\t$show_advansed_filters = false;\n\n\t\tforeach ($filters as $key => $filter) {\n\n\t\t\tif ($filter->hidden) {\n\t\t\t\tunset($filters[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ($filter->advansed == true) {\n\t\t\t\t// Show advansed filters if there have input values\n\t\t\t\tif (!empty($filter->value)) $show_advansed_filters = true;\t\t\t\t\n\t\t\t\t// Copy filter to advansed array\n\t\t\t\t$advansed_filters[] = $filter;\n\t\t\t\t// Delete this filter from main array\n\t\t\t\tunset($filters[$key]);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif (!count($filters)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$result = '<div class=\"block-filters\">';\t\t\n\t\t$result .= '<div class=\"block-title\">Фильтры</div>';\n\t\t$result .= '<form method=\"post\" name=\"filtersForm\" id=\"filtersForm\" action=\"'.$_SERVER['SCRIPT_URL'].'\">';\n\n\t\t// Main filters array\n\t\tforeach ($filters as $filter) {\n\n\t\t\t$result .= '<div class=\"block-item\">';\n\n\t\t\tif (count($filter->values)) {\n\n\t\t\t\t$result .= '<label>'.$filter->title.':</label><br />';\n\t\t\t\t$result .= '<select name=\"filters['.$filter->name.']\" onchange=\"filtersForm.submit()\">';\t\t\t\t\n\n\t\t\t\t\tif ($filter->first_empty_value)\n\t\t\t\t\t\t$result .= '<option value=\"\">Все</option>';\t\t\t\t\t\n\n\t\t\t\t\tforeach ($filter->values as $key => $value) {\n\n\t\t\t\t\t\t$selected = '';\n\n\t\t\t\t\t\tif ($filter->value == $key) {\n\t\t\t\t\t\t\t$selected = 'selected';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$result .= '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t\t\t\t}\t\t\t\t\t\n\n\t\t\t\t$result .= '</select>';\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$result .= '<label>'.$filter->title.':</label><br />';\n\t\t\t\t$result .= '<input type=\"text\" name=\"filters['.$filter->name.']\" value=\"'.$filter->value.'\" />';\n\n\t\t\t}\n\n\t\t\t$result .= '</div>'; #block-item\n\n\t\t}\n\n\t\t$result .= '<div class=\"clr\"></div>';\n\n\t\t// Advansed filters array\n\t\tif ($show_advansed_filters) {\n\t\t\t$result .= '<div class=\"advansed_filters\" style=\"display:block;\">';\t\n\t\t} else {\n\t\t\t$result .= '<div class=\"advansed_filters\" style=\"display:none;\">';\t\n\t\t}\t\t\n\t\t\n\t\tforeach ($advansed_filters as $filter) {\n\n\t\t\t$result .= '<div class=\"block-item\">'; #block-item \n\n\t\t\tif (count($filter->values)) {\n\n\t\t\t\t$result .= '<label>'.$filter->title.':</label><br />';\n\t\t\t\t$result .= '<select name=\"filters['.$filter->name.']\" onchange=\"filtersForm.submit()\">';\t\t\t\t\n\n\t\t\t\t\tif ($filter->first_empty_value)\n\t\t\t\t\t\t$result .= '<option value=\"\">Все</option>';\t\t\t\t\t\n\n\t\t\t\t\tforeach ($filter->values as $key => $value) {\n\n\t\t\t\t\t\t$selected = '';\n\n\t\t\t\t\t\tif ($filter->value == $key) {\n\t\t\t\t\t\t\t$selected = 'selected';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$result .= '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t\t\t\t}\t\t\t\t\t\n\n\t\t\t\t$result .= '</select>';\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$result .= '<label>'.$filter->title.':</label><br />';\n\t\t\t\t$result .= '<input type=\"text\" name=\"filters['.$filter->name.']\" value=\"'.$filter->value.'\" />';\n\n\t\t\t}\n\n\t\t\t$result .= '</div>'; #block-item\n\n\t\t}\n\n\t\t$result .= '</div>';\n\n\t\t$result .= '<div class=\"clr\"></div>';\t\n\n\t\t$result .= '<input type=\"hidden\" name=\"limitstart\" value=\"0\" />';\t\n\t\t$result .= '<input type=\"submit\" value=\"Искать\" />';\t\t\n\t\t$result .= '<input type=\"button\" value=\"Очистить\" class=\"form-reset\" />';\n\n\t\tif (count($advansed_filters)) {\n\t\t\t$result .= '<input type=\"button\" value=\"Расширенный фильтр\" class=\"toggle_advansed_filters\" />';\t\n\t\t}\t\n\t\t\n\t\t$result .= '</form>';\n\t\t$result .= '</div>';\n\n\t\treturn $result;\t\t\n\n\t}", "function get_filters($term_ids,$taxonomy, $filter_type = 'thumbs', $title = ''){\n $result = ''; \n if(is_array($term_ids) && sizeof($term_ids)){\n $result .= $title;\n $result .= '<ul class=\"thumbs-splitter\" data-option-key=\"filter\">';\n $result .= ' <li class=\"segment-0 selected-0 selected\">\n <a href=\"#filter\" data-option-value=\"*\" class=\"selected\">'.__('All','cosmotheme').'</a>\n </li>';\n $i = 0;\n foreach ($term_ids as $term_id) {\n $i++;\n $term = get_term( $term_id, $taxonomy );\n \n $result .= '<li class=\"segment-'.$i.'\">\n <a href=\"#filter\" data-option-value=\".'.$term -> term_id.'-'.$filter_type.'\">'.$term->name.'</a>\n </li>';\n }\n $result .= '</ul>';\n }\n\n return $result;\n }", "public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'media.adminlist.configurator.filter.name');\n $this->addFilter('contentType', new ORM\\StringFilterType('contentType'), 'media.adminlist.configurator.filter.type');\n $this->addFilter('updatedAt', new ORM\\NumberFilterType('updatedAt'), 'media.adminlist.configurator.filter.updated_at');\n $this->addFilter('filesize', new ORM\\NumberFilterType('filesize'), 'media.adminlist.configurator.filter.filesize');\n }", "private static function _initializeTypes()\n {\n\n $db = DataAccess::getInstance();\n $category = self::getActiveCategory();\n\n $fields = geoFields::getInstance(0, $category);\n\n $sql = \"SELECT * FROM \" . geoTables::browsing_filters_settings . \" WHERE `category` = ? AND `enabled` = 1\";\n $settings = $db->Execute($sql, array($category));\n\n while ($settings && $target = $settings->FetchRow()) {\n $name = $target['field'];\n $type = 0; //be sure to reset $type to 0 each time, to prevent bleeding\n if (strpos($name, 'optional_field_') === 0) {\n //this is an optional field\n\n if (!$fields->$name->is_enabled) {\n //field not enabled. do not set!\n continue;\n }\n $optional_type = $fields->$name->field_type;\n if ($optional_type === 'number' || $optional_type === 'cost') {\n $type = self::RANGE;\n } elseif ($optional_type === 'textarea' || $optional_type === 'text') {\n $type = self::SCALAR;\n } elseif ($optional_type === 'date') {\n $type = self::DATE_RANGE;\n } elseif ($optional_type === 'dropdown') {\n $type = self::PICKABLE;\n }\n } elseif (strpos($name, 'cs_') === 0) {\n //this is a cat-spec question\n $question_id = substr($name, 3);\n $cs_type = $db->GetOne(\"SELECT `choices` FROM \" . geoTables::questions_table . \" WHERE `question_id` = ?\", array($question_id));\n if (is_numeric($cs_type) || $cs_type === 'none') {\n $type = self::PICKABLE;\n } elseif ($cs_type === 'check') {\n $type = self::BOOL;\n } elseif ($cs_type === 'number') {\n $type = self::RANGE;\n } elseif ($cs_type === 'date') {\n $type = self::DATE_RANGE;\n } else {\n //not a valid question, or no longer active? do not set.\n continue;\n }\n } elseif (strpos($name, 'leveled_') === 0) {\n //leveled field\n $type = self::PICKABLE;\n }\n if ($type) {\n self::$_types[$name] = $type;\n } else {\n //These aren't the droids you're looking for. You can go about your business. Move along.\n //(Didn't find a dynamic type, which means this field is either statically-typed in the declaration of self::$_types or doesn't exist)\n }\n }\n\n self::$_typesInitialized = true;\n }", "public function filterTypeTicketList( $filter )\r\n {\r\n if( !empty( $filter['type'] ) ){\r\n \r\n $i = 0; \r\n foreach ($filter['type'] as $type){\r\n if( $i == 0){\r\n $sqlType= \" AND (type = '$type' \";\r\n }\r\n else{\r\n $sqlType.= \" OR type = '$type' \";\r\n }\r\n\r\n $i++;\r\n }\r\n $sqlType.= \" ) \";\r\n\r\n return $sqlType;\r\n }\r\n else{\r\n return NULL;\r\n }\r\n }", "function tpl_filters($filter, $showtv)\n{\n global $smarty, $lang;\n global $filter_expr;\n global $owner, $mediatype;\n\tglobal $config;\n\t\n // build filter array\n foreach ($filter_expr as $flt => $regex)\n {\n $filters[$flt] = ($flt == \"NUM\") ? \"#\" : $flt;\n }\n $filters['all']\t = $lang['radio_all'];\n $filters['unseen'] = $lang['radio_unseen'];\n $filters['new'] = $lang['radio_new'];\n/*\n # removed as of 4.0 in favour of media type filter\n $filters['wanted'] = $lang['radio_wanted'];\n*/\n $smarty->assign('filters', $filters);\n $smarty->assign('filter', $filter);\n $smarty->assign('showtv', $showtv);\n\n // create owner selectbox\n $smarty->assign('owners', out_owners(array($lang['filter_any'] => $lang['filter_any']), PERM_READ));\n if (!$owner) $owner = $lang['filter_any']; //!! default owner hack\n $smarty->assign('owner', $owner);\n\n // create mediatype selectbox\n $smarty->assign('mediafilter', out_mediatypes(array(-2 => $lang['filter_any'], -1 => $lang['filter_available'])));\n if (!$mediatype) $mediatype = session_get('mediafilter'); //!! default media type hack\n $smarty->assign('mediatype', $mediatype);\n\t\n\t// create sorting selectbox\n\t// Sorting is disabled when ordering by diskid is enabled\n\tif(!$config['orderallbydisk']) {\n\t\t$smarty->assign('order_options', array(-1 => $lang['title'], 1 => $lang['rating'], 2 => $lang['date']));\n\t\tif(!isset($order)) $order = session_get('order');\n\t\t$smarty->assign('order', $order);\n\t} \n\n\n // enable dynamic columns in list view\n $smarty->assign('listcolumns', session_get('listcolumns'));\n}", "function rate_us_rating_types_html( $args ) {\n\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\n\t// get the value of the setting we've registered with register_setting().\n\t$rating_types = get_option( 'rate_us_rating_types', array() );\n\n\tif ( ! empty( $post_types ) ) {\n\t\tforeach ( $post_types as $key => $value ) {\n\t\t\t$isChecked = in_array( $key, $rating_types );\n\t\t\techo '<input ' . ( $isChecked ? 'checked=\"checked\"' : '' ) . ' type=\"checkbox\" name=\"rate_us_rating_types[]\" value=\"' . $key . '\" /> ' . $value->label . '<br/>';\n\t\t}\n\t}\n}", "public function editSeedCheckboxs(){\n\t\t//tag ids for specific seed\n\t\t$seedName = $_POST['seedName'];\n\t\t$sql2 = \n\t\t\t\"SELECT tag.tag_id\n\t\t\tFROM seed\n\t\t\tINNER JOIN seedtag ON seed.seed_id = seedtag.seed_id\n\t\t\tINNER JOIN tag ON seedtag.tag_id = tag.tag_id\n\t\t\tWHERE seed.name= :seedName\";\n\t\t$stmt2 = $this->databaseConnection->dbConnection->prepare($sql2);\n\t\t$stmt2->bindParam(':seedName', $seedName);\n\t\t$stmt2->execute();\n\t\t$tagsForSeed = [];\n\t\twhile($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){\n\t\t\tarray_push($tagsForSeed, $row2['tag_id']);\n\t\t}\n\n\t\t//for every tag for this type\n\t\t//if the tag is attached to the specific seed, checked\n\t\t//if the tag is not attached to the specific seed, no checked\n\t\t$seedType = $_POST['seedType'];\n\t\t$sql = \n\t\t\t\"SELECT type.type_name, tag.tag_name, tag.tag_id\n\t\t\tFROM type\n\t\t\tINNER JOIN typetag ON type.type_id = typetag.type_id\n\t\t\tINNER JOIN tag ON typetag.tag_id = tag.tag_id\n\t\t\tWHERE type.type_name= :seedType\n\t\t\tORDER BY tag.tag_name\";\n\t\t$stmt = $this->databaseConnection->dbConnection->prepare($sql);\n\t\t$stmt->bindParam(':seedType', $seedType);\n\t\t$stmt->execute();\n\t\t$tagsForType = [];\n\t\t$listOfCheckboxes = \"\";\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t$tagID = $row['tag_id'];\n\t\t\t$tagName = $row['tag_name'];\n\t\t\tif(in_array($tagID, $tagsForSeed)){\n\t\t\t\t//checked\n\t\t\t\t$listOfCheckboxes = $listOfCheckboxes . '<input type=\"checkbox\" name=\"typeTag\" id=\"' . $tagName . \"-\" . $tagID . '\" checked>' . $tagName . '<br>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//unchecked\n\t\t\t\t$listOfCheckboxes = $listOfCheckboxes . '<input type=\"checkbox\" name=\"typeTag\" id=\"' . $tagName . \"-\" . $tagID . '\">' . $tagName . '<br>';\n\t\t\t}\n\t\t}\n\t\techo $listOfCheckboxes;\n\t}", "function CheckBoxList($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "protected function getMergedCheckboxes($type, $labelInfo = '')\n {\n $checkboxes = '';\n if (!empty($this->checkboxesArray[$type])) {\n $labelKey = 'LLL:EXT:themes/Resources/Private/Language/locallang.xlf:behaviour.'.strtolower($type).'_group_label';\n $label = $this->getLanguageService()->sL($labelKey);\n if (trim($labelInfo) != '') {\n $label .= '('.$labelInfo.')';\n }\n $checkboxes .= '<label class=\"t3js-formengine-label themes-label-'.$type.' col-xs-12\">'.$label.':</label>';\n $checkboxes .= implode('', $this->checkboxesArray[$type]).LF;\n }\n\n return $checkboxes;\n }", "function mongo_node_filters($entity_type) {\n $filters = array(\n 'status' => array(\n 'any' => array(\n 'label' => 'Any',\n ),\n 'published' => array(\n 'label' => 'Published',\n 'filters' => array(\n array(\n '#type' => 'status',\n '#value' => 1,\n '#callback' => 'propertyCondition',\n ),\n ),\n ),\n 'not_published' => array(\n 'label' => 'Not published',\n 'filters' => array(\n array(\n '#type' => 'status',\n '#value' => 0,\n '#callback' => 'propertyCondition',\n ),\n ),\n ),\n ),\n 'type' => array(\n 'any' => array(\n 'label' => 'Any',\n ),\n ),\n );\n\n $set = mongo_node_settings();\n $bundles = $set[$entity_type]['bundles'];\n foreach ($bundles as $bundle_name => $bundle_settings) {\n $filters['type'][$bundle_name] = array(\n 'label' => $bundle_settings['label'],\n 'filters' => array(\n array(\n '#type' => 'bundle',\n '#value' => $bundle_name,\n '#callback' => 'entityCondition',\n ),\n ),\n );\n }\n return $filters;\n}", "function _prepare_filter_data () {\n\t\tif (!$this->USE_FILTER || !in_array($_GET[\"action\"], array(\n\t\t\t\"show\",\n\t\t\t\"clear_filter\",\n\t\t\t\"save_filter\",\n\t\t))) return \"\";\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"admin_priority\"=> 'select_box(\"admin_priority\",$this->_priorities2,\t$selected, \"\", 2, \"\", false)',\n\t\t\t\"category_id\"\t=> 'select_box(\"category_id\",\t$this->_help_cats2,\t\t$selected, \"\", 2, \"\", false)',\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_ticket_statuses2,$selected, \"\", 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"per_page\"\t\t=> 'select_box(\"per_page\",\t\t$this->_per_page,\t\t$selected, 0, 2, \"\", 0)',\n\t\t));\n\t\t$this->_priorities2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_priorities as $k => $v) {\n\t\t\t$this->_priorities2[$k]\t= $v;\n\t\t}\n\t\t$this->_help_cats2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_help_cats as $k => $v) {\n\t\t\t$this->_help_cats2[$k]\t= $v;\n\t\t}\n\t\t$this->_ticket_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_ticket_statuses as $k => $v) {\n\t\t\t$this->_ticket_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"user_id\",\n\t\t\t\"name\",\n\t\t\t\"email\",\n\t\t\t\"status\",\n\t\t\t\"admin_priority\",\n\t\t\t\"assigned_to\",\n\t\t\t\"opened_date\",\n\t\t\t\"closed_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"user_id\",\n\t\t\t\"subject\",\n\t\t\t\"message\",\n\t\t\t\"account_type\",\n\t\t\t\"email\",\n\t\t\t\"category_id\",\n\t\t\t\"status\",\n\t\t\t\"admin_priority\",\n\t\t\t\"assigned_to\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t\t\"per_page\",\n\t\t);\n\t\t// Number of records per page\n\t\t$this->_per_page = array(\n\t\t\t50\t=> 50,\n\t\t\t100\t=> 100,\n\t\t\t200\t=> 200,\n\t\t\t500\t=> 500,\n\t\t);\n\t}", "private function get_filterItemsWrap( $items )\n {\n $arr_return = array();\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n $conf_name = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field ];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // IF NOT CATEGORY_MENU ajax class onchange\n // #41753.01, 121010, dwildt, 4-\n// if($conf_name != 'CATEGORY_MENU')\n// {\n// $conf_array = $this->pObj->objJss->class_onchange($conf_name, $conf_array, $this->row_number);\n// }\n // #41753.01, 121010, dwildt, 11+\n switch ( true )\n {\n case( $conf_name == 'CATEGORY_MENU' ):\n case( $conf_name == 'TREEMENU' ):\n // Follow the workflow\n break;\n default:\n $conf_array = $this->pObj->objJss->class_onchange( $conf_name, $conf_array, $this->row_number );\n break;\n }\n // IF NOT CATEGORY_MENU ajax class onchange\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = 'Check multiple!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n // Set multiple property\n // SWITCH type of filter\n switch ( $conf_name )\n {\n case ( 'SELECTBOX' ) :\n $size = $conf_array[ 'size' ];\n $multiple = null;\n if ( $size >= 2 )\n {\n if ( $conf_array[ 'multiple' ] == 1 )\n {\n $multiple = ' ' . $conf_array[ 'multiple.' ][ 'selected' ];\n }\n }\n break;\n case ( 'CHECKBOX' ) :\n// // #i0185, 150715, dwildt\n// $size = null;\n// $multiple = null;\n// if ( $conf_array[ 'multiple' ] == 1 )\n// {\n// $multiple = ' ' . $conf_array[ 'multiple.' ][ 'selected' ];\n// }\n// break;\n case ( 'CATEGORY_MENU' ) :\n case ( 'RADIOBUTTONS' ) :\n $size = null;\n $multiple = null;\n break;\n // #41753.01, 121010, dwildt, 4+\n case ('TREEVIEW') :\n $size = null;\n $multiple = true;\n break;\n default :\n if ( $this->pObj->b_drs_error )\n {\n $prompt = 'undefined value in switch: \\'';\n t3lib_div :: devlog( '[ERROR/JSS] ' . $prompt . $conf_name . '\\'', $this->pObj->extKey, 3 );\n }\n echo '<h1>Undefined value</h1>\n <h2>' . $conf_name . ' is not defined</h2>\n <p>Method ' . __METHOD__ . ' (line: ' . __LINE__ . ')</p>\n <p>Sorry, this error shouldn\\'t occured!</p>\n <p>Browser - TYPO3 without PHP</p>\n ';\n exit;\n break;\n }\n // SWITCH type of filter\n // Set multiple property\n // Get the all items wrap\n $itemsWrap = $this->htmlSpaceLeft . $conf_array[ 'wrap.' ][ 'object' ];\n // Remove empty class\n $itemsWrap = str_replace( ' class=\"\"', null, $itemsWrap );\n\n // Get nice piVar\n $key_piVar = $this->nicePiVar[ 'key_piVar' ];\n //$arr_piVar = $this->nicePiVar['arr_piVar'];\n $str_nicePiVar = $this->nicePiVar[ 'nice_piVar' ];\n\n // Get ID\n $id = $this->pObj->prefixId . '_' . $str_nicePiVar;\n $id = str_replace( '.', '_', $id );\n\n // Replace marker\n $itemsWrap = str_replace( '###TABLE.FIELD###', $key_piVar, $itemsWrap );\n $itemsWrap = str_replace( '###ID###', $id, $itemsWrap );\n $itemsWrap = str_replace( '###SIZE###', $size, $itemsWrap );\n $itemsWrap = str_replace( '###MULTIPLE###', $multiple, $itemsWrap );\n // Replace marker\n // Wrap all items\n $items = PHP_EOL . $items . $this->htmlSpaceLeft;\n $items = str_replace( '|', $items, $itemsWrap );\n // Wrap all items\n // IF CATEGORY_MENU ajax class onchange\n // #41753.01, 121010, dwildt, 4-\n// if($conf_name == 'CATEGORY_MENU')\n// {\n// $conf_array = $this->pObj->objJss->class_onchange($conf_name, $conf_array, $this->row_number);\n// }\n // #41753.01, 121010, dwildt, 10+\n switch ( true )\n {\n case( $conf_name == 'CATEGORY_MENU' ):\n case( $conf_name == 'TREEVIEW' ):\n $conf_array = $this->pObj->objJss->class_onchange( $conf_name, $conf_array, $this->row_number );\n break;\n default:\n // Follow the workflow\n break;\n }\n // IF CATEGORY_MENU ajax class onchange\n // Wrap the filter\n $items = $this->get_filterWrap( $items );\n\n // RETURN content\n $arr_return[ 'data' ][ 'items' ] = $items;\n return $arr_return;\n }", "private function getCheckboxOrRadioOptions($type) {\n $result = \"\";\n foreach($this->itemList as $key => $val) {\n $selectedText = \"\";\n if(in_array($key, $this->selectedItems)) {\n $selectedText = 'checked=\"checked\"';\n }\n $result .= '<section class=\"'.$type.'\">'.\"\\n \\t\";\n $result .= '<label>'.\"\\n \\t\";\n $result .= '<input type=\"'.$type.'\" value=\"'.$key.'\" name=\"'.$this->name.'\"/>'.$val.\"\\n \\t\";\n $result .= '</label>'.\"\\n \\t\";\n $result .= '</section>'.\"\\n \\t\";\n }\n return $result;\n }", "function taxonomy_meta_box_sanitize_cb_checkboxes($taxonomy, $terms)\n {\n }", "function buildOpts($vars) {\r\n // echo \"<pre>\";var_dump($vars);echo \"</pre>\";\r\n // Stock Filters\r\n $opts = array();\r\n $dependents = array( // checkbox names to input names\r\n 'stock_center' => 'stock_center',\r\n 'filter-developer' => 'filter-developer',\r\n 'filter-source' => 'filter-source',\r\n 'filter-country' => 'filter-country',\r\n 'filter-identifier' => 'name',\r\n 'filter-type' => 'type',\r\n 'filter-state' => 'filter-state',\r\n 'filter-line' => 'line', // TODO\r\n 'filter-linkage_groups' => 'linkage_groups',\r\n 'filter-genotypic_variation1' => 'genotypic_variation1',\r\n 'filter-karyotypic_variation' => 'karyotypic_variation'\r\n );\r\n //'num-states' => 'num-states',\r\n // 'state2' => 'state2'\r\n foreach ($dependents as $selected => $key) {\r\n if ((array_key_exists($selected, $vars) && $vars[$selected] == 'on')) {\r\n $opts[$key] = $vars[$key];\r\n }\r\n }\r\n \r\n // Filters passed as url params\r\n $dependentVals = array_values($dependents);\r\n foreach ($vars as $varKey => $varVal) {\r\n if (in_array($varKey, $dependentVals)) {\r\n $opts[$varKey] = $vars[$varKey];\r\n }\r\n }\r\n \r\n //Multiple selections from each of the below filters can now be made\r\n if (count($vars['states']) > 0) {\r\n $opts['num-states'] = count($vars['states']);\r\n for ($i=0; $i<$opts['num-states']; $i++) {\r\n $opts['state'.$i] = $vars['states'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['developers']) > 0) {\r\n $opts['num-developers'] = count($vars['developers']);\r\n for ($i=0; $i<$opts['num-developers']; $i++) {\r\n $opts['developer'.$i] = $vars['developers'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['sources']) > 0) {\r\n $opts['num-sources'] = count($vars['sources']);\r\n for ($i=0; $i<$opts['num-sources']; $i++) {\r\n $opts['source'.$i] = $vars['sources'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['countries']) > 0) {\r\n $opts['num-countries'] = count($vars['countries']);\r\n for ($i=0; $i<$opts['num-countries']; $i++) {\r\n $opts['country'.$i] = $vars['countries'][$i];\r\n }\r\n }\r\n \r\n \r\n //return $vars;\r\n \r\n //echo \"<br><br>opts dump <br>\";\r\n // echo \"<pre>\";var_dump($opts);echo \"</pre><br><br>\";\r\n \r\n //return $vars; //TODO: Test this well to make sure this doesnt break anything\r\n return $opts; //original code\r\n }", "public function paramsFilter(){\n\t\t\t\n\t\t\t$f = [];\n\t\t\t\n\t\t\t// Установка металла\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Металл',\n 'variabled' => 'metall',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$metallList = ['Комбинированное золото','Красное золото','Белое золото','Золочёное серебро','Чернёное серебро'];\n\t\t\t$metallListVals = ['kombinZoloto','krasnZoloto','belZoloto','zoloZoloto','chernZoloto']; \n\t\t\tforeach( $metallList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $metallListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка для кого\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Для кого',\n 'variabled' => 'sex',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$dlaKogo = ['Для женщин','Для мужчин', 'Для женщин, Для мужчин'];\n\t\t\t$dlaKogoVals = ['woman','men', 'unisex']; \n\t\t\tforeach( $dlaKogo as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $dlaKogoVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка размера\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Размер',\n 'variabled' => 'size',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$razmerList = ['2.0','12.0','13.0','13.5','14.0','14.5','15.0','15.5','16.0','16.5','17.0','17.5','18.0','18.5','19.0','19.5','20.0','20.5','21.0','21.5','22.0','22.5','23.0','23.5','24.0','24.5','25.0'];\n\t\t\t$razmerListVals = ['2_0','12_0','13_0','13_5','14_0','14_5','15_0','15_5','16_0','16_5','17_0','17_5','18_0','18_5','19_0','19_5','20_0','20_5','21_0','21_5','22_0','22_5','23_0','23_5','24_0','24_5','25_0']; \n\t\t\tforeach( $razmerList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $razmerListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add; \n\t\t\t\n\t\t\t// Установка вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Вставка',\n 'variabled' => 'kamen',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$kamenList = ['Бриллиант','Сапфир','Изумруд','Рубин','Жемчуг','Топаз','Аметист','Гранат','Хризолит','Цитрин','Агат','Кварц','Янтарь','Опал','Фианит'];\n\t\t\t$kamenListVals = ['brilliant','sapfir','izumrud','rubin','jemchug','topaz','ametist','granat','hrizolit','citrin','agat','kvarc','jantar','opal','fianit']; \n\t\t\tforeach( $kamenList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $kamenListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка формы вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Форма вставки',\n 'variabled' => 'forma_vstavki',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t];\t\t\t\n\t\t\t$formaList = ['Кабошон','Круг','Овал','Груша','Маркиз', 'Багет', 'Квадрат', 'Октагон', 'Триллион', 'Сердце', 'Кушон', 'Пятигранник', 'Шестигранник', 'Восьмигранник'];\n\t\t\t$formaListVals = ['Kaboshon','Krug','Oval','Grusha','Markiz', 'Baget', 'Kvadrat', 'Oktagon', 'Trillion', 'Serdtce', 'Kushon', 'Piatigranniq', 'Shestigranniq', 'Vosmigrannic']; \n\t\t\tforeach( $formaList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $formaListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n \n /*\n\t\t\t\techo json_encode( $f );\n\t\t\t*/\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $f );\n\t\t\techo \"</pre>\";\t\n\t\t\t\n\t\t\t\n \n \n // металл\n \n // для кого\n \n // размер\n \n // Камень\n \n // Форма вставки\n \n \n /*{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},\n\t\t\t\t\n\t\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},\n\t\t\t\t\n\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}*/\n \n\t\t\t/*\n\t\t\t[{\"type\":\"range-values\",\"title\":\"Цена\",\"variabled\":\"Cena\",\"impact\":\"price\",\"data\":[{\"title\":\"Цена от:\",\"value\":\"0\",\"variabled\":\"_ot\"},{\"title\":\"Цена до:\",\"value\":\"900000\",\"variabled\":\"_do\"}]},{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}]*/\n\t\t\t\n\t\t\t\n\t\t}", "function plugin_add_custom_meta_boxes(){\n add_meta_box( \"vehicle_inspector\", __(\"Vehicle Inspector\", \"listings\"), \"vehicle_inspector_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"vehicle_inspector\"));\n\tadd_meta_box( \"vehicle_status\", __(\"Vehicle Status\", \"listings\"), \"vehicle_status_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"vehicle_status\"));\n add_meta_box( \"options\", __(\"Options\", \"listings\"), \"plugin_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"options\"));\n\t$listing_categories = get_listing_categories();\n\t\n\tforeach($listing_categories as $category){\t\n\t\t\t\n\t\t$sfield = str_replace(\" \", \"_\", strtolower($category['singular']));\n\t\t\t\t\n\t\t$field = $name = $category['singular'];\n\n\t\tif($category['filterable'] == 1){\n\t\t\t$field = $field . \" (\" . __(\"Filterable\", \"listings\") . \")\";\n\t\t}\n\t}\n}", "function commercebox_core_filters_settings_form($form, &$form_state) {\n module_load_include('inc', 'facetapi', 'facetapi.admin');\n\n $searcher = 'search_api@product_display';\n $adapter = facetapi_adapter_load($searcher);\n $facet_info = facetapi_get_facet_info($searcher);\n $realm_name = 'block';\n $realm = facetapi_realm_load($realm_name);\n\n $cb_filters_settings = variable_get('commercebox_core_filters_settings', array());\n\n $form['filters'] = array(\n '#tree' => TRUE,\n );\n\n // Initialize some filters to display rows depending to filters weight.\n foreach ($cb_filters_settings as $key => $value) {\n $form['filters'][$key] = array();\n }\n\n foreach ($facet_info as $facet_name => $facet) {\n $settings = $adapter->getFacetSettings($facet, $realm);\n\n if ($settings->enabled) {\n $form['filters'][$facet_name]['drag'] = array();\n $form['filters'][$facet_name]['enabled'] = array(\n '#type' => 'checkbox',\n '#default_value' => empty($cb_filters_settings[$facet_name]) ? FALSE : $cb_filters_settings[$facet_name]['enabled'],\n );\n $form['filters'][$facet_name]['filter'] = array('#markup' => $facet['label']);\n $form['filters'][$facet_name]['title'] = array(\n '#type' => 'container',\n '#attributes' => array(\n 'class' => array('container-inline'),\n ),\n 'rewrite' => array(\n '#type' => 'checkbox',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['title']['rewrite'] : 0,\n ),\n 'value' => array(\n '#type' => 'textfield',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['title']['value'] : NULL,\n '#size' => 30,\n ),\n );\n\n // Builds array of operations to use in the dropbutton.\n $destination = drupal_get_destination();\n $operations = array();\n $operations[] = array(\n 'title' => t('Display'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'edit'),\n 'query' => $destination,\n );\n if ($facet['dependency plugins']) {\n $operations[] = array(\n 'title' => t('Dependencies'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'dependencies'),\n 'query' => $destination,\n );\n }\n if (facetapi_filters_load($facet_name, $searcher, $realm['name'])) {\n $operations[] = array(\n 'title' => t('Filters'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'filters'),\n 'query' => $destination,\n );\n }\n $form['filters'][$facet_name]['operations'] = array(\n '#theme' => 'links__ctools_dropbutton',\n '#links' => $operations,\n '#attributes' => array(\n 'class' => array('inline', 'links', 'actions', 'horizontal', 'right')\n ),\n );\n\n // Position (weight, drag&drop)\n $form['filters'][$facet_name]['weight'] = array(\n '#type' => 'textfield',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['weight'] : 0,\n '#size' => 3,\n '#attributes' => array('class' => array('filter-weight')), // needed for table dragging\n );\n }\n }\n\n $form['additional'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('additional-filter-settings')),\n 'value' => array(\n '#theme' => 'link',\n '#path' => 'admin/config/search/search_api/index/product_display',\n '#text' => t('Advanced filters settings'),\n '#options' => array(\n 'attributes' => array('class' => array('advanced-filter-settings')),\n 'html' => FALSE,\n ),\n ),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n // Attach the same css styles as used on the default facets form.\n $form['#attached']['css'] = array(\n drupal_get_path('module', 'facetapi') . '/facetapi.admin.css' => array(\n 'weight' => 1,\n ),\n drupal_get_path('module', 'commercebox') . '/commercebox.css',\n );\n\n return $form;\n}", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_articles_statuses2,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"account_type\"\t=> 'select_box(\"account_type\",\t$this->_account_types2,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t\t$selected, 0, 2, \"\", false)',\n\t\t));\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Get user account type\n\t\t$this->_account_types2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_account_types as $k => $v) {\n\t\t\t$this->_account_types2[$k]\t= $v;\n\t\t}\n\t\t// Get user account type\n\t\t$this->_articles_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_articles_statuses as $k => $v) {\n\t\t\t$this->_articles_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"cat_id\",\n\t\t\t\"user_id\",\n\t\t\t\"add_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"id_min\",\n\t\t\t\"id_max\",\n\t\t\t\"date_min\",\n\t\t\t\"date_max\",\n\t\t\t\"nick\",\n\t\t\t\"user_id\",\n\t\t\t\"title\",\n\t\t\t\"summary\",\n\t\t\t\"text\",\n\t\t\t\"account_type\",\n\t\t\t\"status\",\n\t\t\t\"cat_id\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t);\n\t}", "function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }" ]
[ "0.628021", "0.60545933", "0.60387933", "0.5972055", "0.5946254", "0.5880567", "0.58206594", "0.5687234", "0.5675121", "0.56599057", "0.56281555", "0.55951697", "0.5565834", "0.55546737", "0.5554669", "0.5551773", "0.5549098", "0.55293417", "0.5513308", "0.55008197", "0.549685", "0.54672223", "0.5449291", "0.5448816", "0.541154", "0.54063153", "0.53994447", "0.539923", "0.53984034", "0.5397702" ]
0.761955
0
Helper function to get all available filter types for a blog post. Searches for all avaiable filter types for a blog post in the database.
private function fetchFilterTypes() { $sql = ' SELECT * FROM Rm_Filters; '; $res = $this->db->executeSelectQueryAndFetchAll($sql); $filterTypesArray = array(); foreach ($res as $key => $row) { $name = htmlentities($row->name); $filterTypesArray[] = $name; } return $filterTypesArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_post_types() {\n\tglobal $rf_custom_posts;\n\n\t$post = new PostType();\n\t$cpts = $post->get_admin_post_pages();\n\n\t$cpts = array_merge($cpts, $rf_custom_posts);\n\t$cpts = apply_filters(\"admin/post_types\", $cpts);\n\n\treturn $cpts;\n}", "function ihc_get_all_post_types(){\n\tglobal $wpdb;\n\t$arr = array();\n\t$data = $wpdb->get_results('SELECT DISTINCT post_type FROM ' . $wpdb->prefix . 'posts WHERE post_status=\"publish\";');\n\tif ($data && count($data)){\n\t\tforeach ($data as $obj){\n\t\t\t$arr[] = $obj->post_type;\n\t\t}\n\t\t$exclude = array('bp-email', 'edd_log', 'nav_menu_item', 'bp-email');\n\t\tforeach ($exclude as $e){\n\t\t\tif ($k=array_search($e, $arr)){\n\t\t\t\tunset($arr[$k]);\n\t\t\t\tunset($k);\n\t\t\t}\n\t\t}\n\t}\n\treturn $arr;\n}", "public function getPostsTypes()\n\t {\n\t \t$args = array(\n\t\t\t 'public' => true,\n\t\t\t '_builtin' => false\n\t\t\t);\n\n\t\t\t$output = 'names'; // names or objects, note names is the default\n\t\t\t$operator = 'and'; // 'and' or 'or'\n\t\t\t$post_types = get_post_types( $args, $output, $operator ); \n\n\t\t\treturn $post_types;\n\t }", "static function get_filtered_post_types($blacklist = array()){\n\t\t$post_types = get_post_types();\n\t\t$result = array();\n\t\t$blacklist = array_merge($blacklist,array('attachment','revision','nav_menu_item','ml-slider','custom_css','customize_changeset'));\n\t\t$blacklist = array_unique(apply_filters(\"wbf/utilities/get_filtered_post_types/blacklist\",$blacklist));\n\t\tforeach($post_types as $pt){\n\t\t\tif(!in_array($pt,$blacklist)){\n\t\t\t\t$pt_obj = get_post_type_object($pt);\n\t\t\t\t$result[$pt_obj->name] = $pt_obj->label;\n\t\t\t}\n\t\t}\n\n\t\t$result = array_unique(apply_filters(\"wbf/utilities/get_filtered_post_types\",$result));\n\n\t\treturn $result;\n\t}", "function acf_get_post_types($args = array())\n{\n}", "function post_types()\n{\n $collection = collect(get_post_types(array( '_builtin' => false ), 'objects'))\n ->pluck('label', 'name')\n ->except(array( 'acf-field', 'acf-field-group', 'wp_stream_alerts', 'wp_area' ))\n ->prepend(get_post_type_object('page')->labels->name, 'page')\n ->prepend(get_post_type_object('post')->labels->name, 'post')\n ->all();\n\n return $collection;\n}", "private function get_post_types() {\n\n\t\t$output = 'names'; // names or objects, note names is the default\n\t\t$operator = 'and'; // 'and' or 'or'\n\n\t\t// Collate builtin and custom post-types\n\t\t$builtin_post_types = get_post_types( array( 'public' => true, '_builtin' => true ), $output, $operator );\n\t\t$custom_post_types = get_post_types( array( \n\t\t\t// Perhaps later introduce an option to select whether to include non-public CPTs as well.\n\t\t\t//'public' => true, \n\t\t\t'_builtin' => false \n\t\t\t), \n\t\t$output, $operator );\n\t\t$post_types = array_merge( $builtin_post_types, $custom_post_types );\n\n\t\treturn $post_types;\n\t}", "public function get_envira_types( $post ) {\n\n $types = array(\n 'default' => __( 'Default', 'envira-gallery' )\n );\n\n return apply_filters( 'envira_gallery_types', $types, $post );\n\n }", "public function get_filters() {\n\t\treturn [\n\t\t\t'type' => new \\Fieldmanager_Select(\n\t\t\t\t[\n\t\t\t\t\t'first_empty' => true,\n\t\t\t\t\t'options' => $this->get_filter_options(),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'post_type' => new \\Fieldmanager_Select(\n\t\t\t\t[\n\t\t\t\t\t'multiple' => true,\n\t\t\t\t\t'first_empty' => false,\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'size' => 5,\n\t\t\t\t\t],\n\t\t\t\t\t'options' => [\n\t\t\t\t\t\t'post' => __( 'Posts', 'civil-first-fleet' ),\n\t\t\t\t\t],\n\t\t\t\t\t'display_if' => [\n\t\t\t\t\t\t'src' => 'type',\n\t\t\t\t\t\t'value' => 'post_type',\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t),\n\t\t\t'category_id' => new \\Fieldmanager_Select(\n\t\t\t\t[\n\t\t\t\t\t'datasource' => new \\Fieldmanager_Datasource_Term(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t]\n\t\t\t\t\t),\n\t\t\t\t\t'display_if' => [\n\t\t\t\t\t\t'src' => 'type',\n\t\t\t\t\t\t'value' => 'category',\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t),\n\t\t\t'post_tag_id' => new \\Fieldmanager_Select(\n\t\t\t\t[\n\t\t\t\t\t'datasource' => new \\Fieldmanager_Datasource_Term(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'taxonomy' => 'post_tag',\n\t\t\t\t\t\t]\n\t\t\t\t\t),\n\t\t\t\t\t'display_if' => [\n\t\t\t\t\t\t'src' => 'type',\n\t\t\t\t\t\t'value' => 'post_tag',\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t),\n\t\t];\n\t}", "function voyage_mikado_blog_types() {\n\n $types = array_merge(voyage_mikado_blog_grid_types(), voyage_mikado_blog_full_width_types());\n\n return $types;\n\n }", "function ee_get_post_types($post_types, $args)\n {\n }", "private function get_registered_post_types() {\n\t\t$post_types = get_post_types( array(), 'names' );\n\t\t$post_types = array_diff( $post_types, array( 'attachment', 'revision', 'nav_menu_item', 'customize_changeset', 'custom_css', 'oembed_cache', 'user_request', 'wp_block' ) );\n\t\t$data = array();\n\t\tforeach ( $post_types as $post_type ) {\n\t\t\t$data[] = $post_type;\n\t\t}\n\t\treturn $data;\n\t}", "public static function typesConditions($post = null)\n {\n $types = Arr::pluck(self::base(), 'condition', 'type');\n\n // ==============================================================\n // Add post types\n // ==============================================================\n foreach ((array) get_post_types(array('_builtin' => false)) as $post_type) {\n $types = Arr::prepend(\n $types,\n function () use ($post_type) {\n return is_singular($post_type);\n },\n $post_type\n );\n }\n\n // ==============================================================\n // Add taxonomies\n // ==============================================================\n foreach ((array) get_taxonomies(array('_builtin' => false), 'objects') as $tax) {\n $tax_name = $tax->name;\n $types = Arr::prepend(\n $types,\n function () use ($tax_name) {\n return is_tax($tax_name);\n },\n $tax_name\n );\n }\n\n // ==============================================================\n // Add template page\n // ==============================================================\n if (null !== $post) {\n $page_template = trim((string) get_post_meta($post->ID, '_wp_page_template', true));\n if ('' !== $page_template) {\n $types = Arr::prepend(\n $types,\n function () {\n return true;\n },\n $page_template\n );\n }\n }\n return $types;\n }", "function medigroup_mikado_blog_types() {\n\n $types = array_merge(medigroup_mikado_blog_grid_types(), medigroup_mikado_blog_full_width_types());\n\n return $types;\n\n }", "public function dmaps_get_post_types() {\n\t\t\t\t\n\t\t$args = array(\n\t\t 'public' => true,\n\t\t '_builtin' => false\n\t\t);\n\n\t\t$post_types = get_post_types( $args ); \n\t\t$post_arr = array( 'post' => 'Post', 'page' => 'Page' );\n\n\t\tforeach ( $post_types as $post_type ) {\n\n\t\t\t$arr = array($post_type => $post_type);\n\t\t\t$post_arr += $arr;\n\n\t\t}\n\t\t\n\t\treturn $post_arr;\t\n\n\t}", "function get_all_post_type_supports($post_type)\n {\n }", "function elb_get_supported_post_types() {\n\tglobal $elb_options;\n\n\t$post_types = !empty( $elb_options['post_types'] ) ? $elb_options['post_types'] : array( 'post' );\n\n\treturn apply_filters( 'elb_post_types', $post_types );\n}", "function get_search_query_types()\n{\n // Apply the filter only once.\n static $searchQueryTypes;\n if ($searchQueryTypes) {\n return $searchQueryTypes;\n }\n\n $searchQueryTypes = array(\n 'keyword' => __('Keyword'),\n 'boolean' => __('Boolean'),\n 'exact_match' => __('Exact match'),\n );\n $searchQueryTypes = apply_filters('search_query_types', $searchQueryTypes);\n return $searchQueryTypes;\n}", "public static function all_post_types()\n\t{\n\t\treturn array_merge(App::config('builtin_post_types'), App::get_public_cpt());\n\t}", "function get_all($post_type) {\n\n\treturn new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t\t=> $post_type,\n\t\t\t'posts_per_page'\t=> -1\n\t\t)\n\t);\n\n}", "function get_post_types($args = array(), $output = 'names', $operator = 'and')\n {\n }", "public function postTypes()\n {\n return $this->morphedByMany(\n PostType::class,\n 'metable',\n 'metables',\n 'meta_id',\n );\n }", "function voicewp_news_post_types() {\n\t/**\n\t * Filters the post types whose content is included in the bundled News skill.\n\t *\n\t * @param array $post_types Post type names.\n\t */\n\treturn apply_filters( 'voicewp_post_types', array( 'post' ) );\n}", "public static function activePostTypes(): array\n {\n return apply_filters('notification_center/activated_posttypes', get_post_types(array('public' => true)));\n }", "function get_search_record_types()\n{\n $searchRecordTypes = array(\n 'Item' => __('Item'),\n 'File' => __('File'),\n 'Collection' => __('Collection'),\n );\n $searchRecordTypes = apply_filters('search_record_types', $searchRecordTypes);\n return $searchRecordTypes;\n}", "public static function types()\n\t{\n\t\t$states = array(\n\t\t\t'blog' => __('Blog'),\n\t\t\t'page' => __('Page'),\n\t\t\t'user' => __('User')\n\t\t);\n\n\t\t$values = Module::action('gleez_types', $states);\n\n\t\treturn $values;\n\t}", "public static function getAllFestivalTypes()\n\t{\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\t$sql = \"SELECT * FROM fest_type\";\n\t\t$query = $database->query($sql);\n\n\t\t// fetchAll() is the PDO method that gets all result rows\n\t\treturn $query->fetchAll();\n\t}", "public function getAllFilters();", "public function getFilters() {\n $filters = [];\n\n // Add a default filter on the publishing status field, if available.\n if ($this->entityType && is_subclass_of($this->entityType->getClass(), EntityPublishedInterface::class)) {\n $field_name = $this->entityType->getKey('published');\n $this->filters = [\n $field_name => [\n 'value' => TRUE,\n 'table' => $this->base_table,\n 'field' => $field_name,\n 'plugin_id' => 'boolean',\n 'entity_type' => $this->entityTypeId,\n 'entity_field' => $field_name,\n ],\n ] + $this->filters;\n }\n\n $default = $this->filter_defaults;\n\n foreach ($this->filters as $name => $info) {\n $default['id'] = $name;\n $filters[$name] = $info + $default;\n }\n\n return $filters;\n }", "public static function alm_get_all_filters(){\n global $wpdb;\n \t$prefix = esc_sql( ALM_FILTERS_PREFIX );\n \t$options = $wpdb->options;\n \t$t = esc_sql( \"$prefix%\" );\n \t$sql = $wpdb -> prepare ( \"SELECT option_name FROM $options WHERE option_name LIKE '%s'\", $t );\n \t$filters = $wpdb -> get_col( $sql );\n\n \t$filters = ALMFilters::alm_remove_filter_license_options($filters);\n\n \treturn $filters;\n }" ]
[ "0.6671693", "0.6498214", "0.6497156", "0.64058065", "0.6348347", "0.62792", "0.6231867", "0.6212867", "0.62043047", "0.6199089", "0.61669433", "0.6164254", "0.6147313", "0.60947895", "0.6075863", "0.6025813", "0.6018699", "0.6003767", "0.59879774", "0.5974607", "0.5911771", "0.5896038", "0.58856547", "0.58754086", "0.58598423", "0.5796571", "0.5757181", "0.575351", "0.57470345", "0.5744299" ]
0.6808397
0
Delete the orders from the sales_order_grid table if not automatically done by the system //
public function deleteOrderFromGrid($observer) { $order = $observer->getOrder(); if ($order->getId()) { $coreResource = Mage::getSingleton('core/resource'); $writeConnection = $coreResource->getConnection('core_write'); $salesOrderGridTable = $coreResource->getTableName('sales_flat_order_grid'); $query = sprintf('Delete from %s where entity_id = %s', $salesOrderGridTable, (int)$order->getId()); $writeConnection->raw_query($query); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_sales_order() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['so_id']);\n\t\tif($this->update(\"sales_order\",$values,$where)) {\t\t\t\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting sales tbl';\n\t}", "public function edd_gdpr_delete_orders($email)\n { \n /*\n * delete order with all information\n */\n global $wpdb;\n \n $delete_customermeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customermeta WHERE customer_id IN (SELECT user_id FROM {$wpdb->prefix}edd_customers WHERE email = %s)\",$email));\n\n $delete_customer = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customers WHERE email =%s\",$email)); \n \n $delete_purchase = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}posts WHERE ID IN (SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %s)\",'_edd_payment_user_email',$email));\n \n\t\t$delete_purchasemeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}postmeta WHERE post_id IN (select edd_id from(SELECT post_id as edd_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %d) post_ids)\",'_edd_payment_user_email',$email));\n }", "function MyShop_OrderDelete($args) {\n global $_TABLES;\n\n $sql = \"DELETE FROM {$_TABLES['myshop_order']} WHERE orderid = '{$args['orderid']}'\";\n DB_query($sql);\n}", "protected function _remove($order_id){\n\t\t$resource = Mage::getSingleton('core/resource');\n\t\t$delete = $resource->getConnection('core_read');\n\t\t$order_table = $resource->getTableName('sales_flat_order_grid');\n\t\t$invoice_table = $resource->getTableName('sales_flat_invoice_grid');\n\t\t$shipment_table = $resource->getTableName('sales_flat_shipment_grid');\n\t\t$creditmemo_table = $resource->getTableName('sales_flat_creditmemo_grid');\n\t\t$sql = \"DELETE FROM \" . $order_table . \" WHERE entity_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $invoice_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $shipment_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\t$sql = \"DELETE FROM \" . $creditmemo_table . \" WHERE order_id = \" . $order_id . \";\";\n\t\t$delete->query($sql);\n\t\n\t\treturn true;\n\t}", "static function cleanup()\n {\n $db = eZDB::instance();\n $rows = $db->arrayQuery( \"SELECT productcollection_id FROM ezorder\" );\n\n $db = eZDB::instance();\n $db->begin();\n if ( count( $rows ) > 0 )\n {\n $productCollectionIDList = array();\n foreach ( $rows as $row )\n {\n $productCollectionIDList[] = $row['productcollection_id'];\n }\n eZProductCollection::cleanupList( $productCollectionIDList );\n }\n // Who deletes which order in shop should be logged.\n eZAudit::writeAudit( 'order-delete', array( 'Comment' => 'Removed all orders from the database: eZOrder::cleanup()' ) );\n\n eZOrderItem::cleanup();\n $db->query( \"DELETE FROM ezorder_status_history\" );\n $db->query( \"DELETE FROM ezorder\" );\n $db->commit();\n }", "public function deleteAllOrdersInBasket() {\n\n //$delete = $this->delete($where);\n // first we need the basketID\n $basketUser = $this->getBasketUserFromAuth();\n // then we delete all detail of the basket\n $result = null;\n if ($basketUser != null) {\n $basketDetailModel = new Application_Model_BasketDetail();\n $result = $basketDetailModel->deleteAllOrdersInBasket($basketUser);\n }\n\n // then the basket\n try {\n $basketID = $basketUser['basketID'];\n// $result = $this->delete(Zend_Db_Table::SELECT_WITH_FROM_PART)\n// ->where('basketID = ?', $basketID);\n \n $condition = array(\n 'basketID = ?' => $basketID\n );\n $this->delete($condition);\n \n } catch (Exception $ex) {\n \n }\n }", "public function delete_OrderPage(){\n $id_product = $_REQUEST[\"id_product\"];\n $id_order = $_REQUEST[\"id_order\"];\n $query = \"DELETE FROM order_u\n WHERE order_u.id = $id_order;\";\n $data = $this->connection->query($query);\n\n $query = \"DELETE FROM order_product\n WHERE order_product.order_id = $id_order;\";\n $data = $this->connection->query($query);\n \n }", "public function makeOrders() {\n $this->cleanOrderLogs();\n $r = $this->updateSales();\n if (!$r) return false;\n // select tragento_sales with order_id = 0\n $db = Mage::getSingleton('core/resource')->getConnection('core_read');\n $query = \"SELECT * FROM `tragento_sales` WHERE order_id=0 ORDER BY purchase_id ASC\";\n $orders = $db->fetchAll($query);\n foreach ($orders as $order) {\n $this->makeOrder($order);\n }\n return true;\n }", "public function clearOrder() {\n\t\t\t$this->order->clearOrder();\n\t\t}", "private function deleteOrderInformation()\n {\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $sql = \"UPDATE `s_core_snippets`\n SET `value` = CASE\n WHEN `value` = 'Transaction ID' THEN 'Free text 4'\n WHEN `value` = 'Transaktions-ID' THEN 'Freitextfeld 4'\n ELSE `value`\n END\n WHERE `namespace` = 'backend/order/main'\n AND `value` IN ('Transaction ID','Transaktions-ID')\";\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $sql = \"DELETE FROM s_attribute_configuration WHERE `table_name` = 's_order_attributes' AND\n `column_name` IN ('attribute4') AND\n `label` IN ('Transaction ID')\";\n }\n Shopware()->Db()->query($sql);\n }", "protected function _afterSave() {\r\n $enabled = $this->getData('groups/ordersgrid/fields/enabled/value');\r\n $value = $enabled ? 0 : 1;\r\n try {\r\n Mage::getModel('core/config_data')\r\n ->load(self::ENABLED_MENU_ORDERS, 'path')\r\n ->setValue($value)\r\n ->setPath(self::ENABLED_MENU_ORDERS)\r\n ->save();\r\n \r\n // check db setup\r\n $resource = Mage::getSingleton('core/resource');\r\n $connection = $resource->getConnection('core_write');\r\n if (!$connection->tableColumnExists($resource->getTableName('sales/order'), 'order_group_id')) {\r\n $connection->delete($resource->getTableName('core/resource'), \"code = 'mageworx_ordersgrid_setup'\");\r\n }\r\n } catch (Exception $e) {\r\n Mage::logException($e);\r\n }\r\n }", "public function destroy(Orders $orders)\r\n {\r\n //\r\n }", "public function deleteOrder($order_id);", "public function clear_all_orders()\n {\n if(request('sabotaj') == 'Sabotaj'){\n\n //Delete all orders\n $all_orders = Order::pluck('id');\n Order::whereIn('id',$all_orders)->delete();\n\n //Delete all product options\n CartProductOption::truncate();\n\n //Delete cart items\n $all_cart_items = CartItem::pluck('id');\n CartItem::whereIn('id',$all_cart_items)->delete();\n\n //Delete cart products\n $all_cart_products = CartProduct::pluck('id');\n CartProduct::whereIn('id',$all_cart_products)->delete();\n\n //Delete all carts\n $all_carts = Cart::pluck('id');\n Cart::whereIn('id',$all_carts)->delete();\n\n return 'Silindi';\n }\n }", "public function destroy(orders $orders)\n {\n //\n }", "function tep_remove_order($order_id, $restock = false)\n{\n if ($restock == 'on')\n {\n $order_query = tep_db_query(\"select products_id, products_quantity from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n\n while ($order = tep_db_fetch_array($order_query))\n {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = products_quantity + \" . $order['products_quantity'] . \", products_ordered = products_ordered - \" . $order['products_quantity'] . \" where products_id = '\" . (int)$order['products_id'] . \"'\");\n }\n\n }\n\n tep_db_query(\"delete from \" . TABLE_ORDERS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_STATUS_HISTORY . \" where orders_id = '\" . (int)$order_id . \"'\");\n tep_db_query(\"delete from \" . TABLE_ORDERS_TOTAL . \" where orders_id = '\" . (int)$order_id . \"'\");\n}", "public function sDeleteBasketOrder()\r\n {\r\n $sessionId = Shopware()->Session()->get('sessionId');\r\n\r\n if (empty($sessionId)) return;\r\n\r\n $deleteWholeOrder = Shopware()->Db()->fetchAll(\"\r\n SELECT * FROM s_order_basket WHERE sessionID = ?\r\n \",array($sessionId));\r\n\r\n foreach ($deleteWholeOrder as $orderDelete) {\r\n Shopware()->Db()->executeUpdate(\"\r\n DELETE FROM s_order_basket WHERE id = ?\r\n \",array($orderDelete[\"id\"]));\r\n }\r\n }", "public function remove($ids, $auth = true)\n {\n\n if ($auth and !vmAccess::manager('orders.delete')) {\n return false;\n }\n\n $invM = VmModel::getModel('invoice');\n $table = $this->getTable($this->_maintablename);\n $removedOrderMsgs = array();\n foreach ($ids as $id) {\n\n $order = $this->getOrder($id);\n\n $invoice = $invM->hasInvoice($id);\n if ($invoice) {\n $removedOrderMsgs[$order['details']['BT']->order_number] = 'COM_VIRTUEMART_ORDER_NOT_ALLOWED_TO_DELETE';\n continue;\n }\n\n if (!empty($order['items'])) {\n foreach ($order['items'] as $it) {\n $this->removeOrderLineItem($it->virtuemart_order_item_id, $auth);\n }\n }\n\n $this->removeOrderItems($id, $auth);\n\n $psTypes = array('shipment', 'payment');\n $db = JFactory::getDbo();\n foreach ($psTypes as $_psType) {\n $idM = 'virtuemart_' . $_psType . 'method_id';\n if (!empty($order['details']['BT']->{$idM})) {\n $q = 'SELECT `' . $_psType . '_element` FROM `#__virtuemart_' . $_psType . 'methods` ';\n $q .= 'WHERE `virtuemart_' . $_psType . 'method_id` = \"' . (int)$order['details']['BT']->{$idM} . '\" ';\n $db->setQuery($q);\n $plg_name = $db->loadResult();\n if (empty($plg_name)) continue;\n $_tablename = '#__virtuemart_' . $_psType . '_plg_' . $plg_name;\n\n $q = 'DELETE FROM ' . $_tablename . ' WHERE virtuemart_order_id=\"' . $id . '\"';\n $db->setQuery($q);\n $db->execute();\n }\n }\n\n // rename invoice number by adding the date, and update the invoice table\n //$this->renameInvoice($id );\t//there must be no invoice, (checked above)\n if (!$table->delete((int)$id)) {\n $removedOrderMsgs[$order['details']['BT']->order_number] = 'COM_VIRTUEMART_ORDER_PB_WHILE_DELETING';\n }\n $removedOrderMsgs[$order['details']['BT']->order_number] = true;\n }\n return $removedOrderMsgs;\n }", "protected function _clearOrders($nht8bfb4e1aa590eab8f08f837b97acf5803a5737ed, $nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61)\n {\n if (!$nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['config']['import']['orders']) {\n return array(\n 'result' => 'process',\n 'function' => '_clearReviews'\n );\n }\n $nht0ec6d150549780250a9772c06b619bcc46a0e560 = array(\n 'result' => 'process'\n );\n $nht2037de437c80264ccbce8a8b61d0bf9f593d2322 = $this->_objectManager->create('Magento\\Sales\\Model\\Order')\n ->getCollection()\n ->addFieldToFilter('store_id', array_values($nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['config']['languages']))\n ->setPageSize($nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['clear_info']['limit'])\n ->setCurPage(1);\n if (!count($nht2037de437c80264ccbce8a8b61d0bf9f593d2322)) {\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['function'] = '_clearReviews';\n } else {\n foreach ($nht2037de437c80264ccbce8a8b61d0bf9f593d2322 as $nhtcce55e4309a753985bdd21919395fdc17daa11e4) {\n try {\n $nhtcce55e4309a753985bdd21919395fdc17daa11e4->delete();\n } catch (\\Exception $nht58e6b3a414a1e090dfc6029add0f3555ccba127f) {\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['result'] = 'error';\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['msg'] = \"Order Id = {$nhtcce55e4309a753985bdd21919395fdc17daa11e4->getId()} delete failed. Error: \" . $nht58e6b3a414a1e090dfc6029add0f3555ccba127f->getMessage();\n break;\n }\n }\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['function'] = '_clearOrders';\n }\n return $nht0ec6d150549780250a9772c06b619bcc46a0e560;\n }", "public function destroy(Orders $orders)\n {\n //\n }", "public function destroy(Orders $orders)\n {\n //\n }", "public function sales_unsaved_delete()\n {\n $sales_no = $this->input->post('sales_no');\n /** Remove auto created sales journal */\n $journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created money receipt for partial or full cash sales */\n $mr = $this->MAc_money_receipts->get_by_doc('Sales', $sales_no);\n if (count($mr) > 0)\n {\n $this->MAc_money_receipts->delete($mr['id']);\n }\n /** Remove sales */\n $this->MSales_details->delete_by_sales_no($sales_no);\n $this->MSales_master->delete_by_sales_no($sales_no);\n }", "private function cleanup()\n\t{\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// delete 14 day old processed product records, always leaving at least 5\n\t\tee()->sync_db->query(\"DELETE FROM products WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY) AND id NOT IN (SELECT id FROM ( SELECT id FROM `products` WHERE processed = 1 ORDER BY id DESC LIMIT 5 ) keepers)\");\n\t\t\n\t\t// delete old inventory records\t\n\t\tee()->sync_db->query(\"DELETE FROM products_inventory WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 2 DAY)\");\n\n\t\t// delete old shipping records\n\t\tee()->sync_db->query(\"DELETE FROM orders_shipping WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY)\");\n\n\t\t// delete old processed records\n\t\tee()->sync_db->query(\"DELETE FROM orders_processed WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY)\");\n\t\t\n\t}", "public function delete_order()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$order_id = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $order_id);\n\t\t\t$old_order_details = $this->order_model->get_all_details(PRODUCT, array('id' => $order_id));\n\t\t\t$this->update_old_list_values($order_id, array(), $old_order_details);\n\t\t\t$this->update_user_order_count($old_order_details);\n\t\t\t$this->order_model->commonDelete(PRODUCT, $condition);\n\t\t\t$this->setErrorMessage('success', 'Order deleted successfully');\n\t\t\tredirect('admin/order/display_order_list');\n\t\t}\n\t}", "public function destroy(Order $orders)\n {\n //\n }", "public function cleanReceivedOrders () {\n\n\t\t$filter = new \\Maven\\Core\\Domain\\OrderFilter();\n\t\t$filter->setStatusID( OrderStatusManager::getReceivedStatus()->getId() );\n\n\t\t// A week old\n\t\t$today = MavenDateTime::getWPCurrentDateTime();\n\n\t\t$toDate = new \\Maven\\Core\\MavenDateTime( $today );\n\t\t$toDate->subFromInterval( 'P1W' );\n\n\t\t$filter->setOrderDateTo( $toDate->mySqlFormatDate() );\n\n\t\t$orders = $this->getOrders( $filter );\n\n\t\tforeach ( $orders as $order ) {\n\n\t\t\t//Check if the order has some contact on it.\n\t\t\tif ( !$order->hasBillingInformation() && !$order->hasShippingInformation() && !$order->hasContactInformation() ) {\n\t\t\t\t$this->delete( $order->getId() );\n\t\t\t}\n\t\t}\n\t}", "public function delete_batch_order_detail()\n {\n $order = new Order($this->input);\n $jsonAlert = new JSONAlert();\n\n try {\n $jsonAlert->append_batch(array(\n 'model'=>$order,\n 'check_empty'=>array(\n 'id'=>'Id Needed!',\n 'detail_ids'=>'Please select at least one detail to continue!'\n )\n ));\n } catch(Exception $e) {\n echo 'Message: ' .$e->getMessage();\n }\n\n /* Check order is Completed or Cancelled */\n $orderModelQuery = $this->db->get_where('t_remarketing_order', array(\n 'id' =>$order->id\n ));\n $orderModel = $orderModelQuery->row_array();\n if( strcasecmp( $orderModel['order_status'],'completed' )==0 || strcasecmp( $orderModel['order_status'],'cancelled' )==0 )\n {\n $jsonAlert->append(array(\n 'errorMsg'=>'Order status is completed or cancelled, please refresh current page!'\n ), TRUE);\n }\n\n if( ! $jsonAlert->hasErrors )\n {\n foreach ($order->detail_ids as $detail_id)\n {\n $orderDetailModelQuery = $this->db->get_where('t_remarketing_order_detail', array(\n 'id'=>$detail_id\n ));\n $orderDetailModel = $orderDetailModelQuery->row_array();\n $this->db->update('t_warehouse_product', array(\n 'is_locked' =>'N'\n ), array(\n 'id' =>$orderDetailModel['product_id']\n ));\n\n $this->db->delete('t_remarketing_order_detail', array(\n 'id'=>$detail_id\n ));\n }\n\n $orderDetailModelQuery = $this->db->get_where('t_remarketing_order_detail', array(\n 'order_id'=>$order->id\n ));\n\n if($orderDetailModelQuery->num_rows() > 0)\n {\n $totalAmount = 0;\n $totalWeight = 0;\n foreach ($orderDetailModelQuery->result_object() as $orderDetail)\n {\n $totalAmount += $orderDetail->price;\n $totalWeight += $orderDetail->weight;\n }\n $totalGST = $totalAmount*0.15;\n $totalAmountGST = $totalAmount*1.15;\n\n $shippingFee = 0;\n\n /* If shipping method is Shipping, then */\n if( $order->shipping_method == 'Shipping' )\n {\n $item_weight_kg = 1;\n if( $totalWeight > 1000 )\n {\n $item_weight_kg = $totalWeight / 1000;\n if( $totalWeight % 1000 != 0 )\n {\n $item_weight_kg ++;\n }\n $item_weight_kg = sprintf(\"%01.0f\",$item_weight_kg);\n }\n\n $courierPricingModelQuery = $this->db->get_where('t_warehouse_courier_pricing', array(\n 'id' =>$order->courier_pricing_id\n ));\n $courierPricingModel = $courierPricingModelQuery->row_array();\n\n $shippingFee += ( $courierPricingModel['charge_wholesaler_per_kg'] * $item_weight_kg );\n $totalAmountGST += ( $courierPricingModel['charge_wholesaler_per_kg'] * $item_weight_kg );\n }\n\n $this->db->update('t_remarketing_order', array(\n 'payable_amount'=>$totalAmountGST,\n 'total_amount'=>$totalAmount,\n 'gst'=>$totalGST,\n 'total_amount_gst'=>$totalAmountGST,\n 'total_weight'=>$totalWeight,\n 'shipping_fee'=>$shippingFee,\n ), array(\n 'id'=>$order->id\n ));\n\n $jsonAlert->append(array(\n 'successMsg'=>'Selected order detail(s) deleted!'\n ), FALSE);\n }\n else\n {\n $this->db->delete('t_remarketing_order', array(\n 'id'=>$order->id\n ));\n $jsonAlert->append(array(\n 'successMsg'=>'Order deleted!'\n ), FALSE);\n }\n }\n echo $jsonAlert->result();\n\t}", "public static function clean()\n {\n try {\n Mage::getModel('hackathon_ordertransaction/mongo')->clean();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }", "public function clear_scheduled_export() {\n\n\t\twp_clear_scheduled_hook( 'wc_customer_order_csv_export_auto_export_orders' );\n\t}", "public function run()\n {\n \t DB::table('sales_orders')->delete();\n\n $sales_orders = array(\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('sales_orders')->insert($sales_orders);\n }" ]
[ "0.6939104", "0.66541797", "0.62175447", "0.6169507", "0.607712", "0.604732", "0.5993249", "0.58917665", "0.58903766", "0.58878994", "0.58656967", "0.584516", "0.58392155", "0.58344936", "0.58268297", "0.5823819", "0.5809307", "0.5778861", "0.5761266", "0.57592285", "0.57592285", "0.5757795", "0.5753098", "0.57265437", "0.5720264", "0.5704025", "0.5685223", "0.56636757", "0.56548285", "0.56540006" ]
0.6656095
1
Returns the node(s) that contain the data for the individual layers of the geo dataset.
protected function findLayerNodes() { return $this->selectMany(array('sos:Contents', 'sos:ObservationOfferingList', 'sos:ObservationOffering'), null, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDatasetNodes()\n {\n $nodes = array();\n $classIdentifier = $this->openDataIni->variable( 'GeneralSettings', 'DatasetClassIdentifier' );\n $class = eZContentClass::fetchByIdentifier( $classIdentifier );\n if ( $class instanceof eZContentClass )\n {\n $params = array(\n 'ClassFilterType' => 'include',\n 'ClassFilterArray' => array( $classIdentifier ),\n 'Depth' => 1,\n 'DepthOperator' => 'ge'\n );\n $nodes = eZContentObjectTreeNode::subTreeByNodeID( $params,\n eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ) ); \n }\n return $nodes;\n }", "public function getNodes();", "public function getLayers();", "public function get_all(): array\n {\n return $this->nodes;\n }", "public function getAllGeonodes() {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\t\t$qb->where(\"rel.geometryvalue IS NOT NULL\");\n\t\treturn $qb->getQuery()->getResult();\n\t}", "function getNodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "function _simplegeo_tileservice_get_nodes($x, $y, $zoom, $lang, $layer, $type) {\n $zoom = 21 - $zoom;\n $top_left = _simplegeo_tileservice_tile2coord($x, $y, $zoom);\n $bottom_right = _simplegeo_tileservice_tile2coord($x+1, $y+1, $zoom);\n $nodes = array();\n // Use views as query builder if a view is specified.\n if (module_exists('views') && $layer->conf['view'] && $view = views_get_view($layer->conf['view'])) {\n // Sanity check; make sure the user added the bounding_box argument to the view.\n // TODO: Add support for other displays than \"default\"?.\n $argument_setting = $view->display['default']->display_options['arguments'];\n if (is_array($argument_setting)) {\n $first_argument_setting = current($argument_setting);\n if ($first_argument_setting['id'] == 'bounding_box') {\n // Create the string expected by the bounding box argument.\n $box = $top_left['lat'] . ',' . $top_left['long'] . ',' . $bottom_right['lat'] . ',' . $bottom_right['long'];\n $view->set_arguments(array($box));\n $view->execute();\n foreach ($view->result as $node) {\n $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point));\n $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid);\n }\n }\n }\n }\n // Build our own query based on layer settings.\n else {\n $sql = \"SELECT n.nid, AsText(ps.position) AS simple_geo_point\n FROM {node} n\n INNER JOIN {simple_geo_position} ps ON n.nid = ps.nid AND ps.type = 'node' \";\n\n // Define the WHERE part of the query. We first define some defaults.\n $wheres = array(\n 'n.status <> 0',\n \"Contains(Envelope(GeomFromText('LineString(%s %s,%s %s)')), ps.position)\",\n \"n.language = '%s'\",\n );\n if (!empty($layer->conf['node_type'])) {\n $wheres[] = \"n.type = '%s'\";\n }\n\n // If max age is defined check so the node isn't older than the specified age.\n if (!empty($layer->conf['max_age'])) {\n $wheres[] = 'n.created >= ' . strtotime('-' . $layer->conf['max_age']);\n }\n\n // If update since is defined check so the node has been updated since the specified time.\n if (!empty($layer->conf['updated_since'])) {\n $wheres[] = 'n.changed >= ' . strtotime('-' . $layer->conf['updated_since']);\n }\n\n // Add the WHEREs to the query.\n $sql .= ' WHERE ' . implode(' AND ', $wheres);\n\n $sql .= \" ORDER BY n.created\";\n\n $params = array($top_left['lat'], $top_left['long'], $bottom_right['lat'], $bottom_right['long'], $lang);\n if (isset($layer->conf['node_type'])) {\n $params[] = $layer->conf['node_type'];\n }\n\n $res = db_query(db_rewrite_sql($sql), $params);\n\n while ($node = db_fetch_object($res)) {\n $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point));\n $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid);\n }\n }\n\n return $nodes;\n}", "public function getLeagueNodes()\n {\n return $this->getOrCreateLeagueBag();\n }", "public function getLayers() {\n return $layers;\n }", "function get_nodes()\n {\n\n \tif( !isset($this->cache['trees'][$this->tree_id]['nodes']))\n \t{\n \t\tee()->db->select('*');\n\t\t\tee()->db->from( $this->tree_table );\n\t\t\tee()->db->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left');\n\t\t\tee()->db->join('statuses', 'statuses.status = channel_titles.status', 'left');\n \t\t$nodes = ee()->db->get()->result_array();\n\n \t\t// map field names => type\n\t\t\t$cf_map = array();\n\t\t\tforeach( $this->cache['trees'][$this->tree_id]['fields'] as $cf)\n\t\t\t{\n\t\t\t $cf_map[$cf['name']] = $cf['type'];\n\t\t\t}\n\n \t\t// reindex with node ids as keys\n \t\t$node_data = $entry_data = array();\n \t\tforeach($nodes as $node)\n \t\t{\n \t\t\t// if the node is associated with an entry\n \t\t\t// create another index for those\n \t\t\tif($node['entry_id'])\n \t\t\t{\n \t\t\t\t$entry_data[ $node['entry_id'] ] = $node['node_id'];\n \t\t\t}\n\n \t\t\tif($node['type'] != '')\n \t\t\t{\n \t\t\t\t$node['type'] = explode('|', $node['type']);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$node['type'] = array();\n \t\t\t}\n\n \t\t\tif(!empty($node['field_data']))\n \t\t\t{\n \t\t\t\tee()->load->library('taxonomy_field_lib');\n \t\t\t\t$node['field_data'] = json_decode($node['field_data'], TRUE);\n \t\t\t\tforeach($node['field_data'] as $k => $v)\n \t\t\t\t{\n \t\t\t\t\t// this should apply to front end template parsing only \n \t\t\t\t\t$callers = debug_backtrace();\n \t\t\t\t\tif ( isset($callers[2]['function']) && $callers[2]['function'] == 'process_tags' && isset($cf_map[$k]))\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t$ft = ee()->taxonomy_field_lib->load($cf_map[$k]);\n \t\t\t\t\t\t// let the fieldtype change the final value\n \t\t\t$v = $ft->replace_value($v);\n \t\t\t// overwrite value\n \t\t\t$node['field_data'][$k] = $v;\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t$node[$k] = $v;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t$node_data[ $node['node_id'] ] = $node;\n \t\t\t$node_data[ $node['node_id'] ]['url'] = $this->build_url($node);\n \t\t\t\n \t\t}\n\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_node_id'] = $node_data;\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_entry_id'] = $entry_data;\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id]['nodes'];\n\n }", "public function getNodes(){\n\t\treturn $this->nodes;\n\t}", "public function getNodes()\n {\n return $this->nodes;\n }", "public function getNodes()\n {\n return $this->nodes;\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "public function layers() : Traversable;", "public function getNodes()\n\t{\n\t\treturn $this->nodes;\n\t}", "public function getFieldNodes(): array\n {\n return $this->organize()->nodes;\n }", "function getNodes() {\n\treturn db_query(\"SELECT nodename,ipaddress FROM Nodes\");\n}", "public function get_locations($nodes);", "function layers(string $id) : array {\n $layers = [];\n foreach ($this->features[$id]['files'] as $geojfileName => $position) {\n $geojfile = new GeoJFile($this->dirpath.'/'.$this->geojfiles[$geojfileName]);\n $feature = $geojfile->quickReadOneFeature($position);\n $description = \"<b>$geojfileName</b><br>\\n\";\n foreach ($feature['properties'] as $k => $v)\n $description .= \"<i>$k</i>: $v<br>\\n\";\n $feature['description'] = $description;\n $layers[$geojfileName]['data'] = $feature;\n }\n return $layers;\n }", "public function getLeafs() {\n\t\treturn $this->leafs;\n\t}", "public function getNodes(): array\n {\n return \\array_merge(\n parent::getNodes(),\n $this->constraints,\n $this->indexes\n );\n }", "public function getNodes() {\n if (is_null($this->_nodes)) {\n $this->_nodes = array();\n try{\n $data = Mage::helper('core')->jsonDecode($this->getPage()->getNodesData());\n }catch (Zend_Json_Exception $e){\n $data = null;\n }\n\n $collection = Mage::getModel('gri_cms/hierarchy_node')->getCollection()\n ->joinCmsPage()\n ->setOrderByLevel()\n ->joinPageExistsNodeInfo($this->getPage());\n\n if (is_array($data)) {\n foreach ($data as $v) {\n if (isset($v['page_exists'])) {\n $pageExists = (bool)$v['page_exists'];\n } else {\n $pageExists = false;\n }\n $node = array(\n 'node_id' => $v['node_id'],\n 'parent_node_id' => $v['parent_node_id'],\n 'label' => $v['label'],\n 'page_exists' => $pageExists,\n 'page_id' => $v['page_id'],\n 'current_page' => (bool)$v['current_page']\n );\n if ($item = $collection->getItemById($v['node_id'])) {\n $node['assigned_to_stores'] = $this->getPageStoreIds($item);\n } else {\n $node['assigned_to_stores'] = array();\n }\n\n $this->_nodes[] = $node;\n }\n } else {\n\n foreach ($collection as $item) {\n if ($item->getLevel() == Gri_Cms_Model_Hierarchy_Node::NODE_LEVEL_FAKE) {\n continue;\n }\n /* @var $item Gri_Cms_Model_Hierarchy_Node */\n $node = array(\n 'node_id' => $item->getId(),\n 'parent_node_id' => $item->getParentNodeId(),\n 'label' => $item->getLabel(),\n 'page_exists' => (bool)$item->getPageExists(),\n 'page_id' => $item->getPageId(),\n 'current_page' => (bool)$item->getCurrentPage(),\n 'assigned_to_stores' => $this->getPageStoreIds($item)\n\n );\n $this->_nodes[] = $node;\n }\n }\n }\n return $this->_nodes;\n }" ]
[ "0.69531584", "0.6744865", "0.65617007", "0.611288", "0.6093506", "0.6091973", "0.6084357", "0.6084357", "0.6084357", "0.6084357", "0.6084357", "0.6084357", "0.605004", "0.6039816", "0.60021156", "0.59513474", "0.5928887", "0.5840039", "0.5840039", "0.5807506", "0.5807506", "0.5721503", "0.56923", "0.5690868", "0.56773174", "0.56747425", "0.5570907", "0.555018", "0.5544383", "0.55305934" ]
0.70368403
0
Parses and returns the unique identifier from the specified layer node.
protected function parseIdentifierFromContents(\SimpleXMLElement $node) { $gmlAttributes = $this->selectAttributes($node, $this->getNamespace('gml')); return empty($gmlAttributes['id']) ? null : $gmlAttributes['id']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function nodeId($with_ns=true) {\t\t\n\t\t$i = explode(':', $this->host, 3);\n\t\t$i = (count($i) > 1 ) ? $i[1] : $i[0];\n\t\t$i=explode('.',$i);\n\t\t$p = array_reverse($i);\n\t\t$id = implode('.', $p); \n\t\t$resultId = $with_ns ? self::ns().':'.$id :$id;\t\t\n\t\t\n\t\treturn $resultId;\t\t\n\t}", "function celerity_generate_unique_node_id() {\n static $uniq = 0;\n $response = CelerityAPI::getStaticResourceResponse();\n $block = $response->getMetadataBlock();\n\n return 'UQ'.$block.'_'.($uniq++);\n}", "public function getNodeId();", "function getElementId($a_node)\n\t{\n\t\t$node = (array) $a_node;\n\t\treturn $node[0];\n\t}", "abstract public function getIdent();", "function getIdentifier(&$record) {\n\t\t$parsedContents =& $record->getParsedContents();\n\t\tif (isset($parsedContents['identifier'])) {\n\t\t\treturn array_shift($parsedContents['identifier']);\n\t\t}\n\t\treturn null;\n\t}", "public function getIdentifier()\n {\n return $this->getAttribute($this->identifier);\n }", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "protected function getIdentifier () {\n\t\n\t\tif (!isset($this->tableName)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$parts = explode(\"_\", $this->tableName);\n\t\t$finalPart = $parts[(count($parts) - 1)];\n\t\t\n\t\treturn substr($finalPart, 0, -1).\"ID\";\n\t\n\t}", "function getIdentifier() ;", "function getIdentifier() ;", "function getIdentifier() ;", "public abstract function getIdentifier();", "abstract public function getIdentifier();", "public function getId(): int\n {\n return (int)substr($this->token, 0, strpos($this->token, ':'));\n }", "public function getIdentifier()\n {\n return $this->getAttribute('metadata.name', null);\n }", "function getGuid() {\n\t return $this->node->getText();\n\t}", "function _get_unique_id_for_node_field() {\n $arg = arg();\nif (!empty($_SESSION['node_preview_unique'])) {\n $reporter_id = $_SESSION['node_preview_unique'];\n }\n else {\n // format uniqueid time node add\n // format uniqueid time nodeid edit\n // So in future we can track from which opration this entry is made.\n \n $unique = 'preview_' . uniqid() . time() . \"_\" .$arg[1] . \"_\" .$arg[2];\n $_SESSION['node_preview_unique'] = $unique;\n $reporter_id = $_SESSION['node_preview_unique'];\n }\n return $reporter_id;\n}", "function getUniqueID(){\n\t\treturn $this->module.'_'.$this->ID;\n\t}", "public function getIdentAttribute()\n {\n $flight_id = $this->airline->code;\n $flight_id .= $this->flight_number;\n\n # TODO: Add in code/leg if set\n\n return $flight_id;\n }", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();" ]
[ "0.58505815", "0.58393985", "0.5761638", "0.57505697", "0.5667095", "0.5659223", "0.5558624", "0.5554576", "0.55543", "0.55543", "0.5554172", "0.5554172", "0.5554172", "0.5554172", "0.5554172", "0.5520159", "0.5518353", "0.5518353", "0.5518025", "0.5513176", "0.55083776", "0.5507169", "0.5505685", "0.54843426", "0.5483445", "0.5464618", "0.5462154", "0.5443891", "0.5443891", "0.5443891" ]
0.65222526
0
Parses and returns extra data from the specified layer node. Extra data might contain data we need to gather as global data, e.g. bounding boxes or time extents, but are not needed for the layer as of now. Returns an array with key value pairs.
protected function parseExtraDataFromContents(\SimpleXMLElement $node) { $sosNode = $node->children($this->getNamespace('sos')); $data = array(); // Time if (!empty($sosNode->time) && $sosNode->count() > 0) { foreach (array('begin', 'end') as $when) { $gmlNode = $sosNode->time->children($this->getNamespace('gml')); $position = $this->selectOne(array("gml:{$when}Position|gml:{$when}"), $gmlNode); if (isIso8601Date($position)) { $data[$when . 'Time'] = new \DateTime($position); } } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function &getExtraFieldData() {\n\t\tif (!isset($this->extra_field_data)) {\n\t\t\t$this->extra_field_data = array();\n\t\t\t$res = db_query_params ('SELECT * FROM artifact_extra_field_data WHERE artifact_id=$1 ORDER BY extra_field_id',\n\t\t\t\t\t\tarray ($this->getID())) ;\n\t\t\t$ef = $this->ArtifactType->getExtraFields();\n\t\t\twhile ($arr = db_fetch_array($res)) {\n\t\t\t\t$type=$ef[$arr['extra_field_id']]['field_type'];\n\t\t\t\tif (($type == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($type==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {\n\t\t\t\t\t//accumulate a sub-array of values in cases where you may have multiple rows\n\t\t\t\t\tif (!array_key_exists($arr['extra_field_id'], $this->extra_field_data) || !is_array($this->extra_field_data[$arr['extra_field_id']])) {\n\t\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']][]=$arr['field_data'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = $arr['field_data'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->extra_field_data;\n\t}", "public function getExtraData();", "abstract protected function getAdditionalJsonData(): array;", "private function getExtraArray() {\n\t\treturn $this->extraArray;\n\t}", "public function get_additional_info()\n {\n return array();\n }", "public function getAdditionalData() {\n\t\treturn $this->additional_data;\n\t}", "public function getAdditionalData()\n {\n return $this->additionalData;\n }", "private function getAttributeSetData(array $additional): array\n {\n $data = [\n 'attributes' => [],\n 'groups' => [],\n 'not_attributes' => [],\n 'removeGroups' => [],\n 'attribute_set_name' => 'Default',\n ];\n\n return array_merge($data, $additional);\n }", "public function getExtra()\n {\n return json_decode($this->extra);\n }", "public function extraPortfolioItemInfo()\n\t{\n\t\t$extraInfo = array();\n\t\t\n\t\t$extraInfo['total_text'] \t= $this->lang->words['total_funds'];\n\t\t$extraInfo['cost'] \t\t= $this->caches['ibEco_banks'][ $cartItem['p_type_id'] ]['b_loans_app_fee'];\n\t\t$extraInfo['total'] \t\t= $this->caches['ibEco_banks'][ $cartItem['p_type_id'] ]['outstanding_loan_amt'];\n\t\t$extraInfo['total_bought']\t= $this->currencySymbolForSums().$this->registry->getClass('class_localization')->formatNumber( $extraInfo['total'], $this->decimalPlacesForSums());\n\t\t\n\t\treturn $extraInfo;\n\t}", "function getExtraFieldDataText() {\n\t\t// First we get the list of extra fields and the data\n\t\t// associated to the fields\n\t\t$efs = $this->ArtifactType->getExtraFields();\n\t\t$efd = $this->getExtraFieldData();\n\n\t\t$return = array();\n\n\t\tforeach ($efs as $efid => $ef) {\n\t\t\t$name = $ef[\"field_name\"];\n\t\t\t$type = $ef[\"field_type\"];\n\n\t\t\t// Get the value according to the type\n\t\t\tswitch ($type) {\n\n\t\t\t\t// for these types, the associated value comes straight\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXT:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_RELATION:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_INTEGER:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $efd[$efid];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// the other types have and ID or an array of IDs associated to them\n\t\t\t\tdefault:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $this->ArtifactType->getElementName($efd[$efid]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = 'None';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t$return[$efid] = array(\"name\" => $name, \"value\" => $value, 'type' => $type);\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getAdditionalData()\n {\n return $this->data;\n }", "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "protected function storeExtraInfo()\n\t{\n\t\t$input = $this->connection->getExtraInfo();\n\t\t\n\t\tif (!isset($input)) {\n\t\t\t$this->extrainfo[] = null;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!is_string($input)) {\n\t\t\ttrigger_error(\"Metadata in other forms that a string is not yet supported\", E_USER_NOTICE);\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t$info[] = (object)array('type'=>'_raw_', 'value'=>$input);\n\t\t\n\t\t$matches = null;\n\t\tif (preg_match_all('%<extraInfo>.*?</extraInfo>%is', $input, $matches, PREG_SET_ORDER)) {\n\t\t\tforeach ($matches[0] as $xml) {\n\t\t\t\t$sxml = new SimpleXMLElement($xml);\n\t\t\t\t$info[] = (object)array('type'=>(string)$sxml->type, 'value'=>(string)$sxml->value->string);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->extrainfo[] = $info;\n\t}", "public function extraInfo();", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getExtra(){\n $_ARR = false;\n\n if(is_array($this->head)){\n foreach($this->head as $key => $val)\n if(substr_compare($key,'_',0,1,true) != 0)\n $_ARR[$key] = $val;\n\n }\n\n return $_ARR;\n }", "public function getExtraInformation() {\n return $this->extra;\n }", "public function extra(): array;", "public function getAdditionalData() {\n return $this->item->getAdditionalData();\n }", "public function extraPortfolioItemInfo()\n\t{\n\t\t$extraInfo = array();\n\t\t\n\t\t$extraInfo['total_text'] \t= $this->lang->words['global_shares_owned'];\n\t\t$extraInfo['cost'] \t\t \t= $this->caches['ibEco_stocks'][ $this->cartItem['p_type_id'] ]['s_value'];\n\t\t$extraInfo['total']\t \t \t= $this->caches['ibEco_stocks'][ $this->cartItem['p_type_id'] ]['total_share_value'];\n\t\t$extraInfo['total_bought']\t= $this->currencySymbolForSums().$this->registry->getClass('class_localization')->formatNumber( $extraInfo['total'], $this->decimalPlacesForSums());\n\t\t\n\t\treturn $extraInfo;\n\t}", "function getAdditionalAttributes() ;" ]
[ "0.576444", "0.55446875", "0.551412", "0.5475458", "0.54067564", "0.5353275", "0.5313549", "0.5288786", "0.5275319", "0.5243624", "0.52359694", "0.51627815", "0.5090331", "0.50881976", "0.5087167", "0.50682473", "0.50682473", "0.50682473", "0.5067277", "0.5067277", "0.50668526", "0.50668526", "0.50668526", "0.50668526", "0.50442666", "0.5034941", "0.50208294", "0.50135076", "0.49780148", "0.49481234" ]
0.56737256
1
Parses and returns the bounding boxes with their respective CRS from the specified layer node.
protected function parseBoundingBoxFromContents(\SimpleXMLElement $node) { $list = array(); $gmlNs = $this->getNamespace('gml'); $gmlNode = $node->children($gmlNs); if (!empty($gmlNode->boundedBy)) { // boundedBy $bbNode = $gmlNode->boundedBy->children($gmlNs); if (!empty($bbNode->Envelope)) { // Envelope $envelopeAttrs = $this->selectAttributes($bbNode->Envelope); // Seems we don't need a ns prefix here $envNode = $bbNode->Envelope->children($gmlNs); if (!empty($envNode->lowerCorner) && !empty($envNode->upperCorner)) { // lower/upperCorner $crs = isset($envelopeAttrs['srsName']) ? $envelopeAttrs['srsName'] : ''; $list[] = $this->parseCoords(strval($envNode->lowerCorner), strval($envNode->upperCorner), $crs, false, true); // Reverse axis order in GML } } } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBBox($asRect = true) {}", "public function getBoundingBox() {}", "function bbox(string $id): Rect {\n if (!isset($this->features[$id]))\n return new Rect([41, -4, 51, 10]);\n else\n return $this->features[$id]['bbox'];\n }", "public function bbox()\n {\n $minX = PHP_INT_MAX;\n $minY = PHP_INT_MAX;\n $maxX = PHP_INT_MIN;\n $maxY = PHP_INT_MIN;\n $n = 0;\n\n foreach($this->coordinates() as $xy)\n {\n list($x, $y) = $xy;\n $minX = min($minX, $x);\n $minY = min($minY, $y);\n $maxX = max($maxX, $x);\n $maxY = max($maxY, $y);\n $n++;\n }\n\n if($n > 0)\n {\n return array($minX, $minY, $maxX, $maxY);\n }\n else\n {\n return false;\n }\n }", "private function readXYBoundingBox()\n {\n // Variables are used here because the order of the output array elements is different!\n $xmin = $this->readDoubleL(Shapefile::FILE_SHP);\n $ymin = $this->readDoubleL(Shapefile::FILE_SHP);\n $xmax = $this->readDoubleL(Shapefile::FILE_SHP);\n $ymax = $this->readDoubleL(Shapefile::FILE_SHP);\n return [\n 'xmin' => $xmin,\n 'xmax' => $xmax,\n 'ymin' => $ymin,\n 'ymax' => $ymax,\n ];\n }", "public function fetchBBOX() {\r\n $row = $this->db->query(\"SELECT ST_X(geom)-0.0001 AS w, ST_X(geom)+0.0001 AS e, ST_YMIN(geom)-0.0001 AS s, ST_YMAX(geom)+0.0001 AS n FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n $row->w = (float) $row->w;\r\n $row->s = (float) $row->s;\r\n $row->e = (float) $row->e;\r\n $row->n = (float) $row->n;\r\n return $row;\r\n}", "private function getSpatialExtent($bboxes)\n {\n if (count($bboxes) === 0 || !isset($bboxes[0])) {\n return null;\n }\n\n /*\n * Empty geometry is allowed in GeoJSON\n */\n $bbox = $bboxes[0];\n for ($i = 1, $ii = count($bboxes); $i < $ii; $i++) {\n if (isset($bboxes[$i])) {\n $bbox = array(\n min($bbox[0], $bboxes[$i][0]),\n min($bbox[1], $bboxes[$i][1]),\n max($bbox[2], $bboxes[$i][2]),\n max($bbox[3], $bboxes[$i][3]),\n );\n }\n }\n\n return $bbox;\n }", "public abstract function getBoundingBox(): Rectangle;", "public function fetchBBOX() {\r\n $row = $this->db->query(\"SELECT ST_XMIN(geom) AS w, ST_XMAX(geom) AS e, ST_YMIN(geom) AS s, ST_YMAX(geom) AS n FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n $row->w = (float) $row->w;\r\n $row->s = (float) $row->s;\r\n $row->e = (float) $row->e;\r\n $row->n = (float) $row->n;\r\n return $row;\r\n}", "protected function _getBBox() {}", "public function getBoundingBox($recalc = false) {}", "public function getViewBox(){\n\n\t\tif(!empty($this->xmlDocument['viewBox'])){\n\n\t\t\t$viewBox = $this->getValuesFromList($this->xmlDocument['viewBox']);\n\t\t\tif(count($viewBox) !== 4){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn array(\n\t\t\t\t'x' => $viewBox[0]*1,\n\t\t\t\t'y' => $viewBox[1]*1,\n\t\t\t\t'width' => $viewBox[2]*1,\n\t\t\t\t'height' => $viewBox[3]*1,\n\t\t\t);\n\n\t\t}\n\n\t\tif(!empty($this->xmlDocument['width']) && !empty($this->xmlDocument['height'])){\n\n\t\t\t$width = trim($this->xmlDocument['width']);\n\t\t\t$height = trim($this->xmlDocument['height']);\n\t\t\tif(isset($this->unitInPixels[substr($width, -2)])){\n\t\t\t\t$width = $width*$this->unitInPixels[substr($width, -2)];\n\t\t\t}\n\t\t\tif(isset($this->unitInPixels[substr($height, -2)])){\n\t\t\t\t$height = $height*$this->unitInPixels[substr($height, -2)];\n\t\t\t}\n\t\t\treturn array(\n\t\t\t\t'x' => 0,\n\t\t\t\t'y' => 0,\n\t\t\t\t'width' => $width*1,\n\t\t\t\t'height' => $height*1,\n\t\t\t);\n\n\t\t}\n\n\t\treturn null;\n\n\t}", "protected function getLatLngBox(SimpleXMLElement $kmz)\r\n {\r\n $groundOverlay = $this->getGroundOverlayObject($kmz);\r\n if ($groundOverlay == null) {\r\n return null;\r\n } else {\r\n return json_decode(json_encode($groundOverlay->LatLonBox));\r\n }\r\n }", "public function getRect() {}", "private function getBounds() {\n\t\tif ($this->element->ParentElement instanceof TreeView) {\n\t\t\t$children = $this->element->ParentElement->Children;\n\t\t\t$firstElement = $children->Get(1);\n\t\t\t$lastElement = $children->Get($children->Count() - 2);\n\t\t} else {\n\t\t\t$children = $this->element->ParentElement->ContainerElement->Children;\n\t\t\t$firstElement = $children->Get(0);\n\t\t\t$lastElement = $children->Get($children->Count() - 1);\n\t\t}\n\t\treturn [$firstElement, $lastElement];\n\t}", "function getByBBOX($w,$s,$e,$n) {\r\n $geom = sprintf(\"ST_Transform(ST_GeometryFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))',4326),3734)\",\r\n $w, $s,\r\n $w, $n,\r\n $e, $n,\r\n $e, $s,\r\n $w, $s\r\n );\r\n $row = $this->db->query(\"SELECT * FROM {$this->table} WHERE ST_Intersects(the_geom,$geom) LIMIT 1\");\r\n $row = $row->row();\r\n return $row;\r\n}", "public function getBounds();", "public function getBoxes() {\r\n\t\treturn $this->_boxes;\r\n\t}", "public function get_bbox($region)\n\t{\n\t\t$dir = $_SERVER[\"DOCUMENT_ROOT\"].'/data';\n\t\tif (!file_exists($dir))\n\t\t\tmkdir($dir);\n\n\t\t$fname = \"$dir/bbox.json\";\n\n\t\tif (file_exists($fname)) {\n\n\t\t\t$st = file_get_contents($fname);\n\n\t\t\t$a = json_decode($st, true);\n\t\t\tif (is_null($a)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isset($a[$region])) {\n\t\t\t\treturn $a[$region];\n\t\t\t}\n\t\t}\n\n\t\t// TODO: сделать одну функцию для запросов к Overpass API\n\t\t$url = \"https://overpass.openstreetmap.ru/api/interpreter\";\n\t\t//$url = \"https://overpass-api.de/api/interpreter\";\n\n\t\t// FIXME: запрос слишком много инфы загружает, поправить\n\t\t$query =\n\t\t\t'[out:json][timeout:180];\n\t\t\trel[ref=\"'.$region.'\"][admin_level=4][boundary=administrative];\n\t\t\tout bb;';\n\n\t\t$page = $this->get_web_page($url, $query);\n\t\tif (is_null($page)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$page = json_decode($page, true);\n\t\tif (is_null($page)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!$page) {\n\t\t\t$bbox = null;\n\t\t} else {\n\t\t\t$bbox = [\n\t\t\t\t'minlat' => $page['elements'][0]['bounds']['minlat'],\n\t\t\t\t'minlon' => $page['elements'][0]['bounds']['minlon'],\n\t\t\t\t'maxlat' => $page['elements'][0]['bounds']['maxlat'],\n\t\t\t\t'maxlon' => $page['elements'][0]['bounds']['maxlon'],\n\t\t\t];\n\n\t\t\t$a[$region] = $bbox;\n\t\t\t$st = json_encode($a);\n\t\t\tfile_put_contents($fname, $st);\n\t\t}\n\n\t\treturn $bbox;\n\t}", "function parseGeojson(array $data, $bmpFile = null) {\n list($w, $h) = $bmpFile ? (getimagesize($bmpFile) ?: []) : [0, 0];\n $w = 0; // don't flip horizontally\n\n if (($type = $data['type'] ?? '') !== 'FeatureCollection') {\n throw new Exception(\"Unrecognized Geojson type: $type\");\n }\n\n $res = [];\n\n foreach ($data['features'] as $exteriorIndex => $feature) {\n if (($type = $feature['type'] ?? '') !== 'Feature') {\n throw new Exception(\"Unrecognized Geojson feature: $type\");\n }\n if (($type = $feature['geometry']['type'] ?? '') !== 'Polygon') {\n throw new Exception(\"Unrecognized Geojson geometry: $type\");\n }\n\n // https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6\n // \"For Polygons with more than one of these rings, the first MUST be\n // the exterior ring, and any others MUST be interior rings.\"\n foreach ($feature['geometry']['coordinates'] as $i => $coords) {\n $ref = &$res[$exteriorIndex][];\n\n // potrace contour is such that its bottom and right edges are on the outside\n // of the shape while top and left are inside. In other words, if right or bottom\n // edge's pixel is at (X;Y) then potrace will specify it as (X+1;Y+1)\n // but will specify (X;Y) for left and top edges. Therefore $x/$y can equal\n // to $w/$h (which they normally should not). We don't normalize this here\n // because this is very minor offset that the player will hardly recognize.\n //\n // Also, potrace flips the image vertically which, given the above, can\n // result in negative X/Y (-1 at minimum). This too works fine with <map>.\n //\n // Memo: potrace ensures that last coord closes the path but <map> would\n // do that automatically anyway.\n foreach ($coords as [$x, $y]) {\n $w and $x = $w - $x;\n $h and $y = $h - $y;\n $ref[] = round($x);\n $ref[] = round($y);\n }\n }\n }\n\n return $res;\n}", "private function getLatLngBoxFromPlacemark(array $placemark_data)\r\n {\r\n $minLat = $maxLat = floatval($placemark_data[0]->lat);\r\n $minLng = $maxLng = floatval($placemark_data[0]->lng);\r\n\r\n foreach ($placemark_data as $place_mark) {\r\n $minLat = min(floatval($place_mark->lat), $minLat);\r\n $maxLat = max(floatval($place_mark->lat), $maxLat);\r\n $minLng = min(floatval($place_mark->lng), $minLng);\r\n $maxLng = max(floatval($place_mark->lng), $maxLng);\r\n }\r\n\r\n $LatLngBox = new \\stdClass();\r\n $LatLngBox->north = $maxLat;\r\n $LatLngBox->south = $minLat;\r\n $LatLngBox->east = $maxLng;\r\n $LatLngBox->west = $minLng;\r\n $LatLngBox->rotation = 0;\r\n\r\n return $LatLngBox;\r\n }", "public function getAllBox($pipelinekey = null) \n\t{\n\t\t$requestor \t= new \\Streak\\ApiRequestor();\n\t\t$endpoint\t= '/v1/pipelines/'.$pipelinekey.\"/boxes\";\n\t\t$data \t\t= $requestor->request($endpoint);\n\t\t\n return $data;\n\t}", "public static function box2dTobbox($box2d)\n {\n return isset($box2d) ? array_map('floatval', explode(',', str_replace(' ', ',', substr(substr($box2d, 0, strlen($box2d) - 1), 4)))) : null;\n }", "public function getRectangle() {}", "public function getRouteBBox($instance_id, $route_id)\n {\n if ($this->routeExists($instance_id, $route_id)) {\n $q = \"\n\t\t SELECT\n\t\t\tCONCAT (\n\t\t\tST_Xmin(ST_Envelope(ST_Collect(geom))),',',\n\t\t\tST_Ymin(ST_Envelope(ST_Collect(geom))),',',\n\t\t\tST_Xmax(ST_Envelope(ST_Collect(geom))),',',\n\t\t\tST_Ymax(ST_Envelope(ST_Collect(geom)))) as bbox\n \t\t FROM track\n \t\t WHERE track_id\n \t\t IN (SELECT track_id FROM related_track WHERE route_id=$route_id AND instance_id='$instance_id')\n AND instance_id='$instance_id'\n ;\";\n $a = $this->select($q);\n $bbox = $a[0]['bbox'];\n $bboxArray = explode(',', $bbox);\n $dx = 0.05;\n $dy = 0.05;\n $bboxArray[0] -= $dx;\n $bboxArray[1] -= $dy;\n $bboxArray[2] += $dx;\n $bboxArray[3] += $dy;\n\n return implode(',', $bboxArray);\n }\n }", "public function getFontBBox();", "function _simplegeo_tileservice_get_nodes($x, $y, $zoom, $lang, $layer, $type) {\n $zoom = 21 - $zoom;\n $top_left = _simplegeo_tileservice_tile2coord($x, $y, $zoom);\n $bottom_right = _simplegeo_tileservice_tile2coord($x+1, $y+1, $zoom);\n $nodes = array();\n // Use views as query builder if a view is specified.\n if (module_exists('views') && $layer->conf['view'] && $view = views_get_view($layer->conf['view'])) {\n // Sanity check; make sure the user added the bounding_box argument to the view.\n // TODO: Add support for other displays than \"default\"?.\n $argument_setting = $view->display['default']->display_options['arguments'];\n if (is_array($argument_setting)) {\n $first_argument_setting = current($argument_setting);\n if ($first_argument_setting['id'] == 'bounding_box') {\n // Create the string expected by the bounding box argument.\n $box = $top_left['lat'] . ',' . $top_left['long'] . ',' . $bottom_right['lat'] . ',' . $bottom_right['long'];\n $view->set_arguments(array($box));\n $view->execute();\n foreach ($view->result as $node) {\n $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point));\n $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid);\n }\n }\n }\n }\n // Build our own query based on layer settings.\n else {\n $sql = \"SELECT n.nid, AsText(ps.position) AS simple_geo_point\n FROM {node} n\n INNER JOIN {simple_geo_position} ps ON n.nid = ps.nid AND ps.type = 'node' \";\n\n // Define the WHERE part of the query. We first define some defaults.\n $wheres = array(\n 'n.status <> 0',\n \"Contains(Envelope(GeomFromText('LineString(%s %s,%s %s)')), ps.position)\",\n \"n.language = '%s'\",\n );\n if (!empty($layer->conf['node_type'])) {\n $wheres[] = \"n.type = '%s'\";\n }\n\n // If max age is defined check so the node isn't older than the specified age.\n if (!empty($layer->conf['max_age'])) {\n $wheres[] = 'n.created >= ' . strtotime('-' . $layer->conf['max_age']);\n }\n\n // If update since is defined check so the node has been updated since the specified time.\n if (!empty($layer->conf['updated_since'])) {\n $wheres[] = 'n.changed >= ' . strtotime('-' . $layer->conf['updated_since']);\n }\n\n // Add the WHEREs to the query.\n $sql .= ' WHERE ' . implode(' AND ', $wheres);\n\n $sql .= \" ORDER BY n.created\";\n\n $params = array($top_left['lat'], $top_left['long'], $bottom_right['lat'], $bottom_right['long'], $lang);\n if (isset($layer->conf['node_type'])) {\n $params[] = $layer->conf['node_type'];\n }\n\n $res = db_query(db_rewrite_sql($sql), $params);\n\n while ($node = db_fetch_object($res)) {\n $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point));\n $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid);\n }\n }\n\n return $nodes;\n}", "public function getFontBBox() {}", "public function getFontBBox() {}", "public function getFontBBox() {}" ]
[ "0.540775", "0.53783554", "0.53258723", "0.5287493", "0.5038154", "0.48737642", "0.4836997", "0.4833065", "0.4790857", "0.47859162", "0.4758138", "0.47483277", "0.47249335", "0.4709717", "0.47087935", "0.4659645", "0.46443167", "0.45930764", "0.45829073", "0.45825565", "0.45650113", "0.45256677", "0.45048568", "0.44988218", "0.44903073", "0.44735155", "0.44628048", "0.44484377", "0.44484377", "0.44484377" ]
0.633317
0
Test that scripts sources are replaced.
public function test_scripts_replaced() { $scripts = wp_scripts(); $s = Use_unpkg::get_instance()->unpkg_scripts; foreach ( $s as $handle => $data ) { if ( in_array( $handle, array( 'twentysixteen-html5', 'html5', 'jquery-scrollto' ) ) ) { continue; } $script = $scripts->query( $handle ); $this->assertContains( 'https://unpkg.com', $script->src, $handle . ' should be loading from unpkg' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testScriptMagicSlugs() {\n\t\t$this->Helper->addScript('libraries', ':hash-default');\n\t\t$this->Helper->addScript('thing', ':hash-default');\n\t\t$this->Helper->addScript('jquery.js', ':hash-jquery');\n\t\t$this->Helper->addScript('jquery-ui.js', ':hash-jquery');\n\n\t\t$hashOne = md5('libraries_thing');\n\t\t$hashTwo = md5('jquery.js_jquery-ui.js');\n\n\t\t$result = $this->Helper->includeAssets();\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/' . $hashOne . '.js?file%5B0%5D=libraries&amp;file%5B1%5D=thing'\n\t\t\t)),\n\t\t\t'/script',\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/' . $hashTwo . '.js?file%5B0%5D=jquery.js&amp;file%5B1%5D=jquery-ui.js'\n\t\t\t)),\n\t\t\t'/script'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testCodeChanges() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldBeCalledOnce();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n file_put_contents($this->appRoot . '/config/a/foo.yml', 'bar');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function testJavaScriptLoading() {\n $this->runUpdates();\n }", "public function testScript() {\n\t\t$result = $this->Html->script('foo');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/foo.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script(array('foobar', 'bar'));\n\t\t$expected = array(\n\t\t\tarray('script' => array('type' => 'text/javascript', 'src' => 'js/foobar.js')),\n\t\t\t'/script',\n\t\t\tarray('script' => array('type' => 'text/javascript', 'src' => 'js/bar.js')),\n\t\t\t'/script',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('jquery-1.3');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/jquery-1.3.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('test.json');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('http://example.com/test.json');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'http://example.com/test.json')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('/plugin/js/jquery-1.3.2.js?someparam=foo');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => '/plugin/js/jquery-1.3.2.js?someparam=foo')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('test.json.js?foo=bar');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js?foo=bar')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('test.json.js?foo=bar&other=test');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/test.json.js?foo=bar&amp;other=test')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('foo2', array('pathPrefix' => '/my/custom/path/'));\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => '/my/custom/path/foo2.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('foo3', array('pathPrefix' => 'http://cakephp.org/assets/js/'));\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'http://cakephp.org/assets/js/foo3.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$previousConfig = Configure::read('App.jsBaseUrl');\n\t\tConfigure::write('App.jsBaseUrl', '//cdn.cakephp.org/js/');\n\t\t$result = $this->Html->script('foo4');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => '//cdn.cakephp.org/js/foo4.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t\tConfigure::write('App.jsBaseUrl', $previousConfig);\n\n\t\t$result = $this->Html->script('foo');\n\t\t$this->assertNull($result, 'Script returned upon duplicate inclusion %s');\n\n\t\t$result = $this->Html->script(array('foo', 'bar', 'baz'));\n\t\t$this->assertNotRegExp('/foo.js/', $result);\n\n\t\t$result = $this->Html->script('foo', array('inline' => true, 'once' => false));\n\t\t$this->assertNotNull($result);\n\n\t\t$result = $this->Html->script('jquery-1.3.2', array('defer' => true, 'encoding' => 'utf-8'));\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'js/jquery-1.3.2.js', 'defer' => 'defer', 'encoding' => 'utf-8')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testMultipleScriptFiles() {\n\t\t$this->Helper->addScript('libraries', 'default');\n\t\t$this->Helper->addScript('thing', 'second');\n\n\t\t$result = $this->Helper->includeAssets();\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/default.js?file%5B0%5D=libraries'\n\t\t\t)),\n\t\t\t'/script',\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/second.js?file%5B0%5D=thing'\n\t\t\t)),\n\t\t\t'/script'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testWriteScriptsInFile() {\n\t\t$this->skipIf(!is_writable(WWW_ROOT . 'js'), 'webroot/js is not Writable, script caching test has been skipped.');\n\n\t\tConfigure::write('Cache.disable', false);\n\t\t$this->Js->request->webroot = '/';\n\t\t$this->Js->JsBaseEngine = $this->getMock('JsBaseEngineHelper', array(), array($this->View));\n\t\t$this->Js->buffer('one = 1;');\n\t\t$this->Js->buffer('two = 2;');\n\t\t$result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => true));\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'preg:/(.)*\\.js/'),\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t\tpreg_match('/src=\"(.*\\.js)\"/', $result, $filename);\n\t\t$this->assertTrue(file_exists(WWW_ROOT . $filename[1]));\n\t\t$contents = file_get_contents(WWW_ROOT . $filename[1]);\n\t\t$this->assertRegExp('/one\\s=\\s1;\\ntwo\\s=\\s2;/', $contents);\n\t\tif (file_exists(WWW_ROOT . $filename[1])) {\n\t\t\tunlink(WWW_ROOT . $filename[1]);\n\t\t}\n\n\t\tConfigure::write('Cache.disable', true);\n\t\t$this->Js->buffer('one = 1;');\n\t\t$this->Js->buffer('two = 2;');\n\t\t$result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => true));\n\t\t$this->assertRegExp('/one\\s=\\s1;\\ntwo\\s=\\s2;/', $result);\n\t\t$this->assertFalse(file_exists(WWW_ROOT . $filename[1]));\n\t}", "public function testScriptAssetFilter() {\n\t\tConfigure::write('Asset.filter.js', 'js.php');\n\n\t\t$result = $this->Html->script('jquery-1.3');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => 'cjs/jquery-1.3.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->script('//example.com/js/jquery-1.3.js');\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript', 'src' => '//example.com/js/jquery-1.3.js')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testIsCachedTouchedSourcePrepare()\n {\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n sleep(1);\n touch ($tpl->source->filepath);\n }", "public function testBaseUrl() {\n\t\tConfigure::write('debug', 0);\n\t\t$config = $this->Helper->config();\n\t\t$config->set('js.baseUrl', 'http://cdn.example.com/js/');\n\t\t$config->set('js.timestamp', false);\n\n\t\t$result = $this->Helper->script('libs.js');\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => 'http://cdn.example.com/js/libs.js'\n\t\t\t))\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\tConfigure::write('debug', 1);\n\t\t$result = $this->Helper->script('libs.js');\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/libs.js'\n\t\t\t))\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function testEditSnippet()\n {\n\n }", "public function test_scripts_exists_on_unpkg() {\n\t\t$scripts = wp_scripts();\n\t\tforeach ( Use_unpkg::get_instance()->unpkg_scripts as $handle => $data ) {\n\t\t\tif ( in_array( $handle, array( 'twentysixteen-html5', 'html5', 'jquery-scrollto' ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$script = $scripts->query( $handle );\n\t\t\t$response = wp_remote_get( $script->src );\n\t\t\t$response_code = wp_remote_retrieve_response_code( $response );\n\t\t\t$this->assertEquals(\n\t\t\t\t200,\n\t\t\t\t$response_code,\n\t\t\t\t$handle . ' should exists on unpkg'\n\t\t\t);\n\t\t}\n\t}", "public function testYmlFileChanges() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldBeCalledOnce();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n file_put_contents($this->appRoot . '/drupal/modules/x/x.routing.yml', 'bar');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function testWriteScriptsNoFile() {\n\t\t$this->_useMock();\n\t\t$this->Js->buffer('one = 1;');\n\t\t$this->Js->buffer('two = 2;');\n\t\t$result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => false, 'clear' => false));\n\t\t$expected = array(\n\t\t\t'script' => array('type' => 'text/javascript'),\n\t\t\t$this->cDataStart,\n\t\t\t\"one = 1;\\ntwo = 2;\",\n\t\t\t$this->cDataEnd,\n\t\t\t'/script',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Js->TestJsEngine->expects($this->atLeastOnce())->method('domReady');\n\t\t$result = $this->Js->writeBuffer(array('onDomReady' => true, 'cache' => false, 'clear' => false));\n\n\t\t$this->View->expects($this->once())\n\t\t\t->method('append')\n\t\t\t->with('script', $this->matchesRegularExpression('/one\\s\\=\\s1;\\ntwo\\s\\=\\s2;/'));\n\t\t$result = $this->Js->writeBuffer(array('onDomReady' => false, 'inline' => false, 'cache' => false));\n\t}", "public function testCacheSourcesRestored() {\n\t\t$this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC');\n\t\t$this->db->cacheSources = true;\n\t\t$TestModel = new JoinA();\n\t\t$TestModel->cacheSources = false;\n\t\t$TestModel->setSource('join_as');\n\t\t$this->assertTrue($this->db->cacheSources);\n\n\t\t$this->db->cacheSources = false;\n\t\t$TestModel = new JoinA();\n\t\t$TestModel->cacheSources = true;\n\t\t$TestModel->setSource('join_as');\n\t\t$this->assertFalse($this->db->cacheSources);\n\t}", "public function testScript(): void\n {\n $filter = new HtmlFilter();\n $html = \"<p>Foo</p>\\n<script type=\\\"text/javascript\\\">Bar Baz\\nBuz</script>\";\n $text = \" Foo \\n \\n \";\n static::assertEquals($text, $filter->filter($html));\n }", "public function testGetSource()\n {\n $dbLoader = $this->getDbLoader('test', true);\n $this->assertEquals('<p>Hello {{ user }}</p>', $dbLoader->getSource('database:test'));\n }", "public function testScriptTimestamping() {\n\t\t$this->skipIf(!is_writable(WWW_ROOT . 'js'), 'webroot/js is not Writable, timestamp testing has been skipped.');\n\n\t\tConfigure::write('debug', 2);\n\t\tConfigure::write('Asset.timestamp', true);\n\n\t\ttouch(WWW_ROOT . 'js' . DS . '__cake_js_test.js');\n\t\t$timestamp = substr(strtotime('now'), 0, 8);\n\n\t\t$result = $this->Html->script('__cake_js_test', array('inline' => true, 'once' => false));\n\t\t$this->assertRegExp('/__cake_js_test.js\\?' . $timestamp . '[0-9]{2}\"/', $result, 'Timestamp value not found %s');\n\n\t\tConfigure::write('debug', 0);\n\t\tConfigure::write('Asset.timestamp', 'force');\n\t\t$result = $this->Html->script('__cake_js_test', array('inline' => true, 'once' => false));\n\t\t$this->assertRegExp('/__cake_js_test.js\\?' . $timestamp . '[0-9]{2}\"/', $result, 'Timestamp value not found %s');\n\t\tunlink(WWW_ROOT . 'js' . DS . '__cake_js_test.js');\n\t\tConfigure::write('Asset.timestamp', false);\n\t}", "public function testReplace()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://original/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n $this->assertEquals(\n [\n 'http://original/'\n ],\n $this->getGraphs()\n );\n\n // replace graph\n $returnVal = $this->fixture->replace(false, 'http://original/', 'http://replacement/');\n\n // check triples\n $res = $this->fixture->query('SELECT * FROM <http://original/> WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // get available graphs\n $this->assertEquals(0, \\count($this->getGraphs()));\n\n $res = $this->fixture->query('SELECT * FROM <http://replacement/> WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // check return value\n $this->assertEquals(\n [\n [\n 't_count' => 2,\n 'delete_time' => $returnVal[0]['delete_time'],\n 'index_update_time' => $returnVal[0]['index_update_time']\n ],\n false\n ],\n $returnVal\n );\n }", "public function testInlineScriptDevelopment() {\n\t\t$config = $this->Helper->config();\n\t\t$config->set('js.filters', array());\n\n\t\t$config->paths('js', null, array(\n\t\t\t$this->_testFiles . 'js' . DS . 'classes'\n\t\t));\n\n\t\t$config->addTarget('all.js', array(\n\t\t\t'files' => array('base_class.js')\n\t\t));\n\n\t\tConfigure::write('debug', 1);\n\t\t$results = $this->Helper->inlineScript('all.js');\n\n\t\t$expected = <<<EOF\n<script>var BaseClass = new Class({\n\n});</script>\nEOF;\n\n\t\t$this->assertEquals($expected, $results);\n\t}", "public function testMustCompileTouchedSource()\n {\n $this->smarty->force_compile = false;\n $tpl = $this->smarty->createTemplate('helloworld.tpl');\n touch($tpl->source->filepath);\n // reset cache for this test to work\n unset($tpl->source->timestamp);\n $this->assertTrue($tpl->mustCompile());\n // clean up for next tests\n $this->smarty->clearCompiledTemplate();\n }", "public function testPrepare()\n {\n $source = \"foo bar baz\";\n $expect = $source;\n $actual = $this->_plugin->prepare($source);\n $this->assertSame($actual, $expect);\n }", "function regClientScript(\n $src,\n $options = ['name' => '', 'version' => '0', 'plaintext' => false],\n $startup = false\n )\n {\n global $modx;\n\n if (empty($src)) {\n return;\n } // nothing to register\n\n if (!is_array($options)) {\n if (is_bool($options)) {\n $options = ['plaintext' => $options];\n } elseif (is_string($options)) {\n $options = ['name' => $options];\n } else {\n $options = [];\n }\n }\n $name = isset($options['name']) ? strtolower($options['name']) : '';\n $version = isset($options['version']) ? $options['version'] : '0';\n $plaintext = isset($options['plaintext']) ? $options['plaintext'] : false;\n $key = $name ? $name : $src;\n\n $useThisVer = true;\n if (isset($modx->loadedjscripts[$key])) { // a matching script was found\n // if existing script is a startup script, make sure the candidate is also a startup script\n if ($modx->loadedjscripts[$key]['startup']) {\n $startup = true;\n }\n\n if (empty($name)) {\n $useThisVer = false; // if the match was based on identical source code, no need to replace the old one\n } else {\n $useThisVer = version_compare($modx->loadedjscripts[$key]['version'], $version, '<');\n }\n\n if ($useThisVer) {\n if ($startup == true && $modx->loadedjscripts[$key]['startup'] == false) {\n // remove old script from the bottom of the page (new one will be at the top)\n unset($modx->jscripts[$modx->loadedjscripts[$key]['pos']]);\n } else {\n // overwrite the old script (the position may be important for dependent scripts)\n $overwritepos = $modx->loadedjscripts[$key]['pos'];\n }\n } else {\n // Use the original version\n if ($startup == true && $modx->loadedjscripts[$key]['startup'] == false) {\n // need to move the exisiting script to the head\n $version = $modx->loadedjscripts[$key][$version];\n $src = $modx->jscripts[$modx->loadedjscripts[$key]['pos']];\n unset($modx->jscripts[$modx->loadedjscripts[$key]['pos']]);\n } else {\n return;\n }\n // the script is already in the right place\n }\n }\n\n if ($useThisVer && $plaintext != true && (strpos(strtolower($src), \"<script\") === false)) {\n $src = \"\\t\" . '<script type=\"text/javascript\" src=\"' . $src . '\"></script>';\n }\n\n if ($startup) {\n $pos = isset($overwritepos) ? $overwritepos : max(array_merge([0], array_keys($modx->sjscripts))) + 1;\n $modx->sjscripts[$pos] = $src;\n } else {\n $pos = isset($overwritepos) ? $overwritepos : max(array_merge([0], array_keys($modx->jscripts))) + 1;\n $modx->jscripts[$pos] = $src;\n }\n $modx->loadedjscripts[$key]['version'] = $version;\n $modx->loadedjscripts[$key]['startup'] = $startup;\n $modx->loadedjscripts[$key]['pos'] = $pos;\n }", "function testPropertyResourcesReplace() {\n\t\t// load the ResourceBundle\n\t\t$resourceBundle = TechDivision_Resources_PropertyResourceBundle\n\t\t ::getBundle(\n\t\t new TechDivision_Lang_String(\n\t\t \t'TechDivision/Resources/data/testresources'\n\t\t ),\n\t\t TechDivision_Util_SystemLocale::create(\n\t\t TechDivision_Util_SystemLocale::GERMANY\n\t\t )\n\t\t );\n\t\t// iterate over the keys and check the values\n\t\t$resourceBundle->replace(\"test.key.new\", \"neuester Testeintrag\");\n\t\t// save the ResourceBundle\n\t\t$resourceBundle->save();\n\t\t// check the correct values to load\n\t\t$this->assertEquals(\n\t\t\t\"neuester Testeintrag\",\n\t\t $resourceBundle->find(\"test.key.new\")\n\t\t);\n\t}", "public function testLangCodeChange() {\n $this->installProcedure->shouldBeCalledTimes(2);\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n $this->cachedInstall->setLangCode('de');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function testInstallFileChanges() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldBeCalledOnce();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n file_put_contents($this->appRoot . '/drupal/modules/x/x.install', 'bar');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function testEverythingIsNotChanged()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => 'datasource_name', // not change\n 'table_id' => 1, // not change\n 'starting_row_number' => 2, // not change\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data of 'datasource' table\n $this->assertEquals($updatePostData['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($updatePostData['table_id'], $updatedTable->table_id);\n $this->assertEquals($updatePostData['starting_row_number'], $updatedTable->starting_row_number);\n $this->assertTrue($updatedTable->created_at != null);\n $this->assertTrue($updatedTable->updated_at != null);\n $this->assertTrue($updatedTable->created_by == null);\n $this->assertTrue($updatedTable->updated_by == null);\n\n //Check response\n $updateResponse\n ->assertStatus(200)\n ->assertJsonFragment([\n 'id' => $updatedTable->id,\n 'datasource_name' => $updatePostData['datasource_name'],\n 'table_id' => $updatePostData['table_id'],\n 'starting_row_number' => $updatePostData['starting_row_number'],\n ]);\n }", "public function testSystemUnderTest(){\n //Because it passes is_file\n $sut = $this->phpwebunit->setSystemUnderTest(__FILE__);\n $this->assertEquals(__FILE__, $sut);\n $this->assertEquals(__FILE__, $this->phpwebunit['sut']);\n\n //Ok, now lets test the fallback plan\n $sut = $this->phpwebunit->setSystemUnderTest(uniqid('does_not_exist'), array('SCRIPT_FILENAME'=>'SCRIPTNAMEGOESHERE'));\n $this->assertEquals('SCRIPTNAMEGOESHERE', $sut);\n\n //Worse case scenario, script_name isn't set :(\n try {\n $sut = $this->phpwebunit->setSystemUnderTest(uniqid('does_not_exist'), array());\n } catch (\\Exception $expected) {\n return;\n }\n $this->fail('Exception should have been raised, SCRIPT_NAME cannot be found');\n }", "public function testScriptInTheme() {\n\t\t$this->skipIf(!is_writable(WWW_ROOT), 'Cannot write to webroot.');\n\t\t$themeExists = is_dir(WWW_ROOT . 'theme');\n\n\t\tApp::uses('File', 'Utility');\n\n\t\t$testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'js' . DS . '__test_js.js';\n\t\tnew File($testfile, true);\n\n\t\tApp::build(array(\n\t\t\t'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)\n\t\t));\n\n\t\t$this->Html->webroot = '/';\n\t\t$this->Html->theme = 'test_theme';\n\t\t$result = $this->Html->script('__test_js.js');\n\t\t$expected = array(\n\t\t\t'script' => array('src' => '/theme/test_theme/js/__test_js.js', 'type' => 'text/javascript')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$Folder = new Folder(WWW_ROOT . 'theme' . DS . 'test_theme');\n\t\t$Folder->delete();\n\n\t\tif (!$themeExists) {\n\t\t\t$dir = new Folder(WWW_ROOT . 'theme');\n\t\t\t$dir->delete();\n\t\t}\n\t}", "public function reloadSource()\n {\n $this->sendCommand(static::RCMD_SRC_RELOAD);\n }", "public function testOverwriteFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($filename, 'It works!');\n file_put_contents($filename, 'It works wonderful!');\n\n $this->assertSame('It works wonderful!', file_get_contents($filename));\n }" ]
[ "0.6116413", "0.6091732", "0.604038", "0.5805325", "0.5745795", "0.5626302", "0.5537842", "0.5523921", "0.55238557", "0.5510435", "0.55059355", "0.54869527", "0.5439302", "0.54275715", "0.54137903", "0.5405908", "0.5366839", "0.5351573", "0.5345135", "0.53378767", "0.53343904", "0.5325539", "0.52996534", "0.52664983", "0.5257278", "0.5255639", "0.5210293", "0.520262", "0.5202595", "0.5184404" ]
0.6990123
0
Maybe set real IP checks for certain plugins and conditions
public function maybe_set_real_ip() { $run =true; if (!function_exists('is_plugin_active')) { include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); } foreach ($this->plugins as $plugin) { if (\is_plugin_active($plugin) ) { $run = false; } } if ($this->wp_rocket_cloudflare_enabled()) { $run = false; } if ($run) { $this->set_real_ip(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allow_ip_address()\r\n\t{\r\n\t\t$bad = apply_filters('three_strikes_count', 0, $_SERVER['REMOTE_ADDR']);\r\n\t\treturn ($bad < THREE_STRIKES_LIMIT);\r\n\t}", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function do_c_block_firewall() {\n\t\t$rxs = $this->get_option( 'service_ips' );\n\t\t$service_ips_external = get_option( 'vaultpress_service_ips_external' );\n\n\t\tif ( !empty( $rxs['data'] ) && !empty( $service_ips_external['data'] ) )\n\t\t\t$rxs = array_merge( $rxs['data'], $service_ips_external['data'] );\t\t\n\t\tif ( ! $rxs )\n\t\t\treturn false;\n\t\treturn $this->validate_ip_address( $rxs );\n\t}", "public static function validIpDataProvider() {}", "function ipchecker(){\r\n if (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\r\n # code...\r\n $IP = $_SERVER[\"HTTP_CLIENT_IP\"];\r\n }elseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\r\n # code...\r\n //check for ip address proxy server\r\n $IP = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\r\n }else{\r\n $IP = $_SERVER[\"REMOTE_ADDR\"];\r\n }\r\n}", "public function checkBackendIpOrDie() {}", "public function strictIPs() {\n\t\treturn false;\n\t}", "function adminChk(){\r\n\treturn $_SERVER[\"REMOTE_ADDR\"] == \"118.36.189.171\" || $_SERVER[\"REMOTE_ADDR\"] == \"39.115.229.173\" || $_SERVER[\"REMOTE_ADDR\"] == \"127.0.0.1\";\r\n}", "private function sniff_ip() {\n\n\t\tif ( $this->ip_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t$this->ip_data = [ '127.0.0.1', 'CLI' ];\n\n\t\t\treturn;\n\t\t}\n\n\t\t$ip_server_keys = [ 'REMOTE_ADDR' => '', 'HTTP_CLIENT_IP' => '', 'HTTP_X_FORWARDED_FOR' => '', ];\n\t\t$ips = array_intersect_key( $_SERVER, $ip_server_keys );\n\t\t$this->ip_data = $ips ? [ reset( $ips ), key( $ips ) ] : [ '0.0.0.0', 'Hidden IP' ];\n\t}", "public function checkLockToIP() {}", "private function set_real_ip() {\n\n\t\t$is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false;\n\t\tif ( ! $is_cf ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\n\t\tif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\n\t\t\t// Grab the Current Cloudflare Address Range\n\t\t\t$cf_ips_values = $this->get_ips();\n\t\t\tif ( false == $cf_ips_values || empty($cf_ips_values) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the we getting a IPv4 or IPv6 Address\n\t\t\tif ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) {\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv4'] ?? '';\n\n\t\t\t\t// IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv6'];\n\t\t\t\t$ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv6_in_range( $ipv6, $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function get_ip(){?\r\r\t$do_check = 1;\r\r\t$addrs = array();\r\r\r\r\tif( $do_check )\r\r\t{\r\r\t\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\r\t\t foreach( array_reverse(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])) as $x_f )\r\r \t\t{\r\r \t\t\t$x_f = trim($x_f);\r\r \t\t\tif( preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $x_f) )\r\r \t\t\t{\r\r \t\t\t\t$addrs[] = $x_f;\r\r \t\t\t}\r\r \t\t}\r\r\t\t}\r\r \r\r\r\r\t\tif(isset($_SERVER['HTTP_CLIENT_IP'])) $addrs[] = $_SERVER['HTTP_CLIENT_IP'];\r\r\t\tif(isset($_SERVER['HTTP_PROXY_USER'])) $addrs[] = $_SERVER['HTTP_PROXY_USER'];\r\r\t}\r\r\r\r\t$addrs[] = $_SERVER['REMOTE_ADDR'];\r\r\r\r\tforeach( $addrs as $v )\r\r\t{\r\r\t\tif( $v )\r\r\t\t{\r\r\t\t\tpreg_match(\"/^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/\", $v, $match);\r\r\t\t\t$ip = $match[1].'.'.$match[2].'.'.$match[3].'.'.$match[4];\r\r\r\r\t\t\tif( $ip && $ip != '...' )\r\r\t\t\t{\r\r\t\t\t\tbreak;\r\r\t\t\t}\r\r\t\t}\r\r\t}\r\r\r\r\tif( ! $ip || $ip == '...' )\r\r\t{\r\r\t\techo \"Không thể xác định địa chỉ IP của bạn.\";\r\r\t}\r\r\r\r\treturn $ip;\r\r}", "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "private function __ipWhitelistCheck() {\n $userIp = $_SERVER['REMOTE_ADDR'];\n\n if (! in_array($userIp, $this->ipWhitelist)) {\n header('HTTP/1.0 403 Forbidden');\n die('Your IP address (' . $userIp . ') is not authorized to access this file.');\n }\n }", "public function addwhitelistip() \n\t{\n\t\tUserModel::authentication();\n\t\t\n\t\tSecurityModel::add_ip_whitelist();\n }", "static function check_visitor_ip_and_perform_blocking()\r\n {\r\n global $aio_wp_security, $wpdb;\r\n $visitor_ip = AIOWPSecurity_Utility_IP::get_user_ip_address();\r\n $ip_type = WP_Http::is_ip_address($visitor_ip);\r\n if(empty($ip_type)){\r\n $aio_wp_security->debug_logger->log_debug(\"do_general_ip_blocking_tasks: \".$visitor_ip.\" is not a valid IP!\",4);\r\n return;\r\n }\r\n\r\n //Check if this IP address is in the block list\r\n $blocked = AIOWPSecurity_Blocking::is_ip_blocked($visitor_ip);\r\n //TODO - future feature: add blocking whitelist and check\r\n\r\n if(empty($blocked)){\r\n return; //Visitor IP is not blocked - allow page to load\r\n }else{\r\n //block this visitor!!\r\n AIOWPSecurity_Utility::redirect_to_url('http://127.0.0.1');\r\n }\r\n return;\r\n\r\n }", "public function checkIpAllowed()\n {\n $ip_list = $this->options->get('allowed_ips');\n if ($ip_list) {\n $client_ip = $this->request->getClientIp();\n $status = Ip::match($client_ip, explode(',', $ip_list));\n if (!$status) {\n $this->logger->warning('IP Not Allowed');\n $response = Response::create('Access denied for IP: '.$client_ip, 403);\n $response->send();\n exit();\n }\n }\n }", "protected function checkIpAddress()\n {\n $allowedIpAddresses = \\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_allowed_ip_addresses;\n return !$allowedIpAddresses \n || false !== strpos($allowedIpAddresses, $_SERVER['REMOTE_ADDR']);\n }", "public static function invalidIpDataProvider() {}", "function ip_detect_mail(){\r\n\t\t$ip_detect = $this->_deny_ip;\r\n\r\n\t\t$punish = 0;\r\n\t\twhile (list ($key, $val) = each ($ip_detect)) {\r\n\t\t\tif ($this->checkIPorRange($val)) {\r\n\t\t\t\t$punish = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($punish) {\r\n\t\t\t// Email the webmaster\r\n\t\t\t$msg .= \"The following banned ip tried to access one of the sites:\\n\";\r\n\t\t\t$msg .= \"Host: \".$_SERVER[\"REMOTE_ADDR\"].\"\\n\";\r\n\t\t\t$msg .= \"Agent: \".$_SERVER[\"HTTP_USER_AGENT\"].\"\\n\";\r\n\t\t\t$msg .= \"Referrer: \".$_SERVER[\"HTTP_REFERER\"].\"\\n\";\r\n\t\t\t$msg .= \"Document: \".$_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"].\"\\n\";\r\n\t\t\t$headers .= \"X-Priority: 1\\n\";\r\n\t\t\t$headers .= \"From: \".ADMIN_NAME.\" <\".ADMIN_EMAIL.\">\\n\";\r\n\t\t\t$headers .= \"X-Sender: <\".ADMIN_EMAIL.\">\\n\";\r\n\r\n\t\t\tmail (ADMIN_EMAIL, SESS_NAME.\" Banned User Access\", $msg, $headers);\r\n\t\t}\r\n\t}", "public function checkIPs () {\n\n\t\t$validation = true;\n\n\t\tforeach ($this->allow as $key => $ip) {\n\t\t\t\n\t\t\tif ($this->matchIP($ip)) {\n \n return true;\n \n }\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function setIps()\n {\n if ($this->module->sandbox) {\n $this->ips = $this->sandboxIps;\n } else {\n $this->ips = $this->productionIps;\n }\n }", "function bps_get_proxy_real_ip_address() {\n\t\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset($_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_CLIENT_IP']);\n\t\t\techo __('HTTP_CLIENT_IP IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\techo __('Proxy X-Forwarded-For IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['REMOTE_ADDR']);\n\t\t\techo __('Public Internet IP Address (ISP): ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t}\n\t}\n}", "function is_ip_allowed ()\n{\n if($_SERVER['REMOTE_ADDR'] != LIMIT_TO_IP)\n {\n die('You are not allowed to shorten URLs with this service.');\n }\n\n}", "function where_is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\t$where_configured = array();\n\n\t$pos = strpos($ignore_if, '_virtualip');\n\tif ($pos !== false) {\n\t\t$ignore_vip_id = substr($ignore_if, $pos+10);\n\t\t$ignore_vip_if = substr($ignore_if, 0, $pos);\n\t} else {\n\t\t$ignore_vip_id = -1;\n\t\t$ignore_vip_if = $ignore_if;\n\t}\n\n\t$isipv6 = is_ipaddrv6($ipaddr);\n\n\tif ($isipv6) {\n\t\t$ipaddr = text_to_compressed_ip6($ipaddr);\n\t}\n\n\tif ($check_subnets) {\n\t\t$cidrprefix = intval($cidrprefix);\n\t\tif ($isipv6) {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 128)) {\n\t\t\t\t$cidrprefix = 128;\n\t\t\t}\n\t\t} else {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 32)) {\n\t\t\t\t$cidrprefix = 32;\n\t\t\t}\n\t\t}\n\t\t$iflist = get_configured_interface_list();\n\t\tforeach ($iflist as $if => $ifname) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($isipv6) {\n\t\t\t\t$if_ipv6 = get_interface_ipv6($if);\n\t\t\t\t$if_snbitsv6 = get_interface_subnetv6($if);\n\t\t\t\t/* do not check subnet overlapping on 6rd interfaces,\n\t\t\t\t * see https://redmine.pfsense.org/issues/12371 */ \n\t\t\t\tif ($if_ipv6 && $if_snbitsv6 &&\n\t\t\t\t ((config_get_path(\"interfaces/{$if}/ipaddrv6\") != '6rd') || ($cidrprefix > $if_snbitsv6)) &&\n\t\t\t\t check_subnetsv6_overlap($ipaddr, $cidrprefix, $if_ipv6, $if_snbitsv6)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ipv6($if) . \"/\" . get_interface_subnetv6($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$if_ipv4 = get_interface_ip($if);\n\t\t\t\t$if_snbitsv4 = get_interface_subnet($if);\n\t\t\t\tif ($if_ipv4 && $if_snbitsv4 && check_subnets_overlap($ipaddr, $cidrprefix, $if_ipv4, $if_snbitsv4)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ip($if) . \"/\" . get_interface_subnet($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($isipv6) {\n\t\t\t$interface_list_ips = get_configured_ipv6_addresses();\n\t\t} else {\n\t\t\t$interface_list_ips = get_configured_ip_addresses();\n\t\t}\n\n\t\tforeach ($interface_list_ips as $if => $ilips) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (strcasecmp($ipaddr, $ilips) == 0) {\n\t\t\t\t$where_entry = array();\n\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t$where_entry['ip_or_subnet'] = $ilips;\n\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($check_localip) {\n\t\tif (strcasecmp($ipaddr, text_to_compressed_ip6(config_get_path('l2tp/localip', \"\"))) == 0) {\n\t\t\t$where_entry = array();\n\t\t\t$where_entry['if'] = 'l2tp';\n\t\t\t$where_entry['ip_or_subnet'] = config_get_path('l2tp/localip');\n\t\t\t$where_configured[] = $where_entry;\n\t\t}\n\t}\n\n\treturn $where_configured;\n}", "function is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\tif (count(where_is_ipaddr_configured($ipaddr, $ignore_if, $check_localip, $check_subnets, $cidrprefix))) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function rest_is_ip_address($ip)\n {\n }", "function bps_get_server_ip_address_sysinfo() {\n\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset( $_SERVER['SERVER_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['SERVER_ADDR']);\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_HOST'] ) ) {\n\t\t\t$ip = esc_html( gethostbyname( $_SERVER['HTTP_HOST'] ) );\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\t\t\n\t\t} else { \n\t\t\t$ip = @dns_get_record( bpsGetDomainRoot(), DNS_ALL );\n\t\t\techo __('Server|Website IP Address: ', 'bulletproof-security').'<strong>'.$ip[0]['ip'].'</strong><br>';\t\n\t\t}\n\t}\n}", "protected function _checkIpAddressIsAllowed()\n\t{\n\t\t/* Check the IP address is banned */\n\t\tif ( \\IPS\\Request::i()->ipAddressIsBanned() )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/A', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than 10 times, ban the IP address */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1', \\IPS\\Request::i()->ipAddress() ) )->first() > 10 )\n\t\t{\n\t\t\t/* Remove the flag from these logs so that if the admin unbans the IP we aren't immediately banned again */\n\t\t\t\\IPS\\Db::i()->update( 'core_api_logs', array( 'is_bad_key' => 0 ), array( 'ip_address=?', \\IPS\\Request::i()->ipAddress() ) );\n\t\t\t\n\t\t\t/* Then insert the ban... */\n\t\t\t\\IPS\\Db::i()->insert( 'core_banfilters', array(\n\t\t\t\t'ban_type'\t\t=> 'ip',\n\t\t\t\t'ban_content'\t=> \\IPS\\Request::i()->ipAddress(),\n\t\t\t\t'ban_date'\t\t=> time(),\n\t\t\t\t'ban_reason'\t=> 'API',\n\t\t\t) );\n\t\t\tunset( \\IPS\\Data\\Store::i()->bannedIpAddresses );\n\t\t\t\n\t\t\t/* And throw an error */\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/C', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than once in the last 5 minutes, throw an error to prevent brute-forcing */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1 AND date>?', \\IPS\\Request::i()->ipAddress(), \\IPS\\DateTime::create()->sub( new \\DateInterval( 'PT5M' ) )->getTimestamp() ) )->first() > 1 )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'TOO_MANY_REQUESTS_WITH_BAD_KEY', '1S290/D', 429 );\n\t\t}\n\t}", "function controlAccess() {\n $ip = FILTER_INPUT(INPUT_SERVER, \"REMOTE_ADDR\");\n $whitelist = [\n \"127.0.0.1\",\n \"91.231.229.130\",\n \"176.38.54.30\",\n \"176.38.54.34\",\n \"94.153.222.226\"\n ];\n return array_search($ip, $whitelist) !== false;\n}" ]
[ "0.72217685", "0.6945912", "0.6870403", "0.6813865", "0.67881083", "0.67538977", "0.66403425", "0.66365445", "0.65711176", "0.6541811", "0.65266067", "0.6515038", "0.6493296", "0.64884686", "0.6484355", "0.64806485", "0.64182395", "0.6364514", "0.6342819", "0.631274", "0.62924135", "0.62875926", "0.6261201", "0.624428", "0.62266153", "0.62224865", "0.6214336", "0.62071073", "0.62010026", "0.6200071" ]
0.78727466
0
Check if WP Rocket has the Cloudflare Module running
private function wp_rocket_cloudflare_enabled() { if (function_exists('rocket_set_real_ip_cloudflare')) { return true; } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isApiAvailable() {\n\t\treturn get_option(\"wp_broadbean_ipavailibility\") == 1;\n\t}", "public function checkAcquiaHosted() {\n return isset($_SERVER['AH_SITE_ENVIRONMENT'], $_SERVER['AH_SITE_NAME']);\n }", "public static function isRunningOnCgiServerApi() {}", "private function canRun()\n {\n $confEnabled = $this->config()->get('cdn_rewrite');\n $devEnabled = ((!Director::isDev()) || ($this->config()->get('enable_in_dev')));\n return ($confEnabled && $devEnabled);\n }", "function is_wpcli() {\n\treturn defined('WP_CLI') && WP_CLI;\n}", "private static function _isDrupalSite() {\n $output = trim(shell_exec('drush status --field=\"Drupal bootstrap\"'));\n if (empty($output)) {\n return FALSE;\n }\n return TRUE;\n }", "public function is_network_detected()\n {\n /* Plugin is loaded via mu-plugins. */\n\n if (strpos(Utility::normalize_path($this->root_path), Utility::normalize_path(WPMU_PLUGIN_DIR)) !== false) {\n return true;\n }\n\n if (is_multisite()) {\n /* Looks through network enabled plugins to see if our one is there. */\n foreach (wp_get_active_network_plugins() as $path) {\n if ($this->boot_file == $path) {\n return true;\n }\n }\n }\n return false;\n }", "public function isAvailable() {\n return (function_exists('apc_fetch') || function_exists('apcu_fetch')) &&\n ini_get('apc.enabled') &&\n (ini_get('apc.enable_cli') || php_sapi_name() != 'cli');\n }", "public static function available()\n\t{\n\t\treturn function_exists('curl_init');\n\t}", "function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}", "function available() {\n\t\treturn function_exists('curl_init');\n\t}", "function is_live() {\n\treturn preg_match( DEVELOPMENT_HOSTS_EXPRESSION, $_SERVER['SERVER_NAME']) ? false : true;\n}", "public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }", "function ms_site_check()\n {\n }", "public static function isCraftCloud(): bool\n {\n return (bool)App::env('AWS_LAMBDA_RUNTIME_API') || App::env('LAMBDA_TASK_ROOT');\n }", "function get_carp_status() {\n\t/* grab the current status of carp */\n\t$status = get_single_sysctl('net.inet.carp.allow');\n\treturn (intval($status) > 0);\n}", "public function isFastcgiMode(): bool;", "function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}", "function available() {\n\t\treturn function_exists('fsockopen');\n\t}", "public function shouldCheckHttpHost()\n {\n return !Director::is_cli() && isset($_SERVER['HTTP_HOST']);\n }", "function cpc_using_classipress() {\n\t\t$my_theme = wp_get_theme();\n\t\tif( !($my_theme->get( 'Name' ) == 'ClassiPress' || $my_theme->get( 'Template' ) == 'classipress' )){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function pacz_woocommerce_enabled() {\n\tif ( class_exists( 'woocommerce' ) ) { return true; }\n\treturn false;\n}", "public static function isCloudFlare (string $ip): bool {\n $cf_ips = ['173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', '141.101.64.0/18', '108.162.192.0/18', '190.93.240.0/20', '188.114.96.0/20', '197.234.240.0/22', '198.41.128.0/17', '162.158.0.0/15', '104.16.0.0/12', '104.24.0.0/14', '172.64.0.0/13', '131.0.72.0/22'];\n foreach ($cf_ips as $cf_ip) {\n if (self::ipInRange($ip,$cf_ip)) {\n return true;\n }\n }\n return false;\n }", "protected function isHostConfigured() {}", "public function isProvisioned() {\n\t\tif(is_file($this->sites_available_path . $this->sitename)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function humcore_check_dependencies() {\n\n\tif ( ! in_array( 'curl', get_loaded_extensions() ) ) {\n\t\ttrigger_error( __( 'cURL is not installed on your server. In order to make this plugin work, you need to install cURL on your server.', 'humcore_domain' ), E_USER_ERROR );\n\t}\n\n}", "function classicpress_check_can_migrate() {\n\t// First: Run a series of checks for conditions that are inherent to this\n\t// WordPress install and this user session.\n\n\t// Check: Are we already on ClassicPress?\n\tif ( function_exists( 'classicpress_version' ) ) {\n\t\tif ( is_multisite() ) {\n\t\t\t$delete_plugin_url = network_admin_url( 'plugins.php' );\n\t\t} else {\n\t\t\t$delete_plugin_url = admin_url( 'plugins.php' );\n\t\t}\n?>\n\t\t<div class=\"notice notice-success\">\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e(\n\t\t\t\t\t\"Hey, good job, you're already running ClassicPress!\",\n\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php echo sprintf(\n\t\t\t\t\t/* translators: %s: URL to plugins page */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'You can <a href=\"%s\">delete this plugin</a> now.',\n\t\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t\t),\n\t\t\t\t\t$delete_plugin_url\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t</div>\n<?php\n\t\treturn false;\n\t}\n\n\t// Check: Are we running on WordPress.com?\n\t// @see https://github.com/Automattic/jetpack/blob/6.6.1/functions.global.php#L32-L43\n\t$at_options = get_option( 'at_options', array() );\n\tif ( ! empty( $at_options ) || defined( 'WPCOMSH__PLUGIN_FILE' ) ) {\n?>\n\t\t<div class=\"notice notice-error\">\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e(\n\t\t\t\t\t\"Sorry, this plugin doesn't support sites hosted on WordPress.com.\",\n\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php _e(\n\t\t\t\t\t'In order to switch to ClassicPress, you\\'ll need to <a href=\"https://move.wordpress.com/\">move to a self-hosted WordPress site</a> first.',\n\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t</div>\n<?php\n\t\treturn false;\n\t}\n\n\t// Check: Does the current user have permission to update core?\n\tif ( ! current_user_can( 'update_core' ) ) {\n?>\n\t\t<div class=\"notice notice-error\">\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e(\n\t\t\t\t\t\"Sorry, you're not allowed to perform this action.\",\n\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<?php esc_html_e(\n\t\t\t\t\t\"Please contact a site administrator for more information.\",\n\t\t\t\t\t'switch-to-classicpress'\n\t\t\t\t); ?>\n\t\t\t</p>\n\t\t</div>\n<?php\n\t\treturn false;\n\t}\n\n\t// The first round of checks has passed. Now, run a second round related\n\t// to conditions that the user (or at least the hosting provider) has\n\t// control over, and display the results in a table.\n\n\t$preflight_checks = array();\n\t$icon_preflight_pass = (\n\t\t'<div class=\"cp-preflight-icon cp-pass\">'\n\t\t\t. '<div class=\"dashicons dashicons-yes\"></div>'\n\t\t. '</div>'\n\t);\n\t$icon_preflight_fail = (\n\t\t'<div class=\"cp-preflight-icon cp-fail\">'\n\t\t\t. '<div class=\"dashicons dashicons-no\"></div>'\n\t\t. '</div>'\n\t);\n\t$icon_preflight_warn = (\n\t\t'<div class=\"cp-preflight-icon cp-warn\">'\n\t\t\t. '<div class=\"dashicons dashicons-flag\"></div>'\n\t\t. '</div>'\n\t);\n\techo '<table id=\"cp-preflight-checks\">' . \"\\n\";\n\n\t// Check: Supported WP version\n\t// More versions can be added after they are confirmed to work.\n\tglobal $wp_version;\n\t$wp_version_min = '4.9.0';\n\t$wp_version_max = '5.0.0';\n\t$wp_version_check_intro_message = sprintf( __(\n\t\t/* translators: 1: minimum supported WordPress version, 2: maximum supported WordPress version */\n\t\t'This plugin supports WordPress versions <strong>%1$s</strong> to <strong>%2$s</strong> (and some newer development versions).',\n\t\t'switch-to-classicpress'\n\t), $wp_version_min, $wp_version_max );\n\t$wp_version_check_intro_message .= \"<br>\\n\";\n\tif (\n\t\t// Version is outside of our \"stable release\" range...\n\t\t(\n\t\t\tversion_compare( $wp_version, $wp_version_min, 'lt' ) ||\n\t\t\tversion_compare( $wp_version, $wp_version_max, 'gt' )\n\t\t) &&\n\t\t// ... and it's not a known development release.\n\t\t! preg_match( '#^5\\.0\\.1-(alpha|beta)\\b#', $wp_version ) &&\n\t\t! preg_match( '#^5\\.1-(alpha|beta)\\b#', $wp_version )\n\t) {\n\t\t/**\n\t\t * Filters whether to ignore the result of the WP version check.\n\t\t *\n\t\t * @since 0.4.0\n\t\t *\n\t\t * @param bool $ignore Ignore the WP version check. Defaults to false.\n\t\t */\n\t\tif ( apply_filters( 'classicpress_ignore_wp_version', false ) ) {\n\t\t\t$preflight_checks['wp_version'] = true;\n\t\t\techo \"<tr>\\n<td>$icon_preflight_warn</td>\\n<td>\\n\";\n\t\t\techo \"<p>\\n\";\n\t\t\techo $wp_version_check_intro_message;\n\t\t\t_e(\n\t\t\t\t'The preflight check for supported WordPress versions has been <strong class=\"cp-emphasis\">disabled</strong>.',\n\t\t\t\t'switch-to-classicpress'\n\t\t\t);\n\t\t\techo \"<br>\\n\";\n\t\t\t_e(\n\t\t\t\t'We cannot guarantee that the migration process is going to work, and may even leave your current installation partially broken.',\n\t\t\t\t'switch-to-classicpress'\n\t\t\t);\n\t\t\techo \"<br>\\n\";\n\t\t\t_e(\n\t\t\t\t'<strong class=\"cp-emphasis\">Proceed at your own risk!</strong>',\n\t\t\t\t'switch-to-classicpress'\n\t\t\t);\n\t\t} else {\n\t\t\t$preflight_checks['wp_version'] = false;\n\t\t\techo \"<tr>\\n<td>$icon_preflight_fail</td>\\n<td>\\n\";\n\t\t\techo \"<p>\\n\";\n\t\t\techo $wp_version_check_intro_message;\n\t\t}\n\t} else {\n\t\t$preflight_checks['wp_version'] = true;\n\t\tif ( substr( $wp_version, 0, 1 ) === '5' ) {\n\t\t\techo \"<tr>\\n<td>$icon_preflight_warn</td>\\n<td>\\n\";\n\t\t} else {\n\t\t\techo \"<tr>\\n<td>$icon_preflight_pass</td>\\n<td>\\n\";\n\t\t}\n\t\techo \"<p>\\n\";\n\t\techo $wp_version_check_intro_message;\n\t}\n\tprintf( __(\n\t\t/* translators: current WordPress version */\n\t\t'You are running WordPress version <strong>%s</strong>.',\n\t\t'switch-to-classicpress'\n\t), $wp_version );\n\tif ( substr( $wp_version, 0, 1 ) === '5' && $preflight_checks['wp_version'] ) {\n\t\techo \"<br>\\n\";\n\t\t_e(\n\t\t\t'Migration is supported, but content edited in the new WordPress block editor may not be fully compatible with ClassicPress.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"<br>\\n\";\n\t\t_e(\n\t\t\t'After the migration, we recommend reviewing each recently edited post or page and restoring to an earlier revision if needed.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t}\n\techo \"\\n</p>\\n\";\n\t// TODO: Add instructions if WP too old.\n\techo \"</td></tr>\\n\";\n\n\t// Check: Supported PHP version\n\t$php_version_min = '5.6';\n\tif ( version_compare( PHP_VERSION, $php_version_min, 'lt' ) ) {\n\t\t$preflight_checks['php_version'] = false;\n\t\techo \"<tr>\\n<td>$icon_preflight_fail</td>\\n<td>\\n\";\n\t} else {\n\t\t$preflight_checks['php_version'] = true;\n\t\techo \"<tr>\\n<td>$icon_preflight_pass</td>\\n<td>\\n\";\n\t}\n\techo \"<p>\\n\";\n\tprintf( __(\n\t\t/* translators: minimum supported PHP version */\n\t\t'ClassicPress supports PHP versions <strong>%1$s</strong> and <strong>newer</strong>.',\n\t\t'switch-to-classicpress'\n\t), $php_version_min );\n\techo \"<br>\\n\";\n\tprintf( __(\n\t\t/* translators: current PHP version */\n\t\t'You are using PHP version <strong>%s</strong>.',\n\t\t'switch-to-classicpress'\n\t), PHP_VERSION );\n\techo \"\\n</p>\\n\";\n\t// TODO: Add instructions if PHP too old.\n\techo \"</td></tr>\\n\";\n\n\t// Check: Support for outgoing HTTPS requests\n\tif ( ! wp_http_supports( array( 'ssl' ) ) ) {\n\t\t$preflight_checks['wp_http_supports_ssl'] = false;\n\t\techo \"<tr>\\n<td>$icon_preflight_fail</td>\\n<td>\\n\";\n\t} else {\n\t\t$preflight_checks['wp_http_supports_ssl'] = true;\n\t\techo \"<tr>\\n<td>$icon_preflight_pass</td>\\n<td>\\n\";\n\t}\n\techo \"<p>\\n\";\n\t_e(\n\t\t'ClassicPress only supports communicating with the ClassicPress.net API over SSL.',\n\t\t'switch-to-classicpress'\n\t);\n\techo \"\\n<br>\\n\";\n\tif ( $preflight_checks['wp_http_supports_ssl'] ) {\n\t\t_e(\n\t\t\t'This site supports making outgoing connections securely using SSL.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t} else {\n\t\t_e(\n\t\t\t'This site <strong class=\"cp-emphasis\">does not</strong> support making outgoing connections securely using SSL.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\t// TODO: Add instructions if SSL not supported.\n\t}\n\techo \"\\n</p>\\n\";\n\techo \"</td></tr>\\n\";\n\n\t// Check: Core files checksums\n\t$modified_files = classicpress_check_core_files();\n\tif ( $modified_files === false || ! empty( $modified_files ) ) {\n\t\techo \"<tr>\\n<td>$icon_preflight_warn</td>\\n<td>\\n\";\n\t} else {\n\t\techo \"<tr>\\n<td>$icon_preflight_pass</td>\\n<td>\\n\";\n\t}\n\techo \"<p>\\n\";\n\t_e(\n\t\t'Your WordPress core files will be overwritten.',\n\t\t'switch-to-classicpress'\n\t);\n\techo \"\\n<br>\\n\";\n\tif ( $modified_files === false ) {\n\t\t_e(\n\t\t\t'<strong class=\"cp-emphasis\">Unable to determine whether core files were modified</strong>.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"\\n<br>\\n\";\n\t\t_e(\n\t\t\t'This is most likely because you are running a development version of WordPress.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t} else if ( empty( $modified_files ) ) {\n\t\t_e(\n\t\t\t'You have not modified any core files.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t} else {\n\t\techo '<strong class=\"cp-emphasis\">';\n\t\t_e(\n\t\t\t'Modified core files detected. These customisations will be lost.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"</strong>\\n<br>\\n\";\n\t\t_e(\n\t\t\t'If you have JavaScript enabled, you can see a list of modified files <strong>in your browser console</strong>.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"\\n<script>console.log( 'modified core files:', \";\n\t\techo wp_json_encode( $modified_files );\n\t\techo ' );</script>';\n\t}\n\techo \"\\n</p>\\n\";\n\techo \"</td></tr>\\n\";\n\n\t// TODO: Any other checks needed?\n\n\tif ( is_multisite() ) {\n\t\t// Show a reminder to backup the multisite install first\n\t\techo \"<tr>\\n<td>$icon_preflight_warn</td>\\n<td>\\n\";\n\t\techo \"<p>\\n\";\n\t\t_e(\n\t\t\t'Multisite installation detected.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"\\n<br>\\n\";\n\t\t_e(\n\t\t\t'Migrating to ClassicPress is supported, but it is <strong class=\"cp-emphasis\">very important</strong> that you perform a backup first.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"\\n<br>\\n\";\n\t\t_e(\n\t\t\t'It would also be a good idea to try the migration on a development or staging site first.',\n\t\t\t'switch-to-classicpress'\n\t\t);\n\t\techo \"\\n</p>\\n\";\n\t\techo \"</td></tr>\\n\";\n\t}\n\n\techo \"</table>\\n\";\n\n\tif (\n\t\t$preflight_checks['wp_version'] &&\n\t\t$preflight_checks['php_version'] &&\n\t\t$preflight_checks['wp_http_supports_ssl']\n\t) {\n\t\tupdate_option( 'classicpress_preflight_checks', $preflight_checks, false );\n\t\treturn true;\n\t} else {\n\t\tdelete_option( 'classicpress_preflight_checks' );\n\t\treturn false;\n\t}\n}", "function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}", "private function should_load() {\n\t\treturn class_exists( 'WooCommerce', false );\n\t}", "public function preflight_check() {\n\t\t\n\t\t\tif( $this->zend_loader_present = @fopen( 'Zend/Loader.php', 'r', true ) ) {\n\t\t\t\tif( !$this->zend_loader_present ) {\n\t\t\t\t\t// ZF Not Found!\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.6667953", "0.6509513", "0.6417302", "0.63991857", "0.62835425", "0.625391", "0.6247767", "0.6228695", "0.61861056", "0.61758685", "0.6169184", "0.61573917", "0.6143217", "0.61088145", "0.60962695", "0.6095984", "0.6061232", "0.6059582", "0.60189015", "0.60155636", "0.60153365", "0.600884", "0.5972716", "0.59446037", "0.59393144", "0.5929844", "0.59156036", "0.5902451", "0.59020954", "0.5898165" ]
0.7518741
0
Set Real IP from CloudFlare
private function set_real_ip() { $is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false; if ( ! $is_cf ) { return; } // only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode. if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { // Grab the Current Cloudflare Address Range $cf_ips_values = $this->get_ips(); if ( false == $cf_ips_values || empty($cf_ips_values) ) { return; } // Check if the we getting a IPv4 or IPv6 Address if ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) { $cf_ip_ranges = $cf_ips_values['ipv4'] ?? ''; // IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range. foreach ( $cf_ip_ranges as $range ) { if ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) { if ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; } break; } } } else { // IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range. $cf_ip_ranges = $cf_ips_values['ipv6']; $ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] ); foreach ( $cf_ip_ranges as $range ) { if ( IP::ipv6_in_range( $ipv6, $range ) ) { if ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; } break; } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}", "public function maybe_set_real_ip() {\n\t\t$run =true;\n\t\tif (!function_exists('is_plugin_active')) {\n\t\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t}\n\t\tforeach ($this->plugins as $plugin) {\n\t\t\tif (\\is_plugin_active($plugin) ) {\n\t\t\t\t$run = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->wp_rocket_cloudflare_enabled()) {\n\t\t\t$run = false;\n\t\t}\n\n\t\tif ($run) {\n\t\t\t$this->set_real_ip();\n\t\t}\n\t}", "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}", "function getRealIpAddr()\n{\nif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\n//CHECK IP FROM SHARE INTERNET\n\n{\n$ip=$_SERVER['HTTP_CLIENT_IP'];\n\n}\n\nelse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\n// to check if ip is pass from proxy\n\n{\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n}\nelse\n{\n$ip=$_SERVER['REMOTE_ADDR'];\n}\nreturn $ip;\n}", "public function setRemoteIp($remoteIp);", "public function setIpAddress($ip_address);", "public static function get_unsafe_client_ip()\n {\n }", "function getRealIpAddr()\n{\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telseif ($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) {\n\t\t$ip = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\telse\n\t{\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}", "static function IP(){\r\n\t\tif(\\Core\\Server::isCLI()){\r\n\t\t\treturn new IP(static::DEFAULT_IP);\r\n\t\t}\r\n\t\tif(isset($_SERVER['HTTP_X_REAL_IP'])){\r\n\t\t\treturn new IP($_SERVER['HTTP_X_REAL_IP']);\r\n\t\t}\r\n\t\tif(isset($_SERVER['REMOTE_ADDR'])){\r\n\t\t\treturn new IP($_SERVER['REMOTE_ADDR']);\r\n\t\t}\r\n\t\treturn new IP(static::DEFAULT_IP);\r\n\t}", "function bps_get_proxy_real_ip_address() {\n\t\n\tif ( is_admin() && wp_script_is( 'bps-accordion', $list = 'queue' ) && current_user_can('manage_options') ) {\n\t\tif ( isset($_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_CLIENT_IP']);\n\t\t\techo __('HTTP_CLIENT_IP IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\techo __('Proxy X-Forwarded-For IP Address: ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\t\t\t$ip = esc_html($_SERVER['REMOTE_ADDR']);\n\t\t\techo __('Public Internet IP Address (ISP): ', 'bulletproof-security').'<strong>'.$ip.'</strong><br>';\n\t\t}\n\t}\n}", "public function setIp($value)\n {\n return $this->set(self::ip, $value);\n }", "function getRealIpAddr()\n{\nif(!empty($_SERVER['HTTP_CLIENT_IP']))\n//check if from share internet\n{\n\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n}\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "public function Persona (){ \n\n $this->ip=$this->getIP();\n }", "public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "private function auto_reverse_proxy_remote_ip(){\n $remote_addr = $_SERVER['REMOTE_ADDR'];\n if (!empty($_SERVER['X_FORWARDED_FOR'])) {\n $X_FORWARDED_FOR = explode(',', $_SERVER['X_FORWARDED_FOR']);\n if (!empty($X_FORWARDED_FOR)) {\n $remote_addr = trim($X_FORWARDED_FOR[0]);\n }\n }\n /*\n * Some php environments will use the $_SERVER['HTTP_X_FORWARDED_FOR'] \n * variable to capture visitor address information.\n */\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $HTTP_X_FORWARDED_FOR= explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n if (!empty($HTTP_X_FORWARDED_FOR)) {\n $remote_addr = trim($HTTP_X_FORWARDED_FOR[0]);\n }\n }\n return preg_replace('/[^0-9a-f:\\., ]/si', '', $remote_addr);\n }", "function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}", "function getRealUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default : return $_SERVER['REMOTE_ADDR'];\n }\n }", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "public static function getIP() {\n\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $rawheaders = apache_request_headers();\n } else {\n $rawheaders = $_SERVER;\n }\n\n // Lower case headers\n $headers = array();\n foreach($rawheaders as $key => $value) {\n $key = trim(strtolower($key));\n if ( !is_string($key) || empty($key) ) continue;\n $headers[$key] = $value;\n }\n\n // $filter_option = FILTER_FLAG_IPV4;\n // $filter_option = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n $filter_option = 0;\n\n $the_ip = false;\n\n // Check Cloudflare headers\n if ( $the_ip === false && array_key_exists( 'http_cf_connecting_ip', $headers ) ) {\n $pieces = explode(',',$headers['http_cf_connecting_ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'cf-connecting-ip', $headers ) ) {\n $pieces = explode(',',$headers['cf-connecting-ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Get the forwarded IP from more traditional places\n if ( $the_ip == false && array_key_exists( 'x-forwarded-for', $headers ) ) {\n $pieces = explode(',',$headers['x-forwarded-for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'http_x_forwarded_for', $headers ) ) {\n $pieces = explode(',',$headers['http_x_forwarded_for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'remote_addr', $headers ) ) {\n $the_ip = filter_var( $headers['remote_addr'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Fall through and get *something*\n if ( $the_ip === false && array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false ) $the_ip = NULL;\n return $the_ip;\n }", "public function testSetRemoteIp()\n {\n $this->_req->setRemoteIp('999.99.998.9');\n $this->assertEquals('999.99.998.9', $this->_req->getRemoteIp());\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIpAddress($val)\n {\n $this->_propDict[\"ipAddress\"] = $val;\n return $this;\n }", "function pre_system ( $data ) \n\t{\n\n\t\t// Is the HTTP_CF_CONNECTING_IP header set? If not, then this isn't CloudFlare\n\t\t$this->is_cf = ( ! empty( $_SERVER[\"HTTP_CF_CONNECTING_IP\"] )) ? TRUE : FALSE;\n\n\t\t// Set Origin IP\n\t\t$this->origin_ip = ( ! empty( $_SERVER[\"HTTP_CF_CONNECTING_IP\"] ))\n\t\t\t\t? $_SERVER[\"HTTP_CF_CONNECTING_IP\"]\n\t\t\t\t: UNKNOWN_COUNTRY;\n\n\t\t// Set country code\n\t\t$this->ip_country = ( ! empty( $_SERVER[\"HTTP_CF_IPCOUNTRY\"] ))\n\t\t\t\t? $_SERVER[\"HTTP_CF_IPCOUNTRY\"]\n\t\t\t\t: UNKNOWN_COUNTRY;\n\t\t\n\t\t// Set the CloudFlare service IP\n\t\t$this->cloudflare_ip = $_SERVER['REMOTE_ADDR'];\n\t\t\n\t\t// Overwrite the REMOTE_ADDR data if enabled\n\t\tif ( $this->settings['overwrite_addr'] == 'y' )\n\t\t{\n\t\t\t$this->_overwrite_remoteaddr();\n\t\t}\n\t\t\n\t}", "function getRealIP() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n}", "function getRealIpUser(){\r\n \r\n switch(true){\r\n \r\n case(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\r\n case(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\r\n case(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n \r\n default : return $_SERVER['REMOTE_ADDR'];\r\n \r\n }\r\n \r\n}" ]
[ "0.77245855", "0.70626086", "0.6871126", "0.66991776", "0.64520085", "0.6154902", "0.6117788", "0.61056876", "0.61023843", "0.6068344", "0.6062182", "0.6057139", "0.6056744", "0.60567325", "0.6050824", "0.60199815", "0.6014682", "0.6007874", "0.59850883", "0.5985085", "0.59832925", "0.59832925", "0.5979547", "0.59601396", "0.5958646", "0.5958646", "0.5954566", "0.5950262", "0.5947601", "0.59332657" ]
0.76323956
1
Get Cloudflare IPs. saves them in the cache for 48 hours if it finds them successfully
private function get_ips() { $cache_name = 'proxyflare_cloudflare_ips'; // Check Cache before making the request $ips = get_transient( $cache_name ); if ( false === $ips ) { // Set the API URL $url = 'https://api.cloudflare.com/client/v4/ips'; // Set API Call Details $args = array( 'headers' => array( 'User-Agent' => 'Proxyflare/' . PROXYFLARE_VERSION, ) ); // Make the request $response = wp_safe_remote_get( $url, $args ); // Check Response if ( ! is_wp_error( $response ) ) { proxyflare()->log( ' - Cloudflare IP Get Result (' . wp_remote_retrieve_response_code( $response ) . '): ' . wp_remote_retrieve_body( $response ) ); $response = json_decode( wp_remote_retrieve_body( $response ), true ); if ( isset( $response['success'] ) && true == $response['success'] ) { $ips = array( 'ipv4' => $response['result']['ipv4_cidrs'] ?? '', 'ipv6' => $response['result']['ipv6_cidrs'] ?? '' ); // Save Cache for 48 hours set_transient( $cache_name, $ips, 2 * DAY_IN_SECONDS ); } } else { proxyflare()->log( ' - API Error (' . wp_remote_retrieve_response_code( $response ) . '): ' . wp_remote_retrieve_body( $response ) ); return false; } return false; } else { return $ips; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getIp()\n\t {\n\t \n\t if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ))\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t \n\t // los proxys van añadiendo al final de esta cabecera\n\t // las direcciones ip que van \"ocultando\". Para localizar la ip real\n\t // del usuario se comienza a mirar por el principio hasta encontrar\n\t // una dirección ip que no sea del rango privado. En caso de no\n\t // encontrarse ninguna se toma como valor el REMOTE_ADDR\n\t \n\t $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t \n\t reset($entries);\n\t while (list(, $entry) = each($entries))\n\t {\n\t $entry = trim($entry);\n\t if ( preg_match(\"/^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/\", $entry, $ip_list) )\n\t {\n\t // http://www.faqs.org/rfcs/rfc1918.html\n\t $private_ip = array(\n\t '/^0\\./',\n\t '/^127\\.0\\.0\\.1/',\n\t '/^192\\.168\\..*/',\n\t '/^172\\.((1[6-9])|(2[0-9])|(3[0-1]))\\..*/',\n\t '/^10\\..*/');\n\t \n\t $found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);\n\t \n\t if ($client_ip != $found_ip)\n\t {\n\t $client_ip = $found_ip;\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t else\n\t {\n\t $client_ip =\n\t ( !empty($_SERVER['REMOTE_ADDR']) ) ?\n\t $_SERVER['REMOTE_ADDR']\n\t :\n\t ( ( !empty($_ENV['REMOTE_ADDR']) ) ?\n\t $_ENV['REMOTE_ADDR']\n\t :\n\t \"unknown\" );\n\t }\n\t \n\t return $client_ip;\n\t \n\t}", "function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}", "public function ip($ip)\n {\n return $this->cache->remember('ip:' . $ip, self::TTL, function () use ($ip) {\n return $this->geoIp->ip($ip);\n });\n }", "public function getCacheTTL();", "private function set_real_ip() {\n\n\t\t$is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false;\n\t\tif ( ! $is_cf ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\n\t\tif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\n\t\t\t// Grab the Current Cloudflare Address Range\n\t\t\t$cf_ips_values = $this->get_ips();\n\t\t\tif ( false == $cf_ips_values || empty($cf_ips_values) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the we getting a IPv4 or IPv6 Address\n\t\t\tif ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) {\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv4'] ?? '';\n\n\t\t\t\t// IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv6'];\n\t\t\t\t$ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv6_in_range( $ipv6, $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function getIPPublic ()\n {\n $dbs = new DB ( $this->config['database'] );\n $search = $dbs->query(\"SELECT * FROM tbl_client_connection_priv WHERE\n priv_client_id LIKE '\". $this->c .\"%' order by private_rec_date desc limit 1\");\n\t\t\tif ( count ( $search ) ) {\n\t\t\t\t$this->result['id'] = $this->c;\n\t\t\t\t$this->result['real_ip_address'] = $search[0]['real_client_ip'];\n\t\t\t} else\n\t\t\t\t$this->result['data']['result'] = $this->c . \":No usage history found\";\n\t\t\t\n\t\t\t$dbs->CloseConnection ();\n\t\t\treturn;\n\t\t}", "public function all()\n {\n $cacheTime = $this->config()->get('ip_list_cache_expire_time');\n\n if ($cacheTime > 0 && $list = $this->cache()->get(static::IP_ADDRESS_LIST_CACHE_NAME)) {\n return $list;\n }\n\n $list = $this->mergeLists(\n $this->getAllFromDatabase(),\n $this->toModels($this->getNonDatabaseIps())\n );\n\n if ($cacheTime > 0) {\n $this->cache()->put(static::IP_ADDRESS_LIST_CACHE_NAME, $list, $cacheTime);\n }\n\n return $list;\n }", "function get_ip(){?\r\r\t$do_check = 1;\r\r\t$addrs = array();\r\r\r\r\tif( $do_check )\r\r\t{\r\r\t\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\r\t\t foreach( array_reverse(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])) as $x_f )\r\r \t\t{\r\r \t\t\t$x_f = trim($x_f);\r\r \t\t\tif( preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $x_f) )\r\r \t\t\t{\r\r \t\t\t\t$addrs[] = $x_f;\r\r \t\t\t}\r\r \t\t}\r\r\t\t}\r\r \r\r\r\r\t\tif(isset($_SERVER['HTTP_CLIENT_IP'])) $addrs[] = $_SERVER['HTTP_CLIENT_IP'];\r\r\t\tif(isset($_SERVER['HTTP_PROXY_USER'])) $addrs[] = $_SERVER['HTTP_PROXY_USER'];\r\r\t}\r\r\r\r\t$addrs[] = $_SERVER['REMOTE_ADDR'];\r\r\r\r\tforeach( $addrs as $v )\r\r\t{\r\r\t\tif( $v )\r\r\t\t{\r\r\t\t\tpreg_match(\"/^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/\", $v, $match);\r\r\t\t\t$ip = $match[1].'.'.$match[2].'.'.$match[3].'.'.$match[4];\r\r\r\r\t\t\tif( $ip && $ip != '...' )\r\r\t\t\t{\r\r\t\t\t\tbreak;\r\r\t\t\t}\r\r\t\t}\r\r\t}\r\r\r\r\tif( ! $ip || $ip == '...' )\r\r\t{\r\r\t\techo \"Không thể xác định địa chỉ IP của bạn.\";\r\r\t}\r\r\r\r\treturn $ip;\r\r}", "function getIp()\n{\n $ip = false;\n\n if(!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_X_FORWARDED_FOR']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['HTTP_VIA']))\n {\n $ips = explode(\",\", \n $_SERVER['HTTP_VIA']);\n for ($i = 0; $i < count($ips); $i++)\n {\n $ips = trim($ips[$i]);\n if (!eregi(\"^(10|172\\.16|192\\.168)\\.\", \n $ips[$i]))\n {\n $ip = $ips[$i];\n break;\n }\n }\n }\n elseif (!empty($_SERVER['REMOTE_ADDR']))\n {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n if (($longip = ip2long($ip)) !== false)\n {\n if ($ip == long2ip($longip))\n {\n return $ip;\n }\n }\n \n return false;\n}", "function get_uk_ip()\n {\n \t\n \t$username = 'lum-customer-hl_db480584-zone-static-route_err-pass_dyn';\n \t$password = 'wa22odw9t60g';\n \t$port = 22225;\n \t$user_agent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36';\n \t$session = mt_rand();\n \t$super_proxy = 'zproxy.lum-superproxy.io';\n \t$curl = curl_init('http://lumtest.com/myip.json');\n \tcurl_setopt($curl, CURLOPT_USERAGENT, $user_agent);\n \tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \tcurl_setopt($curl, CURLOPT_PROXY, \"http://$super_proxy:$port\");\n \tcurl_setopt($curl, CURLOPT_PROXYUSERPWD, \"$username-country-gb-session-$session:$password\");\n \t$result = curl_exec($curl);\n \t$curl_error = curl_error($curl);\n \t$curl_info = curl_getinfo($curl);\n \tcurl_close($curl);\n \t\n \t$result_jd=json_decode($result,true);\n \t\n \t$ip=$result_jd['ip'];\n \t\n \tif(empty($ip))\n \t{\n \t\t$ip = get_client_ip();\n \t}\n\n \treturn $ip;\n }", "public static function ip2Address($ip){\n\n //Could we return from recently fetched ones?\n if(array_key_exists($ip,self::$RECENT_IP2ADDRESSES)){\n return self::$RECENT_IP2ADDRESSES[$ip];\n }\n\n \n //$ip_database_path=//self::basePath().'/database/geoip2';\n \n $city_database=base_path().'/'.ltrim(config('laradmin.geoip.db_city_filename','\\\\/'));//$ip_database_path.'/GeoLite2-City.mmdb';\n //$country_database=$ip_database_path.'/GeoLite2-Country.mmdb';\n\n // This creates the Reader object, which should be reused across\n // lookups.\n $reader = new \\GeoIp2\\Database\\Reader($city_database);\n\n // Replace \"city\" with the appropriate method for your database, e.g.,\n // \"country\".\n\n $record = $reader->city($ip);\n $address=[];\n\n $address['latitude']=$record->location->latitude;\n $address['longitude']=$record->location->longitude;\n $address['city_name']=$record->city->name; \n $address['country_name']=$record->country->name;\n //$address['country_iso_code']=$record->country->isoCode; NOTE: OPEN THIS IF NEEDED\n\n\n // Save some recent address: TODO: Change this to proper catching so that it can be used across sessions.\n self::$RECENT_IP2ADDRESSES[$ip]=$address;\n if(count(self::$RECENT_IP2ADDRESSES)>3){\n array_shift(self::$RECENT_IP2ADDRESSES);\n }\n\n return $address;\n \n }", "public static function fetch_alt_ip() {\n $alt_ip = $_SERVER['REMOTE_ADDR'];\n\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\n $alt_ip = $_SERVER['HTTP_CLIENT_IP'];\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) {\n // try to avoid using an internal IP address, its probably a proxy\n $ranges = array(\n '10.0.0.0/8' => array(ip2long('10.0.0.0'), ip2long('10.255.255.255')),\n '127.0.0.0/8' => array(ip2long('127.0.0.0'), ip2long('127.255.255.255')),\n '169.254.0.0/16' => array(ip2long('169.254.0.0'), ip2long('169.254.255.255')),\n '172.16.0.0/12' => array(ip2long('172.16.0.0'), ip2long('172.31.255.255')),\n '192.168.0.0/16' => array(ip2long('192.168.0.0'), ip2long('192.168.255.255')),\n );\n foreach ($matches[0] AS $ip) {\n $ip_long = ip2long($ip);\n if ($ip_long === false) {\n continue;\n }\n\n $private_ip = false;\n foreach ($ranges AS $range) {\n if ($ip_long >= $range[0] AND $ip_long <= $range[1]) {\n $private_ip = true;\n break;\n }\n }\n\n if (!$private_ip) {\n $alt_ip = $ip;\n break;\n }\n }\n } else if (isset($_SERVER['HTTP_FROM'])) {\n $alt_ip = $_SERVER['HTTP_FROM'];\n }\n\n return $alt_ip;\n }", "public function allIpAction() {\n\n $url = \"156.17.231.34\";\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_exec($ch);\n $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($retcode >= 100 && $retcode <= 505) {\n //echo \"work \" . $retcode . \"<br/>\";\n } else {\n // echo \"nie dziala \" . $retcode . \"<br/>\";\n }\n }", "public static function getIP() {\n\n //Just get the headers if we can or else use the SERVER global\n if ( function_exists( 'apache_request_headers' ) ) {\n $rawheaders = apache_request_headers();\n } else {\n $rawheaders = $_SERVER;\n }\n\n // Lower case headers\n $headers = array();\n foreach($rawheaders as $key => $value) {\n $key = trim(strtolower($key));\n if ( !is_string($key) || empty($key) ) continue;\n $headers[$key] = $value;\n }\n\n // $filter_option = FILTER_FLAG_IPV4;\n // $filter_option = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;\n $filter_option = 0;\n\n $the_ip = false;\n\n // Check Cloudflare headers\n if ( $the_ip === false && array_key_exists( 'http_cf_connecting_ip', $headers ) ) {\n $pieces = explode(',',$headers['http_cf_connecting_ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'cf-connecting-ip', $headers ) ) {\n $pieces = explode(',',$headers['cf-connecting-ip']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Get the forwarded IP from more traditional places\n if ( $the_ip == false && array_key_exists( 'x-forwarded-for', $headers ) ) {\n $pieces = explode(',',$headers['x-forwarded-for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'http_x_forwarded_for', $headers ) ) {\n $pieces = explode(',',$headers['http_x_forwarded_for']);\n $the_ip = filter_var(current($pieces),FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false && array_key_exists( 'remote_addr', $headers ) ) {\n $the_ip = filter_var( $headers['remote_addr'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n // Fall through and get *something*\n if ( $the_ip === false && array_key_exists( 'REMOTE_ADDR', $_SERVER ) ) {\n $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, $filter_option );\n }\n\n if ( $the_ip === false ) $the_ip = NULL;\n return $the_ip;\n }", "function getMembersOnline(): int\n{\n return cache()->remember('i.membersOnline', getCacheILifetime('membersOnline'), function () {\n $onlinePeriod = 10; // minutes\n return \\App\\Models\\PageViews::select('user_ip')\n ->distinct()\n ->where('created_at', '>', now()->subMinutes($onlinePeriod))\n ->where('user_id', '!=', '')\n ->count(['user_ip']);\n });\n}", "public function cacheGet() {\n }", "function get_all_ip()\r\n{ \r\n global $db,$strings;\r\n $count = 0;\r\n $result = $db->query('SELECT ip_id,ipaddr FROM ipmap ORDER BY ipaddr ASC');\r\n\r\n while (@extract($db->fetch_array($result), EXTR_PREFIX_ALL, 'db')) {\r\n \t$iplist[$db_ip_id] = $db_ipaddr;\r\n\t\t$count ++;\r\n }\r\n\r\n\t$iplist[-1] = $strings[IPMAP_NOTASSIGNED];\r\n \r\n return $iplist;\r\n}", "function getRemote( $the_url, $cache_lifetime=60 )\n\t\t{\n\t\t\t$request_alias = 'aiowaff_' . md5($the_url);\n\t\t\t$from_cache = get_option( $request_alias );\n\t\t\t\n\t\t\tif( $from_cache != false ){\n\t\t\t\tif( time() < ( $from_cache['when'] + ($cache_lifetime * 60) )){\n\t\t\t\t\treturn $from_cache['data'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$response = wp_remote_get( $the_url, array('user-agent' => \"Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0\", 'timeout' => 10) ); \n\t\t\t\n\t\t\t// If there's error\n if ( is_wp_error( $response ) ){\n \treturn array(\n\t\t\t\t\t'status' => 'invalid'\n\t\t\t\t);\n }\n \t$body = wp_remote_retrieve_body( $response );\n\t\t\t\n\t\t\t$response_data = json_decode( $body, true );\n\t\t\t\n\t\t\t// overwrite the cache data \n\t\t\tupdate_option( $request_alias, array(\n\t\t\t\t'when' => time(),\n\t\t\t\t'data' => $response_data\n\t\t\t) );\n\t\t\t\t\n\t return $response_data;\n\t\t}", "function getIPs() {\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n if (isset($_SERVER['HTTP_CLIENT_IP'])) {\r\n \t$ip .= '_'.$_SERVER['HTTP_CLIENT_IP'];\r\n }\r\n return $ip;\r\n}", "function wpcom_vip_file_get_contents( $url, $timeout = 3, $cache_time = 900, $extra_args = array() ) {\n\tglobal $blog_id;\n\n\t$extra_args_defaults = array(\n\t\t'obey_cache_control_header' => true, // Uses the \"cache-control\" \"max-age\" value if greater than $cache_time\n\t\t'http_api_args' => array(), // See http://codex.wordpress.org/Function_API/wp_remote_get\n\t);\n\n\t$extra_args = wp_parse_args( $extra_args, $extra_args_defaults );\n\n\t$cache_key = md5( serialize( array_merge( $extra_args, array( 'url' => $url ) ) ) );\n\t$backup_key = $cache_key . '_backup';\n\t$disable_get_key = $cache_key . '_disable';\n\t$cache_group = 'wpcom_vip_file_get_contents';\n\n\t// Temporary legacy keys to prevent mass cache misses during our key switch\n\t$old_cache_key = md5( $url );\n\t$old_backup_key = 'backup:' . $old_cache_key;\n\t$old_disable_get_key = 'disable:' . $old_cache_key;\n\n\t// Let's see if we have an existing cache already\n\t// Empty strings are okay, false means no cache\n\tif ( false !== $cache = wp_cache_get( $cache_key, $cache_group) )\n\t\treturn $cache;\n\n\t// Legacy\n\tif ( false !== $cache = wp_cache_get( $old_cache_key, $cache_group) )\n\t\treturn $cache;\n\n\t// The timeout can be 1 to 10 seconds, we strongly recommend no more than 3 seconds\n\t$timeout = min( 10, max( 1, (int) $timeout ) );\n\n\tif ( $timeout > 3 )\n\t\t_doing_it_wrong( __FUNCTION__, 'Using a timeout value of over 3 seconds is strongly discouraged because users have to wait for the remote request to finish before the rest of their page loads.', null );\n\n\t$server_up = true;\n\t$response = false;\n\t$content = false;\n\n\t// Check to see if previous attempts have failed\n\tif ( false !== wp_cache_get( $disable_get_key, $cache_group ) ) {\n\t\t$server_up = false;\n\t}\n\t// Legacy\n\telseif ( false !== wp_cache_get( $old_disable_get_key, $cache_group ) ) {\n\t\t$server_up = false;\n\t}\n\t// Otherwise make the remote request\n\telse {\n\t\t$http_api_args = (array) $extra_args['http_api_args'];\n\t\t$http_api_args['timeout'] = $timeout;\n\t\t$response = wp_remote_get( $url, $http_api_args );\n\t}\n\n\t// Was the request successful?\n\tif ( $server_up && ! is_wp_error( $response ) && 200 == wp_remote_retrieve_response_code( $response ) ) {\n\t\t$content = wp_remote_retrieve_body( $response );\n\n\t\t$cache_header = wp_remote_retrieve_header( $response, 'cache-control' );\n\t\tif ( is_array( $cache_header ) )\n\t\t\t$cache_header = array_shift( $cache_header );\n\n\t\t// Obey the cache time header unless an arg is passed saying not to\n\t\tif ( $extra_args['obey_cache_control_header'] && $cache_header ) {\n\t\t\t$cache_header = trim( $cache_header );\n\t\t\t// When multiple cache-control directives are returned, they are comma separated\n\t\t\tforeach ( explode( ',', $cache_header ) as $cache_control ) {\n\t\t\t\t// In this scenario, only look for the max-age directive\n\t\t\t\tif( 'max-age' == substr( trim( $cache_control ), 0, 7 ) )\n\t\t\t\t\t// Note the array_pad() call prevents 'undefined offset' notices when explode() returns less than 2 results\n\t\t\t\t\tlist( $cache_header_type, $cache_header_time ) = array_pad( explode( '=', trim( $cache_control ), 2 ), 2, null );\n\t\t\t}\n\t\t\t// If the max-age directive was found and had a value set that is greater than our cache time\n\t\t\tif ( isset( $cache_header_type ) && isset( $cache_header_time ) && $cache_header_time > $cache_time )\n\t\t\t\t$cache_time = (int) $cache_header_time; // Casting to an int will strip \"must-revalidate\", etc.\n\t\t}\n\n\t\t// The cache time shouldn't be less than a minute\n\t\t// Please try and keep this as high as possible though\n\t\t// It'll make your site faster if you do\n\t\t$cache_time = (int) $cache_time;\n\t\tif ( $cache_time < 60 )\n\t\t\t$cache_time = 60;\n\n\t\t// Cache the result\n\t\twp_cache_set( $cache_key, $content, $cache_group, $cache_time );\n\n\t\t// Additionally cache the result with no expiry as a backup content source\n\t\twp_cache_set( $backup_key, $content, $cache_group );\n\n\t\t// So we can hook in other places and do stuff\n\t\tdo_action( 'wpcom_vip_remote_request_success', $url, $response );\n\t}\n\t// Okay, it wasn't successful. Perhaps we have a backup result from earlier.\n\telseif ( $content = wp_cache_get( $backup_key, $cache_group ) ) {\n\t\t// If a remote request failed, log why it did\n\t\tif ( ! defined( 'WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING' ) || ! WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING ) {\n\t\t\tif ( $response && ! is_wp_error( $response ) ) {\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response['headers'] ) . ' ' . maybe_serialize( $response['response'] ) );\n\t\t\t} elseif ( $response ) { // is WP_Error object\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response ) );\n\t\t\t}\n\t\t}\n\t}\n\t// Legacy\n\telseif ( $content = wp_cache_get( $old_backup_key, $cache_group ) ) {\n\t\t// If a remote request failed, log why it did\n\t\tif ( ! defined( 'WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING' ) || ! WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING ) {\n\t\t\tif ( $response && ! is_wp_error( $response ) ) {\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response['headers'] ) . ' ' . maybe_serialize( $response['response'] ) );\n\t\t\t} elseif ( $response ) { // is WP_Error object\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response ) );\n\t\t\t}\n\t\t}\n\t}\n\t// We were unable to fetch any content, so don't try again for another 60 seconds\n\telseif ( $response ) {\n\t\twp_cache_set( $disable_get_key, 1, $cache_group, 60 );\n\n\t\t// If a remote request failed, log why it did\n\t\tif ( ! defined( 'WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING' ) || ! WPCOM_VIP_DISABLE_REMOTE_REQUEST_ERROR_REPORTING ) {\n\t\t\tif ( $response && ! is_wp_error( $response ) ) {\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response['headers'] ) . ' ' . maybe_serialize( $response['response'] ) );\n\t\t\t} elseif ( $response ) { // is WP_Error object\n\t\t\t\terror_log( \"wpcom_vip_file_get_contents: Blog ID {$blog_id}: Failure for $url and the result was: \" . maybe_serialize( $response ) );\n\t\t\t}\n\t\t}\n\t\t// So we can hook in other places and do stuff\n\t\tdo_action( 'wpcom_vip_remote_request_error', $url, $response );\n\t}\n\n\treturn $content;\n}", "function _prime_network_caches( $network_ids ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' );\n\tif ( !empty( $non_cached_ids ) ) {\n\t\t$fresh_networks = $wpdb->get_results( sprintf( \"SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)\", join( \",\", array_map( 'intval', $non_cached_ids ) ) ) );\n\n\t\tupdate_network_cache( $fresh_networks );\n\t}\n}", "public function ip()\n {\n \n try {\n $ip_arr = Yaml::parseFile($this->config['ip_config_path']);\n } catch (\\Exception $e) {\n // Do something\n $ip_arr = [];\n }\n\n $out = [];\n\n // Compile SQL\n $cnt = 0;\n $sel_arr = array('COUNT(1) as count');\n foreach ($ip_arr as $key => $value) {\n if (is_scalar($value)) {\n $value = array($value);\n }\n $when_str = '';\n foreach ($value as $k => $v) {\n $when_str .= sprintf(\" WHEN remote_ip LIKE '%s%%' THEN 1\", $v);\n }\n $sel_arr[] = \"SUM(CASE $when_str ELSE 0 END) AS r{$cnt}\";\n $cnt++;\n }\n $sql = \"SELECT \" . implode(', ', $sel_arr) . \"\n\t\t\t\tFROM reportdata \"\n .get_machine_group_filter();\n\n $reportdata = Reportdata_model::selectRaw(implode(', ', $sel_arr))\n ->filter()\n ->first();\n // Create Out array\n if ($reportdata) {\n $cnt = $total = 0;\n foreach ($ip_arr as $key => $value) {\n $col = 'r' . $cnt++;\n\n $out[] = array('key' => $key, 'cnt' => intval($reportdata[$col]));\n\n $total += $reportdata[$col];\n }\n\n // Add Remaining IP's as other\n if ($reportdata['count'] - $total) {\n $out[] = array('key' => 'Other', 'cnt' => $reportdata['count'] - $total);\n }\n }\n\n $obj = new View();\n $obj->view('json', array('msg' => $out));\n }", "function getVisitorsOnline(): int\n{\n return cache()->remember('i.visitorsOnline', getCacheILifetime('visitorsOnline'), function () {\n $onlinePeriod = 10; // minutes\n return \\App\\Models\\PageViews::select('user_ip')\n ->distinct()\n ->where('created_at', '>', now()->subMinutes($onlinePeriod))\n ->count(['user_ip']);\n });\n}", "private function getClientIP ()\n {\n $status_data = file ( $this->config['status'] ) ;\n $i = 0;\n while ( $i < count ( $status_data ) ) { /* Process openvpn-status.log */\n $buffer = explode (\",\" , $status_data [$i] ) ;\n if ( count ( $buffer ) == 4) {\n if ( strstr( $status_data[$i], $this->c ) ) {\n $status_info = explode (\",\" , $status_data[$i] );\n $this->result['data']['id'] = $this->c;\n $this->result['data']['private_ip'] = trim($status_info[0]);\n $this->result['data']['connect_date'] = trim($status_info[3]);\n $this->result['data']['from'] = \"status.log\";\n }\n }\n $i++;\n }\n\n\t\t\t/* Id not found in openvpn-status.log */\n\t\t\t/* Check fixed ip address from database */\t\t\t\n\t\t\tif ( ! isset ( $this->result['data']['private_ip'] ) ) \t{\n\t\t\t\t$dbs = new DB ( $this->config['database'] );\n \t$c = $dbs->query (\"SELECT * FROM tbl_vpn_org where org_id = '\" . $this->c . \"'\");\n \tif ( count ( $c ) ) { /* Check org */\n\t\t\t\t\t$dbfx = new DB ( $this->config['database'] );\t\t\n\t\t\t\t\t$resfx = $dbfx->query (\"SELECT * FROM tbl_custom_ip WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t\tif ( count ( $resfx ) ) { /* Check fixed ip by id */\n\t\t\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t\t\t$this->result['data']['ip'] = $resfx[0]['fix_ip'];\n\t\t\t\t\t\t$this->result['data']['note'] = \"Fixed ip address\";\n\t\t\t\t\t} else /* Fixed ip address not found, But id founded in main system */\n\t\t\t\t\t\t$this->result['data']['result'] = \"DHCP\";\n\t\t\t\t\t$dbfx->CloseConnection ();\t\n\t\t\t\t} else { \n\t\t\t\t\t/* Main id not found */\n\t\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\t\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t}\n return;\n }", "function wp_nrc_cached_api( $npi ) {\n\t// Namespace in case of collision, since transients don't support groups like object caching.\n\t$url = 'https://transparency.nrchealth.com/widget/api/org-profile/uams/npi/' . $npi . '/0';\n\t$cache_key = 'nrc_' . $npi;\n\t$request = get_transient( $cache_key );\n\n\tif ( false === $request ) {\n\t\t$request = wp_remote_retrieve_body( wp_remote_get( $url ) );\n\n\t\tif ( is_wp_error( $request ) ) {\n\t\t\t// Cache failures for a short time, will speed up page rendering in the event of remote failure.\n\t\t\tset_transient( $cache_key, $request, MINUTE_IN_SECONDS * 15 );\n\t\t} else {\n\t\t\t// Success, cache for a longer time.\n\t\t\tset_transient( $cache_key, $request, DAY_IN_SECONDS );\n\t\t}\n\t}\n\treturn $request;\n}", "function getIp() {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n \r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n \r\n return $ip;\r\n\r\n\r\n\r\n\r\n//getting the cart\r\n}", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getIpCustomer(){\n$ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'IP Tidak Dikenali';\n \n return $ipaddress;\n}", "public static function getCache() {}", "function return_ns_ip($domain) {\n\tglobal $dns_ip_list_c;\n\tif (!@file_exists(\"/usr/bin/dig\")) return;\n\t$msg=array();\n\t//echo $domain.\"\\n\";\n\tfor ($i=0;$i<sizeof($dns_ip_list_c);$i++) {\n\t\t//echo sizeof($dns_ip_list_c[$i]).\"\\n\";\n\t\tfor ($j=0;$j<sizeof($dns_ip_list_c[$i]);$j++) {\n\t\t\t$nip=$dns_ip_list_c[$i][$j][1];\n\t\t\t//echo $nip.\"\\n\";\n\t\t\texec(\"dig @$nip +short +time=1 +tries=1 +retry=1 $domain\",$str,$re);\n\t\t\t//$msg[$nip]=$str[0];\n\t\t\t$msg[]=$str[0];\n\t\t\t$str=\"\";\n\t\t\t//print_r($str);\n\t\t\t//$msg[]=$\n\t\t\t//echo $dns_ip_list_c[$i][$j][1].\"\\n\";\n\t\t}\n\t}\n\t//print_r($msg);\n\treturn $msg;\n}" ]
[ "0.62851995", "0.5880484", "0.5875258", "0.5848676", "0.5815484", "0.5763367", "0.57107735", "0.56935096", "0.56357396", "0.56327885", "0.5628954", "0.5621176", "0.56004065", "0.5584677", "0.55797565", "0.55784816", "0.5576812", "0.55730903", "0.55622536", "0.55471826", "0.55454665", "0.5524435", "0.5506406", "0.5504117", "0.55038095", "0.5496002", "0.54956865", "0.5482614", "0.5455344", "0.5454445" ]
0.7651022
0
Get the movieVote associated with the User
public function movieVote(): HasOne { return $this->hasOne(MovieVote::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_vote($event_id, $user_id);", "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function getVote(User $voter): ?string {\n $stmt = $this->db->prepare('\n SELECT `sentiment` FROM `votes`\n WHERE `message_id` = :message_id\n AND `cast_by` = :cast_by;\n ');\n $stmt->execute([\n 'message_id' => $this->id,\n 'cast_by' => $voter->getId(),\n ]);\n $row = $stmt->fetch();\n if (!$row) {\n return null;\n }\n if ((int) $row['sentiment'] === 1) {\n return 'up';\n }\n return 'down';\n }", "public function voteVideoAction()\n\t{\n\t\t$userSession\t= new Container('fo_user');\n\t\t$request\t\t= $this->getRequest();\n\t\t\n\t\tif(isset($userSession->userSession['_id']) && trim($userSession->userSession['_id']) != '') {\n\t\t\tif($request->isPost()) {\n\t\t\t\t$formData\t= $request->getPost();\n\t\t\t\tif(!isset($userSession->mediaSession['rating'][base64_decode($formData['videoId'])]) && isset($formData['type']) && ($formData['type'] == '1' || $formData['type'] == '2')) {\n\t\t\t\t\t$this->doVote($formData['type'], $formData['videoId']);\n\t\t\t\t\t$typeText\t= ($formData['type'] == 1) ? 'like' : 'dislike';\n\t\t\t\t\tif(isset($userSession->mediaSession['rating'])) {\n\t\t\t\t\t\t$tempArray['rating']\t\t\t\t\t\t\t\t\t\t= $userSession->mediaSession['rating'];\n\t\t\t\t\t\t//$tempArray['rating'][base64_decode($formData['videoId'])]\t= base64_decode($formData['videoId']);\n\t\t\t\t\t\t$tempArray['rating'][base64_decode($formData['videoId'])]\t= $typeText;\n\t\t\t\t\t\t$userSession->mediaSession\t\t\t\t\t\t\t\t\t= $tempArray;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$tempArray['rating'][base64_decode($formData['videoId'])]\t= base64_decode($formData['videoId']);\n\t\t\t\t\t\t$tempArray['rating'][base64_decode($formData['videoId'])]\t= $typeText;\n\t\t\t\t\t\t$userSession->mediaSession\t\t\t\t\t\t\t\t\t= $tempArray;\n\t\t\t\t\t}\n\t\t\t\t\techo trim($formData['type']);\n\t\t\t\t} else if(isset($userSession->mediaSession['rating'][base64_decode($formData['videoId'])])) {\n\t\t\t\t\techo \"-2\";\t// Voted\n\t\t\t\t} else {\n\t\t\t\t\techo \"-1\";\t//\timproper data\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"-1\";\t//\timproper data\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\tuser session is in-active\n\t\t}\n\t\treturn $this->getResponse();\n\t}", "public function test_users_vote_can_be_retrieved() {\n\n $user = User::create('[email protected]', 'secret', 'Jane Doe');\n\n $this->assertNull($this->message->getVote($user));\n\n $this->message->upvote($user);\n $this->assertEquals('up', $this->message->getVote($user));\n\n $this->message->downvote($user);\n $this->assertEquals('down', $this->message->getVote($user));\n\n }", "public function ViewVideo($user_id){\r\n\t\t\t$select = $this->db->query(\"SELECT * FROM $this->_dataMasjid WHERE $this->_UserID='$user_id' \");\r\n\t\t\t$view = $select->fetch_object();\r\n\t\t\treturn $view;\r\n\t\t}", "function checkvote($idvideo, $iduser){\n \t$realid = pg_escape_string($idvideo);\n \t$realusr = pg_escape_string($iduser);\n \t$query = \"SELECT idvotexuser, vote FROM votexuser where idvideo = \".$realid.\" and idusuario = \".$realusr.\";\";\n \t$link = createConection();\n \t$result = pg_exec($link, $query);\n \tcloseConection($link);\n \treturn $result;\n }", "public function getViewUser()\n {\n return $this->belongsTo('App\\User', 'live_video_viewer_id');\n }", "public function findVote(User $user, $id, $type)\n {\n \treturn Vote::where('user_id', '=', $user->id)->where('votable_id', '=', $id)->where('votable_type', $type)->first();\n }", "function getVotingMember() {\n\t\treturn Member::get()->byID($this->MemberID);\n\t}", "public function voteValue($user_id)\n {\n $vote = Vote::where([\n ['article_id', $this->id],\n ['user_id', $user_id]\n ])->first();\n\n if ($vote) {\n return $vote->value;\n } else {\n return 0;\n }\n }", "public function getVideo() {\r\n $video_id = Input::get('video_id');\r\n $user_id = Input::get('user_id');\r\n\r\n $video = Video::find($video_id);\r\n\r\n // Get favorite\r\n $favorite = VideoFavorites::where('video_id', $video_id)\r\n ->where('user_id', $user_id)\r\n ->first();\r\n\r\n if ($favorite)\r\n $video->favorite = 1;\r\n else\r\n $video->favorite = 0;\r\n\r\n return response()->json($video);\r\n }", "public function user()\n {\n return $this->belongsToMany('App\\Http\\Models\\User', 'user_favoris', 'movies_id', 'user_id');\n }", "public function vote()\n {\n # Check if the user is logged in\n if( $this->session->userdata('id') )\n {\n # Define Vote class\n $vote = new User_Vote();\n $vote->where('user_id', $this->input->get('id') )\n ->where('user_voted_id', $this->session->userdata('id') )\n ->get();\n\n # Instanciate a new user\n $user = new User($this->input->get('id'));\n\n # Check if the disponibility has already been voted\n if( $vote->exists() )\n {\n # Delete the vote\n $vote->delete();\n\n # Send the response\n echo json_encode(array('result' => 'alert', 'text' => \"Você deixou de seguir \\\"{$user->name} {$user->surname}\\\".\"));\n\n }else{\n # Set variables\n $vote->user_id = $this->input->get('id');\n $vote->user_voted_id = $this->session->userdata('id');\n\n # Save into database\n $vote->save();\n\n echo json_encode(array('result' => 'success', 'text' => \"Agora você está seguindo \\\"{$user->name} {$user->surname}\\\".\"));\n }\n }else{\n echo json_encode(\n array('result' => 'error', 'text' => \"Você precisa fazer login na Galatea para seguir alguém.\")\n );\n }\n\n }", "public function vote(Voting $voting, User $user, $answerId);", "public function getVote($idea_id,$user_id)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideavotes;\r\n $select = $model -> select()->where('user_id = ?',$user_id)->where('idea_id=?',$idea_id); \r\n $row = $model->fetchRow($select); \r\n \r\n return $row;\r\n }", "public function getMovies()\n {\n return $this->hasOne(Movies::className(), ['id' => 'movies_id']);\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function getLastVideoPublication($user){\n return $this->getByCategoryTypeLimited('Video', $user);\n }", "public function actionLikedFindOne(){\n\t\t$id_user = F3::get('PARAMS.id');\n\n\t\t$user = $this->model_users->getUser($id_user);\n\n\t\tif (!empty($user)):\n\t\t\t$data = $this->model_likes->getUserAction($id_user, $action = 'like');\n\n\t\t\tif (!empty($data)):\n\t\t\t\tApi::response(200, $data);\n\t\t\telse:\n\t\t\t\tApi::response(204, 'No movies liked by this user');\n\t\t\tendif;\n\n\t\telse:\n\t\t\tApi::response(400, 'Bad ID : this user doesn\\'t exist');\n\t\tendif;\n\t}", "public function votes()\n\t{\n\t\treturn $this->belongsToMany('Tangfastics\\Models\\User', 'votes');\n\t}", "public function voter() {\n return $this->belongsTo('Voter', 'voter_id_num', 'voter_id_num');\n }", "public function show(Voter $voter)\n {\n //\n }", "public function topVotedVideosAction()\n {\n\t\t$result = new ViewModel();\n\t $result->setTerminal(true);\n\t\t\n\t\t$matches\t= $this->getEvent()->getRouteMatch();\n\t\t$page\t\t= $matches->getParam('id', 1);\n\t\t$pageNav\t= $matches->getParam('perPage', '1');\n\t\t\n\t\t//\tSession for listing\n\t\t$listingSession = new Container('fo_listing');\n\t\tif($page == '0') {\n\t\t\t$listingSession->page\t= 1;\n\t\t\t$page\t= 1;\n\t\t} else if($listingSession->offsetExists('page')) {\n\t\t\t$page\t= $listingSession->page+1;\n\t\t\t$listingSession->page\t= $page;\n\t\t} else {\n\t\t\t$listingSession->page\t= 1;\n\t\t\t$page\t= 1;\n\t\t}\n\t\t$message\t= '';\n\t\t//\tFetch Media Ids\n\t\t$recordsArray\t= $this->getTopVotedVideos($page, 18);\n\t\t$totalRecords\t= (isset($recordsArray['total'])) ? $recordsArray['total'] : 0;\n\t\t\n\t\t//\tFetch Media Details\n\t\t$mediaIdArray\t= array();\n\t\t$tempIdArray\t= array();\n\t\t\n\t\tif(isset($recordsArray['records']) && is_array($recordsArray['records']) && count($recordsArray['records']) > 0) {\n\t\t\tforeach($recordsArray['records'] as $pkey => $pvalue) {\n\t\t\t\t$mediaIdArray[$pvalue['_id']]['id']\t\t= $pvalue['_id'];\n\t\t\t\t$mediaIdArray[$pvalue['_id']]['votes']\t= $pvalue['votes'];\n\t\t\t\t$tempIdArray[]\t\t\t\t\t\t\t= $pvalue['_id'];\n\t\t\t}\n\t\t\t$mediaDetails\t= $this->getMediaDetails($tempIdArray);\n\t\t}\n\t\t$resultArray\t= $mediaDetails;\n\t\t\n\t\t$userSession\t= new Container('fo_user');\t// Extended Friends Layer\n\t\t$tempUserSession= $userSession->mediaSession;\n\t\t$extFriendsArray= array();\n\t\t\n\t\tif(isset($tempUserSession['friends']) && is_array($tempUserSession['friends']) && count($tempUserSession['friends']) > 0 && count($tempIdArray) > 0) {\n\t\t\t$extFriendsArray\t= $this->getExtendedFriends($tempUserSession['friends'], $tempIdArray);\n\t\t}\n\t\t$result->setVariables(array('records'\t\t=> $resultArray,\n\t\t\t\t\t\t\t\t\t'message'\t\t=> $message,\n\t\t\t\t\t\t\t\t\t'page'\t\t\t=> $page,\n\t\t\t\t\t\t\t\t\t'perPage'\t\t=> $perPage,\n\t\t\t\t\t\t\t\t\t'extended'\t\t=> $extFriendsArray,\n\t\t\t\t\t\t\t\t\t'mediaArray'\t=> $mediaIdArray,\n\t\t\t\t\t\t\t\t\t'totalRecords'\t=> $totalRecords,\n\t\t\t\t\t\t\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t\t\t\t\t\t\t'controller'\t=> $this->params('controller')));\n\t\treturn $result;\n }", "public function movie()\n {\n return $this->belongsTo(Movie::class);\n }", "public function movie()\n {\n return $this->belongsTo(Movie::class);\n }", "public function getVotacion() {\n return $this->votacion;\n }", "public function voteAction()\n {\n $return = 0;\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Checking if user is online and answer_id > 0 */\n if ($user && $_GET['id'] > 0) {\n \n /* Vote answer and return number of votes */\n $return = VotedAnswer::vote($user->id, $_GET['id']);\n }\n \n /* Return response */\n header('Content-Type: application/json');\n echo json_encode($return);\n }", "public function movie()\n {\n return $this->belongsTo('App\\Movie');\n }", "public function findById($movieId)\n {\n $result = $this->getSession()->request(\n '/3/movie/'.$movieId\n );\n return $result;\n }" ]
[ "0.6268471", "0.5922697", "0.58415896", "0.5814991", "0.5795632", "0.5755912", "0.57449985", "0.5724824", "0.57199425", "0.56542015", "0.56527305", "0.54696596", "0.54219854", "0.5421261", "0.53688025", "0.53542525", "0.5325715", "0.53110355", "0.529873", "0.5271557", "0.52522045", "0.52401155", "0.5234944", "0.5228692", "0.5206197", "0.5206197", "0.5191201", "0.5185565", "0.51827085", "0.5147899" ]
0.65453994
0
A simple score updating method for a game
function updateScore(Player $player, int $points) { $score = $player->getScore(); $player->setScore($score + $points); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function score()\n {\n $this->score++;\n }", "public function UpdateScore() {\n\t\t$this->score = self::ComputeScore( $this->goods, $this->bads );\n\t\t$this->tier = self::GetTier( $this->score );\n\t\treturn $this->score;\n\t}", "public function updateScoresAndShots()\n {\n $this->player1score = 0;\n $this->player1shots = 0;\n $this->player2score = 0;\n $this->player2shots = 0;\n\n foreach ($this->getTurns() as $turn) {\n if ($turn->isVoid()) {\n continue;\n }\n\n if ($turn->getPlayer() == $this->getGame()->getPlayer1()) {\n $this->player1score += $turn->getTotalScore();\n $this->player1shots += 3;\n } else {\n $this->player2score += $turn->getTotalScore();\n $this->player2shots += 3;\n }\n }\n }", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n }", "abstract public function score();", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n $this->points -= 5;\n }", "public function score(): int;", "public function getScore();", "public function luxScore();", "function setScore( &$value )\r\n {\r\n $this->Score = $value;\r\n }", "function update_score($answer_validity, $user_id){\n\t\tglobal $mysqli_gamedb;\n\n\t\t$query_query = \"SELECT score, level FROM User WHERE id=\".$user_id;\n\n\t\tif($result = $mysqli_gamedb->query($query_query)){\n\t\t\t$array = $result->fetch_assoc();\n\t\t\t$result->close();\n\t\t}\n\n\t\t$score = $array[\"score\"];\n\t\t$level = $array[\"level\"];\n\n\t\t$update_query = \"UPDATE User SET score=\".$score.\" WHERE id=\".$user_id;\n\n\t\tif(!$mysqli_gamedb->query($update_query)){\n\t\t\t//TODO\n\t\t}\n\n\t\tif(!$score)\n\t\t\treturn 10;\n\t\treturn $score;\n\t}", "public function addScore($score)\n {\n $this->score += $score;\n }", "function promoteScoreToBGAScore() {\n \n // If team game, add the score of the teammate first\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'team') {\n self::DbQuery(\"\n UPDATE\n player AS a\n LEFT JOIN (\n SELECT\n player_team, SUM(player_innovation_score) AS team_score\n FROM\n player\n GROUP BY\n player_team\n \n ) AS b ON a.player_team = b.player_team\n SET\n a.player_innovation_score = b.team_score\n \");\n }\n \n self::DbQuery(\"\n UPDATE\n player\n SET\n player_score_aux = player_score,\n player_score = player_innovation_score\n \");\n }", "function setScore($amount = 0)\n\t{\n\t\treturn $this->score += $amount;\n\t}", "function editTeamScore($teamId, $points, $cause){\r\n //$GLOBALS['GLOBALS['link']'] = connect();\r\n mysqli_query($GLOBALS['link'], 'update teams set `score`=`score` + '. $points .' where `id`='. $teamId .';');\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function soundScore();", "public function displayScores() {\n SJTTournamentTools::getInstance()->getServer()->broadcastMessage('Scores for recent game of Parkour are...');\n\n foreach ($this->scores as $playerName => $playerScores) {\n\t\t\t$score = 0;\n\t\t\tforeach ($playerScores as $location => $value) {\n\t\t\t\t$score += $value;\n\t\t\t}\n\n SJTTournamentTools::getInstance()->getServer()->broadcastMessage($playerName . ' scored ' . $score);\n\t\t}\n }", "public function getScore()\n {\n }", "public function getScore() : int{\n return $this->score;\n }", "public function visualScore();", "public function updateScores(OnScoresStructure $scores) {\n\t\t$round = $this->matchScore->round;\n\n\t\t$this->matchScore->mapPointsBlueTeam[$round] = $scores->getTeamScores()[self::BLUE_TEAM]->getMapPoints();\n\t\t$this->matchScore->mapPointsRedTeam[$round] = $scores->getTeamScores()[self::RED_TEAM]->getMapPoints();\n\n\t\tif (!array_key_exists($round, $this->matchScore->blueTeamPlayerPointsSum)) {\n\t\t\t$this->matchScore->blueTeamPlayerPointsSum[$round] = 0;\n\t\t\t$this->matchScore->redTeamPlayerPointsSum[$round] = 0;\n\n\t\t\tforeach ($scores->getPlayerScores() as $playerScore) {\n\t\t\t\tif ($playerScore->getPlayer()->teamId == self::BLUE_TEAM) {\n\t\t\t\t\t$this->matchScore->blueTeamPlayerPointsSum[$round] += $playerScore->getRoundPoints();\n\t\t\t\t} else if ($playerScore->getPlayer()->teamId == self::RED_TEAM) {\n\t\t\t\t\t$this->matchScore->redTeamPlayerPointsSum[$round] += $playerScore->getRoundPoints();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tforeach ($scores->getPlayerScores() as $playerScore) {\n\n\t\t\tif ($playerScore->getPlayer()->teamId == self::BLUE_TEAM) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[trim($playerScore->getPlayer()->login)] = new TrackmaniaPlayer(trim($playerScore->getPlayer()->login), $playerScore->getPlayer()->nickname, $playerScore->getBestRaceTime(), $playerScore->getRoundPoints(), $playerScore->getMapPoints(), $playerScore->getMatchPoints(), $playerScore->getPlayer()->teamId, false);\n\n\t\t\t} else if ($playerScore->getPlayer()->teamId == self::RED_TEAM) {\n\t\t\t\t$this->matchScore->redTeamPlayers[trim($playerScore->getPlayer()->login)] = new TrackmaniaPlayer(trim($playerScore->getPlayer()->login), $playerScore->getPlayer()->nickname, $playerScore->getBestRaceTime(), $playerScore->getRoundPoints(), $playerScore->getMapPoints(), $playerScore->getMatchPoints(), $playerScore->getPlayer()->teamId, false);\n\n\t\t\t}\n\n\t\t}\n\t\t$this->displayTeamScoreWidget(false);\n\t}", "public function update( Score $score )\n {\n if ( isset( $_POST[ 'scoreId' ] ) ) {\n $scoreId = intval( $_POST[ 'scoreId' ] );\n $score = Score::with( 'meeting', 'implementation' ) -> where( 'id', $scoreId );\n if ( $score ) {\n //get all values from $_POST and validate them\n if ( isset( $_POST[ 'score' ] ) ) {\n $_SESSION[ 'score' ] = intval( $_POST[ 'score' ] );\n }\n if ( isset( $_POST[ 'comment' ] ) ) {\n $_SESSION[ 'comment' ] = strval( $_POST[ 'comment' ] );\n }\n\n if ( isset( $errors ) ) {\n //redirect to form\n } else {\n //update in DB\n DB::table( 'scores' ) -> where( 'id', $scoreId )\n -> update( [ 'score' => $_SESSION[ 'score' ],\n 'comment' => $_SESSION[ 'comment' ] ] );\n //redirect to newly updated score\n header( 'Location: ' . {{ route('scores.show', $scoreId ) }} );\n die();\n }\n } else {\n //error handling : score doesn't exist\n }\n } else {\n //error handling : no score id\n }\n }", "public function uvScore();", "function score()\r\n {\r\n return $this->Score;\r\n }", "public function testMethodSetScore()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setScore(1);\n\n $score = $scorebox->getScore();\n\n $expScore = 1;\n\n $this->assertEquals($score, $expScore);\n }", "public function update_score_table ($score,$user_id) {\n\t\t\n\t\tif ($score > 0) {\n\t\t\t$scores = DB::table('meal_scores')->select('meal_1','meal_2','meal_3','meal_4','meal_5')->where('user_id',$user_id)->get();\n\t\t\t$scores = array_values($scores);\n\t\t\t$mealscores = array($scores[0]->meal_1,$scores[0]->meal_2,$scores[0]->meal_3,$scores[0]->meal_4,$scores[0]->meal_5);\n\t\t\t$count = 0;\n\t\t\t$sum = 0.0;\n\t\t\tforeach ($mealscores as $mealscore){\n\t\t\t\tif ($mealscore > 0) {\n\t\t\t\t\t$sum = $sum + $mealscore;\n\t\t\t\t\t$count = $count + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sum = $sum + $score;\n\t\t\t$status = $sum/($count + 1);\n\t\t\tif ($status < 0.5) {\n\t\t\t\t$status = 0.5;\n\t\t\t}\n\t\t\telseif ($status >= 3.5) {\n\t\t\t\t$status = 3.499999;\n\t\t\t}\n\n\t\t\t// Update database table with new meal score value\n\t\t\t$mealscores = array_values($mealscores);\n\t\t\tDB::table('meal_scores')\n ->where('user_id', $user_id)\n ->update(array('meal_1' => $score,'meal_2' => $mealscores[0],'meal_3' => $mealscores[1],'meal_4' => $mealscores[2],'meal_5' => $mealscores[3],'current_status' => $status));\n\t\t} \n\t\telse {\n\t\t\t$status = DB::table('meal_scores')->where('user_id',$user_id)->pluck('current_status');\n\t\t}\n\t\t\n\t\t$status = round($status);\n\t\treturn $status;\n\t}", "public function update_tictactoe_score($data) {\n\n $model_data = $this->db->where('game_tictactoe_id',$data['game_tictactoe_id'])->update('ct_game_tictactoe',array('sender_score'=>$data['sender_score'],'receiver_score'=>$data['receiver_score'],'tictactoe_status'=>3));\n\n return TRUE;\n }", "public function update_score($input_id, $data_score) {\n\t\t$this->db->where('input_id', $input_id)\n\t\t\t\t ->update('cc_program_eval', $data_score);\n\t}", "public function update(Request $request, Score $score)\n {\n //\n }", "public function update(Request $request, Score $score)\n {\n //\n }" ]
[ "0.7773296", "0.72999465", "0.7275131", "0.7251119", "0.71322197", "0.7017261", "0.68646556", "0.68080646", "0.6744071", "0.67360604", "0.6732284", "0.6647051", "0.6634282", "0.6615012", "0.6603436", "0.6589206", "0.6584348", "0.65678823", "0.65139073", "0.6463049", "0.6449741", "0.6418903", "0.6411969", "0.6404768", "0.6372112", "0.6371185", "0.63686436", "0.6361184", "0.6320662", "0.6320662" ]
0.77036226
1
Authenticates the user passed by the constructor, however in this case we user the WRAP server variable "WRAP_USERID" to get this appropriate username.
public function authenticate() { $username = (getenv('WRAP_USERID') == '') ? getenv('REDIRECT_WRAP_USERID') : getenv('WRAP_USERID'); if ($username == '') { $username = getenv('REDIRECT_WRAP_USERID'); } if ($username == '') { setrawcookie('WRAP_REFERER', $this->_getUrl(), 0, '/', '.ncsu.edu'); header('location:https://webauth.ncsu.edu/wrap-bin/was16.cgi'); die(); } if (strtolower($username) == 'guest') { $this->autoLogout(); return new Zend_Auth_Result( false, new stdClass(), array('Guest access is not allowed for this application') ); } $class = new stdClass(); $class->username = $username; $class->realm = 'wrap'; return new Zend_Auth_Result(true, $class, array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function wrapAuthenticate()\n {\n $username = (getenv('WRAP_USERID') == '') ? getenv('REDIRECT_WRAP_USERID') : getenv('WRAP_USERID');\n\n if ($username == '') {\n $username = getenv('REDIRECT_WRAP_USERID');\n }\n\n if ($username == '') {\n setrawcookie('WRAP_REFERER', $this->_getUrl(), 0, '/', '.ncsu.edu');\n header('location:https://webauth.ncsu.edu/wrap-bin/was16.cgi');\n die();\n }\n\n // Create new users automatically, if configured\n $user = get_userdatabylogin($username);\n if (!$user) {\n if (isset($this->_options['autoCreateUser']) && (bool)$this->_options['autoCreateUser']) {\n $user = $this->_createUser($username);\n }\n else {\n die(\"User $username does not exist in the WordPress database\");\n }\n }\n\n return $user;\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "public function getAuthUsername()\n {\n return $this->username;\n }", "public function httpUser()\n\t{\n\t\treturn $this->server('PHP_AUTH_USER');\n\t}", "protected function getConfiguredUsername() {}", "function getUsername() {\n //return $REMOTE_USER\n //DOES NOT CHECK IF IT'S A VALID USERNAME\n global $PHP_AUTH_USER;\n global $loginName;\n global $serverScriptHelper;\n global $isMonterey;\n if ((!$isMonterey) && $serverScriptHelper->hasCCE()) {\n return $loginName;\n } else {\n return $PHP_AUTH_USER;\n }\n}", "function authenticate($user, $username, $password) {\n $user = $this->check_remote_user();\n\n if (! is_wp_error($user)) {\n $user = new WP_User($user->ID);\n }\n\n return $user;\n }", "public function getAuthenticatedUser () : string {\n return $this->mainController->getAuthenticatedUser();\n }", "public function getUsername() {}", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getAuthIdentifier() {\n return $this->username;\n }", "public function authForUser( $user ){ return $user->authForDB( $this ); }", "abstract protected function getUser();", "public function auth_user() {\n\t\t$key = $this->getParams('key');\n\t\t\n\t\t$this->UserAuth = ClassRegistry::init('UserAuth');\n\t\t$options = array('conditions' => array('UserAuth.key' => $key), 'order' => array('id' => 'DESC'));\n\t\t$data = $this->UserAuth->find('first', $options);\n\t\t$data = isset($data['UserAuth']['params']) ? unserialize($data['UserAuth']['params']) : array();\n\t\t\t\n\t\t$response = array(\n\t\t\t\t'status' => 'success',\n\t\t\t\t'operation' => 'auth_user',\n\t\t\t\t'data' => $data,\n\t\t\t\t);\n\t\t$this->set(array(\n 'response' => parseParams($response),\n '_serialize' => array('response'),\n ));\n\t}", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function get_username() {\n return $this->username;\n }", "private function getUsername()\n {\n return $this->_username;\n }", "public function loginUsername()\n {\n return 'username';\n }", "public function loginUsername()\n {\n return 'username';\n }", "public function getUsername() {\n }", "public function auth(){ return $this->authForUser( User::$cUser ); }", "public function authenticate()\n\t{\n\n\t\t$username = strtolower($this->username);\n\t\t/** @var $user User */\n\t\t$user = User::model()->with('roles')->find('LOWER(use_username)=?', array($username));\n\t\tif ($user === null) {\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t} else {\n\t\t\tif (!$user->validatePassword($this->password)) {\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t\t} else {\n\t\t\t\t$this->_id = $user->use_id;\n\t\t\t\t$this->username = $user->use_fname;\n\t\t\t\t$this->_branchId = $user->use_branch;\n\t\t\t\t$this->_scope = $user->use_scope;\n\t\t\t\t$this->_roles = $user->roles;\n\n\t\t\t\t$this->userData = serialize($user);\n\n\t\t\t\tYii::app()->user->setState(\"fullname\", $user->getFullName());\n\n\t\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t\t$this->loadSessionForOldLogin($user);\n\t\t\t}\n\t\t}\n\t\tLoginLog::model()->log($this, $user);\n\t\treturn $this->errorCode == self::ERROR_NONE;\n\t}", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "private function logInSimpleUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(41);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public static function getUser();", "public function getUsername()\n {\n }" ]
[ "0.7569614", "0.6496819", "0.6489558", "0.63820714", "0.63575935", "0.6349915", "0.6311129", "0.6302423", "0.6280989", "0.62118757", "0.6190359", "0.61903083", "0.6186107", "0.61162996", "0.611271", "0.611271", "0.611271", "0.611271", "0.611271", "0.61031735", "0.6099518", "0.6068976", "0.6068976", "0.6031452", "0.602788", "0.60163647", "0.6003654", "0.59997046", "0.59884906", "0.59862614" ]
0.6629384
1
Setup this adapter to autoLogin
public static function autoLogin() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function autoInit()\n {\n // cancellation\n if(Config::get('toby.mysql.auto_connect') !== true) return;\n \n // vars\n $this->init(\n Config::get('toby.mysql.host'),\n Config::get('toby.mysql.user'),\n Config::get('toby.mysql.password'),\n Config::get('toby.mysql.db')\n );\n }", "protected function _initAuth()\n {\n $dm = Registry::getInstance()->get('dm');\n $user = $dm->getRepository('Domain\\User\\Entity\\User')->find('4de999713eecad69a02e4145');\n \n // Simulate logged in User.\n Registry::getInstance()->set('user', $user);\n }", "private function auto_login()\n {\n if ($this->_cookies->has('authautologin')) {\n $cookieToken = $this->_cookies->get('authautologin')->getValue();\n\n // Load the token\n $token = Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $cookieToken)));\n\n // If the token exists\n if ($token) {\n // Load the user and his roles\n $user = $token->getUser();\n $roles = $this->get_roles($user);\n\n // If user has login role and tokens match, perform a login\n if (isset($roles['registered']) && $token->user_agent === sha1(\\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent())) {\n // Save the token to create a new unique token\n $token->token = $this->create_token();\n $token->save();\n\n // Set the new token\n $this->_cookies->set('authautologin', $token->token, $token->expires);\n\n // Finish the login\n $this->complete_login($user);\n\n // Regenerate session_id\n session_regenerate_id();\n\n // Store user in session\n $this->_session->set($this->_config['session_key'], $user);\n // Store user's roles in session\n if ($this->_config['session_roles']) {\n $this->_session->set($this->_config['session_roles'], $roles);\n }\n\n // Automatic login was successful\n return $user;\n }\n\n // Token is invalid\n $token->delete();\n } else {\n $this->_cookies->set('authautologin', \"\", time() - 3600);\n $this->_cookies->delete('authautologin');\n }\n }\n\n return false;\n }", "private function _setupAuth()\n {\n $this->_auth = Zend_Auth::getInstance();\n }", "public function init() {\r\n $this->_model = new Storefront_Model_User();\r\n\r\n $this->_authService = Storefront_Service_Authentication::getInstance(\r\n $this->_model\r\n );\r\n }", "public function setLoginId(): void\n {\n }", "public function auto_login()\n\t{\n\t\tif ($token = Cookie::get($this->_config['autologin_cookie']))\n\t\t{\n\t\t\t// Load the token and user\n\t\t\t$token = Mango::factory($this->_config['token_model_name'], array(\n\t\t\t\t'token' => $token\n\t\t\t))->load();\n\t\t\t \n\t\t\tif ($token->loaded() AND $token->user->loaded())\n\t\t\t{\n\t\t\t\tif ($token->expires >= time() AND $token->user_agent === sha1(Request::$user_agent))\n\t\t\t\t{\n\t\t\t\t\t// Save the token to create a new unique token\n\t\t\t\t\t$token->save();\n\t\t\t\t\t\t\n\t\t\t\t\t// Set the new token\n\t\t\t\t\tCookie::set($this->_config['autologin_cookie'], $token->token, $token->expires - time());\n\t\t\t\t\t\t\n\t\t\t\t\t// Complete the login with the found data\n\t\t\t\t\t$this->_complete_login($token->user);\n\n\t\t\t\t\t// Automatic login was successful\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\n\t\t\t\t// Token is invalid\n\t\t\t\t$token->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function initialConfig() \n {\n //NB: various link modes handled below in setupPageData()\n if(!isset($_GET['mode'])) {\n\n $this->user_id = $this->user->setupUserData();\n if($this->user_id != 0) {\n $this->addMessage('You are already logged in! You can login as another user or '.$this->js_links['back']);\n\n $_SESSION['login_redirect'] = $_SESSION['login_redirect'] + 1 ;\n if($_SESSION['login_redirect'] > 5) {\n $this->addError('Something is wrong with your access credentials. Please contact support.');\n } else {\n $this->user->redirectLastPage();\n }\n }\n }\n \n }", "public function init()\n {\n \t$auth = Zend_Auth::getInstance();\n \t\n \tif(!$auth->hasIdentity()){\n \t\t$this->_redirect('/login');\n \t}\n }", "public function init()\n {\n $auth = Zend_Auth::getInstance();\n if(!$auth->hasIdentity()) {\n $this->_redirect($this->view->url(array(\n 'module' => 'user',\n 'controller' => 'login',\n )));\n }\n }", "public function auto_login()\n\t{\n\t\tif ($token = cookie::get('autologin'))\n\t\t{\n\t\t\t// Load the token and user\n\t\t\t$token = new User_Token_Model($token);\n\t\t\t$user = new User_Model($token->user_id);\n\n\t\t\tif ($token->id != 0 AND $user->id != 0)\n\t\t\t{\n\t\t\t\tif ($token->user_agent === sha1(Kohana::$user_agent))\n\t\t\t\t{\n\t\t\t\t\t// Save the token to create a new unique token\n\t\t\t\t\t$token->save();\n\n\t\t\t\t\t// Set the new token\n\t\t\t\t\tcookie::set('autologin', $token->token, $token->expires - time());\n\n\t\t\t\t\t// Complete the login with the found data\n\t\t\t\t\t$this->complete_login($user);\n\n\t\t\t\t\t// Automatic login was successful\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\n\t\t\t\t// Token is invalid\n\t\t\t\t$token->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "protected function initAuth()\n {\n /** @var Auth $auth */\n Auth::getInstance()->setStorage();\n }", "public function initializeBackendUser() {}", "public function initializeBackendUser() {}", "public function init()\n {\n \t$auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity()){\n \t\t$this->identity = $auth->getIdentity();\n \t}\n }", "private function __construct() {\n\n $this->\n database = \\FluitoPHP\\Database\\Database::GetInstance();\n\n require_once( dirname(__FILE__) . DS . 'User.class.php' );\n\n $appConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetConfig('AUTHENTICATION');\n\n $appConfig = $appConfig ? $appConfig : [];\n\n $moduleConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetModuleConfig('AUTHENTICATION');\n\n $moduleConfig = $moduleConfig ? $moduleConfig : [];\n\n $appConfig = array_replace_recursive($appConfig, $moduleConfig);\n\n $this->\n UpdateConfig($appConfig);\n }", "public function initialize()\n {\n parent::initialize();\n $this->Auth->allow(\n [\n 'login',\n 'logout',\n 'register',\n 'recover'\n ]\n );\n }", "public function startCommunication()\n {\n if ($this->provider->login()) {\n $this->provider->keepAuth = true;\n }\n }", "public function __construct() {\n $this->emailLogin = '[email protected]';\n }", "public function initialize()\n {\n $this->view->disable();\n\n // all API functions will require authentification\n $userEmail = $this->request->get('email');\n $user = User::findFirst([['email' => $userEmail]]);\n $userApiKey = $this->request->get('apiKey');\n if (empty($user) || $user->apiKey != $userApiKey) {\n echo '{\"result\": \"error\", \"message\": \"wrong credentials\"}';\n // API error management should be unified somehow\n die();\n }\n\n $this->user = $user;\n }", "public function auto_login()\n\t{\n\t\tif ($hash = cookie::get('authautologin'))\n\t\t{\n\t\t\t// Load the token and user\n\t\t\t$token = ORM::load('Token')->findOneBy(array('hash' => $hash));\n\n\t\t\tif ($token !== NULL AND $token->getUser() !== NULL)\n\t\t\t{\n\t\t\t\tif ($token->getUserAgent() === sha1(Request::$user_agent))\n\t\t\t\t{\n\t\t\t\t\t// Update token data\n\t\t\t\t\tAuth_Doctrine::create_token($token);\n\n\t\t\t\t\t// Set the autologin cookie\n\t\t\t\t\tcookie::set('authautologin', $token->getHash(), $this->_config['lifetime']);\n\n\t\t\t\t\t// Complete the login with the found data\n\t\t\t\t\t$this->complete_login($token->getUser()->getLogin());\n\n\t\t\t\t\t// Automatic login was successful\n\t\t\t\t\treturn $token->getUser();\n\t\t\t\t}\n\n\t\t\t\t// Token is invalid\n\t\t\t\tOrm::instance()->remove($token);\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function init()\n {\n \t$this->auth=Zend_Auth::getInstance();\n\n\t\tif($this->auth->hasIdentity()){\n\n\t\t\t$this->authIdentity=$this->auth->getIdentity();\n\n\t\t}\n\n\t\t$this->registry=Zend_Registry::getInstance();\n }", "public static function _init()\n {\n \\Module::load('authentication');\n }", "public function setUp() {\n\t\t$this->client = new ElggApiClient(elgg_get_site_url(), $this->apikey->public);\n\t\t$result = $this->client->obtainAuthToken($this->user->username, 'pass123');\n\t\tif (!$result) {\n\t\t echo \"Error in getting auth token!\\n\";\n\t\t}\n\t}", "public function auto_login()\n\t{\n\t\tif ($token = Cookie::get('authautologin'))\n\t\t{\n\t\t\t// Load the token and user\n $query = DB::select('token', 'expires', 'user_agent')->from('user_tokens')->where('token', '=', $token)->limit(1)->as_object()->execute();\n $token = $query->current();\n\n if ($token->user_agent === sha1(Request::$user_agent))\n {\n\n\t\t\t\t// Create a new autologin token\n $query = DB::update('user_token')->set(array(\n 'expires' => $token->expires - time()\n ))->where('token', '=', $token->token)->execute();\n $insert_id = $query[0];\n\n $query = DB::select('token', 'expires', 'user_agent')->from('user_tokens')->where('id', '=', $insert_id)->limit(1)->as_object()->execute();\n $token = $query->current();\n\n // Set the new token\n Cookie::set('authautologin', $token->token, $token->expires - time());\n\n // Complete the login with the found data\n $query = DB::select('id', 'username')->from('users')->where('id', '=', $token->uid)->limit(1)->as_object()->execute();\n $user = $query->current();\n $this->complete_login($user);\n\n // Automatic login was successful\n return $user;\n }\n\n // Token is invalid\n DB::delete('user_token')->where('token', '=', $token->token)->execute();\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function connexionIntervenantLogin(){\n }", "protected function __configAuth()\n\t{\n\t\t$this->Auth->userModel = 'User';\n\t\tAuthComponent::$sessionKey = 'Auth.User';\n\t\t$this->Auth->authorize = array('Actions');\n\t\t$this->Auth->authError = 'You need to login your account to access this page.';\n\t\t$this->Auth->loginError = 'Sai mật mã hoặc tên tài khoản, xin hãy thử lại';\n\t\t$this->Auth->authenticate = array('Form' => array(\n\t\t\t'fields' => array('username' => 'email'),\n\t\t\t'userModel' => 'User',\n\t\t\t'scope' => array(\n\t\t\t\t'User.active' => true\n\t\t\t)\n\t\t));\n\n\n\t\t$this->Auth->loginAction = array(\n\t\t\t'admin' => false,\n\t\t\t'controller' => 'users',\n\t\t\t'action' => 'login'\n\t\t);\n\t\t$this->Auth->loginRedirect = '/';\n\t\t$this->Auth->logoutRedirect = $this->referer('/');\n\t}", "public function initialize()\n {\n $this->config = new \\Configs\\Core\\PasswordResetKeys();\n\n\n }", "public function __construct() {\n $this->isLogin();\n }", "public function authentication()\n {\n }" ]
[ "0.66130304", "0.6469236", "0.6177194", "0.6172833", "0.6146591", "0.6079863", "0.60101104", "0.6000713", "0.59607774", "0.595822", "0.59559685", "0.59313315", "0.59097445", "0.5908427", "0.5893957", "0.58938545", "0.58921593", "0.5884909", "0.58838516", "0.5871255", "0.585916", "0.5856398", "0.58372027", "0.58341736", "0.5829681", "0.5827871", "0.582396", "0.5789878", "0.5756708", "0.575457" ]
0.67559296
0
flag to tell the app whether a user can sign up or not
public static function allowUserSignUp() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_user()\n {\n \n return true;\n \n }", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "public function authorize()\n {\n if($this->path() == 'signup'){\n return true;\n } else {\n return false;\n }\n \n }", "function users_can_register_signup_filter()\n {\n }", "function validate_user_signup()\n {\n }", "public function please_sign_up() {\n\t\t$this->infoAlert(\"You're not signed in, or not signed up, either way - head this way! <a href='\"\n\t\t\t.site_url('/wp-login.php?action=register&redirect_to='.get_permalink()).\n\t\t\t\"'>Login/Register</a>\");\n\t}", "public function signup()\n\t{\n $user = new User();\n\n // If user can succesfully signup then signin\n if ($user->signup(Database::connection(), $_POST['username'], $_POST['password']))\n {\n $_SESSION['id'] = $user->id;\n return True;\n }\n\n return False;\n }", "public function onSignUp()\n {\n $data = post();\n $data['requires_confirmation'] = $this->requiresConfirmation;\n\n if (app(SignUpHandler::class)->handle($data, (bool)post('as_guest'))) {\n if ($this->requiresConfirmation) {\n return ['.mall-signup-form' => $this->renderPartial($this->alias . '::confirm.htm')];\n }\n\n return $this->redirect();\n }\n }", "public function sign_up()\n {\n\n }", "protected function authRequired()\n {\n return true;\n }", "public function hasSignupId(){\n return $this->_has(4);\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function can_auto_create_users() {\n return (bool)$this->config['weautocreateusers'];\n }", "public function hasUser();", "public function authorize()\n {\n // TODO: Check if is authorized to create user\n return true;\n }", "function get_can_create_user ()\r\n {\r\n return $_SESSION[\"can_create_user\"];\r\n }", "public function create(User $user)\n {\n if (Auth::check()==true ) {\n return true;\n }\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "public function signup()\n {\n $id = (int) Input::get(\"id\");\n $md5 = Input::get(\"secret\");\n if (!$id || !$md5) {\n Redirect::autolink(URLROOT, Lang::T(\"INVALID_ID\"));\n }\n $row = Users::getPasswordSecretStatus($id);\n if (!$row) {\n $mgs = sprintf(Lang::T(\"CONFIRM_EXPIRE\"), Config::TT()['SIGNUPTIMEOUT'] / 86400);\n Redirect::autolink(URLROOT, $mgs);\n }\n if ($row['status'] != \"pending\") {\n Redirect::autolink(URLROOT, Lang::T(\"ACCOUNT_ACTIVATED\"));\n die;\n }\n if ($md5 != $row['secret']) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_ACTIVATE_LINK\"));\n }\n $secret = Helper::mksecret();\n $upd = Users::updatesecret($secret, $id, $row['secret']);\n if ($upd == 0) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_UNABLE\"));\n }\n Redirect::autolink(URLROOT . '/login', Lang::T(\"ACCOUNT_ACTIVATED\"));\n }", "public function authorize()\n\t{\n\t\t// La autorización siempre será true por que cualquier usuario podrá\n\t\t// crear álbumes y nosotros se los asociaremos al usuario\n\t\t// que tiene la sesión creada.\n\t\treturn true;\n\t}", "public function sign_up()\n\t{\n\t\t$post = $this->input->post();\n\t\t$return = $this->accounts->register($post, 'settings'); /*this will redirect to settings page */\n\t\t// debug($this->session);\n\t\t// debug($return, 1);\n\t}", "public function check_insta_user() {\n \n }", "public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "function google_login_allow_new_users_with_google()\n{\n\t$site_reg = elgg_get_config('allow_registration');\n\t$google_reg = elgg_get_plugin_setting('new_users');\n\tif ($site_reg || (!$site_reg && $google_reg == 'yes'))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isUserRegistered()\r\n{\r\n $statusFlag = FALSE;\r\n \r\n // if user has previously registered, return true;\r\n if( isset($_COOKIE[\"user_email\"] ))\r\n $statusFlag = TRUE;\r\n\t \r\nreturn $statusFlag;\r\n\r\n}", "public function checkIfAvailable(){\n $user_check_query = self::$connection->db->prepare(\"SELECT * FROM users WHERE name = ? OR email = ?\");\n $user_check_query->bind_param(\"ss\", self::$signUpName, self::$signUpEmail);\n $user_check_query->execute();\n $users = $user_check_query->get_result()->fetch_assoc();\n $user_check_query->close();\n $nameError = false;\n $emailError = false;\n $_POST = array();\n if (isset($users)) {\n foreach($users as $key=>$value) {\n if (strtolower($users['name']) === strtolower(self::$signUpName) && !$nameError) {\n self::addError(\"signUp\", \"Name already exists.\");\n $nameError = true;\n Auth::CreateView('Auth');\n };\n if ($users['email'] === self::$signUpEmail && !$emailError) {\n self::addError(\"signUp\", \"Email already exists.\");\n $emailError = true;\n Auth::CreateView('Auth');\n };\n }\n } else if(count(self::$signUpErrors) === 0){\n $this->registering();\n return true;\n }\n }", "public function isSignupChecked()\n {\n $v = Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();\n \n return \n Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED\n == $v\n || Professio_BudgetMailer_Model_Config_Source_Account::CHECKED\n == $v;\n }" ]
[ "0.71371895", "0.69843584", "0.6964484", "0.68400747", "0.6792425", "0.66881686", "0.6523544", "0.651542", "0.6493336", "0.64290726", "0.64251363", "0.64017874", "0.6387678", "0.63862205", "0.63463545", "0.6342499", "0.6315831", "0.6311033", "0.631083", "0.62932277", "0.6283741", "0.62831867", "0.62719256", "0.62667334", "0.6264681", "0.62535745", "0.62364197", "0.62326854", "0.622112", "0.62182176" ]
0.8016326
0
Initialize wordpress import block
protected function _construct() { $this->_objectId = 'id'; $this->_blockGroup = 'Magefan_Blog'; $this->_controller = 'adminhtml_import'; $this->_mode = 'wordpress'; parent::_construct(); if (!$this->_isAllowedAction('Magefan_Blog::import')) { $this->buttonList->remove('save'); } else { $this->updateButton( 'save', 'label', __('Start Import') ); } $this->buttonList->remove('delete'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init() {\n\n\t\tif ( ! function_exists( 'llms' ) || ! version_compare( self::MIN_CORE_VERSION, llms()->version, '<=' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->includes();\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'remove_metaboxes' ), 999, 2 );\n\n\t\tglobal $wp_version;\n\t\t$filter = version_compare( $wp_version, '5.8-src', '>=' ) ? 'block_categories_all' : 'block_categories';\n\n\t\tadd_filter( $filter, array( $this, 'add_block_category' ) );\n\t\tadd_action( 'admin_print_scripts', array( $this, 'admin_print_scripts' ), 15 );\n\n\t\t/**\n\t\t * When loaded as a library included by the LifterLMS core localization is handled by the LifterLMS core.\n\t\t *\n\t\t * When the plugin is loaded by itself as a plugin, we must localize it independently.\n\t\t */\n\t\tif ( ! defined( 'LLMS_BLOCKS_LIB' ) || ! LLMS_BLOCKS_LIB ) {\n\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ), 0 );\n\t\t}\n\n\t}", "public function wp_parser_starting_import() {\n\t\t$importer = new Importer;\n\n\t\tif ( ! $this->p2p_tables_exist() ) {\n\t\t\t\\P2P_Storage::init();\n\t\t\t\\P2P_Storage::install();\n\t\t}\n\n\t\t$this->post_types = array(\n\t\t\t'hook' => $importer->post_type_hook,\n\t\t\t'method' => $importer->post_type_method,\n\t\t\t'function' => $importer->post_type_function,\n\t\t);\n\t}", "public function action_init( )\n\t{\n\t\t$this->load_text_domain( 'flickrfeed' );\n\t\t$this->add_template( 'block.flickrfeed', dirname( __FILE__ ) . '/block.flickrfeed.php' );\n\t}", "protected function initializeImport() {}", "public function init() {\n global $CFG;\n $this->blockname = get_class($this);\n $this->title = get_string('pluginname', $this->blockname);\n }", "function action_init()\n\t{\n\n\t\t$this->allblocks = array(\n\t\t\t'recent_comments' => _t( 'Recent Comments' ),\n\t\t\t'recent_posts' => _t( 'Recent Posts' ),\n\t\t\t'monthly_archives' => _t( 'Monthly Archives' ),\n\t\t\t'tag_archives' => _t( 'Tag Archives' ),\n\t\t\t'meta_links' => _t( 'Meta Links' ),\n\t\t\t'search_form' => _t( 'Search Form' ),\n\t\t\t'text' => _t( 'Text' ),\n\t\t);\n\n\t\tforeach ( array_keys( $this->allblocks ) as $blockname ) {\n\t\t\t$this->add_template( \"block.$blockname\", dirname( __FILE__ ) . \"/block.$blockname.php\" );\n\t\t}\n\t\t$this->add_template( \"block.dropdown.tag_archives\", dirname( __FILE__ ) . \"/block.dropdown.tag_archives.php\" );\n\t\t$this->add_template( \"block.dropdown.monthly_archives\", dirname( __FILE__ ) . \"/block.dropdown.monthly_archives.php\" );\n\t}", "public function _construct()\n {\n $this->_init('customfield/block', 'id');\n }", "function init() {\n //$this->title = get_string('blockname', 'block_lpr');\n $this->title = 'ILP Reporting Tool';\n $this->version = 2010030100;\n }", "function init() {\n global $CFG;\n $this->blockname = get_class($this);\n $this->title = get_string('blockname', $this->blockname);\n $this->version = 2009082800;\n }", "public function init()\n {\n // Cargar Templates\n add_filter( 'template_include', array( $this, 'include_template' ), 11 );\n add_filter( 'wc_get_template', array( $this, 'get_template' ), 11, 5 );\n }", "function _init() {\n\t\n\t\t// ----------------------------------------\n\t\t// load database wrapper object \n\t\t// ----------------------------------------\n\t\n\t\t// define filename\n\t\t$class_file = 'class_commentpress_mu_db.php';\n\t\n\t\t// get path\n\t\t$class_file_path = cpmu_file_is_present( $class_file );\n\t\t\n\t\t// we're fine, include class definition\n\t\trequire_once( $class_file_path );\n\t\n\t\t// init autoload database object\n\t\t$this->db = new CommentPressMultisiteAdmin( $this );\n\t\t\n\n\n\t\t// ----------------------------------------\n\t\t// load standard multisite object \n\t\t// ----------------------------------------\n\t\n\t\t// define filename\n\t\t$class_file = 'class_commentpress_mu.php';\n\t\n\t\t// get path\n\t\t$class_file_path = cpmu_file_is_present( $class_file );\n\t\t\n\t\t// we're fine, include class definition\n\t\trequire_once( $class_file_path );\n\t\n\t\t// init multisite object\n\t\t$this->mu = new CommentPressMultisite( $this );\n\t\t\n\n\t\t\n\t\t// ----------------------------------------\n\t\t// optionally load buddypress object \n\t\t// ----------------------------------------\n\t\n\t\t// load when buddypress is loaded\n\t\tadd_action( 'bp_include', array( &$this, '_load_buddypress_object' ) );\n\n\t}", "function bfImport() {\n\t\t$this->__construct();\n\t}", "public function init() {\n\n\t\t// Functions.\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/functions-llms-blocks.php';\n\n\t\t// Classes.\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-assets.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-abstract-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-migrate.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-page-builders.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-post-instructors.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-post-types.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-post-visibility.php';\n\n\t\t// Block Visibility Component.\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/class-llms-blocks-visibility.php';\n\n\t\t// Dynamic Blocks.\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-course-information-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-course-syllabus-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-instructors-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-lesson-navigation-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-lesson-progression-block.php';\n\t\trequire_once LLMS_BLOCKS_PLUGIN_DIR . '/includes/blocks/class-llms-blocks-pricing-table-block.php';\n\n\t}", "public static function init() {\n\t\tHeadway::load('admin/admin-meta-boxes');\n\t\t\t\t\n\t\tadd_action('delete_post', array(__CLASS__, 'delete_post'));\n\n\t\tadd_filter('get_sample_permalink_html', array(__CLASS__, 'open_in_visual_editor_button'), 10, 4);\n\t\t\n\t}", "public function hook_init() {\n\n\t\t$this->register_blocks();\n\t\t$this->register_assets();\n\n\t}", "function init(){\n\t\t\tinclude \"config/post__config.php\";\n\t\t\tinclude \"config/postmeta__config.php\";\n\n\t\t\t$this->metaBoxes = getFieldConfig();\n\n\t\t\t//wp_enqueue_script( 'theme-plugins', get_template_directory_uri() . '/js/plugins.js');\n\t\t\twp_enqueue_script( 'theme-functions', get_template_directory_uri() . '/js/main.js');\n\n\t\t\twp_register_style( 'bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css' );\n \t\twp_enqueue_style( 'bootstrap' );\n\t\t}", "function init() {\n\t\\add_action(\n\t\t'rest_api_init',\n\t\t__NAMESPACE__ . '\\register_rest_routes'\n\t);\n\t\\add_action(\n\t\t'enqueue_block_editor_assets',\n\t\t__NAMESPACE__ . '\\sc_enqueue_block_editor_assets'\n\t);\n}", "public function wp_init() {\n\t\n\t\t// (re)load our settings\n\t\t$this->load_settings();\n\n\t\tload_plugin_textdomain('wp-united', false, 'wp-united/languages/');\n\t\t\n\t\trequire_once($this->get_plugin_path() . 'template-tags.php');\n\t\t\n\t\t// some login integration routines may be needed even when user integration is disabled.\t\n\t\trequire_once($this->get_plugin_path() . 'user-integrator.php'); \n\t\t\n\t\tif($this->get_setting('xposting')) {\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'cross-posting.php');\n\t\t\t$this->xPoster = new WPU_Plugin_XPosting($this->settings);\n\t\t}\n\n\n\t\t// add new actions and filters\n\t\t$this->add_actions();\n\t\t$this->add_filters();\n\t\tunset($this->actions, $this->filters);\n\n\t}", "public function init()\n {\n // form should use p4cms-ui styles.\n $this->setAttrib('class', 'p4cms-ui wordpress-import-form');\n\n // handle file upload\n $this->setAttrib('enctype', 'multipart/form-data');\n\n // set the method for the form to POST\n $this->setMethod('post');\n\n // file specification\n $this->addElement(\n 'file',\n 'importfile',\n array(\n 'label' => 'WordPress XML File',\n 'required' => true,\n 'description' => 'Select the exported WordPress XML file to import into Chronicle.',\n 'validators' => array('Extension' => array('xml'))\n )\n );\n\n // fix odd wording on error message\n // \"File 'foobar.ext' has a false extension\" by default.\n $this->getElement('importfile')->getValidator('Extension')->setMessage(\n \"File '%value%' does not appear to be an xml file.\",\n Zend_Validate_File_Extension::FALSE_EXTENSION\n );\n\n $this->addElement(\n 'SubmitButton',\n 'import',\n array(\n 'label' => 'Import',\n 'required' => false,\n 'ignore' => true\n )\n );\n\n // put the buttons in a fieldset.\n $this->addDisplayGroup(\n array('import'),\n 'buttons',\n array('class' => 'buttons')\n );\n }", "public function initialize()\n {\n add_action( 'init', [ $this, 'actionRegisterEditorCustomiserSettings' ] );\n add_action( 'init', [ $this, 'actionAddBlockEditorSupport' ] );\n add_filter( 'kirki/styles_array', [ $this, 'outputColorClassesForBlockEditor' ] );\n }", "public function action_init_theme()\n\t{\n\t\t$this->add_template('block.photoset_randomphotos', dirname(__FILE__) . '/block.photoset_randomphotos.php');\n\t\t$this->add_template('block.singlepage_content', dirname(__FILE__) . '/block.singlepage_content.php');\n\t\t\n\t\tFormat::apply('autop', 'comment_content_out');\n\t\tFormat::apply('autop', 'post_content_excerpt');\n\t\t\n\t\t$this->assign( 'multipleview', false);\n\t\t$action = Controller::get_action();\n\t\tif ($action == 'display_home' || $action == 'display_entries' || $action == 'search' || $action == 'display_tag' || $action == 'display_date') {\n\t\t\t$this->assign('multipleview', true);\n\t\t}\n\t}", "function init() {\n\t\t/** @global $gantry Gantry */\n\t\tglobal $gantry;\n\n\t\t/**\n\t\t * bbPress - add extra content location paths\n\t\t */\n\n\t\tadd_action( 'after_setup_theme', array( &$this, 'bbpress_add_content_location' ) );\n\n\t}", "public function __construct() {\n // update default vars with configuration file\n SELF::updateVars();\n // filter gutenberg blocks\n if(!empty($this->WPgutenberg_AllowedBlocks)):\n add_filter( 'allowed_block_types', array($this, 'AllowGutenbergBlocks'), 100 );\n endif;\n // add gutenberg style options\n if(!empty($this->WPgutenberg_Stylesfile)):\n add_action( 'enqueue_block_editor_assets', array($this, 'AddBackendStyleOptions'), 100 );\n endif;\n // disable gutenberg\n if($this->WPgutenberg_active == 0):\n SELF::DisableGutenberg();\n endif;\n // disable Gutenberg block styles\n if($this->WPgutenberg_css == 0):\n add_action( 'wp_enqueue_scripts', array($this, 'DisableGutenbergCSS'), 100 );\n endif;\n // add theme support\n SELF::CustomThemeSupport();\n // register custom blocks\n add_action( 'init', array($this, 'WPgutenbergCustomBlocks') );\n // Change inline font size to var\n if($this->WPgutenberg_fontsizeScaler == 0):\n add_filter('the_content', array($this, 'InlineFontSize') );\n endif;\n }", "public static function wpInit() {}", "public function init () {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array( //'sitemap.models.*',\n\t\t 'sitemap.extensions.sitemap.*',\n\t\t));\n\t}", "public function init() {\n\t\t$this->add_cpt_support();\n\n\t\t$this->init_components();\n\n\t\tdo_action( 'elementor/init' );\n\t}", "function etivite_bp_activity_block_init() {\n\trequire( dirname( __FILE__ ) . '/bp-activity-block.php' );\n\tif ( file_exists( dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' ) ) {\n\t\tload_textdomain( 'bp-activity-block', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' );\n\t}\n}", "static function init(){\n\t\t\t\tadd_action('wp_ajax_gdlr_core_get_pb_template', 'gdlr_core_page_builder_template::get_template');\n\t\t\t}", "public function init() {\n\n\t\t\t// Set up localisation\n\t\t\t$this->load_plugin_textdomain();\n\n\t\t\t// Variables\n\t\t\t$this->template_url = apply_filters( 'wolf_photos_url', 'wolf-photos/' );\n\n\t\t\t// Classes/actions loaded for the frontend and for ajax requests\n\t\t\tif ( ! is_admin() || defined( 'DOING_AJAX' ) ) {\n\n\t\t\t\t// Hooks\n\t\t\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\n\t\t\t}\n\n\t\t\t$this->register_taxonomy();\n\t\t\t$this->add_rewrite_rule();\n\t\t\t$this->flush_rewrite_rules();\n\n\t\t\t// Init action\n\t\t\tdo_action( 'wolf_photos_init' );\n\t\t}", "public function init() {\n\t\tdo_action( get_called_class() . '_before_init' );\n\t\tdo_action( get_called_class() . '_after_init' );\n\t\tadd_action( 'wp_enqueue_scripts', array( get_called_class(), 'enqueue_scripts' ), 20 );\n\t\tnew Display();\n\t\tnew Term_Meta();\n\t}" ]
[ "0.6904067", "0.68647754", "0.68420553", "0.680391", "0.67640436", "0.6687453", "0.6679465", "0.6639066", "0.6625153", "0.661617", "0.65937734", "0.6589987", "0.65757984", "0.6574324", "0.6487622", "0.64584935", "0.6443672", "0.64273745", "0.6410032", "0.64086705", "0.64052653", "0.6399412", "0.63725954", "0.6368733", "0.6358943", "0.6358021", "0.6349698", "0.63309944", "0.63278854", "0.6326109" ]
0.7010562
0
Checks wether this element is ancestor of $element
public function isAncestor($element) { $ancestor = false; foreach ($this->children as $child) { if ($element===$child) { $ancestor = true; break; } elseif ($child->isAncestor($element)) { $ancestor = true; } } return $ancestor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAncestorOf(Hierarchy $element, $loader = null)\n {\n return $element->isOffspring($this, $loader);\n }", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function isAncestorOf($page) {\n return $page->isDescendantOf($this);\n }", "public function hasParent() {}", "public function hasAncestors();", "public function isAncestor ($Item)\r\n {\r\n \tif ($this->path == '')\r\n \t\treturn false;\r\n \telse\r\n \t{\r\n \t\t$return = (strpos($Item->path,$this->path)===0);\r\n\r\n \t\treturn $return;\r\n \t}\r\n }", "public function is(Hierarchy $element)\n {\n if (get_class($this) !== get_class($element))\n return false;\n return $this->id === $element->id;\n }", "public function isParent();", "final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}", "public function hasDescendants();", "public function hasParent()\n {\n }", "public function is_ancestor( $post_id ){\n\t\tglobal $wp_query;\n\t\t$ancestors = $wp_query->post->ancestors;\n\t\tif ( in_array( $post_id, $ancestors ) ){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "public function isAncestorOf(AbstractNode $node) :bool {\n if ($this->hasChild()===false || $node->hasParent()===false || $this->isSameNode($node)) {\n return false;\n }\n\t\twhile ($node instanceof AbstractNode) {\n\t\t\tif ($this->isParentOf($node)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$node = $node->parent;\n\t\t}\n\t\treturn false;\n }", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function is_in_parents($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return $target->is_descendant($this);\n }", "function is_ancestor($tree, $child_id, $ancestor_id): bool {\n $target_id = $child_id;\n while($n = $tree->find($target_id)) {\n if($n->parent_id == $ancestor_id) {\n return true;\n }\n $target_id = $n->parent_id;\n }\n return false;\n}", "public static function isAncestorOf(object $a, object $b) : bool\n {\n $a_id = spl_object_id($a);\n $curr_id = spl_object_id($b);\n while ($curr = @ self::$parents_index[$curr_id]) {\n $curr_id = spl_object_id($curr);\n if ($a_id === $curr_id) {\n return true;\n }\n }\n return false;\n }", "protected function hasParentMenuItem() {}", "public function hasParent() {\n return isset($this->_parent);\n }", "function cat_is_ancestor_of($cat1, $cat2)\n {\n }", "public function isCurrentChild(): bool;", "public function getParentElement() {}", "public function isDescendantOfActive() {\n return $this->isDescendantOf($this->site->page());\n }", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "public function isChildOnly();" ]
[ "0.6542127", "0.64991647", "0.61710393", "0.61710393", "0.61710393", "0.61230016", "0.60059696", "0.60046726", "0.59604484", "0.5921563", "0.5902705", "0.5757671", "0.5728297", "0.57192826", "0.5699878", "0.56545407", "0.5634029", "0.5566879", "0.5560207", "0.5556685", "0.554857", "0.55463415", "0.5483575", "0.5480677", "0.54562944", "0.54358983", "0.5417342", "0.5339748", "0.53390706", "0.5318562" ]
0.7277344
0
Creates a base job from OLP on EFI
function efi_create_job($job_id, $extra_job_data = array()){ global $order_date, $delivery_date, $debug; $base_job_data['job']=$job_id; $base_job_data['customer']='SINALITE'; $base_job_data['description']='SINALITE PRESSRUN '.$job_id; $base_job_data['description2']='Generated by OLP'; $base_job_data['jobType']=5013; $base_job_data['adminStatus']='O'; $base_job_data['shipVia']=1; $base_job_data['terms']=1; $base_job_data['dateSetup']=$order_date; $base_job_data['timeSetUp']=$order_date; $base_job_data['poNum']= 'SL'.$job_id; $base_job_data['promiseDate']=$delivery_date; $base_job_data['promiseTime']=$delivery_date; $base_job_data['scheduledShipDate']=$delivery_date; $base_job_data['priceList']=1; $base_job_data['oversMethod']=1; $base_job_data['shipInNameOf']=1; //$job_data['numbersGuaranteed']= //$job_data['convertingToJob']= //$job_data['paceConnectOrderID']=1260; //$job_data['paceConnectUserId']=65; $base_job_data['comboJobPercentageCalculationType']=1; //$base_job_data['altCurrency']="USD"; //$base_job_data['altCurrencyRate']=1.14159; //$base_job_data['comboTotal']=10000; //$base_job_data['totalPriceAllParts']=215000.000000; $base_job_data['readyToSchedule']=1; // CAUTION duplicate keys in $extra_job_data will overwrite $base_job_data $job_data = array_merge($base_job_data, $extra_job_data); //there could be more, added from the function args $job = new CreateObjectHelper(); try { $new_job = $job->createObject('job', $job_data, 'createJob'); if($debug){ show_all($new_job); } return true; } catch (Exception $exc) { //probably job exists return $exc->getMessage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function makeJob();", "abstract public function makeJob();", "public function addNewJobOpo()\n {\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "function rlip_schedule_add_job($data) {\n global $DB, $USER;\n\n //calculate the next run time, for use in both records\n $nextruntime = (int)(time() + rlip_schedule_period_minutes($data['period']) * 60);\n\n $userid = isset($data['userid']) ? $data['userid'] : $USER->id;\n $data['timemodified'] = time();\n if (isset($data['submitbutton'])) { // formslib!\n unset($data['submitbutton']);\n }\n $ipjob = new stdClass;\n $ipjob->userid = $userid;\n $ipjob->plugin = $data['plugin'];\n $ipjob->config = serialize($data);\n\n //store as a redundant copy in order to prevent elis task strangeness\n $ipjob->nextruntime = $nextruntime;\n\n if (!empty($data['id'])) {\n $ipjob->id = $data['id'];\n $DB->update_record(RLIP_SCHEDULE_TABLE, $ipjob);\n // Must delete any existing task records for the old schedule\n $taskname = 'ipjob_'. $ipjob->id;\n $DB->delete_records('elis_scheduled_tasks', array('taskname' => $taskname));\n } else {\n $ipjob->id = $DB->insert_record(RLIP_SCHEDULE_TABLE, $ipjob);\n }\n\n $task = new stdClass;\n $task->plugin = 'block_rlip';\n $task->taskname = 'ipjob_'. $ipjob->id;\n $task->callfile = '/blocks/rlip/lib.php';\n $task->callfunction = serialize('run_ipjob'); // TBD\n $task->lastruntime = 0;\n $task->blocking = 0;\n $task->minute = 0;\n $task->hour = 0;\n $task->day = '*';\n $task->month = '*';\n $task->dayofweek = '*';\n $task->timezone = 0;\n $task->enddate = null;\n $task->runsremaining = null;\n $task->nextruntime = $nextruntime;\n return $DB->insert_record('elis_scheduled_tasks', $task);\n}", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "Public Function CreatejobId()\n {\n \t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n \t\n\t\t\t$Salt = \"abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ1234567890_\";\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$ConfirmationKey = \"\";\n\t\t\tfor ($i=0;$i<8;$i++)\n\t\t\t{\n\t\t\t\t$ConfirmationKey = $ConfirmationKey . substr ($Salt, rand() % strlen($Salt), 1);\n\t\t\t}\n\t\t\t\n\t\t\t$InsertArray = array(\n \t\t\t'jobId' => $ConfirmationKey,\n \t\t);\n \t\t\n \t\t$Sql = \"SELECT id FROM bevomedia_queue WHERE jobId = '$ConfirmationKey'\";\n \t\t$Rows = $DatabaseObj->fetchAll($Sql);\n \t\tif(sizeof($Rows) > 0)\n \t\t{\n \t\t\t$ConfirmationKey = $this->CreatejobId();\n \t\t\treturn $ConfirmationKey;\n \t\t}\n \t\t\n \t\t$DatabaseObj->insert('bevomedia_queue', $InsertArray);\n \t\t\n \t\t$this->jobId = $ConfirmationKey;\n \t\t\n\t\t\treturn $ConfirmationKey;\n \t\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "public function create()\n\t{\n\t\tglobal $ilUser,$lng;\n\t\t\n\n\t\t// Write on task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\t$this->createAssignments($writer);\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\t\t#$GLOBALS['ilLog']->write($writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\tinclude_once './Services/ADN/Base/classes/class.adnRpcAdapter.php';\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t\t\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "abstract function create();", "function createLittleLoadBoxDummy(){\n $data = $this->getDataLittleLoadMovement();\n $data['movement_type_id'] = MovementTypeService::LOAD_BOX;\n\n Movement::create($data);\n }", "function addNewJob()\n {\n if($this->isManager() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n \n $this->global['pageTitle'] = 'Talend Job Seeker : Add New Input Component';\n\n $this->loadViews(\"addNewJob\", $this->global, $data, NULL);\n }\n }", "function createDIAUmpireQuantCommandFile ($task_infor, $all_task_file_path){\n//########################################################################\n \n $use_memery_size = '40G';\n if(defined(\"JAR_MAX_MEMORY\") and JAR_MAX_MEMORY){\n $use_memery_size = JAR_MAX_MEMORY;\n }\n $JAR_Command = get_jar_command($use_memery_size);\n //in analyst dir\n $mapDIA_CRATE_DATA_FILE = dirname(__FILE__).'/create_DIAUmpire_data_unique_pep.php';\n \n echo \"5. Create task command file\\n\";\n echo $task_infor['taskComFile'].\"\\n\";\n print \"-- all searched file locations.\\n\";\n $fp = fopen($task_infor['taskComFile'], \"w\");\n \n fwrite($fp, \"#!/bin/bash\\n\\n\");\n fwrite($fp, \"echo `hostname`\\n\");\n fwrite($fp, \"echo \\\"###1. cd to working dir\\\"\\n\");\n \n $command = \"cd '\".$task_infor['taskDir'].\"'\" ;\n fwrite($fp, \"$command \\n\"); \n $command = \"if [ ! -d ./Results ]\\nthen\\n\\tmkdir ./Results\\nfi\\n\";\n $command .= \"if [ ! -d ./Results ]\\nthen\\n\\techo \\\"Error: Cannot make Results folder\\\"\\n\\texit\\nfi\";\n fwrite($fp, \"$command\\n\"); \n \n if($task_infor['ParentQuantResultsDir']){\n $command = \"if [ ! -f \".$task_infor['ParentQuantResultsDir'].\"/FragSummary.xls ]\\nthen\\n\\techo 'Parent task folder has no FragSummary.xls'\\n\\texit\\nfi\";\n fwrite($fp, \"$command \\n\"); \n $command = \"cp '\". $task_infor['ParentQuantResultsDir'].\"/'*xls '\" . $task_infor['taskDir'].\"/'\" ;\n fwrite($fp, \"$command\\n\"); \n $command = \"FragSummary_FILE=\\\"FragSummary.xls\\\"\";\n fwrite($fp, \"$command \\n\");\n }else{\n fwrite($fp, \"echo \\\"###2. run ProteinProphet for all interact files\\\"\\n\"); \n $all_task_file_path_str = '';\n if($task_infor['tppSchEngine'] == 'iProphet'){\n //my ($tmp_path, $tmp_file_basename, $pep_file_from, $pep_file_to);\n foreach ($all_task_file_path as $theFilePath){\n print $theFilePath.\"\\n\";\n if(strpos($theFilePath, ':') === false) continue;\n list($tmp_path, $tmp_file_basename) = explode(':', $theFilePath);\n $pep_file_from = \"'\". $tmp_path . \"interact-\".$tmp_file_basename.\"_Q'\" . \"*\";\n $pep_file_to = dirname(dirname($tmp_path)). \"/\". $tmp_file_basename . \"/\";\n \n \n $command = \"cd '\".$pep_file_to.\"'\" ;\n fwrite($fp, \"$command \\n\"); \n $command = 'for theFile in `ls interact-* *_LCMSID.serFS *_LibID_* *_Q1.*FS *_Q2.*FS *_Q3.*FS *_masscaliRT.png`;do rm -f $theFile; done';\n \n fwrite($fp, \"$command\\n\"); \n $command = \"cp -f $pep_file_from '$pep_file_to'\";\n fwrite($fp, \"$command\\n\"); \n $all_task_file_path_str .= \"'\".$pep_file_to . \"interact-\".$tmp_file_basename.\"_Q'\" . \"* \";\n }\n $command = \"cd '\".$task_infor['taskDir'].\"'\" ;\n fwrite($fp, \"$command \\n\"); \n \n }else{\n \n foreach ($all_task_file_path as $theFilePath){\n print $theFilePath.\"\\n\";\n $all_task_file_path_str .= \"'\".$theFilePath . \"interact-'*.pep.xml \"; \n }\n }\n \n $command = escapeshellarg(TPP_BIN_PATH.'/ProteinProphet') . \" \". $all_task_file_path_str . escapeshellarg($task_infor['protFilePath']);\n if($task_infor['tppSchEngine'] == 'iProphet'){\n $command .= \" IPROPHET\";\n }\n $command .= \" 2>&1\";\n fwrite($fp, \"echo \\\"$command\\\"\\n$command \\n\"); \n fwrite($fp, \"echo \\\"###3. run DIA_Umpire_Quant\\\"\\n\");\n \n $command = $JAR_Command . escapeshellarg(DIAUMPIRE_BIN_PATH . \"/DIA_Umpire_Quant.jar\") .\" \". escapeshellarg($task_infor['QuantParamFile']);\n \n fwrite($fp, \"echo \\\"$command\\\"\\n$command \\n\"); \n \n $command = \"FragSummary_FILE=`ls -t FragSummary_*.xls | head -1` \\nif [ !-f \\\"\\$FragSummary_FILE\\\" ] \\nthen \\n\\techo 'Error: no DIA-Umpire-Quant result file created.' \\n\\texit \\nelse \\n\\techo 'DIA-Umpire-Quant result files were created.' \\nfi \\n\";\n fwrite($fp, \"$command \\n\");\n \n $command = \"for theFile in `ls *.xls diaumpire.quant_params`\\ndo\\n\\tcp -f \\$theFile Results/`echo \\$theFile|sed \\\"s/_[0-9]\\\\+//g\\\"`\\ndone\";\n fwrite($fp, \"$command \\n\"); \n \n }\n \n if($task_infor['SAINT_or_mapDIA'] == 'mapDIA' && $task_infor['SAINT_bait_name_str']){\n $mapDIA_input = \"mapDIA_input.txt\";\n $mapDIA_data = \"mapDIA_data.txt\";\n $mapDIA_path = dirname(dirname(MAP_DIA_BIN_PATH));\n $CRATE_DATA_FILE_in_mapDIA = $mapDIA_path.\"/create_DIAUmpire_data_unique_pep.php\";\n if(!_is_file($CRATE_DATA_FILE_in_mapDIA)){\n copy($mapDIA_CRATE_DATA_FILE, $CRATE_DATA_FILE_in_mapDIA);\n }\n $mapDIA_option = $task_infor['mapDIA_parameters'];\n $mapDIA_option = str_replace(\",\", \"\\n\",$task_infor['mapDIA_parameters']);\n $fp_mapDIA = fopen($task_infor['taskDir'].\"/\".$mapDIA_input, \"w\");\n fwrite($fp_mapDIA, \"### input file\\nFILE=\".$mapDIA_data.\"\\n\");\n fwrite($fp_mapDIA, $mapDIA_option); \n fclose($fp_mapDIA);\n \n \n \n fwrite($fp, \"echo \\\"###4. run mapDIA\\\"\\n\");\n $command = \"if [ ! -d ./Results/mapDIA ]\\nthen\\n\\tmkdir ./Results/mapDIA\\nfi\\n\";\n fwrite($fp, \"$command \\n\"); \n $command = \"php -f \".escapeshellarg($CRATE_DATA_FILE_in_mapDIA).\" \\$FragSummary_FILE \".escapeshellarg($task_infor['SAINT_bait_name_str']).\" $mapDIA_data\";\n if($task_infor['REMOVE_SHARED_PEPTIDE_GENE'] == 'true'){\n $command .= ' 1';\n }\n fwrite($fp, \"echo \\\"$command\\\"\\n$command \\n\");\n $command = escapeshellarg(MAP_DIA_BIN_PATH.\"/mapDIA\") . \" \". $mapDIA_input; \n fwrite($fp, \"echo \\\"$command\\\"\\n$command \\n\"); \n $command = \"if [ -f analysis_output.txt ]\\nthen\\n\\techo 'mapDIA result files created'\\n\\tcp -f protein_level.txt peptide_level.txt log2_data.txt fragment_selection.txt analysis_output.txt mapDIA*.txt ./Results/mapDIA/\\nelse\\n\\techo 'no mapDIA result files were created.'\\nfi\";\n \n fwrite($fp, \"$command \\n\"); \n \n \n }else if($task_infor['SAINT_or_mapDIA'] == 'SAINT' && $task_infor['SAINT_bait_name_str']){\n \n fwrite($fp, \"echo \\\"###4. run SAINT\\\"\\n\");\n $command = \"if ls SAINT_Interaction_MS1* > /dev/null 2>&1\\nthen\\n\\techo \\\"SAINT input files were created\\\"\\nelse\\n\\techo \\\"Error: no SAINT input files were created\\\"\\n\\texit\\nfi\";\n fwrite($fp, \"$command \\n\"); \n \n $command = \"for theFile in `ls SAINT_*.txt`\\ndo\\n\\tcp -f \\$theFile Results/`echo \\$theFile|sed \\\"s/_[0-9]\\+//g\\\"`\\ndone\";\n fwrite($fp, \"$command \\n\"); \n \n $tmp_saint_op = explode(',', $task_infor['SAINT_parameters']);\n $saint_para_hash = array();\n $saint_para_hash['saint_type'] = 'express';\n $saint_para_hash['nControl'] = '4';\n $saint_para_hash['nCompressBaits'] = '2';\n $saint_para_hash['nburn'] = '2000';\n $saint_para_hash['niter'] = '5000';\n $saint_para_hash['lowMode'] = '0';\n $saint_para_hash['minFold'] = '1'; \n $saint_para_hash['fthres'] = '0';\n $saint_para_hash['fgroup'] = '0';\n $saint_para_hash['var'] ='0';\n $saint_para_hash['normalize'] ='1';\n $saint_para_hash['has_iRefIndex_file'] = '';\n \n \n foreach ($tmp_saint_op as $thePare) {\n if(strpos($thePare, \":\") === false)continue;\n list($tmp_name, $value) = explode(':', $thePare);\n $saint_para_hash[$tmp_name] = $value;\n }\n \n $tmp_com = ''; \n \n \n if(_is_file(SAINT_SERVER_EXPRESS_PATH.\"/SAINTexpress-int\")){\n \n fwrite($fp, \"echo \\\"#4-1. run SAINT express\\\"\\n\");\n $command = escapeshellarg(SAINT_SERVER_EXPRESS_PATH.\"/SAINTexpress-int\");\n \n if($saint_para_hash['nControl']){\n $command .= \" -L\".$saint_para_hash['nControl'];\n }\n if($saint_para_hash['nCompressBaits']){\n $command .= \" -R\".$saint_para_hash['nCompressBaits'];\n }\n $tmp_com = $command . \" SAINT_Interaction_MS1_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\";\n if(_is_file(\"iRefIndex.dat\")){\n $tmp_com .= \" iRefIndex.dat\";\n }\n fwrite($fp, \"echo \\\"$tmp_com\\\"\\n$tmp_com \\n\"); \n $tmp_com = \"if [ -f list.txt ]\\nthen\\n\\tmv list.txt ./Results/list_MS1.txt\\nfi\";\n fwrite($fp, \"$tmp_com \\n\");\n \n $tmp_com = $command . \" SAINT_Interaction_MS2_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\";\n if(_is_file(\"iRefIndex.dat\")){\n $tmp_com .= \" iRefIndex.dat\";\n }\n fwrite($fp, \"echo \\\"$tmp_com\\\"\\n$tmp_com \\n\"); \n $tmp_com = \"if [ -f list.txt ]\\nthen\\n\\tmv list.txt ./Results/list_MS2.txt\\nfi\";\n fwrite($fp, \"$tmp_com \\n\"); \n \n \n fwrite($fp, \"echo \\\"#4-2. run SAINT\\\"\\n\");\n $command_reform_MS1 = escapeshellarg(SAINT_SERVER_PATH.\"/saint-reformat\"). \" SAINT_Interaction_MS1_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\";\n $command_reform_MS2 = escapeshellarg(SAINT_SERVER_PATH.\"/saint-reformat\"). \" SAINT_Interaction_MS2_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\";\n $other_options;\n if($saint_para_hash['nControl']){\n $command_reform_MS1 .= \" \" . $saint_para_hash['nControl'];\n $command_reform_MS2 .= \" \" . $saint_para_hash['nControl'];\n $command = escapeshellarg(SAINT_SERVER_PATH. \"/saint-int-ctrl\");\n $other_options = \" \". $saint_para_hash['lowMode']. \" \". $saint_para_hash['minFold'].\" \". $saint_para_hash['normalize'];\n }else{\n ###############?????????????????????????????\n $command = escapeshellarg(SAINT_SERVER_PATH. \"/saint-spc-noctrl\"); \n ###############????????????????????????????\n $other_options = \" \".$saint_para_hash['fthres'].\" \". $saint_para_hash['fgroup'].\" \". $saint_para_hash['var'].\" \". $saint_para_hash['normalize'];\n }\n \n fwrite($fp, \"echo \\\"$command_reform_MS1\\\" \\n$command_reform_MS1\\n\");\n $command = \"GSL_RNG_SEED=123 \". $command . \" interaction.new prey.new bait.new \". $saint_para_hash['nburn'] . \" \". $saint_para_hash['niter'] . $other_options;\n fwrite($fp, \"echo \\\"$command\\\" \\n$command \\n\"); \n $tmp_com = \"if [ -d RESULT ]\\nthen\\n\\techo 'SAINT MS1 result files were created'\\n\\tmv *.new ./RESULT\\n\\tmv RESULT Results/RESULT_MS1\\nelse\\n\\techo 'Error: No SAINT MS1 result files were created'\\n\\trm -f *.new\\nfi\\n\";\n $tmp_com .= \"rm -R LOG MAPPING MCMC\";\n fwrite($fp, \"$tmp_com\\n\");\n fwrite($fp, \"echo \\\"$command_reform_MS2\\\" \\n$command_reform_MS2\\n\");\n fwrite($fp, \"echo \\\"$command\\\" \\n$command \\n\"); \n $tmp_com = \"if [ -d RESULT ]\\nthen\\n\\techo 'SAINT MS2 result files were created'\\n\\tmv *.new ./RESULT\\n\\tmv RESULT Results/RESULT_MS2\\nelse\\n\\techo 'Error: No SAINT MS2 result files were created'\\n\\trm -f *.new\\nfi\";\n fwrite($fp, \"$tmp_com\\n\");\n \n /*\n #/mnt/thegpm/Prohits_SAINT/saint_code/SAINT_v2.3.4/bin/saint-reformat SAINT_Interaction_MS1_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt 3\n #/mnt/thegpm/Prohits_SAINT/saint_code/SAINT_v2.3.4/bin/saint-reformat SAINT_Interaction_MS2_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt 3\n #GSL_RNG_SEED=123 /mnt/thegpm/Prohits_SAINT/saint_code/SAINT_v2.3.4/bin/saint-int-ctrl interaction.new prey.new bait.new 2000 5000 0 1 1\n #6 run SATINT Express\n #/mnt/thegpm/Prohits_SAINT/saint_code/SAINTexpress_v3.3__2014_Apr_23/bin/SAINTexpress-int -L3 -R2 SAINT_Interaction_MS1_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\n #/mnt/thegpm/Prohits_SAINT/saint_code/SAINTexpress_v3.3__2014_Apr_23/bin/SAINTexpress-int -L3 -R2 SAINT_Interaction_MS2_*.txt SAINT_Prey_*.txt SAINT_Bait_*.txt\n */\n }else{\n fwrite($fp, \"#SAINT is requested. But SAINT cannot be run. Please check SAINT setting.\\n\");\n }\n }else{\n fwrite($fp, \"#SAINT is not requested.\\n\");\n }\n $command = \"cp -f task.log ./Results/\";\n fwrite($fp, \"$command \\n\"); \n fclose ($fp);\n \n \n \n \n \n system(\"chmod 775 \". $task_infor['taskComFile']);\n \n}", "function createLO( $objectType, $id_resource = false, $environment = false ) {\n\t\n\t$query = \"SELECT className, fileName FROM %lms_lo_types WHERE objectType='\".$objectType.\"'\";\n\t$rs = sql_query( $query );\n\tlist( $class_name, $file_name ) = sql_fetch_row( $rs );\n\tif (trim($file_name) == \"\") return false;\n\t/*if (trim($file_name) == \"\") {\n\t\tif (isset($_SESSION['idCourse'])) {\n\t\t\tUtil::jump_to('index.php?modname=organization&op=organization');\n\t\t}\n\t\tUtil::jump_to('index.php');\n\t}*/\n\trequire_once(dirname(__FILE__).'/../class.module/learning.object.php' );\n\tif (file_exists(_base_ . '/customscripts/'._folder_lms_.'/class.module/'.$file_name ) && Get::cfg('enable_customscripts', false) == true ){\n\t\trequire_once(_base_ . '/customscripts/'._folder_lms_.'/class.module/'.$file_name );\n\t} else {\n\t\trequire_once(dirname(__FILE__).'/../class.module/'.$file_name );\n\t}\n\t$lo = new $class_name($id_resource, $environment);\n\treturn $lo;\n}", "public function actionCreate()\n {\n $model = new JobpositionBase();\n\n $model->createdate = date('Y-m-d H:i:s');\n $model->updatedate = $model->createdate;\n $model->status = 1;\n\n $fromcompany = false;\n if(isset($_GET['fromcompany']) && intval($_GET['fromcompany']) > 0)\n {\n \t$model->companyid = $_GET['fromcompany'];\n \t$fromcompany = $_GET['fromcompany'];\n }\n \n $postdata = Yii::$app->request->post();\n if(isset($postdata['JobpositionBase']))\n {\n \t$postdata['JobpositionBase']['jobstartdate'] = '01' . substr($postdata['JobpositionBase']['jobstartdate'], 2); //echo $postdata['JobpositionBase']['jobstartdate']; exit;\n \t$postdata['JobpositionBase']['jobstartdate'] = BrainHelper::dateGermanToEnglish($postdata['JobpositionBase']['jobstartdate']);\n \t$postdata['JobpositionBase']['userid'] = Yii::$app->user->identity->id;\n \t$postdata['JobpositionBase']['subtitle'] = isset($postdata['JobpositionBase']['subtitle']) ? $postdata['JobpositionBase']['subtitle'] : '';\n \t$postdata['JobpositionBase']['showdate'] = isset($postdata['JobpositionBase']['showdate']) ? $postdata['JobpositionBase']['showdate'] : date('Y-m-d');\n \t$postdata['JobpositionBase']['expiredate'] = BrainHelper::dateGermanToEnglish($postdata['JobpositionBase']['expiredate']);\n \t\n \tPostcodeBase::add($postdata['JobpositionBase']['country'], $postdata['JobpositionBase']['city'], $postdata['JobpositionBase']['postcode']);\n }\n \n \n if ($model->load($postdata) && $model->save(false)) {\n \treturn $this->redirect(['view', 'id' => $model->id, 'fromcompany' => $fromcompany]);\n } else {\n \t\n \t$cities = CityBase::allCities();\n \t$worktypes_array = BrainStaticList::workTypeList();\n \t$jobypes_array = BrainStaticList::jobTypeList();\n \t$vacancy_array = BrainStaticList::vacancyList();\n \t$countries = BrainStaticList::countryList();\n \tunset($countries['Deutschland']);\n \t$countries_array = array('' => '' , 'Deutschland' => 'Deutschland' , );\n \t$countries_array = array_merge($countries_array , $countries);\n \t$worktypes = BrainStaticList::workTypeList();\n \t \n return $this->render('create', [\n \t\t'model' \t\t\t\t=> $model,\n \t\t\t\t\t'jobypes' \t\t\t\t=> $jobypes_array,\n \t\t\t\t\t'countries' \t\t\t=> $countries_array,\n \t\t\t\t\t'cities'\t\t\t\t=> $cities,\n \t\t\t\t\t'vacancies'\t\t\t\t=> $vacancy_array,\n \t\t\t\t\t'worktypes'\t\t\t\t=> $worktypes,\n ]);\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function createjobpacketAction(){\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$objJobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\n\t\t\t\tforeach($posts as $key => $value){\n\t\t\t\t\t/*if($key == 'milestones'){\n\t\t\t\t\t\t$posts['milestones'] = implode(',', $value);\n\t\t\t\t\t}else*/if($key == 'items'){\n\t\t\t\t\t\t$posts['items'] = implode(',', $value);\n\t\t\t\t\t}elseif($key == 'exp_delivery_date'){\n\t\t\t\t\t\tlist($d, $m, $y) = explode('/', $value);\n\t\t\t\t\t\t$posts['exp_delivery_date'] = \"$y-$m-$d\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($posts['id'])){\n\t\t\t\t\t$posts['created_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['created_by'] = $identity['user_id'];\n\t\t\t\t}else{\n\t\t\t\t\t$posts['updated_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['updated_by'] = $identity['user_id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo $objJobPacketTable->createJobPacket($posts);\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "abstract protected function create ();", "public function initJob(): void\n {\n mkdir($this->jobDirectory, 0777, true);\n $this->storeJobStatus('configuration', $this->config);\n }", "public function addJobToPB()\n {\n $input = Request::onlyLegacy('board_ids', 'job_id');\n\n $validator = Validator::make($input, ProductionBoard::getJobRule());\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $boardIds = arry_fu($input['board_ids']);\n\n if (empty($boardIds)) {\n return ApiResponse::errorGeneral('Invalid progress board ids.');\n }\n\n $job = $this->jobRepo->getById($input['job_id']);\n try {\n $this->service->addJobToPB($job, $boardIds);\n\n $type = 'Job';\n if ($job->isProject()) {\n $type = 'Project';\n }\n\n return ApiResponse::success([\n 'message' => trans('response.success.job_add_to_pb', ['attribute' => $type])\n ]);\n } catch (ModelNotFoundException $e) {\n return ApiResponse::errorNotFound($e->getMessage());\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "function createLoadBoxDummy(){\n $data = $this->getDataMovement();\n $data['movement_type_id'] = MovementTypeService::LOAD_BOX;\n\n Movement::create($data);\n }", "protected function process() {\n\n $jobId = $this->param();\n\n $jobTitle = $this->app()->request->post(\"title\");\n $jobDescription = $this->app()->request->post(\"description\");\n $jobSkills = $this->app()->request->post(\"skills\");\n\n $jobPositions = $this->app()->request->post(\"positions\");\n $jobLocation = $this->app()->request->post(\"location\");\n $jobType = $this->app()->request->post(\"type\");\n $jobStart = $this->app()->request->post(\"start\");\n\n\n if($jobType == 'temporary') {\n $jobDuration = $this->app()->request->post(\"duration\");\n }\n else {\n $jobDuration = '';\n }\n\n $skills = explode(\",\", $jobSkills);\n\n if(!$this->validPost($jobTitle, $jobDescription, $jobSkills, $jobPositions, $jobLocation, $jobDuration, $jobStart, $jobType)) {\n return;\n }\n\n require_once 'models/Job.php';\n\n\n switch($jobType) {\n case 'temporary':\n require_once 'models/TemporaryJob.php';\n $job = new TemporaryJob($jobId);\n $job->setTitle($jobTitle);\n $job->setDescription($jobDescription);\n $job->setSkills($skills);\n $job->setPositions($jobPositions);\n $job->setLocation($jobLocation);\n $job->setStartTime($jobStart);\n $job->setDuration($jobDuration);\n $job->saveToDb();\n break;\n\n case 'permanent':\n require_once 'models/PermanentJob.php';\n $job = new PermanentJob($jobId);\n $job->setTitle($jobTitle);\n $job->setDescription($jobDescription);\n $job->setSkills($skills);\n $job->setPositions($jobPositions);\n $job->setLocation($jobLocation);\n $job->setStartTime($jobStart);\n $job->saveToDb();\n break;\n }\n }", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('batch_job_lock');\n\t\t$this->setPhpName('BatchJobLock');\n\t\t$this->setClassname('BatchJobLock');\n\t\t$this->setPackage('Core');\n\t\t$this->setUseIdGenerator(false);\n\t\t// columns\n\t\t$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);\n\t\t$this->addColumn('JOB_TYPE', 'JobType', 'INTEGER', false, null, null);\n\t\t$this->addColumn('JOB_SUB_TYPE', 'JobSubType', 'INTEGER', false, null, null);\n\t\t$this->addColumn('OBJECT_ID', 'ObjectId', 'VARCHAR', false, 20, '');\n\t\t$this->addColumn('OBJECT_TYPE', 'ObjectType', 'INTEGER', false, null, null);\n\t\t$this->addColumn('ESTIMATED_EFFORT', 'EstimatedEffort', 'BIGINT', false, null, null);\n\t\t$this->addColumn('STATUS', 'Status', 'INTEGER', false, null, null);\n\t\t$this->addColumn('START_AT', 'StartAt', 'TIMESTAMP', false, null, null);\n\t\t$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);\n\t\t$this->addColumn('PRIORITY', 'Priority', 'TINYINT', false, null, null);\n\t\t$this->addColumn('URGENCY', 'Urgency', 'TINYINT', false, null, null);\n\t\t$this->addColumn('ENTRY_ID', 'EntryId', 'VARCHAR', false, 20, '');\n\t\t$this->addColumn('PARTNER_ID', 'PartnerId', 'INTEGER', false, null, 0);\n\t\t$this->addColumn('SCHEDULER_ID', 'SchedulerId', 'INTEGER', false, null, null);\n\t\t$this->addColumn('WORKER_ID', 'WorkerId', 'INTEGER', false, null, null);\n\t\t$this->addColumn('BATCH_INDEX', 'BatchIndex', 'INTEGER', false, null, null);\n\t\t$this->addColumn('EXPIRATION', 'Expiration', 'TIMESTAMP', false, null, null);\n\t\t$this->addColumn('EXECUTION_ATTEMPTS', 'ExecutionAttempts', 'TINYINT', false, null, null);\n\t\t$this->addColumn('VERSION', 'Version', 'INTEGER', false, null, null);\n\t\t$this->addColumn('DC', 'Dc', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('BATCH_JOB_ID', 'BatchJobId', 'INTEGER', 'batch_job_sep', 'ID', false, null, null);\n\t\t$this->addColumn('CUSTOM_DATA', 'CustomData', 'LONGVARCHAR', false, null, null);\n\t\t// validators\n\t}", "public function run()\n {\n\n\n OpenJobCard::create([\n 'job_card_number' => '123',\n 'opening_date' => '2020-01-01',\n 'workshop_id' => '1',\n 'truck_id' => '1',\n 'customer_id' => '1',\n 'job_system_id' => '1',\n 'job_ident_id' => '1',\n 'km_reading' => '10000',\n 'km_reading_date' => '2020-01-01',\n 'driver_id' => '1',\n 'mechanic_id' => '1',\n 'ass_mechanic_id' => '1',\n 'opening_clerk_id' => '1',\n 'receptionist_id' => '1',\n 'closed' => '0',\n 'comment' => 'ggggggggg',\n ]);\n }", "public function createTrancheOld()\n {\n $uniqueId = str_replace(\".\",\"\",microtime(true)).rand(000,999);\n\n if($this->type == 1){\n\n TranchesPoidsPc::create([\n 'nom' => $this->minPoids.\" - \".$this->maxPoids,\n 'min_poids' => $this->minPoids,\n 'max_poids' => $this->maxPoids,\n 'uid' => \"PP\".$uniqueId,\n ]);\n\n\n\n }else{\n TranchesKgPc::create([\n 'nom' => $this->nom,\n 'uid' => \"KP\".$uniqueId,\n ]);\n\n }\n session()->flash('message', 'Tranche \"'.$this->nom. '\" a été crée ');\n\n\n\n $this->reset(['nom','minPoids','maxPoids']);\n\n $this->emit('saved');\n }" ]
[ "0.6454626", "0.6454626", "0.5926238", "0.5911856", "0.5560392", "0.54484826", "0.5372004", "0.5367039", "0.5263153", "0.5160501", "0.514083", "0.51307267", "0.5094002", "0.50655574", "0.50480133", "0.5047628", "0.50425905", "0.50350827", "0.4979414", "0.4966838", "0.4966826", "0.49216273", "0.49139762", "0.49004167", "0.49003685", "0.4890622", "0.48879963", "0.48775595", "0.48523423", "0.4850624" ]
0.7077317
0
$ret = $this>soapclient>$actionName(array('Job' => $object,'in1' => null, 'in2' => null, 'in3' => $newObject ));
function cloneObject2( $actionName, $object, $newPKey, $newParent, $newObject ) { $ret = $this->soapclient->$actionName(array('Job' => $object,'newPrimaryKey' => $newPKey, 'newParent' => $newParent, 'JobAttributesToOverride' => $newObject )); return $ret->out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testSoap() {\n\n ini_set('soap.wsdl_cache_enabled', 0);\n\n // Load the WSDL\n $wsdlURI = TESTAPP_URL.jUrl::get('jsoap~WSDL:wsdl', array('service'=>'testapp~soap'));\n $client = new SoapClient($wsdlURI, array('trace' => 1, 'soap_version' => SOAP_1_1));\n\n $result = $client->__soapCall('getServerDate', array());\n $this->assertEqualOrDiff(date('Y-m-d\\TH:i:s O'),$result);\n\n $result = $client->__soapCall('hello', array('Sylvain'));\n $this->assertEqualOrDiff(\"Hello Sylvain\", $result);\n\n $result = $client->__soapCall('concatString', array('Hi ! ', 'Sylvain', 'How are you ?'));\n $this->assertEqualOrDiff('Hi ! SylvainHow are you ?', $result);\n\n $result = $client->__soapCall('concatArray', array(array('Hi ! ', 'Sylvain', 'How are you ?')));\n $this->assertEqualOrDiff('Hi ! Sylvain How are you ?', $result);\n\n $result = $client->__soapCall('returnAssociativeArray', array());\n $this->assertEqualOrDiff(array (\n 'arg1' => 'Hi ! ',\n 'arg2' => 'Sylvain',\n 'arg3' => 'How are you ?',\n ), $result);\n\n\n $result = $client->__soapCall('returnAssociativeArrayOfObjects', array());\n $struct='<array>\n <object key=\"arg1\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n <object key=\"arg2\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n <object key=\"arg3\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n</array>';\n $this->assertComplexIdenticalStr($result, $struct);\n\n //$this->assertEqualOrDiff(array('arg1'=>'Hi ! ', 'arg2'=>'Sylvain', 'arg3'=>'How are you ?'), $result);\n\n $result = $client->__soapCall('concatAssociativeArray', array(array('arg1'=>'Hi ! ', 'arg2'=>'Sylvain', 'arg3'=>'How are you ?')));\n $this->assertEqualOrDiff('Hi ! Sylvain How are you ?', $result);\n\n $result = $client->__soapCall('returnObject', array());\n $struct='<object>\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>';\n $this->assertComplexIdenticalStr($result, $struct);\n\n $result = $client->__soapCall('receiveObject', array($result));\n $struct='<object>\n <string property=\"name\" value=\"Name updated\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>';\n $this->assertComplexIdenticalStr($result, $struct);\n\n $result = $client->__soapCall('returnObjects', array());\n $struct='<array>\n <object key=\"0\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n <object key=\"1\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n <object key=\"2\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n <object key=\"3\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n</array>';\n $this->assertComplexIdenticalStr($result, $struct);\n\n $result = $client->__soapCall('returnObjectBis', array());\n $struct='\n <object>\n <string property=\"msg\" value=\"hello\" />\n\n <object property=\"test\">\n <string property=\"name\" value=\"De Vathaire\"/>\n <string property=\"firstName\" value=\"Sylvain\"/>\n <string property=\"city\" value=\"Paris\"/>\n </object>\n </object>';\n $this->assertComplexIdenticalStr($result, $struct);\n\n $result = $client->__soapCall('returnCircularReference', array());\n $struct='\n <array>\n <object key=\"0\">\n <string property=\"msg\" value=\"object1\" />\n <object property=\"test\">\n <string property=\"msg\" value=\"object2\" />\n <object property=\"test\">\n <string property=\"msg\" value=\"object1\" />\n </object>\n </object>\n </object>\n <object key=\"1\">\n <string property=\"msg\" value=\"object2\" />\n <object property=\"test\">\n <string property=\"msg\" value=\"object1\" />\n <object property=\"test\">\n <string property=\"msg\" value=\"object2\" />\n </object>\n </object>\n </object>\n </array>';\n $this->assertComplexIdenticalStr($result, $struct);\n }", "function efi_create_job($job_id, $extra_job_data = array()){\n \n global $order_date, $delivery_date, $debug;\n \n $base_job_data['job']=$job_id;\n $base_job_data['customer']='SINALITE';\n $base_job_data['description']='SINALITE PRESSRUN '.$job_id;\n $base_job_data['description2']='Generated by OLP';\n $base_job_data['jobType']=5013;\n $base_job_data['adminStatus']='O';\n $base_job_data['shipVia']=1;\n $base_job_data['terms']=1;\n $base_job_data['dateSetup']=$order_date;\n $base_job_data['timeSetUp']=$order_date;\n $base_job_data['poNum']= 'SL'.$job_id;\n $base_job_data['promiseDate']=$delivery_date;\n $base_job_data['promiseTime']=$delivery_date;\n $base_job_data['scheduledShipDate']=$delivery_date;\n $base_job_data['priceList']=1;\n $base_job_data['oversMethod']=1;\n $base_job_data['shipInNameOf']=1;\n //$job_data['numbersGuaranteed']=\n //$job_data['convertingToJob']=\n //$job_data['paceConnectOrderID']=1260;\n //$job_data['paceConnectUserId']=65;\n $base_job_data['comboJobPercentageCalculationType']=1;\n //$base_job_data['altCurrency']=\"USD\";\n //$base_job_data['altCurrencyRate']=1.14159;\n //$base_job_data['comboTotal']=10000;\n //$base_job_data['totalPriceAllParts']=215000.000000;\n $base_job_data['readyToSchedule']=1;\n \n // CAUTION duplicate keys in $extra_job_data will overwrite $base_job_data\n $job_data = array_merge($base_job_data, $extra_job_data);\n\n //there could be more, added from the function args\n \n $job = new CreateObjectHelper();\n\n try \n {\n $new_job = $job->createObject('job', $job_data, 'createJob');\n if($debug){\n show_all($new_job);\n }\n return true; \n }\n catch (Exception $exc) \n {\n //probably job exists\n return $exc->getMessage();\n }\n}", "public function toSoapRequest()\n { \n \n $obj = new \\stdClass();\n\n // Populate SOAP Request object with data\n foreach ($this->_properties as $key=>$value) {\n // Prepare value by function\n $functionName = \"_prepare\" . ucwords($key);\n if (method_exists($this, $functionName)) {\n $value = $this->$functionName($value);\n }\n\n if (is_array($value)) {\n // An array\n $result = array();\n foreach ($value as $itemId => $item) {\n if ($item instanceof \\Pcxpress\\Unifaun\\Model\\Pcxpress\\Unifaun\\UnifaunAbstract) {\n $result[$itemId] = $item->toSoapRequest();\n } else {\n $result[$itemId] = $item;\n }\n }\n\n if (sizeof($result) > 0) {\n $namespace = $this->_namespace;\n if (array_key_exists($key, $this->_namespaceForProperties)) {\n $namespace = $this->_namespaceForProperties[$key];\n }\n\n if ($namespace !== null) {\n $result = new \\SoapVar($result, SOAP_ENC_OBJECT, null, $namespace, $key, $namespace);\n }\n\n $obj->$key = $result;\n }\n } elseif ($value instanceof \\Pcxpress\\Unifaun\\Model\\Pcxpress\\Unifaun\\UnifaunAbstract) {\n // An object was found in value\n $result = $value->toSoapRequest();\n if (sizeof($result) > 0) {\n $obj->$key = $result;\n }\n } else {\n if ($value !== NULL) {\n $namespace = $this->_namespace;\n if (array_key_exists($key, $this->_namespaceForProperties)) {\n $namespace = $this->_namespaceForProperties[$key];\n }\n\n if ($namespace !== null && !$value instanceof \\stdClass) {\n $value = new \\SoapVar((string)$value, null, null, $namespace, $key, $namespace);\n }\n $obj->$key = $value;\n }\n }\n\n }\n\n return $obj;\n }", "public function &renvoi_objet_soap($arrayObject = false) {\n\t\t$soap_var = new soapvar ( $this->renvoi_donnees_soap ( $arrayObject ), SOAP_ENC_OBJECT, \"CustomizationVirtualMachineName\" );\n\t\treturn $soap_var;\n\t}", "function SOAP_call($body, $controle){\n $location_URL = 'https://api.go4you.com.br/Consultas/Pedidos/Acoes.asmx?wsdl';\n $action_URL = \"http://www.go4you.com.br/webservices/InserirPedidoSemBag\";\n \n $client = new SoapClient(null, array(\n \"Content-type: text/xml;charset=\\\"utf-8\\\"\",\n \"Accept: text/xml\",\n \"Cache-Control: no-cache\",\n \"Pragma: no-cache\",\n \"SOAPAction: \\\"run\\\"\",\n 'location' => $location_URL,\n 'host' => \"api.go4you.com.br\",\n 'uri' => \"api.go4you.com.br\",\n 'trace' => \"1\",\n \"Content-length: \".strlen($body)\n ));\n \n return $client->__doRequest($body ,$location_URL, $action_URL, 1); \n \n}", "public function __construct($_personName = NULL,$_contactInfo = NULL,$_tINInfo = NULL,$_birthDt = NULL,$_birthState = NULL,$_birthCountry = NULL,$_deathDt = NULL,$_driversLicense = NULL,$_mothersMaidenName = NULL,$_spouseInfo = NULL,$_employmentHistory = NULL,$_schoolInfo = NULL,$_physicalCharacteristics = NULL,$_citizenship = NULL,$_languageSpoken = NULL,$_message = NULL,$_quality = NULL,$_birthCity = NULL,$_nationality = NULL,$_affiliation = NULL,$_validationInfo = NULL,$_recordID = NULL,$_militaryIdInfo = NULL,$_passportInfo = NULL,$_childrenInfo = NULL,$_hometownArea = NULL,$_relationshipStatus = NULL,$_orientation = NULL,$_aKAInfo = NULL,$_zodiac = NULL,$_birthYear = NULL)\n {\n MicrobiltWsdlClass::__construct(array('PersonName'=>$_personName,'ContactInfo'=>$_contactInfo,'TINInfo'=>$_tINInfo,'BirthDt'=>$_birthDt,'BirthState'=>$_birthState,'BirthCountry'=>$_birthCountry,'DeathDt'=>$_deathDt,'DriversLicense'=>$_driversLicense,'MothersMaidenName'=>$_mothersMaidenName,'SpouseInfo'=>$_spouseInfo,'EmploymentHistory'=>$_employmentHistory,'SchoolInfo'=>$_schoolInfo,'PhysicalCharacteristics'=>$_physicalCharacteristics,'Citizenship'=>$_citizenship,'LanguageSpoken'=>$_languageSpoken,'Message'=>$_message,'Quality'=>$_quality,'BirthCity'=>$_birthCity,'Nationality'=>$_nationality,'Affiliation'=>$_affiliation,'ValidationInfo'=>$_validationInfo,'RecordID'=>$_recordID,'MilitaryIdInfo'=>$_militaryIdInfo,'PassportInfo'=>$_passportInfo,'ChildrenInfo'=>$_childrenInfo,'HometownArea'=>$_hometownArea,'RelationshipStatus'=>$_relationshipStatus,'Orientation'=>$_orientation,'AKAInfo'=>$_aKAInfo,'Zodiac'=>$_zodiac,'BirthYear'=>$_birthYear),false);\n }", "public function __construct($_personName = NULL,$_contactInfo = NULL,$_tINInfo = NULL,$_birthDt = NULL,$_birthState = NULL,$_birthCountry = NULL,$_deathDt = NULL,$_driversLicense = NULL,$_mothersMaidenName = NULL,$_spouseInfo = NULL,$_employmentHistory = NULL,$_schoolInfo = NULL,$_physicalCharacteristics = NULL,$_citizenship = NULL,$_languageSpoken = NULL,$_message = NULL,$_quality = NULL,$_birthCity = NULL,$_nationality = NULL,$_affiliation = NULL,$_validationInfo = NULL,$_recordID = NULL,$_militaryIdInfo = NULL,$_passportInfo = NULL,$_childrenInfo = NULL,$_hometownArea = NULL,$_relationshipStatus = NULL,$_orientation = NULL,$_aKAInfo = NULL,$_zodiac = NULL,$_birthYear = NULL,$_ownershipPercentage = NULL)\n {\n MicrobiltCriminalReportWsdlClass::__construct(array('PersonName'=>$_personName,'ContactInfo'=>$_contactInfo,'TINInfo'=>$_tINInfo,'BirthDt'=>$_birthDt,'BirthState'=>$_birthState,'BirthCountry'=>$_birthCountry,'DeathDt'=>$_deathDt,'DriversLicense'=>$_driversLicense,'MothersMaidenName'=>$_mothersMaidenName,'SpouseInfo'=>$_spouseInfo,'EmploymentHistory'=>$_employmentHistory,'SchoolInfo'=>$_schoolInfo,'PhysicalCharacteristics'=>$_physicalCharacteristics,'Citizenship'=>$_citizenship,'LanguageSpoken'=>$_languageSpoken,'Message'=>$_message,'Quality'=>$_quality,'BirthCity'=>$_birthCity,'Nationality'=>$_nationality,'Affiliation'=>$_affiliation,'ValidationInfo'=>$_validationInfo,'RecordID'=>$_recordID,'MilitaryIdInfo'=>$_militaryIdInfo,'PassportInfo'=>$_passportInfo,'ChildrenInfo'=>$_childrenInfo,'HometownArea'=>$_hometownArea,'RelationshipStatus'=>$_relationshipStatus,'Orientation'=>$_orientation,'AKAInfo'=>$_aKAInfo,'Zodiac'=>$_zodiac,'BirthYear'=>$_birthYear,'OwnershipPercentage'=>$_ownershipPercentage),false);\n }", "public function __construct($_chargeId = NULL,$_chargeDesc = NULL,$_chargeType = NULL,$_chargeClass = NULL,$_chargeDt = NULL,$_arrestDt = NULL,$_offenseDt = NULL,$_plea = NULL,$_sentence = NULL,$_sentenceDt = NULL,$_dispositionDt = NULL,$_dispositionType = NULL,$_probationStatus = NULL,$_defendantName = NULL,$_plaintiff = NULL,$_originationState = NULL,$_originationCounty = NULL,$_offenderStatus = NULL,$_offenderCategory = NULL,$_judgment = NULL,$_riskLevel = NULL,$_message = NULL,$_adjudicationWithheld = NULL,$_caseId = NULL,$_count = NULL,$_county = NULL,$_offenseDesc = NULL,$_maxTerm = NULL,$_minTerm = NULL,$_numOfCounts = NULL,$_appealDt = NULL,$_statute = NULL,$_arrestType = NULL,$_finalDesposition = NULL,$_chargeDesc2 = NULL,$_originationName = NULL,$_caseType = NULL)\n {\n MicrobiltWsdlClass::__construct(array('ChargeId'=>$_chargeId,'ChargeDesc'=>$_chargeDesc,'ChargeType'=>$_chargeType,'ChargeClass'=>$_chargeClass,'ChargeDt'=>$_chargeDt,'ArrestDt'=>$_arrestDt,'OffenseDt'=>$_offenseDt,'Plea'=>$_plea,'Sentence'=>$_sentence,'SentenceDt'=>$_sentenceDt,'DispositionDt'=>$_dispositionDt,'DispositionType'=>$_dispositionType,'ProbationStatus'=>$_probationStatus,'DefendantName'=>$_defendantName,'Plaintiff'=>$_plaintiff,'OriginationState'=>$_originationState,'OriginationCounty'=>$_originationCounty,'OffenderStatus'=>$_offenderStatus,'OffenderCategory'=>$_offenderCategory,'Judgment'=>$_judgment,'RiskLevel'=>$_riskLevel,'Message'=>$_message,'AdjudicationWithheld'=>$_adjudicationWithheld,'CaseId'=>$_caseId,'Count'=>$_count,'County'=>$_county,'OffenseDesc'=>$_offenseDesc,'MaxTerm'=>$_maxTerm,'MinTerm'=>$_minTerm,'NumOfCounts'=>$_numOfCounts,'AppealDt'=>$_appealDt,'Statute'=>$_statute,'ArrestType'=>$_arrestType,'FinalDesposition'=>$_finalDesposition,'ChargeDesc2'=>$_chargeDesc2,'OriginationName'=>$_originationName,'CaseType'=>$_caseType),false);\n }", "public function __construct($_collateralDesc = NULL,$_collateralCount = NULL,$_propertyDesc = NULL,$_propertyAddress = NULL,$_serialNum = NULL,$_message = NULL,$_primaryMachine = NULL,$_secondMachine = NULL,$_manufacturerName = NULL,$_year = NULL,$_model = NULL,$_manufacturedDt = NULL,$_borough = NULL,$_lot = NULL,$_airRights = NULL,$_subterraneanRights = NULL,$_easement = NULL,$_newUsed = NULL)\n {\n MicrobiltWsdlClass::__construct(array('CollateralDesc'=>$_collateralDesc,'CollateralCount'=>$_collateralCount,'PropertyDesc'=>$_propertyDesc,'PropertyAddress'=>$_propertyAddress,'SerialNum'=>$_serialNum,'Message'=>$_message,'PrimaryMachine'=>$_primaryMachine,'SecondMachine'=>$_secondMachine,'ManufacturerName'=>$_manufacturerName,'Year'=>$_year,'Model'=>$_model,'ManufacturedDt'=>$_manufacturedDt,'Borough'=>$_borough,'Lot'=>$_lot,'AirRights'=>$_airRights,'SubterraneanRights'=>$_subterraneanRights,'Easement'=>$_easement,'NewUsed'=>$_newUsed),false);\n }", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "function sendCharging($transactionID,$moID){ \n\n$sokaServicesObj = new SokaServices(\"consumer\"); \n \n$url = 'http://192.168.50.68:8002/osb/services/AdjustAccount_1_0?wsdl';\n$date = date(\"YmdHis\");\n $username = \"live_tigo_quiz\";\n $password = \"Qu1z@#123\";\n $expDateTime = \"2020-01-01 00:00:00\";\n$xmlPost = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:v1=\"http://xmlns.tigo.com/AdjustAccountRequest/V1\" xmlns:v3=\"http://xmlns.tigo.com/RequestHeader/V3\" xmlns:v2=\"http://xmlns.tigo.com/ParameterType/V2\">\n<soapenv:Header xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n<cor:debugFlag xmlns:cor=\"http://soa.mic.co.af/coredata_1\">true</cor:debugFlag>\n<wsse:Security>\n<wsse:UsernameToken>\n<wsse:Username>live_tigo_quiz</wsse:Username>\n<wsse:Password>Qu1z@#123</wsse:Password>\n</wsse:UsernameToken>\n</wsse:Security>\n</soapenv:Header>\n<soapenv:Body>\n<v1:AdjustAccountRequest>\n<v3:RequestHeader>\n<v3:GeneralConsumerInformation>\n<v3:consumerID>TIGO_QUIZ</v3:consumerID>\n<v3:transactionID>'.$transactionID.'</v3:transactionID>\n<v3:country>TCD</v3:country>\n<v3:correlationID>33</v3:correlationID>\n</v3:GeneralConsumerInformation>\n</v3:RequestHeader>\n<v1:RequestBody>\n<v1:customerID>'.$this->msisdn.'</v1:customerID>\n<v1:walletID>2000</v1:walletID>\n<v1:adjustmentValue>-'.$this->amount.'</v1:adjustmentValue>\n<v1:externalTransactionID>'.$transactionID.'</v1:externalTransactionID>\n<v1:comment>Charging</v1:comment>\n<v1:additionalParameters>\n<v2:ParameterType>\n<v2:parameterName>ExpiryDateTime</v2:parameterName>\n<v2:parameterValue>'.$expDateTime.'</v2:parameterValue>\n</v2:ParameterType>\n</v1:additionalParameters>\n</v1:RequestBody>\n</v1:AdjustAccountRequest>\n</soapenv:Body>\n</soapenv:Envelope>';\n $headers = array(\n \"Method:POST\",\n \"Content-type: application/soap+xml;charset=\\\"utf-8\\\"\",\n \"Content-length: \" . strlen($xmlPost),\n \"Cache-Control: no-cache\",\n \"Pragma: no-cache\",\n \"Accept: application/soap+xml\",\n \"Content-Encoding:gzip,compress\",\n \"SOAPAction:AdjustAccount\",\n );\n\n \n $txnID = $sokaServicesObj->recordPaymentTransaction($this->msisdn,$transactionID, $xmlPost, $moID,\"SENT\",$this->amount); \n \n$ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $username . \":\" . $password); // username and password - declared at the top of the doc\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_TIMEOUT, 160);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlPost); // the SOAP request\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $soapResponse = curl_exec($ch);\n curl_close($ch);\n if($soapResponse){\n $data['isResponse'] = TRUE; \n $data['response'] = $soapResponse;\n $data['txnID'] = $txnID;\n }\n else{ \n $data['isResponse'] = FALSE; \n $data['response'] = \"PROCESS_FAILED\";\n $data['txnID'] = $txnID;\n }\n return $data;\n \n \n}", "function SAP_set_order_multy($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,invoice.month,invoice.year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$c_month=$i_data[4];\n\t\t\t$c_year=$i_data[5];\n\t\t\t$srv_date='';\n\t\t\t$m_date='';\n\t\t\t//SET UP SERVICE DATE - END OF THE BILLING PERIOD\n\t\t\tswitch($c_month)\n\t\t\t{\n\t\t\t\tcase '1':\n\t\t\t\t$m_date='-01-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t$m_date='-02-28';\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t$m_date='-03-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t$m_date='-04-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t$m_date='-05-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t$m_date='-06-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t$m_date='-07-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t$m_date='-08-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t$m_date='-09-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '10':\n\t\t\t\t$m_date='-10-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '11':\n\t\t\t\t$m_date='-11-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '12':\n\t\t\t\t$m_date='-12-31';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$srv_date='20'.$c_year.$m_date;\n\t\t\t\n\t\t\t// Preparing Items for Invoice\n\t\t\t\n\t\t\t// LOCATE POSITIONS for the invoice\n\t\t\t$positions_sql=\"SELECT service_id,quantity,service.id_SAP \n\t\t\t\t\t\t\tFROM invoice_reg \n\t\t\t\t\t\t\tLEFT JOIN service ON invoice_reg.service_id=service.id\n\t\t\t\t\t\t\tWHERE invoice_id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql1=mysqli_query($db_server,$positions_sql);\n\t\t\t\t\n\t\t\tif(!$answsql1) die(\"Database SELECT TO invoice_reg table failed: \".mysqli_error($db_server));\t\n\t\t\t$count_in=$answsql1->num_rows;\n\t\t\tif (!$count_in)\n\t\t\t{\n\t\t\t\techo \"WARNING: No POSITIONS found for a given ID in invoice_reg TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$items=new ItemList();\n\t\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t\t{\t\n\t\t\t\t\t$pos_data= mysqli_fetch_row($answsql1);\n\t\t\t\t\t$item1 = new Item();\n\t\t\t\t\t// 1. Item number\n\t\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t\t// 2. Material code\n\t\t\t\t\t$item1->MATERIAL=$pos_data[2];\n\t\t\t\n\t\t\t\t\n\t\t\t\t// 3. Currency ?? - need it?\n\t\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t\t// 4. SD conditions\n\t\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t\t// 4. Quantity\n\t\t\t\t\t$item1->TARGET_QTY=$pos_data[1];; \n\t\t\t\t\n\t\t\t\n\t\t\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t\t$items->item[$it] = $item1;\n\t\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode; \t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->SERVICEDATE=$srv_date;\n\t\t\t$req->RETURN2 = '';\n\t\t\t//echo \"SENDING TO SAP\";\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order->RETURN2->item->MESSAGE==\"SUCCESS\")\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\t\t\telse\n\t\t\t\t$doc_id=0;\n\t\t\t\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "function SAP_set_order($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,decade,month,year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "function bwc_transactions_all($gets){\r\n\t$gets['output'] = \"obj\";\r\n\t$transactions_join = (object)[\r\n\t\t\"transactions\"=>bwc_transactions_mass($gets),\r\n\t\t\"prosto\"=>bwc_ajax_prosto_mass($gets),\r\n\t\t\"storage\"=>bwc_ajax_storage_mass($gets),\r\n\t\t\"processing\"=>bwc_ajax_storage_mass($gets)\r\n\t\t];\r\n\t// var_dump($transactions_join->prosto);\r\n\treturn $transactions_join;\r\n\r\n\t// $transactions_join->transactions = bwc_transactions_mass($gets);\r\n\t// $transactions_join->prosto = bwc_ajax_prosto_mass($gets);\r\n\t// $transactions_join->storage = bwc_ajax_storage_mass($gets);\r\n\t// $transactions_join->processing = bwc_ajax_storage_mass($gets);\r\n}", "public function sendRequestXML($object);", "public final function __soapCall($function_name, $arguments, $options=array(), $input_headers= array(), &$output_headers=array()) {\t\n \t \n \t$result = parent::__soapCall($function_name, $arguments, $options, $this->getWSsecurityHeader(),$output_headers);\n \t\n \tif (isset($this->options['debug']) && $this->options['debug']) {\t\t\n\t\t\t$this->logLastWSResponse();\n\t\t}\n\t\treturn $result;\n }", "function projectmessages_to_soap($at_arr) {\n\tfor ($i=0; $i<count($at_arr); $i++) {\n\t\tif ($at_arr[$i]->isError()) {\n\t\t\t//skip if error\n\t\t} else {\n\t\t\t$return[]=array(\n\t\t\t\t'project_message_id'=>$at_arr->data_array['project_message_id'],\n\t\t\t\t'project_task_id'=>$at_arr->data_array['project_task_id'],\n\t\t\t\t'body'=>$at_arr->data_array['body'],\n\t\t\t\t'postdate'=>$at_arr->data_array['postdate'],\n\t\t\t\t'posted_by'=>$at_arr->data_array['posted_by']\n\t\t\t);\n\t\t}\n\t}\n\treturn $return;\n}", "public function aw_service_wp ( $proc, $args ) {\n\t \t//$args = array('argDta' => $productID,'argIsSale' => 1,'argUsr' => '');\n\t\t$url \t\t= 'http://203.201.129.15/AWSERVICE_WP_WEB/awws/AWService_WP.awws?wsdl';\n\t\t$client \t= new SoapClient($url);\n\t\t$response \t= $client->__soapCall( $proc, array($args) );\n\t\t\n\t\tswitch ( $proc ) {\n\t\t\tcase 'Trainers_OnlineProduct_Listing':\n\t\t\t\t$simpleXml = simplexml_load_string($response->Trainers_OnlineProduct_ListingResult);\n\t\t\tbreak;\n\n\t\t\tcase 'CorporateClientsList':\n\t\t\t\t$simpleXml = simplexml_load_string($response->CorporateClientsListResult);\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'pcPrdct_DisplayInfo':\n\t\t\t\t$simpleXml = simplexml_load_string($response->pcPrdct_DisplayInfoResult);\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'pcChat_UserDetails':\n\t\t\t\t$simpleXml = $response->pcChat_UserDetailsResult;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t \treturn $simpleXml;\n\t }", "function getappointmentcount(){\t\t\t\n\t\t\t\n\n\n$aParametres = array(\"sessionID\" => \"\",\n\t\t\t\t\t\t\"fromDate\" => \"\",\n\t\t\t\t\t\t\"toDate\" => \"\"\n );\n\ntry {\n $options = array(\n 'soap_version'=>SOAP_1_2,\n 'exceptions'=>true,\n 'trace'=>1,\n 'cache_wsdl'=>WSDL_CACHE_NONE\n );\n\t\t\t\n $client = new SoapClient('https://ehmclinicals.com/WebApplication6/PangeaWS?WSDL', $options);\n\t\t\t//var_dump($client->__getFunctions());\n\n $results = $client->GetAppointmentCount(array(\"parameter\"=> $aParametres));\n\t\t\tvar_dump($client);\n\t\t\tvar_dump($results);\n } catch (Exception $e) {\n echo \"<h2>Exception Error!</h2>\";\n echo $e->getMessage();\n } \n}", "public function getProcessedOrder( $param = array() )\n {\n \n $Token = Configure::read('access_token');\n $soapUrl = \"http://api.linnlive.com/order.asmx?op=ProcessOrder\"; \n $xml_post_string = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <ProcessOrder xmlns=\"http://api.linnlive.com/order\">\n <Token>'.$Token.'</Token>\n <request> \n <OrderIdIsSet>true</OrderIdIsSet>\n <OrderId>'.$param['OrderId'].'</OrderId> \n <ProcessedByName>'.$param['ProcessedByName'].'</ProcessedByName>\n <ProcessDateTimeIdIsSet>true</ProcessDateTimeIdIsSet> \n </request>\n </ProcessOrder>\n </soap:Body>\n </soap:Envelope>';\n \n $headers = array(\n \"POST /generic.asmx HTTP/1.1\",\n \"Host: api.linnlive.com\",\n \"Content-Type: text/xml; charset=utf-8\",\n \"Content-Length: \".strlen($xml_post_string)\n );\n \n $url = $soapUrl;\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $response = curl_exec($ch); \n curl_close($ch);\n \n $response = str_replace( \"</soap:Body>\" ,\"\" , str_replace( \"<soap:Body>\" , \"\" , $response ) );\n $parser = simplexml_load_string($response);\n //echo \"<pre>\";\n //print_r($parser);\n return $parser->ProcessOrderResponse->ProcessOrderResult->Error;\n //exit; \n \n }", "public function __call($name, $request)\n\t{\n\t\tif(is_object($this->soap))\n\t\t{\n\t\t\tswitch($name)\n\t\t\t{\n\t\t\t\tcase \"ProcessTransaction\":\n\t\t\t\tcase \"AddABAccount\":\n\t\t\t\tcase \"UpdateABAccount\":\n\t\t\t\tcase \"UpdateABSchedule\":\n\t\t\t\t\t$r[\"TRANSACTION\"] = $request[0];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"ProcessVaultTransaction\":\n\t\t\t\tcase \"UpdateTransaction\":\n\t\t\t\tcase \"ProcessAccount\":\n\t\t\t\tcase \"ProcessCustomer\":\n\t\t\t\tcase \"ProcessCustomerAndAccount\":\n\t\t\t\t\t$r[\"TRANSACTION_VAULT\"] = $request[0];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n $r = $request[0];\n\t\t\t\t\t//throw new Exception('Method Choice Error - '.$name.' is not a valid Gateway method name.');\n\t\t\t\t\t//return FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Remove bool items\n\t\t\t$r = $this->soap_request($r);\n\t\t\t// No further formatting is offered for soap responses, as the soap response object is uber-powerful.\n\t\t\t$response = $this->soap->$name($r);\n\t\t\t\n\t\t\t//if($response->ProcessTransactionResult->TRANSACTIONRESPONSE->RESPONSE_CODE == 3)\n\t\t\t//{\n\t\t\t//\tthrow new Exception('Request Error - '.$response->ProcessTransactionResult->TRANSACTIONRESPONSE->RESPONSE_REASON_TEXT);\n\t\t\t//}\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch($name)\n\t\t\t{\n\t\t\t\tcase \"ProcessTransaction\":\n\t\t\t\tcase \"AddABAccount\":\n\t\t\t\tcase \"UpdateABAccount\":\n\t\t\t\tcase \"UpdateABSchedule\":\n\t\t\t\t\t$xml = '<TRANSACTION xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://gateway.securenet.com/API/Contracts\">';\n\t\t\t\t\t$xml .= $this->xmlize($request[0]);\n\t\t\t\t\t$xml .= '</TRANSACTION>';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"ProcessVaultTransaction\":\n\t\t\t\tcase \"UpdateTransaction\":\n\t\t\t\tcase \"ProcessAccount\":\n\t\t\t\tcase \"ProcessCustomer\":\n\t\t\t\tcase \"ProcessCustomerAndAccount\":\n\t\t\t\t\t$xml = '<TRANSACTION_VAULT xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://gateway.securenet.com/API/Contracts\">';\n\t\t\t\t\t$xml .= $this->xmlize($request[0]);\n\t\t\t\t\t$xml .= '</TRANSACTION_VAULT>';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception('Method Choice Error - '.$name.' is not a valid Gateway method name.');\n\t\t\t\t\treturn FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $this->send($xml,$name);\n\t\t}\n\t}", "public function demo(){\n // $this->soapWrapper->add(function ($service) {\n // $service->name('CRW')\n // ->wsdl('http://crm.elizade.net:5050/Service1.svc?wsdl')\n // ->trace(true);\n // });\n $this->soapWrapper->add('CRW', function ($service) {\n $service\n ->wsdl('http://crm.elizade.net:5050/Service1.svc?wsdl')\n ->trace(true);\n // ->classmap([\n // GetConversionAmount::class,\n // GetConversionAmountResponse::class,\n // ]);\n });\n\n $data = [\n 'lastname' => 'Raymond',\n 'firstname' => 'Ativie',\n 'email' => '[email protected]',\n 'bizPhone' => '08151700676'\n ];\n\n $case = [\n 'accountnumber' => 'CUST013643',\n 'description' => 'This is a description',\n 'title' => 'Hello world'\n ];\n\n // $response = $this->soapWrapper->call('CRW.CreateContact', [$data]);\n $response = $this->soapWrapper->call('CRW.CreateCase', [$case]);\n\n var_dump($response);\n\n // Using the added service\n // $this->soapWrapper->service('CRW', function ($service) use ($data) {\n // var_dump($service->call('CreateContact', [$data]));\n // // var_dump($service->call('Otherfunction'));\n // });\n }", "public function __construct($_serviceOptions = NULL,$_shipFrom = NULL,$_shipTo = NULL,$_shipmentPackages = NULL)\n {\n parent::__construct(array('serviceOptions'=>$_serviceOptions,'shipFrom'=>$_shipFrom,'shipTo'=>$_shipTo,'shipmentPackages'=>$_shipmentPackages),false);\n }", "public function ocenture_update(array $args ) {\r\n\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $user = $args['order']['user']['UserInfo'];\r\n $billing = $args['order']['product']['BillingAddress'];\r\n $products = $args['order']['product']['OrderItems'];\r\n $repNo = $args['order']['user']['RepresentativeNumber'];\r\n\r\n $params = [\r\n 'args' => [\r\n \"ProductCode\" => 'IG7985', //default product code, will be changed below\r\n \"ClientMemberID\" => $args['result']['CustomerID'],\r\n \"FirstName\" => $user['FirstName'],\r\n \"LastName\" => $user['LastName'],\r\n \"Address\" => $billing['Street1'],\r\n \"City\" => $billing['City'],\r\n \"State\" => $billing['State'],\r\n \"Zipcode\" => $billing['PostalCode'],\r\n \"Phone\" => $billing['Phone'], \r\n \"Email\" => $user['Email'],\r\n //remove dob for now as it is not mandatory\r\n //\"DOB\" => $user['DateOfBirth'],\r\n \"Gender\" => $user['Gender'],\r\n \"RepID\" => $repNo\r\n ]\r\n ];\r\n\r\n \r\n\r\n $results = [];\r\n $log = [] ;\r\n\r\n foreach ($products as $product) {\r\n //get ocenture product id by mapping the freedom product id\r\n $ocentureProductCode = $this->getOcentureProductCode(\r\n $product['ProductID']\r\n );\r\n\r\n $params['args']['ProductCode'] = $ocentureProductCode;\r\n\r\n Logger::start($params['args']);\r\n\r\n try {\r\n \r\n Logger::log(\"Request Params\");\r\n Logger::log($params);\r\n\r\n //create account on ocenture\r\n $result = $ocenture->createAccount($params);\r\n\r\n Logger::log(\"Ocenture Result\");\r\n Logger::log($result);\r\n\r\n //if the account was successfully created\r\n if ($result->Status == 'Account Created') {\r\n Logger::log(\"Ocenture account created\");\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n } catch (Exception $e) {\r\n $result = $e->getMessage();\r\n Logger::log(\"Exception: $result\");\r\n }\r\n\r\n $log[] = ['params' => $params, 'result' => $result];\r\n $results[] = $result;\r\n }\r\n\r\n /* sample result from ocenture:\r\n stdClass::__set_state(array(\r\n 'Status' => 'Account Created',\r\n 'ClientMemberID' => 'R25961408',\r\n 'MembershipID' => 111836826,\r\n 'ProductCode' => 'YP8381',\r\n )),\r\n */\r\n\r\n\r\n \r\n Logger::close();\r\n\r\n return ['ocenture' => $results];\r\n }", "function searcharraySh($ponumber, $status, $paramSh, $shippingUrl, $querytype){\n\t\t$carrier =\"\";\n\t\t$clink=\"\";\n\t\t\t\t\n\t\t$resultshvalreturn = \"\";\n\t\t\n\t\t\n\tif($status==\"80\" || $status==\"75\"){\n\t\t\n\t\t\n\t\t$responseSh='';\n\t\t//if($querytype == '4' ){$responseSh='';}\n\t\tif($shippingUrl == \"\"){$responseSh='';}\n\t\telse{\n\t\t$wsdlSh = $shippingUrl;\n\t\t$paramSh['referenceNumber'] = $ponumber;\n\t\ttry {\n\t\t\t$clientSh = new SoapClient($wsdlSh);\n\t\t\t$responseSh = $clientSh->__soapCall(\"getOrderShipmentNotification\", array($paramSh));\n\t\t} catch (SoapFault $e) {\n\t\t // echo \"<pre>SoapFault: \".print_r($e, true).\"</pre>\\n\";\n\t\t\t//echo \"Failed to load\";\n\t\t\t\n\t\t // echo \"<pre>faultcode: '\".$e->faultcode.\"'</pre>\";\n\t\t // echo \"<pre>faultstring: '\".$e->getMessage().\"'</pre>\";\n\t\t\t$erromsgSh = \"Failed to load\";\n\t\t\t$responseSh=\"SoapFault\";\n\t\t}\n\t\t\n\t\t}\n\t\t$arraysh = json_decode(json_encode($responseSh), true);\n\t\t\n\t\t\n\t\tif($arraysh==\"SoapFault\"){\n\t\t\t\t$resultshvalreturn=\"Fail to load\";\n\t\t\t\treturn $resultshvalreturn;\n\t\t\t\tdie();\n\t\t\t}\t\n\t\t\t\n\t\t\t$narray=isset($arraysh['OrderShipmentNotificationArray']['OrderShipmentNotification']) ? $arraysh['OrderShipmentNotificationArray']['OrderShipmentNotification'] : \"\";\n\t\tif(isset($arraysh['OrderShipmentNotificationArray']['OrderShipmentNotification']['purchaseOrderNumber'])){\n\t\t\t$ponumsearcharray=array($narray);\n\t\t}\n\t\telse{\n\t\t\t$ponumsearcharray=$narray;\t\n\t\t\t}\n\t\t/*print \"<pre>\";\t\n\t\tprint_r($ponumsearcharray);\n\t\tprint \"</pre>\";*/\n\t\t\tif(is_array($ponumsearcharray)){\n\t\t\tforeach($ponumsearcharray as $ponumsearch){\n\t\t\t\tif($ponumber ==$ponumsearch['purchaseOrderNumber']){\n\t\t\t\t$parray = isset($ponumsearch['SalesOrderArray']['SalesOrder']) ? $ponumsearch['SalesOrderArray']['SalesOrder'] : \"\";\n\t\t\t\tif(isset($ponumsearch['SalesOrderArray']['SalesOrder']['ShipmentLocationArray'])){\n\t\t\t\t\t\t$salesorderarray=array($parray);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$salesorderarray=$parray;\n\t\t\t\t}\n\t\t\t\t/*print \"<pre>\";\t\n\t\t\t\tprint_r($salesorderarray);\n\t\t\t\tprint \"</pre>\";*/\n\t\t\t\t\tif(is_array($salesorderarray)){\n\t\t\t\t\tforeach($salesorderarray as $salesorder){\n\t\t\t\t\t$sarray = isset($salesorder['ShipmentLocationArray']['ShipmentLocation']) ? $salesorder['ShipmentLocationArray']['ShipmentLocation'] : \"\";\n\t\t\t\t\tif(isset($salesorder['ShipmentLocationArray']['ShipmentLocation']['PackageArray'])){\n\t\t\t\t\t\t\t$ShipmentLocationarray=array($sarray);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$ShipmentLocationarray=$sarray;\n\t\t\t\t\t}\n\t\t\t\t\t/*print \"<pre>\";\t\n\t\t\t\t\tprint_r($ShipmentLocationarray);\n\t\t\t\t\tprint \"</pre>\";*/\n\t\t\t\t\tif(is_array($ShipmentLocationarray)){\n\t\t\t\t\t\tforeach($ShipmentLocationarray as $ShipmentLocation){\n\t\t\t\t\t\t$sharray = isset($ShipmentLocation['PackageArray']['Package']) ? $ShipmentLocation['PackageArray']['Package'] : \"\";\n\t\t\t\t\t\tif(isset($ShipmentLocation['PackageArray']['Package']['trackingNumber'])){\n\t\t\t\t\t\t\t\t$PackageArrayarray=array($sharray);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$PackageArrayarray=$sharray;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*print \"<pre>\";\t\n\t\t\t\t\t\tprint_r($PackageArrayarray);\n\t\t\t\t\t\tprint \"</pre>\";*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(is_array($PackageArrayarray)){\n\t\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\t\t\t\t\t\tforeach($PackageArrayarray as $Package){\n\t\t\t\t\t\t\t\t\t\t\t\t//if($i!=0){$resultshvalreturn.= \", \";}\n\t\t\t\t\t\t\t\t\t\t\t\t\t//if(isset($Package['trackingNumber'])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ptrackingNumber = isset($Package['trackingNumber']) ? $Package['trackingNumber'] : '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$pcarrier = isset($Package['carrier']) ? $Package['carrier'] : '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$pshipmentMethod = isset($Package['shipmentMethod']) ? $Package['shipmentMethod'] : '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$trakingno = trackingno($pcarrier, $ptrackingNumber, $pshipmentMethod);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$resultshvalreturn.= $trakingno;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\t}//die();\n\t\t//$resultshvalreturn.= \"<br / >/*********Po Array loop*********/<br / ><br / >\";\n\t\t\t}\n\t\t\t}\n\t\t\t}\n}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\t\n\t\t\tif($resultshvalreturn==\"\" && ($status == \"80\" || $status == \"75\")){ $resultshvalreturn=\"Shipped\"; }\n\t\t\telseif($status == \"99\"){ $resultshvalreturn=\"Canceled\"; }\n\t\t\telseif($resultshvalreturn==\"\" && ($status == \"10\" || $status == \"11\" || $status == \"20\" || $status == \"30\" || $status == \"40\" || $status == \"41\" || $status == \"42\" || $status == \"43\" || $status == \"44\" || $status == \"60\" || $status == \"70\")){$resultshvalreturn=\"In Process\";}\n\t\t\treturn $resultshvalreturn;\n\t\t\tset_time_limit(0);\n\t}", "public function renvoi_donnees_soap($arrayObject = false) {\n\t\t$liste_proprietes = parent::renvoi_donnees_soap(true);\n\t\t\n\t\t\n\t\tif ($arrayObject) {\n\t\t\treturn $liste_proprietes;\n\t\t}\n\t\treturn $liste_proprietes->getArrayCopy ();\n\t}", "public function __construct($_answerValue = NULL,$_answerIsCorrect = NULL)\n {\n MicrobiltWsdlClass::__construct(array('AnswerValue'=>$_answerValue,'AnswerIsCorrect'=>$_answerIsCorrect),false);\n }", "public function addNewJobOpo()\n {\n }", "public function __construct($arguments = array()) {\n \n parent::__construct($arguments);\n\n $this->description = t('Get Procedure (English) from SOAP service (SharePoint).');\n\n // \"fields\" from an XML feed, so we pass an explicit list of source fields.\n $fields = array(\n// 'd:Id' => t('ID'),\n// 'd:Title' => t('Name'),\n// 'd:AudienceDesc' => t('Description'),\n \n 'RecordID' => t('Record ID'),\n 'ServiceID' => t('Service ID'),\n 'AProcedureName' => t('A ProcedureName'),\n 'Ebeneficiary' => t('E Beneficiary'),\n );\n\n // The source ID here is the one retrieved from the XML listing URL, and\n // used to identify the specific item's URL.\n $this->map = new MigrateSQLMap($this->machineName,\n array(\n 'RecordID' => array(\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => TRUE,\n 'description' => 'Record ID',\n ),\n ),\n MigrateDestinationTerm::getKeySchema()\n );\n\n //$xpath = '//m:properties/d:Id';\n\n // Source list URL.\n //$list_url = 'http://dnrd.ae/_layouts/RestProxy/Query.aspx?html=0&q=Audiance';\n $soap_service_name = 'test_soap';\n\n // Each ID retrieved from the list URL will be plugged into :id in the\n // item URL to fetch the specific objects.\n //$item_url = 'http://dnrd.ae/_layouts/RestProxy/Query.aspx?html=0&q=Audiance(:id)';\n\n // We use the MigrateSourceList class for any source where we obtain the\n // list of IDs to process separately from the data for each item. The\n // listing and item are represented by separate classes, so for example we\n // could replace the XML listing with a file directory listing, or the XML\n // item with a JSON item.\n \n// $this->source = new MigrateSourceList(new DnrdMigrateListXML($list_url, $xpath),\n// new MigrateItemXML($item_url), $fields);\n $this->source = new MigrateSourceList(new Gdrfa_MigrateListSoapXML($soap_service_name),\n new Gdrfa_MigrateItemSoapXML($soap_service_name), $fields);\n \n \n $this->destination = new MigrateDestinationNode('service_soap');\n \n\n // TIP: Note that for XML sources, in addition to the source field passed to\n // addFieldMapping (the name under which it will be saved in the data row\n // passed through the migration process) we specify the Xpath used to retrieve\n // the value from the XML.\n \n $this->addFieldMapping('title', 'RecordID')->xpath('//RecordID');\n\n $this->addFieldMapping('field_service_id', 'ServiceID')->xpath('//ServiceID');\n\n $this->addFieldMapping('field_a_procedure_name', 'AProcedureName')->xpath('//AProcedureName');\n \n $this->addFieldMapping('field_e_beneficiary', 'Ebeneficiary')->xpath('//Ebeneficiary');\n\n $this->addFieldMapping('status')\n ->defaultValue(1);\n\n $this->addFieldMapping('promote')\n ->defaultValue(0);\n\n $this->addFieldMapping('sticky')\n ->defaultValue(0);\n\n // Declare unmapped source fields.\n $unmapped_sources = array(\n /*\n //'EProcedureName',\n 'ADepartment',\n 'EDepartment',\n 'ECustomerType',\n 'ACustomerType',\n 'Classification',\n 'Status',\n 'Estatus',\n 'Astatus',\n\n 'Abeneficiary',\n 'AFeeRequired',\n 'ARequirements',\n 'ATools',\n 'ANotesforCustomer',\n 'ANoteforemployees',\n 'ESubmissionPlaces',\n 'ASubmissionPlaces',\n 'AProcedureDetail',\n 'OnLocal',\n 'OnLine',\n 'Modified',\n 'NeedUpdate',\n 'UpdateID',\n 'Active',\n */\n\n );\n $this->addUnmigratedSources($unmapped_sources);\n\n // Declare unmapped destination fields.\n $unmapped_destinations = array(\n 'nid',\n 'uid',\n //'redirect',\n 'language',\n 'tnid',\n 'body',\n 'created',\n 'body:summary',\n 'body:format',\n 'changed',\n 'log',\n 'translate',\n 'revision',\n 'revision_uid',\n 'is_new',\n 'path',\n 'pathauto',\n 'comment',\n );\n $this->addUnmigratedDestinations($unmapped_destinations);\n \n \n \n\n }", "public function testJobGet()\n {\n\n }" ]
[ "0.6121664", "0.588437", "0.5749995", "0.56961703", "0.5671588", "0.55704707", "0.55391824", "0.55011153", "0.54051495", "0.52915925", "0.52260876", "0.52213365", "0.5183876", "0.5183059", "0.5119213", "0.5072623", "0.5051123", "0.5012386", "0.4998912", "0.49915993", "0.49886218", "0.49756104", "0.49416566", "0.49315792", "0.49267116", "0.4920524", "0.48967037", "0.4895781", "0.4881691", "0.48690373" ]
0.61725414
0
Constructs a new DigestReader implementation, reading from the Reader $reader and hashing all data with the algorithm $hashAlgo.
public function __construct(Reader $reader, $hashAlgo) { $this->_base = $reader; $this->_resource = hash_init($hashAlgo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __construct(Reader $reader)\n {\n $this->_reader = $reader;\n }", "public function __construct(Reader $reader)\n {\n $this->reader = $reader;\n }", "public function __construct(Reader $reader)\n {\n $this->reader = $reader;\n }", "public static function create(\\SetaPDF_Core_Reader_ReaderInterface $reader) {}", "public function __construct($reader) {\n\t\t$this->nativeReader = $reader;\n\t}", "public static function get(\\SetaPDF_Core_Reader_ReaderInterface $reader) {}", "public static function fromReader(Reader $reader): self\n {\n $mimeType = MediaType::mapFileExtensionToMimeType($reader->getFileExtension());\n $stream = $reader->getStream();\n\n return new self($mimeType, $stream);\n }", "public function __construct($reader) {\n $this->cfgReader = $reader;\n }", "public function __construct($reader = null, &$options = array())\n {\n $this->_reader = $reader;\n $this->_options = &$options;\n }", "public function __construct($reader = null, &$options = array())\n {\n parent::__construct($reader, $options);\n\n if ($reader === null)\n return;\n\n $offset = $this->_reader->getOffset();\n $this->_size = $this->_reader->readUInt32BE();\n\n /* ID3v2.3.0 ExtendedHeader */\n if ($this->getOption('version', 4) < 4) {\n if ($this->_reader->readUInt16BE() == 0x8000) {\n $this->_flags = self::CRC32;\n }\n $this->_padding = $this->_reader->readUInt32BE();\n if ($this->hasFlag(self::CRC32)) {\n $this->_crc = $this->_reader->readUInt32BE();\n }\n }\n\n /* ID3v2.4.0 ExtendedHeader */\n else {\n $this->_size = $this->_decodeSynchsafe32($this->_size);\n $this->_reader->skip(1);\n $this->_flags = $this->_reader->readInt8();\n if ($this->hasFlag(self::UPDATE)) {\n $this->_reader->skip(1);\n }\n if ($this->hasFlag(self::CRC32)) {\n $this->_reader->skip(1);\n $this->_crc =\n $this->_reader->readInt8() * (0xfffffff + 1) +\n $this->_decodeSynchsafe32($this->_reader->readUInt32BE());\n }\n if ($this->hasFlag(self::RESTRICTED)) {\n $this->_reader->skip(1);\n $this->_restrictions = $this->_reader->readInt8();\n }\n }\n }", "public function __construct($reader = null, &$options = array())\n {\n parent::__construct($reader, $options);\n\n if ($reader === null)\n return;\n\n $this->_bufferSize =\n Transform::fromUInt32BE(\"\\0\" . substr($this->_data, 0, 3));\n $this->_infoFlags = Transform::fromInt8($this->_data[3]);\n if ($this->getSize() > 4)\n $this->_offset = Transform::fromInt32BE(substr($this->_data, 4, 4));\n }", "public function hash()\n\t{\n\t\t$components = $this->components;\n\t\t\n\t\t/*\n\t\t * Reconstruct the original signature with the data we have about the\n\t\t * source application to verify whether the apps are the same, and\n\t\t * should therefore be granted access.\n\t\t */\n\t\tswitch (strtolower($this->algo)) {\n\t\t\tcase 'sha512':\n\t\t\t\t$calculated = hash('sha512', implode(self::SEPARATOR, array_filter($components)));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Invalid algorithm', 400);\n\t\t}\n\t\t\n\t\treturn new Checksum($this->algo, $calculated);\n\t}", "public function __construct(\n Klarna_Checkout_HTTP_TransportInterface $http,\n Klarna_Checkout_Digest $digester,\n $secret\n ) {\n $this->http = $http;\n $this->digester = $digester;\n $this->_secret = $secret;\n }", "public static function create(FeeBoundReaderInterface $feeBoundReader): FeeCalculatorInterface\n {\n return new FeeCalculator($feeBoundReader->getFeeBoundCollection());\n }", "public function __construct(Reader $reader, Writer $writer)\n {\n $this->reader = $reader;\n $this->writer = $writer;\n }", "public function hash($algorithm) {\n try {\n if ( in_array($algorithm, hash_algos()) ) {\n $this->_value = hash($algorithm, $this->_value);\n \n return $this;\n }\n throw new \\Exception(\"Algorithm \\\"$algorithm\\\" not found!\");\n } catch (\\Exception $e) {\n print 'Exception detected! '. $e->getMessage();\n }\n \n return $this;\n }", "public function read(PhpBuf_IO_Reader_Interface $reader) {\n try {\n while($reader->getPosition() < $reader->getLength()){\n $fieldClass = $this->readFieldFromHeader($reader);\n $fieldClass->read($reader);\n }\n } catch(PhpBuf_IO_Exception $e){\n return ;\n }\n }", "public function setDigest(string $digest) : self\n {\n $this->initialized['digest'] = true;\n $this->digest = $digest;\n return $this;\n }", "static function xmlDeserialize(Reader $reader)\n {\n $payeeFinancial = new self();\n\n $keyValue = Sabre\\Xml\\Element\\KeyValue::xmlDeserialize($reader);\n\n if (isset($keyValue[Schema::CBC . 'ID'])) {\n $financial->id = $keyValue[Schema::CBC . 'ID'];\n }\n\n if (isset($keyValue[Schema::CBC . 'Name'])) {\n $financial->name = $keyValue[Schema::CBC . 'Name'];\n }\n\n if (isset($keyValue[Schema::CAC . 'FinancialInstitutionBranch'])) {\n $financial->financialInstitutionBranch = $keyValue[Schema::CAC . 'FinancialInstitutionBranch'];\n }\n\n return $payeeFinancial;\n }", "public function setAlgorithm($tag) {\n $this->header->setAlgorithm($tag);\n return $this;\n }", "public function __construct(HasherContract $hasher)\n {\n $this->hasher = $hasher;\n }", "public function __construct(HasherContract $hasher)\n {\n $this->hasher = $hasher;\n }", "public function __construct($reader = null, &$options = array())\n {\n parent::__construct($reader, $options);\n\n if ($reader === null)\n return;\n\n $this->_format = Transform::fromUInt8($this->_data[0]);\n for ($i = 1; $i < $this->getSize(); $i += 5) {\n $this->_events[Transform::fromUInt32BE(substr($this->_data, $i + 1, 4))] =\n $data = Transform::fromUInt8($this->_data[$i]);\n if ($data == 0xff)\n break;\n }\n ksort($this->_events);\n }", "public function setReader(Reader $reader);", "protected function __construct(Reader $reader, Generator $generator) {\n\n\t\t$this->reader = $reader;\n\t\t$this->faker = $generator;\n\t}", "public static function create(\\SetaPDF_Core_Document $document, \\SetaPDF_Core_Reader_ReaderInterface $reader) {}", "public function createReader($filename) {}", "public function __construct(DoorReadingRepositoryInterface $DoorReadingRepository)\n {\n parent::__construct();\n $this->ReadDoorRepo = $DoorReadingRepository;\n }", "public function setHashAlgorithm($hash_algorithm)\n\t{\n\t\t$this->hash_algorithm = $hash_algorithm;\n\n\t\treturn $this;\n\t}", "public function __construct($reader, &$options = array())\n {\n parent::__construct($reader, $options);\n\n $this->_reserved1 = $this->_reader->readGuid();\n $markersCount = $this->_reader->readUInt32LE();\n $this->_reserved2 = $this->_reader->readUInt16LE();\n $nameLength = $this->_reader->readUInt16LE();\n $this->_name = iconv\n ('utf-16le', $this->getOption('encoding'),\n $this->_reader->readString16($nameLength));\n for ($i = 0; $i < $markersCount; $i++) {\n $marker = array\n ('offset' => $this->_reader->readInt64LE(),\n 'presentationTime' => $this->_reader->readInt64LE());\n $this->_reader->skip(2);\n $marker['sendTime'] = $this->_reader->readUInt32LE();\n $marker['flags'] = $this->_reader->readUInt32LE();\n $descriptionLength = $this->_reader->readUInt32LE();\n $marker['description'] = iconv\n ('utf-16le', $this->getOption('encoding'),\n $this->_reader->readString16($descriptionLength));\n $this->_markers[] = $marker;\n }\n }" ]
[ "0.5410404", "0.53830004", "0.53830004", "0.5262567", "0.5086237", "0.4889678", "0.4856584", "0.482767", "0.47710654", "0.47192723", "0.46631235", "0.4624918", "0.45854688", "0.456514", "0.45649627", "0.4535507", "0.4465374", "0.44271603", "0.44090238", "0.435876", "0.43279764", "0.43279764", "0.43212917", "0.43151778", "0.4308039", "0.43064126", "0.42715904", "0.42660406", "0.42334932", "0.42145836" ]
0.7672387
0
Returns a relative link to this category.
public function getLink() { return Controller::join_links($this->Blog()->Link(), 'category', $this->URLSegment); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canonicalLink()\n\t{\n\t\treturn $this->URL();\n\t}", "public function getUrlAttribute()\n {\n return url(\"blog/category/{$this->id}-\") . strtolower(str_replace(\" \", \"-\", $this->name));\n }", "public function Link() {\n $Action = 'show/' . $this->ID . '/' . $this->CategoryID;\n return $Action; \n }", "function get_category_link($category)\n {\n }", "public function getLink() {\n\t\t\t// This is currently identical to drawLink()\n\t\t\t// but that's designed to return HTML, and may in the future contain formatting etc\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$this->guid}'\");\n\t\t\t$location = array();\n\t\t\t$html = '';\n\t\t\twhile ($data->parent != 0) {\n\t\t\t\t$html = '/'.$data->name.$html;\n\t\t\t\t$data = $db->get_row(\"SELECT parent,name FROM pages WHERE guid = '{$data->parent}'\");\n\t\t\t}\n\t\t\treturn $html . '/'; // .html removed and replaced by a /\n\t\t}", "public function Link()\n {\n return $this->Url;\n }", "public function link()\r\n\t{\r\n\t\t$language_segment = (Config::get('core::languages')) ? $this->language->uri . '/' : '';\r\n\r\n\t\treturn url($language_segment . 'galleries/' . $this->gallery->slug . '/' . $this->id);\r\n\t}", "public function AbsoluteLink()\n {\n if ($Page = $this->Link()) {\n return Director::absoluteURL($Page);\n }\n }", "public function getLink()\n {\n return $this->get('Link');\n }", "public function getURL()\n {\n return $this->page->getURL() . 'links-to-this/';\n }", "public function getLinkUrl()\n {\n if ($this->linkUrl === null) {\n if (!empty($this->url)) {\n $this->linkUrl = $this->url;\n } elseif (!empty($this->uri)) {\n $this->linkUrl = '/' . locale() . '/' . $this->uri;\n }\n }\n\n return $this->linkUrl;\n }", "public function getLink(){\n\t\t$parentCat = VideoCategory::get()->byID($this->VideoCategoryID);\n\t\t$parentPage = Page::get()->byID($parentCat->VideoPageID);\n\t\treturn $parentPage->Link().\"?video=\".$this->ID;\n\t}", "public function link() { return site_url().'/'.$this->post->post_name; }", "public function Link()\n {\n if ($product = $this->Product()) {\n return $product->Link;\n }\n return '';\n }", "public function get_link()\n {\n\n return $this->link;\n }", "public function Link() {\n\t\treturn self::$url_segment .'/';\n\t}", "public function getLink() {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }" ]
[ "0.6979202", "0.68052036", "0.6756991", "0.67027897", "0.669461", "0.66623235", "0.66561204", "0.65567994", "0.65025854", "0.6496775", "0.6473944", "0.6439003", "0.64306366", "0.642306", "0.640929", "0.6390306", "0.6344888", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424", "0.63352424" ]
0.78979516
0
Sets a new encapsulatedX509Certificate
public function setEncapsulatedX509Certificate(array $encapsulatedX509Certificate) { $this->encapsulatedX509Certificate = $encapsulatedX509Certificate; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCertificate($val)\n {\n $this->_propDict[\"certificate\"] = $val;\n return $this;\n }", "public function setCertificate(?Certificate $certificate): static\n {\n $this->certificate = $certificate;\n return $this;\n }", "public function setCertificate(array $certificate)\n {\n $this->certificate = $certificate;\n return $this;\n }", "public function setCertificate(string $certificate): self\n {\n $this->options['certificate'] = $certificate;\n return $this;\n }", "public function setCertificate(string $certificate): self\n {\n $this->options['certificate'] = $certificate;\n return $this;\n }", "public function setCert(?string $cert): void\n {\n }", "function setCertificateID($id) {\n $this->certificateID = $id;\n }", "function setCertificateFile($filename)\n {\n $this->_certificateFile = $filename;\n }", "public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null)\n {\n $this->signCertificate = 'file://'.str_replace('\\\\', '/', realpath($certificate));\n\n if (null !== $privateKey) {\n if (is_array($privateKey)) {\n $this->signPrivateKey = $privateKey;\n $this->signPrivateKey[0] = 'file://'.str_replace('\\\\', '/', realpath($privateKey[0]));\n } else {\n $this->signPrivateKey = 'file://'.str_replace('\\\\', '/', realpath($privateKey));\n }\n }\n\n $this->signOptions = $signOptions;\n if (null !== $extraCerts) {\n $this->extraCerts = str_replace('\\\\', '/', realpath($extraCerts));\n }\n\n return $this;\n }", "function setCertificate($certificateFilename, $privateKeyFilename) {\n $result = false;\n\n if (is_readable($certificateFilename) && is_readable($privateKeyFilename))\n {\n $certificate=null;\n $handle=fopen($certificateFilename, \"r\");\n $size=filesize($certificateFilename);\n $certificate=fread($handle,$size);\n fclose($handle);\n\n $privateKey=null; \n $handle=fopen($privateKeyFilename,\"r\");\n $size=filesize($privateKeyFilename);\n $privateKey=fread($handle, $size);\n fclose($handle);\n \n \t if (($certificate !== false) && ($privateKey !== false) && openssl_x509_check_private_key($certificate, $privateKey)) {\n\t\t\t $this->certificate = $certificate;\n\t\t\t $this->certificateFile = $certificateFilename;\n\t\t\t $this->privateKey = $privateKey;\n\t\t\t $this->privateKeyFile = $privateKeyFilename;\n\t\t\t $result = true;\n \t }\n }\n\n return $result;\n }", "function setCertId($value)\n {\n $this->_props['CertId'] = $value;\n }", "public function setRootCertificate($val)\n {\n $this->_propDict[\"rootCertificate\"] = $val;\n return $this;\n }", "public function setSslCertificate($cert, $key, $keyPass = '');", "public function setRSACertificate($cert) {}", "function setCertificatePassword($password)\n {\n $this->_certificatePassword = $password;\n }", "public function setIdentityCertificate(?IosCertificateProfileBase $value): void {\n $this->getBackingStore()->set('identityCertificate', $value);\n }", "public function testUpdateCertificate()\n {\n }", "function set_certkey($cert, $key) {\n\t\t// get user and groups from certificate\n\t\t$cn = explode(';', LGIUser::get_cert_cn($cert));\n\t\t$certuser = $certproject = $certgroups = null;\n\t\tif (count($cn)==2) {\n\t\t\t$certuser = $cn[0];\n\t\t\t$certgroups = null;\n\t\t\t$certprojects = explode(',', $cn[1]);\n\t\t} elseif (count($cn)==3) {\n\t\t\t$certuser = $cn[0];\n\t\t\t$certgroups = explode(',', $cn[1]);\n\t\t\t$certprojects = explode(',', $cn[2]);\n\t\t} else {\n\t\t\tthrow new LGIPortalException(\"Unsupported certificate: need 2 or 3 semicolon-separated fields in CN\");\n\t\t}\n\t\t// update or insert key/certificate\n\t\t$query = \"%t(usercerts) SET `cert`='%%', `key`='%%', `username`='%%', `fixedgroups`='%%', `user`='%%'\";\n\t\t$result = lgi_mysql_query(\"SELECT `id` FROM %t(usercerts) WHERE cert='%%' AND `key`='%%' AND `user`='%%'\", $cert, $key, $this->userid);\n\t\tif ($result && mysql_num_rows($result)>0) {\n\t\t\t// already exists: update\n\t\t\t$usercertid = mysql_fetch_row($result);\n\t\t\t$usercertid = $usercertid[0];\n\t\t\tlgi_mysql_query(\"UPDATE $query WHERE `id`='%%'\", $cert, $key, $certuser, !is_null($certgroups), $this->userid, $usercertid);\n\t\t// new row: add it instead\n\t\t} else {\n\t\t\tlgi_mysql_query(\"INSERT INTO $query\", $cert, $key, $certuser, !is_null($certgroups), $this->userid);\n\t\t\t$usercertid = mysql_insert_id();\n\t\t}\n\t\t// create groups\n\t\tif ($certgroups!==null) {\n\t\t\t// only the user's own group + the ones specified\n\t\t\tlgi_mysql_query(\"DELETE FROM %t(usergroups) WHERE `usercertid`='%%'\", $usercertid);\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $this->userid);\n\t\t\tforeach ($certgroups as $g)\n\t\t\t\tlgi_mysql_query(\"INSERT INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $g);\n\t\t} else {\n\t\t\t// when any group can be chosen, pre-fill database with admin\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $this->userid);\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='admin'\", $usercertid);\n\t\t}\n\t\t// and projects\n\t\tlgi_mysql_query(\"DELETE FROM %t(userprojects) WHERE `usercertid`='%%'\", $usercertid);\n\t\tforeach($certprojects as $p)\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(userprojects) SET `usercertid`='%%', `name`='%%'\", $usercertid, $p);\n\t}", "public function setCACert(?string $cacert): void\n {\n }", "public function sslcert($value): self\n {\n $this->sslcert = $value;\n \n return $this;\n }", "public static function createFromDiscriminatorValue(ParseNode $parseNode): SslCertificate {\n return new SslCertificate();\n }", "public function setEncryptCertificate($recipientCerts, $cipher = null)\n {\n if (is_array($recipientCerts)) {\n $this->encryptCert = array();\n\n foreach ($recipientCerts as $cert) {\n $this->encryptCert[] = 'file://'.str_replace('\\\\', '/', realpath($cert));\n }\n } else {\n $this->encryptCert = 'file://'.str_replace('\\\\', '/', realpath($recipientCerts));\n }\n\n if (null !== $cipher) {\n $this->encryptCipher = $cipher;\n }\n\n return $this;\n }", "public function setSubject(?SslCertificateEntity $value): void {\n $this->getBackingStore()->set('subject', $value);\n }", "public function setOtherCertificate(array $otherCertificate)\n {\n $this->otherCertificate = $otherCertificate;\n return $this;\n }", "public function setRootCertificate(?AndroidWorkProfileTrustedRootCertificate $value): void {\n $this->getBackingStore()->set('rootCertificate', $value);\n }", "function setPayPalCertificate($fileName) {\n if (is_readable($fileName)) {\n $handle=null;\n $certificate=null;\n $size=null;\n \n $handle=fopen($fileName, \"r\");\n if (!$handle){\n echo 'Paypal cert could not be opened';\n }\n $size=filesize($fileName);\n \n $certificate=fread($handle, $size);\n if (!$certificate){\n echo 'Paypal cert could not be read';\n }\n fclose($handle);\n\n \t if ($certificate !== false) {\n\t\t\t $this->paypalCertificate = $certificate;\n\t\t\t $this->paypalCertificateFile = $fileName;\n\t\t\t return true;\n \t }\n }\n return false;\n }", "public function setCACertificate(FilePathInterface $caCertificate): self\n {\n $this->caCertificate = $caCertificate;\n\n return $this;\n }", "public static function set_certificate_path($path)\n {\n }", "public function setPayPalCertificate($fileName)\n {\n if (is_readable($fileName))\n {\n $certificate = openssl_x509_read(file_get_contents($fileName));\n\n if ($certificate !== FALSE)\n {\n $this->paypalCertificate = $certificate;\n $this->paypalCertificateFile = $fileName;\n\n return TRUE;\n }\n }\n\n return FALSE;\n }", "public function setSigningCertificate(array $signingCertificate)\n {\n $this->signingCertificate = $signingCertificate;\n return $this;\n }" ]
[ "0.6935556", "0.64903575", "0.646597", "0.63652754", "0.63652754", "0.62945867", "0.6152357", "0.5983352", "0.5903213", "0.5896832", "0.5848124", "0.5817035", "0.5739999", "0.56965905", "0.5607194", "0.55353594", "0.5526638", "0.5492469", "0.54794234", "0.53952926", "0.5355948", "0.53196603", "0.52992785", "0.52883315", "0.52545136", "0.5252728", "0.5236634", "0.51827765", "0.51745987", "0.5144" ]
0.6709507
1
Sets a new otherCertificate
public function setOtherCertificate(array $otherCertificate) { $this->otherCertificate = $otherCertificate; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCertificate($val)\n {\n $this->_propDict[\"certificate\"] = $val;\n return $this;\n }", "public function testUpdateCertificate()\n {\n }", "function setCertificateID($id) {\n $this->certificateID = $id;\n }", "function setCertificatePassword($password)\n {\n $this->_certificatePassword = $password;\n }", "function setCertificateFile($filename)\n {\n $this->_certificateFile = $filename;\n }", "function setCertId($value)\n {\n $this->_props['CertId'] = $value;\n }", "public function setCert(?string $cert): void\n {\n }", "public function setSslCertificate($cert, $key, $keyPass = '');", "function setCertificate($certificateFilename, $privateKeyFilename) {\n $result = false;\n\n if (is_readable($certificateFilename) && is_readable($privateKeyFilename))\n {\n $certificate=null;\n $handle=fopen($certificateFilename, \"r\");\n $size=filesize($certificateFilename);\n $certificate=fread($handle,$size);\n fclose($handle);\n\n $privateKey=null; \n $handle=fopen($privateKeyFilename,\"r\");\n $size=filesize($privateKeyFilename);\n $privateKey=fread($handle, $size);\n fclose($handle);\n \n \t if (($certificate !== false) && ($privateKey !== false) && openssl_x509_check_private_key($certificate, $privateKey)) {\n\t\t\t $this->certificate = $certificate;\n\t\t\t $this->certificateFile = $certificateFilename;\n\t\t\t $this->privateKey = $privateKey;\n\t\t\t $this->privateKeyFile = $privateKeyFilename;\n\t\t\t $result = true;\n \t }\n }\n\n return $result;\n }", "public function setSubject(?SslCertificateEntity $value): void {\n $this->getBackingStore()->set('subject', $value);\n }", "public function setOther($other)\n {\n if (is_string($other)) {\n htmlspecialchars($other);\n $this->_other = $other;\n }\n }", "public function setIdentityCertificate(?IosCertificateProfileBase $value): void {\n $this->getBackingStore()->set('identityCertificate', $value);\n }", "public function setCertificate(array $certificate)\n {\n $this->certificate = $certificate;\n return $this;\n }", "public function setIssuer(?SslCertificateEntity $value): void {\n $this->getBackingStore()->set('issuer', $value);\n }", "public function setCertificate(?Certificate $certificate): static\n {\n $this->certificate = $certificate;\n return $this;\n }", "public function setCertificate(string $certificate): self\n {\n $this->options['certificate'] = $certificate;\n return $this;\n }", "public function setCertificate(string $certificate): self\n {\n $this->options['certificate'] = $certificate;\n return $this;\n }", "public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null)\n {\n $this->signCertificate = 'file://'.str_replace('\\\\', '/', realpath($certificate));\n\n if (null !== $privateKey) {\n if (is_array($privateKey)) {\n $this->signPrivateKey = $privateKey;\n $this->signPrivateKey[0] = 'file://'.str_replace('\\\\', '/', realpath($privateKey[0]));\n } else {\n $this->signPrivateKey = 'file://'.str_replace('\\\\', '/', realpath($privateKey));\n }\n }\n\n $this->signOptions = $signOptions;\n if (null !== $extraCerts) {\n $this->extraCerts = str_replace('\\\\', '/', realpath($extraCerts));\n }\n\n return $this;\n }", "public function setRootCertificate(?AndroidWorkProfileTrustedRootCertificate $value): void {\n $this->getBackingStore()->set('rootCertificate', $value);\n }", "public static function set_certificate_path($path)\n {\n }", "function set_certkey($cert, $key) {\n\t\t// get user and groups from certificate\n\t\t$cn = explode(';', LGIUser::get_cert_cn($cert));\n\t\t$certuser = $certproject = $certgroups = null;\n\t\tif (count($cn)==2) {\n\t\t\t$certuser = $cn[0];\n\t\t\t$certgroups = null;\n\t\t\t$certprojects = explode(',', $cn[1]);\n\t\t} elseif (count($cn)==3) {\n\t\t\t$certuser = $cn[0];\n\t\t\t$certgroups = explode(',', $cn[1]);\n\t\t\t$certprojects = explode(',', $cn[2]);\n\t\t} else {\n\t\t\tthrow new LGIPortalException(\"Unsupported certificate: need 2 or 3 semicolon-separated fields in CN\");\n\t\t}\n\t\t// update or insert key/certificate\n\t\t$query = \"%t(usercerts) SET `cert`='%%', `key`='%%', `username`='%%', `fixedgroups`='%%', `user`='%%'\";\n\t\t$result = lgi_mysql_query(\"SELECT `id` FROM %t(usercerts) WHERE cert='%%' AND `key`='%%' AND `user`='%%'\", $cert, $key, $this->userid);\n\t\tif ($result && mysql_num_rows($result)>0) {\n\t\t\t// already exists: update\n\t\t\t$usercertid = mysql_fetch_row($result);\n\t\t\t$usercertid = $usercertid[0];\n\t\t\tlgi_mysql_query(\"UPDATE $query WHERE `id`='%%'\", $cert, $key, $certuser, !is_null($certgroups), $this->userid, $usercertid);\n\t\t// new row: add it instead\n\t\t} else {\n\t\t\tlgi_mysql_query(\"INSERT INTO $query\", $cert, $key, $certuser, !is_null($certgroups), $this->userid);\n\t\t\t$usercertid = mysql_insert_id();\n\t\t}\n\t\t// create groups\n\t\tif ($certgroups!==null) {\n\t\t\t// only the user's own group + the ones specified\n\t\t\tlgi_mysql_query(\"DELETE FROM %t(usergroups) WHERE `usercertid`='%%'\", $usercertid);\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $this->userid);\n\t\t\tforeach ($certgroups as $g)\n\t\t\t\tlgi_mysql_query(\"INSERT INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $g);\n\t\t} else {\n\t\t\t// when any group can be chosen, pre-fill database with admin\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='%%'\", $usercertid, $this->userid);\n\t\t\tlgi_mysql_query(\"INSERT IGNORE INTO %t(usergroups) SET `usercertid`='%%', `name`='admin'\", $usercertid);\n\t\t}\n\t\t// and projects\n\t\tlgi_mysql_query(\"DELETE FROM %t(userprojects) WHERE `usercertid`='%%'\", $usercertid);\n\t\tforeach($certprojects as $p)\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(userprojects) SET `usercertid`='%%', `name`='%%'\", $usercertid, $p);\n\t}", "public function setCertificateIssuer(?string $value): void {\n $this->getBackingStore()->set('certificateIssuer', $value);\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.security.sslCertificate');\n }", "public function setRootCertificate($val)\n {\n $this->_propDict[\"rootCertificate\"] = $val;\n return $this;\n }", "public function setRSACertificate($cert) {}", "public function setCertificateEnhancedKeyUsage(?string $value): void {\n $this->getBackingStore()->set('certificateEnhancedKeyUsage', $value);\n }", "public function setEncryptCertificate($recipientCerts, $cipher = null)\n {\n if (is_array($recipientCerts)) {\n $this->encryptCert = array();\n\n foreach ($recipientCerts as $cert) {\n $this->encryptCert[] = 'file://'.str_replace('\\\\', '/', realpath($cert));\n }\n } else {\n $this->encryptCert = 'file://'.str_replace('\\\\', '/', realpath($recipientCerts));\n }\n\n if (null !== $cipher) {\n $this->encryptCipher = $cipher;\n }\n\n return $this;\n }", "public function sslcert($value): self\n {\n $this->sslcert = $value;\n \n return $this;\n }", "function setPayPalCertificate($fileName) {\n if (is_readable($fileName)) {\n $handle=null;\n $certificate=null;\n $size=null;\n \n $handle=fopen($fileName, \"r\");\n if (!$handle){\n echo 'Paypal cert could not be opened';\n }\n $size=filesize($fileName);\n \n $certificate=fread($handle, $size);\n if (!$certificate){\n echo 'Paypal cert could not be read';\n }\n fclose($handle);\n\n \t if ($certificate !== false) {\n\t\t\t $this->paypalCertificate = $certificate;\n\t\t\t $this->paypalCertificateFile = $fileName;\n\t\t\t return true;\n \t }\n }\n return false;\n }", "public function other($other) \n {\n if ($other === null) {\n throw new DataSetException(\"null not allowed for other clause\");\n } \n $this->other = $other;\n return $this;\n }" ]
[ "0.6442554", "0.6081556", "0.58484876", "0.5844857", "0.57556254", "0.57211185", "0.55608356", "0.55008894", "0.5461199", "0.54429686", "0.5420772", "0.5417981", "0.53751665", "0.52398384", "0.52111876", "0.52045345", "0.52045345", "0.5054363", "0.5041309", "0.5011718", "0.49937233", "0.4978777", "0.49714175", "0.4967963", "0.49356517", "0.4897852", "0.48955396", "0.48908764", "0.48715508", "0.4797825" ]
0.74124104
0
Display a listing of the QcTipoEqualizacaoTecnica.
public function index(QcTipoEqualizacaoTecnicaDataTable $qcTipoEqualizacaoTecnicaDataTable) { return $qcTipoEqualizacaoTecnicaDataTable->render('qc_tipo_equalizacao_tecnicas.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showItems() {\n global $DB;\n\n $budgets_id = $this->fields['id'];\n\n if (!$this->can($budgets_id, READ)) {\n return false;\n }\n\n $iterator = $DB->request([\n 'SELECT' => 'itemtype',\n 'DISTINCT' => true,\n 'FROM' => 'glpi_infocoms',\n 'WHERE' => [\n 'budgets_id' => $budgets_id,\n 'NOT' => ['itemtype' => ['ConsumableItem', 'CartridgeItem', 'Software']]\n ],\n 'ORDER' => 'itemtype'\n ]);\n\n $number = count($iterator);\n\n echo \"<div class='spaced'><table class='tab_cadre_fixe'>\";\n echo \"<tr><th colspan='2'>\";\n Html::printPagerForm();\n echo \"</th><th colspan='4'>\";\n if ($number == 0) {\n echo __('No associated item');\n } else {\n echo _n('Associated item', 'Associated items', $number);\n }\n echo \"</th></tr>\";\n\n echo \"<tr><th>\".__('Type').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Serial number').\"</th>\";\n echo \"<th>\".__('Inventory number').\"</th>\";\n echo \"<th>\"._x('price', 'Value').\"</th>\";\n echo \"</tr>\";\n\n $num = 0;\n $itemtypes = [];\n while ($row = $iterator->next()) {\n $itemtypes[] = $row['itemtype'];\n }\n $itemtypes[] = 'Contract';\n $itemtypes[] = 'Ticket';\n $itemtypes[] = 'Problem';\n $itemtypes[] = 'Change';\n $itemtypes[] = 'Project';\n\n foreach ($itemtypes as $itemtype) {\n if (!($item = getItemForItemtype($itemtype))) {\n continue;\n }\n\n if ($item->canView()) {\n switch ($itemtype) {\n\n case 'Contract' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_contractcosts.cost AS value'\n ],\n 'FROM' => 'glpi_contractcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_contractcosts' => 'contracts_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_contractcosts.budgets_id' => $budgets_id,\n $item->getTable() . '.is_template' => 0\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Ticket' :\n case 'Problem' :\n case 'Change' :\n $costtable = getTableForItemType($item->getType().'Cost');\n\n $sum = new QueryExpression(\n \"SUM(\" . $DB->quoteName(\"$costtable.actiontime\") . \" * \" . $DB->quoteName(\"$costtable.cost_time\") . \"/\".HOUR_TIMESTAMP.\"\n + \" . $DB->quoteName(\"$costtable.cost_fixed\") . \"\n + \" . $DB->quoteName(\"$costtable.cost_material\") . \") AS \" . $DB->quoteName('value')\n );\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n $sum\n ],\n 'FROM' => $costtable,\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n $costtable => $item->getForeignKeyField()\n ]\n ]\n ],\n 'WHERE' => [\n $costtable . '.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Project' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_projectcosts.cost AS value'\n ],\n 'FROM' => 'glpi_projectcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_projectcosts' => 'projects_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_projectcosts.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Cartridge' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_cartridgeitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_cartridgeitems' => [\n 'ON' => [\n $item->getTable() => 'cartridgeitems_id',\n 'glpi_cartridgeitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n case 'Consumable' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_consumableitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_consumableitems' => [\n 'ON' => [\n $item->getTable() => 'consumableitems_id',\n 'glpi_consumableitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n default:\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_infocoms.value',\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n $item->getTable() . '.entities_id'\n ]\n ];\n if ($item->maybeTemplate()) {\n $criteria['WHERE'][$item->getTable() . '.is_template'] = 0;\n }\n\n if ($item instanceof Item_Devices) {\n $criteria['ORDERBY'][] = $item->getTable() .'.itemtype';\n } else {\n $criteria['ORDERBY'][] = $item->getTable() . '.name';\n }\n break;\n }\n\n $iterator = $DB->request($criteria);\n $nb = count($iterator);\n if ($nb > $_SESSION['glpilist_limit']) {\n echo \"<tr class='tab_bg_1'>\";\n $name = $item->getTypeName($nb);\n //TRANS: %1$s is a name, %2$s is a number\n echo \"<td class='center'>\".sprintf(__('%1$s: %2$s'), $name, $nb).\"</td>\";\n echo \"<td class='center' colspan='2'>\";\n\n $opt = ['order' => 'ASC',\n 'is_deleted' => 0,\n 'reset' => 'reset',\n 'start' => 0,\n 'sort' => 80,\n 'criteria' => [0 => ['value' => '$$$$'.$budgets_id,\n 'searchtype' => 'contains',\n 'field' => 50]]];\n\n echo \"<a href='\". $item->getSearchURL() . \"?\" .Toolbox::append_params($opt). \"'>\".\n __('Device list').\"</a></td>\";\n echo \"<td class='center'>-</td><td class='center'>-</td><td class='center'>-\".\n \"</td></tr>\";\n\n } else if ($nb) {\n for ($prem=true; $data = $iterator->next(); $prem=false) {\n $name = NOT_AVAILABLE;\n if ($item->getFromDB($data[\"id\"])) {\n if ($item instanceof Item_Devices) {\n $tmpitem = new $item::$itemtype_2();\n if ($tmpitem->getFromDB($data[$item::$items_id_2])) {\n $name = $tmpitem->getLink(['additional' => true]);\n }\n } else {\n $name = $item->getLink(['additional' => true]);\n }\n }\n echo \"<tr class='tab_bg_1'>\";\n if ($prem) {\n $typename = $item->getTypeName($nb);\n echo \"<td class='center top' rowspan='$nb'>\".\n ($nb>1 ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename).\"</td>\";\n }\n echo \"<td class='center'>\".Dropdown::getDropdownName(\"glpi_entities\",\n $data[\"entities_id\"]);\n echo \"</td><td class='center\";\n echo (isset($data['is_deleted']) && $data['is_deleted'] ? \" tab_bg_2_2'\" : \"'\");\n echo \">\".$name.\"</td>\";\n echo \"<td class='center'>\".(isset($data[\"serial\"])? \"\".$data[\"serial\"].\"\" :\"-\");\n echo \"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"otherserial\"])? \"\".$data[\"otherserial\"].\"\" :\"-\").\"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"value\"]) ? \"\".Html::formatNumber($data[\"value\"], true).\"\"\n :\"-\");\n\n echo \"</td></tr>\";\n }\n }\n $num += $nb;\n }\n }\n\n if ($num>0) {\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td class='center b'>\".sprintf(__('%1$s = %2$s'), __('Total'), $num).\"</td>\";\n echo \"<td colspan='5'>&nbsp;</td></tr> \";\n }\n echo \"</table></div>\";\n }", "public function actionIndex()\n {\n $model = new Financeiro();\n $searchModel = new FinanceiroSearch(['tipo' => 1]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getEquipes() {\n \t$view =\"\";\n $listeEquipe = Array();\n foreach ($this->equipe->getAll() as $eq) {\n $view .= \"<li><a href='index.php?equipe/\".$eq->getEquipeId().\"'>\".$eq->getEquipeNom().\"</a></li>\";\n }\n \n \treturn $view;\n }", "public function Index() {\n\t\t\t$Plantilla = new NeuralPlantillasTwig('Tienda');\n\t\t\t$Plantilla->Parametro('Consulta', $this->Modelo->Listado());\n\t\t\t$Plantilla->Filtro('HexASCII', function ($Parametro) { return AppHexAsciiHex::ASCII_HEX($Parametro); });\n\t\t\techo $Plantilla->MostrarPlantilla('Proveedor/Listado.html');\n\t\t}", "public function listarC(){\n $colegios = Colegios::orderBy('id','ASC')->where('id','>','1')->paginate(10);\n return view('Administrador.views.colegios')->with('colegios',$colegios);\n }", "public function index()\n {\n\n $esps_types = EspecializacionTipo::where(\"deleted\", '=', 0)->orderBy('id', 'desc')->get();\n return view('especializacion_tipo.index', array('esps_types' => $esps_types));\n\n }", "public function actionIndex()\n {\n $searchModel = new StoreTypeCarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $parents = StoreTypeCar::find()->select('parent_id')->orderBy('parent_id')->groupBy('parent_id')->all();\n\n $parent_filter = [];\n if(!empty($parents)) {\n foreach ($parents as $parent) {\n if($parent->parent_id != '') $parent_filter[$parent->parent->id] = $parent->parent->translate->name;\n }\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'parent_filter' => $parent_filter,\n ]);\n }", "public function index()\n {\n $baseTCs = BaseTestCenter::paginate(10);\n\n return view('baseTCFolder/baseTC')->with(compact('baseTCs'));//->with($APP_URL);\n }", "public function actionIndex()\n {\n $searchModel = new ConvocatoriaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listeEpciAction(){\n $this->denyAccessUnlessGranted('ROLE_ADMIN', 'Vous n\\'avez pas accès à cette page' );\n $em = $this->getDoctrine()->getManager();\n\n $listeEpci = $em->getRepository('LSIMarketBundle:Epci')->findAllEpci();\n //dump($listeEpci);\n\n return $this->render('@LSIMarket/admin/gestion_epci/liste_epci.html.twig', array('listeepci' => $listeEpci));\n }", "public function show($tipo_producto)\n {\n \n }", "public function actionIndex()\n {\n $searchModel = new TaPeriodeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex() {\n $searchModel = new TabEnderecoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $this->titulo = 'Gerenciar Endereco';\n $this->subTitulo = '';\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index() {\n \t$types = TipoTransparencia::all();\n \treturn $types;\n }", "public function show(TipoProductos $tipoProductos)\n {\n //\n }", "public function actionIndex()\n {\n $searchModel = new DetallecarritoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listar(){\n $equipamento = new Equipamento();\n // Recuperar dados\n $lista = $equipamento->getEquipamentos();\n // Manipular dados\n // . . .\n\n // Substituindo numero da manutencao pelo tipo dela.\n // foreach ($lista as $key => $value) {\n // $lista[$key]['tipo'] = $value['tipo'] == 1 ? 'Preventiva' : ($value['tipo'] == 2 ? 'Corretiva' : 'Urgente');\n // }\n\n // Invocar/retornar os dados para view.\n include 'view/admin/lista.php';\n }", "public function actionIndex()\n {\n $searchModel = new TabContatoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t$this->titulo = 'Gerenciar Contato';\n\t\t$this->subTitulo = '';\n\t\t\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n\n\n\n $escuelas = Escuela::paginate();\n\n $circuitos = Circuito::pluck('nombre', 'idcircuitos')->prepend('Seleccionar ', ''); // creating list;\n\n return view('admin.escuelas.index', compact('escuelas', 'circuitos'));\n\n }", "public function actionIndex()\n {\n $searchModel = new TPeriodeKriteriaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function tiempo()\n { \n \n $contratos = Contrato::where(\"estado\",\"=\",1)->select(\"id\",\"feterco\")->paginate(10);\n return view ('pig/contratos/tiempo')->with('contratos',$contratos);\n }", "public function index()\n {\n $contatos = FaleConosco::orderByDesc('created_at')->paginate();\n\n return view('admin.fale-conosco.index', compact('contatos'));\n }", "public function actionTCIs()\n\t{\n\t\tif (ctype_digit(@$_GET['page'])) $this->page = $_GET['page'];\n\t\t$this->renderPartial('_list',array('operations'=>$this->getTransportList($_GET)));\n\t}", "public function listaTipoTransaccion(){\n $marcas = $this->repoTipoTransaccion->all();\n return view('mantenimiento.compraventa.tipotransaccion.tipotransaccion', compact('marcas'));\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function actionIndex()\n {\n $searchModel = new TinTucSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'const' => $this->const,\n 'categories' => $this->getCategories(),\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new OcorrenciaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(Equipe $equipe)\n {\n //\n }", "public function index()\n {\n //\n $contecos = conteco_ddt38::orderBy('nom_conteco')->paginate(10);\n return view('contecos.index')->with('contecos', $contecos);\n }", "public function index()\n {\n $tipos=Tipo::orderBy('id','ASC')->select('tipos.*')->get();\n return view('Tipos/listTipo',compact('tipos'));\n }" ]
[ "0.61772054", "0.5957543", "0.5868475", "0.5762233", "0.5708826", "0.5707026", "0.57067597", "0.56953543", "0.56462467", "0.5631694", "0.5607885", "0.5602044", "0.55953324", "0.559277", "0.55901164", "0.5589777", "0.55815345", "0.55621845", "0.5551992", "0.55519634", "0.5521991", "0.55181813", "0.55137", "0.55107695", "0.55054694", "0.550073", "0.54974276", "0.5492702", "0.54870355", "0.54783714" ]
0.61112916
1
Show the form for creating a new QcTipoEqualizacaoTecnica.
public function create() { return view('qc_tipo_equalizacao_tecnicas.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(CreateQcTipoEqualizacaoTecnicaRequest $request)\n {\n $input = $request->all();\n\n $qcTipoEqualizacaoTecnica = $this->qcTipoEqualizacaoTecnicaRepository->create($input);\n\n Flash::success('Qc Tipo Equalizacao Tecnica '.trans('common.saved').' '.trans('common.successfully').'.');\n\n return redirect(route('qcTipoEqualizacaoTecnicas.index'));\n }", "public function actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}", "public function create()\n {\n $cmp_id = Session::get('cmp_id');\n $gro_id = Session::get('gro_id');\n $tipos = Productype::getTipoProductos($gro_id);\n if ($gro_id ==1) {\n return view('product.gasolineras.form_create',compact('tipos'));\n }\n if ($gro_id ==2) {\n return view('product.farmacias.form_create',compact('tipos'));\n }\n }", "public function create()\n {\n $this->authorize('CADASTRAR_TABELAS_SISTEMA');\n return view('pages.tipo-entrada.form');\n }", "public function create()\n {\n //\n return view('especializacion_tipo.create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new ConfFa;\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n if($_POST['ConfFa']['NIVEL_PRECIO'] == '')\n $model->NIVEL_PRECIO = NULL; \n \n if($model->save())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function create()\n\t{\n $sociosCombo = $this->sociosRepo->getComboNroLegajo();\n $action = \"Crear\";\n $form_data = array('route' => array('prestamos.store'), 'method' => 'POST', 'id' => 'prestamoForm');\n\t\treturn View::make(\"prestamos.create\",compact(\"sociosCombo\",\"action\",\"form_data\"));\n\t}", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin/tipoproductoCreate');\n }", "public function create()\n {\n return view('cartas.cartaForm');\n }", "public function create()\n {\n return view('produto.form_produto');\n }", "public function create()\n {\n return view('contato.form');\n }", "public function create()\n {\n return view('tipoproducto.create');\n }", "public function create()\n {\n return view('tipo-cuenta.create');\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('criarPi')) {\n\n $model = new Estiloconstrucao();\n\n if ($model->load(Yii::$app->request->post())) {\n $verificaEC = $this->verificaEstiloConstrucao($model);\n if ($verificaEC == true) {\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'Estilo de Construção já registado!');\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n return $this->redirect(['index']);\n }\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n return view('restricoes.add_restricao');\n }", "public function create()\n\t{\n\t\t/*Add select options*/\n\t\t$estados_options \t= $this->estadosRepository->optionList();\n\t\t$clientes_options \t= $this->clientesRepository->optionList();\n\t\t\n\t\t//dd([$this->maquina_options,$this->metodo_options]);\n\t\t\n\t\treturn view('proyectos.create')\n\t\t->with('estado_options', $estados_options)\n\t\t->with('cliente_options', $clientes_options)\n\t\t->with('maquina_options', $this->maquina_options)\n\t\t->with('metodo_options', $this->metodo_options);\n\t}", "public function create()\n {\n return view('jogos.tecnicos.create');\n }", "public function actionCreate()\n {\n $model = new ProvCompras();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $this->layout=\"main\";\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new TabContato();\n\n\t\t$this->titulo = 'Incluir Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n\t\t\t\n return $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('gas_consumo.create');\n }", "public function create()\n {\n $data=$this->getFormData();\n list($specialty, $niv) = $data;\n return view('pages.classe.create',compact('specialty','niv'));\n }", "public function create()\n {return view('familleQuarantaine.create');\n \n }", "public function create()\n {\n return view('form_candidatas', ['acao'=>1]);\n }", "public function create()\n {\n return view('admin.questions.RIASEC.create', compact(''));\n }", "public function create()\n {\n return view('crud.tipos.crear');\n }", "public function actionCreate($tipo)\n {\n $model = new Financeiro();\n\n if ($tipo == 1){\n $model->scenario = 'ContaPagar';\n }else if ($tipo == 2){\n $model->scenario = 'ContaReceber';\n }\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if ($model->scenario == 'ContaPagar'){\n return $this->redirect(['index']);\n }else{\n return $this->redirect(['index-receber']);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view('admin.nom.prefcontrtypes.create');\n }", "public function create()\n {\n //return view('conditionform.create');\n }" ]
[ "0.63867724", "0.6321323", "0.6248641", "0.6170369", "0.61597025", "0.61566734", "0.61521035", "0.61520785", "0.6149233", "0.6145191", "0.6131166", "0.6128632", "0.61170894", "0.6116662", "0.60984033", "0.60978085", "0.6090943", "0.6088183", "0.60780376", "0.60660523", "0.606102", "0.60195017", "0.6010684", "0.5994157", "0.5982759", "0.59755784", "0.5974277", "0.5971381", "0.5959268", "0.5958025" ]
0.7429291
0
Store a newly created QcTipoEqualizacaoTecnica in storage.
public function store(CreateQcTipoEqualizacaoTecnicaRequest $request) { $input = $request->all(); $qcTipoEqualizacaoTecnica = $this->qcTipoEqualizacaoTecnicaRepository->create($input); Flash::success('Qc Tipo Equalizacao Tecnica '.trans('common.saved').' '.trans('common.successfully').'.'); return redirect(route('qcTipoEqualizacaoTecnicas.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function store($valutazione)\n {\n $con = FConnectionDB::getIstanza();\n $con->store($valutazione, static::$nomeClasse);\n }", "public function store(Request $request)\n {\n DB::beginTransaction();\n try{\n $tacNuevo = new Tac;\n $tacNuevo->nombre=$request->nombre;\n $tacNuevo->save();\n //Crear una categoria de servicio asociada a los examen\n $categoria_existe = CategoriaServicio::where('nombre','TAC')->first();\n\n if($categoria_existe==null){\n $categoria_existe = new CategoriaServicio;\n $categoria_existe->nombre = \"TAC\";\n $categoria_existe->save();\n }\n\n $servicio = new Servicio;\n $servicio->nombre = $request->nombre;\n $servicio->f_categoria = $categoria_existe->id;\n $servicio->precio = $request->precio;\n $servicio->f_tac = $tacNuevo->id;\n $servicio->save();\n }catch(\\Exception $e){\n DB::rollback();\n return $e;\n return redirect('/tacs')->with('mensaje', $e);\n }\n DB::commit();\n Bitacora::bitacora('store','tacs','tacs',$tacNuevo->id);\n return redirect('/tacs')->with('mensaje', '¡Guardado!');\n }", "public function store(CriacaoQuarto $request)\n {\n $request->validated();\n\n $quarto = new Quarto;\n $quarto->andar = $request->input('andar');\n $quarto->status = strtoupper($request->input('status'));\n $valorDiaria = $request->input('valorDiaria');\n $quarto->valor_diaria = $valorDiaria;\n\n $servicos = $request->input('servico');\n $servicosQuarto = array();\n\n if ($servicos != null && sizeof($servicos) > 0) {\n foreach ($servicos as $srv) {\n $s = Servico::find($srv);\n array_push($servicosQuarto, $s);\n }\n }\n\n try {\n $quarto->save();\n if (sizeof($servicosQuarto) > 0) {\n $quarto->servicos()->saveMany($servicosQuarto);\n }\n return view(VIEW_CREATE, [\n 'message' => 'Quarto salvo com sucesso',\n 'quarto' => $quarto,\n 'error' => false\n ]);\n } catch (\\Throwable $th) {\n echo $th->getMessage();\n return view(VIEW_CREATE, [\n 'error' => true,\n 'message' => 'Ocorreu um erro ao salvar o quarto'\n ]);\n }\n }", "public function store(Request $request)\n {\n\n //return ($request->all());\n //strval($mytime)\n try{\n\n DB::beginTransaction();\n\n $mytime= Carbon::now('America/La_Paz');\n\n $compra = new Compra();\n $compra->f_compra = strval($mytime);// $mytime->toDateString();\n $compra->id_proveedor = $request->id_proveedor==\"Seleccione Proveeedor...\" ? 3 : $request->id_proveedor;\n $compra->id_user = \\Auth::user()->id;\n\n\n $compra->save();\n\n $id_producto=$request->id_producto;\n $cantidad=$request->cantidad;\n $precio=$request->precio_compra;\n\n $pre1 =$request->pre1;\n $pre2 =$request->pre2;\n $pre3 =$request->pre3;\n\n\n\n //Recorro todos los elementos\n $cont=0;\n\n while($cont < count($id_producto)){\n\n $detalle = new DetalleCompra();\n /*enviamos valores a las propiedades del objeto detalle*/\n /*al idcompra del objeto detalle le envio el id del objeto compra, que es el objeto que se ingresó en la tabla compras de la bd*/\n $detalle->precio = $precio[$cont];\n $detalle->cantidad = $cantidad[$cont];\n $detalle->id_compra = $compra->id_compra;\n $detalle->id_producto = $id_producto[$cont];\n $detalle->save();\n\n\n // actualizando Stock en tabla Productos (Almacen)\n $producto=Producto::find($id_producto[$cont]);\n $producto->stock = $producto->stock + $cantidad[$cont];\n $producto->precio_compra = $precio[$cont];\n $producto->pre1 = $pre1[$cont];\n $producto->pre2 = $pre2[$cont];\n $producto->pre3 = $pre3[$cont];\n $producto->save();\n\n // Actualizando Precios en todas las Sucursales pre,pre2,pre3 (opcional)\n //SucursalProducto::where('id_producto','=',$id_producto[$cont])->update(['pre1'=> $pre1[$cont],'pre2'=> $pre2[$cont],'pre3'=> $pre3[$cont]]);\n\n $cont=$cont+1;\n }\n\n DB::commit();\n $message = 'Compra realizado correctamente!!!!';\n\n } catch(Exception $e){\n\n DB::rollBack();\n $message = 'Error al realizar la Compra !!!! ';\n }\n\n // return Redirect::to('compra');\n return redirect('compra')->with( 'message',$message);\n\n }", "public function store(StorePagoTransportistaRequest $request)\n { \n //Transaction\n $array_selected = $request->array_selected;\n $pago = PagoTransportista::create( $request->validated() ); \n $id = $request->transportista_id;\n $transportista = Transportista::findOrFail($id);\n //modificar aquí si descuento pendiente anterior no se cancela completamente\n $transportista->descuento_pendiente = 0;\n $transportista->descuento_pendiente += $request->pendiente_dejado;\n $transportista->save();\n //1ero PAGO A SUS PEDIDOS CLIENTE\n $pedidos_cliente\n = Pedido::join('vehiculos','pedidos.vehiculo_id','=','vehiculos.id')\n ->join('transportistas','transportistas.id','=','vehiculos.transportista_id')\n ->join('pedido_proveedor_clientes','pedido_proveedor_clientes.pedido_id','=','pedidos.id')\n ->join('pedido_clientes','pedido_clientes.id','=','pedido_proveedor_clientes.pedido_cliente_id')\n ->whereNotNull('pedidos.vehiculo_id')\n ->whereIn('pedidos.id',$array_selected)\n //->where('pedidos.estado_flete','=',1)\n ->where('transportistas.id','=',$id) \n ->select('pedido_proveedor_clientes.id','pedidos.id as pedido_id')\n ->get();\n\n foreach ( $pedidos_cliente as $pivote ) {\n $pedido_prov_cliente = PedidoProveedorCliente::findOrFail( $pivote->id );\n $pedido_prov_cliente->timestamps = false;\n $pedido_prov_cliente->pago_transportista_id = $pago->id;\n $pedido_prov_cliente->save();\n //estado flete\n $pedido = Pedido::findOrFail( $pivote->pedido_id );\n $pedido->estado_flete = 2;\n $pedido->save();\n }\n\n //2do PAGO A SUS PEDIDOS GRFIOSS\n $pedidos_grifo = Pedido::join('vehiculos','pedidos.vehiculo_id','=','vehiculos.id')\n ->join('transportistas','transportistas.id','=','vehiculos.transportista_id')\n ->join('pedido_grifos','pedido_grifos.pedido_id','=','pedidos.id')\n ->join('grifos','pedido_grifos.grifo_id','=','grifos.id') \n ->whereNotNull('pedidos.vehiculo_id')\n ->whereIn('pedidos.id',$array_selected)\n //->where('pedidos.estado_flete','=',1)\n ->where('transportistas.id','=',$id) \n ->select('pedido_grifos.id','pedidos.id as pedido_id')\n ->get();\n foreach ($pedidos_grifo as $pivote) {\n $pedido_prov_grifo = PedidoProveedorGrifo::findOrFail($pivote->id);\n $pedido_prov_grifo->timestamps = false;\n $pedido_prov_grifo->pago_transportista_id = $pago->id;\n $pedido_prov_grifo->save();\n $pedido = Pedido::findOrFail( $pivote->pedido_id );\n $pedido->estado_flete = 2;\n $pedido->save();\n }\n\n return \n redirect()->route('pago_transportistas.index')->with('alert-type','success')->with('status','Pago Realizado con éxito');\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'quantidade_estoque'=>'required|numeric'\n ])->validate();\n $e = Estoque::where('produto_estoque_id', $request->produto_estoque_id)->first();\n if(!$e){\n $estoque = new Estoque;\n $estoque->quantidade_estoque = $request->quantidade_estoque;\n $estoque->produto_estoque_id = $request->produto_estoque_id;\n $estoque->save();\n }else{\n if($request->quantidade_estoque == 0){\n $e->quantidade_estoque = $request->quantidade_estoque;\n }\n if($request->quantidade_estoque != 0){\n $e->quantidade_estoque = $e->quantidade_estoque + $request->quantidade_estoque;\n }\n\n $e->save();\n }\n\n\n\n return redirect('/produtos');\n }", "public function store(Request $request)\n {\n $produtos = Produto::all()->where(\"ativo\", \"!=\", 0);\n $dados = new Produto();\n $estoque = new Estoque();\n $dados->nome = ($request->nome) ? $request->nome : null;\n $dados->marca = ($request->marca) ? $request->marca : \"-\";\n $dados->tipo_produto = ($request->tipo_produto) ? $request->tipo_produto : null;\n $dados->observacoes = ($request->observacoes) ? $request->observacoes : \"-\";\n if ($request->nome == null) {\n session()->put(\"info\", \"Insira o nome do produto!\");\n return view(\"produto.create\", [\"dados\" => $dados]);\n }\n if ($request->tipo_produto == null) {\n session()->put(\"info\", \"Selecione o tipo de produto!\");\n return view(\"produto.create\", [\"dados\" => $dados]);\n }\n foreach ($produtos as $produto) {\n if ($produto->nome == $dados->nome && $produto->marca == $dados->marca) {\n if ($produto->tipo_produto == $dados->tipo_produto) {\n session()->put(\"info\", \"Produto já registrado!\");\n return view(\"produto.create\", [\"dados\" => $dados]);\n }\n }\n }\n DB::beginTransaction();\n try {\n $dados->save();\n $estoque->quantidade = 0;\n $estoque->preco = 0;\n $estoque->id_produto = $dados->id;\n $estoque->save();\n DB::commit();\n } catch (\\Throwable $e) {\n DB::rollback();\n $erro = $e->errorInfo[1];\n session()->put(\"info\", \"Erro ao salvar! ($erro)\");\n return view(\"produto.create\", [\"dados\" => $dados]);\n }\n $listaDados = Produto::all()->where(\"ativo\", \"!=\", 0);\n session()->put(\"info\", \"Registro salvo!\");\n return view(\"produto.index\", [\"listaDados\" => $listaDados]);\n }", "public function createTrancheOld()\n {\n $uniqueId = str_replace(\".\",\"\",microtime(true)).rand(000,999);\n\n if($this->type == 1){\n\n TranchesPoidsPc::create([\n 'nom' => $this->minPoids.\" - \".$this->maxPoids,\n 'min_poids' => $this->minPoids,\n 'max_poids' => $this->maxPoids,\n 'uid' => \"PP\".$uniqueId,\n ]);\n\n\n\n }else{\n TranchesKgPc::create([\n 'nom' => $this->nom,\n 'uid' => \"KP\".$uniqueId,\n ]);\n\n }\n session()->flash('message', 'Tranche \"'.$this->nom. '\" a été crée ');\n\n\n\n $this->reset(['nom','minPoids','maxPoids']);\n\n $this->emit('saved');\n }", "public function store(Request $request)\n {\n\n $time = Carbon::now('America/Lima');\n\n try {\n DB::beginTransaction();\n\n $compra = new Compra();\n // $compra->com_fecha = $time;\n $compra->com_hora = $time->toTimeString();\n $compra->com_fecha = $time->toDateString();\n // $compra->com_hora = '11:00:00';\n $compra->com_com = $request->comprobante;\n $compra->com_serie = $request->serie;\n $compra->com_numero = $request->numero;\n $compra->com_moneda = $request->moneda;\n // $compra->com_total = '22.3';\n $compra->com_total = $request->total;\n $compra->com_estado = 1;\n $compra->com_femision = $request->emision;\n $compra->com_fvenci = $request->vencimiento;\n // $compra->users_id = \\Auth::id();\n $compra->users_id = '8';\n $compra->proveedor_idproveedor = $request->provee;\n // $compra->proveedor_idproveedor = '3';\n $compra->save();\n\n $detalles = $request->data;\n\n foreach ($detalles as $ep => $det) {\n $detalle = new Dcompra();\n $detalle ->dc_cantidad = $det['cantidad'];\n $detalle ->dc_precio = $det['precio'];\n $detalle ->dc_lote = $det['lote'];\n $detalle ->dc_fecha = $det['fecha'];\n $detalle ->producto_idproducto = $det['idproducto'];\n $detalle ->compra_idcompra = $compra->idcompra;\n $detalle ->save();\n }\n\n $kardexs = $request->data;\n foreach ($kardexs as $ep => $det) {\n $kardex = new Kardex();\n $kardex ->ka_fecha = $time->toDateString();\n // $kardex ->ka_fecha = $time->toTimeString();\n $kardex ->ka_tipo = 'Compra';\n $kardex ->ka_cantidad = $det['cantidad'];\n $kardex ->producto_idproducto = $det['idproducto'];\n $kardex ->compra_idcompra = $compra->idcompra;\n // $kardex ->compra_idcompra = '55';\n $kardex ->save();\n }\n\n //Mz G Lote 14\n //10702166336\n //Direc: Av. Arias Graziani s/n\n //Minimarket 'Estefania'\n\n DB::commit();\n } catch (\\Exception $e) {\n\n DB::rollBack();\n return ['res' => $detalles];\n }\n }", "public function store(ConvocatoriaRequest $request)\n {\n $id_user = Auth::user()->id;\n $id_encuesta = $request->input('id_encuesta');\n $id_bases = $request->input('id_bases');\n $anio_convocatoria = $request->input('anio_convocatoria');\n $titulo_convocatoria = $request->input('titulo_convocatoria');\n $descripcion_convocatoria = $request->input('descripcion_convocatoria');\n $periodo_convocatoria = $request->input('periodo_convocatoria');\n $plaza_convocatoria = $request->input('plaza_convocatoria');\n $nombre_imagen = $request->input('nombre_imagen');\n if($request->hasFile('nombre_imagen')){\n $nombre_imagen=$request->file('nombre_imagen')->store('uploads\\imagenes','public');\n }\n\n $now = rand(100, 999);\n /* $id_convocatorias = DB::table('convocatorias')->max('id'); */ // Falta codigo de proteccion\n /* $nombre_archivo = $request->input('nombre_archivo'); */\n $archivo = $request->file('archivo_base');\n if($request->hasFile('archivo_base')){\n $nombre_archivo_temporal = $archivo->getClientOriginalName();\n $archivo_base = $archivo->storeAs('uploads/archivos', $now.\"_\".$nombre_archivo_temporal, 'public');\n }\n\n $archivo_op = $request->file('archivo_opcional');\n if($request->hasFile('archivo_opcional')){\n $nombre_archivo_temporalOP = $archivo_op->getClientOriginalName();\n $archivo_opcional = $archivo_op->storeAs('uploads/archivos_op', $now.\"_\".$nombre_archivo_temporalOP, 'public');\n }\n\n\n\n $fecha_inicioP = $request->input('fecha_inicio');\n $fecha_inicio = Carbon::createFromFormat(\"Y-m-d H:i:s\", $fecha_inicioP);\n $fecha_finP = $request->input('fecha_fin');\n $fecha_fin = Carbon::createFromFormat(\"Y-m-d H:i:s\", $fecha_finP);\n\n DB::table('convocatorias')->insert([\n [\n 'id_user' =>$id_user,\n 'id_encuesta' =>$id_encuesta,\n 'id_bases' =>$id_bases,\n 'anio_convocatoria' =>$anio_convocatoria,\n 'titulo_convocatoria' =>$titulo_convocatoria,\n 'descripcion_convocatoria' =>$descripcion_convocatoria,\n 'periodo_convocatoria' =>$periodo_convocatoria,\n 'plaza_convocatoria' =>$plaza_convocatoria,\n 'nombre_imagen' =>$nombre_imagen,\n 'archivo_base' =>$archivo_base,\n /* 'archivo_opcional' =>$archivo_opcional, */\n 'fecha_inicio' =>$fecha_inicio,\n 'fecha_fin' =>$fecha_fin,\n ]\n ]);\n\n/* $now = rand(100, 999);\n $id_convocatorias = DB::table('convocatorias')->max('id'); // Falta codigo de proteccion\n $nombre_archivo = $request->input('nombre_archivo');\n $archivos = $request->file('archivo_bases');\n\n for($i = 0; $i<count($archivos); $i++){\n foreach($archivos as $archivo){\n $nombre_archivo_temporal = $archivo->getClientOriginalName();\n $archivo_base = $archivo->storeAs('uploads/archivos', $now.\"_\".$nombre_archivo_temporal);\n\n $id_convocatorias = $id_convocatorias;\n $id_nombre_archivo = $nombre_archivo[$i];\n $id_archivo_base = $archivo_base;\n DB::table('archivo_convocatorias')->insert([\n ['id_convocatorias'=>$id_convocatorias,'nombre_archivo'=>$id_nombre_archivo,'archivo_base'=>$id_archivo_base]\n ]);\n }\n } */\n\n\n\n\n\n\n\n/*\n $now = time();\n $id_convocatorias = DB::table('convocatorias')->max('id'); // Falta codigo de proteccion\n $nombre_archivo = $request->input('nombre_archivo');\n\n $destinationPath = 'storage\\uploads\\archivos';\n\n foreach($files as $file) {\n $filename = $now.\"_\".$file->getClientOriginalName();\n $fileupload = $file->store($destinationPath, $filename);\n }\n\n for($i = 0; $i<count($files); $i++){\n $id_convocatorias = $id_convocatorias;\n $id_nombre_archivo = $nombre_archivo[$i];\n $id_archivo_base = $fileupload[$i];\n DB::table('archivo_convocatorias')->insert([['id_convocatorias'=>$id_convocatorias,'nombre_archivo'=>$id_nombre_archivo,'archivo_base'=>$id_archivo_base]]);\n }\n */\n\n\n\n/*\n $now = time();\n $id_convocatorias = DB::table('convocatorias')->max('id'); // Falta codigo de proteccion\n $nombre_archivo = $request->input('nombre_archivo');\n $files = $request->file('archivo_bases');\n $destinationPath = 'storage\\uploads\\archivos';\n foreach($files as $file) {\n $filename = $now.\"_\".$file->getClientOriginalName();\n $fileupload = $file->move($destinationPath, $filename);\n } */\n\n\n\n\n /* if(is_array($fileupload)){\n for($i = 0; $i<count($fileupload); $i++){\n $id_convocatorias = $id_convocatorias;\n $id_nombre_archivo = $nombre_archivo[$i];\n $id_archivo_base = $fileupload[$i];\n DB::table('archivo_convocatorias')->insert([\n ['id_convocatorias'=>$id_convocatorias,'nombre_archivo'=>$id_nombre_archivo,'archivo_base'=>$id_archivo_base]\n ]);\n }\n }else{\n return redirect(action('ConvocatoriaController@index'))->with('status', 'No se pudo guardar arhivos');\n } */\n\n\n /* dd($archivo_bases); */\n /* foreach($request->archivo_bases as $archivo_base){\n $archivo_bases = $archivo_bases->file('archivo_base')->store('uploads\\archivos', 'public');\n } */\n\n\n /* foreach($request->archivo_base as $file) {\n $filename = $file->store('library');\n }\n if($request->hasFile('archivo_base')){\n $archivo_base=$request->file('archivo_base')->store('uploads\\archivos', 'public');\n } */\n\n\n\n // $data['id_user']= \\Auth::user()->id;\n/* $data = request()->except('_token');\n if($request->hasFile('nombre_imagen')){\n $data['nombre_imagen']=$request->file('nombre_imagen')->store('uploads\\imagenes','public');\n }\n if($request->hasFile('nombre_archivo_uno')){\n $data['nombre_archivo_uno']=$request->file('nombre_archivo_uno')->store('uploads\\archivos', 'public');\n }\n if($request->hasFile('nombre_archivo_dos')){\n $data['nombre_archivo_dos']=$request->file('nombre_archivo_dos')->store('uploads\\archivos', 'public');\n }\n if($request->hasFile('nombre_archivo_tres')){\n $data['nombre_archivo_tres']=$request->file('nombre_archivo_tres')->store('uploads\\archivos', 'public');\n } */\n /*dd($data); */\n /* Convocatoria::insert($data); */\n return redirect(action('ConvocatoriaController@index'))->with('status', 'Convocatoria creada éxitosamente');\n }", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $this->Name = $db->escapeString( $this->Name );\r\n $this->Sign = $db->escapeString( $this->Sign );\r\n\r\n if ( $this->Value == \"\" )\r\n {\r\n $this->Value = 1;\r\n }\r\n \r\n if ( !isset( $this->ID ) )\r\n {\r\n $timeStamp =& eZDateTime::timeStamp( true );\r\n $db->lock( \"eZTrade_AlternativeCurrency\" );\r\n $nextID = $db->nextID( \"eZTrade_AlternativeCurrency\", \"ID\" );\r\n \r\n $res[] = $db->query( \"INSERT INTO eZTrade_AlternativeCurrency\r\n ( ID,\r\n\t\t Name,\r\n\t\t Sign,\r\n\t\t Value,\r\n\t\t Created,\r\n\t\t PrefixSign )\r\n VALUES\r\n\t\t ( '$nextID',\r\n '$this->Name',\r\n\t\t '$this->Sign',\r\n\t\t '$this->Value',\r\n\t\t '$timeStamp',\r\n\t\t '$this->PrefixSign' )\" );\r\n $db->unlock();\r\n\t\t\t$this->ID = $nextID;\r\n }\r\n else\r\n {\r\n $res[] = $db->query( \"UPDATE eZTrade_AlternativeCurrency SET\r\n\t\t Name='$this->Name',\r\n\t\t Sign='$this->Sign',\r\n\t\t Value='$this->Value',\r\n\t\t Created=Created,\r\n\t\t PrefixSign='$this->PrefixSign'\r\n WHERE ID='$this->ID'\" );\r\n }\r\n\r\n eZDB::finish( $res, $db );\r\n return true;\r\n }", "public function store() {\n \n }", "public function store()\n\t{\n\t\t$fbf_historico_atleta_cameponato = new FbfHistoricoAtletaCameponato;\n\t\t$fbf_historico_atleta_cameponato->idcampeonato = Input::get('idcampeonato');\n$fbf_historico_atleta_cameponato->idatleta = Input::get('idatleta');\n$fbf_historico_atleta_cameponato->idtime = Input::get('idtime');\n$fbf_historico_atleta_cameponato->classificacao = Input::get('classificacao');\n$fbf_historico_atleta_cameponato->jogos = Input::get('jogos');\n$fbf_historico_atleta_cameponato->gols = Input::get('gols');\n\n\t\t$fbf_historico_atleta_cameponato->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Registro cadastrado com sucesso!');\n\t\treturn Redirect::to('fbf_historico_atleta_cameponato');\n\t}", "public function store(request $request) { \n \t//\n\n \t $trab = \\App\\producto::find($request['cargar']);\n $total=$trab->existencia-$request['telefono'];\n if($total>=0)\n {\n $trab->existencia = $trab->existencia-$request['telefono'];\n $trab->save();\n \\App\\tempoventa::create([\n \t\t//modelo \t\t\t//la vista create\n \n 'cantidad' => $request['telefono'],\n 'idProducto' => $request['cargar'],\n 'precio' => $request['preUnitario'],\n \n \n ]);\n\n return redirect('ventas/create')->with('message','create');\n }\n else{\n return redirect('ventas/create')->with('message','stock');\n }\n}", "public function store()\n\t {\n\t //\n\t }", "public function store(CreateContratoRequest $request)\n {\n //return $request->all();\n $listacontratos = \\App\\Contrato::create( $request->all() );\n\n //$listacontratos->tipoDeContrato()->create([$listacontratos]);\n // $listacontratos-> tipoDeContrato()->save($listacontratos);\n \n \n //$listacontratos->tipoDeContrato()->associate($listacontratos);\n //$listacontratos->save();\n \n\n\n // DB::table('contrato') -> insert([\n\n // \"Jornada\" => $request->input('Jornada'),\n //\"PeriodoDePrueva\" => $request->input('PeriodoDePrueva'),\n // \"Salario\" => $request->input('Salario'),\n // \"FechaInicio\" => $request->input('FechaInicio'),\n // \"id_tipoDeContrato\" => $request->input('id_tipoDeContrato'),\n // \"id_cargo\" => $request->input('id_cargo'),\n // \"id_empleado\" => $request->input('id_empleado'),\n // \"id_empresa\" => $request->input('id_empresa'),\n // ]);\n\n\n //return redirect()->route('contratos.index');\n return redirect()->route('contratos.index', compact('listacontratos'))->with('infoContratoCreate','Contrato Creado');\n\n }", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $ret = false;\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n if ( !isSet( $this->ID ) )\r\n {\r\n $db->lock( \"eZContact_CompanyType\" );\r\n\t\t\t$this->ID = $db->nextID( \"eZContact_CompanyType\", \"ID\" );\r\n $res[] = $db->query( \"INSERT INTO eZContact_CompanyType\r\n (ID, Name, Description, ImageID, ParentID)\r\n VALUES\r\n ('$this->ID',\r\n '$name',\r\n '$description',\r\n '$this->ImageID',\r\n '$this->ParentID')\" );\r\n $db->unlock();\r\n $ret = true;\r\n }\r\n else\r\n {\r\n $res[] = $db->query( \"UPDATE eZContact_CompanyType set Name='$name', Description='$description', ImageID='$this->ImageID', ParentID='$this->ParentID' WHERE ID='$this->ID'\" );\r\n\r\n $ret = true;\r\n }\r\n eZDB::finish( $res, $db );\r\n return $ret;\r\n }", "public function store()\n {\n $this->validate();\n\n $cliente = Cliente::create([\n 'sexo_id' => $this->sexo_id,\n 'cedula' => $this->cedula,\n 'nombre_primero' => $this->nombre_primero,\n 'nombre_segundo' => $this->nombre_segundo,\n 'apellido_paterno' => $this->apellido_paterno,\n 'apellido_materno' => $this->apellido_materno,\n 'direccion' => $this->direccion,\n 'correo' => $this->correo,\n 'telefono' => $this->telefono,\n 'fecha_nacimiento' => $this->fecha_nacimiento,\n 'deuda' => $this->deuda,\n ]);\n\n $this->resetInput();\n $this->accion = 1;\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store(TecnicosRequest $request)\n {\n $input = $request->all();\n\n // define o codigo novo\n $id = BuscaProximoCodigo('TECNICOS');\n\n // pega o próximo codigo\n if ($id != null)\n $input['ID_TECNICO'] = $id;\n Tecnicos::create($input);\n\n \\Session::flash('message', trans('messages.conf_tecnico_inc'));\n $url = $request->get('redirect_to', asset('jogos/tecnicos'));\n return redirect()->to($url);\n }", "public function store(TipoEnvaseFormRequest $request)\n {\n \t$tipoenvase=new TipoEnvase;\n \t$tipoenvase->tipo=$request->get('tipo');//esta en tipobebida forma request\n \t$tipoenvase->estado='1';\n \t$tipoenvase->save();//guarda en la base de datos\n\n \treturn Redirect::to('inventario/tipoenvase');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }", "public function store(TipoRequest $request)\n {\n Tipo::create($request->all());\n return redirect()->route('tipos.index');\n }", "public function store(MttnCorrectivoRequest $request)\n {\n\n Orden::create([\n 'nOrden'=>$request['nOrden'],\n ]);\n\n $idO=Orden::All();\n $id=$idO->last()->id;\n\n MantenimientoCorrectivoVeh::create([\n 'idOrden'=>$id,\n 'idMecanico'=>$request['mecanico'],\n 'idVehiculo'=>$request['idVehiculo'],\n 'idMotorista'=>$request['idMotorista'],\n 'numTrabajo'=>$request['numTrabajo'],\n 'fechaInicioMtt'=>$request['fechaInicioMtt'],\n 'fechaFinMtt'=>$request['fechaInicioMtt'],\n 'fallasVeh'=>$request['fallasVeh'],\n 'diagnosticoMec'=>\"\",\n ]);\n $v= Vehiculo::find($request['idVehiculo']);\n $v->semaforo =4; //el estado del vehiculo cambia a mantt Correctivo\n $v->save();\n Bitacora::bitacora(\"Registro de nuevo Mttn Correctivo al Vehiculo': \".$v->nPlaca);\n return redirect('/mantenimientoCorVeh')->with('create','• Mantenimiento correctivo ingresado correctamente');\n }" ]
[ "0.55074793", "0.5428944", "0.53076106", "0.5231666", "0.51308054", "0.5123865", "0.50989157", "0.5078516", "0.50765", "0.5006776", "0.500204", "0.49781814", "0.49584776", "0.495819", "0.49563813", "0.49557543", "0.49315625", "0.49293077", "0.4915092", "0.49088088", "0.49088088", "0.49088088", "0.49087965", "0.48953235", "0.4893538", "0.4893538", "0.4893538", "0.4891732", "0.489122", "0.48845327" ]
0.70216274
0
Update the specified QcTipoEqualizacaoTecnica in storage.
public function update($id, UpdateQcTipoEqualizacaoTecnicaRequest $request) { $qcTipoEqualizacaoTecnica = $this->qcTipoEqualizacaoTecnicaRepository->findWithoutFail($id); if (empty($qcTipoEqualizacaoTecnica)) { Flash::error('Qc Tipo Equalizacao Tecnica '.trans('common.not-found')); return redirect(route('qcTipoEqualizacaoTecnicas.index')); } $qcTipoEqualizacaoTecnica = $this->qcTipoEqualizacaoTecnicaRepository->update($request->all(), $id); Flash::success('Qc Tipo Equalizacao Tecnica '.trans('common.updated').' '.trans('common.successfully').'.'); return redirect(route('qcTipoEqualizacaoTecnicas.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($tipoQuarto_id, array $data)\n {\n TipoQuarto::find($tipoQuarto_id)->update($data);\n }", "public function update($contenuto,$quantita) {\n\n\t\t$position = -1;\n\n\t\tfor ($i=0;$i<count($this->contenuto);$i++)\n\t\t{\n\t\t//Prelevo la posizione del prodotto nell'array\n\t\t\tif ($this->contenuto[$i]==$contenuto) \n\t\t\t$position=$i;\n\t\t}\n\n\t\t//Aggiorno le informazioni del prodotto\n\t\t$this->quantita[$position]=$quantita;\n\t\tif ($position==-1) \n\t\techo \"Impossibile aggiornare il prodotto,\n\t\t\tprodotto non trovato!<br><br>\";\n\n\t}", "public function update($tarConvenio);", "public function update(Request $request, Complainttype $complainttype)\n {\n //\n\n\n\n $complainttype_update = $complainttype->update($request->toArray());\n if ( $complainttype_update) {\n\n if (isset($request->complainttype_status) and $request->complainttype_status == '0') {\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Deleted');\n Session::flash('toastcontent', 'complainttype Deleted Successfully');\n } else {\n\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Success');\n Session::flash('toastcontent', 'complainttype updated Successfully');\n }\n } else {\n Session::flash('toasttype', 'error');\n Session::flash('toasttitle', 'Error');\n Session::flash('toastcontent', 'complainttype Not Updated');\n }\n\n return redirect()->route('complainttype.index');\n }", "public function update($cbtRekapNilai);", "public function updateCerveza(TipoCerveza $tc, $params)\n {\n // Proceso imagen\n $foto = $params['foto'];\n $path_imagen = $tc->getRutaImagen();\n if (isset($foto) && $foto['error'] !== UPLOAD_ERR_NO_FILE) {\n if ($this->resizeImage($foto, 'cervezas', $path_imagen)) {\n unlink($tc->getRutaImagen()); // Borro la anterior\n } else {\n return false;\n }\n }\n\n $this->initCerveza($tc, $params, $path_imagen);\n $tc->setModificadoEn(Utils::getCurrentTimestamp());\n $tc->update();\n return true;\n }", "public function update(Request $request, TipoCarpeta $tipoCarpeta)\n {\n //\n }", "public function store(CreateQcTipoEqualizacaoTecnicaRequest $request)\n {\n $input = $request->all();\n\n $qcTipoEqualizacaoTecnica = $this->qcTipoEqualizacaoTecnicaRepository->create($input);\n\n Flash::success('Qc Tipo Equalizacao Tecnica '.trans('common.saved').' '.trans('common.successfully').'.');\n\n return redirect(route('qcTipoEqualizacaoTecnicas.index'));\n }", "public function POS_it_checks_updateRec_att_type_changed() {\n // create the record to check\n $type = 'Bob';\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n $taskType->save();\n\n // create the changed record\n $changeType = 'Steve';\n\n $stdClass = new \\stdClass();\n $stdClass->id = $taskType->id;\n $stdClass->type = $changeType;\n $stdClass->desc = $taskType->getDescription();\n $stdClass->client_id = $taskType->client_id;\n\n $taskType->updateRec($stdClass);\n $result = $taskType::where('id', $taskType->getId())->first();\n\n $this->assertEquals($result->getType(), $changeType);\n }", "public function alterarTipoServico($tipoServico){\r\n \r\n try {\r\n \r\n $this->validarDadosTipoServico($tipoServico);\r\n return $this->tipoServicoDAO->update($tipoServico);\r\n } catch (DataException $e) {\r\n throw $e; \r\n } \r\n }", "public function update(Request $request, PrefacturaTratamiento $prefacturaTratamiento)\n {\n //\n }", "public function updating(TipoInstrumento $tipoInstrumento)\n {\n $auditoria = new Auditoria();\n $auditoria->auditoria_script = request()->route()->uri(); \n $auditoria->auditoria_host = Controller::GetIPRemote();\n $auditoria->aud_tip_id = 5;\n $auditoria->usuario_id = Auth::user()->usuario_id;\n $auditoria->auditoria_fecha = now();\n $auditoria->auditoria_tabla = 'tipos_instrumentos';\n $auditoria->auditoria_registro_id = request()->tipo_instrumento_id;\n $auditoria->auditoria_descripcion = 'Actualización de Tipo de Instrumento';\n $auditoria->auditoria_detalle_old = json_encode($tipoInstrumento->getOriginal());\n $auditoria->auditoria_detalle_new = json_encode($tipoInstrumento->getAttributes());\n $auditoria->save();\n }", "public function update(Request $request, TipoProductos $tipoProductos)\n {\n //\n }", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "public function updated(FormPettyCash $formPettyCash)\n {\n if (\n $formPettyCash->is_confirmed_pic && $formPettyCash->is_confirmed_manager_ops &&\n ($formPettyCash->status_id == 1)\n ) {\n $formPettyCash->status_id = 2;\n $formPettyCash->save();\n }\n\n if (\n $formPettyCash->isDirty('is_confirmed_cashier')\n ) {\n // Update number\n $day = str_pad(Carbon::now()->day, 2, '0', STR_PAD_LEFT);\n $month = str_pad(Carbon::now()->month, 2, '0', STR_PAD_LEFT);\n $year = Carbon::now()->year;\n $count = FormPettyCash::where(function ($query) {\n $query->where('is_confirmed_cashier', 1);\n $query->whereDate('date', Carbon::now()->toDate());\n })->count() + 1;\n $count = str_pad($count, 2, '0', STR_PAD_LEFT);\n $code = \"KK\";\n $number = $code . \".\" . $count . \".\" . $day . $month . $year;\n $formPettyCash->number = $number;\n\n // Decrease budget code balance\n foreach ($formPettyCash->details as $detail) {\n $budgetCode = $detail->budgetCode;\n $budgetCode->balance = $budgetCode->balance - $detail->nominal;\n $budgetCode->save();\n $budgetCodeService = new BudgetCodeService($budgetCode);\n $budgetCodeService->createLog($number, 'kredit', $detail->nominal, $formPettyCash->pic()->first()->id);\n }\n\n // Update status to \"Terbayarkan\"\n $formPettyCash->status_id = 3;\n\n // Update date to now\n $formPettyCash->date = Carbon::now()->toDateString();\n\n $formPettyCash->saveWithoutEvents();\n }\n }", "public function actionEditPrecioUnitario()\r\n {\r\n Yii::import('booster.components.TbEditableSaver');\r\n $es = new TbEditableSaver('DetalleVenta');\r\n $es->scenario='update';\r\n// /$_cantidad= $es->value;\r\n $es->onBeforeUpdate= function($event) {\r\n\r\n $model=$this->loadModel(yii::app()->request->getParam('pk')); //obteniendo el Model de detalleCompra\r\n \r\n //incrementando el credito disponible para para el cliente\r\n Cliente::model()->actualizarCreditoDisponible($model, 0);\r\n \r\n $_precioUnitario= yii::app()->request->getParam('value');\r\n \r\n $_total= round($model->cantidad*$_precioUnitario,2);//calculando el subtotal\r\n $_subtotal= $_subtotal= Producto::model()->getSubtotal($_total); //round($_total/((int)Yii::app()->params['impuesto']*0.01+1),2); //calculando impuesto\r\n $_impuesto= round($_total-$_subtotal,2); //calculando total\r\n \r\n $event->sender->setAttribute('subtotal', $_subtotal);//Actualizando Cantidad\r\n $event->sender->setAttribute('impuesto', $_impuesto);//Actualizando impuesto\r\n $event->sender->setAttribute('total', $_total); //actualizando total\r\n \r\n };\r\n $es->onAfterUpdate=function($event){\r\n $model=$this->loadModel(yii::app()->request->getParam('pk'));\r\n //actualizando el credito disponible para el cliente.\r\n Cliente::model()->actualizarCreditoDisponible($model, 1);\r\n };\r\n \r\n $es->update();\r\n }", "public function updateAtivo(Patrocinio $Patrocinio) {\n $conn = $this->conex->connectDatabase();\n if($Patrocinio->getStatus()==\"0\"){\n $Patrocinio->setStatus(\"1\");\n }\n else {\n $Patrocinio->setStatus(\"0\");\n }\n //Query de update\n $sql = \"update tbl_patrocinio set ativo=? where id_patrocinio=?\";\n $stm = $conn->prepare($sql);\n //Setando os valores\n $stm->bindValue(1, $Patrocinio->getStatus());\n $stm->bindValue(2, $Patrocinio->getId());\n //Executando a query\n $stm->execute();\n $this->conex->closeDataBase();\n }", "private function actualizar($tipo_rest, $idTipo)\n {\n try {\n // Creando consulta UPDATE\n $consulta = \"UPDATE \" . self::NOMBRE_TABLA .\n \" SET \" . \n self::NOMBRE_TIPO_REST . \"=? \" .\n \" WHERE \" . self::ID_TIPO_REST . \"=?\";//\" AND \" . self::ID_CLIENTE . \"=?\";\n\n // Preparar la sentencia\n $sentencia = ConexionBD::obtenerInstancia()->obtenerBD()->prepare($consulta);\n\n $sentencia->bindParam(1, $tipo_rest->nombre_tipo_rest);\n $sentencia->bindParam(2, $idTipo); \n\n // Ejecutar la sentencia\n $sentencia->execute();\n\n return $sentencia->rowCount();\n\n } catch (PDOException $e) {\n throw new ExcepcionApi(self::ESTADO_ERROR_BD, $e->getMessage());\n }\n }", "function modificarElemento($tipo, $id, $array) {\n\t\tglobal $db;\n\n\t\t$w = $tipo . '_id = \"' . $id . '\"';\n\t\t$update[$tipo . '_titulo'] = $array[$tipo . '_titulo'];\n\t\t$update[$tipo . '_titulo_corto'] = $array[$tipo . '_titulo_corto'];\n\t\t$update[$tipo . '_categoria'] = $array[$tipo . '_categoria'];\n\t\t$update[$tipo . '_categoria2'] = $array[$tipo . '_categoria2'];\n\t\t$update[$tipo . '_icono'] = $array[$tipo . '_icono'];\n\t\t$update[$tipo . '_copete'] = $array[$tipo . '_copete'];\n\t\t$update[$tipo . '_cuerpo'] = $array[$tipo . '_cuerpo'];\n\t\t$update[$tipo . '_codigo'] = $array[$tipo . '_codigo'];\n\t\t$update[$tipo . '_precio'] = $array[$tipo . '_precio'];\n\t\t$update[$tipo . '_stock'] = $array[$tipo . '_stock'];\n\t\t$update[$tipo . '_fecha_alta'] = $array[$tipo . '_fecha_alta'];\n\t\t$update[$tipo . '_fecha_baja'] = $array[$tipo . '_fecha_baja'];\n\t\t$update[$tipo . '_estado'] = $array[$tipo . '_estado'];\n\t\t$update[$tipo . '_destacado'] = $array[$tipo . '_destacado'];\n\t\t$update[$tipo . '_home'] = $array[$tipo . '_home'];\n\t\t$update[$tipo . '_video_youtube'] = $array[$tipo . '_video_youtube'];\n\n\t\t$db->UPDATEJ('tbl_' . $tipo, $update, $w);\n\t}", "public function update(Request $request, TipoBien $tipoBien)\n {\n //\n }", "private function upd(array $config) {\r\n switch ($config['type']) {\r\n case 'cart':\r\n case 'address':\r\n case 'cartConfig':\r\n case 'pwd':\r\n case 'config':\r\n case 'status_order':\r\n parent::update(\r\n ['type' => $config['type']],\r\n $config['data']\r\n );\r\n break;\r\n }\r\n }", "public function update($data, $type = '')\n {\n }", "public function change()\n {\n \n $this->execute('DELETE FROM cotz_cotizaciones_catalogo WHERE id = 12');\n \n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Abierta', etiqueta='abierta' WHERE id = '7'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Ganada', etiqueta='ganada' WHERE id = '9'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Perdida', etiqueta='perdida' WHERE id = '10'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Anulada', etiqueta='anulada' WHERE id = '11'\");\n \n $this->execute(\"UPDATE cotz_cotizaciones SET estado='abierta' WHERE estado = 'aprobado'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='ganada' WHERE estado = 'ganado'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='perdida' WHERE estado = 'perdido'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='anulada' WHERE estado = 'anulado'\");\n }", "public function update(Request $request, TipoAusencia $tipoAusencia)\n {\n //\n }", "function update() {\r\n\r\n\t\t$this->connection = new Connection();\r\n\t\t$conn = $this->connection->openConnection();\r\n\r\n\t\t$insert = $conn->prepare(\"UPDATE `panier` SET `quantite`=:quantite WHERE id_internaute=:id_internaute AND id_nourriture=:id_nourriture AND datep=:datep\");\r\n\t\ttry {\r\n\t\t\t$result = $insert->execute(array('quantite' => $this->getQuantite(),'id_internaute' => $this->getId_internaute(),'id_nourriture' => $this->getId_nourriture(),'datep' => $this->getDate()));\r\n\t\t\t\r\n\t\t} catch (PDOExecption $e) {\r\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"</br>\";\r\n\t\t}\r\n\t\t$this->connection->closeConnection();\r\n\t}", "function updateCodigoSat()\n {\n $db = new db();\n $db = $db->conectDB();\n\n $queryStatement= \"select id from ec_admin_codigos_sat where id_categoria='\".$this->id_categoria.\"' and id_subcategoria='\".$this->id_subcategoria.\"';\";\n $result = $db->query($queryStatement);\n $resultRow = $result->fetch();\n $value = $resultRow['id'];\n\n if (!empty($value)) {\n //Ejectua update\n $sql = \"update ec_admin_codigos_sat set codigo_sat='{$this->codigo_sat}', descripcion_sat='{$this->descripcion_sat}', descripcion_cl='{$this->descripcion_cl}' where id='{$value}';\";\n }else {\n //Ejecuta insert\n $sql = \"insert into ec_admin_codigos_sat (id_categoria,id_subcategoria,codigo_sat,descripcion_sat,descripcion_cl) values ({$this->id_categoria},{$this->id_subcategoria},'{$this->codigo_sat}','{$this->descripcion_sat}','{$this->descripcion_cl}')\";\n }\n\n // prepare query\n $prep_state = $db->prepare($sql);\n if ($prep_state->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function update(Request $request, $id)\n {\n try{\n\n \\DB::beginTransaction();\n\n foreach($request->storageTypeList as $storageType){\n\n $unitStorageType = UnitTypeStorage::where('intStorageTypeIdFK', '=', $storageType['intStorageTypeId'])\n ->where('intUnitTypeIdFK', '=', $id)\n ->first();\n\n if ($unitStorageType == null){\n\n $unitStorageType = UnitTypeStorage::onlyTrashed()\n ->where('intStorageTypeIdFK', '=', $storageType['intStorageTypeId'])\n ->where('intUnitTypeIdFK', '=', $id)\n ->first();\n\n if ($unitStorageType == null) {\n\n $unitStorageType = UnitTypeStorage::create([\n 'intStorageTypeIdFK' => $storageType['intStorageTypeId'],\n 'intUnitTypeIdFK' => $id,\n 'intQuantity' => $storageType['intQuantity']\n ]);\n\n }else{\n\n $unitStorageType->restore();\n $unitStorageType->intQuantity = $storageType['intQuantity'];\n $unitStorageType->save();\n\n }\n\n }else{\n\n $unitStorageType->intQuantity = $storageType['intQuantity'];\n $unitStorageType->save();\n\n }\n\n }\n\n $savedUnitStorageList = UnitTypeStorage::where('intUnitTypeIdFK', '=', $id)\n ->get();\n\n foreach ($savedUnitStorageList as $savedUnitStorage){\n\n $boolNotExist = true;\n\n foreach($request->storageTypeList as $storageType){\n\n if ($savedUnitStorage->intStorageTypeIdFK == $storageType['intStorageTypeId']){\n\n $boolNotExist = false;\n\n }\n\n }\n\n if ($boolNotExist){\n\n $savedUnitStorage->delete();\n\n }\n\n }\n\n \\DB::commit();\n return response()\n ->json(\n [\n 'message' => 'Storage Types are successfully updated.'\n ],\n 201\n );\n\n }catch(\\Exception $e){\n \\DB::rollBack();\n return response()\n ->json(\n [\n 'message' => 'Oops.',\n 'error' => $e->getMessage()\n ],\n 500\n );\n }\n }", "function updateTest()\n {\n $this->cD->updateElement(new Product(1, \"Trang\"));\n }", "public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }", "public function update($cbtSoalSiswa);" ]
[ "0.5172879", "0.49889868", "0.49685395", "0.49525422", "0.48831308", "0.4877327", "0.480173", "0.4787714", "0.4772085", "0.47435433", "0.4734039", "0.47330976", "0.47316438", "0.4729007", "0.4720053", "0.469939", "0.46706483", "0.46560657", "0.46509624", "0.46433008", "0.463428", "0.46334317", "0.46182677", "0.46147397", "0.4614394", "0.46117607", "0.46022218", "0.45885098", "0.45816472", "0.4578699" ]
0.60942036
0
Print purchase detail report.
public function print_purchase_detail_report(Request $request) { $company_info = auth()->user()->company_info; $from_date = $request->from_date; $to_date = $request->to_date; $purchase_details = $this->get_data($from_date,$to_date); return view('reports.purchasereports.print',compact('purchase_details','company_info','from_date','to_date')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function purchase_print($purchase_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['master'] = $this->MPurchase_master->get_by_purchase_no($purchase_no);\n $data['details'] = $this->MPurchase_details->get_by_purchase_no($purchase_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/inventory/purchase/print', $data);\n }", "public function show(Purchase $purchase)\n {\n //\n \n }", "public function show(Purchase $purchase)\n {\n //\n }", "public function show(Purchase $purchase)\n {\n //\n }", "public function show(Purchase $purchase)\n {\n //\n }", "public function show(Purchase $purchase)\n {\n //\n }", "public function show($id)\n {\n \n $customer = array();\n\n $data = PurchaseOrder::find($id);\n\n $SupplierDetail = DB::table('zenrolle_purcahse')->join('zenrolle_suppliers','zenrolle_purcahse.supplier','=','zenrolle_suppliers.id')\n ->select('zenrolle_suppliers.name','zenrolle_suppliers.address','zenrolle_suppliers.city','zenrolle_suppliers.country','zenrolle_suppliers.phone','zenrolle_suppliers.email','zenrolle_purcahse.invoice_no','zenrolle_purcahse.reference_no','zenrolle_purcahse.order_date','zenrolle_purcahse.due_date','zenrolle_purcahse.id','zenrolle_purcahse.subtotal','zenrolle_purcahse.total','zenrolle_purcahse.total_discount','zenrolle_purcahse.status','zenrolle_purcahse.total_tax','zenrolle_purcahse.shipping')\n ->where('zenrolle_purcahse.id',$id)->get();\n\n $invoice = PurchaseItem::where('pid',$id)->get();\n\n $customer['invoice'] = $invoice; \n $data->due_balance = $data->total - $data->payment_made;\n \n $pdf = PDF::loadView('purchasing.purchase_order.pdf', compact('data','SupplierDetail','invoice'));\n return $pdf->stream('zenroller.pdf'); \n }", "public function purchase_return_print($purchase_return_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['master'] = $this->MPurchase_return_master->get_by_purchase_return_no($purchase_return_no);\n $data['details'] = $this->MPurchase_return_details->get_by_purchase_return_no($purchase_return_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/inventory/purchase_return/print', $data);\n }", "function view(){\n\t\t$sale_number = $this->uri->segment(3);\n\n\t\t$data['purchase'] = $this->m_sale->get_one($sale_number)->row_array();\n\t\t$data['purchdetail'] = $this->m_sale->get_detail($sale_number);\n\n\t\t$this->template->load('inv_template', 'orders/v_view_sale', $data);\n\t}", "public function show($pid)\n {\n $data = GeneralTransaction::find($pid);\n $Trans_Detail = DB::table('zenrolle__general_transaction')->join('zenrolle__general_transaction_detail','zenrolle__general_transaction_detail.pid','=','zenrolle__general_transaction.id')\n ->where('zenrolle__general_transaction.id',$pid)->get();\n $pdf = PDF::loadView('Accounts.GeneralTransaction.print_view', compact('data','Trans_Detail'));\n return $pdf->stream('ZenrolleVoucher.pdf');\n\n }", "public function actionView($id) {\r\n $this->redirect(array('print', 'purchase_id' => $id));\r\n }", "private function __print_receipt()\n {\n\t//Assuming range\n\t$ret = $this->__view_receipt();\n\t$receipthead = $this->__receipt_head_html();\n\t$receiptfoot = $this->__receipt_foot_html();\n\t\n\t$receipts = $receipthead. sprintf(\"\n\t<div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t\n\t\", $ret, $ret, $ret, $ret, $ret, $ret).$receiptfoot;\n\t\n\techo $receipts;\n }", "public function showPurchase()\n\t{\n\t\t$orders = OrderDetails::latest()\n ->where('user_id', auth()->user()->id)\n ->where('status', '=','paid')\n ->with('product')\n //->with(\"user\")\n ->get();\n\n //return $orders = $orders;\n\n $count = $orders->count();\n\n\n return view('view-shop', compact('orders' ,'count'));\n\t}", "public function view_purchase_info($id=Null)\n\t{\n\t\tif($res = $this->Purchase_model->purchase_info_by_id($id)){\n\t\t\t$data['title']\t= 'View Purchase Car Details';\n\t\t\t$data['content'] = 'purchase/view_purchase';\n\t\t\t$data['supplier'] = $this->Supplier_model->supplier_by_id($res->supplier_id);\n\t\t\t$data['purchase'] = $res;\n\n\t\t\t$this->load->view('admin/adminMaster', $data);\n\t\t}else{\n\t\t\t$data['error']=\"No Data Find..!\";\n\t\t\t$this->session->set_flashdata($data);\n\t\t\tredirect('purchase/list');\n\t\t}\n\t}", "public function show($id)\n {\n $purchase = DB::table('purchases as pu')\n ->join('providers as p','pu.provider_id','=','p.id')\n ->join('purchase_details as pd','pu.id','=','pd.purchase_id')\n ->select('pu.id', 'pu.date', 'p.tradename', 'pu.document_type', 'pu.document_serie', 'pu.document_no', 'pu.isActive', DB::raw('sum(pd.quantity * purchase_price) as total'))\n ->where('pu.id', '=', $id)\n ->groupBy('pu.id')\n ->first();\n\n $purchase_details = DB::table('purchase_details as pd')\n ->join('products as pr','pd.product_id','=','pr.id')\n ->select('pr.name as product','pd.quantity','pd.purchase_price','pd.sale_price')\n ->where('pd.purchase_id','=',$id)\n ->get();\n\n return view(\"purchases.show\",[\"purchase\" => $purchase, \"purchase_details\" => $purchase_details]);\n \n }", "public function print_invoice_details_table() {\n\n // Language variables to be used in heredoc syntax\n $tableHeaderCategory = lang( 'report_th_category' );\n $tableHeaderDescription = lang( 'report_th_description' );\n $tableHeaderAmount = lang( 'report_th_amount' );\n\n // Get the invoice row details\n $invoiceRows = $this->mockinvoice_row_model->get_by( 'mockInvoiceId = ' . @$_POST['mockInvoiceId'] );\n\n $tableRows = '';\n\n foreach ( $invoiceRows as $row ) {\n\n // Add currency symbol Eg. '$' to the amount if we have one\n ( $row->amount != null ? $amount = lang( 'system_currency_symbol' ) . $row->amount : $amount = '' );\n // Replace new lines with HTML <br> tags\n $description = nl2br( $row->description );\n\n // Check if a row has some content and add it to the table if it does\n if ( ( $row->category != null ) or ( $row->description != null ) or ( $row->amount != null ) ) {\n $tableRows .= <<< HTML\n <tr id=\"invoice-details-row-{$row->mockInvoiceRowId}\">\n <td>{$row->category}</td>\n <td>{$description}</td>\n <td>{$amount}</td>\n </tr>\n\nHTML;\n }\n }\n\n // Output the HTML\n if ( $tableRows == '' ) {\n\n // Show that we have no details yet to display\n echo '<div class=\"alert alert-warning\">' . lang( 'report_minv_empty' ) . '</div>';\n } else {\n\n // Display the table with invoice details\n echo <<< HTML\n <table class=\"table table-striped table-bordered table-hover table-report\">\n <thead>\n <tr class=\"report-heading-row\">\n <th>{$tableHeaderCategory}</th>\n <th>{$tableHeaderDescription}</th>\n <th>{$tableHeaderAmount}</th>\n </tr>\n </thead>\n <tbody>\n\n{$tableRows}\n\n </tbody>\n </table>\n\nHTML;\n }\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "private function getPurchasePageData(){\n\t\t$this->template->imgurl = $this->getParam('imgurl');\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\t$this->getItem();\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\n\t\t// TODO Add 'name' to productdata\n\t\t$itemView = $this->template->item;\n\t\t$name = substr($itemView->description, 0, 35);\n\t\t$itemView->name = $name . '...';\n\n\t\t// Build shippng costs (including insurance)\n\t\t$shippingbase = shop_shipping_fee;\n\t\t$optionShipping = array();\n\t\t$options = $itemView->options;\n\t\tfor ($i = 0; $i < sizeof($options); $i++) {\n\t\t\t$option = $options[$i];\n\t\t\tif ($option->price < 100) {\n\t\t\t\t$ship = $shippingbase + 4;\n\t\t\t} else {\n\t\t\t\t$ship = $shippingbase + 8;\n\t\t\t}\n\t\t\t$optionShipping[$option->seq] = $ship;\n\t\t}\n\t\t$this->template->optionShipping = $optionShipping;\n\t\t\n\t\tLogger::info('Purchase page view ['.$this->template->item->id.']['.$this->template->item->code.']');\n\t}", "public function print_invoice() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n $data['user_org'] = $this->payments_model->get_user_org_details($userid);\n $data['invoice'] = $this->payments_model->get_invoice_details($data['clsid'], $data['crsid'], $userid);\n $data['meta_data'] = $this->meta_data;\n return generate_invoice($data);\n }", "public function display_billing()\n\t{\n\t\t$this->call_member('display_billing_'.g::$pages[$this->page_index + 2], 'display_billing_hist');\n\t}", "public function show(purchaseMaster $purchaseMaster)\n {\n //\n }", "public function purchase_preview($purchase_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['menu'] = 'inventory';\n $data['content'] = 'admin/inventory/purchase/preview';\n $data['master'] = $this->MPurchase_master->get_by_purchase_no($purchase_no);\n $data['details'] = $this->MPurchase_details->get_by_purchase_no($purchase_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/template', $data);\n }", "function print_order_detail($orderid){\n // product data in table\n\t$order_items = \"scart_purchdetail\"; // purchdetail table - order item info\n // retrieve command table order details\n\t$intorderid = intval($orderid); // => 23 mysql value in integer\n\t$cmdorder = \"select * from $order_items where orderid = $intorderid order by line_item asc;\";\n\t$result2 = mysql_query($cmdorder)\n or die (\"Query '$cmdorder' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$num_rows2 = mysql_num_rows($result2);\n\t// $row_info = mysql_fetch_array($result2);\n\tif ( $num_rows2 >= 1 ) {\n\t // ========= start order items data records =========\n\t $row = 0; // line_item values\n\t while ($row_info = mysql_fetch_object($result2)) {\n\t\t $data[$row]['item'] = $row_info->line_item; // current row item number\n\t\t $data[$row]['qty'] = $row_info->order_quantity; // current row quantity\n\t\t $data[$row]['bookid'] = $row_info->bookid; // current row bookid\n\t\t $data[$row]['price'] = $row_info->order_price; // current row book price\n\t\t $row ++; // next line_item values\n\t }\n\t return $data; // return order details\n\t} else {\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"query result mysql_errno is = '.mysql_errno($connID).' !\\nmysql_errormsg = '\n\t\t\t .mysql_error($connID).'\\nNo results found - Returning empty!\\n\")';\n\t print '</script>'; \n\t // exit(); \n\t return 0; // return failed order detail\n }\n}", "public function print( $saleId )\n\t{\n\t\trequire_once APP.\"/Traits/PdfTrait.php\"; \n\t\t// incluimos la plantilla a usar\n\t\trequire_once APP.\"/Helpers/PdfTemplates/DefaultTemplate.php\";\n\t\t// obtenemos los datos de la venta\n\t\t$sale = $this->SaleModel->find( $saleId );\n\t\t// Obtenemos los datos del usuario\n\t\t$user = $this->UserModel->find( $sale['userId'] );\n\t\t// Busca los datos del usuario\n\t\t$dataCliente = $this->UserDataModel->find_by_user_id( $sale['userId'] );\n\t\t// variable que contendra el listado de productos\n\t\t$products = \"\";\n\t\t// Busca los detalles de cada venta\n\t\t$details = $this->SaleDetailModel->find_all( $sale['saleId'] );\n\t\t// Asigna el valor\n\t\tforeach ($details as $detail) {\n\t\t\t$products .= '\n\t\t\t<div>'.$detail['name'].' Talla:'.$detail['size']. ' Precio: '.$detail['price']. ' Cantidad: '.$detail['quantity']. '</div>\n\t\t\t';\n\t\t}\n\t\t// Obtenemos el estado de la venta\n\t\t$status = $this->StatusSaleModel->find( $sale['statusSaleId'] );\n\t\t// creamos la plantilla\n\t\t$template = DefaultTemplate::template( $sale, $user, $dataCliente , $products, $status );\n\t\t// mostramos el pdf\n\t\t$pdf = PdfTrait::view( $template, \"Legal\", \"P\", \"10\", \"10\", \"10\", \"10\" );\n\n\t}", "protected function detail($id)\n {\n $show = new Show(Purchase::findOrFail($id));\n\n $show->field('id', \"编号\");\n $show->field('consumer_name', \"客户\")->as(function () {\n return $this->consumer->full_name;\n });\n $show->field('house_readable_name', \"房源\")->as(function () {\n return $this->house->readable_name;\n });\n $show->field('started_at', \"生效日期\");\n $show->field('ended_at', \"结束日期\");\n $show->field('sell_type', \"出售方式\")->as(function ($sell_type) {\n return Purchase::$type[$sell_type];\n });\n $show->field('price', \"成交价格\")->as(function ($price) {\n return \"¥$price\";\n });\n $show->field('created_at', \"创建日期\");\n $show->field('updated_at', \"更新日期\");\n\n return $show;\n }", "public function printDiv($id, $purchase_no)\n\t{\n\t\tif (!in_array('viewOrder', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\tif ($id) {\n\t\t\t$order_data = $this->model_purchase->getPurchaseData($id);\n\t\t\t$orders_items = $this->model_purchase->getPurchaseItemData($purchase_no);\n\t\t\t// $footer_items = $this->model_orders->getFooter($id);\n\t\t\t$company_info = $this->model_company->getCompanyData(1);\n\t\t\t$party_data = $this->model_party->getPartyData($order_data['party_id']);\n\n\t\t\t$order_date = strtotime($order_data['purchase_date']);\n\t\t\t$order_date = date('d/m/Y', $order_date);\n\t\t\t// $paid_status = ($order_data['is_payment_received'] == 1) ? \"Paid\" : \"Unpaid\";\n\t\t\t$freight_other_charge = $order_data['other_charges'];\n\n\t\t\t$purchase_date = date('d-m-Y', strtotime($order_data['purchase_date']));\n\t\t\t$ref_date = date('d-m-Y', strtotime($order_data['ref_date']));\n\n\t\t\tif (strtotime($order_data['purchase_date']) < 0) {\n\t\t\t\t$purchase_date = '';\n\t\t\t}\n\n\t\t\tif (strtotime($order_data['ref_date']) < 0) {\n\t\t\t\t$ref_date = '';\n\t\t\t}\n\n\n\t\t\t$html = '<!-- Main content -->\n\t\t\t<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t <meta charset=\"utf-8\">\n\t\t\t <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t\t\t <title></title>\n\t\t\t <!-- Tell the browser to be responsive to screen width -->\n\t\t\t <meta content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\" name=\"viewport\">\n\t\t\t <!-- Bootstrap 3.3.7 -->\n\t\t\t <link rel=\"stylesheet\" href=\"' . base_url('assets/bower_components/bootstrap/dist/css/bootstrap.min.css') . '\">\n\t\t\t <!-- Font Awesome -->\n\t\t\t <link rel=\"stylesheet\" href=\"' . base_url('assets/bower_components/font-awesome/css/font-awesome.min.css') . '\">\n\t\t\t <link rel=\"stylesheet\" href=\"' . base_url('assets/dist/css/AdminLTE.min.css') . '\">\n\t\t\t <link rel=\"stylesheet\" href=\"' . base_url('assets/dist/css/AdminLTE.css') . '?v=<?=time();?\">\n\t\t\t</head>\n\t\t\t<body onload=\"window.print();\">\n\t\t\t\n\t\t\t<div class=\"wrapper\" style= \"overflow: visible\">\n\t\t\t <section class=\"invoice\">\n\t\t\t <!-- title row -->\n\t\t\t <div class=\"row\">\n\t\t\t\t <div class=\"col-xs-12 \">\n\t\t\t <h1 class=\"invoice-title-name\">\n\t\t\t ' . $company_info['company_name'] . '\n\t\t\t\t\t</h1>\n\t\t\t\t\t<h6 class=\"invoice-title-address\">\n\t\t\t ' . $company_info['address'] . '\n\t\t\t\t\t</h6>\n\t\t\t\t\t<div class=\"display-flex\">\n\t\t\t\t\t<h6 class=\"invoice-title-address\" style=\"padding: 10px; padding-top: 0px;\">\n\t\t\t\t\tPhone No:' . $company_info['phone'] . '\n\t\t\t\t\t</h6>\n\t\t\t\t\t<h6 class=\"invoice-title-address\" style=\"padding: 10px; padding-top: 0px;\">\n\t\t\t Email:' . $company_info['email'] . '\n\t\t\t\t\t</h6>\n\t\t\t\t\t</div>\n\t\t\t\t <h4 class=\"invoice-title-address\">Purchase Order</h4>\n\t\t\t </div>\n\t\t\t <!-- /.col -->\n\t\t\t </div>\n\t\t\t\t<!-- info row -->\n\t\t\t\t<div class=\"invoice-border\">\n\t\t\t <div class=\"row invoice-info\" style=\"margin-right: -8px;\">\n\t\t\t \n\t\t\t\t <div class=\"col-sm-6 invoice-col table-bordered-invoice invoice-top\" >\n\t\t\t\t <div class=\"padding-10\" style=\"font-size: 12px;\">\n\t\t\t\t\t<b>To:<br> M/s. </b> ' . $party_data['party_name'] . '<br>' . $party_data['address'] . '<br><br>\n\t\t\t\t\t<b>GST No.:</b> ' . $party_data['gst_number'] . '<br>\n\t\t\t\t\t</div>\n\n\t\t\t </div>\n\t\t\t\t <!-- /.col -->\n\t\t\t\t <div class=\"col-sm-6 invoice-col table-bordered-invoice invoice-top\">\n\t\t\t\t <div class=\"padding-5\">\n\t\t\t\t <b>Purchase No.:</b> ' . $order_data['purchase_no'] . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"invoice-boxes padding-5\" style=\"font-size: 12px;\">\n\t\t\t\t\t<b>Date.:</b> ' . $purchase_date . ' \n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"invoice-boxes padding-5\" style=\"font-size: 12px;\"> \n\t\t\t\t\t<b>Ref. No.:</b> ' . $order_data['ref_no'] . '\n\n\t\t\t\t </div>\n\t\t\t\t <div class=\"invoice-boxes padding-5\" style=\"font-size: 12px;\">\n\t\t\t\t\t<b>Ref. Date.:</b> ' . $ref_date . '\n\n\t\t\t\t </div>\n\n\t\t\t </div>\n\t\t\t\t <!-- /.col -->\n\t\t\t </div>\n\t\t\t <!-- /.row -->\t\n\t\t\t <!-- Table row -->\n\t\t\t <div class=\"row\" style=\"margin-right: -15px;\">\n\t\t\t <div class=\"col-xs-12 table-responsive table-invoice\" style=\"font-size: 10px;\">\n\t\t\t <table class=\"table table-bordered-invoice\" >\n\t\t\t <thead>\n\t\t\t\t\t <tr>\n\t\t\t\t\t\t<th>S.N.</th>\n\t\t\t\t\t\t<th>Code</th>\n\t\t\t <th>Description</th>\n\t\t\t\t\t\t<th>Make</th>\n\t\t\t <th>Qty</th>\n\t\t\t\t\t\t<th>Unit</th>\n\t\t\t\t\t\t<th>Rate</th>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>';\n\t\t\t$total = 0;\n\n\t\t\tforeach ($orders_items as $k => $v) {\n\n\t\t\t\t$product_data = $this->model_products->getProductData($v['item_id']);\n\t\t\t\t$amount = $v['qty'] * $v['rate'];\n\t\t\t\t$total = $total + $amount;\n\t\t\t\t$index = $k + 1;\n\n\n\n\t\t\t\t$discount_amount = $amount - ($amount * $v['discount']) / 100;\n\n\n\n\t\t\t\t$html .= '<tr>\n\t\t\t\t\t\t\t<td>' . $index . '</td>\n\t\t\t\t\t\t\t<td>' . $product_data['Item_Code'] . '</td>\n\t\t\t\t\t\t\t<td>' . $product_data['Item_Name'] . '</td>\n\t\t\t\t\t\t\t<td>' . $product_data['Item_Make'] . '</td>\n\t\t\t\t\t\t\t<td>' . $v['qty'] . '</td>\n\t\t\t\t\t\t\t<td>' . $v['unit'] . '</td>\n\t\t\t\t\t\t\t<td>' . $v['rate'] . '</td>\n\t\t\t \t</tr>';\n\t\t\t}\n\n\t\t\t$tax_value = $order_data['tax_value'];\n\t\t\t$gross_total = $total - $order_data['total_discount'];\n\t\t\t$total_after_tax = $gross_total + ($gross_total * $tax_value) / 100;\n\t\t\t$final_total = $total_after_tax + $freight_other_charge;\n\n\n\t\t\t$rounded_total_amount = round($final_total);\n\t\t\t$round_off = ($rounded_total_amount - $final_total);\n\t\t\t$round_off = round($round_off, 2);\n\n\t\t\t$html .= '</tbody>\n\t\t\t </table>\n\t\t\t </div>\n\t\t\t <!-- /.col -->\n\t\t\t </div>\n\t\t\t <!-- /.row -->\n\n\t\t\t \n\t\t\t\t<!-- /.border -->\n\t\t\t </section>\n\t\t\t <!-- /.content -->\n\t\t\t</div>\n\t\t</body>\n\t</html>';\n\n\t\t\techo $html;\n\t\t}\n\t}", "public function print_receipt() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_payment_receipt($data);\n }", "public static function getExport($purchases) {\n $lines = array();\n\n // create each line\n foreach ($purchases as $p) {\n\n // Purchase status must be 'OK'\n if ($p->status != 'OK') {\n continue;\n }\n\n $l = array();\n\n // Record type\n $l[] = $p->bookedby ? 'P' : 'O';\n\n // Tour ref\n $l[] = Admin::clean($p->code);\n\n // Bkg ref\n $l[] = Admin::clean($p->bookingref);\n\n // Surname\n $l[] = Admin::clean($p->surname, 20);\n\n // Title\n $l[] = Admin::clean($p->title, 12);\n\n // First names\n $l[] = Admin::clean($p->firstname, 20);\n\n // Address line 1\n $l[] = Admin::clean($p->address1, 25);\n\n // Address line 2\n $l[] = Admin::clean($p->address2, 25);\n\n // Address line 3\n $l[] = Admin::clean($p->city, 25);\n\n // Address line 4\n $l[] = Admin::clean($p->county, 25);\n\n // Post code\n $l[] = Admin::clean($p->postcode, 8);\n\n // Phone No\n $l[] = Admin::clean($p->phone, 15);\n\n // Email\n $l[] = Admin::clean($p->email, 50);\n\n // Start\n $l[] = Admin::clean($p->joining);\n\n // Destination\n $l[] = Admin::clean($p->destination);\n\n // Class\n $l[] = Admin::clean($p->class, 1);\n\n // Adults\n $l[] = Admin::clean($p->adults);\n\n // Children\n $l[] = Admin::clean($p->children);\n\n // OAP (not used)\n $l[] = '0';\n\n // Family (not used)\n $l[] = '0';\n\n // Meal A\n $l[] = Admin::clean($p->meala);\n\n // Meal B\n $l[] = Admin::clean($p->mealb);\n\n // Meal C\n $l[] = Admin::clean($p->mealc);\n\n // Meal D\n $l[] = Admin::clean($p->meald);\n\n // Comment - add booker on the front\n // Remove 1/2 spurious characters from comment\n $comment = strlen($p->comment) < 3 ? '' : $p->comment;\n if ($p->bookedby) {\n $bookedby = Admin::getInitials($p->bookedby) . ' ';\n } else {\n $bookedby = '';\n }\n $l[] = Admin::clean($bookedby . $comment, 39);\n\n // Payment\n $l[] = Admin::clean(intval($p->payment * 100));\n\n // Booking Date\n $fdate = substr($p->date, 0, 4) . substr($p->date, 5, 2) . substr($p->date, 8, 2);\n $l[] = Admin::clean($fdate);\n\n // Seat supplement\n $l[] = $p->seatsupplement ? 'Y' : 'N';\n\n // Card Payment\n $l[] = 'Y';\n\n // Action required\n $l[] = 'N';\n\n // make tab separated line\n $line = implode(\"\\t\", $l);\n $lines[] = $line;\n }\n\n // combine lines\n return implode(\"\\n\", $lines);\n }", "public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }", "public function product_detail() {\n\t\t// double tracking as there could be multiple buy buttons on the page.\n\t\tif ( $this->has_tracked_detail ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->has_tracked_detail = true;\n\n\t\t// If page reload, then return\n\t\tif ( monsterinsights_is_page_reload() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product_id = get_the_ID();\n\n\t\t// Output view product details EE\n\t\t$js = $this->enhanced_ecommerce_add_product( $product_id );\n\n\t\t// Output setAction for EC funnel\n\t\t$js .= $this->get_funnel_js( 'viewed_product' );\n\n\t\t// Add JS to output queue\n\t\t$this->enqueue_js( 'event', $js );\n\n\t\t// Send view product event\n\t\t$properties = array(\n\t\t\t'eventCategory' => 'Products',\n\t\t\t'eventLabel' => esc_js( get_the_title() ),\n\t\t\t'nonInteraction' => true,\n\t\t);\n\n\t\t$this->js_record_event( 'Viewed Product', $properties );\n\t}" ]
[ "0.73125845", "0.6920693", "0.68628573", "0.68628573", "0.68628573", "0.68628573", "0.6557655", "0.6537634", "0.65098155", "0.64912045", "0.6375801", "0.6347581", "0.6268212", "0.6210744", "0.6187664", "0.618299", "0.6126077", "0.610497", "0.6033689", "0.6014171", "0.5993196", "0.5964965", "0.5953349", "0.5944014", "0.59341997", "0.5926339", "0.5924182", "0.589821", "0.588878", "0.5888073" ]
0.69766605
1
RevokeAuthKeys Revoke a previously created authKey.
public function revokeAuthKeys(string $token, array $keys) { // Form revokeAuthKeys parameters $authKeys = array( 'keys' => implode(',', $keys), ); // Do the query $response = Elvis::query($token, 'revokeAuthKeys', $authKeys); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteRevokedTokens(): void\n {\n $this->model->newQuery()\n ->where('revoked', '=', true)\n ->delete();\n }", "public static function revokeKey($key_id, $revokingUser)\n {\n /* @var $key Key */\n $key = self::model()->findByPk($key_id); \n if (is_null($key)) {\n return array(false, 'Bad key_id');\n }\n \n if ($key->revoke($revokingUser)) {\n \n return array(true, null);\n \n } else {\n \n // Return the error messages.\n return array(false, $key->getErrorsAsFlatTextList());\n }\n }", "public function revokeRefreshTokens(bool $revokeRefreshTokens): void;", "public function revokeAuthCode($codeId)\n {\n }", "public function revokeAuthCode($codeId): void {\n $this->revokeToken($codeId);\n }", "public function revokeAuthCode($codeId)\n {\n // TODO: Implement revokeAuthCode() method.\n }", "public function revoke()\n {\n $accessToken = $this->tokenRepo->get()['access_token'];\n $url = $this->getLoginURL();\n $url .= '/services/oauth2/revoke';\n\n $options['headers']['content-type'] = 'application/x-www-form-urlencoded';\n $options['form_params']['token'] = $accessToken;\n\n return $this->httpClient->post($url, $options);\n }", "private function revoke_token() {\n $this->delete_refresh_token();\n $this->client->revokeToken();\n $this->store_access_token(null);\n }", "public function revokeApiKeyForUser(string $idOrMail, string $apiKey): bool\n {\n $url = $this->getApiUrl() . 'users/' . urlencode($idOrMail) . '/api-keys/' . urlencode($apiKey) ;\n $headers = $this->getRequestHeaders();\n $method = 'DELETE';\n $response = $this->getHttpClient()->request($method, $url, $headers);\n\n if ($response->getStatus() === 200) {\n return true;\n } else {\n throw $this->getExceptionByStatusCode($method, $url, $response);\n }\n }", "public static function _revoke ( $permissions ) {\n $instance = self::getInstance();\n\n $instance->_permissions = false;\n\n if ( is_string($permissions) ) {\n $instance->revokes[$permissions] = $permissions;\n unset($instance->permissions[$permissions]);\n }\n\n if ( is_array($permissions) ) {\n foreach ($permissions as $permission) {\n $instance->revokes[$permission] = $permission;\n unset($instance->permissions[$permission]);\n }\n }\n //echo \"<BR><<<<<<<<<<<<<<<<<<<<<<<<<REVOKED $permissions <BR>\";\n }", "public function revoke($revokingUser)\n {\n if ( ! $revokingUser instanceof User) {\n // This should not happen in the normal flow of things... thus\n // the exception.\n throw new \\Exception(\n 'No User provided when trying to revoke a Key.',\n 1466000163\n );\n } elseif ( ! $revokingUser->canRevokeKey($this)) {\n $this->addError('processed_by', sprintf(\n 'That user (%s) is not authorized to revoke this key.',\n $revokingUser->getDisplayName()\n ));\n return false;\n }\n\n if ( ! $this->isApproved()) {\n $this->addError('status', 'Only approved keys can be revoked.');\n return false;\n }\n \n $this->processed_by = $revokingUser->user_id;\n $this->status = self::STATUS_REVOKED;\n /* NOTE: Leave the key value intact (for identifying the revoked key,\n * both to ApiAxle and to the end user). Do get rid of the secret,\n * though. */\n /* NOTE 2: Don't worry about the fact that, if the Key was to an Api\n * that did not require a signature, there was no secret (and the\n * value was sufficient by itself). When we save a Key with a\n * status of revoked, it deletes it from ApiAxle. */\n $this->secret = null;\n \n if ($this->save()) {\n $this->log('revoked');\n \n try {\n $this->notifyUserOfRevokedKey();\n $this->notifyApiOwnerOfRevokedKey();\n } catch (\\Exception $e) {\n \\Yii::log(sprintf(\n 'Error sending key-revoked notification email(s): (%s) %s',\n $e->getCode(),\n $e->getMessage()\n ), \\CLogger::LEVEL_WARNING);\n }\n\n // Indicate success.\n return true;\n } else {\n return false;\n }\n }", "function revoke()\n\t{\n\t}", "public function revokeAllPermissions();", "public function revokeAllPermissions();", "public function revoke_access() {\r\n // Nothing to do!\r\n }", "public function destroy () {\n $accountId = $this->account->id;\n $accountApiKeyId = $this->accountApiKey->id;\n $url = \"/api/accounts/$accountId/account-api-keys/$accountApiKeyId\";\n $response = $this->json('DELETE', $url);\n\n $accountApiKey = $this->accountApiKey->find($accountApiKeyId);\n $this->assertNull($accountApiKey);\n $response->assertStatus(204);\n }", "function RevokeAccessToken()\r\n {\r\n $this->Rest->RevokeAccessToken();\r\n }", "public function revokeAllRoles ();", "public function notifyUserOfRevokedKey(\n \\YiiMailer $mailer = null,\n array $appParams = null\n ) {\n // If not given the Yii app params, retrieve them.\n if ($appParams === null) {\n $appParams = \\Yii::app()->params->toArray();\n }\n \n // If we are in an environment where we should NOT send email\n // notifications, then don't.\n if ($appParams['mail'] === false) {\n return;\n }\n \n if ($this->user && $this->user->email) {\n\n // Try to send them a notification email.\n if ($mailer === null) {\n $mailer = \\Utils::getMailer();\n }\n $mailer->setView('key-revoked-user');\n $mailer->setTo($this->user->email);\n $mailer->setSubject(sprintf(\n 'Key revoked for %s API',\n $this->api->display_name\n ));\n if (isset($appParams['mail']['bcc'])) {\n $mailer->setBcc($appParams['mail']['bcc']);\n }\n $mailer->setData(array(\n 'key' => $this,\n 'api' => $this->api,\n 'keyOwner' => $this->user,\n ));\n\n // If unable to send the email, allow the process to\n // continue but communicate the email failure somehow.\n if ( ! $mailer->send()) {\n \\Yii::log(\n 'Unable to send key-revoked notification email to user: '\n . $mailer->ErrorInfo,\n \\CLogger::LEVEL_WARNING\n );\n }\n }\n }", "public function bulkRevokeTokens($options)\n {\n $this->bulkRevokeTokensWithHttpInfo($options);\n }", "public function revokeAuthCode($codeId)\n {\n $authCodeModel = $this->modelResolver->getModel('AuthCodeModel');\n $authCodeModel::where('token', $codeId)->delete();\n }", "public function notifyApiOwnerOfRevokedKey(\n \\YiiMailer $mailer = null,\n array $appParams = null\n ) {\n // If not given the Yii app params, retrieve them.\n if ($appParams === null) {\n $appParams = \\Yii::app()->params->toArray();\n }\n \n // If we are in an environment where we should NOT send email\n // notifications, then don't.\n if ($appParams['mail'] === false) {\n return;\n }\n \n if ($this->api->owner && $this->api->owner->email) {\n\n // Try to send them a notification email.\n if ($mailer === null) {\n $mailer = \\Utils::getMailer();\n }\n $mailer->setView('key-revoked-api-owner');\n $mailer->setTo($this->api->owner->email);\n $mailer->setSubject(sprintf(\n 'Key revoked for %s API',\n $this->api->display_name\n ));\n if (isset($appParams['mail']['bcc'])) {\n $mailer->setBcc($appParams['mail']['bcc']);\n }\n $mailer->setData(array(\n 'apiOwner' => $this->api->owner,\n 'api' => $this->api,\n 'key' => $this,\n 'keyOwner' => $this->user,\n ));\n\n // If unable to send the email, allow the process to\n // continue but communicate the email failure somehow.\n if ( ! $mailer->send()) {\n \\Yii::log(\n 'Unable to send key-revoked notification email to API '\n . 'owner: ' . $mailer->ErrorInfo,\n \\CLogger::LEVEL_WARNING\n );\n }\n }\n }", "public function resetApiKey()\n {\n $this->resetApiKeyWithHttpInfo();\n }", "public function revoke(Request $request)\n {\n // Check if the name of the instance to revoke has been supplied.\n $name = $request->input(\n static::AUTH_NAME_PARAM_NAME,\n Authorisation::DEFAULT_NAME\n );\n\n $final_url = $request->input(static::FINAL_URL_PARAM_NAME);\n\n // Get the authorisation of the givem name for the current user.\n $auth = Authorisation::currentUser()\n ->name($name)\n ->isActive()\n ->first();\n\n if ($auth) {\n $auth->revokeAuth();\n $auth->save();\n }\n\n if ($final_url) {\n return redirect($final_url);\n } else {\n return redirect()->back();\n }\n }", "public function unlink() {\n $this->credential->setAccessToken(null);\n $this->credential->setTokenType(null);\n }", "protected function sendNonPendingKeyDeletionNotification(\n \\YiiMailer $mailer,\n array $appParams\n ) {\n if ($this->user && $this->user->email) {\n\n // Send notification to owner of key that it was revoked.\n $mailer->setView('key-deleted');\n $mailer->setTo($this->user->email);\n $mailer->setSubject(sprintf(\n 'API key deleted for %s API',\n $this->api->display_name\n ));\n if (isset($appParams['mail']['bcc'])) {\n $mailer->setBcc($appParams['mail']['bcc']);\n }\n $mailer->setData(array(\n 'key' => $this,\n 'api' => $this->api,\n ));\n \n // If unable to send the email, allow the process to\n // continue but communicate the email failure somehow.\n if ( ! $mailer->send()) {\n \\Yii::log(\n 'Unable to send key deletion email: '\n . $mailer->ErrorInfo,\n \\CLogger::LEVEL_WARNING\n );\n }\n }\n }", "public function revokeCurrentApiKey(): bool\n {\n $url = $this->getApiUrl() . 'api-keys/current';\n $headers = $this->getRequestHeaders();\n $method = 'DELETE';\n $response = $this->getHttpClient()->request($method, $url, $headers);\n\n if ($response->getStatus() === 200) {\n return true;\n } else {\n throw $this->getExceptionByStatusCode($method, $url, $response);\n }\n }", "public static function del($keys)\n {\n return parent::del($keys);\n }", "public function revokeUserKey($appUserID, $label)\n {\n // Check to see if the key exists for the user first\n $result = $this->sdb->query(\"select id from api_keys where uid=$1 and label=$2;\", [$appUserID, $label]);\n\n // Return only the data returned (one row);\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n $all = $row;\n }\n\n // If key exists for the user, then delete it\n if (!empty($all) && isset($all[\"id\"])) {\n $result = $this->sdb->query(\"delete from api_keys where id=$1 returning *;\", [$all[\"id\"]]);\n // Return only the data returned (one row);\n $check = array();\n while($row = $this->sdb->fetchrow($result))\n {\n $check = $row;\n }\n\n // Sanity check: did we actually delete something?\n if (empty($all))\n return false;\n return true;\n }\n\n return false;\n }", "protected function deleteRSAPairKeys()\n {\n $basePath = keys_path();\n $keys = [$basePath . 'rsa-private-key.key', $basePath . 'rsa-public-key.key'];\n\n foreach ($keys as $key) {\n if (!file_exists($key)) {\n throw new KeyException(\"[KeyException]:\\n\\n>>> There is no key to drop!\\n\");\n }\n @unlink($key);\n }\n }" ]
[ "0.60081214", "0.5768068", "0.54424673", "0.5417898", "0.5338536", "0.5329902", "0.5118892", "0.5112476", "0.51051366", "0.51036537", "0.50865597", "0.5074073", "0.50487447", "0.50487447", "0.5042517", "0.5034107", "0.50074816", "0.48802537", "0.48591533", "0.48548317", "0.48276368", "0.47960457", "0.4759395", "0.47457138", "0.47277507", "0.47186545", "0.4714604", "0.47016907", "0.46843123", "0.46821603" ]
0.6110338
0
Return a unique zip filename in the Elvis folder in the storage directory.
private function createUniqueZipFilename() { $directory = storage_path() . '/elvis/'; if (!file_exists($directory)) { mkdir($directory); } return $directory . Str::random(40) . '.zip'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeFilename()\n {\n return getcwd().'/package'.md5(time().uniqid()).'.zip';\n }", "protected function makeFilename()\n {\n return getcwd().'/bolt_'.md5(time().uniqid()).'.zip';\n }", "protected static function generateArchiveName(): string\n {\n $archiveName = sprintf(\n '%s_%s_%s.zip',\n strtoupper(env('APP_NAME', 'default')),\n env('APP_VERSION', '0.0.1'),\n Carbon::now(env('APP_TIMEZONE', 'UTC'))->format('Y-m-d-H-i-s-u')\n );\n\n return storage_path($archiveName);\n }", "protected function makeFilename()\n {\n return getcwd().'/october_installer_'.md5(time().uniqid()).'.zip';\n }", "public function getZipfileName()\r\n {\r\n return $this->zip_filename;\r\n }", "public function toZip() : string\n {\n $rootPath = $this->getStoragePath();\n $outputPath = join_paths('/tmp/', $this->uid.'.zip');\n\n // Initialize archive object\n $zip = new ZipArchive();\n $zip->open($outputPath, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n\n // Create recursive directory iterator\n /** @var SplFileInfo[] $files */\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($rootPath),\n RecursiveIteratorIterator::LEAVES_ONLY\n );\n\n foreach ($files as $name => $file) {\n // Skip directories (they would be added automatically)\n if (!$file->isDir()) {\n // Get real and relative path for current file\n $filePath = $file->getRealPath();\n $relativePath = substr($filePath, strlen($rootPath) + 1);\n\n // Add current file to archive\n $zip->addFile($filePath, $relativePath);\n }\n }\n\n // Zip archive will be created only after closing object\n $zip->close();\n\n return $outputPath;\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName() {\r\n \r\n return md5(uniqid());\r\n }", "public function getZipFile(): string\n {\n return $this->zip_file;\n }", "public function encrypt_name(){\n $filename = md5(uniqid(mt_rand()));\n return $filename;\n }", "private function createZip(Collection $entries) {\n $random = str_random();\n $path = storage_path(\"app/temp/zips/$random.zip\");\n $zip = new ZipArchive();\n\n $zip->open($path, ZIPARCHIVE::CREATE);\n\n $this->fillZip($zip, $entries);\n\n $zip->close();\n\n return $path;\n }", "private function generateUniqueFileName()\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName() :string\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "private function generateUniqueFileName()\n {\n return md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));\n }", "protected function filename()\n {\n return 'wallet_' . date('YmdHis');\n }", "public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }", "function generate_zip($filename){\n\n try {\n $filename = $this->parent_dir() . ($filename);\n\t\t\t@unlink($filename);\n \n\t\t\t$zip = new ZipArchive();\n\t\t\t$ret = $zip->open($filename, ZipArchive::CREATE );\t\t\t\n\t\t\t$files = glob( $this->working_dir .'page*' );\n foreach($files as $fn){\n $zip->addFile($fn,basename($fn));\n }\n\n $zip->close();\n \n return $filename;\n } catch (Exception $ex){\n error_log($ex->getMessage() );\n }\n }", "protected function _getFileName() {\n\n\t\t\treturn \t$this->_cacheFolder.$this->_getHash($this->_cacheFile).$this->_cacheExtension;\n\n\t\t}", "private function archiveTargetName(): string {\n return \"Media library collection_{$this->currentDate()}.zip\";\n }", "private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }", "public function cache_filename()\n {\n return $this->_name . '_' . $this->id() . '.' . $this->_type;\n }", "protected function filename()\n {\n return 'active-checkouts-' . Carbon::now()->format('m-d-Y');\n }", "public function getName()\n {\n return $this->nameInsideZip;\n }" ]
[ "0.7570685", "0.755048", "0.75492525", "0.75096065", "0.66830945", "0.65340286", "0.6525944", "0.651863", "0.651863", "0.651863", "0.651863", "0.651863", "0.651863", "0.65106976", "0.6480843", "0.6367123", "0.6359182", "0.6345084", "0.6333627", "0.63045716", "0.6269606", "0.6186969", "0.61661315", "0.6151663", "0.61300045", "0.61234546", "0.60647917", "0.6061538", "0.6016464", "0.5997736" ]
0.8426513
0
Lock object in memory.
public function lock() { if ( !($this->_state & self::LOADED) ) { $this->_memManager->load($this, $this->_id); $this->_state |= self::LOADED; } $this->_state |= self::LOCKED; /** * @todo * It's possible to set "value" container attribute to avoid modification tracing, while it's locked * Check, if it's more effective */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lock() {}", "public function lock(): void;", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "public function lock()\n {\n $this->isLocked = true;\n }", "abstract protected function lock(): void;", "function lockCacheObject ()\n {\n return copy($this->cacheObjectId, $this->cacheObjectId.'.lock');\n }", "public function lock()\n {\n $this->locked = true;\n }", "public function lock()\n {\n $this->lock = true;\n }", "function lock()\n{\n}", "public function lock()\n {\n $shmId = shmop_open($this->getIndexerId(), 'c', self::PERM, self::LEN);\n shmop_write($shmId, $this->_getMicrotimeString(), 0);\n shmop_close($shmId);\n $this->_isLocked = true;\n }", "public function acquireSharedLock() {}", "public function lockToNormal() {}", "protected function lock()\n {\n $this->isStateLocked = true;\n }", "private function lockConcurrentExecution()\n\t{\n\t\t$tag = $this->getLockTag();\n\t\t$app = \\Bitrix\\Main\\Application::getInstance();\n\t\t$managedCache = $app->getManagedCache();\n\t\t$managedCache->clean($tag);\n\t\t$managedCache->read(self::LOCK_TTL, $tag);\n\t\t$managedCache->setImmediate($tag, true);\n\t}", "function loadLockedObject()\n {\n return $this->cacheObjectContents($this->cacheObjectId.'.lock');\n }", "public function acquireExclusiveLock() {}", "function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }", "public function trylock() {}", "public function lockAndBlock()\n {\n $this->lock();\n }", "public function enableLocked()\n\t{\n\t\t$this->_locked = true;\n\t}", "public function lock()\r\n {\r\n $this->locked = true;\r\n\r\n return $this;\r\n }", "public function lock()\n {\n $this->lock = TRUE;\n return $this;\n\n }", "function lock(Sabre_DAV_Locks_LockInfo $lockInfo);", "public static function setLocked()\n {\n self::$locked = true;\n }", "public function lock()\n {\n if ($this->isLocked()) {\n throw new RuntimeException('Cannot lock: already locked');\n }\n\n $this->conn->set('lock:' . $this->name, $this->id);\n }" ]
[ "0.79939806", "0.76784873", "0.7584581", "0.7584581", "0.7584581", "0.7584581", "0.7584581", "0.7529791", "0.7516779", "0.74915516", "0.7487365", "0.7477436", "0.73398083", "0.7234214", "0.7216432", "0.71107876", "0.7060109", "0.70130384", "0.699959", "0.6960688", "0.69207907", "0.6845118", "0.68262297", "0.6758483", "0.67281514", "0.6656228", "0.662474", "0.65917075", "0.6589276", "0.6560786" ]
0.8080703
0
Set value (used by memory manager when value is loaded)
public function setValue($value) { $this->_value = new Zend_Memory_Value($value, $this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setValue($value, $load = false);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "abstract public function setValue($value);", "public function setValue($value){\n $this->_value = $value;\n }", "function setValue($value) {\n $this->value = $value;\n }", "function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}" ]
[ "0.77804565", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724653", "0.7724288", "0.7724288", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76851404", "0.76654893", "0.7624043", "0.75582564", "0.75443", "0.75266945", "0.7501171" ]
0.7927431
0
Check if object is marked as swapped
public function isSwapped() { return $this->_state & self::SWAPPED; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_switched()\n {\n }", "protected function isUnchanged() {}", "function ms_is_switched()\n {\n }", "function ms_is_switched() {\n\treturn ! empty( $GLOBALS['_wp_switched_stack'] );\n}", "public function retainObjectOrder()\n {\n return false;\n }", "public function reverseState()\n {\n $etat = $this->getIsActive();\n\n return !$etat;\n }", "public function reverseState()\n {\n $etat = $this->getIsActive();\n\n return !$etat;\n }", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "public function setTrapped($trapped) {}", "public function is_switched() {\n\t\treturn ! empty( $this->locales );\n\t}", "public function markAsSwapped()\n {\n // Clear LOADED state bit\n $this->_state |= self::LOADED;\n }", "public function markUnchanged();", "protected function shouldCallReversed()\n {\n return property_exists($this, 'callReversed') ? $this->callReversed : true;\n }", "function isInReverse() {\n return $this->_inReverse;\n }", "function __flip(&$tmp) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function isSortable() {\n\t\treturn $this->sortKey != null;\n\t}", "public function isSortable() {\n\t\treturn $this->sortKey != null;\n\t}", "public function isSortable(): bool\n {\n return $this->isSortable;\n }", "public function isReversed() {\n\t\treturn $this->attributes['reversed'];\n\t}", "public static function swap($instance)\n {\n }", "public static function swap($instance)\n {\n }", "public static function swap($instance)\n {\n }", "public static function swap($instance)\n {\n }", "public function isSortable()\n {\n return $this->is_sortable;\n }", "public function isSortable() {\n\t\treturn $this->isSortable;\n\t}", "public function isSortable()\n {\n return $this->field()->isSortable();\n }", "public function hasIsReverse()\n {\n return $this->is_reverse !== null;\n }", "public function isSortable()\n {\n return $this->sortable;\n }", "public function rollback(): bool\r\n {\r\n return $this->instance->rollBack() === true;\r\n }", "public function swap($k, $j) {\n if (!isset($this->_hash[$k]) || !isset($this->_hash[$j])) {\n return FALSE;\n }\n $t= $this->_hash[$k];\n $this->_hash[$k]= $this->_hash[$j];\n $this->_hash[$j]= $t;\n return TRUE;\n }" ]
[ "0.67545384", "0.637417", "0.5814218", "0.5543415", "0.5515815", "0.54928035", "0.54928035", "0.53640574", "0.5350206", "0.53006804", "0.52732044", "0.5247265", "0.5108829", "0.51074255", "0.5100363", "0.49751502", "0.49751502", "0.4940735", "0.4918538", "0.48654747", "0.48654747", "0.48654747", "0.48654747", "0.48612514", "0.48496947", "0.48081726", "0.47767922", "0.47651276", "0.47606623", "0.46983892" ]
0.7614702
0
Destroy memory container and remove it from memory manager list
public function destroy() { /** * We don't clean up swap because of performance considerations * Cleaning is performed by Memory Manager destructor */ $this->_memManager->unlink($this, $this->_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function dropContainer(): void {\n self::$instance = null;\n }", "function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function destroy();", "public function garbageCollection();", "public static function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public static function destroy();", "public function destroy()\n {\n $this->items = array();\n }", "public function destroy()\n\t{\n\t\t//\n\t}", "abstract protected function _destroy();", "public function detach()\n\t{\n\t\tif (null !== $this->shmId) {\n\t\t\tshmop_close($this->shmId);\n\t\t\t$this->shmId = null;\n\t\t}\n\t}", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "function destroy() ;", "public function __destruct() {\r\n if ($this->option_remove) {\r\n $this->transaction_start();\r\n $shm_id = $this->_open_existing();\r\n if (isset($shm_id)) {\r\n shmop_delete($shm_id);\r\n shmop_close($shm_id);\r\n }\r\n }\r\n $this->transaction_finish();\r\n }", "private function destroyCache()\r\n\t{\r\n\t\t$memcache = new \\Memcached();\r\n\t\t$memcache->addServer('localhost', 11211);\r\n\t\t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n\t\t$cache_data = $memcache->delete($key);\r\n\t}", "function __destroy() {\n }", "public function __destruct()\n {\n imagedestroy($this->layout);\n foreach((array)$this->images as $image) {\n imagedestroy($image);\n }\n }", "public function destroy() {\n\t\t$this->removeInstance();\n\t\t$this->tearDownTestDatabase();\n\t}", "public function destroy()\n {\n $this->stop();\n $this->setupListeners();\n }" ]
[ "0.6664783", "0.65328825", "0.6412288", "0.6412288", "0.6412288", "0.6412288", "0.6412288", "0.6412288", "0.6412288", "0.6379874", "0.63675743", "0.6337551", "0.6337551", "0.6337551", "0.6337551", "0.6337551", "0.633751", "0.63256955", "0.6285606", "0.6238078", "0.62055635", "0.618614", "0.6180849", "0.6153533", "0.6150839", "0.6144559", "0.6136115", "0.612072", "0.6070837", "0.600517" ]
0.68093324
0
Get the value of errorIcon
public function getErrorIcon() { return $this->errorIcon; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "public function icon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->get(self::_ICON);\n }", "public function getIcon() {\n return $this->icon;\n }", "public function getIcon() {\n return $this->icon;\n }", "public function getIcon() {\n\t\treturn $this->icon;\n\t}", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}", "public function getIcon()\n\t{\n\t\treturn $this->icon;\n\t}", "public function getIcon()\n {\n return $this->_icon;\n }", "public function getIcon()\n {\n return $this->Icon;\n }", "public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}", "public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }", "public function icon(): ?string\n {\n return $this->getAttribute('icon');\n }", "public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError();", "public function getError();", "public function getError();", "public function getIcon() {}" ]
[ "0.70776504", "0.70776504", "0.69794035", "0.69553447", "0.6916963", "0.6916963", "0.69139004", "0.6906492", "0.6906492", "0.6906492", "0.6906492", "0.6906492", "0.6906492", "0.6906492", "0.6888174", "0.68779695", "0.68680894", "0.68303347", "0.67731565", "0.6759747", "0.6727621", "0.6574029", "0.65718037", "0.6556607", "0.65252316", "0.65252316", "0.6487093", "0.6487093", "0.6487093", "0.6454465" ]
0.86516255
0
Get the value of errorDesc
public function getErrorDesc() { return $this->errorDesc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getErrorDescription() {\n\t\treturn $this->error_description;\n\t}", "public function getErrorDescription()\n {\n return $this->errorDescription;\n }", "public function getErrorDescription(): string\n {\n return $this->errorDescription;\n }", "public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}", "public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }", "public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }", "public function getErrorMsg()\n\t{\n\t\treturn $this->error;\n\t}", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "public function getError(): string\n {\n return $this->Error;\n }", "public function getError(): string\n {\n return $this->error;\n }", "public function getErrorText(){\n return $this->error;\n }", "public function getMessage()\n {\n return $this->_error;\n }", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "function errorMsg() {\r\n return \r\n $this->resultError;\r\n }", "public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}", "public function getErrorDetail()\n {\n return $this->singleValue('//i:errorDetail');\n }", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }", "public function getError()\n\t{\n\t\treturn $this->err;\n\t}", "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}", "public function getError() : string\r\n {\r\n return $this->strError;\r\n }", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public function errorInfo()\n {\n return $this->error;\n }" ]
[ "0.7963527", "0.7799581", "0.7755414", "0.76882154", "0.75526524", "0.7546791", "0.7464236", "0.740983", "0.740983", "0.74003184", "0.73228717", "0.7320093", "0.7292492", "0.72740436", "0.7264626", "0.7254259", "0.72516125", "0.72449696", "0.72449696", "0.72432756", "0.72352976", "0.7228905", "0.72282124", "0.72278965", "0.71961284", "0.7185707", "0.7178004", "0.7177392", "0.7172524", "0.71632034" ]
0.8590951
0
/Leads Reports by user (Sales Calls)
public function salesCallsReport(Request $request) { $validator = Validator::make($request->all(), [ 'user_id' => 'required' ]); if ($validator->fails()) { return response()->json(array( 'status' => 400, 'message'=> 'Error', 'error_message'=>$validator->errors() ),200); } if (!empty($request->date) || !empty($request->status)) { $queryData = Lead::join('users','leads.user_id','=','users.id'); if (!empty($request->date)) { $queryData = $queryData->where('leads.date',$request->date); } if (!empty($request->status)) { $queryData = $queryData->where('leads.status',$request->status); } $leads = $queryData->where('leads.user_id',$request->user_id) ->select('leads.*','users.name as user_name') ->get(); }else{ $leads = Lead::join('users','leads.user_id','=','users.id') ->where('leads.user_id',$request->user_id) ->select('leads.*','users.name as user_name') ->get(); } $data = []; foreach ($leads as $key => $lead) { $data[] = [ 'id' => $lead->id, 'user_id' => $lead->user_id, 'name' => $lead->name, 'email' => $lead->email, 'phone' => $lead->phone, //'message' => $lead->message, 'status' => $lead->status, 'date' => date('Y-m-d',strtotime($lead->created_at)), //'comments' => $this->getLeadComments($lead->id), ]; } if (count($data)>0) { return response()->json(array( 'status' => 200, 'message'=> 'Success', 'success_message'=>'Data found.', 'data' => $data, ),200); }else{ return response()->json(array( 'status' => 400, 'message'=> 'Error', 'error_message'=>'No data found!' ),200); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function leads()\n {\n $this->load->model('leads_model');\n $data['statuses'] = $this->leads_model->get_status();\n $this->load->view('admin/reports/leads', $data);\n }", "public function index()\n { \n \n $user_id = session('USER_ID');\n $leads = Lead::where(['user_id'=>$user_id])->paginate(10);\n $lead_source_data = DB::table('leads')\n ->distinct()\n ->select('lead_source.id','lead_source.name')\n ->Join('lead_source','leads.lead_source_id','=','lead_source.id')\n ->get();\n $count = Lead::where(['user_id'=>$user_id])->count();\n /** Activity */\n $activity = Activity::where(['user_id'=>$user_id])->get()->toArray();\n if(isset($activity[0]['status'])){\n $activity = $activity[0]['status'];\n }else{\n $activity = 0; \n }\n\n return view('crm.leads.leads',compact('leads','lead_source_data','count','activity'));\n }", "public function index(){\n $this->data['counterup'] = true;\n $this->data['ckeditor'] = TRUE;\n $this->data['title'] = 'Agent | Dialer';\n $this->data['pagetitle'] = 'Dialer';\n $this->data['datatable'] = TRUE;\n /* recent calls */\n $options = array('LIMIT' => array('start' => '6', 'end' => '0'), 'ORDER_BY' => array('field' => 'unique_id', 'order' => 'DESC'));\n $options['conditions'] = 'agent_id = ' . $this->session->userdata('agent')->id . ' AND call_log.lead_id != \"\"';\n $options[\"JOIN\"] = array(array(\n 'table' => 'lead_store_mst',\n 'condition' => 'lead_store_mst.lead_id = call_log.lead_id',\n 'type' => 'FULL'\n )\n );\n $options['fields'] = 'call_log.unique_id,call_log.type,lead_store_mst.phone,call_log.lead_id,lead_store_mst.first_name,lead_store_mst.last_name';\n $this->data['callLogs'] = $this->Callog_m->get_relation('', $options);\n $id=$this->session->userdata['user']->id ;\n $this->data['tasks'] = $this->Tasks_m->get_by(array('user_id'=>$id));\n /* agentID */\n $agentID=$this->session->userdata['agent']->id;\n /* total outbound calls */\n $relation = array(\n 'fields' => \"count(*) As total\",\n 'conditions' => \"agent_id = $agentID AND TYPE = 'outbound'\"\n );\n $data = $this->Callog_m->get_relation('', $relation);\n $this->data['totalOutbound'] = $data['0']['total'];\n /* total inbound calls */\n $relation = array(\n 'fields' => \"count(*) As total\",\n 'conditions' => \"agent_id = $agentID AND TYPE = 'inbound'\"\n );\n $data = $this->Callog_m->get_relation('', $relation);\n $this->data['totalInbound'] = $data['0']['total'];\n $this->template->load(\"agent\", \"dialpad/index\", $this->data);\n }", "public function called(){\n\n $telecaller_id = Auth::guard('telecaller')->user()->id;\n\n\n\n $data = [\n\n 'data' => EnquiryLeads::getAllEnquiry('telecaller','2'),\n\n 'enquiry_src' => EnquirySrc::where('status','0')->where('is_deleted','0')->get(),\n\n 'course' => Course::where('status','0')->where('is_deleted','0')->get(),\n\n 'single_enquiry_src' => new EnquirySrc,\n\n 'single_course' => new Course,\n\n 'lead_quality' => LeadQuality::get(),\n\n 'single_lead_quality' => new LeadQuality,\n\n 'type' => 'called',\n\n 'link' => env('telecaller').'/enquiry_leads_called'\n\n ];\n\n\n\n return View('telecaller.enquiry_leads.index',$data);\n\n }", "function nycc_rides_report_leaders() {\r\n $sql = array();\r\n $sql['query'] = \"SELECT np.title AS name, np.nid, count(*) AS cnt FROM node np, content_type_rides r, content_field_ride_leaders l, node nr WHERE l.field_ride_leaders_nid = np.nid AND np.type='profile' AND l.nid = r.nid AND l.vid = r.vid AND np.status <> 0 AND nr.nid = r.nid AND nr.vid = r.vid AND nr.status <> 0 \";\r\n\r\n $sql['count'] = \"SELECT COUNT(DISTINCT np.title) AS cnt FROM node np, content_type_rides r, content_field_ride_leaders l, node nr WHERE l.field_ride_leaders_nid = np.nid AND np.type='profile' AND l.nid = r.nid AND l.vid = r.vid AND np.status <> 0 AND nr.nid = r.nid AND nr.vid = r.vid AND nr.status <> 0 \";\r\n\r\n return nycc_rides_report(\"Ride Reports: Leaders\", $sql, nycc_rides_report_rides_header_1(), 'nycc_rides_report_rides_process_row_1', 1);\r\n}", "function get_invites_leads(){\n\t\t$query = $this->db->query(\"SELECT campaignname, company, concat(firstname,' ',lastname) as name, designation, email FROM `vtiger_invites` as invites LEFT JOIN vtiger_campaign as campaign on invites.campaignid=campaign.campaignid INNER JOIN vtiger_leaddetails as leads on invites.crmid = leads.leadid INNER JOIN vtiger_leadscf as leadscf on leads.leadid=leadscf.leadid where module='leads'\");\n\t\treturn $query->result();\n\t}", "public function index()\n {\n return LeadResource::collection(\n auth()->user()\n ->tbl_leads()\n ->with(\n 'users',\n 'tbl_accounts',\n 'tbl_leadsource',\n 'tbl_leadstatus',\n 'tbl_industrytypes',\n 'tbl_leadsource',\n 'tbl_leadstatus',\n 'tbl_industrytypes',\n 'tbl_countries',\n 'tbl_states')\n ->latest()\n ->paginate(15));\n }", "function admin_userReports()\n\t{\n\t\t$this->User->recursive = 0;\n\t\t$rol = $this->data['User']['role_id'];\t\n\t\tforeach($this->data['User'] as $indice =>$valor)\n\t\t{\n\t\t\tif($valor==1)\n\t\t\t{\n\t\t\t\t$array[] = $indice;\n\t\t\t}\n\t\t}\n\t\t$reporte = $this->User->find('all', array('fields'=>$array,'conditions'=>array('User.role_id'=>$rol)));\n\t\t$this->set(compact('reporte'));\n\t}", "public function getReportsByUserIdAndDate($user_id, $date){\n $sql = \"SELECT t1.id\n FROM reports t1\n WHERE t1.lord_id = :user_id OR t1.lead_tenant_id = :user_id AND :date BETWEEN t1.check_in AND t1.check_out\n GROUP BY t1.id\";\n\n return $this->_db->select($sql, array(':user_id' => $user_id, ':date' => $date));\n }", "public function getCountLeads()\n {\n $data = $this->call('apps/' . $this->appId . '/users', [], 'get');\n\n if ($data['total']) {\n return (int)$data['total'];\n }\n\n return 0;\n }", "public function payForInvitedUsers(){\n \n $userService = parent::getService('user','user');\n \n $refererUsers = $userService->getUsersWithRefererNotPaid();\n foreach($refererUsers as $user):\n // if created at least 30 days ago\n if(strtotime($user['created_at'])>strtotime('-30 days')){\n continue;\n }\n // if logged within last 5 days ago\n if(!(strtotime($user['last_active'])>strtotime('-7 days'))){\n $user->referer_not_active = 1;\n $user->save();\n continue;\n }\n \n $values = array();\n $values['description'] = 'Referencing FastRally to user '.$user['username'];\n $values['income'] = 1;\n \n \n if($user['gold_member_expire']!=null){\n $amount = 100;\n }\n else{\n $amount = 10;\n }\n \n \n $userService->addPremium($user['referer'],$amount,$values);\n $user->referer_paid = 1;\n $user->save();\n endforeach;\n echo \"done\";exit;\n }", "public function agentSaleList($id)\n {\n $report_info =array();\n $operator_id =$this->myGlob->operator_id;\n $agent_ids =$this->myGlob->agent_ids;\n $agopt_ids =$this->myGlob->agopt_ids;\n $operator_ids =array();\n if($agopt_ids){\n $operator_ids =$agopt_ids;\n }else{\n $operator_ids[] =$operator_id;\n }\n $agent_status=$agent_id =$id;\n $trips =Input::get('trips'); //for agent report or not\n $search=array();\n $search['agent_rp'] =1;\n\n $from =Input::get('from');\n $to =Input::get('to');\n\n $start_date =Input::get('start_date');\n $end_date =Input::get('end_date') ? Input::get('end_date') : $this->getDate();\n if($start_date){\n $start_date =str_replace('/', '-', $start_date);\n $start_date =date('Y-m-d', strtotime($start_date));\n $end_date =str_replace('/', '-', $end_date);\n $end_date =date('Y-m-d', strtotime($end_date));\n }else{\n $start_date=$this->getDate();\n $end_date=$this->getDate();\n }\n\n $departure_time =Input::get('departure_time');\n $departure_time =str_replace('-', ' ', $departure_time);\n\n $operator_id =$operator_id ? $operator_id : $this->myGlob->operator_id;\n\n if($from=='all')\n $from=0;\n\n $trip_ids=array();\n $sale_item=array();\n $order_ids=array();\n\n if($departure_time){\n $trip_ids=Trip::wherein('operator_id',$operator_ids)\n ->wheretime($departure_time)->lists('id');\n }else{\n $trip_ids=Trip::wherein('operator_id',$operator_ids)\n ->lists('id');\n }\n\n if($trip_ids)\n $order_ids=SaleItem::wherein('trip_id',$trip_ids)\n ->where('departure_date','>=',$start_date)\n ->where('departure_date','<=',$end_date)\n ->groupBy('order_id')->lists('order_id');\n\n if($order_ids)\n $order_ids=SaleOrder::wherein('id',$order_ids)->wherebooking(0)->lists('id');\n\n if($order_ids)\n { \n /******************************************************************************** \n * For agent report by agent group and branches OR don't have branch agent\n ***/\n $agentgroup_id =Input::get('agentgroup');\n if($agentgroup_id==\"All\")\n $agentgroup_id=0;\n $arr_agent_id =array();\n\n if($agentgroup_id && $agent_id)\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get(); \n }\n elseif(!$agentgroup_id && $agent_id)\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get();\n }\n elseif($agentgroup_id && !$agent_id)\n {\n $arr_agent_id=Agent::whereagentgroup_id($agentgroup_id)->lists('id');\n \n $order_ids2=array();\n if($arr_agent_id)\n $order_ids2=SaleItem::wherein('agent_id',$arr_agent_id)->where('departure_date','>=',$start_date)->where('departure_date','<=',$end_date)->groupBy('order_id')->lists('order_id');\n // for unique orderids for all agent branches\n $order_id_list=array_intersect($order_ids, $order_ids2);\n // dd($order_id_list);\n if($order_id_list)\n $sale_item = SaleItem::wherein('order_id', $order_id_list)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n // ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get(); \n }\n /***\n * End For agent report by agent group and branches OR don't have branch agent\n *********************************************************************************/\n \n /******************************************************************* \n * for Trip report \n */\n else\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->groupBy('order_id')->orderBy('departure_date','asc')->get();\n }\n\n }\n \n $lists = array();\n foreach ($sale_item as $rows) {\n $local_person = 0;\n $foreign_price = 0;\n $total_amount = 0;\n $commission=0;\n $percent_total=0;\n $trip = Trip::whereid($rows->trip_id)->first();\n $order_date=SaleOrder::whereid($rows->order_id)->pluck('orderdate');\n $list['order_date'] = $order_date;\n $list['order_id'] = $rows->order_id;\n // dd($rows->agent_id);\n $agent_name=Agent::whereid($rows->agent_id)->pluck('name');\n $list['agent_id']=$rows->agent_id ? $rows->agent_id : 0;\n $list['agent_name']=$agent_name ? $agent_name : \"-\";\n \n if($trip){\n $list['id'] = $rows->trip_id;\n $list['bus_id'] = $rows->busoccurance_id;\n $list['departure_date'] = $rows->departure_date;\n $list['from_id'] = $trip->from;\n $list['to_id'] = $trip->to;\n $list['from_to'] = City::whereid($trip->from)->pluck('name').'-'.City::whereid($trip->to)->pluck('name');\n $list['time'] = $trip->time;\n $list['class_id'] = $trip->class_id;\n $list['class_name'] = Classes::whereid($trip->class_id)->pluck('name');\n \n $list['from_to_class']=$list['from_to']. \"(\".$list['class_name'].\")\";\n \n $nationality=SaleOrder::whereid($rows->order_id)->pluck('nationality');\n \n $agent_commission = AgentCommission::wheretrip_id($rows->trip_id)->whereagent_id($rows->agent_id)->first();\n if($agent_commission){\n $commission = $agent_commission->commission;\n }else{\n $commission = Trip::whereid($rows->trip_id)->pluck('commission');\n }\n\n if( $nationality== 'local'){\n $local_person += $rows->sold_seat;\n $total_amount += $rows->free_ticket > 0 ? ($rows->price * $rows->sold_seat) - ($rows->price * $rows->free_ticket) : $rows->price * $rows->sold_seat ;\n $tmptotal =$rows->price * ($rows->sold_seat- $rows->free_ticket);\n $percent_total +=$tmptotal - ($commission * ($rows->sold_seat- $rows->free_ticket));\n }else{\n $foreign_price += $rows->sold_seat;\n $total_amount += $rows->free_ticket > 0 ? ($rows->foreign_price * $rows->sold_seat) - ($rows->foreign_price * $rows->free_ticket) : $rows->foreign_price * $rows->sold_seat ;\n $tmptotal =$rows->foreign_price * ($rows->sold_seat- $rows->free_ticket);\n $percent_total +=$tmptotal - ($commission * ($rows->sold_seat- $rows->free_ticket));\n }\n $list['local_person'] = $local_person;\n $list['foreign_person'] = $foreign_price;\n $list['local_price'] = $rows->price;\n $list['foreign_price'] = $rows->foreign_price;\n $list['sold_seat'] = $rows->sold_seat;\n $list['free_ticket'] = $rows->free_ticket;\n $list['total_amount'] = $total_amount;\n $list['percent_total'] = $percent_total;\n $lists[] = $list;\n }\n }\n //Grouping from Lists\n $stack = array();\n foreach ($lists as $rows) {\n if($search['agent_rp'])\n $check = $this->ifExistAgent($rows, $stack);\n else\n $check = $this->ifExist($rows, $stack);\n if($check != -1){\n $stack[$check]['local_person'] += $rows['local_person'];\n $stack[$check]['foreign_person'] += $rows['foreign_person'];\n $stack[$check]['sold_seat'] += $rows['sold_seat'];\n $stack[$check]['free_ticket'] += $rows['free_ticket'];\n $stack[$check]['total_amount'] += $rows['total_amount'];\n $stack[$check]['percent_total'] += $rows['percent_total'];\n }else{\n array_push($stack, $rows);\n }\n }\n\n $search['agentgroup']=\"\";\n $agentgroup=array();\n $agentgroup=AgentGroup::whereoperator_id($operator_id)->get();\n $search['agentgroup']=$agentgroup;\n\n $cities=array();\n $cities=$this->getCitiesByoperatorId($operator_id);\n $search['cities']=$cities;\n \n $times=array();\n $times=$this->getTime($operator_id, $from, $to);\n $search['times']=$times;\n\n $search['operator_id']=$operator_id;\n $search['trips']=$trips;\n $search['from']=$from;\n $search['to']=$to;\n $search['time']=$departure_time;\n $search['start_date']=$start_date;\n $search['end_date']=$end_date;\n $search['agentgroup_id']=Input::get('agentgroup')? Input::get('agentgroup') : 0;\n $search['agent_name']=Agent::whereid($id)->pluck('name');\n $search['agent_id']=$id;\n \n // sorting result\n $response=$this->msort($stack,array(\"departure_date\",\"time\"), $sort_flags=SORT_REGULAR,$order=SORT_ASC);\n \n // grouping\n if($search['agent_rp']==1){\n $tripandorderdategroup = array();\n foreach ($response AS $arr) {\n $tripandorderdategroup[$arr['agent_name']][] = $arr;\n }\n }\n else\n {\n $tripandorderdategroup = array();\n foreach ($response AS $arr) {\n $tripandorderdategroup[$arr['from_to_class']][] = $arr;\n }\n // sorting\n }\n ksort($tripandorderdategroup);\n\n $agent=Agent::whereoperator_id($operator_id)->where('id','!=',$id)->get();\n // return Response::json($tripandorderdategroup);\n return View::make('agent.agentsalelist', array('response'=>$tripandorderdategroup, 'search'=>$search,'agentlist'=>$agent));\n }", "public function get_reports() {\n $data['results'] = $this->Report_Model->get_membership_payments();\n // print_r($data['results']);\n $this->render('list', $data);\n }", "public function leads_this_week_report()\n {\n echo json_encode($this->reports_model->leads_this_week_report());\n }", "function getAllReports(){\n global $errors;\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles, $keyword;\n\t\t$sql = \"SELECT * FROM reportedusers WHERE U_name like '%$keyword%' or rptr_u_name like '%$keyword%' or reason like '%$keyword%' order by timestamp desc \"; \n\t\tif($result = mysqli_query($conn, $sql)){\n $users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $users;\n }else{\n array_push($errors, \"there was a problem fetching Records\");\n }\n\n\t} else {\n\t\treturn null;\n\t}\n}", "public function salesOrdersReport(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required'\n ]);\n\n if ($validator->fails()) {\n return response()->json(array(\n 'status' => 400,\n 'message'=> 'Error',\n 'error_message'=>$validator->errors()\n ),200);\n }\n\n if (!empty($request->date)) {\n $data = SalesOrder::join('quotes','sales_orders.quote_id','=','quotes.id')\n ->join('leads','quotes.lead_id','=','leads.id')\n ->join('users','leads.user_id','=','users.id')\n ->select('sales_orders.*','leads.name as lead_name','leads.email','leads.phone','leads.user_id','quotes.product_id','quotes.lead_id','users.name as user_name','leads.status as lead_status')\n ->where('sales_orders.date',$request->date)\n ->where('leads.user_id',$request->user_id)\n ->get();\n\n }else{\n $data = SalesOrder::join('quotes','sales_orders.quote_id','=','quotes.id')\n ->join('leads','quotes.lead_id','=','leads.id')\n ->join('users','leads.user_id','=','users.id')\n ->select('sales_orders.*','leads.name as lead_name','leads.email','leads.phone','leads.user_id','quotes.product_id','quotes.lead_id','users.name as user_name','leads.status as lead_status')\n ->where('leads.user_id',$request->user_id)\n ->get();\n }\n\n if (count($data)>0) {\n return response()->json(array(\n 'status' => 200,\n 'message'=> 'Success',\n 'success_message'=>'Data found.',\n 'data' => $data,\n ),200);\n }else{\n return response()->json(array(\n 'status' => 400,\n 'message'=> 'Error',\n 'error_message'=>'No data found!'\n ),200);\n }\n }", "public function get_ledger_report(Request $request)\n\t{\t \n\t $organization_id = Session::get('organization_id');\n\t $start_date \t= $request->start_date;\n\t $end_date \t= $request->end_date;\n\t $ledger_id \t= $request->id;\n\t $group_name \t= $request->group_name;\n\n\t $prev_date = date('Y-m-d', strtotime($start_date .' -1 day'));\n\n\t //dd($start_date);\n\n\t $account_ledger_name = AccountLedger::where('id', $ledger_id)->first()->name;\n\n\t $ledger = AccountLedger::select('account_ledgers.id', 'account_ledgers.display_name AS ledger', 'account_ledgers.opening_balance','account_ledgers.opening_balance_type', 'account_ledgers.updated_at', 'account_ledgers.opening_balance_date')\n ->where('account_ledgers.id', $ledger_id)\n ->first();\n\n /*get organization first transaction date */\n\n $pre_entry = AccountEntry::select('account_entries.id',DB::raw('MIN(account_entries.date) as pre_date'))\n ->leftjoin('account_vouchers','account_vouchers.id', '=' ,'account_entries.voucher_id')\n ->leftjoin('account_transactions','account_transactions.entry_id', '=' ,'account_entries.id')\n ->leftjoin('account_ledgers AS debit_ledger','debit_ledger.id', '=' ,'account_transactions.debit_ledger_id')\n ->leftjoin('account_ledgers AS credit_ledger','credit_ledger.id', '=' ,'account_transactions.credit_ledger_id') \n ->where('account_entries.organization_id', $organization_id)\n ->where('debit_ledger.id',$ledger_id)\n ->orWhere('credit_ledger.id',$ledger_id)\n ->first();\n\n /*end*/\n\n \t$opening_balance = $this->ledger_closing_sp($ledger_id, Carbon::parse($pre_entry->pre_date)->subDay()->toDateString(), Carbon::parse($pre_entry->pre_date)->subDay()->toDateString(),$group_name); \n\n \t/*its changed*/\n \t$closing_balance = $this->ledger_closing_sp($ledger_id, $pre_entry->pre_date, $end_date,$group_name);\n \t/*end*/\n\n\n \t/* previous opening amount */\n\n\t\t$pre_balance = $this->ledger_closing_sp($ledger_id, $pre_entry->pre_date, $prev_date,$group_name);\n\n\t\t/*end*/\n\t\t\n\t\t//dd($pre_balance);\n\n if($account_ledger_name == 'sales' || $account_ledger_name == 'opening_equity' || $group_name == 'Sundry Debtors' || $group_name == 'Sundry creditors' || $group_name =='Duties &amp; Taxes')\n\t\t{\n\t\t\t//dd('1');\n\t\t\t$ledger_statement = DB::select(\"SELECT \n\t\t\t account_entries.id,\n\t\t\t account_transactions.id AS voucher_acc_id,\n\t\t\t account_entries.voucher_no,\n\t\t\t account_vouchers.code AS voucher_code,\n\t\t\t account_vouchers.id AS voucher_master_id,\n\t\t\t account_vouchers.display_name AS voucher_type,\n\t\t\t debit_ledger.display_name AS debit_account,\n\t\t\t credit_ledger.display_name AS credit_account,\n\t\t\t \n\t\t\t IF(debit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS debit,\n\t\t\t IF(credit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS credit,\n\t\t\t account_entries.date,\n\t\t\t account_vouchers.name AS voucher_master\n\t\t\tFROM\n\t\t\t account_entries\n\t\t\t LEFT JOIN account_vouchers \n\t\t\t ON account_vouchers.id = account_entries.voucher_id \n\t\t\t LEFT JOIN account_transactions \n\t\t\t ON account_entries.id = account_transactions.entry_id \n\t\t\t LEFT JOIN account_ledgers AS debit_ledger \n\t\t\t ON debit_ledger.id = account_transactions.debit_ledger_id \n\t\t\t LEFT JOIN account_ledgers AS credit_ledger \n\t\t\t ON credit_ledger.id = account_transactions.credit_ledger_id \n\t\t\tWHERE account_entries.organization_id = \".$organization_id.\" \n\t\t\t AND (debit_ledger.id = \".$ledger_id.\" OR credit_ledger.id = \".$ledger_id.\") AND (DATE BETWEEN '\".$start_date.\"' AND '\".$end_date.\"')\n\t\t\t AND account_entries.status = 1 AND account_vouchers.name != 'stock_journal'\n\t\t\t GROUP BY account_entries.id\n\t\t\t \");\n\t\t}else\n\t\t{\n\t\t\t//dd('2');\n\t $ledger_statement = DB::select(\"SELECT \n\t\t\t account_entries.id,\n\t\t\t account_transactions.id AS voucher_acc_id,\n\t\t\t account_entries.voucher_no,\n\t\t\t account_vouchers.code AS voucher_code,\n\t\t\t account_vouchers.id AS voucher_master_id,\n\t\t\t account_vouchers.display_name AS voucher_type,\n\t\t\t debit_ledger.display_name AS debit_account,\n\t\t\t credit_ledger.display_name AS credit_account,\n\t\t\t \n\t\t\t IF(debit_ledger.id = \".$ledger_id.\", sum(account_transactions.amount), '0.00') AS debit,\n\t\t\t IF(credit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS credit,\n\t\t\t account_entries.date,\n\t\t\t account_vouchers.name AS voucher_master\n\t\t\tFROM\n\t\t\t account_entries\n\t\t\t LEFT JOIN account_vouchers \n\t\t\t ON account_vouchers.id = account_entries.voucher_id \n\t\t\t LEFT JOIN account_transactions \n\t\t\t ON account_entries.id = account_transactions.entry_id \n\t\t\t LEFT JOIN account_ledgers AS debit_ledger \n\t\t\t ON debit_ledger.id = account_transactions.debit_ledger_id \n\t\t\t LEFT JOIN account_ledgers AS credit_ledger \n\t\t\t ON credit_ledger.id = account_transactions.credit_ledger_id \n\t\t\tWHERE account_entries.organization_id = \".$organization_id.\" \n\t\t\t AND (debit_ledger.id = \".$ledger_id.\" OR credit_ledger.id = \".$ledger_id.\") AND (DATE BETWEEN '\".$start_date.\"' AND '\".$end_date.\"')\n\t\t\t AND account_entries.status = 1\n\t\t\t GROUP BY account_entries.id\n\t\t\t \");\n\t }\n\t \n //dd($ledger_statement);\n\n return response()->json(array('opening_balance' => $opening_balance, 'ledger_statement' => $ledger_statement, 'closing_balance' => $closing_balance, 'opening_date' => $request->start_date, 'closing_date' => $end_date, 'ledger' => $ledger,'account_ledger_name' => $account_ledger_name,'pre_balance' => $pre_balance));\n\t}", "public function index(Request $request){\n\n $query = Lead::with('address','b2b')->where('is_active', 1);\n\n if($request->name){\n $query->where('name','like','%'.$request->name.'%');\n }\n\n if($request->email){\n $query->where('email','like','%'.$request->email.'%');\n }\n\n if($request->mobile_no){\n $query->where('mobile_no',$request->mobile_no);\n }\n\n if(isset($request->status)){\n $query->where('leads_status',$request->status);\n } \n\n if(isset($request->source)){\n $query->where('source',$request->source);\n } \n \n $query->orderBy('id', 'DESC');\n\n $leads = $query->paginate($this->records_per_page);\n\n return $this->sendResponse($leads, 'Lead(s) retrieved successfully.');\n }", "public function lead_log_list($lead_id)\n {\n $result = common_select_values('lg.*, (select name from users where user_id = lg.created_by) as log_created_by', 'lead_history_log lg', ' lg.lead_id = \"'.$lead_id.'\"', 'result');\n return $result; \n }", "function quantizer_expenses_user_report($user = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerUsersExpenses($user, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }", "public function getAllLeadsOfAgent(Request $request){\n try{\n if(!empty($request->agent_id)){\n $data['leads'] = Customer::where('agent_id', $request->agent_id)->get();\n \n if($data['leads']){\n return response()->json([\n 'agent_customers'=>$data,\n 'status' =>'success',\n 'code' =>200,\n ]);\n }else{\n response()->json([\n 'message'=>'Data not found',\n 'status' =>'error',\n ]);\n }\n }else{\n response()->json([\n 'message'=>'Something went wrong with this request.Please Contact your administrator',\n 'status' =>'error',\n ]);\n }\n }catch(\\Exception $e){\n return response()->json([\n 'message'=>\"something went wrong.Please contact administrator.\".$e->getMessage(),\n 'error' =>true,\n ]);\n }\n }", "function scheduledreporting_component_get_reports($userid = 0)\n{\n $scheduled_reports = array();\n $temp = get_user_meta($userid, 'scheduled_reports');\n if ($temp != null)\n $scheduled_reports = mb_unserialize($temp);\n\n // Add user_id to reports\n if (empty($userid)) {\n $userid = $_SESSION['user_id'];\n }\n foreach ($scheduled_reports as $id => $report) {\n $scheduled_reports[$id]['user_id'] = $userid;\n }\n\n return $scheduled_reports;\n}", "public function getUserEarningAnalytics(Request $request) {\n // Period\n $start = $request->start ?? Carbon::now()->addDays(-14)->format('Y-m-d');\n $end = $request->end ?? Carbon::now()->format('Y-m-d');\n\n $selectedCampaigns = $request->campaigns;\n $selectedBusinesses = $request->businesses;\n $selectedSegments = $request->segments;\n $selectedStaff = $request->staff;\n\n // Get onboarding step\n $totals = auth()->user()->getUserTotals();\n\n // Filters\n $campaigns = auth()->user()->campaigns->pluck('name', 'id');\n $businesses = auth()->user()->businesses->pluck('name', 'id');\n $segments = auth()->user()->segments->pluck('name', 'id');\n $staff = auth()->user()->staff->pluck('name', 'id');\n $customers = auth()->user()->customers->pluck('name', 'id');\n\n // Period\n $period = new \\DatePeriod( new \\DateTime($start . ' 00:00:00'), new \\DateInterval('P1D'), new \\DateTime($end . ' 23:59:59'));\n\n $table = null;\n\n $table = auth()->user()->history()\n ->whereBetween('created_at', [$start . ' 00:00:00', $end . ' 23:59:59'])\n ->where('points', '>', 0);\n\n if (is_array($selectedCampaigns) && count($selectedCampaigns) > 0) {\n $table = $table->whereHas('campaign', function($query) use ($selectedCampaigns) {\n $query->whereIn('campaign_id', $selectedCampaigns);\n });\n }\n\n if (is_array($selectedBusinesses) && count($selectedBusinesses) > 0) {\n $table = $table->whereHas('campaign', function($query) use ($selectedBusinesses) {\n $query->whereHas('business', function ($q) use ($selectedBusinesses){\n $q->whereIn('business_id', $selectedBusinesses);\n });\n });\n }\n\n if (is_array($selectedSegments) && count($selectedSegments) > 0) {\n foreach ($selectedSegments as $segment_id) {\n $table = $table->whereHas('segments', function($query) use ($segment_id) {\n $query->where('segment_id', $segment_id);\n });\n }\n }\n /*\n if (is_array($selectedSegments) && count($selectedSegments) > 0) {\n $table = $table->whereHas('segments', function($query) use ($selectedSegments) {\n $query->whereIn('segment_id', $selectedSegments);\n });\n }*/\n\n if (is_array($selectedStaff) && count($selectedStaff) > 0) {\n $table = $table->whereHas('staff', function($query) use ($selectedStaff) {\n $query->whereIn('staff_id', $selectedStaff);\n });\n }\n\n $table = $table->orderBy('created_at', 'asc')->get();\n\n $table = $table->map(function ($record) use ($campaigns, $staff, $customers) {\n $record->created_at = $record->created_at->timezone(auth()->user()->getTimezone());\n $record->customer_name = $customers[$record->customer_id];\n $record->campaign_name = $campaigns[$record->campaign_id];\n $record->staff_name = ($record->staff_id === null) ? $record->staff_name : $staff[$record->staff_id];\n if ($record->staff_name === null) $record->staff_name = '-';\n\n return collect($record)->only('uuid', 'staff_name', 'customer_name', 'campaign_name', 'description', 'icon', 'created_at', 'points');\n });\n\n // Table headers\n $tableHeaders = [\n ['text' => __('Campaign'), 'value' => 'campaign_name'],\n ['text' => __('Customer'), 'value' => 'customer_name'],\n ['text' => __('Event'), 'value' => 'description'],\n ['text' => __('Staff member'), 'value' => 'staff_name'],\n ['text' => __('Points'), 'value' => 'points', 'align' => 'right'],\n ['text' => __('Date'), 'value' => 'created_at', 'align' => 'right']\n ];\n\n $range = [];\n foreach($period as $date){\n $range[$date->format(\"Y-m-d\")] = 0;\n }\n\n $data = auth()->user()->history()\n ->select([\n DB::raw('DATE(`created_at`) as `date`'),\n DB::raw('SUM(points) as `count`')\n ])\n ->whereBetween('created_at', [$start . ' 00:00:00', $end . ' 23:59:59'])\n ->where('points', '>', 0);\n\n if (is_array($selectedCampaigns) && count($selectedCampaigns) > 0) {\n $data = $data->whereHas('campaign', function($query) use ($selectedCampaigns) {\n $query->whereIn('campaign_id', $selectedCampaigns);\n });\n }\n\n if (is_array($selectedBusinesses) && count($selectedBusinesses) > 0) {\n $data = $data->whereHas('campaign', function($query) use ($selectedBusinesses) {\n $query->whereHas('business', function ($q) use ($selectedBusinesses){\n $q->whereIn('business_id', $selectedBusinesses);\n });\n });\n }\n\n if (is_array($selectedSegments) && count($selectedSegments) > 0) {\n foreach ($selectedSegments as $segment_id) {\n $data = $data->whereHas('segments', function($query) use ($segment_id) {\n $query->where('segment_id', $segment_id);\n });\n }\n }\n/*\n if (is_array($selectedSegments) && count($selectedSegments) > 0) {\n $data = $data->whereHas('segments', function($query) use ($selectedSegments) {\n $query->whereIn('segment_id', $selectedSegments);\n });\n }\n*/\n if (is_array($selectedStaff) && count($selectedStaff) > 0) {\n $data = $data->whereHas('staff', function($query) use ($selectedStaff) {\n $query->whereIn('staff_id', $selectedStaff);\n });\n }\n\n $data = $data->groupBy('date')\n ->get()\n ->pluck('count', 'date');\n\n $dbData = [];\n $total = 0;\n if ($data !== null) {\n foreach($data as $date => $count) {\n $dbData[$date] = (int) $count;\n $total += $count;\n }\n }\n\n $chartData = array_replace($range, $dbData);\n\n $chart = [];\n $chart[] = [\"Date\", \"Points earned\"];\n foreach ($chartData as $date => $count) {\n $chart[] = [$date, $count];\n }\n\n $analytics = [\n 'start' => $start,\n 'end' => $end,\n 'total' => [\n 'onboardingStep' => $totals['onboardingStep'],\n 'chart' => $total\n ],\n 'campaigns' => $campaigns,\n 'businesses' => $businesses,\n 'segments' => $segments,\n 'staff' => $staff,\n 'chart' => $chart,\n 'table' => $table,\n 'tableHeaders' => $tableHeaders\n ];\n\n return response()->json($analytics, 200);\n }", "public function index()\n {\n $module = Module::get('Ledgerreports');\n \n $acc_items = Acc_account::where('acc_or_group','account')->get();\n return View('la.ledgerreports.index', [\n 'show_actions' => $this->show_action,\n 'listing_cols' => $this->listing_cols,\n 'acc_items' => $acc_items, \n 'module' => $module\n ]);\n }", "function getUserReport( $datetypeselect, $startdate, $enddate ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \" left\";\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tselect u.ID,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t u.Extension,\r\n\t\t\t u.Email\r\n\t\t\tfrom users u$left join (`contacts-users` cu join contacts c on cu.contactid = c.id$datestuff) on cu.userid = u.id\r\n\t\t\";\r\n\t\t\r\n\t\tif( $datetypeselect == 0 || $datetypeselect == 1 ) {\r\n\t\t\tif( $startdate ) $query .= \" and datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\t\tif( $enddate ) $query .= \" and datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t}\r\n\t\telse if( $datetypeselect == 2 && ($startdate || $enddate) ) {\r\n\t\t\t$query .= \" and (0\";\r\n\t\t\tif( $startdate ) $query .= \" or datecreated < '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\t\tif( $enddate ) $query .= \" or datecreated > '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\t$query .= \")\";\r\n\t\t}\r\n\t\t\r\n\t\t$query .= \" group by u.id order by u.lastname\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-users` cu\r\n\t\t\t\t\twhere cu.userid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-users` cu\r\n\t\t\t\t\ton cu.contactid = c.id\r\n\t\t\t\t\tand cu.userid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the students associated with the contacts\r\n\t\t\t$query = \"select distinct s.ID,\r\n\t\t\t\t\t concat( s.LAST_NAME, ', ', s.FIRST_NAME, ' ', s.MIDDLE_NAME ) as FullName,\r\n\t\t\t\t\t s.WOOSTER_EMAIL\r\n\t\t\t\t from X_PNSY_STUDENT s, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where s.ID = cs.studentid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cu.userid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$studentsArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $studentrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $studentsArray, $studentrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Students'] = $studentsArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "public function getReportsData($userId)\n {\n\n $countPIN = 0;\n $countactualPIN = 0;\n\n $TotalPIN = $this->PDO->prepare(\"SELECT count(*) as numreports FROM lifepin WHERE (markfordelete IS NULL or markfordelete=0) and IdUsu = ? and emr_old = 0 \");\n $TotalPIN->bindValue(1, $userId, PDO::PARAM_INT);\n $TotalPIN->execute();\n\n\n if($rowNUM = $TotalPIN->fetch(PDO::FETCH_ASSOC))\n {\n $countPIN = $rowNUM['numreports'];\n }\n\n $dluPIN = $this->PDO->prepare(\"SELECT * from doctorslinkusers where IdUs = ? and IdMED = ?\");\n $dluPIN->bindValue(1, $userId, PDO::PARAM_INT);\n $dluPIN->bindValue(2, $this->doctor, PDO::PARAM_INT);\n $result = $dluPIN->execute();\n $dluqquery = '';\n $num = $dluPIN->rowCount();\n\n $i = 0;\n if($num > 0)\n\n {\n\n while($rowdlu = $dluPIN->fetch(PDO::FETCH_ASSOC))\n {\n $dluqquery = '';\n\n if($rowdlu['IdPIN']==null)\n {\n\n $dluqquery = \"UNION(select lp.* from \".$dbname.\".lifepin lp INNER JOIN (select IdMED from \".$dbname.\".doctorslinkusers where IdUs=? and IdMED=? and IdPIN IS NULL) dlu where dlu.IdMED=lp.IdMED and lp.IdUsu=?)\";\n\n }\n else\n {\n\n if($rowdlu['IdPIN']!=null)\n {\n\n $dluqquery=\"UNION(select lp.* from \".$dbname.\".lifepin lp INNER JOIN (select * from \".$dbname.\".doctorslinkusers where IdUs=? and IdMED=?) dlu where dlu.IdPIN=lp.IdPin and lp.IdUsu=?)\";\n\n }\n\n }\n\n }\n }\n\n\n $loadquery=\"(select LP.* from \".$dbname.\".lifepin LP INNER JOIN ((select A.idDoctor from \".$dbname.\".doctorsgroups A INNER JOIN (select idGroup from \".$dbname.\".doctorsgroups where idDoctor=?) B where B.idGroup=A.idGroup) UNION (select Id from \".$dbname.\".doctors where Id=?) UNION (select IdMED from \".$dbname.\".doctorslinkdoctors where IdMED2=? and IdPac=?)) AB where LP.IdMed=AB.idDoctor and IdUsu=? and (LP.markfordelete=0 or LP.markfordelete is null) and (LP.IsPrivate=0 or LP.IsPrivate is null) and NOT (LP.Tipo IN (select Id from \".$dbname.\".tipopin where Agrup=9) and LP.IdMED!=?) and LP.emr_old=0)UNION(select * from \".$dbname.\".lifepin where IdMED=? and IdUsu=? and (markfordelete=0 or markfordelete is null) and emr_old=0)\".$dluqquery;\n\n $viewablePIN = $this->PDO->prepare($loadquery);\n $viewablePIN->bindValue(1, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(2, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(3, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(4, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(5, $userId, PDO::PARAM_INT);\n $viewablePIN->bindValue(6, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(7, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(8, $userId, PDO::PARAM_INT);\n $viewablePIN->bindValue(9, $userId, PDO::PARAM_INT);\n $viewablePIN->bindValue(10, $this->doctor, PDO::PARAM_INT);\n $viewablePIN->bindValue(11, $userId, PDO::PARAM_INT);\n $viewablePIN->execute();\n\n\n $hasfullaccess = 0;\n if($viewablePIN->fetch(PDO::FETCH_ASSOC))\n {\n $countactualPIN = $viewablePIN->rowCount();\n $hasfullaccess = 1;\n }\n\n if($hasfullaccess==1)\n {\n $viewable= $this->PDO->prepare(\"Select count(*) as patreport from \".$dbname.\".lifepin where (IdMed IS NULL or IdMed=0 or IdMed=?) and (markfordelete IS NULL or markfordelete=0) and IdUsu=?\");\n $viewable->bindValue(1, $userId, PDO::PARAM_INT);\n $viewable->bindValue(2, $userId, PDO::PARAM_INT);\n $viewable->execute();\n\n if($row=$viewable->fetch(PDO::FETCH_ASSOC))\n $numPIN = $row['patreport'];\n \n //If Idpin is null the doctor has full access to the patients\n $countactualPIN += $numPIN; \n\n }\n\n //$NReports = $countactualPIN.\"/\".$countPIN;\n\n return array(\"reports\" => $countactualPIN, \"total\" => $countPIN);\n\n }", "public function staffLeaveReportView(Request $request)\n {\n $from_date = trim($request->from);\n $from = date('Y-m-d',strtotime($from_date));\n $to_date = trim($request->to);\n $to = date('Y-m-d',strtotime($to_date));\n $staff = trim($request->staff);\n\n if($staff == '0'){\n // for all staff\n $count = DB::table('users')\n ->join('tbl_leave','users.id', '=', 'tbl_leave.user_id')\n ->leftJoin('department', 'users.dept', '=', 'department.id','tbl_leave.final_request_from')\n ->select('users.*', 'department.departmentName')\n ->where('tbl_leave.type_status',0)\n ->whereBetween('tbl_leave.final_request_from', [$from, $to])\n ->count();\n if($count == '0'){\n echo 'f1';\n exit();\n }\n }else{\n // individual staff\n $count = DB::table('users')\n ->join('tbl_leave','users.id', '=', 'tbl_leave.user_id')\n ->leftJoin('department', 'users.dept', '=', 'department.id')\n ->select('users.*', 'department.departmentName','tbl_leave.final_request_from')\n ->where('tbl_leave.user_id',$staff)\n ->where('tbl_leave.type_status',0)\n ->whereBetween('tbl_leave.final_request_from', [$from, $to])\n ->count();\n if($count == '0'){\n echo 'f1';\n exit();\n }\n }\n\n if($staff == '0'){\n // for all staff\n $result = DB::table('users')\n ->join('tbl_leave','users.id', '=', 'tbl_leave.user_id')\n ->leftJoin('department', 'users.dept', '=', 'department.id')\n ->select('users.*', 'department.departmentName','tbl_leave.final_request_from')\n ->where('tbl_leave.type_status',0)\n ->whereBetween('tbl_leave.final_request_from', [$from, $to])\n ->get();\n }else{\n // individual staff\n $result = DB::table('users')\n ->join('tbl_leave','users.id', '=', 'tbl_leave.user_id')\n ->leftJoin('department', 'users.dept', '=', 'department.id','tbl_leave.final_request_from')\n ->select('users.*', 'department.departmentName','tbl_leave.final_request_from')\n ->where('tbl_leave.user_id',$staff)\n ->where('tbl_leave.type_status',0)\n ->whereBetween('tbl_leave.final_request_from', [$from, $to])\n ->get();\n }\n return view('view_report.staffLeaveReportView')->with('result',$result)->with('from',$from)->with('to',$to)->with('staff',$staff); \n }", "function reportOpenedResultsPerUser($ReportCondition = '1', $Limit = 15)\r\n{\r\n return reportPerUser('ResultInfo', 'OpenedBy', $ReportCondition, $Limit);\r\n}", "function report($user_id) {\n\n\t\t// Get paged and limit\n\t\t$paged = 1;\n\t\tif (isset($_REQUEST['paged'])) {\n\t\t\t$paged = $_REQUEST['paged'];\n\t\t}\n\n\t\tif (isset($_REQUEST['submit-first-page'])) {\n\t\t\t$paged = $_REQUEST['first-page'];\n\t\t} else if (isset($_REQUEST['submit-previous-page'])) {\n\t\t\t$paged = $_REQUEST['previous-page'];\n\t\t} else if (isset($_REQUEST['submit-next-page'])) {\n\t\t\t$paged = $_REQUEST['next-page'];\n\t\t} else if (isset($_REQUEST['submit-last-page'])) {\n\t\t\t$paged = $_REQUEST['last-page'];\n\t\t} \n\n\t\t$limit = 15;\n\t\tif (isset($_REQUEST['limit'])) {\n\t\t\t$limit = $_REQUEST['limit'];\n\t\t}\n\t\t\n\t\t$offset = $limit * ($paged - 1);\n\n\t\t// Get all the data (paged view will come later)\n\t\t$karmicLoad = new carnieKarmaKarmicLoad;\n\t\t$karmic_load_rows = $karmicLoad->get_rows($user_id);\n\n\t\t$count = count($karmic_load_rows);\n\t\t$results = array_slice($karmic_load_rows, $offset, $limit);\n\n\t\t$gigsView = new carnieKarmaLoadDetailsView;\n\t\treturn $gigsView->render($user_id, $results, $count, $paged, $limit);\n\t}" ]
[ "0.6010138", "0.5911834", "0.5786621", "0.57433194", "0.5732786", "0.5698263", "0.5657125", "0.55970055", "0.5584977", "0.55848855", "0.55743", "0.5551029", "0.55420554", "0.5540597", "0.55353326", "0.5523119", "0.55004275", "0.5465037", "0.54503024", "0.5449019", "0.54347444", "0.5406505", "0.5406046", "0.53623706", "0.53450966", "0.53445756", "0.53346664", "0.5324822", "0.53220785", "0.5317809" ]
0.67287743
0
get Product by Category Path
function getProductByCategoryPath($path){ $q_product_id=getResultSet("SELECT product_id FROM ".DB_PREFIX."product_to_category WHERE category_id=".$path); while($rp=mysql_fetch_array($q_product_id)){ $product_id = $rp['product_id']; $product = new product($product_id); echo '<div class="item">'; echo '<div class="desc">'; echo '<div class="item_name" >'.$product->getProductName().'</div>'; echo '<div class="shop_name"><span style="padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;">'.$product->getShopName().'</span></div>'; echo '<div class="price" >$'.$product->getProductPrice().'</div>'; echo '</div>'; echo '<a href="?page=productdetail&product='.$product_id.'">'; echo '<img src="'.$product->getProductImage().'">'; echo '</a>'; echo '</div>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "function productByCategory($id)\n {\n \t\n }", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "public function path()\n {\n return $this->dispatch(new GetCategoryPath($this));\n }", "public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "public function get($category_id);", "function getCategory($category)\n {\n\n $product_category = DB::table('products')->select('products.id','products.name','products.price', 'products.price_promotion','products.image')\n ->join('categories', 'categories.id', '=','products.id_category')\n ->where('categories.id', '=', $category )->get();\n \n $categories = DB::table('categories')->get();\n // var_dump($categories);exit;\n\n\n // var_dump($product_category);exit;\n return view('frontend.pages.category', compact('product_category','categories'));\n }", "public function product_get_by_category($data)\n {\n $queryColumn = \"DESCRIBE \" . $this->db_table_prefix . \"products\";\n $resultColumn = $this->commonDatabaseAction($queryColumn);\n $resultColumn = $this->resultArray($resultColumn);\n $columns = php_array_column($resultColumn, 'Field');\n \n $query = \"SELECT p.*, c.name as catName\n \t FROM \" . $this->db_table_prefix . \"products p\n JOIN \" . $this->db_table_prefix . \"categories c\n ON p.cat_id = c.id \";\n \n if (!empty($data))\n {\n $query .= 'WHERE 1';\n foreach ($data as $key => $value)\n {\n $pos = strpos($key, '.');\n $columnArray = ($pos) ? explode('.', $key) : ''; \n $columnName = (!empty($columnArray)) ? $columnArray[1] : $key ;\n \n if (in_array($columnName, $columns))\n {\n $query .= ' AND ' . $key . ' = ' . $value;\n }\n }\n }\n $query .= \" ORDER BY p.id DESC\";\n\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "public function getCategory(Request $request)\n\t{\n\t\t$params = $request->all();\n\n\t\t$categories = new Categories;\n\n\t\tif(isset($params['category']) && $params['category']!=\"\"){\n\t\t\t$categories = $categories->where('slug', \"=\", $params['category']);\n\t\t}\n\n\t\t$categories = $categories->where('cat_status',1);\t\t\n\n\t\tif(isset($params['onlyParent']) && $params['onlyParent']){\n\t\t\t$categories = $categories->where('ancestors','exists',false);\n\t\t}\n\n\t\t$categories = $categories->get();\n\n\t\tif(empty($categories) || !is_object($categories) || empty($categories->toArray())){\n\t\t\treturn response([],404);\n\t\t}\n\n\t\tif(isset($params['withChild']) && $params['withChild']){\n\n\t\t\tforeach($categories as &$category){\t\t\t\t\n\t\t\t\t$category['children'] = array();\n\t\t\t\t$category['children'] = Categories::where('cat_status',1)->where('ancestors.0._id','=',$category['_id'])->get(array('_id','slug','cat_title','metaTitle','metaDescription','metaKeywords'));\n\t\t\t}\n\n\t\t}\t\n\t\t\n\t\t\n\t\tif(isset($params['withCount']) && $params['withCount']){\n\n\t\t\t// db.products.aggregate([{$group:{_id:\"$categories\",count:{$sum:1}}}])\n\n\t\t\t$products = DB::collection('products')->raw(function($collection){\n\n\t\t\t\treturn $collection->aggregate(array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$match' => array(\n\t\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$project' => array('categories' => 1)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$unwind' => array(\n\t\t\t\t\t\t\t'path' => '$categories',\n\t\t\t\t\t\t\t'preserveNullAndEmptyArrays' => true\t\n\t\t\t\t\t\t)\n\t\t\t\t\t),\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$group' => array(\n\t\t\t\t\t\t\t'_id'=>'$categories',\n\t\t\t\t\t\t\t'count' => array(\n\t\t\t\t\t\t\t\t'$sum' => 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t});\n\n\t\t\t$processedPro = [];\n\t\t\tforeach($products['result'] as $product){\n\n\t\t\t\t$cat = $product['_id'];\n\n\t\t\t\t$processedPro[$cat] = $product['count'];\n\n\t\t\t}\n\n\t\t\tforeach($categories as &$category){\n\n\t\t\t\t$category['productCount'] = isset($processedPro[$category['_id']])?$processedPro[$category['_id']]:0;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn response($categories);\n\t}", "public function getCategoryAction (Request $request)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $parentId = $request->query->get('parentId', null);\r\n $categoryQueryString = $request->query->get('queryString', null);\r\n\r\n $productCategoryRepository = $em->getRepository('YilinkerCoreBundle:ProductCategory');\r\n $productCategories = $productCategoryRepository->searchCategory($parentId, null, null, $categoryQueryString);\r\n\r\n $errorMessage = 'No Result';\r\n $isSuccessful = false;\r\n\r\n $assetHelper = $this->get('templating.helper.assets');\r\n foreach ($productCategories as $index => $productCategory) {\r\n if($productCategory['image'] !== null && strlen(trim($productCategory['image'])) > 0){\r\n $productCategories[$index]['image'] = $assetHelper->getUrl($productCategory['image'], 'mobile_category');\r\n }\r\n }\r\n\r\n if ($productCategories) {\r\n $isSuccessful = true;\r\n $errorMessage = '';\r\n }\r\n\r\n return new JsonResponse(array(\r\n 'isSuccessful' => $isSuccessful,\r\n 'data' => $productCategories,\r\n 'message' => $errorMessage,\r\n ));\r\n }", "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "public function getProductByCategoryId($category_id){\n if($category_id!=''){\n $this->db->select('id,title,image');\n $this->db->from('product');\n $this->db->where('status','t');\n $this->db->where('category_id',$category_id);\n $this->db->or_where('sub_category_id',$category_id);\n $this->db->where('status','t');\n $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get();\n return $query->result(); \n }\n\n }", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "function get_ProductsBy_CatID($data) {\r\n $params[0] = array(\"name\" => \":category_id\", \"value\" => &$data['category_id']);\r\n $params[1] = array(\"name\" => \":prodType\", \"value\" => &$data['prodType']);\r\n return $this->DBObject->readCursor(\"product_actions.get_ProductsBy_CatID(:category_id,:prodType)\", $params);\r\n }", "public static function route_products_and_categories()\n\t{\n\t\tforeach(ORM::factory('product')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t\t\n\t\tforeach(ORM::factory('category')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function getCategoryProduct(Request $request,$show_category_product)\n {\n // return 123456;\n if ($show_category_product > 0) {\n return Post::where('category_id', $show_category_product)->with('category')->get();\n }\n }", "public function getProducts($category) {\n $sql = \"SELECT * FROM products INNER JOIN categories on products.product_CategoryID = categories.category_ID WHERE category_Name = '\".$category.\"'\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"products\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"product_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"product_Name\"] . '\",' .\n '\"Category\": \"' . $row[\"category_Name\"] . '\",' .\n '\"Price\": \"' . $row[\"product_Price\"] . '\",' .\n '\"Brand\": \"' . $row[\"product_Brand\"] . '\",' .\n '\"Description\": \"' . $row[\"product_Description\"] . '\",' .\n '\"ImagePath\": \"' . $row[\"product_ImagePath\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Return the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n }", "public function index()\n {\n return ProductResource::collection(Product::with('categories')->get());\n }", "function tep_get_product_path($products_id) {\n $cPath = '';\n\n $category_query = tep_db_query(\"select p2c.categories_id from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = '\" . (int)$products_id . \"' and p.products_status = '1' and p.products_id = p2c.products_id limit 1\");\n if (tep_db_num_rows($category_query)) {\n $category = tep_db_fetch_array($category_query);\n\n $categories = array();\n tep_get_parent_categories($categories, $category['categories_id']);\n\n $categories = array_reverse($categories);\n\n $cPath = implode('_', $categories);\n\n if (tep_not_null($cPath)) $cPath .= '_';\n $cPath .= $category['categories_id'];\n }\n\n return $cPath;\n }", "public function getProductsByCategory($slug){\n $category = Category::where(['url'=> $slug, 'status' => 1])->first();\n \n if($category){\n // Show parent category\n if($category->parent_id != 0){\n $parent_categories = Category::with('categories')->where('id', $category->parent_id)->get();\n }else{\n $parent_categories = [$category];\n }\n \n // Show products by category_id\n $products = Product::where('category_id', $category->id)->where('status', 1)->orderBy('id', 'DESC')->paginate(8);\n\n return view('frontend.products_by_category')->withCategory($category)->withProducts($products)->withParentCategories($parent_categories);\n }\n return abort(404, 'Unauthorized action.');\n }", "public function productBySubCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsBySubCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "public function getCatalogoCategory($category) {\n $cat = Category::findOrFail($category);\n $prods = $cat->productTypes->pluck('id');\n $products = ProductType::whereIn('id', $prods)->paginate(8);\n\n // Manipolazione dei prodotti !!!\n $products->map(function ($product) {\n\n });;\n\n return view('frontoffice.pages.shop', ['products' => $products, 'parent' => $cat]);\n }", "public function getFullProductUrl(Mage_Catalog_Model_Product $product = null){\n $categories = $product->getCategoryCollection();\n $deepCatId = 0;\n $path = '';\n $productPath = false;\n\n foreach ($categories as $category) {\n // Look for the deepest path and save.\n if (substr_count($category->getData('path'), '/') > substr_count($path, '/')) {\n $path = $category->getData('path');\n $deepCatId = $category->getId();\n }\n }\n\n // Load category.\n $category = Mage::getModel('catalog/category')->load($deepCatId);\n\n // Remove .html from category url_path.\n $categoryPath = str_replace('.html', '', $category->getData('url_path'));\n\n // Get product url path if set.\n $productUrlPath = $product->getData('url_path');\n\n // Get product request path if set.\n $productRequestPath = $product->getData('request_path');\n\n // If URL path is not found, try using the URL key.\n if ($productUrlPath === null && $productRequestPath === null) {\n $productUrlPath = $product->getData('url_key');\n }\n\n // Now grab only the product path including suffix (if any).\n if ($productUrlPath) {\n $path = explode('/', $productUrlPath);\n $productPath = array_pop($path);\n } elseif ($productRequestPath) {\n $path = explode('/', $productRequestPath);\n $productPath = array_pop($path);\n }\n\n // Now set product request path to be our full product url including deepest category url path.\n if ($productPath !== false) {\n if ($categoryPath && false) {\n // Only use the category path is one is found.\n $product->setData('request_path', $categoryPath . '/' . $productPath);\n } else {\n $product->setData('request_path', $productPath);\n }\n }\n\n return $product->getProductUrl();\n }", "public function getProductsByCategory ($category_id) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t/*\n $query = \"SELECT ea_product.id, ea_product.upc, ea_product.brand, ea_product.product_name, ea_product.product_description, ea_product.avg_price, ea_image.file\n\t\t\tFROM ea_product LEFT JOIN ea_image\n ON ea_product.upc = ea_image.upc\n WHERE ea_product.category_id = '$category_id'\n\t\t\tORDER BY ea_product.avg_price\";\n */\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND category_id = '$category_id'\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t\n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n\t}", "protected function getCategoryByPath($path,$storeIdentifier)\n {\n\n $store = $this->storeFactory->create();\n $store->load($storeIdentifier);\n $storeId = $store->getId();\n if($storeId){\n $rootCatId = $store->getGroup()->getDefaultStore()->getRootCategoryId();\n $names = array_filter(explode('/', $path));\n $tree = $this->getTree($rootCatId);\n foreach ($names as $name) {\n $tree = $this->findTreeChild($tree, $name);\n if (!$tree) {\n $tree = $this->findTreeChild($this->getTree($rootCatId, true), $name);\n }\n if (!$tree) {\n break;\n }\n }\n return $tree;\n }else{\n return null;\n }\n\n }" ]
[ "0.65317667", "0.64077926", "0.6311345", "0.6276059", "0.6240993", "0.62391573", "0.62004507", "0.6194961", "0.6185571", "0.6171575", "0.6099227", "0.6077542", "0.6072147", "0.60644984", "0.60644984", "0.6045247", "0.60351044", "0.6023607", "0.6013061", "0.6012197", "0.59623754", "0.5933934", "0.5926271", "0.5919241", "0.5914203", "0.5911154", "0.58973205", "0.5890823", "0.58781165", "0.58561695" ]
0.7754095
0
get Product by Category Search
function getProductByCategorySearch($category_id, $keyword){ $unix_product = array(); //$has_printed = false; $total_product_1 = 0; $total_product_2 = 0; $keyword=strtolower($keyword); if($category_id!=0){ $q_category = getResultSet("SELECT DISTINCT(category_id) FROM ".DB_PREFIX."category WHERE parent_id=".$category_id); } elseif($category_id==0){ $q_category = getResultSet("SELECT DISTINCT(category_id) FROM ".DB_PREFIX."category"); } while($rc=mysql_fetch_array($q_category)){ $cat_id = $rc['category_id']; //if($category_id!=0){ $q_product_id=getResultSet("SELECT DISTINCT(C.product_id) FROM ".DB_PREFIX."product_to_category AS C INNER JOIN ".DB_PREFIX."product_description AS D ON C.product_id = D.product_id WHERE C.category_id=".$cat_id." AND lower(D.name) LIKE '%$keyword%'"); $total_product_1 = mysql_num_rows($q_product_id); while($rp=mysql_fetch_array($q_product_id)){ $product_id = $rp['product_id']; $product = new product($product_id); if(!in_array($product_id, $unix_product)){ echo '<div class="item">'; echo '<div class="desc">'; echo '<div class="item_name" >'.$product->getProductName().'_'.$total_product_1.'</div>'; echo '<div class="shop_name"><span style="padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;">'.$product->getShopName().'</span></div>'; echo '<div class="price" >$'.$product->getProductPrice().'</div>'; echo '</div>'; echo '<a href="?page=productdetail&product='.$product_id.'">'; echo '<img src="'.$product->getProductImage().'">'; echo '</a>'; echo '</div>'; } $unix_product[] = $rp['product_id']; $unix_product = array_unique($unix_product); } } //Search Child Category $q_child_product_id=getResultSet("SELECT DISTINCT(C.product_id) FROM ".DB_PREFIX."product_to_category AS C INNER JOIN ".DB_PREFIX."product_description AS D ON C.product_id = D.product_id WHERE C.category_id=".$category_id." AND lower(D.name) LIKE '%$keyword%'"); $total_product_2 = mysql_num_rows($q_child_product_id); while($rp=mysql_fetch_array($q_child_product_id)){ $product_id = $rp['product_id']; $product = new product($product_id); if(!in_array($product_id, $unix_product)){ echo '<div class="item">'; echo '<div class="desc">'; echo '<div class="item_name" >'.$product->getProductName().$total_product_2.'</div>'; echo '<div class="shop_name"><span style="padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;">'.$product->getShopName().'</span></div>'; echo '<div class="price" >$'.$product->getProductPrice().'</div>'; echo '</div>'; echo '<a href="?page=productdetail&product='.$product_id.'">'; echo '<img src="'.$product->getProductImage().'">'; echo '</a>'; echo '</div>'; } $unix_product[] = $rp['product_id']; $unix_product = array_unique($unix_product); } //Info if Search No Result /* if($total_product_1==0 && $total_product_2==0){ echo '<div class="no_item" style="height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;">'; echo 'No Result! RUn'.$total_product_1.'_'.$total_product_2; //echo ':)'.$rLanguage->text("Logout"); echo '</div>'; } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $request = request();\n $category_id = $request->input('category_id');\n $keyword = $request->input('q');\n\n $products = Product::when($category_id, function($query, $category_id) {\n return $query->where('category_id', $category_id);\n })\n ->when($keyword, function($query, $keyword) {\n return $query->where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('description', 'LIKE', \"%$keyword%\");\n })\n ->with('category')\n ->paginate();\n\n return $products;\n }", "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "public function category_search_get($category_name=\"cell_process\")\n {\n $sutil = new CILServiceUtil();\n $query = file_get_contents('php://input', 'r');\n $json = $sutil->searchCategory($category_name, $query);\n $this->response($json);\n }", "private function searchByCategory($category){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($category)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n foreach($item->categories as $category_tmp)\n if($category == $category_tmp){\n $searchResults[] = $item;\n } \n }\n return $searchResults;\n }", "public function product_get_by_category($data)\n {\n $queryColumn = \"DESCRIBE \" . $this->db_table_prefix . \"products\";\n $resultColumn = $this->commonDatabaseAction($queryColumn);\n $resultColumn = $this->resultArray($resultColumn);\n $columns = php_array_column($resultColumn, 'Field');\n \n $query = \"SELECT p.*, c.name as catName\n \t FROM \" . $this->db_table_prefix . \"products p\n JOIN \" . $this->db_table_prefix . \"categories c\n ON p.cat_id = c.id \";\n \n if (!empty($data))\n {\n $query .= 'WHERE 1';\n foreach ($data as $key => $value)\n {\n $pos = strpos($key, '.');\n $columnArray = ($pos) ? explode('.', $key) : ''; \n $columnName = (!empty($columnArray)) ? $columnArray[1] : $key ;\n \n if (in_array($columnName, $columns))\n {\n $query .= ' AND ' . $key . ' = ' . $value;\n }\n }\n }\n $query .= \" ORDER BY p.id DESC\";\n\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "public function searchWithCategory(Request $request)\n {\n $category = trim($request->get('category'));\n\n if ($category) {\n $products = Product::where('category_id', '=', $category)\n ->orderBy('created_at', 'desc')\n ->paginate(4);\n }\n \n return view('products.index', [\n 'products' => $products\n ]);\n \n }", "public function search(Request $request)\n {\n $this->validate($request, [\n 'term' => 'required|string',\n 'category_id' => 'required|integer|min:0',\n ]);\n $searchResults = Product::hydrate(Searchy::products([\n 'name_en', 'name_ar',\n 'description_en', 'description_ar',\n 'short_description_en', 'short_description_ar',\n ])->query($request->term)->get()->toArray())->where('active', 1);\n $category = SubSubCategory::find($request->category_id);\n $latest_products = Product::orderBy('created_at', 'desc')->active()->get()->take(5);\n if ($category) {\n $category_products = $category->active()->first()->products()->active()->get();\n $searchResults = $searchResults->intersect($category_products);\n }\n return view('user.products.search', compact('searchResults', 'latest_products'));\n }", "public function search_product(){\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->model('Orders');\n\t\t$product_name = $this->input->post('product_name');\n\t\t$category_id = $this->input->post('category_id');\n\t\t$product_search = $this->Orders->product_search($product_name,$category_id);\n if ($product_search) {\n foreach ($product_search as $product) {\n echo \"<div class=\\\"col-xs-6 col-sm-4 col-md-2 col-p-3\\\">\";\n echo \"<div class=\\\"panel panel-bd product-panel select_product\\\">\";\n echo \"<div class=\\\"panel-body\\\">\";\n echo \"<img src=\\\"$product->image_thumb\\\" class=\\\"img-responsive\\\" alt=\\\"\\\">\";\n echo \"<input type=\\\"hidden\\\" name=\\\"select_product_id\\\" class=\\\"select_product_id\\\" value='\".$product->product_id.\"'>\";\n echo \"</div>\";\n echo \"<div class=\\\"panel-footer\\\">$product->product_model - $product->product_name</div>\";\n echo \"</div>\";\n echo \"</div>\";\n \t}\n }else{\n \techo \"420\";\n }\n\t}", "public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }", "public function search() {\n\n if ($this->request->is('post')) {\n\n // Lay du lieu tu form\n\n $listCat = $_REQUEST['listCat'];\n\n $this->Session->write('catId', $listCat);\n\n\n\n // Get keyword\n\n $keyword = $_REQUEST['keyword'];\n\n $this->Session->write('keyword', $keyword);\n\n } else {\n\n $listCat = $this->Session->read('catId');\n\n $keyword = $this->Session->read('keyword');\n\n }\n\n\n\n // setup condition to search\n\n $condition = array();\n\n if (!empty($keyword)) {\n\n $condition[] = array(\n\n 'Product.name LIKE' => '%' . $keyword . '%'\n\n );\n\n }\n\n\n\n if ($listCat > 0) {\n\n $condition[] = array(\n\n 'Product.cat_id' => $listCat\n\n );\n\n }\n\n\n\n // Lưu đường dẫn để quay lại nếu update, edit, dellete\n\n $urlTmp = DOMAINAD . $this->request->url;\n\n $this->Session->write('pageproduct', $urlTmp);\n\n\n\n // Sau khi lay het dieu kien sap xep vao 1 array\n\n $conditions = array();\n\n foreach ($condition as $values) {\n\n foreach ($values as $key => $cond) {\n\n $conditions[$key] = $cond;\n\n }\n\n }\n\n\n\n // Tang so thu tu * limit (example : 10)\n\n $urlTmp = DOMAINAD . $this->request->url;\n\n $urlTmp = explode(\":\", $urlTmp);\n\n if (isset($urlTmp[2])) {\n\n $startPage = ($urlTmp[2] - 1) * 10 + 1;\n\n } else {\n\n $startPage = 1;\n\n }\n\n $this->set('startPage', $startPage);\n\n\n\n // Simple to call data\n\n $this->paginate = array(\n\n 'conditions' => $condition,\n\n 'order' => 'Product.id DESC',\n\n 'limit' => '10'\n\n );\n\n $product = $this->paginate('Product');\n\n $this->set('product', $product);\n\n\n\n // Load model\n\n $this->loadModel(\"Catproduct\");\n\n $list_cat = $this->Catproduct->generateTreeList(null, null, null, '-- ');\n\n $this->set(compact('list_cat'));\n\n }", "public function ProductSearch() {\n\t\t\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$seller_id\t\t\t=\t$search_data['seller_id'];\n\t\t\n\t\t$querydata \t\t= \t$this->_objectManager->create('Webkul\\Marketplace\\Model\\Product')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t\t['eq' => $seller_id]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'status',\n\t\t\t\t\t\t\t\t\t['eq' =>1]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->addFieldToSelect('mageproduct_id')\n\t\t\t\t\t\t\t\t->setOrder('mageproduct_id');\n\t\t\t//return \t$querydata->getData();\t\t\t\t\n\t\t\t$collection = $this->_productCollectionFactory->create()->addAttributeToSelect(\n '*'\n );\n\t\t$collection->addAttributeToFilter('entity_id', array('in' => $querydata->getData()));\n\t\t$collection->addAttributeToFilter('name', array('like' => '%'.$search_term.'%'));\n\t\t\t\n\t\treturn $collection->getData();\n\t\t\t\n }", "public function getProductsBySearch ($search) {\n \n $words = explode(' ', $search);\n $regex = implode('|', $words);\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n if (!empty($search)) {\n \n try {\n\n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n FROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND ( product_name REGEXP '{$regex}'\n OR brand REGEXP '{$regex}'\n OR upc REGEXP '{$regex}'\n OR ea_category.name REGEXP '{$regex}' )\n ORDER BY avg_price\";\n //print(\"$query\");\n foreach($this->dbo->query($query) as $row) {\n $id = stripslashes($row[0]);\n $upc = strval(stripslashes($row[1]));\n $brand = $this->convertFancyQuotes(stripslashes($row[2]));\n $product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n $product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n $avg_price = stripslashes($row[5]);\n $category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n\n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n\n $product[\"image_path\"] = $this->getImagePath($upc);\n\n $products[] = $product;\n }\n\n } catch (PDOException $e) {\n $this->errorCode = 1;\n $errorCode = -1;\n $errorMessage = \"PDOException for getProductsBySearch.\";\n }\t\n \n } else {\n $errorCode = 1;\n\t\t\t$errorMessage = \"No Search value provided.\";\n }\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $search;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n \n }", "public function product_by_search()\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->library('lproduct');\n\t\t$product_id = $this->input->post('product_id');\t\t\n $content = $CI->lproduct->product_search_list($product_id);\n $sub_menu = array(\n\t\t\t\tarray('label'=> 'Manage Product', 'url' => 'Cproduct', 'class' =>'active'),\n\t\t\t\tarray('label'=> 'Add Product', 'url' => 'Cproduct/manage_product')\n\t\t\t);\n\t\t$this->template->full_admin_html_view($content,$sub_menu);\n\t}", "public function search(Request $request, $category)\n { \n\n\n\n $result= Tip::where('category', 'like', '%'.$category.'%')->get();\n\n if(!empty($result)){\n $arraycategories=[];\n foreach($result as $res){\n $arraycategories[] = $res['category'];\n\n }\n\n return response()->json(array_unique($arraycategories));\n\n }\n\n }", "public function index(Request $request, Category $category = null)\n {\n if($category&&$category->id>0){\n $items = $category->products()\n ->ofStatus('published')\n ->where('quantity', '>', 0);;\n }else{\n $items = Product::ofStatus('published')\n ->where('quantity', '>', 0);\n }\n \n $search = new Search();\n $q = $request->q;\n if($q){\n $items = $items->where(function($query) use ($q){\n return $query->where('content', 'LIKE', '%'.$q.'%')\n ->orWhere('title', 'LIKE', '%'.$q.'%');\n });\n $search->keyword = $q;\n if(!$request->ajax()) $search->save();\n }\n \n $page = $request->get('page');\n if(empty($page)) $page = 1;\n \n $orderBy = $request->get('orderBy');\n if(!in_array($orderBy, ['price', 'created_at', 'view_count'])) $orderBy = 'price';\n \n $order = $request->get('order');\n if(!in_array($order, ['desc', 'asc'])) $order = 'desc';\n \n $items = $items->orderBy($orderBy, $order);\n $items = $items->paginate($this->pageSize);\n \n if($request->ajax()){\n return response()->json(array(\n 'html' => view('ajax.product.all', compact('items'))->render()\n ));\n }\n \n $products = Product::orderBy('created_at','desc')\n ->ofStatus('published')\n ->take($this->recentSize)\n ->get();\n \n $categories = Category::orderBy('created_at', 'desc')\n ->has('products')\n ->withCount('products')\n ->take($this->recentSize)\n ->get();\n \n $page2 = Page::where('path', '=', '/products*')->first();\n if($page2){$pubs = $page2->pubs;}else{$pubs=[];}\n\n $types = Type::orderBy('title', 'asc')\n ->where('object_type', 'type')\n ->withCount('products')\n ->get();\n \n $locationTypes = Type::orderBy('title', 'asc')\n ->where('object_type', 'location')\n ->withCount('products')\n ->get();\n \n $states = State::orderBy('content', 'asc')\n ->withCount('products')\n ->get();\n \n return view('shop.index')\n ->with('items', $items)\n ->with('search', $search)\n ->with('q', $q)\n ->with('orderBy', $orderBy)\n ->with('order', $order)\n ->with('page', $page)\n ->with('pubs', $pubs)\n ->with('products', $products)\n ->with('types', $types)\n ->with('locationTypes', $locationTypes)\n ->with('states', $states)\n ->with('category', $category)\n ->with('categories', $categories); \n }", "public function searchProduct($search)\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE name LIKE ? OR description LIKE ? OR category LIKE ?;\";\n $resultset = $this->db->executeFetchAll($sql, array_fill(0, 3, \"%\" . $search . \"%\"));\n return $resultset;\n }", "function productByCategory($id)\n {\n \t\n }", "function get_ProductsBy_CatID($data) {\r\n $params[0] = array(\"name\" => \":category_id\", \"value\" => &$data['category_id']);\r\n $params[1] = array(\"name\" => \":prodType\", \"value\" => &$data['prodType']);\r\n return $this->DBObject->readCursor(\"product_actions.get_ProductsBy_CatID(:category_id,:prodType)\", $params);\r\n }", "public function getProducts($category) {\n $sql = \"SELECT * FROM products INNER JOIN categories on products.product_CategoryID = categories.category_ID WHERE category_Name = '\".$category.\"'\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"products\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"product_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"product_Name\"] . '\",' .\n '\"Category\": \"' . $row[\"category_Name\"] . '\",' .\n '\"Price\": \"' . $row[\"product_Price\"] . '\",' .\n '\"Brand\": \"' . $row[\"product_Brand\"] . '\",' .\n '\"Description\": \"' . $row[\"product_Description\"] . '\",' .\n '\"ImagePath\": \"' . $row[\"product_ImagePath\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Return the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n }", "function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "function searchProduct($type,$input)\n {\n $products;\n switch($type)\n {\n case 0:\n $products=Product::search($input);\n break;\n case 1:\n $products=Product::searchByName($input);\n break;\n case 2:\n $products=Product::searchByGroup($input);\n break;\n case 3:\n $products=Product::searchBySupplier($input);\n break;\n case 4:\n $products=Product::searchByTag($input);\n break;\n case 5: $products=Product::searchByDescription($input);\n break;\n default:\n break;\n }\n if(!empty($products))\n {\n return $products;\n }else {\n return false;\n }\n }", "public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "public function searchProductosCategoria($value){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1 and producto.nombre LIKE ?';\n $params=array($this->categoria,\"%$value%\");\n return Database::getRows($sql, $params);\n }", "public function searchCategory(Request $request){\n $categories=Category::where('title','LIKE','%'.$request->keyword.'%')->orWhere('description','LIKE','%'.$request->keyword.'%')->get();\n if(count($categories)==0){\n return Response::json(['message'=>'No category match found !']);\n }else{\n return Response::json($categories);\n }\n }", "function searchCoursesByCategory($categoryId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE CategoryId='\" . $categoryId . \"' ORDER BY popularity\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function productsBasedOnCategory($category_id){\n $now=Carbon::now();\n $date=$now->toDateString();\n $products=Product::where([['status',1],['sell_by_date','>',$date],['category_id',$category_id]])->get();\n\n /*to be populated in dashboard*/\n $categories=Category::all();\n\n $category=Category::find($category_id);\n return view('products.filter.byCategory',compact('products','categories','category'));\n }", "function get_foods_of_category($search_key) {\n if ((!$search_key) || ($search_key == '')) {\n return false;\n }\n \n $conn = db_connect();\n $query = \"select * from food where catogery_name = '\".$search_key.\"'\";\n \n $result = @$conn->query($query);\n if (!$result) {\n return false;\n }\n \n $num_books = @$result->num_rows;\n if ($num_books == 0) {\n return false;\n } \n $result = db_result_to_array($result);\n return $result;\n}", "public function search($input) {\r\n $con = database::connectDB();\r\n $query = \"select * \"\r\n . \"from tbl_product pr \"\r\n . \"INNER JOIN tbl_categories cate on pr.CATE_id = cate.CATE_id\"\r\n . \"where \"\r\n . \"pr.PRODUCT_id LIKE '%\" . $input . \"%' OR pr.PRODUCT_name LIKE '%\" . $input . \"%'\"\r\n . \"OR cate.CATE_name LIKE '%\" . $input . \"%'\";\r\n $result = mysqli_query($con, $query);\r\n database::close();\r\n\r\n return $result;\r\n }", "public function getCategory($search_type, $id)\n {\n $data['id'] = $id;\n $data['search_type'] = $search_type;\n //Get Categories for sidebar\n $categories = CategoryOrder::orderBy('order')->get();\n\n foreach ($categories as $category)\n {\n $cat = Category::where('id', $category->category_id)->first();\n\n $category->id = $category->category_id;\n $category->name = $cat->name;\n\n $category->subcategory = Category::where('parent', $category->id)->get();\n }\n\n $ids = [];\n\n if (Category::find($id)->value('parent') == 0) //Clicking on a 'main category' link\n {\n $ids = Category::where('parent', $id)->lists('id')->toArray();\n }\n array_push($ids, (int)$id);\n\n $approved_users = User::where('approved', 1)->lists('id')->toArray();\n\n\n $productcount = \\App\\Product::whereIn('category', $ids)\n ->where('approved',1)\n ->whereIn('user', $approved_users)\n ->count();\n\n $suppliercount = User::whereIn('category', $ids)\n ->whereIn('id', $approved_users)\n ->where(function ($query) {\n $query->where('role', 'supplier')\n ->orWhere('role', 'both');\n })->count();\n\n $buyercount = $products = Buyproduct::whereIn('category', $ids)\n ->where('approved',1)\n ->whereIn('user', $approved_users)\n ->count();\n\n if ($search_type == 'Products') //Product Search\n {\n $products = \\App\\Product::whereIn('category', $ids)\n ->where('approved',1)\n ->whereIn('user', $approved_users)\n ->paginate(SettingsController::MAX_PAGINATE);\n\n $pagetitle = \"Products List\";\n\n return view('publicview.catproductsearch', compact('products', 'pagetitle', 'categories', 'data', 'productcount', 'suppliercount', 'buyercount'));\n\n }\n else if ($search_type == 'Suppliers') //Supplier Search\n {\n $suppliers = User::whereIn('category', $ids)\n ->whereIn('id', $approved_users)\n ->where(function ($query) {\n $query->where('role', 'supplier')\n ->orWhere('role', 'both');\n })->paginate(SettingsController::MAX_PAGINATE);\n\n $pagetitle = \"Suppliers List\";\n\n return view('publicview.catsuppliersearch', compact('suppliers', 'pagetitle', 'categories', 'data', 'productcount', 'suppliercount', 'buyercount'));\n\n }\n else if ($search_type == 'Buyers')\n {\n $products = Buyproduct::whereIn('category', $ids)\n ->where('approved',1)\n ->whereIn('user', $approved_users)\n ->paginate(SettingsController::MAX_PAGINATE);\n\n $pagetitle = \"Buyers List\";\n\n return view('publicview.catbuyersearch', compact('products', 'pagetitle', 'categories', 'data', 'productcount', 'suppliercount', 'buyercount'));\n }\n }" ]
[ "0.71643317", "0.7025536", "0.69703025", "0.6907894", "0.68832415", "0.6829164", "0.68226475", "0.67797655", "0.6772409", "0.6767486", "0.67455864", "0.673169", "0.6724667", "0.670287", "0.67013144", "0.6683852", "0.6656874", "0.663494", "0.6634396", "0.6626445", "0.661354", "0.6590986", "0.6589036", "0.65826505", "0.65707445", "0.655839", "0.6545376", "0.6545335", "0.6539843", "0.65385073" ]
0.73423225
0
Lists all reservation entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $reservation = $em->getRepository('CommerceBundle:Reservation')->findAll(); return $this->render('reservation/index.html.twig', array( 'reservation' => $reservation, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return Reservation::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VCReservasBundle:Reserva')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $reservation = Reservation::all();\n return $reservation;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $reservers = $em->getRepository('FrontBonPlanBundle:Reserver')->findAll();\n\n return $this->render('reserver/index.html.twig', array(\n 'reservers' => $reservers,\n ));\n }", "public function actionReservationIndex()\n {\n $searchModel = new ServicesReservationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('reservationindex', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $reservations = Reservation::orderByDesc('id')->get();\n return view(\"admin.pages.reservation.list\", compact(\"reservations\"));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Reservation::find()->where(['user_id' => \\Yii::$app->user->id]),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function reservationsList(Request $request)\n {\n $id = $request->get('id');\n $search = $request->get('search');\n\n $placeReservations = $this->repository->scopeQuery(function ($query) use ($id) {\n return $query->where(['place_id' => $id, 'is_pre_reservation' => false])->orderBy('date', 'ASC');\n })->with('client')->whereHas('client', function($q) use ($search){\n $q->where('name', 'LIKE', '%'.$search.'%');\n $q->orWhere('last_name', 'LIKE', '%'.$search.'%');\n })->paginate(10);\n\n if (request()->wantsJson()) {\n\n return response()->json($placeReservations);\n }\n }", "public function actionIndex()\n {\n $searchModel = new ReservationDetailSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function index()\n {\n $reservations = Reservation::all();\n return view('calendarreservation', compact('reservations'));\n }", "public\n function indexReservationAction(Request $request)\n {\n $authenticationUtils = $this->get('security.authentication_utils');\n\n // get the login error if there is one\n $error = $authenticationUtils->getLastAuthenticationError();\n\n // last username entered by the user\n $lastUsername = $authenticationUtils->getLastUsername();\n $user = $this->getUser();\n $em = $this->getDoctrine()->getManager();\n $profilNotifs = $em->getRepository('AppBundle:ProfilNotification')->findby(array('active' => true));\n $typeNotifications = $em->getRepository('AppBundle:TypeNotification')->findby(array('entite' => 'Reservation'));\n foreach ($profilNotifs as $profilNotif) {\n foreach ($typeNotifications as $typeNotification) {\n if ($profilNotif->getTypeNotification() == $typeNotification) {\n $profilNotif->setActive(false);\n $em->merge($profilNotif);\n $em->flush();\n }\n }\n }\n // $reservations = $em->getRepository('AppBundle:Reservation')->findAlll();\n $reservations = $em->getRepository('AppBundle:Reservation')->findAlll();\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate($reservations, $request->query->getInt('page', 1), 5);\n\n\n return $this->render(':admin:reservation/index.html.twig', array('pagination' => $pagination,\n 'reservations' => $reservations,\n\n 'last_username' => $lastUsername,\n 'error' => $error,\n 'user' => $user\n ));\n }", "static public function getAllReservations() {\n\t\ttry {\n\t\t\t$rep = Model::$pdo->query('SELECT * FROM reservation WHERE idFestival =' . $_SESSION[\"idFestival\"]);\n\t\t\t$rep->setFetchMode(PDO::FETCH_CLASS, 'ModelReservation');\n\t\t\t$tab_prod = $rep->fetchAll();\n\t\t\treturn $tab_prod;\n\t\t} catch (PDOException $e) {\n\t\t\techo('Error tout casse ( /!\\ method getAllReservations() /!\\ )');\n\t\t}\n\t}", "public function index()\n {\n $resultsPerPage = 4;\n\n if (request()->wantsJson()) {\n $reservations = Reservation::with(['status', 'hotel'])\n ->withCount(['clients', 'rooms'])\n ->paginate($resultsPerPage);\n\n $data = $reservations->makeHidden([\n 'reservation_status_id',\n 'created_at',\n 'updated_at',\n 'hotel_id'\n ]);\n $reservations->data = $data;\n\n return response($reservations);\n }\n\n return view('reservations.index');\n }", "public function index()\n {\n //\n $json = \\App\\Reservation::all();\n return $json;\n }", "public function getAllAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $thisEventDate = $em->getRepository('AtkRegistrationBundle:EventDate')->findAll();\n \n if (!$thisEventDate) {\n throw $this->createNotFoundException('Unable to find EventDate entity.');\n }\n \n return $this->render('AtkRegistrationBundle:EventDate:eventdate.html.twig', array('eventdate' => $thisEventDate));\n }", "public function index()\n {\n return Reserva::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n\n\n\n\n $reservationbooks = $em->getRepository('BooksBundle:Reservationbook')->findBy(array(\"idetd\"=>$user->getId()));\n\n return $this->render('reservationbook/index.html.twig', array(\n 'reservationbooks' => $reservationbooks,\n ));\n }", "public function index() {\n $reservations = Reservation::paginate(15);\n return view('reservations.index', compact('reservations'));\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n\n $placeReservations = $this->repository->scopeQuery(function ($query) {\n return $query->where(['client_id' => \\Auth::guard('client')->user()->id]);\n })->with(['place' => function ($query) {\n $query->select('id', 'name', 'slug');\n }])->paginate(10);\n\n if (request()->wantsJson()) {\n\n return response()->json($placeReservations);\n }\n\n return view('placeReservations.index', compact('placeReservations'));\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function showAllAction( Request $request)\n { $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('GererEntrepotBundle:Entrepot')->findAll();\n\n\n return $this->render('@GererEntrepot/admin/index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n\n }", "public function indexAction(){\n\t\t$user = $this->getUser(); if ($user == '' || !$this->es_admin()) { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n\n\t\t$user = $this->getUser();\n\t\t$roles = $user->getRoles();\n\t\t$em = $this->getDoctrine()->getManager();\n\n\t\t$entities = $em->getRepository('LIHotelBundle:Reserva')->findAll();\n\n\t\treturn $this->render('LIHotelBundle:Reserva:index.html.twig', array(\n\t\t\t'entities' => $entities,\n\t\t\t'user' => $user\n\t\t));\n\t}", "public function index(Request $request){\n return Reserva::all();\n }", "public function index()\n {\n\n $reservation = Reservation::orderByRaw(\"FIELD(status , 'pending', 'accepted', 'cancelled') ASC\")->get();\n\n $guest = Guest::all();\n \n $roomType = RoomType::all();\n \n $inventory = Inventory::all();\n \n return view('frontDesk.reservation.reservation', compact('inventory', 'roomType','reservation','guest'));\n \n \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CmarMeetingBundle:Meeting')->findAll();\n\n return array('entities' => $entities);\n }", "public function getReserv()\r\n {\r\n $query = \"SELECT * FROM list_reservation\";\r\n $stmt = $this->connexion()->prepare($query);\r\n $stmt->execute();\r\n\r\n while ($result = $stmt->fetchAll()) {\r\n return $result;\r\n }\r\n }", "public function index(Request $request)\n {\n $reservations = Reservation::query()->paginate();\n\n return $this->success($reservations);\n }", "public function getReservations()\n {\n return $this->hasMany(Reservation::className(), ['service_id' => 'id']);\n }", "public function index()\n {\n return Reservation::with('customer','paypal_payments')->Where('status','Check in')->orWhere('status','Reserved')->get();\n }" ]
[ "0.7254961", "0.71217114", "0.6814796", "0.6761953", "0.6728081", "0.6691792", "0.66635925", "0.6657193", "0.6632309", "0.65781355", "0.6526293", "0.65245694", "0.6493011", "0.6482767", "0.64495856", "0.6447723", "0.64351624", "0.64106417", "0.63504595", "0.634273", "0.6321366", "0.63105243", "0.62998444", "0.62661326", "0.62644464", "0.62588936", "0.62260056", "0.622468", "0.62196696", "0.6211623" ]
0.7567255
0
Delete a Shipping Service for the App. Note: you can only delete a Shipping Service if the App is the owner of the service.
public function delete($id) { Assert::integerish($id, __METHOD__ . 'expects $id to be an integer'); return $this->call('DELETE', "/shipping/services/{$id}.json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleting(Service $Service)\n {\n //code...\n }", "public function deleteAction(Request $request, Services $service)\n {\n $form = $this->createDeleteForm($service);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n if ($service->getParent()) {\n $service->setParent(null);\n }\n foreach($service->getWorkerOrders() as $order) {\n $order->setServices(null);\n $order->setServicesparent(null);\n }\n $em->remove($service);\n $em->flush();\n }\n\n return $this->redirectToRoute('services_index');\n }", "public function deleted(Service $service)\n {\n //\n }", "public function deleted(Service $Service)\n {\n //code...\n }", "public function destroy(Services $service)\n {\n $service->delete();\n }", "public function destroy(Service $service)\n {\n $service->delete();\n session()->flash('success', __('site.deleted_successfully'));\n return redirect()->route('dashboard.service.index');\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $id = $model->service_id;\n $model->delete();\n\n return $this->redirect(['/admin/services/edit', 'id' => $id]);\n }", "public function deleteService($service_id) {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\tif(empty($service_id)) {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 400,\n\t\t\t\t\t\"message\" => \"Parametros incorrectos, service_id es requerido\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\t$service = ServicesOrder::where(\"id_client\", $user->id)->where(\"id\", $service_id)->first();\n\n\t\t\t\tif($service) {\n\t\t\t\t\t$service->status = 6;\n\t\t\t\t\t$service->save();\n\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\t\"message\" => \"Servicio borrado exitosamente\",\n\t\t\t\t\t\t\"response\" => array(\"service\" => $service)\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 400,\n\t\t\t\t\t\t\"message\" => \"El servicio que intenta borrar no existe\",\n\t\t\t\t\t\t\"response\" => null\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function destroy(Service $service)\n {\n //\n $service->delete();\n\n return redirect('/service');\n }", "public function destroy($id)\n {\n $shipping = Shipping::find($id);\n Storage::delete($shipping->logo);\n $shipping->delete();\n session()->flash('success', trans('admin.record_deleted'));\n\n return redirect(aurl('shippings'));\n }", "public function deleteService()\n {\n $serviceid = request()->input('serviceId');\n DB::table('tbl_services')->where('service_id',$serviceid)->delete();\n return redirect('cms/1');\n }", "public function delete($id)\n {\n $information = Service::find($id)->delete();\n return redirect('/services');\n }", "public function deleteAction($serviceid) {\n $this->require_login('ROLE_ADMIN', 'service/delete/' . $serviceid);\n\n $service = Admin::getService($serviceid);\n\n // If there are purchases, we're out of here\n if (Admin::is_purchases($serviceid)) {\n $haspurchases = true;\n } else {\n $haspurchases = false;\n\n // anything submitted?\n if ($data = $this->getRequest()) {\n\n // Delete?\n if (!empty($data['delete'])) {\n Admin::deleteService($service);\n }\n $this->redirect('service/index');\n }\n }\n\n $this->View('service/delete', array(\n 'service' => $service,\n 'haspurchases' => $haspurchases,\n ));\n }", "public function destroy($id)\n {\n $service = Service::findOrFail($id);\n $service->delete();\n \n // redirect\n return redirect('/services');\n }", "public function destroy(Service $service)\n {\n $service->clients()->detach();\n File::delete($service->logo);\n $service->delete();\n\n\n return redirect()->route('services');\n }", "public function destroy(Service $service)\n {\n //\n }", "public function forceDeleted(Service $service)\n {\n //\n }", "public function deleted(SaleService $saleService)\n {\n //\n }", "public function destroy(Service $service)\n {\n $service->delete();\n session()->flash('flash_message', 'Se ha eliminado el servicio');\n return redirect('servicios');\n }", "public function destroySpaService($id)\n {\n $service = Service::find($id);\n $service->delete();\n return Response::json( array('result' => true, 'content' => 'The spa service has been deleted') );\n }", "public function destroy($id)\r\n\t{\r\n\t\t$service = Service::find($id)->delete();\r\n\t\tSession::flash('message', 'Successfully deleted service');\r\n\t\treturn Redirect::to('services');\r\n\t}", "public function destroy($id)\n {\n $shipping = ShippingMethod::findOrFail($id);\n $shipping->delete();\n return redirect('sadmin/shipping')->with('message','Shipping Method Delete Successfully.');\n }", "public function destroy($id)\n {\n if (Gate::denies('service.delete',ServiceType::findOrFail($id))) {\n session()->flash('warning', 'You do not have permission to edit a service');\n return redirect()->back();\n }\n $service = ServiceType::where('id', $id)->first();\n $service->delete();\n session()->flash('success', 'Service Deleted');\n return redirect()->route('service.index');\n }", "public function destroy(Service $id)\n {\n if(file_exists(public_path().'/uploads/images/services/icon/'.$id->icons))\n @unlink(public_path().'/uploads/images/services/icon/'.$id->icons);\n\n if(file_exists(public_path().'/uploads/images/services/image/'.$id->image))\n @unlink(public_path().'/uploads/images/services/image/'.$id->image);\n\n if(file_exists(public_path().'/uploads/images/services/image/thumbnail/'.$id->thumbnail))\n @unlink(public_path().'/uploads/images/services/image/thumbnail/'.$id->thumbnail);\n\n\n $id->delete();\n $delete = true;\n\n return redirect()->route('services', ['delete' => $delete])->with('status', 'Service deleted successfully');\n }", "public function delete($id)\n {\n try\n {\n $this->Shippingline->destroy($id);\n }\n catch (Exception $e)\n {\n return json_encode(array('success' => false, 'message' => 'Something went wrong, please try again later.'));\n }\n \n return json_encode(array('success' => true, 'message' => 'Shippingline successfully deleted!'));\n }", "public function destroy(Shipping $shipping)\n {\n //\n }", "public function destroy(Services $service)\n {\n DB::beginTransaction();\n\n try{\n\n $service->unlinkImage($service->banner);\n\n $service->products()->detach();\n $service->delete();\n\n DB::commit();\n\n return redirect()->route('services.index')->with('status', 'Created Successfully');\n\n } catch(Exception $e) {\n DB::rollBack();\n Log::error($e->getMessage());\n return response(['status' => \"Can't Delete Data\"], 500);\n }\n\n }", "public function destroy($id)\n {\n //\n DB::delete('DELETE FROM orders WHERE id = ?', [$id]);\n echo(\"Shipping Record deleted successfully\");\n return redirect()->route('Orders.index');\n }", "public function deleteServiceAdhoc(Request $request)\n {\n try {\n $data = $request->all();\n $available_adhocs = new AvailableAdhocs();\n return $available_adhocs->deleteAdhoc($data);\n\n } catch (Exception $exception) {\n return back()->withInput()\n ->withErrors(['unexpected_error' => $exception->getMessage()]);\n }\n }", "public function destroy($id)\n {\n $service = Services::find($id);\n $service->delete();\n \n return redirect()->back();\n }" ]
[ "0.65340686", "0.60801095", "0.5961579", "0.59219646", "0.5898796", "0.5882203", "0.58641803", "0.58499473", "0.584771", "0.5822772", "0.5787619", "0.5750809", "0.57467234", "0.56897634", "0.5679206", "0.56574637", "0.5646953", "0.5636407", "0.56165576", "0.5614049", "0.5601415", "0.5598", "0.55975443", "0.5596513", "0.5574695", "0.556489", "0.55477643", "0.5532176", "0.55305517", "0.55156994" ]
0.6723941
0
Get a list of Shipping Services associated with this App.
public function getList() { return $this->call('GET', "/shipping/services.json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n $services = InvoiceService::where('office_id', request('office_id'))->where('name', 'like', '%' . request('q') . '%')->get();\n\n return $services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n\n return $this->services;\n\n }", "public function get_services() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/services.json\");\n }", "public function getShippingServices($intShippingId = 0)\n {\n if (!$intShippingId)\n return 0;\n //Set the shipstation mapping with the X-Cart.\n $arrShippingServices = array(\n '5' => 'USPS_USPPM',//USPS Priority Mail\n '6' => 'USPS_USPEXP',//USPS Priority Mail Express\n '7' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '8' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '10' => 'USPS_USPFC',//USPS First Class Mail\n '11' => 'USPS_USPMM',//USPS Media Mail\n '13' => 'USPS_USPPM',//USPS Priority Mail\n '14' => 'USPS_USPEXP',//USPS Priority Mail Express\n '15' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '16' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '18' => 'USPS_USPFC',//USPS First Class Mail\n '19' => 'USPS_USPMM',//USPS Media Mail\n '21' => 'USPS_USPPM',//USPS Priority Mail\n '22' => 'USPS_USPEXP',//USPS Priority Mail Express\n '23' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '24' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '26' => 'UPS_UPSGND',//UPS® Ground\n '27' => 'UPS_UPS3DS',//UPS 3 Day Select®\n '28' => 'UPS_UPS2ND',//UPS 2nd Day Air®\n '29' => 'WEXPP',//UPS Worldwide Express Plus®\n '30' => 'UPS_UPSWEX',//UPS Worldwide Express®\n '31' => 'UPS_UPSNDS',//UPS Next Day Air Saver®\n '32' => 'UPS_UPSNDA',//UPS Next Day Air®\n '33' => 'UPS_UPSWEP',//UPS Worldwide Expedited®\n '34' => 'UPS_UPSWSV',//UPS Worldwide Saver®\n '35' => 'UPS_UPSCAN',//UPS Standard®\n '36' => 'UPS_UPS2DE',//UPS 2nd Day Air AM®\n '37' => 'UPS_UPSNDE',//UPS Next Day Air® Early\n '50' => 'FEDEX_GROUND',//FedEx Ground®\n '51' => 'GROUND_HOME_DELIVERY',//FedEx Home Delivery®\n '52' => 'FEDEX_2_DAY',//FedEx 2Day®\n '53' => 'FEDEX_2_DAY_AM',//FedEx 2Day® A.M.\n '54' => 'FEDEX_EXPRESS_SAVER',//FedEx Express Saver®\n '55' => 'STANDARD_OVERNIGHT',//FedEx Standard Overnight®\n '56' => 'PRIORITY_OVERNIGHT',//FedEx Priority Overnight®\n '57' => 'FIRST_OVERNIGHT',//FedEx First Overnight®\n '59' => 'INTERNATIONAL_ECONOMY',//FedEx International Economy®\n '60' => 'INTERNATIONAL_PRIORITY',//FedEx International Priority®\n '61' => 'INTERNATIONAL_FIRST',//FedEx International First®\n '67' => 'FEDEX_1_DAY_FREIGHT',//FedEx 1Day® Freight\n '68' => 'FEDEX_2_DAY_FREIGHT',//FedEx 2Day® Freight\n '69' => 'FEDEX_3_DAY_FREIGHT',//FedEx 3Day® Freight\n '70' => 'INTERNATIONAL_ECONOMY_FREIGHT',//FedEx International Economy® Freight\n '71' => 'INTERNATIONAL_PRIORITY_FREIGHT',//FedEx International Priority® Freight\n '73' => 'FEDEX_FDXIGND',//FedEx International Ground®\n '98' => 'DOM.RP',//Regular Parcel\n '99' => 'DOM.EP',//Expedited Parcel\n '100' => 'DOM.XP',//Xpresspost\n '101' => 'DOM.XP.CERT',//Xpresspost Certified\n '102' => 'DOM.PC',//Priority\n '103' => 'DOM.LIB',//Library Books\n '104' => 'USA.EP',//Expedited Parcel USA\n '105' => 'USA.PW.ENV',//Priority Worldwide Envelope USA\n '106' => 'USA.PW.PAK',//Priority Worldwide pak USA\n '107' => 'USA.PW.PARCEL',//Priority Worldwide Parcel USA\n '115' => 'INT.PW.ENV',//Priority Worldwide Envelope Intl\n '116' => 'INT.PW.PAK',//Priority Worldwide pak Intl\n '117' => 'INT.PW.PARCEL',//Priority Worldwide parcel Intl\n '118' => 'INT.SP.AIR',//Small Packet International Air\n '119' => 'INT.SP.SURF',//Small Packet International Surface\n '120' => 'INT.TP',//Tracked Packet - International\n '2700' => 'USPS_USPFC',//USPS First Class Mail\n '2701' => 'USPS_USPMM',//USPS Media Mail\n '2709' => 'USPS_USPPM',//USPS Priority Mail\n '2732' => 'USPS_USPPMI',//USPS Priority Mail International\n '2735' => 'USPS_USPEMI',//USPS Priority Mail Express International\n '2760' => 'UPS_UPSGND',//UPS Ground\n '2762' => 'UPS_UPS3DS',//UPS 3 Day Select\n '2763' => 'UPS_UPS2DE',//UPS 2nd Day Air\n '2765' => 'UPS_UPSNDAS',//UPS Next Day Air Saver\n '2766' => 'UPS_UPSNDA',//UPS Next Day Air\n );\n\n if (isset($arrShippingServices[$intShippingId])) {\n return $arrShippingServices[$intShippingId]; \n } else {\n return 0;\n }\n }", "public function getServices()\n {\n return $this->pantonoServices;\n }", "public function getServices();", "public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getServices() {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$services = ServicesOrder::join('user_addresses', 'user_addresses.id', '=', 'services_orders.address')\n\t\t\t\t->where('services_orders.id_client', $user->id)\n\t\t\t\t->where('services_orders.status', '!=', 6)\n\t\t\t\t->get(['services_orders.*', 'user_addresses.address', 'user_addresses.latitude', 'user_addresses.longitude']);\n\n\t\t\tif($services->count()) {\n\t\t\t\tforeach($services as $key => $service) {\n\t\t\t\t\t$documents = ServicesDocuments::join('documents', 'documents.id', '=', 'services2documents.document_id')->where('service_id', $service->id)->get(['documents.id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'documents.created_at']);\n\t\t\t\t\t$services[$key]->documents = $documents;\n\t\t\t\t}\n\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\"message\" => \"Listado de servicios\",\n\t\t\t\t\t\"response\" => array(\"services\" => $services)\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\"message\" => \"No se encontraron servicios\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function getService()\n {\n if (isset($this->data['ShippingService'])) {\n return $this->data['ShippingService'];\n } else {\n return false;\n }\n }", "public function getShippingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_SHIPPING]);\n }", "public function getShippingService()\n {\n if (!$this->shippingService) {\n $this->setShippingService(new ShippingService($this));\n }\n\n return $this->shippingService;\n }", "public function getServices()\r\n {\r\n if (is_null($this->_services)) {\r\n if ($this->getConfig('auto')) {\r\n $this->_services = array();\r\n $config = Mage::app()->getConfig();\r\n foreach (array('cache', 'full_page_cache', 'fpc') as $cacheType) {\r\n $node = $config->getXpath('global/' . $cacheType . '[1]');\r\n if (isset($node[0]->backend) && in_array((string)$node[0]->backend, array(\r\n 'Cm_Cache_Backend_Redis',\r\n 'Mage_Cache_Backend_Redis'\r\n ))) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__(str_replace('_', ' ', uc_words($cacheType))),\r\n $node[0]->backend_options->server,\r\n $node[0]->backend_options->port,\r\n $node[0]->backend_options->password,\r\n $node[0]->backend_options->database\r\n );\r\n }\r\n }\r\n // get session\r\n $node = $config->getXpath('global/redis_session');\r\n if ($node) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__('Session'),\r\n $node[0]->host,\r\n $node[0]->port,\r\n $node[0]->password,\r\n $node[0]->db\r\n );\r\n }\r\n } else {\r\n $this->_services = unserialize($this->getConfig('manual'));\r\n }\r\n }\r\n return $this->_services;\r\n }", "public function getShippingServiceName(){\n if(!$this->shippingServiceName){\n return $this->getCarrierServiceName();\n }\n return $this->shippingServiceName;\n }", "public static function get_services()\n {\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\CustomPostType::class,\n Base\\CustomMetaBox::class,\n Base\\Shortcode::class,\n Base\\Cron::class,\n ];\n }", "private function get_services() {\n\t\treturn [\n\t\t\tServices\\Language_Loader::class,\n\t\t\tServices\\Setup_Database::class,\n\t\t\tServices\\Scripts_And_Templates::class,\n\t\t\tServices\\Admin_Pages::class,\n\t\t\tServices\\Setup_Settings_Page::class,\n\t\t\tServices\\Loggers_Loader::class,\n\t\t\tServices\\Dropins_Loader::class,\n\t\t\tServices\\Setup_Log_Filters::class,\n\t\t\tServices\\Setup_Pause_Resume_Actions::class,\n\t\t\tServices\\Setup_Purge_DB_Cron::class,\n\t\t\tServices\\API::class,\n\t\t\tServices\\Dashboard_Widget::class,\n\t\t\tServices\\Network_Menu_Items::class,\n\t\t\tServices\\Plugin_List_Link::class,\n\t\t];\n\t}", "public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}", "public function listAllAvailableServices()\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/services/available.json\");\n\t\t$data = $data->{'services'};\n\t\t$serviceArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$serviceArray->append(new Service($data[$i], $this));\n\t\t}\n\t\treturn $serviceArray;\n }", "protected function getServicesList()\n {\n $servicesList = [];\n $services = $this->getInstalledServices();\n foreach ($services as $serviceType => $installedServices) {\n $servicesList[] = $this->getServiceTypeList($serviceType, $installedServices);\n }\n return $servicesList;\n }", "public function getShippingMethods();", "public static function getServices(): array\n {\n return static::$services;\n }", "public static function get_services()\n {\n return [\n Pages\\Dashboard::class,\n Base\\Enqueue::class,\n Base\\SettingsLink::class,\n Base\\CustomPostTypeController::class,\n ];\n }", "public static function get_services() {\n return [ \n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class,\n Base\\JsObjectsManager::class,\n Base\\ShortCodesManager::class\n ];\n }", "public function getShipping();" ]
[ "0.6723004", "0.6688981", "0.6671607", "0.6671607", "0.6671607", "0.6667309", "0.66655296", "0.66655296", "0.6656359", "0.663274", "0.6594247", "0.6470561", "0.6410358", "0.6403323", "0.63763595", "0.62962925", "0.6294049", "0.62781715", "0.6260912", "0.6237242", "0.6231255", "0.6219355", "0.6201314", "0.6168223", "0.60923934", "0.6077691", "0.6063761", "0.605068", "0.6018338", "0.6014635" ]
0.79947937
0
/ Converts a number of seconds to hours, minutes and seconds.
function convert_seconds_to_hour($time){ echo "Time diff in seconds: " . $time . "<br>"; $numHours = $time / 3600; echo $numHours; echo "<br>"; echo "Time diff in hours: " . (int)$numHours . "<br>"; $numMinutes = ($time % 3600) / 60; echo $numMinutes; echo "<br>"; echo "Time diff in minutes: " . (int)$numMinutes . "<br>"; $numSeconds = ($time % 3600) % 60; echo "Time diff in seconds: " . $numSeconds . "<br>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hms2sec ($hms) {\n\tlist($h, $m, $s) = explode (\":\", $hms);\n\t$seconds = 0;\n\t$seconds += (intval($h) * 3600);\n\t$seconds += (intval($m) * 60);\n\t$seconds += (intval($s));\n\treturn $seconds;\n}", "function get_hh_ss($seconds) {\n $hours = floor($seconds / 60 / 60);\n $minutes = floor(($seconds - ($hours * 60 * 60)) / 60);\n $d_seconds = $seconds - (($hours * 60 * 60) + ($minutes * 60));\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n $f_seconds = strlen($d_seconds) == 1 ? \"0$d_seconds\" : $d_seconds;\n return \"$f_hours:$f_minutes:$f_seconds\";\n}", "function seconds_to_time( $seconds, $format = 'H:m:s' ) {\n\t// extract hours\n\t$hours = floor($seconds / (60 * 60));\n\t\n\t// extract minutes\n\t$divisor_for_minutes = $seconds % ( 60 * 60 );\n\t$minutes = floor( $divisor_for_minutes / 60 );\n\t\n\t// extract the remaining seconds\n\t$divisor_for_seconds = $divisor_for_minutes % 60;\n\t$seconds = ceil( $divisor_for_seconds );\n\t\n\t$format = str_replace( 'H', str_pad( $hours, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 'm', str_pad( $minutes, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 's', str_pad( $seconds, 2, \"0\", STR_PAD_LEFT ), $format );\n\t\n\treturn $format;\n\t\n}", "public static function secondsToHms(int $seconds): string\n\t{\n\t\t$hours = floor($seconds / 3600);\n\t\t$minutes = floor(($seconds / 60) % 60);\n\t\t$seconds = $seconds % 60;\n\n\t\t$return_hours = $hours > 0 ? $hours.\"h\" : \"\";\n\t\t$return_minutes = $minutes > 0 ? $minutes.\"min\" : \"\";\n\t\t$return_seconds = $seconds > 0 ? $seconds.\"s\" : \"\";\n\n\t\treturn $return_hours.$return_minutes.$return_seconds;\n\t}", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "function seconds_to_time($inputSeconds)\n {\n\n $secondsInAMinute = 60;\n $secondsInAnHour = 60 * $secondsInAMinute;\n $secondsInADay = 24 * $secondsInAnHour;\n\n // extract days\n $days = floor($inputSeconds / $secondsInADay);\n\n // extract hours\n $hourSeconds = $inputSeconds % $secondsInADay;\n $hours = floor($hourSeconds / $secondsInAnHour);\n\n // extract minutes\n $minuteSeconds = $hourSeconds % $secondsInAnHour;\n $minutes = floor($minuteSeconds / $secondsInAMinute);\n\n // extract the remaining seconds\n $remainingSeconds = $minuteSeconds % $secondsInAMinute;\n $seconds = ceil($remainingSeconds);\n\n // return the final array\n return [\n 'd' => (int)$days,\n 'H' => (int)$hours,\n 'i' => (int)$minutes,\n 's' => (int)$seconds,\n ];\n }", "protected function secondsToTime($seconds) {\n $dtF = new \\DateTime(\"@0\");\n $dtT = new \\DateTime(\"@$seconds\");\n return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');\n }", "function toHours($seconds) {\n return $seconds > 0 ? formatDecimal($seconds / 3600, 3) : 0;\n}", "public static function offsetSec2His( $seconds ) {\n static $FMT = '%02d';\n switch( substr( $seconds, 0, 1 )) {\n case util::$MINUS :\n $output = util::$MINUS;\n $seconds = substr( $seconds, 1 );\n break;\n case util::$PLUS :\n $output = util::$PLUS;\n $seconds = substr( $seconds, 1 );\n break;\n default :\n $output = util::$PLUS;\n break;\n }\n $output .= sprintf( $FMT, ((int) floor( $seconds / 3600 ))); // hour\n $seconds = $seconds % 3600;\n $output .= sprintf( $FMT, ((int) floor( $seconds / 60 ))); // min\n $seconds = $seconds % 60;\n if( 0 < $seconds )\n $output .= sprintf( $FMT, $seconds ); // sec\n return $output;\n }", "function getTimeFromSeconds($seconds = '') {\n\n\t\t$hours = floor($seconds / 3600);\n\t\t$mins = floor($seconds / 60 % 60);\n\t\t$secs = floor($seconds % 60);\n\n\t\t$timeFormat = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);\n\n\t\treturn $timeFormat;\n\t}", "function convert_time($total)\n{\n return sprintf('%2d:%2d:%2d', intval($total/3600), intval($total/60) % 60, $total % 60);\n}", "protected function _secondsToTime($seconds) {\n\t\t\t$dtF = new DateTime(\"@0\");\n\t\t\t$dtT = new DateTime(\"@$seconds\");\n\t\t\t$msgid = '%a days, %h hours, %i minutes and %s seconds';\n\t\t\treturn $dtF->diff($dtT)->format( __( $msgid ) );\n\t\t}", "public function toSeconds($time) {\n \treturn intval($time / 1000) % 60;\n }", "function convertSeconds($seconds)\n{\n\t$date1 = new DateTime(\"@0\");\n\t$date2 = new DateTime(\"@$seconds\");\n\treturn $date1->diff($date2)->format(\"%a days, %h hours, %i minutes and %s seconds\");\n}", "function seconds_to_time_format($seconds = 0, $include_seconds = false) {\r\n $hours = floor($seconds / 3600);\r\n $mins = floor(($seconds - ($hours * 3600)) / 60);\r\n $secs = floor($seconds % 60);\r\n\r\n $hours = ($hours < 10) ? \"0\" . $hours : $hours;\r\n $mins = ($mins < 10) ? \"0\" . $mins : $mins;\r\n $secs = ($secs < 10) ? \"0\" . $secs : $secs;\r\n $sprintF = $include_seconds == true ? '%02d:%02d:%02d' : '%02d:%02d';\r\n return sprintf($sprintF, $hours, $mins, $secs);\r\n}", "function get_hh_mm($seconds) {\n $hours = floor($seconds / 60 / 60);\n $remaining_seconds = $seconds - ($hours * 60 * 60);\n $minutes = floor($remaining_seconds / 60);\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n return \"$f_hours:$f_minutes\";\n}", "function time_to_secs($time)\n{\n$timeArr = array_reverse(split(\":\", $time));\n$seconds = 0;\n$vals = Array(1, 60, 3600, 86400);\nforeach($timeArr as $key => $value)\n{\nif(!isset($vals[$key]))\nbreak;\n$seconds += $value * $vals[$key];\n}\nreturn $seconds;\n}", "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "function getSecondsFromTime($time = '') {\n\t\tsscanf($time, \"%d:%d:%d\", $hours, $minutes, $seconds);\n\t\t$time_seconds = $hours * 3600 + $minutes * 60 + $seconds;\n\n\t\treturn $time_seconds;\n\t}", "function formatSeconds( $seconds ) {\n $hours = 0;\n $milliseconds = str_replace( \"0.\", '', $seconds - floor( $seconds ) );\n\n if ( $seconds > 3600 ) {\n $hours = floor( $seconds / 3600 );\n }\n $seconds = $seconds % 3600;\n\n return str_pad( $hours, 2, '0', STR_PAD_LEFT ) . gmdate( ':i:s', $seconds ) . ($milliseconds ? \".$milliseconds\" : '') ;\n}", "function intToTime($sec, $padHours = true, $padMins = true, $padSecs = true) \n{\n\t$hms = \"\";\n\n\t// do the hours first: there are 3600 seconds in an hour, so if we divide\n\t// the total number of seconds by 3600 and throw away the remainder, we're\n\t// left with the number of hours in those seconds\n\t$hours = intval(intval($sec) / 3600); \n\n\t// add hours to $hms (with a leading 0 if asked for)\n\t$hms .= ($padHours) ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\" : $hours. \":\";\n\n\t// dividing the total seconds by 60 will give us the number of minutes\n\t// in total, but we're interested in *minutes past the hour* and to get\n\t// this, we have to divide by 60 again and then use the remainder\n\t$minutes = intval(($sec / 60) % 60); \n\n\t// add minutes to $hms (with a leading 0 if needed)\n\t$hms .= ($padMins) ? str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\" : $minutes. \":\";\n\n\t// seconds past the minute are found by dividing the total number of seconds\n\t// by 60 and using the remainder\n\t$seconds = intval($sec % 60); \n\n\t// add seconds to $hms (with a leading 0 if needed)\n\t$hms .= ($padSecs) ? str_pad($seconds, 2, \"0\", STR_PAD_LEFT) : $seconds;\n\n\t// done!\n\treturn $hms;\n\n}", "function convertSecond2Time($seconds, $formatTime = 'H:i:s')\n {\n $result = date($formatTime, mktime(0, 0, $seconds));\n return $result;\n }", "function secs_to_h($secs)\n{\n$units = array(\n\"week\" => 7*24*3600,\n\"day\" => 24*3600,\n\"hour\" => 3600,\n\"minute\" => 60,\n\"second\" => 1);\n// specifically handle zero, or a value less than 1 if it's a floating point number\n//Trying out handling anything less than a minute.\nif ($secs < 60)\nreturn \"$secs seconds\";\n$s = \"\";\nforeach ( $units as $name => $divisor )\n{\nif ($name == \"second\")\n{\n$quot = round($secs / $divisor, 2);\n}\nelse\n{\n$quot = intval($secs / $divisor);\n}\nif ($quot)\n{\n$s .= \"$quot $name\";\n$s .= (abs($quot) > 1 ? \"s\" : \"\") . \", \";\n$secs -= $quot * $divisor;\n}\n}\nreturn substr($s, 0, -2);\n}", "function convertTime($number)\n{\n $str_arr = explode('.', $number);\n\n $num = ($str_arr[0]);\n //floatval\n $point = ($str_arr[1]);\n $count = strlen($str_arr[1]);\n\n if ($count == 1 && $point < 10) {\n $point = $point * 10;\n }\n\n while ($point >= 60) {\n $num = $num + 1;\n $point = $point - 60;\n }\n $t = floatval($num . \".\" . $point);\n\n return $t;\n}", "function seconds_to_string($sec)\n {\n $hms = \"\";\n\t\t\n\t\t// for days\n\t\t$days = intval(intval($sec) / 86400);\n\t\t\n\t\t$hms .= ($days > 0) ? $days. \"d - \" : \"\";\n \n // do the hours first: there are 3600 seconds in an hour, so if we divide\n // the total number of seconds by 3600 and throw away the remainder, we're\n // left with the number of hours in those seconds\n $hours = intval(intval($sec / 3600) % 24);\n \n // add hours to $hms (with a leading 0 if asked for)\n $hms .= ($days == 0 && $hours == 0) ? \"\" : $hours. \"h - \";\n \n // dividing the total seconds by 60 will give us the number of minutes\n // in total, but we're interested in *minutes past the hour* and to get\n // this, we have to divide by 60 again and then use the remainder\n $minutes = intval(($sec / 60) % 60); \n \n // add minutes to $hms (with a leading 0 if needed) but only if minutes are not 0\n $hms .= ($days == 0 && $hours == 0 && $minutes == 0) ? \"\" : $minutes.\"m\";\n \n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n //$seconds = intval($sec % 60); \n \n // add seconds to $hms (with a leading 0 if needed)\n //$hms .= $seconds.\"s\";\n \n // if the total time is 0, show so\n\t\t$hms = empty($hms) ? 0 : $hms;\n\t\t\n\t\t// done!\n return $hms;\n }", "function time2sec($time){\n\t// Parameters: \t$time\n\t//\t\t\t\tType: string\n\t//\t\t\t\tFormat: dd:hh:mm:ss\n\t// Returns:\t\tinteger\n\n\t$day = 86400;\n\t$hour = 3600;\n\t$minute = 60;\n\n\t$tc = explode(\":\", $time, 4);\n\tif(!is_array($tc)) return false;\n\tif(sizeof($tc)== 2){\n\t\t\n\t\t// This time has only minutes and seconds\n\t\t$seconds = (intval($tc[0]) * $minute) + (intval($tc[1]));\n\t}elseif(sizeof($tc) == 3){\n\t\n\t\t// This time has hours minutes and seconds\n\t\t$seconds = (intval($tc[0]) * $hour) + (intval($tc[1]) * $minute) + intval($tc[2]);\n\t}elseif(sizeof($tc) == 4){\n\t\t\n\t\t// This time has days, hours, and minutes\n\t\t$seconds = (intval($tc[0]) * $day) + (intval($tc[1]) * $hour) + (intval($tc[2]) * $minute) + intval($tc[3]);\n\t}else{\n\t\t// Something is wrong\n\t\treturn false;\n\t}\n\t\n\treturn $seconds;\n}", "function TimeToSec($time) {\n\t$dot2 = strpos($time, ':');\n\tif($dot2 > 0) {\n\t\t$min = substr($time, 0, $dot2);\n\t\t$time = substr($time, $dot2+1);\n\t}\n\t\t\n\t$time = ($min * 60) + $time;\n\treturn $time;\n}", "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "public static function toSeconds ($time)\n\t\t{\n\t\t\t// 06:23:16.213\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{3})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t{\n\t\t\t\tif ($match[ 4 ] > 499)\n\t\t\t\t\t$match[ 3 ] += 1;\n\n\t\t\t\treturn (int) ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 );\n\t\t\t}\n\n\t\t\t// 06:23:16.21\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t{\n\t\t\t\tif ($match[ 4 ] > self::$fps / 2)\n\t\t\t\t\t$match[ 3 ]++;\n\n\t\t\t\treturn $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600;\n\t\t\t}\n\n\t\t\t// 06:23:16\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 4)\n\t\t\t\treturn $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600;\n\n\t\t\treturn null;\n\t\t}", "public static function getSecondsToWholeHours($seconds) {\n\t\treturn round($seconds / 3600);\n\t}" ]
[ "0.7389435", "0.73260266", "0.7112515", "0.71064585", "0.7030816", "0.70249516", "0.69129205", "0.6895721", "0.6881544", "0.6875911", "0.6856346", "0.6850859", "0.6848863", "0.68434554", "0.6805531", "0.6757704", "0.67499095", "0.67359865", "0.6705889", "0.66434646", "0.66316783", "0.6630871", "0.6610297", "0.65818936", "0.6549975", "0.65310395", "0.6524676", "0.6519013", "0.6516311", "0.6479891" ]
0.7329921
1
Attach a writer instance
public function attachWriter(Writer $writer) { if (isset($writer)) { $this->writers[] = $writer; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWriter(\\SetaPDF_Core_Writer_WriterInterface $writer) {}", "public function attach(Kohana_Log_Writer $writer, array $types = NULL)\n\t{\n\t\t$this->_writers[\"{$writer}\"] = array\n\t\t(\n\t\t\t'object' => $writer,\n\t\t\t'types' => $types\n\t\t);\n\n\t\treturn $this;\n\t}", "private function registerWriter() : void\n {\n $this->fixture->offsetSet('index', $this->writer);\n }", "public function setAdapter(Writer $adapter)\n {\n $this->adapter = $adapter;\n return $this;\n }", "private function setWriter(\\XMLWriter $writer)\n {\n $this->writer = $writer;\n }", "public function setLogger(Writer $logger)\n {\n $this->logger = $logger;\n\n return $this;\n }", "function setWriter(systemLogWriter $oWriter) {\n\t\treturn $this->_setItem($oWriter->getUniqueId(), $oWriter);\n\t}", "public function andAt(string $writer)\n\t\t\t\t{\n\t\t\t\t\t$this->backup->saveAt([$writer]);\n\n\t\t\t\t\treturn $this;\n\t\t\t\t}", "protected function addAttributesToRender($writer)\n\t{\n\t\tif ($this->getEnableVisualEdit() && $this->getEnabled(true)) {\n\t\t\t$writer->addAttribute('id', $this->getClientID());\n\t\t\t$this->registerEditorClientScript($writer);\n\t\t}\n\n\t\tparent::addAttributesToRender($writer);\n\t}", "public function attach(\\KORD\\I18n\\Reader\\ReaderInterface $reader);", "private function getWriter()\n {\n return $this->writer;\n }", "public function getWriter() {}", "public function registerWriter(WriterRegistererInterface $writer)\n {\n $this->writers = array_merge($this->writers, $writer->getRegisteredWriters());\n $this->namespaces = array_merge($this->namespaces, $writer->getRegisteredNamespaces());\n }", "protected function addAttributesToRender($writer)\n\t{\n\t\tparent::addAttributesToRender($writer);\n\t\t$writer->addAttribute('id',$this->getClientID());\n\n\t\t$this->getPage()->getClientScript()->registerPradoScript('dragdrop');\n\t\t$this->getActiveControl()->registerCallbackClientScript(\n\t\t\t$this->getClientClassName(), $this->getPostBackOptions());\n\t}", "public function addWriter(QueueWriter $writer)\n {\n $this->writers[] = $writer;\n\n return $this;\n }", "public function serialize(SerializationWriter $writer): void {\n parent::serialize($writer);\n }", "public function serialize(SerializationWriter $writer): void {\n parent::serialize($writer);\n }", "public function setUser(User $writer): self\n {\n if($writer->getNbOfWrittenArticles() == 0 || ($writer->getNbOfWrittenArticles() > 0 && $writer->getIsWriter() == false)) {\n $writer->setIsWriter(true);\n }\n $this->user = $writer;\n\n return $this;\n }", "protected function addWriter(array $writer)\n {\n $adapter = $writer['adapter'];\n $path = $writer['options']['output'];\n\n FileSystem::mkdirp($path, 0777, true);\n\n if (!empty($writer['options']['file']))\n $path .= $writer['options']['file'];\n\n $stream = new $adapter($path);\n $this->getLogger()->addWriter($stream);\n $stream->addFilter(new Priority($writer['filter']));\n\n return $adapter;\n }", "public function attach()\n {\n // dummy implementation\n }", "public function attach(WidgetProvider $provider): void\n {\n $this->attached = $provider;\n }", "public function __construct(PdfWriter $writer) {\n $this->writer = $writer;\n }", "public function sinkTo(WriterInterface $writerInterface): void;", "public function writerCreateFromPath($filePath)\n {\n $this->writer = Writer::createFromPath($filePath, 'w+');\n }", "public function open_xml_writer() {\n\n if (is_null($this->get_xml_filename())) {\n throw new convert_exception('handler_not_expected_to_write_xml');\n }\n\n if (!$this->xmlwriter instanceof xml_writer) {\n $fullpath = $this->converter->get_workdir_path() . '/' . $this->get_xml_filename();\n $directory = pathinfo($fullpath, PATHINFO_DIRNAME);\n\n if (!check_dir_exists($directory)) {\n throw new convert_exception('unable_create_target_directory', $directory);\n }\n $this->xmlwriter = new xml_writer(new file_xml_output($fullpath));\n $this->xmlwriter->start();\n }\n }", "public function write(\\SetaPDF_Core_Writer_WriterInterface $writer) {}", "public function copyTo(\\SetaPDF_Core_WriteInterface $writer) {}", "public function copyTo(\\SetaPDF_Core_WriteInterface $writer) {}", "protected function addAttributesToRender($writer)\n\t{\n\t\t$isEnabled=$this->getEnabled(true);\n\t\tif($this->getEnabled() && !$isEnabled)\n\t\t\t$writer->addAttribute('disabled','disabled');\n\t\tparent::addAttributesToRender($writer);\n\t\tif(($url=$this->getNavigateUrl())!=='' && $isEnabled)\n\t\t\t$writer->addAttribute('href',$url);\n\t\tif(($target=$this->getTarget())!=='')\n\t\t\t$writer->addAttribute('target',$target);\n\t}", "public function writeTo(XmlWriter $w) { }" ]
[ "0.6557399", "0.6333759", "0.62169576", "0.61179495", "0.6077798", "0.5568247", "0.55649376", "0.555916", "0.5547654", "0.55437225", "0.54704833", "0.5461469", "0.53434277", "0.53208095", "0.53114057", "0.5302123", "0.5302123", "0.5281024", "0.5266721", "0.523793", "0.5182185", "0.5156145", "0.5147368", "0.5144206", "0.5142755", "0.5135462", "0.5123466", "0.5123466", "0.51219034", "0.5116033" ]
0.7423104
0
Check log level exists
protected static function logLevelValid($level) { if (is_int($level) && isset(static::$levels[$level])) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isValidLogLevel($level)\n {\n return in_array($level, static::getLogLevels() );\n }", "public function testLoggerExists()\n\t{\t\t\n\t\t$this->__Log->setupLogger('test1',new \\Monolog\\Handler\\TestHandler());\n\t\t$this->assertTrue($this->__Log->isLoggerExists('test1'));\n\t\t$this->assertFalse($this->__Log->isLoggerExists('test3'));\n\t}", "public function isLogEnabled($level=2)\n {\n return $this->getDebugSetting(\"enable_log\") == true &&\n \t\t$this->getDebugSetting(\"log_level\") >= $level;\n }", "private static function getLevel() {\n if (empty(static::$level)) {\n static::$level = Conf::getIniVal(Conf::LOG_LEVEL, 3);\n }\n return static::$level;\n }", "protected function registerLogLevel(){\n require_once __DIR__ . '/../../config/constant.php';\n $monolog = Log::getMonolog();\n foreach($monolog->getHandlers() as $handler) {\n $handler->setLevel(Config::get('app.log-level'));\n }\n }", "public function logLevel()\n {\n return $this->logLevel ?: self::LOG_LEVEL_INFO;\n }", "function isLevelAvailable($level)\n {\n\n // define all the global variables\n global $database, $message;\n\n // check for empty object given\n if ($level == \"\") {\n return false;\n }\n\n // check in database if exists\n $sql = \"SELECT COUNT(*) FROM \" . TBL_LEVELS . \" WHERE \" . TBL_LEVELS_LEVEL . \" = '$level'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n // grab the results\n $row = $database->getQueryEffectedRow($result, true);\n\n // check if any values has been returned\n if ($row[0] > 0) {\n return true;\n } else {\n return false;\n }\n }", "function verify_level($level) // Colorize: green\n { // Colorize: green\n return isset($level) // Colorize: green\n && // Colorize: green\n is_int($level) // Colorize: green\n && // Colorize: green\n $level >= 0 // Colorize: green\n && // Colorize: green\n $level <= 1; // Colorize: green\n }", "public function getKnackLogLevel();", "public function hasLevel(){\n return $this->_has(2);\n }", "protected function getMinimumLogLevel() {}", "public function hasLevel(){\r\n return $this->_has(2);\r\n }", "public function getLevel() {\n return Logger::$LOG_LEVELS[$this->logLevel];\n }", "function LevelExists($languageID, $level)\n {\n try\n {\n $levelExists = FALSE;\n $db = GetDBConnection();\n \n $query = 'SELECT ' . GetQuestionIdIdentifier() . ' FROM'\n . ' ' . GetQuestionsIdentifier() . ' WHERE'\n . ' ' . GetLanguageIdIdentifier()\n . ' = :' . GetLanguageIdIdentifier() . ' AND'\n . ' ' . 'Level'\n . ' = :' . 'Level' . ';';\n \n $statement = $db->prepare($query);\n $statement->bindValue(':' . GetLanguageIdIdentifier(), $languageID);\n $statement->bindValue(':' . 'Level', $level);\n \n $statement->execute();\n \n $rows = $statement->fetchAll();\n \n $statement->closeCursor();\n \n if ($rows != FALSE && count($rows) > 0)\n {\n $levelExists = TRUE;\n }\n \n return $levelExists;\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }", "public function write_log($level, $msg) : bool\n\t{\n\t\t/**\n\t\t * This function has multiple exit points\n\t\t * because we try to bail as soon as possible\n\t\t * if no logging is needed to keep it a little faster\n\t\t */\n\t\tif (!$this->_enabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/* normalize */\n\t\t$level = strtoupper($level);\n\n\t\t/* bitwise PSR 3 Mode */\n\t\tif ((!array_key_exists($level, $this->psr_levels)) || (!($this->_threshold & $this->psr_levels[$level]))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/* logging level check passed - log something! */\n\n\t\tswitch ($level) {\n\t\tcase 'EMERGENCY': // 1\n\t\t\t$this->monolog->emergency($msg);\n\t\t\tbreak;\n\t\tcase 'ALERT': // 2\n\t\t\t$this->monolog->alert($msg);\n\t\t\tbreak;\n\t\tcase 'CRITICAL': // 4\n\t\t\t$this->monolog->critical($msg);\n\t\t\tbreak;\n\t\tcase 'ERROR': // 8\n\t\t\t$this->monolog->error($msg);\n\t\t\tbreak;\n\t\tcase 'WARNING': // 16\n\t\t\t$this->monolog->warning($msg);\n\t\t\tbreak;\n\t\tcase 'NOTICE': // 32\n\t\t\t$this->monolog->notice($msg);\n\t\t\tbreak;\n\t\tcase 'INFO': // 64\n\t\t\t$this->monolog->info($msg);\n\t\t\tbreak;\n\t\tcase 'DEBUG': // 128\n\t\t\t$this->monolog->debug($msg);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn true;\n\t}", "public function getLogLevel()\r\n {\r\n return $this->level;\r\n }", "public function getLogLevel()\n {\n return $this->level;\n }", "public function testSelectiveLoggingByLevel() {\n\t\tif (file_exists(LOGS . 'spam.log')) {\n\t\t\tunlink(LOGS . 'spam.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'eggs.log')) {\n\t\t\tunlink(LOGS . 'eggs.log');\n\t\t}\n\t\tCakeLog::config('spam', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => 'debug',\n\t\t\t'file' => 'spam',\n\t\t));\n\t\tCakeLog::config('eggs', array(\n\t\t\t'engine' => 'File',\n\t\t\t'types' => array('eggs', 'debug', 'error', 'warning'),\n\t\t\t'file' => 'eggs',\n\t\t));\n\n\t\t$testMessage = 'selective logging';\n\t\tCakeLog::write(LOG_WARNING, $testMessage);\n\n\t\t$this->assertTrue(file_exists(LOGS . 'eggs.log'));\n\t\t$this->assertFalse(file_exists(LOGS . 'spam.log'));\n\n\t\tCakeLog::write(LOG_DEBUG, $testMessage);\n\t\t$this->assertTrue(file_exists(LOGS . 'spam.log'));\n\n\t\t$contents = file_get_contents(LOGS . 'spam.log');\n\t\t$this->assertContains('Debug: ' . $testMessage, $contents);\n\t\t$contents = file_get_contents(LOGS . 'eggs.log');\n\t\t$this->assertContains('Debug: ' . $testMessage, $contents);\n\n\t\tif (file_exists(LOGS . 'spam.log')) {\n\t\t\tunlink(LOGS . 'spam.log');\n\t\t}\n\t\tif (file_exists(LOGS . 'eggs.log')) {\n\t\t\tunlink(LOGS . 'eggs.log');\n\t\t}\n\t}", "public function hasLogger($loggerType);", "function getLogLevel()\n {\n return $this->_props['LogLevel'];\n }", "protected function getLogLevel()\n {\n return $this->_loglevel;\n }", "public function getLogLevel(){\n\n\t\treturn $this->_log_level;\n\t}", "public function fileLogActive() {\n\t\treturn isset($this->loggers['file']);\n\t}", "public function isLogEnabled(){\n\n\t\treturn $this->_log_enabled;\n\t}", "public function webLogActive() {\n\t\treturn isset($this->loggers['web']);\n\t}", "function ihc_user_has_level($u_id, $l_id){\n\t$user_levels = get_user_meta($u_id, 'ihc_user_levels', true);\n\tif($user_levels){\n\t\t$levels = explode(',', $user_levels);\n\t\tif (isset($levels) && count($levels) && in_array($l_id, $levels)){\n\t\t\t$user_time = ihc_get_start_expire_date_for_user_level($u_id, $l_id);\n\t\t\tif(strtotime($user_time['expire_time']) > time())\n\t\t\t\treturn TRUE;\n\t\t}\n\t}\n\treturn FALSE;\n}", "public function getLogLevel()\n {\n return $this->_logLevel;\n }", "public function hasLogid(){\n return $this->_has(20);\n }", "protected static function resolveLogLevel($level) {\n if (is_int($level)) {\n return $level;\n }\n else if (is_string($level)) {\n $lvlStrUpper = strtoupper($level);\n if (defined(\"self::$lvlStrUpper\")) {\n return constant(\"self::$lvlStrUpper\");\n }\n }\n return false;\n }", "public function getLogLevel() {\n $log_level = Mage::getStoreConfig(static::XML_PATH_LOG_LEVEL);\n\n return ($log_level !== null) ? intval($log_level) : Zend_Log::INFO;\n }" ]
[ "0.63863206", "0.6376074", "0.63185346", "0.62299687", "0.6153398", "0.61138594", "0.6110918", "0.60530084", "0.60400856", "0.6030286", "0.6027785", "0.6014787", "0.59796256", "0.5978228", "0.5952413", "0.5945662", "0.58972615", "0.5895406", "0.58753043", "0.5840629", "0.5831245", "0.5812419", "0.5751994", "0.57277423", "0.5727698", "0.5699084", "0.5684656", "0.5677202", "0.5673261", "0.5646494" ]
0.64706326
0
Check if value can be cast to string
protected static function canBeCastToString($value) { if (is_object($value) && method_exists($value, "__toString")) { return true; } return is_scalar($value) || is_null($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function aString($value)\n {\n return (is_string($value))?:false;\n }", "private function canBeString($value): bool\n {\n // https://stackoverflow.com/a/5496674\n return !is_array($value) && (\n (!is_object($value) && settype($value, 'string') !== false) ||\n (is_object($value) && method_exists($value, '__toString'))\n );\n }", "function o_castString($value) {\n\t\t\treturn Obj::singleton()->castString($value);\n\t\t}", "function string_value($value) {\r\n\t\t// objects should have a to_string a value to compare to\r\n\t\tif (is_object($value)) {\r\n\t\t\tif (method_exists($value, 'to_string')) {\r\n\t\t\t\t$value = $value->to_string();\r\n\t\t\t} else {\r\n\t\t\t\ttrigger_error(\"Cannot convert $value to string\", E_USER_WARNING);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\t// arrays simply return true\r\n\t\tif (is_array($value)) {\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $value;\r\n\t}", "function isString ($value)\r\n{\r\n\treturn is_string ($value);\r\n}", "public function checkString(): string\n {\n if (!is_string($this->getValue())) {\n throw new TypeInvalidException('string', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "public function getIsString() {\n return $this->getType() == \"string\";\n }", "public function isValueString() {\n\t\treturn $this->isValueString;\n\t}", "protected function valueToString($value): string\n {\n if (\\is_string($value)) {\n return $value;\n }\n if (\\is_int($value)) {\n return (string) $value;\n }\n if (\\is_float($value)) {\n return (string) $value;\n }\n return \\gettype($value) . ' - can´t be casted to string';\n }", "public function checkString($value)\n {\n return $this->checkHasType($value, 'string');\n }", "protected function validateString($value){\n\t\treturn is_string($value);\n\t}", "#[@test]\n public function stringCast() {\n $this->assertSourcecodeEquals(\n '$s= (string)$num;',\n $this->emit('$s= (string)$num;')\n );\n }", "public function isString()\n {\n return \\is_string($this->value);\n }", "public static function ensureString($value)\n\t{\n\t\tif (TJavaScript::isJsLiteral($value))\n\t\t\treturn $value;\n\t\tif (is_bool($value))\n\t\t\treturn $value?'true':'false';\n\t\telse\n\t\t\treturn (string)$value;\n\t}", "public function cast( // phpcs:ignore\n $value\n ): string;", "final public static function string($value, $fail = false) {\n if (!is_scalar($value)) {\n return $fail;\n }\n settype($value, 'string');\n return $value;\n }", "public static function is_string_or_stringable($input)\n {\n }", "function testString($s)\n {\n return is_scalar($s) || is_null($s);\n }", "public function testIsString() {\n\t\t$result = _::isString('test');\n\t\t$this->assertTrue($result);\n\n\t\t// test that an integer is not a string\n\t\t$result = _::isString(1);\n\t\t$this->assertFalse($result);\n\t}", "function php7strictString(string $castVar) : string\n {\n return $castVar . \" is a string\";\n }", "private static function castToType($value) {\n if ($value == \"true\" || $value == \"1\")\n return true;\n\n if ($value == \"false\" || $value == \"0\")\n return false;\n\n return $value;\n\n }", "private function string ($param)\n {\n $this->type = 'string';\n $this->value = (string)$this->value;\n return true;\n }", "final public function _cast():?string\n {\n return $this->commonCast();\n }", "public function cast($value, bool $isSamplifying = true): string\n {\n if (is_null($value)) {\n return \"null\";\n }\n if (is_bool($value)) {\n return ($value ? \"true\" : \"false\");\n }\n if (is_numeric($value)) {\n return strval($value);\n }\n if (is_string($value)) {\n if ($this->customStringFormatterCollection && $this->customStringFormatterCollection->count()) {\n foreach ($this->customStringFormatterCollection as $stringFormatter) {\n $stringFormatter = $stringFormatter->withIsPrependingType(false);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n $return = $stringFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $stringFormatter = $this->defaultStringFormatter->withIsPrependingType(false);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n return $stringFormatter->formatEnsureString($value);\n }\n if (is_object($value)) {\n if ($this->customObjectFormatterCollection && $this->customObjectFormatterCollection->count()) {\n foreach ($this->customObjectFormatterCollection as $objectFormatter) {\n $objectFormatter = $objectFormatter->withIsPrependingType(false);\n $return = $objectFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $objectFormatter = $this->defaultObjectFormatter->withIsPrependingType(false);\n $objectFormatter = $objectFormatter->withIsSamplifying($isSamplifying);\n return $objectFormatter->formatEnsureString($value);\n }\n if (is_array($value)) {\n if ($this->customArrayFormatterCollection && $this->customArrayFormatterCollection->count()) {\n foreach ($this->customArrayFormatterCollection as $arrayFormatter) {\n $arrayFormatter = $arrayFormatter->withIsPrependingType(false);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n $return = $arrayFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $arrayFormatter = $this->defaultArrayFormatter->withIsPrependingType(false);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n return $arrayFormatter->formatEnsureString($value);\n }\n if (is_resource($value)) {\n if ($this->customResourceFormatterCollection && $this->customResourceFormatterCollection->count()) {\n foreach ($this->customResourceFormatterCollection as $resourceFormatter) {\n $resourceFormatter = $resourceFormatter->withIsPrependingType(false);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n $return = $resourceFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $resourceFormatter = $this->defaultResourceFormatter->withIsPrependingType(false);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n return $resourceFormatter->formatEnsureString($value);\n }\n return $this->maskString(@strval($value));\n }", "public function castTyped( // phpcs:ignore\n $value\n ): string;", "function is_stringable($var): bool\n {\n if (is_array($var)) {\n try {\n return (bool)array_to_string($var);\n } catch (LogicException $e) {\n return false;\n }\n }\n\n return !is_null($var) && (is_scalar($var) || method_exists($var, '__toString'));\n }", "function o_isString($value) {\n\t\t\treturn Obj::singleton()->isString($value);\n\t\t}", "protected function isValueNormalizationRequired(mixed $value): bool\n {\n return \\is_string($value);\n }", "private static function print_value_by_type($value) {\n\t//--\n\tif($value === null) {\n\t\t$value = 'NULL (null)';\n\t} elseif($value === false) {\n\t\t$value = 'FALSE (bool)';\n\t} elseif($value === true) {\n\t\t$value = 'TRUE (bool)';\n\t} elseif($value === 0) {\n\t\t$value = '0 (zero)';\n\t} elseif($value === '') {\n\t\t$value = '`` (empty string)';\n\t} elseif(is_array($value)) {\n\t\t$value = (string) Smart::json_encode($value, true, true, false);\n\t} elseif(is_object($value)) {\n\t\t$value = '[!OBJECT!]';\n\t} //end if else\n\t//--\n\treturn (string) $value;\n\t//--\n}", "public static function stringOf($value) {\n return null === $value ? 'null' : Objects::stringOf($value);\n }" ]
[ "0.69170946", "0.67336637", "0.6730131", "0.651785", "0.6409559", "0.6367405", "0.6363094", "0.6347807", "0.6308053", "0.6257929", "0.6243511", "0.62164634", "0.6186825", "0.6164853", "0.61502516", "0.6146022", "0.6125181", "0.6106843", "0.60612065", "0.59892136", "0.594983", "0.59478503", "0.59250224", "0.5913568", "0.59085375", "0.59084284", "0.59057194", "0.5902603", "0.589744", "0.58480257" ]
0.7591007
0
Query to retrieve game information.
function retrieveGameInfo($name) { # Open and validate the Database connection. $conn = connect(); if ($conn != null) { $sql = "SELECT * FROM Games WHERE Name = '$name'"; $result = $conn->query($sql); if ($result->num_rows == 0) { # There are no games that match the searchTerm in the database. $conn->close(); return errors(460); } # Get game information while ($row = $result -> fetch_assoc()) { $ans = array("status" => "COMPLETE", "state" => $row["State"], "imageSource" => $row["ImageSource"], "PlayStation" => $row["PlayStation"], "PlayStation2" => $row["PlayStation2"], "PlayStation3" => $row["PlayStation3"], "PlayStation4" => $row["PlayStation4"], "PSP" => $row["PSP"], "GameboyAdvance" => $row["GameboyAdvance"], "NintendoDS" => $row["NintendoDS"], "Nintendo3DS" => $row["Nintendo3DS"], "NintendoSwitch" => $row["NintendoSwitch"], "XboxOne" => $row["XboxOne"], "Blizzard" => $row["Blizzard"], "GOG" => $row["GOG"], "Epic" => $row["Epic"], "Origin" => $row["Origin"], "Steam" => $row["Steam"], "Twitch" => $row["Twitch"], "UPlay" => $row["UPlay"], "Microsoft" => $row["Microsoft"]); } $conn->close(); return $ans; } else { # Connection to Database was not successful. $conn->close(); return errors(400); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listGame()\n {\n return $this->db->get('game', 8, 9)->result();\n }", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "public function queryAction() {\n $role_id = $this->session->get('role_id');\n $guild_lib = $this->_di->getShared('guild_lib');\n $ginfo = $guild_lib->status($role_id);\n if (!isset($ginfo[GuildLib::$STATUS_FIELD_GID])) {\n return json_encode(['code'=>403, 'msg'=>'you does not belong to any guild']);\n }\n $gid = $ginfo[GuildLib::$STATUS_FIELD_GID];\n\n $gmlib = $this->_di->getShared('gmission_lib');\n $info = $gmlib->query($gid);\n return json_encode(array('code'=>200, 'level'=>$info['level'], 'bosses'=>$info['bosses'], 'ginfo'=>$ginfo), JSON_NUMERIC_CHECK|JSON_FORCE_OBJECT);\n }", "function searchForGame($query, $page, $resultsPerPage, $userID) \n { \n // build API request\n $url = $this->config->item('gb_api_root') . \"/search/?api_key=\" . $this->config->item('gb_api_key') . \"&format=json&resources=game&limit=\" . $resultsPerPage . \"&page=\" . $page . \"&query=\" . urlencode ($query);\n \n // make API request\n $result = $this->Utility->getData($url, \"Search\");\n\n if(is_object($result) && $result->error == \"OK\" && $result->number_of_page_results > 0)\n { \n\t\t\t$this->load->model('Collection'); \n foreach($result->results as $game)\n { \n $game = $this->Collection->addCollectionInfo($game, $userID);\n }\n return $result;\n } else {\n return null;\n }\n }", "function get_by_game($game_id)\n {\n return $this->db->query('SELECT victory_conditions.*, players.faction FROM victory_conditions '\n . 'JOIN players on players.player_id=victory_conditions.player_id '\n . 'WHERE victory_conditions.game_id='.$game_id\n . '')->result();\n }", "function getAllGames() {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games\");\n $query->execute();\n\n return $query->fetchAll();\n }", "private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }", "public function testGetPlayerGameStatsWithQuery()\n\t{\n\t\t$client = static::createClient();\n\t\t$client->request(Request::METHOD_GET, '/player/game/stats?player=bjergsen');\n\t\t$response = $client->getResponse();\n\n\t\t$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n\t\t$this->assertContains('count', $response->getContent());\n\t\t$this->assertContains('results', $response->getContent());\n\t\t$this->assertContains('\"success\":true', $response->getContent());\n\t\t$this->assertContains('TSM', $response->getContent());\n\t\t$this->assertTrue(\n\t\t\t$response->headers->contains(\n\t\t\t\t'Content-Type',\n\t\t\t\t'application/json'\n\t\t\t)\n\t\t);\n\t}", "private function getGame() {\n if (!isset($this->params['game'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n\n $key = $this->params['game'];\n $game = new SnGames();\n\t\t$url = Url::getUrlByName($key, URL_GAME);\n\n\t\tif ($url) {\n\t\t\t$game->ID_GAME = $url->ID_OWNER;\n\t\t} else {\n\t\t\tDooUriRouter::redirect(Doo::conf()->APP_URL);\n\t\t\treturn FALSE;\n\t\t}\n\n $game = $game->getOne();\n\n return $game;\n }", "function ShowInfoGames($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idGame, LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, DescriptionType, (SELECT COUNT(idPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS OccupedPlaces, (SELECT SUM(PondFishesPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS SumPondFishes\n FROM fishermenland.game\n INNER JOIN fishermenland.type ON game.fkTypeGame = type.idType WHERE idGame = '$idGame'\");\n\n return $req;\n}", "public function get(GameRepositoryQuery $query = null): array;", "function listAvailableGames() {\n\t$sql = \"select id, name, admin_id from games where has_started = 0\";\n\n\treturn parcoursRs(SQLSelect($sql));\n}", "function getGame($id) {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games WHERE id = :id\");\n $query->bindParam(\":id\", $id);\n $query->execute();\n\n return $query->fetch();\n }", "function GetListGames()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idGame, LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, DescriptionType, (SELECT COUNT(idPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS OccupedPlaces\n FROM fishermenland.game\n INNER JOIN fishermenland.type ON game.fkTypeGame = type.idType GROUP BY idGame\");\n\n return $req;\n}", "public function getAll() { \r\n return $this->makeRequest('get', \"/games/top\");\r\n }", "function getGame($id){\n $conn = getDB();\n $sql = \"SELECT * FROM games WHERE id=\".$id.\"\";\n if(!($result = $conn->query($sql))){\n echo $conn->error; //TODO remove this after debugging\n closeDB($conn);\n return null;\n }\n closeDB($conn);\n $result = $result->fetch_assoc();\n return $result;\n}", "public function findAllGames()\n {\n return $this->entityManager->getRepository('Model\\Entity\\Game')->findAll();\n }", "public function index()\n {\n $validData = request()->validate([\n 'group_identifier' => 'required|string',\n ]);\n //get all games for this identifier\n $games = Game::with('positions')\n ->where('group_identifier', $validData['group_identifier'])\n ->get();\n\n return GameResource::collection($games);\n }", "public function testGetPlayerGameStatsWithQueryNoResults()\n\t{\n\t\t$client = static::createClient();\n\t\t$client->request(Request::METHOD_GET, '/player/game/stats?player=asdflkjafdasf');\n\t\t$response = $client->getResponse();\n\n\t\t$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n\t\t$this->assertContains('\"count\":0', $response->getContent());\n\t\t$this->assertContains('results', $response->getContent());\n\t\t$this->assertContains('\"success\":true', $response->getContent());\n\t\t$this->assertTrue(\n\t\t\t$response->headers->contains(\n\t\t\t\t'Content-Type',\n\t\t\t\t'application/json'\n\t\t\t)\n\t\t);\n\t}", "public function index()\n {\n return Game::all();\n }", "public function getGames(){\n\t\t$sql = new SqlManager();\n\t\t$sql->setQuery(\"SELECT game_id FROM game WHERE game_status != 'finished'\");\n\t\t$sql->execute();\n\t\t\n\t\t$games = array();\n\t\twhile($row = $sql->fetch()){\n\t\t\t$games[] = new Game($row['game_id']);\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "function CheckDisponiblityGame($IdJoinGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT MaxPlayersGame, (SELECT COUNT(fkGamePlace) FROM fishermenland.place WHERE fkGamePlace = '$IdJoinGame') as UsedPlaces FROM fishermenland.game WHERE idGame = '$IdJoinGame'\");\n $reqArray = $req->fetch();\n\n return $reqArray;\n}", "function get_by_game($id)\n {\n $this->db->join('players', 'peripherybids.player_id = players.player_id');\n $this->db->where('game_id', $id);\n return $this->db->get($this->table)->result();\n }", "public function getCurrentGame() {\n\t\t// $stmt = $this->dbh->prepare($sql);\n\t\t// $this->dbo->execute($stmt,array());\t\n\n\t\t// if ($stmt->rowCount() >= 1)\n\t\t// {\t\n\t\t// \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t// \treturn $result[0];\n\t\t// } else {\n\t\t// \treturn false;\n\t\t// }\t\n\t }", "public function query()\n {\n $query = DB::table('historics')\n ->leftJoin('games', 'games.id', '=', 'historics.game_id')\n ->leftJoin('boxes', 'boxes.id', '=', 'historics.box_id')\n ->leftJoin('workers', 'workers.id', '=', 'historics.worker_id')\n ->leftJoin('users', 'users.id', '=', 'workers.user_id')\n ->select(\n DB::raw('games.name as game_name'),\n DB::raw('boxes.code as box_code'),\n DB::raw('users.name as worker_name'),\n DB::raw('historics.played_at as game_played_at'),\n DB::raw('historics.is_payed as is_payed'),\n DB::raw('historics.players_number as players_number'),\n DB::raw('worker_id as historics_worker_id'),\n DB::raw('game_id as historics_game_id'),\n DB::raw('box_id as historics_box_id'),\n 'price'\n );\n\n return $this->applyScopes($query);\n }", "public function FindByGame($gid)\n {\n $guessArr = $this->db->fetchAll('SELECT * FROM guess WHERE game_id = :game ORDER BY timestamp', array(\n 'game' => (int) $gid));\n return $this->returnGuesses($guessArr);\n }", "function getGames() {\n\treturn json_decode(file_get_contents(\"data/games.json\"), true);\n}", "function getPlayersFromGameId($id){\n $conn = getDB();\n $sql = \"SELECT player1id, player2id, player3id FROM games WHERE id=\".$id.\"\";\n if(!($result = $conn->query($sql))){\n echo $conn->error; //TODO remove this after debugging\n closeDB($conn);\n return null;\n }\n closeDB($conn);\n return $result;\n}", "public function getGames($offset) \n { \n // build API request\n $url = $this->config->item('gb_api_root') . \"/games/?api_key=\" . $this->config->item('gb_api_key') . \"&format=json&offset=\" . $offset;\n \n // make API request\n $result = $this->Utility->getData($url, \"Games\");\n \n if(is_object($result))\n {\n return $result;\n } else {\n return null;\n }\n }", "public function getGameList($format=\"html\")\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"SELECT * FROM game\");\n\t\t\n\t\tif($db->num_rows($result) == 0)\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"No records found.\";\n\t\t}\n\t\telseif($format == \"xml\")\n\t\t{\n\t\t\theader (\"Content-Type:text/xml\");\n\t\t\t$xml = $db->MYSQL2XML($result, \"ThinkFunProject\", \"Game\");\n\t\t\tprint $xml;\n\t\t}\n\t\telseif($format == \"html\")\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"<HTML>\\n\";\n\t\t\tprint \"<BODY>\\n\";\n\t\t\t\t$html = $db->MYSQL2HTML($result, \"ThinkFunProject\", \"Game\");\n\t\t\t\tprint $html;\n\t\t\tprint \"</BODY>\\n\";\n\t\t\tprint \"</HTML>\\n\";\n\t\t}\n\t}" ]
[ "0.6470949", "0.64091974", "0.6350413", "0.62441", "0.6194894", "0.6130296", "0.61253667", "0.60936165", "0.60888135", "0.6070886", "0.6028884", "0.602729", "0.595925", "0.5896337", "0.5884195", "0.58512735", "0.5819909", "0.57474124", "0.572737", "0.5689521", "0.56753397", "0.5673982", "0.5663977", "0.5631895", "0.5631075", "0.56215256", "0.557028", "0.5563012", "0.5553033", "0.55070245" ]
0.668178
0
Query to change game information
function updateGameInfo($prevName, $name, $state, $PlayStation, $PlayStation2, $PlayStation3, $PlayStation4, $PSP, $GameboyAdvance, $NintendoDS, $Nintendo3DS, $NintendoSwitch, $XboxOne, $Blizzard, $GOG, $Epic, $Origin, $Steam, $Twitch, $UPlay, $Microsoft, $PC) { # Open and validate the Database connection $conn = connect(); if ($conn != null) { $sql = "UPDATE Games SET Name = '$name', State = '$state', PlayStation = '$PlayStation', PlayStation2 = '$PlayStation2', PlayStation3 = '$PlayStation3', PlayStation4 = '$PlayStation4', PSP = '$PSP', GameboyAdvance = '$GameboyAdvance', NintendoDS = '$NintendoDS', Nintendo3DS = '$Nintendo3DS', NintendoSwitch = '$NintendoSwitch', XboxOne = '$XboxOne', Blizzard = '$Blizzard', GOG = '$GOG', Epic = '$Epic', Origin = '$Origin', Steam = '$Steam', Twitch = '$Twitch', UPlay = '$UPlay', Microsoft = '$Microsoft', PC = '$PC' WHERE Name = '$prevName'"; if (mysqli_query($conn, $sql)) { $conn->close(); return array("status" => "COMPLETE"); } else { $conn->close(); return errors(480); } } else { # Connection to Database was not successful $conn->close(); return errors(400); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateGames($change) {\n\t$new = array_merge(getGames(), $change);\n\twriteGames($new);\n}", "public function modifyGame()\n {\n\n $data = $this->input->post();\n $id = $this->input->post('ID_GAMES');\n $data = $this->security->xss_clean($data);\n unset($data['modifier']);\n\n $this->db->where('ID_GAMES', $id);\n $this->db->update('games', $data);\n }", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "function UpdateTourGame($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.game SET TourGame = '999' WHERE idGame = '$idGame'\");\n}", "public function cheat(){\n\t\t$gameId = $this->input->get('gameId');\n\t\t$game = $this->setRedis_info($gameId);\n\t\techo \"<pre>\";\n\t\tprint_r($game['info']);\n\t\techo \"</pre>\";\n\t}", "function StartGame($idGame, $FirstPlayer)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.game SET TourGame = '1', FirstPlayerGame = '$FirstPlayer' WHERE idGame = '$idGame' AND TourGame IS NULL\");\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '2' WHERE fkPlayerPlace = (SELECT idPlayer FROM fishermenland.player WHERE PseudoPlayer = '$FirstPlayer')\");\n}", "public function edit(Game $game)\n {\n //\n }", "public function edit(Game $game)\n {\n //\n }", "public function edit(Game $game)\n {\n //\n }", "public function edit(Game $game)\n {\n \t//\n }", "public function edit(Game $game)\n {\n \n }", "function ShowInfoGames($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idGame, LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, DescriptionType, (SELECT COUNT(idPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS OccupedPlaces, (SELECT SUM(PondFishesPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS SumPondFishes\n FROM fishermenland.game\n INNER JOIN fishermenland.type ON game.fkTypeGame = type.idType WHERE idGame = '$idGame'\");\n\n return $req;\n}", "private function updateGameSession()\n {\n $this->getSession()->set('gameData', $this->getGame()->getGameData());\n }", "function TblGames($name, $op, $id) {\r\n\t\t\r\n\t\tTable::Table($name, $op, $id);\r\n\t\t\r\n\t\t$this->cfg->cup_id->name = \"cup_id\";\r\n\t\t$this->cfg->cup_id->public_name = _CUPNAME;\r\n\t\t$this->cfg->cup_id->db_list = _DB_PREFIX.'_cups';\r\n\t\t$this->cfg->cup_id->db_list_pk = \"id\";\r\n\t\t$this->cfg->cup_id->db_list_sel = \"cup\";\r\n\t\t$this->cfg->cup_id->db_list_cond = \"close!=1\";\r\n\t\t$this->cfg->cup_id->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->chief_pn->name = \"chief_pn\";\r\n\t\t$this->cfg->chief_pn->no_add = 1;\r\n\t\r\n\t\t$this->cfg->game->name = \"game\";\r\n\t\t$this->cfg->game->public_name = _GAMENAME;\r\n\t\t$this->cfg->game->type = 'text';\r\n\t\t$this->cfg->game->maxlength = 64;\r\n\t\t$this->cfg->game->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->town->name = \"town\";\r\n\t\t$this->cfg->town->public_name = _GAMETOWN;\r\n\t\t$this->cfg->town->type = 'text';\r\n\t\t$this->cfg->town->maxlength = 32;\r\n\t\t$this->cfg->town->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->place->name = \"place\";\r\n\t\t$this->cfg->place->public_name = _GAMEPLACE;\r\n\t\t$this->cfg->place->type = 'text';\r\n\t\t$this->cfg->place->maxlength = 32;\r\n\t\t$this->cfg->place->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->dt->name = \"dt\";\r\n\t\t$this->cfg->dt->public_name = _GAMEDATE;\r\n\t\t$this->cfg->dt->type = 'text';\r\n\t\t$this->cfg->dt->maxlength = 10;\r\n\t\t$this->cfg->dt->is_date = 1;\r\n\t\t$this->cfg->dt->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->game_mode->name = \"game_mode\";\r\n\t\t$this->cfg->game_mode->public_name = _Rodzajgry;\r\n\t\t$this->cfg->game_mode->radio = 'mode_select';\r\n\t\t$this->cfg->game_mode->not_empty = 1;\r\n\t\t\r\n\t\t$this->cfg->ratio->name = \"ratio\";\r\n\t\t$this->cfg->ratio->no_add = 1;\r\n\t\t\r\n\t\t$this->cfg->game_status->name = \"game_status\";\r\n\t\t$this->cfg->game_status->no_add = 1;\r\n\t}", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "public function execute(Game $game);", "public function listGame()\n {\n return $this->db->get('game', 8, 9)->result();\n }", "public static function update(Game $game)\n {\n $stats = self::get();\n if (isset($stats[$game->getState()->getId()])) {\n $stats[$game->getState()->getId()]++;\n } else {\n $stats[$game->getState()->getId()] = 1;\n }\n\n if (isset($stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()])) {\n $stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()]++;\n } else {\n $stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()] = 1;\n }\n\n if (isset($stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()])) {\n $stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()]++;\n } else {\n $stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()] = 1;\n }\n $cache = new FilesystemCache();\n $cache->set(self::STATISTIC_PREFIX, $stats);\n }", "function listAvailableGames() {\n\t$sql = \"select id, name, admin_id from games where has_started = 0\";\n\n\treturn parcoursRs(SQLSelect($sql));\n}", "function retrieveGameInfo($name) {\n \t# Open and validate the Database connection.\n \t$conn = connect();\n\n if ($conn != null) {\n \t$sql = \"SELECT * FROM Games WHERE Name = '$name'\";\n\t\t\t$result = $conn->query($sql);\n\n\t\t\tif ($result->num_rows == 0) {\n\t\t\t\t# There are no games that match the searchTerm in the database.\n\t\t\t\t$conn->close();\n\t\t\t\treturn errors(460);\n\t\t\t}\n\n\t\t\t# Get game information\n\t\t\twhile ($row = $result -> fetch_assoc()) {\n $ans = array(\"status\" => \"COMPLETE\", \"state\" => $row[\"State\"], \"imageSource\" => $row[\"ImageSource\"],\n \"PlayStation\" => $row[\"PlayStation\"], \"PlayStation2\" => $row[\"PlayStation2\"],\n \"PlayStation3\" => $row[\"PlayStation3\"], \"PlayStation4\" => $row[\"PlayStation4\"],\n \"PSP\" => $row[\"PSP\"], \"GameboyAdvance\" => $row[\"GameboyAdvance\"],\n \"NintendoDS\" => $row[\"NintendoDS\"], \"Nintendo3DS\" => $row[\"Nintendo3DS\"],\n \"NintendoSwitch\" => $row[\"NintendoSwitch\"], \"XboxOne\" => $row[\"XboxOne\"],\n \"Blizzard\" => $row[\"Blizzard\"], \"GOG\" => $row[\"GOG\"], \"Epic\" => $row[\"Epic\"],\n \"Origin\" => $row[\"Origin\"], \"Steam\" => $row[\"Steam\"], \"Twitch\" => $row[\"Twitch\"],\n \"UPlay\" => $row[\"UPlay\"], \"Microsoft\" => $row[\"Microsoft\"]);\n\t\t\t}\n\n\t\t\t$conn->close();\n\t\t\treturn $ans;\n }\n else {\n \t# Connection to Database was not successful.\n \t$conn->close();\n \treturn errors(400);\n }\n\t}", "public function edit(Games $games)\n {\n //\n }", "function PassRound($PassRound, $idGame, $idPlace)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '1' WHERE idPlace = '$idPlace'\");\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '2' WHERE fkGamePlace = '$idGame' AND OrderPlace = '$PassRound'\");\n}", "function updateGameDetails( $dbData, $tournamentID ) {\n\n/* ... write the update back to the DB */\n $this->db->where( 'TournamentID', $tournamentID );\n $this->db->update( 'Tournament', $dbData );\n\n/* ... time to go */\n return;\n }", "function get_by_game($game_id)\n {\n return $this->db->query('SELECT victory_conditions.*, players.faction FROM victory_conditions '\n . 'JOIN players on players.player_id=victory_conditions.player_id '\n . 'WHERE victory_conditions.game_id='.$game_id\n . '')->result();\n }", "function gaMatch_addPlayerResult($kidPlayerId, $win, $draw, $lost) {\n //??????????????????? does record already exist - what if player change ?????????\n $match = array_search ( $kidPlayerId , $this->gamatch_gamePlayerMap);\n if ($match === FALSE) {\n $newGame = new stdData_gameUnit_extended;\n $newGame->stdRec_loadRow($row);\n $this->gamatch_gamePlayerMap[$newGame->game_kidPeriodId] = $newGame;\n ++$this->game_opponents_count;\n $this->game_opponents_kidPeriodId[] = $kidPlayerId;\n $this->game_opponents_wins[] = $win;\n $this->game_opponents_draws[] = $draw;\n $this->game_opponents_losts[] = $lost;\n $this->gagArrayGameId[] = 0;\n } else {\n $this->game_opponents_wins[$match] += $win;\n $this->game_opponents_draws[$match] += $draw;\n $this->game_opponents_losts[$match] += $lost;\n }\n}", "function fetchGame() {\n\n\t\t$this -> mysqli -> query(\"\n\t\tCREATE TEMPORARY TABLE IF NOT EXISTS temp1 AS\n\t\t(SELECT matchups.matchupID, matchups.homeTeamID, matchups.awayTeamID, games.gameKickofftime \n\t\tFROM games \n\t\tINNER JOIN matchups \n\t\tON games.gameID = matchups.gameID);\");\n\n\t\t$this -> mysqli -> query(\"CREATE TEMPORARY TABLE IF NOT EXISTS temp2 AS\n\t\t(SELECT t.matchupID, t.homeTeamID, t.awayTeamID, t.gameKickofftime, teams.teamSchoolAcro \n FROM temp1 t\n LEFT JOIN teams ON t.homeTeamID = teams.teamID);\");\n\n\t\t$res = $this -> mysqli -> query(\"SELECT t2.matchupID, t2.homeTeamID, t2.awayTeamID, t2.gameKickofftime, t2.teamSchoolAcro AS homeTeam, teams.teamSchoolAcro AS awayTeam\n FROM temp2 t2\n LEFT JOIN teams ON t2.awayTeamID = teams.teamID;\");\n\n\t\techo \"<div class='table-responsive'><table class='table table-striped table-hover'>\";\n\t\techo \"<tr><th>Game ID</th><th>Game</th><th>Kickoff Time</th></tr>\";\n\n\t\twhile ($row = $res -> fetch_assoc()) {\n\t\t\t//format the date to be more user friendly\n\t\t\t$date = date_create($row['gameKickofftime']);\n\t\t\t$formattedDate = date_format($date, 'd/m/Y @ g:i A');\n\t\t\techo \"<tr>\" . \"<td>\" . $row['matchupID'] . \"</td>\" . \"<td>\" . $row['awayTeam'] . \" @ \" . $row['homeTeam'] . \"</td>\" . \"<td>\" . $formattedDate . \"</td>\" . \"</tr>\";\n\t\t}\n\t\techo \"</table></div>\";\n\t}", "public function updateMatch(){\n\t\t\n\t\t}", "private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }", "public function update(Request $request, Game $game)\n {\n //\n }", "public function update(Request $request, Game $game)\n {\n //\n }" ]
[ "0.6025621", "0.5750339", "0.5746301", "0.57445884", "0.5720354", "0.5599228", "0.5597927", "0.5597927", "0.5597927", "0.55829674", "0.556023", "0.5527915", "0.550245", "0.54825425", "0.548126", "0.54314786", "0.5402931", "0.5394354", "0.5356362", "0.53360766", "0.52946115", "0.52649343", "0.52540326", "0.5251496", "0.52178425", "0.51654553", "0.5160548", "0.51547045", "0.5151242", "0.5151242" ]
0.5762749
1
The head action handles HEAD requests; it should respond with an identical response to the one that would correspond to a GET request, but without the response body.
public function headAction() { Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function head($id = null) {\n $action = $this->params('actiion');\n $job_id = $this->params('jobid');\n \n //$job_id > 30 is only for checking if the request is garbage and so save resources\n if($action == 'head' && strlen($job_id) >= 30){\n $crawlResultHelper = new CrawlResultHelper();\n return $crawlResultHelper->routeHEADRequest($id, $job_id, $this->response);\n }else{\n return $this->customJsonResponse(); \n }\n }", "function head($url, $args = array()) {\n\t\t$defaults = array('method' => 'HEAD');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public function testHead(): void\n {\n $this->assertNull($this->_response);\n\n $this->head('/request_action/test_request_action');\n $this->assertNotEmpty($this->_response);\n $this->assertInstanceOf('Cake\\Http\\Response', $this->_response);\n $this->assertResponseSuccess();\n }", "function Head( $uri )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Head( $uri )\\n\";\r\n\t\t$this->responseHeaders = $this->responseBody = \"\";\r\n\t\t$uri = $this->makeUri( $uri );\r\n\t\tif( $this->sendCommand( \"HEAD $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "public function head($uri, array $headers = []): ResponseInterface;", "public function head()\n {\n $this->method = 'HEAD';\n return $this;\n }", "public function testHeadMethodRoute(): void\n {\n $this->head('/head/request_action/test_request_action');\n $this->assertResponseSuccess();\n }", "public function head($version = null)\n {\n $socket = $this->createSocket();\n $this->processHeader($socket, self::METHOD_HEAD, $version);\n $socket->write('Connection: close' . stubHTTPConnection::END_OF_LINE . stubHTTPConnection::END_OF_LINE);\n return new stubHTTPResponse($socket);\n }", "public function isHead()\n {\n return $this->getMethod() === 'HEAD';\n }", "function http_head($url = null, ?array $options = null, ?array &$info = null) {}", "public function head()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "public function head($url, $query = array(), $headers = array());", "public function isHead()\n {\n return $this->method === self::METHOD_HEAD;\n }", "public function isHead()\n {\n return $this->isMethod('HEAD');\n }", "public function isHead()\n {\n return $this->isMethod('HEAD');\n }", "public function isHead() {\n return $this->method == self::METHOD_HEAD;\n }", "public function head($path = '*', $callback = null)\r\n {\r\n // Get the arguments in a very loose format\r\n extract(\r\n $this->parseLooseArgumentOrder(func_get_args()),\r\n EXTR_OVERWRITE\r\n );\r\n\r\n return $this->respond('HEAD', $path, $callback);\r\n }", "public function getIsHead()\n {\n return $this->getMethod() === 'HEAD';\n }", "public function head($options)\n {\n if (is_int($options) || is_string($options)) {\n $options = ['status' => $options];\n } elseif (!is_array($options)) {\n throw new Exception\\InvalidArgumentException(\n sprintf(\n \"Argument must be either string or array, %s passed\",\n gettype($options)\n )\n );\n }\n \n if ($options) {\n $validOptions = ['status' => null, 'location' => null, 'contentType' => null];\n \n $headers = array_diff_key($options, $validOptions);\n $options = array_intersect_key($options, $validOptions);\n \n if (isset($options['status'])) {\n $this->response()->setStatus($options['status']);\n }\n if (isset($options['location'])) {\n $this->response()->setLocation($this->urlFor($options['location']));\n }\n \n foreach ($options as $key => $value) {\n $this->response()->addHeader(\n str_replace(' ', '-', ucwords(strtolower(str_replace('-', ' ', $key)))),\n $value\n );\n }\n }\n \n $status = $this->response()->status();\n \n if (!\n (($status > 100 && $status < 199) ||\n in_array($status, [204, 205, 304]))\n ) {\n $this->response()->setCharset(false);\n if (isset($options['contentType'])) {\n $this->response->setContentType($options['contentType']);\n }\n $this->response()->setBody(' ');\n } else {\n $this->response()->removeHeader('Content-Type');\n $this->response()->setBody('');\n }\n }", "public function isHead()\n {\n return ($this->getMethod() == 'HEAD') ? true : false;\n }", "public function head($uri = NULL, $vars = NULL) {\n\t\tif (! empty ( $uri ))\n\t\t\t$this->uri = $uri;\n\t\tif (! empty ( $vars ) && is_array ( $vars ))\n\t\t\t$vars = http_build_query ( $vars );\n\t\tif (empty ( $this->query ))\n\t\t\t$this->query = $vars;\n\t\telse if (! empty ( $vars ))\n\t\t\t$this->query .= \"&\" . $vars;\n\t\tif (! empty ( $this->query ))\n\t\t\t$this->uri .= \"?\" . $this->query;\n\t\t$this->method = \"HEAD\";\n\t\t$this->request_body = NULL;\n\t\t$this->send ();\n\t}", "public function isHead() {\n\t\tif ('HEAD' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function head($path)\n {\n $defaults = stream_context_get_options(stream_context_get_default());\n $options = $this->context;\n\n if ($this->supportsHead) {\n $options['http']['method'] = 'HEAD';\n }\n\n stream_context_set_default($options);\n\n $headers = get_headers($this->buildUrl($path), 1);\n\n stream_context_set_default($defaults);\n\n if ($headers === false || strpos($headers[0], ' 200') === false) {\n return false;\n }\n\n return array_change_key_case($headers);\n }", "public function testCanMakeHttpHead()\n {\n # Set desired response\n $resp = $this->createMock('Psr\\Http\\Message\\ResponseInterface');\n $this->mockClient->addResponse($resp);\n $httpClient = $this->givenSdk()->getHttpClient();\n $response = $httpClient->head(\"/dummy_uri\");\n\n $this->assertSame($resp, $response);\n }", "public function isHead(): bool\n {\n return $this->getMethod() === self::METHOD_HEAD;\n }", "public function isHead()\n\t{\n\t\treturn $this->httpMethod() == self::MethodHead;\n\t}", "public function head($uri = null, $headers = null)\n {\n return $this->createRequest('HEAD', $uri, $headers);\n }", "public function head($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_HEAD);\n\t}", "public function _head($url = null, array $parameters = []);", "function head() {\n\t\theader(\"{$_SERVER['SERVER_PROTOCOL']} 200 OK\");\n \t\theader('Content-Type: application/json');\n \theader('Access-Control-Allow-Origin: *');\n\t}" ]
[ "0.7382294", "0.71671796", "0.7164798", "0.71319973", "0.70671886", "0.7047216", "0.6946991", "0.69293755", "0.68885183", "0.6802876", "0.6799131", "0.67906845", "0.67873675", "0.67367345", "0.67367345", "0.6715691", "0.67076296", "0.6698354", "0.66940653", "0.6686401", "0.6679841", "0.6655488", "0.6602909", "0.6569043", "0.64962393", "0.6438819", "0.641256", "0.6283065", "0.62269515", "0.61874324" ]
0.7187432
1
Convenience method that does the complete initialization for DocBlox. This method will register the autoloader, event dispatcher and plugins. The methods called can also be implemented separately, for example when you want to use your own autoloader.
public function initialize() { $autoloader = $this->registerAutoloader(); $this->registerPlugins($autoloader); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "public static function _init()\n\t{\n\t\t\\Module::load('documentation');\n\t}", "public static function register_autoloader()\n {\n }", "protected function init()\n {\n $this->registerExtensions();\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "public function registerPlugins($autoloader)\n {\n // initialize the event dispatcher; the include is here explicitly\n // should anyone not want this dependency and thus nto invoke this\n // method\n include_once 'symfony/components/event_dispatcher/lib/sfEventDispatcher.php';\n $dispatcher = new sfEventDispatcher();\n\n // initialize the plugin manager\n $plugin_manager = new DocBlox_Plugin_Manager(\n $dispatcher,\n DocBlox_Core_Abstract::config(),\n $autoloader\n );\n\n $plugin_manager->loadFromConfiguration(DocBlox_Core_Abstract::config());\n\n $this->attachDispatcher($dispatcher);\n }", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "public static function start()\n\t{\n\t\tspl_autoload_register('Autoloader::init', true, true);\n\t}", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "protected function _initAutoloader()\n {\n $loader = new StandardAutoloader();\n $loader->registerNamespace('Doctrine', PROJECT_PATH.'/library/Doctrine')\n ->registerNamespace('App', PROJECT_PATH.'/library/App')\n ->registerNamespace('Domain', PROJECT_PATH.'/library/Domain')\n ->registerNamespace('Gedmo', PROJECT_PATH.'/library/Doctrine/Extension/Gedmo');\n $loader->register();\n }", "protected function _initAutoloader()\n {\n require_once APPLICATION_PATH . DIRECTORY_SEPARATOR . 'Autoloader.php';\n $this->_autoloader = new \\App\\Autoloader();\n $this->_autoloader\n ->addNamespaces($this->_getAutoloaderNamespaces())\n ->register(true)\n ;\n }", "public function init() {\n\t\tglobal $wpdb;\n\n\t\t$this->incrementor = new Incrementor();\n\n\t\t$this->file_locator = new File_Locator();\n\n\t\t$this->block_recognizer = new Block_Recognizer();\n\n\t\t$this->dependencies = new Dependencies();\n\n\t\t// @todo Pass options for verbosity, which filters to wrap, whether to output annotations that have no output, etc.\n\t\t$this->output_annotator = new Output_Annotator(\n\t\t\t$this->dependencies,\n\t\t\t$this->incrementor,\n\t\t\t$this->block_recognizer,\n\t\t\t[\n\t\t\t\t'can_show_queries_callback' => function() {\n\t\t\t\t\treturn current_user_can( $this->show_queries_cap );\n\t\t\t\t},\n\t\t\t]\n\t\t);\n\n\t\t$this->database = new Database( $wpdb );\n\n\t\t$this->hook_wrapper = new Hook_Wrapper();\n\n\t\t$this->invocation_watcher = new Invocation_Watcher(\n\t\t\t$this->file_locator,\n\t\t\t$this->output_annotator,\n\t\t\t$this->dependencies,\n\t\t\t$this->database,\n\t\t\t$this->incrementor,\n\t\t\t$this->hook_wrapper\n\t\t);\n\n\t\t$this->output_annotator->set_invocation_watcher( $this->invocation_watcher );\n\n\t\t$this->server_timing_headers = new Server_Timing_Headers( $this->invocation_watcher );\n\t}", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "public function initialize() {\r\n\t\tparent::initialize();\r\n\t\t\r\n\t\t// load mediawiki api component\r\n\t\t$this->loadComponent( 'MediawikiAPI' );\r\n\t\t$this->loadComponent( 'PasswordGenerator' );\r\n\t\t$this->loadComponent( 'EmailSending' );\r\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "public static function initialize()\n {\n if (static::$isConfigurationLoaded === true) {\n return;\n }\n \n foreach (static::$handlers as $handler) {\n EventManager::getInstance()->addEventHandler($handler[0], $handler[1], $handler[2], $handler[3]);\n }\n\n static::$isConfigurationLoaded = true;\n }", "public function init()\n\t{\n\t\t$this->resolvePackagePath();\n\t\t$this->registerCoreScripts();\n\t\tparent::init();\n\t}", "public function __construct() {\n spl_autoload_register(array($this, 'loader'));\n }", "private function init() {\n\t\tforeach (Config::get('app/events/loaders') as $loader => $parameters) {\n\t\t\t//Ignore disabled loaders\n\t\t\tif (isset($parameters['enabled']) && !$parameters['enabled'])\n\t\t\t\tcontinue;\n\n\t\t\t$driver = PHPLoader::getDriverClass(\"events\",$loader);\n\n\t\t\t$res = call_user_func([$driver,'load'],$this,$parameters);\n\t\t\tif ($res && is_array($res))\n\t\t\t\t$this->listeners = array_merge($this->listeners,$res);\n\t\t}\n\t}", "public function init() {\n\t\tdo_action( get_called_class() . '_before_init' );\n\t\tdo_action( get_called_class() . '_after_init' );\n\t\tadd_action( 'wp_enqueue_scripts', array( get_called_class(), 'enqueue_scripts' ), 20 );\n\t\tnew Display();\n\t\tnew Term_Meta();\n\t}", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}", "public function registerAutoloaders()\n {\n }", "public static function init( )\n {\n $config = \\Painless::load( 'system/common/config' );\n $triggers = $config->get( 'triggers.*' );\n \n if ( ! empty( $triggers ) )\n {\n foreach( $triggers as $name => $callback )\n {\n self::register( $name, $callback );\n }\n }\n }", "public function __construct() {\n require_once __DIR__ . '/vendor/autoload.php';\n $this->define_constants();\n register_activation_hook( __FILE__, array( $this, 'activate' ) ); \n add_action( 'plugins_loaded', array( $this, 'init_plugin' ) ); \n }", "public function init() {\n parent::init();\n if (!is_object($this->api)) {\n $class = $this->api;\n $this->api = new $class;\n }\n $this->loadPlugins();\n }", "function __construct()\n {\n parent::__construct('phpDocumentor', self::VERSION);\n\n $this->addAutoloader();\n $this->addLogging();\n $this->addConfiguration();\n $this->addEventDispatcher();\n $this->loadPlugins();\n\n $this->addCommandsForProjectNamespace();\n }", "function _initialize()\n {\n $CFG =& \\O2System\\load_class('Config', 'core');\n\n // If hooks are not enabled in the config file\n // there is nothing else to do\n\n if ($CFG->item('enable_hooks') == FALSE)\n {\n return;\n }\n\n // Grab the \"hooks\" definition file.\n // If there are no hooks, we're done.\n\n if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'))\n {\n include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');\n }\n elseif (is_file(APPPATH.'config/hooks.php'))\n {\n include(APPPATH.'config/hooks.php');\n }\n\n\n if ( ! isset($hook) OR ! is_array($hook))\n {\n return;\n }\n\n $this->hooks =& $hook;\n $this->enabled = TRUE;\n }", "static public function initialize()\r\n {\r\n spl_autoload_register(\"self::load\");\r\n }", "public static function init()\n {\n add_action('plugins_loaded', array(self::instance(), '_setup'));\n }", "public static function Initialize() {\n\n Debugger::debugMessage('Registering components register');\n self::ComponentsRegister();\n }" ]
[ "0.68206704", "0.66960126", "0.6666122", "0.6646043", "0.66263855", "0.6624106", "0.6591112", "0.6558713", "0.64892226", "0.6451603", "0.64219743", "0.63961893", "0.63901526", "0.6332813", "0.63216305", "0.6320369", "0.6314277", "0.6275027", "0.62626415", "0.62625897", "0.6261532", "0.6253172", "0.6235495", "0.6233249", "0.6230767", "0.6225641", "0.62167877", "0.6214006", "0.62131274", "0.62126094" ]
0.7356257
0
Registers and returns the autoloader for DocBlox. DocBlox uses the ZF2 autoloader to register the common paths and start a PSR0 fallback. The autoloader is also used by the plugin system to make sure that everything in a plugin can be autoloaded.
public function registerAutoloader() { $base_include_folder = dirname(__FILE__) . '/../../src'; // set path to add lib folder, load the Zend Autoloader set_include_path( $base_include_folder . PATH_SEPARATOR . get_include_path() ); include_once $base_include_folder . '/ZendX/Loader/StandardAutoloader.php'; $autoloader = new ZendX_Loader_StandardAutoloader( array( 'prefixes' => array( 'Zend' => $base_include_folder . '/Zend', 'DocBlox' => $base_include_folder . '/DocBlox' ), 'fallback_autoloader' => true ) ); $autoloader->register(); return $autoloader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerAutoloaders()\n {\n }", "public static function register_autoloader()\n {\n }", "protected function _initAutoload() {\r\n $autoLoader = Zend_Loader_Autoloader::getInstance();\r\n $autoLoader->registerNamespace('CMS_');\r\n $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => '', 'resourceTypes' => array('form' => array('path' => 'forms/', 'namespace' => 'Form_',), 'model' => array('path' => 'models/', 'namespace' => 'Model_'),),));\r\n // Return it so that it can be stored by the bootstrap\r\n return $autoLoader;\r\n }", "public function registerAutoloaders()\n {\n $loader = new Loader();\n \n $loader->setNamespaces(array(\n 'App\\Install\\Controllers' => __DIR__ . '/controllers/',\n 'App\\Install\\Tags' => __DIR__ . '/tags/'\n ));\n $loader->register();\n }", "protected function _initAutoload(){\n\t $autoLoader = Zend_Loader_Autoloader::getInstance();\n\t $autoLoader->registerNamespace('CMS_');\n\t $resourceLoader = new Zend_Loader_Autoloader_Resource(\n\t \tarray(\n\t\t\t 'basePath' => APPLICATION_PATH,\n\t\t\t 'namespace' => '',\n\t\t\t 'resourceTypes' => array(\n\t\t\t \t'form' => array(\n\t\t\t\t \t'path' => 'forms/',\n\t\t\t\t \t'namespace' => 'Form_',\n\t\t\t\t ),\n\t \t\t\t\n\t \t\t),\n\t \t)\n\t );\n\t // Return it so that it can be stored b the bootstrap\n\t return $autoLoader;\n\t }", "public function registerAutoloaders()\n {\n\n $loader = new Loader();\n\n $loader->registerNamespaces(array(\n 'Ns\\Core\\Controllers' => __DIR__ . '/controllers/',\n 'Ns\\Core\\Models' => __DIR__ . '/models/',\n 'Ns\\Core\\Libraries' => __DIR__ . '/libraries/',\n ));\n\n $loader->register();\n }", "public static function registerAutoloader() {\n spl_autoload_register(__NAMESPACE__ . \"\\\\Framework::autoload\");\n }", "public function registerAutoloaders() {\n\t\t$loader = new Loader();\n\n\t\t$loader->registerNamespaces(array (\n\t\t\t\t'Modules\\Frontend\\Controllers' => __DIR__ . '/controllers/',\n\t\t\t\t'Modules\\Frontend\\Models' => __DIR__ . '/models/',\n\t\t\t\t'Modules\\Frontend\\Forms' => __DIR__ . '/forms/',\n\t\t\t\t'Modules\\Frontend\\Validators' => __DIR__ . '/validators/',\n\t\t));\n\t\t\n\t\t$loader->register();\n\t}", "protected function _initAutoload()\n\t{\n\t\t$config = $this->getOption('autoloader');\n\t\t$autoloader = new Zend_Loader_Autoloader_Resource($config);\n\n\t\treturn $autoloader;\n\t}", "protected function _initAutoload()\n {\n $autoLoader = Zend_Loader_Autoloader::getInstance();\n $autoLoader->registerNamespace('App_');\n $resourceLoader = new Zend_Loader_Autoloader_Resource(array(\n 'basePath' => APPLICATION_PATH,\n 'namespace' => '',\n 'resourceTypes' => array(\n 'form' => array(\n 'path' => 'forms/',\n 'namespace' => 'Form_',\n ),\n 'model' => array(\n 'path' => 'models/',\n 'namespace' => 'Model_'\n )\n ),\n ));\n // Return it so that it can be stored by the bootstrap\n return $autoLoader;\n }", "protected function _initAutoload() {\n $autoLoader = Zend_Loader_Autoloader::getInstance();\n\n $resourceLoader = new Zend_Loader_Autoloader_Resource(array(\n 'basePath' => APPLICATION_PATH,\n 'namespace' => '',\n 'resourceTypes' => array(\n 'model' => array(\n 'path' => 'models/',\n 'namespace' => 'Model_'\n ), \n ),\n ));\n \n \n $resourceLoader = new Zend_Loader_Autoloader_Resource(array(\n 'basePath' => APPLICATION_PATH,\n 'namespace' => '',\n 'resourceTypes' => array(\n 'model' => array(\n 'path' => 'models/Functions',\n 'namespace' => 'Model_'\n )\n ),\n ));\n \n // Return it so that it can be stored by the bootstrap\n return $autoLoader;\n }", "private function registerAutoloader() {\n\t\t\t// register autoloader\n\t\t\tspl_autoload_extensions(EXT);\n\t\t\tspl_autoload_register(array($this, 'autoload'));\n\t\t}", "protected function _initAutoload()\n\t{\n\t\t$loader = new Zend_Application_Module_Autoloader(array(\n 'namespace' => '',\n 'basePath' => APPLICATION_PATH));\n\n\t\treturn $loader;\n\t}", "function autoloader()\n {\n spl_autoload_register(function ($className) {\n\n # DIRECTORY SEPARATORS varies in various platforms\n $ds = DIRECTORY_SEPARATOR;\n\n # Current Working Directory\n $dir = __DIR__;\n\n # replace namespace separator with directory separator (prolly not required)\n $className = str_replace('\\\\', $ds, $className);\n\n # get full name of file containing the required class\n $file = \"{$dir}{$ds}{$className}.php\";\n\n # get file if it is readable\n if (is_readable($file)) {\n require_once $file;\n }\n });\n }", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "public function registerAutoload()\n {\n return spl_autoload_register(array('Proem\\Loader', 'load'));\n }", "protected function _initAutoload () {\n\t\t// configure new autoloader\n\t\t$autoloader = new Zend_Application_Module_Autoloader (array ('namespace' => 'Admin', 'basePath' => APPLICATION_PATH.\"/modules/admin\"));\n\n\t\t// autoload validators definition\n\t\t$autoloader->addResourceType ('Validate', 'validators', 'Validate_');\n\t}", "protected function _initAutoload() {\n\t\t$resourceLoader = new Zend_Loader_Autoloader_Resource(array(\n\t\t\t'basePath' => dirname(__FILE__),\n\t\t\t'namespace' => false\n\t\t));\n\t\t$resourceLoader->addResourceType('model', 'models', 'Model_');\n\t\t$resourceLoader->addResourceType('default-form', 'modules/default/forms', 'Form_');\n\t}", "protected function _initAutoloader()\n {\n $loader = new StandardAutoloader();\n $loader->registerNamespace('Doctrine', PROJECT_PATH.'/library/Doctrine')\n ->registerNamespace('App', PROJECT_PATH.'/library/App')\n ->registerNamespace('Domain', PROJECT_PATH.'/library/Domain')\n ->registerNamespace('Gedmo', PROJECT_PATH.'/library/Doctrine/Extension/Gedmo');\n $loader->register();\n }", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "protected function _initAutoload() {\n $moduleLoader = new Zend_Application_Module_Autoloader(array(\n 'namespace' => '',\n 'basePath' => APPLICATION_PATH\n ));\n return $moduleLoader;\n }", "public function addAutoloader()\n {\n if (! $this->autoloaderRegistered) {\n spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload'));\n require_once Mage::getBaseDir('lib') . '/Wallee/Sdk/autoload.php';\n spl_autoload_register(array(Varien_Autoload::instance(), 'autoload'));\n\n set_include_path(get_include_path() . PATH_SEPARATOR . Mage::helper('wallee_payment')->getGenerationDirectoryPath());\n\n spl_autoload_register(\n function ($class) {\n if (strpos($class, 'Wallee_Payment_Model_PaymentMethod') === 0) {\n $file = Mage::helper('wallee_payment')->getGenerationDirectoryPath() . DS . uc_words($class, DIRECTORY_SEPARATOR) . '.php';\n if (file_exists($file)) {\n require $file;\n }\n }\n }, true, true\n );\n $this->autoloaderRegistered = true;\n }\n }", "protected function _initAutoload2() {\n $autoLoader = Zend_Loader_Autoloader::getInstance();\n $autoLoader->setFallbackAutoloader(true);\n return $autoLoader;\n }", "public static function registerAutoloaders()\n {\n $modules = self::getModsTable();\n unset($modules[0]);\n foreach ($modules as $module) {\n $base = ($module['type'] == self::TYPE_MODULE) ? 'modules' : 'system';\n $path = \"$base/$module[directory]/lib\";\n ZLoader::addAutoloader($module['directory'], $path);\n }\n }", "public function registerAutoloaders() {\r\n return $this;\r\n }", "public function registerPlugins($autoloader)\n {\n // initialize the event dispatcher; the include is here explicitly\n // should anyone not want this dependency and thus nto invoke this\n // method\n include_once 'symfony/components/event_dispatcher/lib/sfEventDispatcher.php';\n $dispatcher = new sfEventDispatcher();\n\n // initialize the plugin manager\n $plugin_manager = new DocBlox_Plugin_Manager(\n $dispatcher,\n DocBlox_Core_Abstract::config(),\n $autoloader\n );\n\n $plugin_manager->loadFromConfiguration(DocBlox_Core_Abstract::config());\n\n $this->attachDispatcher($dispatcher);\n }", "protected function loadAutoloader()\n {\n new Autoloader();\n }", "public function registerAutoloader()\n {\n if (!$this->isLoaderRegistered()) {\n $this->_loaderRegistered = spl_autoload_register(array($this, 'loadClass'));\n }\n }", "public static function registerAutoloader()\n\t{\n\t\tspl_autoload_register(__NAMESPACE__.'\\\\Core::autoload');\n\t}", "public function registerAutoloader()\n {\n spl_autoload_register(array($this,'loadClass'),true, false);\n }" ]
[ "0.71239805", "0.70356315", "0.7014604", "0.69268245", "0.69074523", "0.6881294", "0.6874796", "0.687425", "0.6843537", "0.6786774", "0.6757401", "0.673854", "0.6735615", "0.67146933", "0.6698351", "0.6682487", "0.6631243", "0.66288084", "0.6608404", "0.6566878", "0.655929", "0.6546614", "0.6522928", "0.6501604", "0.65000504", "0.6482366", "0.6471116", "0.64664793", "0.64613855", "0.644705" ]
0.7894871
0
Methods getters Get table of info upon the path. Array return : > tab[0] = path module > tab[1] = class name > tab[2] = method name
protected function getPathInfo() { // Init var $Result = array('','',''); $tabStr = explode(PARAM_KERNEL_ROUTE_SEPARATOR, $this->strPath); $strModPath = ''; $strClassNm = ''; $strActionNm = ''; if((count($tabStr) == 1) || (count($tabStr) == 2)) { // Set path and action $strModPath = trim($tabStr[0]); if(count($tabStr) == 2) // Get { $strActionNm = trim($tabStr[1]); } // Set class name if ( (strpos($strModPath, '/') !== false) && (strpos($strModPath, '.') !== false) && (strlen($strModPath)>2) ) { $tabStr = explode('/', $strModPath); $str = $tabStr[count($tabStr)-1]; $tabStr = explode('.', $str); $strClassNm = trim($tabStr[0]); $ToolboxNameSpace = $this->getToolboxNameSpace(); $strNS = $ToolboxNameSpace::getNameSpaceReprocess(PARAM_KERNEL_PATH_ROOT.'/'.$strModPath); $strClassNm = $strNS.$strClassNm; } // Check Path if(file_exists(PARAM_KERNEL_PATH_ROOT.'/'.$strModPath)) { $Result[0] = $strModPath; } // Put other infos $Result[1] = $strClassNm; $Result[2] = $strActionNm; } // Return result return $Result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }", "public function getMethods();", "public function getMethods();", "public function getMethods();", "public function getMethods(): array;", "public function getMethods(): array;", "function getMethodsHead()\n {\n\n }", "function sourceArray($srcClassName) {\n // Returns an array which contains method source and args.\n\n $ref = new ReflectionClass($srcClassName);\n\n $refMethods = $ref->getMethods();\n // Possible replacement: get_class_methods()?\n\n $objectArray = array();\n foreach ($refMethods as $refMethod) {\n $method = $refMethod->name;\n\n // Get a string of a method's source, in a single line.\n // XXX: Y u no cache file\n $filename = $refMethod->getFileName();\n if (!empty($filename)) {\n $source = getSource($srcClassName, $method, $filename);\n } else {\n // We presume that if no filename is found, the method is\n // built-in and we are unconcerned with it\n debugMsg(\"Skipping builtin method $method\");\n continue;\n }\n \n // Check to determine whether the method being inspected is static\n $isStatic = $refMethod->isStatic();\n\n // Get a comma-seperated string of parameters, wrap them in\n // a method definition. Note that all your methods\n // just became public.\n $params = prepareParametersString($refMethod, false); \n $paramsDefault = prepareParametersString($refMethod); \n if ($isStatic) {\n // unconfirmed as of yet\n $methodHeader = \"public static function $method({$paramsDefault})\";\n } else {\n $methodHeader = \"public function $method({$paramsDefault})\";\n }\n\n // Return the two components mentioned above, indexed by method name\n // XXX: Only send one of the params vars, processing on other end\n $objectArray[$method] = array(\"params\" => $params, \"paramsDefault\" => $paramsDefault, 'methodHeader' => $methodHeader, 'src' => $source, 'isStatic' => $isStatic);\n }\n return $objectArray;\n}", "public function getPath(): array;", "public function getActiveMethods();", "public function methods();", "function MyMod_Handle_Files_Path_Table($path,$prencells)\n {\n $files=$this->DirFiles($path);\n sort($files);\n\n if (count($files)==0) { return; }\n\n $table=array();\n array_push\n (\n $table,\n $this->MyMod_Handle_File_Title_Row($path,$prencells)\n );\n\n $comps=preg_split('/\\//',$path);\n foreach ($files as $file)\n {\n array_push($table,$this->MyMod_Handle_File_Row($file,$prencells));\n }\n \n\n return $table;\n }", "public function getModulePath()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[0];\r\n }", "public function getMethodDescriptors(): array;", "protected function _infos($type)\n {\n $this->checkAccess($type);\n\n global $config;\n $infos = objects::infos($type);\n unset($infos['tabClass']);\n $infos['tabs'] = $config->data['TABS'][$infos['tabGroup']];\n unset($infos['tabGroup']);\n return $infos;\n }", "function describeService($data)\r\n\r\n\t{\r\n\r\n\t\t$className = $data['label'];\r\n\r\n\t\t//Sanitize path\r\n\r\n\t\t$path = str_replace('..', '', $data['data']);\r\n\r\n\t\t//Generate the method table from this info\r\n\r\n\t\t// Browse the cakePHP controllers folder\t\t\r\n\r\n\t\t$this->_path = CONTROLLERS;\r\n\r\n\t\t\r\n\r\n\t\t$methodTable = CakeMethodTable::create($this->_path . $path . $className . '.php', NULL, $classComment);\r\n\r\n\t\treturn array($methodTable, $classComment);\r\n\r\n\t}", "public function getPagePath();", "private function parsePath() {\r\n\t\t// Get the path from PATH_INFO\r\n\t\tif( $this->input('server', 'PATH_INFO') !== null\r\n\t\t && !empty( $this->input('server', 'PATH_INFO') )\r\n\t\t && trim($this->input('server', 'PATH_INFO'), '/') !== '' ) {\r\n\t\t\t$path = trim($this->input('server', 'PATH_INFO'), '/');\r\n\t\t} else {\r\n\t\t // PATH_INFO does not exist, use index\r\n\t\t\t$path = 'index';\r\n\t\t}\r\n\r\n\t\t// Replace any dangerous characters and make everything lower case\r\n\t\t$path = strtolower(preg_replace('/[^a-z\\/]/i', '', $path));\r\n\t\t\r\n\t\t// Remove the \"api\" prefix if there is one\r\n\t\tif(strpos($path, '/api') === 0) {\r\n\t\t $path = substr($path, 4);\r\n\t\t}\r\n\t\t\r\n\t\t// Parse the class\r\n\t\tif( count(explode('/', $path)) === 1 ) { // If there's only the class\r\n\t\t\t$class = $path;\r\n\t\t\t\t\r\n\t\t\t$this->method = 'index';\r\n\t\t}\r\n\t\telse { // Otherwise both the class and method exist\r\n\t\t\t$class = substr($path, 0, strlen( basename($path) ) * -1); // Get the path only (without the method)\r\n\t\t\t\t\r\n\t\t\t// Set the method\r\n\t\t\t$this->method = basename($path);\r\n\t\t}\r\n\t\t\r\n\t\t// Replace '/' with capitalization for every first letter in the path\r\n\t\tforeach( explode('/', trim($class, '/')) as $value ) {\r\n\t\t\t$this->class .= ucfirst($value);\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t// 'Add 'Actions' prefix so there will be no mistakes including the class\r\n\t\t$this->class = 'Actions' . $this->class;\r\n\t}", "public function getInfo(): array;", "function getInfoObject($path)\n\t{\n\n\t\tif (strrpos(basename($path), '.') === false) {\n\t\t\tif (strrpos($path, '/') < strlen($path)-1) {\n\t\t\t\t$path = rtrim($path, '/') . '/';\n\t\t\t}\n\t\t}\n\n\t\t$path = preg_replace('#[/\\\\\\\\]+#', '/', $path);\n\t\t$slash = strrpos($path, '/') + 1;\n\t\t$sbase = ($slash > 1)\n\t\t\t\t\t? basename(substr($path, $slash), '.php')\n\t\t\t\t\t: basename($path, '.php');\n\n\t\t$out = new stdClass;\n\t\t$out->path = rtrim($path, '/');\n\t\tif ($slash > 1) {\n\t\t\t$out->dirname = substr($path, 0, $slash);\n\t\t\t$out->filename = substr($path, $slash);\n\t\t} else {\n\t\t\t$out->dirname = '';\n\t\t\t$out->filename = $path;\n\t\t}\n\n\t\t// Modified below\n\t\t$out->basename = $sbase;\n\t\t$out->classname = $sbase;\n\t\t$out->testclass = $sbase;\n\t\t$out->package = 'Joomla';\n\t\t$out->enabled = false;\n\t\t$out->is_test = 0;\n\n\t\t// determine \"TestSuite Package\" 'libraries/joomla/package/subpackage/'\n\t\t// not necessarily identical to the J!F Package the tested file belongs to\n\t\t$parts = explode('/', rtrim($out->dirname, '\\\\/'));\n\t\tif (count($parts) > 1) {\n\t\t\tif (isset($parts[2])) {\n\t\t\t\t$out->package = ucwords($parts[2]);\n\t\t\t\tif (isset($parts[3])) {\n\t\t\t\t\t$out->package .= '_'.ucwords($parts[3]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Libraries\n\t\t\t\t$out->package = ucwords($parts[0]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (empty($sbase)) {\n\t\t\t\t$out->package = 'UnitTests';\n\t\t\t} else {\n\t\t\t\t$out->package = 'Framework';\n\t\t\t}\n\t\t}\n\n\t\tif ($out->enabled == false) {\n\t\t\treturn $out;\n\t\t}\n\n\t\t$testcase =& JUnit_Setup::getProperty('Reporter', 'UnitTests', 'array');\n\t\t$testcase[strtolower($out->testclass)] =& $out;\n\n\t\t// JUNIT_CLI\n\n\t\treturn $out;\n\t}", "public function path();", "public static function get_path1(){\n return self::PATH1;\n }", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "public function getMethods($class);", "abstract protected function paths();", "public static function getTabs() {\r\n\t\treturn self::getModulesForUser(Config::$sis_tab_folder);\r\n\t}", "protected function getInfoModule() {}", "abstract public function getClassPath();", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function getInfo();" ]
[ "0.63688976", "0.6122291", "0.6122291", "0.6122291", "0.58756924", "0.58756924", "0.5767824", "0.5712552", "0.5681708", "0.5615371", "0.5614685", "0.56075615", "0.56058383", "0.5556423", "0.55488485", "0.5532424", "0.5503298", "0.54928464", "0.5477363", "0.5477326", "0.5454608", "0.5450145", "0.5430994", "0.5430889", "0.5404556", "0.5394355", "0.5391355", "0.5388175", "0.5382236", "0.5372554" ]
0.6936527
0
Checks if $this>data exists inside $this>url
private function checkDataInURL() { $html = @file_get_contents($this->url); if ($html === FALSE) throw new Exception('Unable to get html from URL.'); return strpos($html, $this->data) !== FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\n\t}", "protected function has_data()\n {\n }", "public function hasUrl()\n {\n return ! empty($this->url);\n }", "public function has_data()\n {\n }", "public function hasData(){\n return $this->_has(1);\n }", "public function exists()\n {\n return !empty($this->data);\n }", "protected function isInitialized($data)\n {\n return isset($data->delivery_url);\n }", "public function hasData() : bool;", "public function hasData(): bool\n {\n return !empty($this->data);\n }", "protected function hasData($key) {\n\t\t\treturn array_key_exists($key, $this->data);\n\t\t}", "function isURLExistingInLinkArry($url){\r\n foreach($this->link_arry as $link){\r\n if($link->getURL()==$url){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public function hasUrlPath()\n {\n return $this->url_path !== null;\n }", "public function exists( $url );", "function exists($data){\n if(isset($data) and !empty($data)){\n return true;\n }\n return false;\n}", "public function exists() {\n\t\treturn !isset($userData);\n\t}", "private function hasURLDataChanged() {\n $isDataInURL = filter_var($this->cookie->get(URLDATATRACKER_ISDATAINURL), FILTER_VALIDATE_BOOLEAN);\n try {\n $dataCompareResult = $isDataInURL !== $this->checkDataInURL();\n echo \"Successfully performed data check.\\n\";\n return $dataCompareResult;\n } catch (Exception $e) {\n echo \"Failed to perform data check.\\n\";\n throw $e;\n }\n }", "function _fix_data() {\n\t\tif (isset($this->url) && $this->url) $this->_parse_url($this->url);\n\n\t\treturn true;\n\t}", "public function hasData(){\n return $this->_has(10);\n }", "public function hasData(){\n return $this->_has(10);\n }", "public function exists() {\n return $this->shareData !== false;\n }", "public final function hasData()\n {\n return $this->data == false ? false : true;\n }", "public static function hasData()\n {\n if (Request::METHOD_GET === static::getMethod()) {\n return !empty($_GET);\n }\n\n return 0 < intval(static::getHeader('Content-Length'));\n }", "public function hasData($key = '');", "function url_exist($url)\r\n\t\t{\r\n\t\t\r\n\t\t}", "public function hasData($key = null);", "public function hasData($key = '') {\n if (empty($key) || !is_string($key)) {\n return !empty($this->_data);\n }\n return array_key_exists($key, $this->_data);\n }", "public function has_data($data=null)\n\t{\n if ( is_null($data) ){\n $data = $this->data;\n }\n\t\treturn ( is_array($data) && (count($data) > 0) ) ? 1 : false;\n\t}", "public function checkNotExist($data) {\r\n\t\t$sql = \"Select Count(*) As cnt From `#languages` Where `url_code` = '{$data['url_code']}' And id <> {$data['id']}\"; \r\n\t\t$rs = $this->_get($sql); \r\n\t\tif ($rs) {\r\n\t\t\tif ($rs->cnt == 0) return true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "public function hasUserData(){\n return $this->_has(2);\n }" ]
[ "0.69160885", "0.6750902", "0.65724427", "0.6543552", "0.65159374", "0.64892465", "0.6432191", "0.6417725", "0.6336273", "0.63291854", "0.63265705", "0.6172349", "0.6168309", "0.61219645", "0.612057", "0.6114995", "0.6113378", "0.61113495", "0.61113495", "0.6109108", "0.6099373", "0.6050131", "0.59936446", "0.59920734", "0.5975314", "0.5956122", "0.5953238", "0.59490836", "0.5936881", "0.5935801" ]
0.7399255
0
Checks if $this>checkDataInURL() status has changed from the the last known status stored in the cookie
private function hasURLDataChanged() { $isDataInURL = filter_var($this->cookie->get(URLDATATRACKER_ISDATAINURL), FILTER_VALIDATE_BOOLEAN); try { $dataCompareResult = $isDataInURL !== $this->checkDataInURL(); echo "Successfully performed data check.\n"; return $dataCompareResult; } catch (Exception $e) { echo "Failed to perform data check.\n"; throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_new_data() {\n $rv = FALSE;\n if ($this->is_remote($this->url)) {\n $ts_standard = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_COUNTIES);\n }\n else {\n $ts_standard = filemtime($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = filemtime($this->url . FileFetcher::FILE_COUNTIES);\n }\n $ts = 0;\n if ($this->last_fetch == '' || $ts_standard > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_standard;\n }\n if ($this->last_fetch == '' || $ts_counties > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_counties;\n }\n if ($rv) {\n update_option(\"hecc_standard_last_update_datetime\", $ts);\n }\n return $rv;\n }", "public function checkUrl()\n\t{\n\t\t$url = $this->input->get('url', '', 'raw');\n\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\t\t$model->savestate(true);\n\t\t$result = $model->checkAndCleanUrl($url);\n\n\t\t$this->container->platform->setSessionVar('transfer.url', $result['url'], 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.url_status', $result['status'], 'akeeba');\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}", "public function isRefreshTimeBasedCookie() {}", "public function isRefreshTimeBasedCookie() {}", "function rest_cookie_collect_status()\n {\n }", "public function changed() {\n\t\t\tif (!$this->original_data) {\n\t\t\t\tthrow new Exception('call exists() before calling changed()');\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->last_change != $this->original_last_change ||\n\t\t\t $this->last_change_reason != $this->original_last_change_reason ||\n\t\t\t $this->lanes_affected != $this->original_lanes_affected ||\n\t\t\t $this->traffic_impact != $this->original_traffic_impact ||\n\t\t\t $this->reason != $this->original_reason) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t}", "private function isRefresh($lastUrl): bool\n\t{\n\t\treturn $lastUrl == $_SERVER['HTTP_REFERER'];\n\t}", "private function hasUrlChanged($request)\n {\n }", "private function checkStatus()\n {\n $res = $this->parseBoolean(\n json_encode($this->getStatus()[\"timed_out\"])\n );\n\n if ($this->getStatus() == null)\n $this->setOnline(false);\n else if ($res)\n $this->setOnline(false);\n else\n $this->setOnline(true);\n }", "private function checkUrlStatus()\n {\n $request = curl_init($this->url);\n\n curl_setopt($request, CURLOPT_HEADER, true);\n curl_setopt($request, CURLOPT_NOBODY, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_TIMEOUT, 10);\n\n curl_exec($request);\n $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);\n curl_close($request);\n\n if ($httpCode >= 200 && $httpCode < 400) {\n return true;\n }\n\n return false;\n }", "function rest_cookie_collect_status() {\n\tglobal $wp_rest_auth_cookie;\n\n\t$status_type = current_action();\n\n\tif ( 'auth_cookie_valid' !== $status_type ) {\n\t\t$wp_rest_auth_cookie = substr( $status_type, 12 );\n\t\treturn;\n\t}\n\n\t$wp_rest_auth_cookie = true;\n}", "public function needsRefreshing()\n {\n return $this->isExpired() || ! $this->isLoaded();\n }", "public function isCookieSet() {}", "function expired() {\r\n if(!file_exists($this->cachefile)) return true;\r\n # compare new m5d to existing cached md5\r\n elseif($this->hash !== $this->get_current_hash()) return true;\r\n else return false;\r\n }", "public function isValidCheckin(){\n\t\t$users_connection = $this->dbHandle->users;\n\t\t$data = $users_connection->findOne(array('uid' => intval($this->uid)));\n\t\tif (!isset ($data['last_update']) || $data['last_update'] == null){\n\t\t\t//first update so is valid.\n\t\t\treturn true;\n\t\t}\n\t\t//$last_update_time = $data['last_update']['created_on']->sec;\n\t\tif (isset ($data['last_update']['listing'])){\n\t\t\t$last_checkedin_show = $data['last_update']['listing']['listing_id'];\n\t\t\t$last_checkedin_show_start = $data['last_update']['listing']['start']->sec;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t\tif (($this->listing_id == $last_checkedin_show) && ($this->time == $last_checkedin_show_start)){\n\t\t\t$this->logger->log(\"Checked into the same show again. Return false\",Zend_Log::INFO);\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t$current_update_time = $this->timestamp;\n\t\t$diff_secs = $current_update_time - $last_update_time;\n\t\t$this->logger->log(\"The diff secs = $diff_secs\",Zend_Log::INFO);\n\t\t$threshold = 30*60; //30 mins \n\t\tif ($diff_secs > $threshold){\n\t\t\treturn true;\n\t\t}\n\t\t//within 30 mins not valid for points.\n\t\treturn false;\n\t\t*/\n\t\treturn true;\n\t}", "public function checkAcquiaHostedStatusChanged($spi_data) {\n return isset($spi_data['acquia_hosted']) && (bool) $spi_data['acquia_hosted'] != (bool) $this->acquiaHosted;\n }", "public function isRemoteCheckRequired()\n {\n if ($this->uid && $this->sessionToken && $this->recheck) {\n if($this->recheck > (new DateTime('NOW'))) {\n return false;\n }\n }\n\n return true;\n }", "private function isAliveRequest() : bool {\n return\n $_SERVER['REQUEST_METHOD'] === \"GET\"\n &&\n $_SERVER['DOCUMENT_URI'] === '/status';\n }", "private function checkDataInURL() {\n $html = @file_get_contents($this->url);\n if ($html === FALSE) throw new Exception('Unable to get html from URL.');\n return strpos($html, $this->data) !== FALSE;\n }", "public function validateUpdate()\n\t{\n\t\tBlocks::log('Validating MD5 for '.$this->_downloadFilePath, \\CLogger::LEVEL_INFO);\n\t\t$sourceMD5 = IOHelper::getFileName($this->_downloadFilePath, false);\n\n\t\t$localMD5 = IOHelper::getFileMD5($this->_downloadFilePath);\n\n\t\tif ($localMD5 === $sourceMD5)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function valid() \n {\n return isset($_COOKIE[$this->key()]);\n }", "public function checkConfigChanged()\n {\n if(!file_exists($this->full_path.'/.svn'))\n {\n $this->logger->info('SvnAdapter: config changed, not a svn repo');\n return true;\n }\n \n //url from file\n $out = self::_system('svn info '.$this->full_path.' | grep \"URL\"');\n $url_file = substr($out, 5);\n if($url_file != $this->url)\n { \n $this->logger->info('SvnAdapter: config changed, not the same url repo');\n return true;\n }\n \n $this->logger->info('SvnAdapter: config NOT changed');\n return false;\n }", "function check_cache ( $url ) {\n $this->ERROR = \"\";\n $filename = $this->file_name( $url );\n \n if ( file_exists( $filename ) ) {\n // find how long ago the file was added to the cache\n // and whether that is longer then MAX_AGE\n $mtime = filemtime( $filename );\n $age = time() - $mtime;\n if ( $this->MAX_AGE > $age ) {\n // object exists and is current\n return 'HIT';\n }\n else {\n // object exists but is old\n return 'STALE';\n }\n }\n else {\n // object does not exist\n return 'MISS';\n }\n }", "public function updateVisitsToExpired() {\n\t\ttry {\n\n\t\t\t$command = Yii::app()->db->createCommand(\"UPDATE visit\n LEFT JOIN card_generated ON card_generated.id = visit.card\n SET visit_status = \" . VisitStatus::EXPIRED . \",card_status =\" . CardStatus::NOT_RETURNED . \"\n WHERE CURRENT_DATE > date_expiration AND visit_status = \" . VisitStatus::ACTIVE . \"\n AND card_status =\" . CardStatus::ACTIVE . \" and card_type=\" . CardType::MULTI_DAY_VISITOR . \"\")->execute();\n\n\t\t\techo \"Affected Rows : \" . $command . \"<br>\";\n\t\t\tif ($command > 0) {\n\t\t\t\techo \"Update visit to expired status successful.\";\n\t\t\t} else {\n\t\t\t\techo \"No record to update.\";\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} catch (Exception $ex) {\n\t\t\techo 'Query failed', $ex->getMessage();\n\t\t\treturn false;\n\t\t}\n\t}", "public function isRedirect()\n {\n return isset($this->data['Status']) && '3DAUTH' === $this->data['Status'];\n }", "public function cacheUpToDate()\n\t{\n\t\t$expiredSites = $this->getExpiredCacheSites();\n\n\t\treturn empty($expiredSites);\n\t}", "public function isAlreadyDownloaded(): bool\n {\n return file_exists($this->getFilePath());\n }", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function recentlySeen()\n {\n return $this->checked_in_at->diffInDays(now()) < 1;\n }", "public function isDifferentUrl()\n {\n $defaultUrl = $this->getCheckoutUrl();\n $actualUrl = Mage::helper('checkout/url')->getCheckoutUrl();\n\n return $defaultUrl != $actualUrl;\n }" ]
[ "0.59183085", "0.5706716", "0.56382966", "0.56382966", "0.56168854", "0.5615127", "0.56083584", "0.5400694", "0.5390382", "0.53425604", "0.5327734", "0.5321748", "0.530336", "0.5274762", "0.5253346", "0.52509844", "0.522989", "0.5225797", "0.5221308", "0.5215015", "0.5182281", "0.5163699", "0.51228285", "0.51145107", "0.5099677", "0.5094804", "0.5088389", "0.50871783", "0.50840026", "0.5074793" ]
0.82121
0
Stores the current $this>checkDataInURL() status to a cookie
private function storeCookie() { try { $this->cookie->store(URLDATATRACKER_ISDATAINURL, $this->checkDataInURL() ? 'TRUE' : 'FALSE'); echo "Successfully stored cookie.\n"; } catch (Exception $e) { echo "Failed to store cookie.\n"; throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hasURLDataChanged() {\n $isDataInURL = filter_var($this->cookie->get(URLDATATRACKER_ISDATAINURL), FILTER_VALIDATE_BOOLEAN);\n try {\n $dataCompareResult = $isDataInURL !== $this->checkDataInURL();\n echo \"Successfully performed data check.\\n\";\n return $dataCompareResult;\n } catch (Exception $e) {\n echo \"Failed to perform data check.\\n\";\n throw $e;\n }\n }", "public function store()\n {\n return response('200')->cookie(\n 'cookie-popup',\n 'checked',\n time() + (365 * 24 * 60 * 60)\n );\n }", "public function isCookieSet() {}", "function rest_cookie_collect_status()\n {\n }", "private function getCookie() {\n $Cookie = filter_input(INPUT_COOKIE, 'useronline', FILTER_DEFAULT);\n if (!$Cookie):\n return FALSE;\n else:\n return TRUE;\n endif;\n setcookie(\"useronline\", base64_encode(\"ccs\"), time() + 86400);\n }", "function storeData(){\n $new_object=array();\n\n if(array_key_exists(\"x1\", $_GET) && array_key_exists(\"y1\", $_GET) &&\n array_key_exists(\"x2\", $_GET) && array_key_exists(\"y2\", $_GET)\n ) {\n $new_object[\"x1\"]=$_GET[\"x1\"];\n $new_object[\"y1\"]=$_GET[\"y1\"];\n $new_object[\"x2\"]=$_GET[\"x2\"];\n $new_object[\"y2\"]=$_GET[\"y2\"];\n }\n \n if (array_key_exists(\"drawing\", $_COOKIE)){\n $drawing=unserialize(base64_decode($_COOKIE[\"drawing\"])); //PWN here\n } else{\n // create new array\n $drawing=array();\n }\n \n $drawing[]=$new_object; //Append to the array\n setcookie(\"drawing\",base64_encode(serialize($drawing)));\n }", "function run() {\n try {\n if (empty($this->cookie->get(URLDATATRACKER_ISDATAINURL))) {\n $this->storeCookie();\n return;\n }\n\n if ($this->hasURLDataChanged()) {\n $this->storeCookie();\n $this->sendAPN();\n }\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n }", "function save_cookie($data) {\n //set for ~2 months\n setcookie(Main::getCookieName(), $data, time()+60*60*24*7*8);\n }", "public function is_cookie_set()\n {\n }", "function setCookieData($pNewData)\n{\n $tData = json_encode([\"ui\" => $pNewData[\"ui\"], \"stats\" => $pNewData[\"stats\"]]);\n setcookie(\"ConwayData\", $tData, time() + (10 * 365 * 24 * 60 * 60));\n}", "function save()\n {\n $this->getSession()->set($this->getCookieJarName(), $this->cookieJar);\n }", "public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }", "function storeInCookie($user_profile_data)\n{\n\t$context = Context::getContext();\n\t$cookie = $context->cookie;\n\t$cookie->login_radius_data = serialize($user_profile_data);\n}", "static function viaRemember()\n\t{\n\t\treturn self::$cookie;\n\t}", "public function set_cookie()\n {\n }", "public function enableCookies() {}", "function rest_cookie_collect_status() {\n\tglobal $wp_rest_auth_cookie;\n\n\t$status_type = current_action();\n\n\tif ( 'auth_cookie_valid' !== $status_type ) {\n\t\t$wp_rest_auth_cookie = substr( $status_type, 12 );\n\t\treturn;\n\t}\n\n\t$wp_rest_auth_cookie = true;\n}", "public function cookieIsset() {\n\t\tif(isset($_COOKIE[$this->cookieName])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function cookieAction() {\n if($_COOKIE['tx_cookies_accepted'] && !$this->settings['showPermanent']) {\n return FALSE;\n }\n $this->view->assign('accepted', array_key_exists('tx_cookies_accepted', $_COOKIE) ? 1 : 0);\n $this->view->assign('disabled', array_key_exists('tx_cookies_disabled', $_COOKIE) ? 1 : 0);\n $this->view->assign('acceptedOrDisabled', ($_COOKIE['tx_cookies_accepted'] || $_COOKIE['tx_cookies_disabled']) ? 1 : 0);\n }", "function getFromCookies() {\r\n\t\t//Data stored in cache as a cookie.\r\n\t\t$this->phone_number = $_COOKIE['phoneNumber'];\r\n\t\t$this->email = $_COOKIE['email'];\r\n\t}", "public static function rememberPageHasBeenVisited()\n\t{\n\t\tif( SETTINGS_LOG_VISITS )\n\t\t{\n\t\t\t$page = self::getPageCode();\n\t\t\t$type = Page::getContentType();\n\t\t\tif( $type == Page::KEY_HTML || $type == Page::KEY_DATA )\n\t\t\t{\n\t\t\t\tif( $id = self::getConnectionID() )\n\t\t\t\t{\n\t\t\t\t\tDB::update(\"UPDATE `\".self::$sql_table_connections.\"` SET `logout_date`='\"\n\t\t\t\t\t\t\t\t\t.Common::formatDateToSQL(null, true).\"', `pages_viewed`=`pages_viewed`+1 WHERE `session_id`=$id\");\n\t\t\t\t}\n\t\t\t\telseif( $id = self::trackConnection() )\n\t\t\t\t{\n\t\t\t\t\tClient::setSessionID($id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// track the pages viewed\n\t\t\t\tif( $id && self::$sql_table_pagesViewed && self::isCasualPage() && ! Vars::isPostContext() )\n\t\t\t\t{\n\t\t\t\t\tDB::insert(self::$sql_table_pagesViewed, Array\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t$page, $type, // page name and type\n\t\t\t\t\t\t\t$_SERVER['REQUEST_URI'], // request string, or try $_SERVER['QUERY_STRING']\n\t\t\t\t\t\t\t$id, Common::formatDateToSQL(null, false) // session_id and current date\n\t\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function updateVisitorCookie() {\n setcookie('alchemy_visited', 'yes', time() + 86400 * 365 * 2);\n return ;\n }", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function acceptCookies(){\n\t\tsetcookie('isUsingCookies', true, time()+60*60*24*365);\n\t\treturn redirect()->route('home');\n\t}", "public function save()\n {\n if (headers_sent())\n {\n throw new \\RuntimeException('Cache cookie can not be saved as headers have '\n . 'already been sent to the user agent.');\n }\n\n $headers = headers_list(); // List all headers\n header_remove(); // remove all headers\n $regexp = '/^Set-Cookie\\\\s*:\\\\s*' . preg_quote($this->name) . '=/';\n\n foreach ($headers as $header)\n {\n // Re-add every header except the one for this cookie\n if (!preg_match($regexp, $header))\n {\n header($header, true);\n }\n }\n\n if (!empty($this->content) && count($this->content) > 0)\n {\n if (function_exists('msgpack_pack'))\n {\n $data = msgpack_pack($this->content);\n }\n else\n {\n $data = json_encode($this->content);\n }\n\n // Store expiration time in minutes\n $data = round((time() - $this->start_timestamp + $this->duration*60)/60) . '|' . $data;\n\n $cookie = hash_hmac($this->digest_method, $data, $this->secret) . '|' . $data;\n\n $duration = $this->duration ? time() + $this->duration * 60 : 0;\n\n if (strlen($cookie . $this->path . $duration . $this->domain . $this->name) > 4080)\n {\n throw new \\OverflowException('Cache cookie can not be saved as its size exceeds 4KB.');\n }\n\n setcookie($this->name, $cookie, $duration, $this->path, $this->domain, $this->secure, true);\n $_COOKIE[$this->name] = $cookie;\n }\n else\n {\n setcookie($this->name, '', 1, $this->path, $this->domain, $this->secure, true);\n unset($_COOKIE[$this->name]);\n }\n\n return true;\n }", "function set_referral_cookie($val){\n\n\t\t$cookieName = self::$prefix . \"referral\";\n\t\t$domain = $this->options['domain']->get_value();\n\t\t$path = $this->options['path']->get_value();\n\t\t$days = $this->options['cookie_length']->get_value();\n\t\t$time = time() + ( 60 * 60 * 24 * $days );\n\n\t\tif ($val === true){\n\t\t\t$cookieval = \"true\";\n\t\t} else {\n\t\t\t$cookieval = \"false\";\n\t\t}\n\n\t\tif ( $domain == '' ){\n\t\t\t$domain = null;\n\t\t}\n\t\t$this->logger->_log(\"Path is set to $path\");\n \t\tsetcookie( $cookieName, $cookieval, $time, $path, $domain );\n\n\t}", "public function save(): void\n {\n $json = [];\n /** @var SetCookie $cookie */\n foreach ($this as $cookie) {\n if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {\n $json[] = $cookie->toArray();\n }\n }\n\n $_SESSION[$this->sessionKey] = \\json_encode($json);\n }", "protected function _connection() {\n\n\t\tif ($this->cookie->exists('user') === false && $this->cookie->exists('token') === false) {\n\t\t\t\n\t\t\tif (count($_POST) && isset($_POST['email']) && isset($_POST['password'])) {\n\t\t\t\t\n\t\t\t\t$oUser = new User;\n\t\t\t\t$oUserEntity = $oUser->findOneByemail($_POST['email']);\n\n\t\t\t\tif (count($oUserEntity) > 0 && md5($_POST['password']) === $oUserEntity->get_password()) {\n\n\t\t\t\t\t$this->cookie->set('user', $_POST['email'], 86400);\n\t\t\t\t\t$this->cookie->set('id', $oUserEntity->get_id(), 86400);\n\t\t\t\t\t$this->cookie->set('token', md5($_POST['email'].self::PRIVATE_KEY_FOR_TOKEN), 86400);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->cookie->exists('user') && $this->cookie->exists('token')) {\n\t\t\t\n\t\t\tif (md5($this->cookie->get('user').self::PRIVATE_KEY_FOR_TOKEN) != $this->cookie->get('token')) {\n\t\t\t\t\n\t\t\t\t$this->cookie->set('user', null, 0);\n\t\t\t\t$this->cookie->set('id', null, 0);\n\t\t\t\t$this->cookie->set('token', null, 0);\n\t\t\t}\n\t\t}\n\t}", "function expire() {\r\n\t\t$this->log .= \"expire() called<br />\";\r\n\t\t$ret = true;\r\n\t\t$this->data = array();\r\n\t\tif (!file_exists($this->filename)) {\r\n\t\t\t$this->log .= $this->filename.\" does not exist.<br />\";\r\n\t\t\t$ret = false;\r\n\t\t} else {\r\n\t\t\tif (!@unlink($this->filename)) {\r\n\t\t\t\t$this->log .= \"session file delete failed for \"\r\n\t\t\t\t.$this->filename.\"<br />\";\r\n\t\t\t\t$ret = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!setcookie('sid' ,$this->id, time()-3600, \"/\")) {\r\n\t\t\t$this->log .= \"sid cookie expire failed. This may be due to browser\"\r\n\t\t\t.\" output started prior.<br />\";\r\n\t\t\t$ret = false;\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public function set()\n {\n setcookie($this->name, $this->value, $this->time);\n\n }" ]
[ "0.6307936", "0.62240255", "0.57195693", "0.5614683", "0.55893165", "0.5564948", "0.5545319", "0.5518148", "0.54891455", "0.54829985", "0.54582965", "0.54274374", "0.5424936", "0.53587395", "0.53414977", "0.5272552", "0.5266992", "0.5262771", "0.5241918", "0.5218157", "0.52016306", "0.51986235", "0.5198349", "0.51605487", "0.51488096", "0.5140196", "0.5123124", "0.5113042", "0.5112138", "0.51053625" ]
0.7268596
0
this sample file contains 1 UUID only
public function testExtractUsingSampleWithOneUuid(): void { $sample = $this->fileContentPath('sample-to-extract-metadata-one-cfdi.html'); $extractor = new MetadataExtractor(); $data = $extractor->extract($sample); $this->assertGreaterThanOrEqual(1, count($data)); $expectedUuid = 'b97262e5-704c-4bf7-ae26-9174fef04d63'; $expectedData = [ $expectedUuid => [ 'uuid' => $expectedUuid, 'rfcEmisor' => 'BSM970519DU8', 'nombreEmisor' => 'BANCO SANTANDER MEXICO,' . ' SA INSTITUCION DE BANCA MULTIPLE, GRUPO FINANCIERO SANTANDER MEXICO', 'rfcReceptor' => 'AUAC920422D38', 'nombreReceptor' => 'CESAR RENE AGUILERA ARREOLA', 'fechaEmision' => '2019-03-31T02:04:46', 'fechaCertificacion' => '2019-03-31T02:05:15', 'pacCertifico' => 'INT020124V62', 'total' => '$0.00', 'efectoComprobante' => 'Ingreso', 'estatusCancelacion' => 'Cancelable sin aceptación', 'estadoComprobante' => 'Vigente', 'estatusProcesoCancelacion' => '', 'fechaProcesoCancelacion' => '', 'rfcACuentaTerceros' => 'ABC010101AAA', 'motivoCancelacion' => '', 'folioSustitucion' => '', ], ]; $this->assertTrue($data->has($expectedUuid)); $document = $data->get($expectedUuid); foreach ($expectedData[$expectedUuid] as $key => $value) { $this->assertTrue($document->has($key)); $this->assertSame($value, $document->get($key)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function files_id_get($resource=\".files_meta\", $uuid) { // read one\n return resource_id_get($resource, $uuid);\n}", "function __getSeed($filename, $uuid=null) {\n \treturn '-';\t\n }", "public static function uuid() {}", "public function testUuid(): void\n {\n $regex = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i';\n $this->assertTrue((bool) preg_match($regex, $this->user->getUuid()));\n }", "function uniqFile($id,$filename,$ext) {\n $file = md5($filename).\"\".uniqid($filename, true);\n return \"pro\".$id.\"\".md5($file).\"le.\".$ext ;\n }", "public function uuid();", "public function uuid();", "function hook_uuid_id_uri_data($data) {\n}", "function hook_uuid_uri_data($data) {\n}", "function hook_uuid_uri_data($data) {\n}", "public function getUuid(): string;", "public function testNewModelWithUuidGenerator() {\n \n $this->loadClass('sample_UuidRecord');\n $session = $this->getSampleProjectSession(true);\n $record = $session->add(new sample_UuidRecord());\n \n $session->flush();\n \n $this->assertTrue(preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $record->recordId, $matches) == 1);\n \n }", "protected function _updateFileIdentifier() {}", "private function idCreate() {\n\t\twhile ($id = '') {\n\t\t\t// Create a random string\n\t\t\t$str = substr( str_shuffle( $this->init['id']['chars'] ), 0, $this->init['id']['length'] );\n\t\t\t// If the file exists\n\t\t\tif ( file_exists( $this->init['path']['data'] . $str . $this->init['data']['ext'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function uuid(){ }", "private function uuid(){\n return uniqid('');\n }", "function IsUuid($data)\n{\n return preg_match('/^[a-f\\d]{8}-(?:[a-f\\d]{4}-){3}[a-f\\d]{12}$/i', $data);\n}", "public function getDataWithTypeFileReturnsUidOfFileObject() {}", "private function uuid()\n {\n $data = random_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40);\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80);\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "function wp_generate_uuid4()\n {\n }", "public function get_uuid() \n {\n return $this->uuid;\n }", "private function uuid4():string {\n\t\t$uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t# 32 bits for \"time_low\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\t# 16 bits for \"time_mid\"\n\t\t\tmt_rand(0, 0xffff),\n\t\t\t# 16 bits for \"time_hi_and_version\",\n\t\t\t# four most significant bits holds version number 4\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\t# 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t# 8 bits for \"clk_seq_low\",\n\t\t\t# two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\t# 48 bits for \"node\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t\treturn str_replace('-', '', $uuid);\n\t}", "public function valid_uuid(): void\n {\n $uuid = UUID::generate();\n\n $pattern = '/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i';\n $this->assertNotFalse(preg_match_all($pattern, (string) $uuid));\n }", "function hook_uuid_sync() {\n // Do what you need to do to generate missing UUIDs for you implementation.\n}", "public function uuid() : Uuid;", "public function getUuid()\n {\n return isset($this->source['uuid']) ? $this->source['uuid'] : null;\n }", "private function generateFileUID( $table ) {\n $today = date( 'Ymd' );\n $array = glob( $this->path . trim( $table, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . $today . ( $this->gzip ? '*.dat.gz' : '*.dat' ) );\n\n if( !empty( $array ) ) {\n natsort( $array );\n\n $last = basename( end( $array ), ( $this->gzip ? '.dat.gz' : '.dat' ) );\n $date = substr( $last, 0, 8 );\n $dec = base_convert( substr( $last, 8 ), 36, 10 );\n\n // Overflow\n if( $dec >= 2821109907455 )\n throw new \\OverflowException( \"File UID ($last) overflow\" );\n\n $id = sprintf( \"%8s%08s\", $today, base_convert( ( $dec + 1 ), 10, 36 ) );\n }\n else {\n $id = sprintf( \"%8s%08s\", $today, base_convert( 1, 10, 36 ) );\n }\n\n return $id;\n }", "public function getUuid();", "function get_uuid() {\n\t\t$t = explode(\" \", microtime());\n\t\treturn sprintf('%04x%04x-%04x-%08s-%08s-%04s',\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), \n\t\tmt_rand(1, 0xffff), mt_rand(1, 0xffff), \n\t\tgetmypid(),\n\t\tsubstr(\"00000000\" . dechex($t[1]), -8), // get 8HEX of unixtime\n\t\tsubstr(\"0000\" . dechex(round($t[0] * 65536)), -4) // get 4HEX of microtime\n\t\t);\n\t}", "private static function gen_uuid() {\n\t\t/*\n\t\t * Generates a v4 UUID\n\t\t * \n\t\t */\n\t\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t// 32 bits for \"time_low\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_mid\"\n\t\t\tmt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t// four most significant bits holds version number 4\n\t\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\n\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\n\t\t\t// 48 bits for \"node\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n\t\t);\n\t}" ]
[ "0.6127566", "0.6116905", "0.6082378", "0.59926337", "0.5893623", "0.5859925", "0.5859925", "0.58578855", "0.5844705", "0.5844705", "0.57949317", "0.57918817", "0.5782084", "0.57363075", "0.572623", "0.565729", "0.56490684", "0.5627418", "0.56027", "0.558304", "0.55761766", "0.5573975", "0.5570883", "0.5561557", "0.5529127", "0.55227596", "0.55131793", "0.54924196", "0.546924", "0.54546535" ]
0.64943606
0
/ Smarty plugin File: function.set.php Type: function Name: set Purpose: set a variable
function smarty_function_set($params, &$smarty) { // if an array is to create if (substr($params['value'], 0, 6) == "array(") eval("\$params['value'] = " . str_replace('"', '', $params['value']) . ";"); if (!isset($params['var'])) { $smarty->trigger_error("set: missing 'var' parameter", E_USER_WARNING); return; } // Functions permitted in "if" parameter $functionsPermitted = array('empty', '!empty', 'is_null', '!is_null', 'isset', '!isset', 'is_void'); if (!isset($params['value'])) { $smarty->assign($params['var'], null); // clean setting return; } elseif (isset($params['if'])) { // Setting with "if" parameter if (in_array($params['if'], $functionsPermitted)) { $var = $smarty->get_template_vars($params['var']); echo "aa=".$var."<br>"; switch ($params['if']) { case "is_void": if (empty($var) and ($var !== 0) and ($var !== '0')) $smarty->assign($params['var'], $params['value']); break; case "empty": if (empty($params['var'])) $smarty->assign($params['var'], $params['value']); break; case "!empty": if (!empty($params['var'])) $smarty->assign($params['var'], $params['value']); break; case "is_null": if (is_null($params['var'])) $smarty->assign($params['var'], $params['value']); break; case "!is_null": if (!is_null($params['var'])) $smarty->assign($params['var'], $params['value']); break; case "isset": if (isset($params['var'])) $smarty->assign($params['var'], $params['value']); break; case "!isset": if (!isset($params['var'])) $smarty->assign($params['var'], $params['value']); break; } } else { $smarty->trigger_error("set: 'if' parameter not valid", E_USER_WARNING); } } else { // normal setting $smarty->assign($params['var'], $params['value']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($variable, $value);", "function set_var($name, $value){ // set the template variable\n\tif (func_num_args()> 2){\n\t\tif (!$this->in_vars($name)) $this->vars[$name] = array();\n\t\t$this->vars[$name][func_get_arg(2)] = $value;\n\t} else $this->vars[$name] = $value;\n}", "function testSetVariable()\n {\n $result = $this->tpl->setTemplate('{placeholder1} {placeholder2} {placeholder3}', true, true);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error setting template: '. $result->getMessage());\n }\n // \"scalar\" call\n $this->tpl->setVariable('placeholder1', 'var1');\n // array call\n $this->tpl->setVariable(array(\n 'placeholder2' => 'var2',\n 'placeholder3' => 'var3'\n ));\n $this->assertEquals('var1 var2 var3', $this->tpl->get());\n }", "public function set($var, $value){\n\t\t\t$this->template_vars[$var] = $value;\n\t\t}", "public function set($n,$v){\n\t\t$this->Template->set($n, $v);\n\t}", "function set($name, $value)\n {\n $this->_template->set($name, $value);\n }", "function set($name, $value){\n\t\t$this->vars[$name] = $value;\n\t}", "function set($name, $value) {\n $args = func_get_args();\n $cnt = count($args);\n // we check for odd number of args => missing values...\n if ($cnt % 2 == 0 && $cnt >= 2 ) {\n for ($i=0; $i < $cnt; $i += 2) {\n $name = $args[$i];\n $value = $args[$i + 1];\n $this->vars[$name] = ($value instanceof Template) ? $value->fetch() : $value;\n }\n } \n }", "function smarty_function_dotbvar_teamset($params, &$smarty) {\n $sfh = new DotbFieldHandler();\n $dotbField = $sfh->getDotbField('Teamset');\n return $dotbField->render($params, $smarty);\n}", "public function setVar($key, $value);", "function smarty_function_sugarvar_teamset($params, &$smarty) {\n $sfh = new SugarFieldHandler();\n $sugarField = $sfh->getSugarField('Teamset');\n return $sugarField->render($params, $smarty);\n}", "function set($name, $value) {\n $this->vars[$name] = $value; //is_object($value) ? $value->fetch() : $value;\n }", "function simple_set_value( $pFeature, $pPackageName = NULL ) {\n\tglobal $_REQUEST, $gBitSystem, $gBitSmarty;\n\tif( isset( $_REQUEST[$pFeature] ) ) {\n\t\t$gBitSystem->storeConfig( $pFeature, $_REQUEST[$pFeature], $pPackageName );\n\t\t$gBitSmarty->assign( $pFeature, $_REQUEST[$pFeature] );\n\t}\n}", "public function __set($_name, $_value);", "protected static function assign($key, $value) { self::$smarty->assign($key, $value); }", "public function set( $option, $value );", "public function set($parameter, $value);", "public function __set($key, $val)\n {\n\t\t$this->_setSmartyParams($key, $val);\n }", "function Assign($tpl_var, $value = null)\n {\n $this->_smarty->assign( $tpl_var, $value );\n }", "public static function assign($key,$value) {\r\n\t\tself::$_smarty->assignGlobal($key,$value);\r\n\t}", "public function assign($name,$value);", "function assign_to($tpl, $key, $value = null)\n\t{\n\t\t$this->data[$tpl]->assign($key, $value);\n\t}", "function set_data($name, $value)\n {\n }", "public function __set($param, $value);", "public function __set($var, $val) {\n\t\t$this->view_variables[$var] = $val;\n\t}", "function drush_variable_realm_set($realm_name, $realm_key, $variable_name, $value) {\n variable_realm_set($realm_name, $realm_key, $variable_name, $value);\n drush_print('Variable set.');\n}", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "function variant_set($variant, $value) {}", "function set($key, $value);", "function set($key, $value);" ]
[ "0.7084304", "0.7051902", "0.6641909", "0.663742", "0.6556279", "0.6314208", "0.6253499", "0.62321454", "0.6225774", "0.62167346", "0.619909", "0.61985904", "0.61957854", "0.6175531", "0.6111055", "0.6111023", "0.61055166", "0.60730654", "0.6067533", "0.60530436", "0.60393184", "0.6035298", "0.6030102", "0.602885", "0.6028338", "0.6014982", "0.5986646", "0.59600884", "0.5955247", "0.5955247" ]
0.70628375
1