Skip to content

Instantly share code, notes, and snippets.

Shane Bill shaneonabike

Block or report user

Report or block shaneonabike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Drupal Search Index blocks
SELECT n.nid FROM node n LEFT JOIN search_dataset d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid asc;
View popup.js
jQuery(function($) {
// Scroll the popup with the user
$(window).scroll(function() {
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupWidth = $("#likeus").width();
var popupHeight = $("#likeus").height();
var topPopup = windowHeight * 2 / 3 + $(window).scrollTop();
var leftPopup = windowWidth - popupWidth;
View popup.css
/**
* Like Us Popup CSS
*/
#likeus {
width:342px;
height:170px;
border: 1px solid #666;
background-color:#fff;
-webkit-box-shadow: 0 0 16px #666;
box-shadow: 0 0 16px #666;
@shaneonabike
shaneonabike / page.html
Last active Sep 11, 2018
Popup code body
View page.html
<div id="likeus"><div id="likeus-wrapper">
<div id="likeus-banner">&nbsp;</div>
<div id="likeus-inner">
<h2>Join us on Facebook</h2>
<div class="fb-like" width="300" data-href="http://www.facebook.com/yourpath" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
<div id="likeus-close-wrapper">
<a href="#likeus" class="close-like">Close</a> ·
<a href="#likeus"> class="close-forever">I already like Bees on a Bike</a>
</div>
</div>
@shaneonabike
shaneonabike / template.php
Created Sep 11, 2018
Drupal Timefield exposed filter integration (template.php)
View template.php
/**
* Preprocess output of form element
*
*/
function yourtheme_preprocess_form_element(&$vars) {
if (!empty($vars['element']['#id']) && ($vars['element']['#id'] == 'edit-hour')) {
// Add special class for JS to work properly but we need to edit the #children value :/
$children = $vars['element']['#children'];
if (!empty($children)) {
$vars['element']['#children'] = str_replace('form-text', 'form-text edit-timefield-timepicker filter-project-event-time', $children);
@shaneonabike
shaneonabike / yourmodule.module
Created Sep 11, 2018
Drupal Timefield exposed filter
View yourmodule.module
<?php
/**
* Alter the exposed form for the projects view
*
* $form
* Relative form that is being created
* $form_state
* Existing statee
*/
You can’t perform that action at this time.