This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function close_print(){ | |
var beforePrint = function() { | |
console.log('Functionality to run before printing.'); | |
}; | |
var afterPrint = function() { | |
//console.log('Functionality to run after printing'); | |
$("#animal_menu, .single-subnav, #footer-credits-wrap, #mainpage-header, #print_button, .legend").show(); | |
$(".park_map_page").css("width", 1170); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$view_counter = 0; | |
if(CModule::IncludeModule("iblock")){ | |
CIBlockElement::CounterInc($item["ID"]); | |
$res = CIBlockElement::GetByID($item["ID"]); | |
if($ar_res = $res->GetNext()){ | |
$view_counter = $ar_res['SHOW_COUNTER']; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db_props = CIBlockElement::GetProperty($item["IBLOCK_ID"], $item["ID"], "sort", "asc", array()); | |
$PROPS = array(); | |
while($ar_props = $db_props->Fetch()){ | |
$PROPS[$ar_props['CODE']] = $ar_props['VALUE']; | |
echo $PROPS[$ar_props['CODE']] . "<br />"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = '|f|oo||'; | |
var y = x.replace(/^\|+|\|+$/g, ''); | |
document.write(x + '<br />' + y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.sitepoint.com/create-a-wordpress-theme-settings-page-with-the-settings-api/ | |
function theme_settings_page() | |
{ | |
?> | |
<div class="wrap"> | |
<h1>Настройка темы</h1> | |
<form method="post" action="options.php"> | |
<?php | |
settings_fields("section"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURLParameter(name) { | |
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null; | |
} | |
myvar = getURLParameter('myvar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "<pre>"; | |
print_r($this->_item->getRelatedCategories(true)); | |
echo "</pre>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidEmailAddress(emailAddress) { | |
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); | |
return pattern.test(emailAddress); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app = JFactory::getApplication(); | |
$menu = $app->getMenu(); | |
if ($menu->getActive() == $menu->getDefault()) { | |
echo 'This is the front page'; | |
} |