Skip to content

Instantly share code, notes, and snippets.

@luisciphere
luisciphere / Bootstrap Table CSS
Last active August 29, 2023 06:06
Bootstrap tables only css
.table {
width: 100%;
max-width: 100%;
margin-bottom: 1rem;
}
.table th,
.table td {
padding: 0.75rem;
vertical-align: top;
@luisciphere
luisciphere / AJAX Form Example
Created October 2, 2017 21:55
Simple jQuery ajax request
function ajax() {
var msg = $(".register").serialize();
$.ajax({
type: "POST",
url: "./mail.php",
data: msg,
success: function(data) {
$('#results').html(data);
console.log('форма отправлена');
},
@luisciphere
luisciphere / gulp-directory-template.md
Created October 3, 2017 13:50 — forked from Inclushe/gulp-directory-template.md
Gulpfile using Stylus, Pug, Browsersync, and Browserify.

Directory Template

📁 src
  📁 assets
    📁 images
    📁 videos
  📁 js
  📁 pug
 📁 templates
ERROR - 2017-10-04 22:38:21 --> Severity: Notice --> Undefined index: country /var/www/bookiefree.com/www/application/models/users_data.php 784
ERROR - 2017-10-04 22:38:21 --> Severity: Notice --> Undefined index: russian /var/www/bookiefree.com/www/application/models/users_data.php 785
ERROR - 2017-10-04 22:38:21 --> Severity: Warning --> Cannot use a scalar value as an array /var/www/bookiefree.com/www/application/models/users_data.php 782
$('.sub-menu').hide ();
$('.mainmenu li').hover (
function () {
$(this).addClass('active');
$('ul:first', this).fadeIn ();
},
function () {
$(this).removeClass('active');
<!-- Menu edits temp -->
<?php
$logheight = get_field('logo_height', 'option');
$btnheight = 40 + $logheight;
?>
<style media="screen">
.header-logo {
height: <?php echo $logheight; ?>px;
}
.menu-toggle {
<?php
/*
* Тут мы будем обрабатывать ошибки и выводить соответствующие сообщения
*/
if( isset( $_GET['msg'] ) ) {
// в случае успеха
if( $_GET['msg'] == 'success' )
echo '<span>Сообщение успешно отправлено</span>';
<?php
// проверка на спам - просто прерываем выполнение кода, при желании можно и сообщение спамерам вывести
if( isset( $_POST['comment'] ) || isset( $_POST['message'] ) )
exit;
// подключаем WP, можно конечно обойтись без этого, но зачем?
require( dirname(__FILE__) . '/wp-load.php');
$name = ($_POST['name']) ? $_POST['name'] : '';
$email = ($_POST['email'] && is_email( $_POST['email'] )) ? $_POST['email'] : '';