This file contains hidden or 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
<script type="text/javascript" src="/site_assets/js/cycle.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$("#featured_slideshow").hover( | |
function() { $("#slides").cycle("pause"); $("#controls").stop().fadeTo("normal", 1); }, | |
function() { $("#slides").cycle("resume"); $("#controls").stop().fadeTo("normal", 0); } | |
); | |
$("#slides").cycle({ |
This file contains hidden or 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 $pagination = $("#demo1 ul"); | |
$pagination.delegate('.jPag-current', 'click', function() { | |
var $$this = $(this); | |
$$this.closest('li').addClass('cached'); | |
$pagination.find("#currentPage").removeAttr('id').wrapInner($('<a>', {'class':'pagenumbers', 'href':'book_data.php?keywords='+keywords})); | |
$$this.closest('li').attr('id','currentPage').html( $$this.text() ); | |
$.ajax({ | |
type : "GET", | |
cache : false, |
This file contains hidden or 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
{!-- | |
This script is useful for grabbing the number of entries under a category | |
--} | |
{exp:weblog:categories weblog="faq" style="nested" show_empty="yes"} | |
<h2>{category_name}</h2> | |
{exp:query sql="SELECT count(exp_category_posts.entry_id) AS post_count FROM exp_category_posts WHERE exp_category_posts.cat_id = {category_id}"} | |
<h4>{post_count} Question(s)</h4> | |
{/exp:query} |
This file contains hidden or 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 | |
global $IN; | |
// Getting the last segment of the URL | |
if (sizeof($IN->SEGS) > 1) { | |
$last_seg = ($IN->QSTR == 'index') ? $IN->SEGS[sizeof($IN->SEGS)-1] : $IN->QSTR; | |
} else if (sizeof($IN->SEGS) == 0) { | |
$last_seg = "home"; | |
} |
This file contains hidden or 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
$.fn.trigger = function (type) { if (type == 'click') return false; return this.trigger (type); } |
This file contains hidden or 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
$.YQL = function(query, callback) { | |
if (!query || !callback) { | |
throw new Error('$.YQL(): query or callback are undefined'); | |
} | |
var encodedQuery = encodeURIComponent(query.toLowerCase()), | |
url = 'http://query.yahooapis.com/v1/public/yql?q=' | |
+ encodedQuery + '&format=json&callback=?'; | |
$.getJSON(url, callback); | |
}; |
This file contains hidden or 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
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script> | |
<script type="text/javascript"> | |
if (typeof jQuery == 'undefined') { | |
document.write(unescape("%3Cscript src='/js/jquery-1.4.2.min.js' type='text/javascript'%3E%3C/script%3E")); | |
} | |
</script> |
This file contains hidden or 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
# Copyright 2009 Michael Ivey, released to public domain | |
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master | |
# I wanted it to run from MySQL and command line, instead of a Sinatra app | |
require 'rubygems' | |
require 'rest_client' | |
require 'json' | |
require 'sequel' | |
disqus_url = 'http://disqus.com/api' |
This file contains hidden or 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
//EXAMPLE CODE FROM MY BOOK PROJECT: | |
$data = array(); | |
foreach ($entries->rows as $index=>$e) { | |
if(array_key_exists('title', $e['value'])){ | |
// checking if the id of the book has already been met | |
if ( isset($data[$e['id']]) ) { |
This file contains hidden or 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
<div class="coda-slider-wrapper" id="sliderContainer"> | |
<div class="backgroundWrapper"> | |
{exp:weblog:entries weblog="{embed:section}" disable="categories|member_data|pagination|trackbacks" dynamic="off"} | |
<div class="coda-slider preload slider" id="coda-slider-{count}"> | |
{if gallery_images != ""} | |
{gallery_images} | |
{if image != ""} | |
<div class="panel"> |
OlderNewer