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 sendFeedback() { | |
$.post('url_to_post.php', | |
$('#feedbackForm').serialize(), function(data) { | |
var datamsg = data.split('!'); | |
$('#message-area').hide(); | |
if (datamsg[0] != 'Ошибка') { | |
// messages | |
$('#message-area').removeClass('error'); | |
$('#message-area').addClass('success').show('slow'); | |
} else { |
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
if ($_SERVER['REQUEST_METHOD'] == "POST") | |
{ | |
$user_name = trim($_POST['name']); | |
$user_email = trim($_POST['email']); | |
$user_message = trim($_POST['message']); | |
$action = trim($_POST['action']); | |
if (strlen($user_name) == 0) { echo "Error! Представьтесь, пожалуйста."; exit(); } | |
if (strlen($user_email) == 0) { echo "Error! Введите ваш емайл."; exit(); } | |
if (strlen($user_message) == 0) { echo "Error! Сообщение не может быть пустым."; exit(); } |
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
$(document).ready(function() { | |
var sidebarHeight = $("#sidebar").height(); | |
var contentHeight = $("#workarea").height(); | |
if (contentHeight > sidebarHeight) { | |
$("#sidebar").height(contentHeight).slideDown("slow"); | |
} | |
}); |
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 breadcrumbs() { | |
#### Пример: | |
#### <a href="#">Главная</a> » <a href="#">Название Категории</a> » Название записи | |
# Predefined variables | |
#global $wp, $post; | |
$link_EOS = '<a href="'; | |
$link_CON = '">'; | |
$link_EOF = '</a>'; | |
$sep = " » "; # important to put it between two spaces |
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
add_filter( 'wp_get_attachment_link', 'add_fancybox_rel'); | |
function add_fancybox_rel ($content) { | |
// add checks if you want to add prettyPhoto on certain places (archives etc). | |
return str_replace('<a', '<a rel="fancybox"', $content); | |
} |
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
# Rewrite <title> tag for better SEO | |
function seo_title() { | |
global $post, $page, $paged; | |
$sep = " | "; # Separator | |
$newtitle = get_bloginfo('name'); # Default | |
# Single page ######################################## | |
if (is_single() || is_page()) { | |
$newtitle = single_post_title("", false); # default title | |
} |
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
<meta name='keywords' content='<?php echo $keywords; ?>' /> | |
<meta name='description' content='<?php echo $description; ?>' /> |
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
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib |
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
class DiscogsController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :check_admin | |
before_filter do | |
@discogs = Discogs::Wrapper.new("APP_NAME", access_token: session[:access_token]) | |
end | |
def index | |
@items_with_discogs = Item.all # Items should have discogs_release_id |
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
def check_payment_status | |
# Prepare for search collection | |
search_hash = { external_reference: params[:id] } | |
####################################### INIT MERCADOPAGO API | |
client_id = 'xxxxx' | |
client_secret = 'xxxxxxx' | |
mp_client = MercadoPago::Client.new(client_id, client_secret) | |
hash = mp_client.search(search_hash) |
OlderNewer