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 | |
if($_POST) { | |
$action_limit = 2 * 1000; // Should match the action_limit set in the script | |
$return = array('new_total' => 0); | |
// Do something here to get the user's current points | |
$previous_total = 0; | |
// DEMO STUFF | |
$previous_total = $_COOKIE['points']; | |
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="points"></div> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="jquery.interactionPoints.js"></script> | |
<script> | |
$(function() { | |
// Initialize the User Interaction Points jQuery Plugin | |
$('.points').interactionPoints({ | |
url: 'your-script-here.php', // The URL the points get posted to, required | |
container: window, // The element to track interactions on | |
value: 1, // The amount of points each second is worth |
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
#overlay { | |
display: block; | |
position: fixed; | |
z-index: 999; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: rgba(0, 0, 0, .5); | |
} |
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 id="your-content"> | |
<h3 class="title">Traffic Pop jQuery Plugin</h3> | |
<div class="mid"> | |
You content here (ex. social network sharing buttons) | |
</div> | |
</div> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="jquery.trafficPop.js"></script> | |
<script> | |
$(function() { |
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
body { font-family: Arial, 'DejaVu Sans', 'Liberation Sans', Freesans, sans-serif } | |
.prettyfied-select { | |
height: 33px; | |
display: inline-block; | |
min-width: 200px; | |
position: relative; | |
background: #eee; | |
} |
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
(function( $ ) { | |
$( "select.prettyfied" ).each( function() { | |
var $select = $( this ), | |
$container = $( "<div>", { | |
width: $select.outerWidth(), | |
className: "prettyfied-select", | |
html: '<div class="prettyfied-select-box"><span></span></div>', | |
}), | |
$dropDown = $( "<ul>", { | |
className: "dropDown", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Coding Deliciously Styled Dropdown Select Lists | A Demo by Ben Marshall</title> | |
<link rel="stylesheet" href="assets/css/styles.css"> | |
</head> | |
<body> | |
<form method="post" action="#"> | |
<select name="prettyfied" class="prettyfied"> |
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 | |
$api = new Mozscape_API_Class( 'accessId', 'secretKey' ); | |
// Outputs the Mozscape logo | |
echo $api->attributionLink( 'logo', 'lg' ); | |
echo $api->attributionLink( 'logo', 'med' ); | |
echo $api->attributionLink( 'logo', 'sm' ); | |
echo $api->attributionLink( 'logo', 'xlg' ); | |
// Outputs the Mozscape icon |
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 | |
$top_pages = $api->topPages( 'www.benmarshall.me' ); | |
print_r( $top_pages ); |
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 | |
$api = new Mozscape_API_Class( 'accessId', 'secretKey' ); | |
echo $api->responseFields( 'ut', 'name' ); // Returns 'Title' | |
echo $api->responseFields( 'ut', 'description' ); // Returns 'The title of the page if available. For example: "Request-Response Format"' | |
echo $api->responseFields( 'ut', 'bit_flag' ); // Returns '1' | |
echo $api->responseFields( 'ut', 'slug' ); // Returns 'title' | |
echo $api->responseFields( 'ut', 'free' ); // Returns 'yes' |