Items
Nodes Posts Things
Blocks
items_blocks.tpl.php
-
Login redirect
<?php
function HOOK_user_login_submit( $form, &$form_state ){
$form_state["redirect"] = "";
}
function HOOK_form_user_login_alter( &$form, $form_state ){
$form["#submit"][] = "HOOK_user_login_submit";
}
?>...
Code
Template Coding
Drupal
2013
-
Make Drupal Module Most Important
So other modules don't supersede your module, run this code once.
<?php
db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'");
?>...
Code
Template Coding
Drupal
2013
-
Image Desaturation Effect
.box img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'>
<filter id=\'grayscale\'>
<feColorMatrix type=\'saturate\' values=\'0.5\'/>
</filter>
</svg>#grayscale");
filter: gray alpha(opacity=50);
-webkit-filter: grayscale(50%);
-webkit-transfo...
Stylesheet Coding
Code
2013
-
Slideshow
HTML
<div id="photos_rotator">
<ul>
<li>
<a href="/node/15">
<span class="title">003</span>
</a>
<div class="rotator_full"><img src="003_0.jpg" alt=""/></div>
</li>
<li>
<a href="/node/14">
<span class="t...
JavaScript
Stylesheet Coding
Code
JQuery
2013
-
Webcam Image Refresher
HTML
<img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div>
JavaScript
function refreshCam(id, file) {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
document.getElementById(id).src = file + "?time="+h+m+s;
setTime...
JavaScript
Code
2013
-
AJAX Remote Read, Local Write
w/JavaScript
//the callback function run after loading JSONp below
function test_results_loaded(data){
//post data to a service via ajax
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://orgnsm@orgnsm.org:lkAGWUE01H@orgnsm.testrail.com//index.php?/api/v2/add_result/1", true);
xhr.setRequestHeader('Cont...
Code
JavaScript
JQuery
2013
-
DOM Inject and Add Event
w/JavaScript
window.onload = function(){
//create new button
var btn = document.createElement("a");
btn.setAttribute("id", "addedbutton");
var btntxt = document.createTextNode("Run Me");
btn.appendChild(btntxt);
//inject new button
document.getElementById("sidebar").appendChild(btn);
//add event to ...
Code
JavaScript
JQuery
2013
-
Pagination Logic
<?php
$items = array(
0 => array( "item 1", "2013-09-13", "1" ),
1 => array( "item 2", "2013-09-14", "2" ),
2 => array( "item 3", "2013-09-15", "3" ),
);
######## CALCULATIONS #########
# set per-page var
if (isset($_GET["perpage"])) $perpage = $_GET["perpage"];
else $perpage = 10;
# calc ...
Code
Template Coding
PHP
2013
-
Device-Responsive Layout
HTML
<meta name="viewport" content="width=device-width, initial-scale=1.0;"/>
CSS
@media (max-width: 480px){
}
@media (max-width: 767px){
#container{
padding: 0 25px;
}
nav ul li a{
font-size: 100%;
padding: 15px 0;
border-radius: 30px;
}
nav ul li ...
Stylesheet Coding
Code
2013
-
Dynamic Form Submission
The JavaScript
jQuery(function($){
$("#contact").submit(function(){
//grab form values before blowing it out of the DOM in the next line
values=$(this).serialize();
$("#contact").html( "<p>Sending message...</p>\n" );
//send the values to the PHP handler
$.aja...
Code
JavaScript
PHP
JQuery
2013
-
Read and Process RSS
<?php
function getRSS( $url ){
$cobj = curl_init( $url );
curl_setopt( $cobj, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $cobj, CURLOPT_CONNECTTIMEOUT, 0 );//0 = no timeout
$tumblr_raw = curl_exec( $cobj );
curl_close( $cobj );
if( $tumblr_raw ){
$tumblr_xml = new DOMDocument();
$tumblr_xml->lo...
Code
Template Coding
2013
-
La Picolla Scolla Italia
Italian Preschool Information
Layout & Typography, Semantic XHTML content structuring, Site Template & Request Handler, Flash & GoogleMaps Embedding...
Stylesheet Coding
Information Structuring
Template Coding
JavaScript
Work
2013
-
Incubator
Artwork Project Archive
Typography & Layout, Content Structuring, UI/X Design, Interactivity & Sorting...
Work
Stylesheet Coding
Information Structuring
Graphic Design
Template Coding
JavaScript
Drupal
Organic Connectivity Module
2013
-
Jellyfish Frequency
Record Label Website
Work
Template Coding
Information Structuring
Stylesheet Coding
Drupal
2012
-
Attributes
Types
2012
3
-
Page Layout Method
HTML
<div id="hub">
<div id="content1" class="column">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tatio...
Code
Information Structuring
Stylesheet Coding
2012
-
Stylesheet Switcher
Style Links HTML
<link rel="alternate stylesheet" type="text/css" href="/theme/KATALOG/style.css" title="KATALOG"/>
<link rel="alternate stylesheet" type="text/css" href="/theme/SCREEN/style.css" title="SCREEN"/>
<link rel="alternate stylesheet" type="text/css" href="/theme/spaeci...
JavaScript
Code
2012
-
BossaNova Robotics
Robot Toy Product Promotion
Site Request Handler, Framework for loading XML content from Flash nav click. Flash, GoogleMaps and YouTube Embedding....
Stylesheet Coding
Template Coding
JavaScript
Work
2011
-
TiedyeJohn
Tiedye Artist Examples and Ordering
Stylesheet Coding
Template Coding
JavaScript
Information Structuring
Work
Drupal
Graphic Design
2011
-
Kimochis Portal
Forum for Users of Educational Toys
Work
Stylesheet Coding
Information Structuring
Template Coding
Drupal
2011
-
Frameworks
...
Macintosh
Attributes
Types
Topics
Topics
2011
7
4
-
IAS
Data Management Services Promotion
Salesforce Form Submission Connectivity, AJaX Content Filtering, Flash Video Embedding...
Stylesheet Coding
Information Structuring
Template Coding
JavaScript
Work
Drupal
2011
-
PaulBird.tv
Mixed Martial Arts Fighter Information & Media
Layout & Typography, DrupalNodes, DrupalBlocks, UI Design/Background Art, DrupalViews Templates, YouTube Embedding...
Work
Stylesheet Coding
Information Structuring
Graphic Design
Template Coding
JavaScript
Drupal
2011
-
777
Dimensionality Study Tool
Work
Information Structuring
Template Coding
Stylesheet Coding
Drupal
Organic Connectivity Module
Graphic Design
2011
-
Organic Interfaces
Portfolio Website
Work
Information Structuring
Template Coding
Stylesheet Coding
Graphic Design
Drupal
Organic Connectivity Module
2011
-
Luscious Hawaiian
Natural Island Food Products
Graphic Design
Template Coding
Stylesheet Coding
Work
2011
-
N.i. Portfolio
Website Work Portfolio & Team Biographies
Layout & Typography, Request Handler & Site Template ((This is an "HTML Version" of their main Flash site - the PHP template uses the same XML data as the Flash site)), XML...
Work
Stylesheet Coding
Template Coding
Information Structuring
Google
2011
-
Visionary Sports Group
Athlete Management
Work
Information Structuring
Template Coding
Stylesheet Coding
Drupal
2011
-
Interactivity
Disciplines
Topics
2011
1
-
Layout & Typography
Disciplines
Topics
2011
2
-
Content Strategy
Storing and retrieving information
Disciplines
Topics
2011
2
-
RosaPharma
Pharmaceutical Development Services Information
Layout, Typography & Navigation, Semantic XHTML, Site Template & Request Handler [custom built with PHP], drop-down navigation...
Stylesheet Coding
Information Structuring
Template Coding
JavaScript
Work
2010
-
Ouroboros
Inspirational Imagery Archive
Work
Information Structuring
Stylesheet Coding
Template Coding
Drupal
Organic Connectivity Module
Graphic Design
2010
-
Business Researchers
Business Strategy Services Information
Layout & Typography, Site Template & Request Handler, Animated Dropdown Menus, Google Maps Embed, Flash Embed
See also: businessresearchers.com...
Work
Stylesheet Coding
Template Coding
JavaScript
2010
-
Drupal
<?php
function HOOK_user_insert( &$edit, &$account, $category = NULL ){
// Don't create a new username if one is already set
if( strpos($account->name, 'temporary_') !== 0)
return;
// O...
<?php
$page_menu_items = menu_tree_output(menu_tree_all_data("main-menu"));
echo( drupal_render($page_menu_items) );
?>...
Frameworks
Topics
Frameworks
2010
33
-
Radiesse
Dermal Product Information for Doctors & Patients
Helped with overall framework
built main XHTML+template
constructed the map section and before and after section
View this Site
radiesse.com
...
Work
Information Structuring
Stylesheet Coding
JavaScript
Template Coding
2010
-
Process
Information Gathering
Initial Concepting
Front-End & User Interface Design
Information Design & Systems Development
Front-end & UI Code
User Experience & Syste...
Topics
Topics
2010
0
-
FlipVideo
Digital Video Camera Information & Purchasing
...
Work
Stylesheet Coding
JavaScript
JQuery
2010
-
N.i. Extranet
[Internal + Client] Project Planning Platform
clients.native-instinct.com...
Work
Stylesheet Coding
Information Structuring
Template Coding
Drupal
2010
-
Resumé
Curriculum Vitæ
Topics
Topics
2010
0
-
Disciplines
...
Topics
Topics
Types
2010
3
0
-
Code
Snippets / Examples
see also: code.orgnsm.org for testable examples...
function obtain_entities_by_type($entity_type,$bundle,$limit=10,$offset=0,$subject_nid=FALSE){
$query=new EntityFieldQuery();
$query->entityCondition('entity_type', $entity_type)
->entityCondition...
w/JavaScript
window.onload = function(){
//create new button
var btn = document.createElement("a");
btn.setAttribute("id", "addedbutton");
var btntxt = document.createTextNode("Run Me");
btn.appendChild(btntxt)...
The JavaScript
jQuery(function($){
$("#contact").submit(function(){
//grab form values before blowing it out of the DOM in the next line
values=$(this).serialize();
$("#contact").html( "<...
Topics
Types
Topics
2010
0
39
-
Graphic Design
Interface Visuals
...
Layout & Typography
Topics
2010
21
-
JavaScript
AJaX & Motion
The JavaScript
jQuery(function($){
$("#contact").submit(function(){
//grab form values before blowing it out of the DOM in the next line
values=$(this).serialize();
$("#contact").html( "<...
Interactivity
Topics
2010
22
-
Stylesheet Coding
Information Presentation
...
Layout & Typography
Topics
2010
46
-
Information Structuring
Nodal Connectivity
...
Content Strategy
Topics
2010
28
-
Template Coding
Information Transmutation
...
<?php
function get_species_country($id_country) {
$inner = new EntityFieldQuery();
$inner_r = $inner->entityCondition('entity_type', 'field_collection_item')
->fieldCondition('field...
<?php
$items = array(
0 => array( "item 1", "2013-09-13", "1" ),
1 => array( "item 2", "2013-09-14", "2" ),
2 => array( "item 3", "2013-09-15", "3" ),
);
######## CALCULATIONS #########
# set per...
Content Strategy
Topics
2010
47
-
Amniot
Personal Journal / Progression Log / Public life document site / Homepage
Work
Information Structuring
Template Coding
Stylesheet Coding
Organic Connectivity Module
Graphic Design
2010
-
FlipVideo - Store
Store Updates for Designable Video cameras
Heavy amount of legacy updating
/XHTML for new sections
some ASP template work
...
Work
Stylesheet Coding
2010
-
Organic Planner
Private Notes & Organizational Tools
...
Work
Template Coding
Information Structuring
Stylesheet Coding
Drupal
Organic Connectivity Module
Graphic Design
2010
Nodes
items_nodes.tpl.php
-
Login redirect
Submitted by orgnsm on Thu, 11/21/2013 - 10:55Context:Connection:Attribute Type:Types<?php function HOOK_user_login_submit( $form, &$form_state ){ $form_state["redirect"] = ""; } function HOOK_form_user_login_alter( &$form, $form_state ){ $form["#submit"][] = "HOOK_user_login_submit"; } ?> -
Make Drupal Module Most Important
Submitted by orgnsm on Thu, 11/21/2013 - 10:43Context:Connection:Attribute Type:TypesSo other modules don't supersede your module, run this code once.<?php db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'"); ?> -
Image Desaturation Effect
Submitted by orgnsm on Thu, 09/19/2013 - 12:05Context:Connection:Attribute Type:Types.box img{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'0.5\'/> </filter> </svg>#grayscale"); filter: gray alpha(opacity=50); -webkit-filter: grayscale(50%); -webkit-transform: translateZ(0); } .box img:hover{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'1\'/> </filter> </svg>#grayscale"); -webkit-filter: grayscale(0%); } -
Slideshow
Submitted by orgnsm on Fri, 09/13/2013 - 18:33Context:Connection:Attribute Type:TypesHTML
<div id="photos_rotator"> <ul> <li> <a href="/node/15"> <span class="title">003</span> </a> <div class="rotator_full"><img src="003_0.jpg" alt=""/></div> </li> <li> <a href="/node/14"> <span class="title">002</span> </a> <div class="rotator_full"><img src="002_0.jpg" alt=""/></div> </li> <li> <a href="/node/13"> <span class="title">001</span> </a> <div class="rotator_full"><img src="001_0.jpg" alt=""/></div> </li> </ul> </div>JavaScript
jQuery(function($){ function processSlideshow( nextElem ){ currentElem = $("#photos_rotator ul li.selected"); if( !nextElem ){ currentElemIndex = $("#photos_rotator ul li").index(currentElem); nextElem = $('#photos_rotator ul li').get(currentElemIndex+1); if( !nextElem ) nextElem = $("#photos_rotator ul li").get(0); } //fade out $(currentElem).removeClass("selected"); $(currentElem).find(".rotator_full").css("left","-600px"); setTimeout(function(){ $(currentElem).find(".rotator_full").css("z-index","-2"); $(currentElem).find(".rotator_full").css("left","600px"); }, 700); //fade in $(nextElem).addClass("selected"); $(nextElem).find(".rotator_full").css("z-index","-1"); $(nextElem).find(".rotator_full").css("left","0"); } if( $("#photos_rotator").length ){ processSlideshow( $("#photos_rotator ul li").get(0) ); setInterval(function(){ processSlideshow(); }, 6000); $("#photos_rotator ul li a").click(function(){ processSlideshow( $(this).parent() ); return false; }); } });CSS
#photos_rotator{ position: relative; width: 600px; height: 400px; margin: 15px auto 0 auto; z-index: 0; overflow: hidden; } #photos_rotator ul{ list-style: none; padding: 0; margin: 0; width: 300px; padding: 370px 0 0 25px; } #photos_rotator ul:after{ content: ""; display: block; height: 0; clear: both; } #photos_rotator ul li{ float: left; width: 30px; height: 30px; } #photos_rotator ul li a{ display: block; height: 30px; line-height: 30px; text-align: center; text-decoration: none; } #photos_rotator ul li.selected a{ background-color: #2bd06a; -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; transition: all 0.5s ease; } #photos_rotator ul li .rotator_full{ z-index: -1; position: absolute; top: 0; left: 600px; -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; transition: all 0.5s ease; } -
Webcam Image Refresher
Submitted by orgnsm on Wed, 09/11/2013 - 12:54Context:Connection:Attribute Type:TypesHTML
<img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div>JavaScript
function refreshCam(id, file) { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); document.getElementById(id).src = file + "?time="+h+m+s; setTimeout('refreshCam("webcamImage","'+file+'")',10000); } window.onload = function(){ if( document.getElementById("webcamImage") ) refreshCam( "webcamImage","http://orgnsm.org/webcam.jpg" ); } -
AJAX Remote Read, Local Write
Submitted by orgnsm on Mon, 09/09/2013 - 10:36Context:Connection:Attribute Type:Typesw/JavaScript
//the callback function run after loading JSONp below function test_results_loaded(data){ //post data to a service via ajax var xhr = new XMLHttpRequest(); xhr.open("POST", "https://orgnsm@orgnsm.org:lkAGWUE01H@orgnsm.testrail.com//index.php?/api/v2/add_result/1", true); xhr.setRequestHeader('Content-Type', 'application/json;'); xhr.setRequestHeader('Accept', 'application/json;'); // send the collected data as JSON xhr.send(JSON.stringify({"status_id":"1"})); xhr.onloadend = function () { alert("Wrote test data"); }; } window.onload = function(){ //add event to a button that loads remote JSONp document.getElementById('loaderButton').onclick = function(){ var script = document.createElement('script'); script.src = 'http://shellfiche.anoml.net/test.php5?callback=test_results_loaded'; document.getElementsByTagName('head')[0].appendChild(script); } }w/JQuery
$(document).ready(function(){ $("#loaderButton").click(function(){ $.ajax({ url: 'http://shellfiche.anoml.net/test.php5', dataType: "jsonp", jsonpCallback: "callback", success: function( testreply ){ alert("Test results obtained.. Posting results..."); $.ajax({ url: 'https://orgnsm.testrail.com//index.php?/api/v2/add_result/1', username: "orgnsm@orgnsm.org", password: "lkAGWUE01H", contentType: "application/json;", accepts: "application/json;", dataType: "json", type: "POST", data: '{"status_id": "1"}', processData: "false", headers:{"Content-Type": "application/json;"}, beforeSend: function(jqXHR){ jqXHR.overrideMimeType("application/json;"); jqXHR.setRequestHeader("Accept", "application/json;"); }, success: function( postreply ){ alert("Wrote test data"); } }); } }); return false; }); }); -
DOM Inject and Add Event
Submitted by orgnsm on Mon, 09/09/2013 - 10:09Context:Connection:Attribute Type:Typesw/JavaScript
window.onload = function(){ //create new button var btn = document.createElement("a"); btn.setAttribute("id", "addedbutton"); var btntxt = document.createTextNode("Run Me"); btn.appendChild(btntxt); //inject new button document.getElementById("sidebar").appendChild(btn); //add event to new button document.getElementById('addedbutton').onclick = function(){ alert("Success"); } }w/JQuery
$(document).ready(function(){ var test = $("<a href='#'>Run Me</a>").click(function(){ alert("Success"); return false; }); $("body").append(test); }); -
Pagination Logic
Submitted by orgnsm on Tue, 08/27/2013 - 14:13Context:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/code/pagination.php<?php $items = array( 0 => array( "item 1", "2013-09-13", "1" ), 1 => array( "item 2", "2013-09-14", "2" ), 2 => array( "item 3", "2013-09-15", "3" ), ); ######## CALCULATIONS ######### # set per-page var if (isset($_GET["perpage"])) $perpage = $_GET["perpage"]; else $perpage = 10; # calc numb of pages $pages = ceil(count($items) / $perpage); # which page are we on? if( isset($_GET["page"]) && round($_GET["page"]) <= $pages && round($_GET["page"]) > 0 ) $page = round($_GET["page"]); else $page = 1; # calc start and end item $startItem = (($page - 1) * $perpage); $endItem = $startItem + ($perpage - 1); if( $endItem > $items ) $endItem = $endItem - ($endItem % $items); ######## PRINT ITEMS ######### echo( "<div>\n" ); echo( " <ul>\n"); for( $i=$startItem; $i<=$endItem; $i++ ){ echo( " <li>\n"); echo( " <a href=\"/node/".$items[$i][2]."\">\n"); echo( " <span class=\"title\">" . $items[$i][0] . "</span>\n" ); echo( " </a>\n" ); echo( " </li>\n" ); } echo( " </ul>\n" ); echo( "</div>\n\n" ); # print page links as: URL/?page=## echo("<ul class=\"pagination\">\n"); if( $page > 1 ) echo(" <li>"); echo(" <a href=\"?page=".($page-1)."&perpage=".$perpage."\" class=\"previous\">Previous</a>"); echo(" </li>\n"); for ($i=1; $i<=$pages; $i++) { if ($i == $page) { echo(" <li>"); echo(" <a href=\"?page=".$i."&perpage=".$perpage."\" class=\"active\">".$i."</a>"); echo(" </li>\n"); } else { echo(" <li>"); echo(" <a href=\"?page=".$i."&perpage=".$perpage."\">".$i."</a>"); echo(" </li>\n"); } } if( $page < $pages ) echo(" <li><a href=\"?page=".($page+1)."\" class=\"next\">Next</a></li>\n"); echo("</ul>\n\n"); ?> -
Device-Responsive Layout
Submitted by orgnsm on Tue, 08/27/2013 - 14:03Context:Connection:Attribute Type:TypesInstallation URL:http://code.orgnsm.org/viewport.htmlHTML
<meta name="viewport" content="width=device-width, initial-scale=1.0;"/>CSS
@media (max-width: 480px){ } @media (max-width: 767px){ #container{ padding: 0 25px; } nav ul li a{ font-size: 100%; padding: 15px 0; border-radius: 30px; } nav ul li a svg{ width: 60px; height: 60px; } } @media (min-width: 768px) and (max-width: 979px){ #container{ padding: 0 35px; } nav ul li a{ font-size: 120%; padding: 20px 0; border-radius: 40px; } nav ul li a svg{ width: 80px; height: 80px; } } @media (max-width: 979px){ } @media (min-width: 980px){ /* default rules */ } @media (min-width: 1200px){ #container{ padding: 0 75px; } nav ul li a{ font-size: 170%; padding: 30px 0; border-radius: 60px; } nav ul li a svg{ width: 133px; height: 133px; } } -
Dynamic Form Submission
Submitted by orgnsm on Tue, 08/27/2013 - 13:35Context:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/code/form.htmlThe JavaScript
jQuery(function($){ $("#contact").submit(function(){ //grab form values before blowing it out of the DOM in the next line values=$(this).serialize(); $("#contact").html( "<p>Sending message...</p>\n" ); //send the values to the PHP handler $.ajax({ type: "POST", url: $("#contact").attr('action'), data: values, success: function(re){ $("#contact").html(re); } }); return false; }); });PHP
<?php if( $_SERVER["REQUEST_METHOD"] == "POST" ){ $to = "orgnsm@orgnsm.org"; $subject = "Contact through website"; $message = "Message: ".$_POST["message"]."\r\rFrom: ".$_POST["nombre"]."\r\rEmail: ".$_POST["email"]; $from = $_POST["email"]; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo( "<p>Your message has been sent. Thank you</p>\n" ); } ?>HTML
<form action="/sites/all/themes/visionarysports/contact.php" method="POST" id="contact"> <div><input type="text" name="nombre" id="nombre" placeholder="Your Name"/></div> <div><input type="email" name="email" id="email" placeholder="Your E-mail"/></div> <div><textarea name="message" id="message" placeholder="Your Message"></textarea></div> <div><input type="submit" value="Send"/></div> </form> -
Read and Process RSS
Submitted by orgnsm on Sun, 08/25/2013 - 19:36Context:Connection:Attribute Type:Types<?php function getRSS( $url ){ $cobj = curl_init( $url ); curl_setopt( $cobj, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $cobj, CURLOPT_CONNECTTIMEOUT, 0 );//0 = no timeout $tumblr_raw = curl_exec( $cobj ); curl_close( $cobj ); if( $tumblr_raw ){ $tumblr_xml = new DOMDocument(); $tumblr_xml->loadXML( $tumblr_raw ); //echo( "<pre>".$tumblr_xml->saveHTML()."</pre>" ); if( $tumblr_xml->getElementsByTagName("item") instanceof DOMNodeList && $tumblr_xml->getElementsByTagName("item")->item(0) instanceof DOMElement && $tumblr_xml->getElementsByTagName("item")->item(0)->hasChildNodes() ){ foreach( $tumblr_xml->getElementsByTagName("item") as $tweet ){ foreach( $tweet->childNodes as $deetz ){ if( $deetz->nodeType == 1 && $deetz->nodeName == "title" ) $tweet_title = $deetz->textContent; elseif( $deetz->nodeType == 1 && $deetz->nodeName == "pubDate" ) $tweet_date = $deetz->textContent; elseif( $deetz->nodeType == 1 && $deetz->nodeName == "guid" ) $tweet_url = $deetz->textContent; elseif( $deetz->nodeType == 1 && $deetz->nodeName == "description" ) $tumbl_img = $deetz->textContent; } $tweetz[] = Array( "title" => $tweet_title, "date" => $tweet_date, "url" => $tweet_url, "img" => $tumbl_img ); } } else return "Tumblr is broken"; } else return "Tumblr is broken"; return $tweetz; } if( $tumblr = getRSS("http://ominousss.tumblr.com/rss") ){ echo( "<section id=\"recent-tumbls\">\n" ); echo( "<div><ul>\n" ); //echo("<pre>\n");print_r( $tumblr );echo("</pre>\n"); for( $i=0; $i < 9; $i++ ){ if( isset($tumblr[$i]) ){ echo( "<li>\n" ); echo( "<a href=\"".$tumblr[$i]["url"]."\" rel=\"external\">\n" ); echo( "<span class=\"tumblr_title\">".$tumblr[$i]["title"]."</span>\n" ); echo( "<span class=\"tumblr_date\">\n" ); echo( substr($tumblr[$i]["date"],0,strlen($tumblr[$i]["date"])-6) ); echo( "</span>\n" ); echo( "<span class=\"imgry\">" . $tumblr[$i]["img"] . "</span>\n" ); echo( "</a>\n" ); echo( "</li>\n" ); } } echo( "</ul></div>\n" ); echo( "<a href=\"http://ominousss.tumblr.com\" rel=\"external\" title=\"Tumblr page\">Tumblr</a>\n" ); echo( "</section>\n\n" ); } ?> -
La Picolla Scolla Italia
Submitted by orgnsm on Tue, 02/05/2013 - 23:06Subtitle:Italian Preschool InformationContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/lpsi/Images:





Layout & Typography, Semantic XHTML content structuring, Site Template & Request Handler, Flash & GoogleMaps Embedding -
Incubator
Submitted by orgnsm on Mon, 01/28/2013 - 11:32Subtitle:Artwork Project ArchiveContext:Connection:Attribute Type:TypesInstallation URL:http://incubator.orgnsm.orgImages:




Typography & Layout, Content Structuring, UI/X Design, Interactivity & Sorting
-
Jellyfish Frequency
Submitted by orgnsm on Sat, 12/29/2012 - 18:56Subtitle:Record Label WebsiteContext:Connection:Attribute Type:TypesInstallation URL:http://jellyfishfrequency.comImages:


-
Attributes
Submitted by orgnsm on Wed, 04/25/2012 - 20:52Context:Connection:Attribute Type:Types -
Page Layout Method
Submitted by orgnsm on Wed, 04/25/2012 - 00:48Context:Connection:Attribute Type:TypesInstallation URL:http://code.orgnsm.org/layout_example.htmlImages:
HTML
<div id="hub"> <div id="content1" class="column"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p> </div> <div id="content2" class="column"> <p>This page utilizes positioning, <strong>not floating</strong>, to create a fluid layout. Adding more dimensionality to the page flow while at the same time giving the CSS attribute <em>'float'</em> back some lost meaning when overly used for page layout <em>positioning</em>.</p> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla.</p> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla.</p> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla.</p> </div> <div id="content3" class="column"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla.</p> </div> </div> <div id="footer"> <div>Lorem ipsum</div> </div>CSS
#hub{ position: relative; } #content1{ position: absolute; border-right: 1px solid #ccc; right: 85%; background-color: #eee; color: #000; } #content3{ position: absolute; border-left: 1px solid #ccc; left: 67%; background-color: #eee; color: #000; } #content2{ position: absolute; left: 15%; right: 33%; } .column{ padding: 10px 10px 50px 10px; /* padding-bottom here should be approximate height of footer */ } #footer{ position: fixed; left: 0; bottom: 0; width: 100%; border-top: 1px dashed #999; background-color: #fff; color: #000; } #footer > div{ padding: 10px; } -
Stylesheet Switcher
Submitted by orgnsm on Wed, 04/25/2012 - 00:20Context:Connection:Attribute Type:TypesStyle Links HTML
<link rel="alternate stylesheet" type="text/css" href="/theme/KATALOG/style.css" title="KATALOG"/> <link rel="alternate stylesheet" type="text/css" href="/theme/SCREEN/style.css" title="SCREEN"/> <link rel="alternate stylesheet" type="text/css" href="/theme/spaecial/style.css" title="spaecial"/> <link rel="alternate stylesheet" type="text/css" href="/theme/touchpanel/style.css" title="touchpanel"/> <link rel="stylesheet" type="text/css" href="/theme/blawk/style.css" title="blawk"/>Style Switch Links HTML
<div id="style_chooser"> <a href="#" onclick="setActiveStyleSheet('KATALOG');this.blur();return false;">KATALOG</a> <a href="#" onclick="setActiveStyleSheet('SCREEN');this.blur();return false;">SCREEN</a> <a href="#" onclick="setActiveStyleSheet('touchpanel');this.blur();return false;">(touchpanel)</a> <a href="#" onclick="setActiveStyleSheet('spaecial');this.blur();return false;">spæcial</a> <a href="#" onclick="setActiveStyleSheet('blawk');this.blur();return false;">blawk</a> </div>JavaScript functions
function setActiveStyleSheet(title) { var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; document.getElementById( "style_choice_"+a.getAttribute("title") ).className = ""; if (a.getAttribute("title") == title){ a.disabled = false; document.getElementById( "style_choice_"+title ).className = "selected"; } } } } function getActiveStyleSheet() { var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) { return a.getAttribute("title"); } } return null; } function getPreferredStyleSheet(){ var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if( a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ){ return a.getAttribute("title"); } } return null; } function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "expires="+date.toGMTString(); } else expires = ""; document.cookie = name+"="+value+"; "+expires+"; "+"path=/"; } function readCookie(name) { var nameEQ = name + "="; if( typeof document.cookie != "undefined" ){ var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while( c.charAt(0)==' ' ) c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } } return null; }JavaScript load/unload event
window.onload = function(e){ var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); if( cookie == null || cookie == "null" ) var title = getPreferredStyleSheet(); else{ var title = cookie;/ *alert("received style through cookie: "+title);* / } setActiveStyleSheet(title); } window.onunload = function(e){ var title = getActiveStyleSheet(); createCookie("style", title, 30); } -
BossaNova Robotics
Submitted by orgnsm on Fri, 10/28/2011 - 21:12Subtitle:Robot Toy Product PromotionContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/bossanovaImages:



Process Imagery:
Site Request Handler, Framework for loading XML content from Flash nav click. Flash, GoogleMaps and YouTube Embedding. -
TiedyeJohn
Submitted by orgnsm on Fri, 09/02/2011 - 15:27Subtitle:Tiedye Artist Examples and OrderingContext:Connection:Attribute Type:TypesInstallation URL:http://tiedyehobo.anoml.netImages:
-
Kimochis Portal
Submitted by orgnsm on Tue, 08/30/2011 - 00:59Subtitle:Forum for Users of Educational ToysContext:Connection:Attribute Type:TypesInstallation URL:http://kimochis.com/educatorsportalImages:




-
Frameworks
Submitted by orgnsm on Mon, 08/01/2011 - 22:56Context:Connection:Attribute Type:TypesConnection:Attribute Type:TypesConnection:Attribute Type:TypesImages:
-
IAS
Submitted by orgnsm on Thu, 07/28/2011 - 21:17Subtitle:Data Management Services PromotionContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/iasImages:




Salesforce Form Submission Connectivity, AJaX Content Filtering, Flash Video Embedding -
PaulBird.tv
Submitted by orgnsm on Thu, 07/28/2011 - 18:51Subtitle:Mixed Martial Arts Fighter Information & MediaContext:Connection:Attribute Type:TypesInstallation URL:http://paulbird.anoml.netImages:


Process Imagery:

Layout & Typography, DrupalNodes, DrupalBlocks, UI Design/Background Art, DrupalViews Templates, YouTube Embedding -
777
Submitted by orgnsm on Wed, 07/06/2011 - 21:15Subtitle:Dimensionality Study ToolContext:Connection:Attribute Type:TypesInstallation URL:http://777.anoml.netImages:

Process Imagery:
-
Organic Interfaces
Submitted by orgnsm on Tue, 07/05/2011 - 17:49Subtitle:Portfolio WebsiteContext:Connection:Attribute Type:TypesInstallation URL:http://interfaces.orgnsm.orgImages:





Process Imagery:
-
Luscious Hawaiian
Submitted by orgnsm on Tue, 07/05/2011 - 15:34Subtitle:Natural Island Food ProductsContext:Connection:Attribute Type:TypesInstallation URL:http://luscioushawaiian.com/betaImages:
-
N.i. Portfolio
Submitted by orgnsm on Mon, 03/28/2011 - 22:09Subtitle:Website Work Portfolio & Team BiographiesContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/ni_comImages:



Layout & Typography, Request Handler & Site Template ((This is an "HTML Version" of their main Flash site - the PHP template uses the same XML data as the Flash site)), XML -
Visionary Sports Group
Submitted by orgnsm on Thu, 01/27/2011 - 18:28Subtitle:Athlete ManagementContext:Connection:Attribute Type:TypesInstallation URL:http://visionarysports.anoml.netImages:
-
Interactivity
Submitted by orgnsm on Sun, 01/23/2011 - 15:45Context:Connection:Attribute Type:TypesImages:
-
Layout & Typography
Submitted by orgnsm on Wed, 01/19/2011 - 18:06Context:Connection:Attribute Type:TypesImages:
-
Content Strategy
Submitted by orgnsm on Wed, 01/19/2011 - 09:34Subtitle:Storing and retrieving informationContext:Connection:Attribute Type:TypesImages:
-
RosaPharma
Submitted by orgnsm on Tue, 12/28/2010 - 18:25Subtitle:Pharmaceutical Development Services InformationContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/rosapharmaImages:


Layout, Typography & Navigation, Semantic XHTML, Site Template & Request Handler [custom built with PHP], drop-down navigation -
Ouroboros
Submitted by orgnsm on Tue, 12/07/2010 - 14:22Subtitle:Inspirational Imagery ArchiveContext:Connection:Attribute Type:TypesInstallation URL:http://ouroboros.orgnsm.orgImages:





-
Business Researchers
Submitted by orgnsm on Sun, 11/28/2010 - 22:10Subtitle:Business Strategy Services InformationContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/briImages:





Process Imagery:

Layout & Typography, Site Template & Request Handler, Animated Dropdown Menus, Google Maps Embed, Flash Embed
See also: businessresearchers.com
-
Drupal
Submitted by orgnsm on Fri, 11/05/2010 - 20:13Context:Connection:Attribute Type:TypesConnection:Attribute Type:TypesImages:
-
Radiesse
Submitted by orgnsm on Thu, 10/14/2010 - 16:34Subtitle:Dermal Product Information for Doctors & PatientsContext:Connection:Attribute Type:TypesInstallation URL:http://stage.orgnsm.org/radiesseImages:


Helped with overall framework
built main XHTML+template
constructed the map section and before and after section
radiesse.com
-
Process
Submitted by orgnsm on Thu, 10/14/2010 - 16:24Images:
-
Information Gathering
Getting to know our client. We ask many questions.
What do you want to accomplish? What are the main goals?
What are your business objectives? What features do you need?
What features do you want? How will you measure success?
When do you need delivery? - Initial Concepting
- Front-End & User Interface Design
- Information Design & Systems Development
- Front-end & UI Code
- User Experience & System Functionality Testing
- Deployment
-
Information Gathering
-
FlipVideo
Submitted by orgnsm on Thu, 10/14/2010 - 16:14Subtitle:Digital Video Camera Information & PurchasingContext:Connection:Attribute Type:TypesImages:

-
N.i. Extranet
Submitted by orgnsm on Wed, 07/28/2010 - 22:09Subtitle:[Internal + Client] Project Planning PlatformContext:Connection:Attribute Type:TypesImages:


clients.native-instinct.com
-
Resumé
Submitted by orgnsm on Wed, 07/28/2010 - 20:55 -
Disciplines
Submitted by orgnsm on Wed, 07/28/2010 - 20:55 -
Code
Submitted by orgnsm on Wed, 07/28/2010 - 20:00Subtitle:Snippets / ExamplesInstallation URL:http://stage.orgnsm.org/codeImages:
see also: code.orgnsm.org for testable examples -
Graphic Design
Submitted by orgnsm on Tue, 07/27/2010 - 20:20Subtitle:Interface VisualsContext:Connection:Attribute Type:TypesImages:
-
JavaScript
Submitted by orgnsm on Tue, 07/27/2010 - 20:19Subtitle:AJaX & MotionContext:Connection:Attribute Type:TypesImages:

-
Stylesheet Coding
Submitted by orgnsm on Tue, 07/27/2010 - 20:18Subtitle:Information PresentationContext:Connection:Attribute Type:TypesImages:
-
Information Structuring
Submitted by orgnsm on Tue, 07/27/2010 - 20:15Subtitle:Nodal ConnectivityContext:Connection:Attribute Type:TypesImages:
-
Template Coding
Submitted by orgnsm on Tue, 07/27/2010 - 20:05Subtitle:Information TransmutationContext:Connection:Attribute Type:TypesImages:
-
Amniot
Submitted by orgnsm on Sun, 07/25/2010 - 13:40Subtitle:Personal Journal / Progression Log / Public life document site / HomepageContext:Connection:Attribute Type:TypesInstallation URL:http://amniot.orgnsm.orgImages:



-
FlipVideo - Store
Submitted by orgnsm on Sun, 04/25/2010 - 17:07Subtitle:Store Updates for Designable Video camerasContext:Connection:Attribute Type:TypesImages:




Process Imagery:






- Heavy amount of legacy
updating
/XHTML for new sections- some ASP template work
- Heavy amount of legacy
-
Organic Planner
Submitted by orgnsm on Sat, 04/24/2010 - 21:37Subtitle:Private Notes & Organizational ToolsContext:Connection:Attribute Type:TypesInstallation URL:http://planner.orgnsm.orgImages:









Table
items_table.tpl.php
| ID | Images/Body | Types | Title | Subjects | Attributes | Edit |
|---|---|---|---|---|---|---|
| 91 | <?php function HOOK_user_login_submit( $form, &$form_state ){ $form_state["redirect"] = ""; } function HOOK_form_user_login_alter( &$form, $form_state ){ $form["#submit"][] = "HOOK_user_login_submit"; } ?> | Login redirectPrivate Notes & Organizational Tools |
|
EDIT | ||
| 90 | So other modules don't supersede your module, run this code once. <?php db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'"); ?> | Make Drupal Module Most ImportantPrivate Notes & Organizational Tools |
|
EDIT | ||
| 89 | .box img{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'0.5\'/> </filter> </svg>#grayscale"); filter: gray alpha(opacity=50); -webkit-filter: grayscale(50%); -webkit-transform: translateZ(0); } .box img:hover{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'1\'/> </fi | Image Desaturation EffectPrivate Notes & Organizational Tools |
|
EDIT | ||
| 88 | HTML <div id="photos_rotator"> <ul> <li> <a href="/node/15"> <span class="title">003</span> </a> <div class="rotator_full"><img src="003_0.jpg" alt=""/></div> </li> <li> <a href="/node/14"> <span class="title">002</span> </a> <div class="rotator_full"><img src="002_0.jpg" alt=""/></div> </li> <li> <a href="/node/13"> <span class="title">001</span> | SlideshowPrivate Notes & Organizational Tools |
|
EDIT | ||
| 87 | HTML <img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div> JavaScript function refreshCam(id, file) { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); document.getElementById(id).src = file + "?time="+h+m+s; setTimeout('refreshCam("webcamImage","'+file+'")',10000); } window.onload = function(){ if( document.getElementById("webcamImage") ) refreshCam( "webcamImage","http://orgnsm.org/webcam.jpg" ); } | Webcam Image RefresherPrivate Notes & Organizational Tools |
|
EDIT | ||
| 85 | w/JavaScript //the callback function run after loading JSONp below function test_results_loaded(data){ //post data to a service via ajax var xhr = new XMLHttpRequest(); xhr.open("POST", "https://orgnsm@orgnsm.org:lkAGWUE01H@orgnsm.testrail.com//index.php?/api/v2/add_result/1", true); xhr.setRequestHeader('Content-Type', 'application/json;'); xhr.setRequestHeader('Accept', 'application/json;'); // send the collected data as JSON xhr.send(JSON.stringify({"status_id":"1"})); xhr.onloadend = function () { alert("Wrote test data | AJAX Remote Read, Local WritePrivate Notes & Organizational Tools |
|
EDIT | ||
| 84 | w/JavaScript window.onload = function(){ //create new button var btn = document.createElement("a"); btn.setAttribute("id", "addedbutton"); var btntxt = document.createTextNode("Run Me"); btn.appendChild(btntxt); //inject new button document.getElementById("sidebar").appendChild(btn); //add event to new button document.getElementById('addedbutton').onclick = function(){ alert("Success"); } } w/JQuery $(document).ready(function(){ var test = $("<a href='#'>Run Me</a>").click(function(){ a | DOM Inject and Add EventPrivate Notes & Organizational Tools |
|
EDIT | ||
| 82 | <?php $items = array( 0 => array( "item 1", "2013-09-13", "1" ), 1 => array( "item 2", "2013-09-14", "2" ), 2 => array( "item 3", "2013-09-15", "3" ), ); ######## CALCULATIONS ######### # set per-page var if (isset($_GET["perpage"])) $perpage = $_GET["perpage"]; else $perpage = 10; # calc numb of pages $pages = ceil(count($items) / $perpage); # which page are we on? if( isset($_GET["page"]) && round($_GET["page"]) <= $pages && round($_GET["page"]) > 0 ) $page = round($_GET["page"]); else $page = 1; | Pagination LogicPrivate Notes & Organizational Tools |
|
EDIT | ||
| 81 | HTML <meta name="viewport" content="width=device-width, initial-scale=1.0;"/> CSS @media (max-width: 480px){ } @media (max-width: 767px){ #container{ padding: 0 25px; } nav ul li a{ font-size: 100%; padding: 15px 0; border-radius: 30px; } nav ul li a svg{ width: 60px; height: 60px; } } @media (min-width: 768px) and (max-width: 979px){ #container{ padding: 0 35px; } nav ul li a{ font-size: 120%; padding: 20px | Device-Responsive LayoutPrivate Notes & Organizational Tools |
|
EDIT | ||
| 80 | The JavaScript jQuery(function($){ $("#contact").submit(function(){ //grab form values before blowing it out of the DOM in the next line values=$(this).serialize(); $("#contact").html( "<p>Sending message...</p>\n" ); //send the values to the PHP handler $.ajax({ type: "POST", url: $("#contact").attr('action'), data: values, success: function(re){ $("#contact").html(re); } }); return fal | Dynamic Form SubmissionPrivate Notes & Organizational Tools |
|
EDIT | ||
| 79 | <?php function getRSS( $url ){ $cobj = curl_init( $url ); curl_setopt( $cobj, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $cobj, CURLOPT_CONNECTTIMEOUT, 0 );//0 = no timeout $tumblr_raw = curl_exec( $cobj ); curl_close( $cobj ); if( $tumblr_raw ){ $tumblr_xml = new DOMDocument(); $tumblr_xml->loadXML( $tumblr_raw ); //echo( "<pre>".$tumblr_xml->saveHTML()."</pre>" ); if( $tumblr_xml->getElementsByTagName("item") instanceof DOMNodeList && $tumblr_xml->getElementsByTagName("item")->ite | Read and Process RSSPrivate Notes & Organizational Tools |
|
EDIT | ||
| 5 |
|
La Picolla Scolla ItaliaPrivate Notes & Organizational Tools |
|
EDIT | ||
| 7 |
|
IncubatorPrivate Notes & Organizational Tools |
|
EDIT | ||
| 69 |
|
Jellyfish FrequencyPrivate Notes & Organizational Tools |
|
EDIT | ||
| 66 | AttributesPrivate Notes & Organizational Tools |
|
|
EDIT | ||
| 53 |
|
Page Layout MethodPrivate Notes & Organizational Tools |
|
EDIT | ||
| 52 | Style Links HTML <link rel="alternate stylesheet" type="text/css" href="/theme/KATALOG/style.css" title="KATALOG"/> <link rel="alternate stylesheet" type="text/css" href="/theme/SCREEN/style.css" title="SCREEN"/> <link rel="alternate stylesheet" type="text/css" href="/theme/spaecial/style.css" title="spaecial"/> <link rel="alternate stylesheet" type="text/css" href="/theme/touchpanel/style.css" title="touchpanel"/> <link rel="stylesheet" type="text/css" href="/theme/blawk/styl | Stylesheet SwitcherPrivate Notes & Organizational Tools |
|
EDIT | ||
| 14 |
|
BossaNova RoboticsPrivate Notes & Organizational Tools |
|
EDIT | ||
| 83 |
|
TiedyeJohnPrivate Notes & Organizational Tools |
|
EDIT | ||
| 20 |
|
Kimochis PortalPrivate Notes & Organizational Tools |
|
EDIT | ||
| 41 |
|
FrameworksPrivate Notes & Organizational Tools |
|
EDIT | ||
| 15 |
|
IASPrivate Notes & Organizational Tools |
|
EDIT | ||
| 10 |
|
PaulBird.tvPrivate Notes & Organizational Tools |
|
EDIT | ||
| 72 |
|
777Private Notes & Organizational Tools |
|
EDIT | ||
| 73 |
|
Organic InterfacesPrivate Notes & Organizational Tools |
|
EDIT | ||
| 70 |
|
Luscious HawaiianPrivate Notes & Organizational Tools |
|
EDIT | ||
| 16 |
|
N.i. PortfolioPrivate Notes & Organizational Tools |
|
EDIT | ||
| 77 |
|
Visionary Sports GroupPrivate Notes & Organizational Tools |
|
EDIT | ||
| 39 |
|
InteractivityPrivate Notes & Organizational Tools |
|
EDIT | ||
| 38 |
|
Layout & TypographyPrivate Notes & Organizational Tools |
|
EDIT | ||
| 37 |
|
Content StrategyPrivate Notes & Organizational Tools |
|
EDIT | ||
| 9 |
|
RosaPharmaPrivate Notes & Organizational Tools |
|
EDIT | ||
| 107 |
|
OuroborosPrivate Notes & Organizational Tools |
|
EDIT | ||
| 18 |
|
Business ResearchersPrivate Notes & Organizational Tools |
|
EDIT | ||
| 32 |
|
DrupalPrivate Notes & Organizational Tools |
|
EDIT | ||
| 26 |
|
RadiessePrivate Notes & Organizational Tools |
|
EDIT | ||
| 25 |
|
ProcessPrivate Notes & Organizational Tools |
|
EDIT | ||
| 24 |
|
FlipVideoPrivate Notes & Organizational Tools |
|
EDIT | ||
| 17 |
|
N.i. ExtranetPrivate Notes & Organizational Tools |
|
EDIT | ||
| 12 |
|
ResuméPrivate Notes & Organizational Tools |
|
EDIT | ||
| 11 |
|
DisciplinesPrivate Notes & Organizational Tools |
|
EDIT | ||
| 13 |
|
CodePrivate Notes & Organizational Tools |
|
EDIT | ||
| 4 |
|
Graphic DesignPrivate Notes & Organizational Tools |
|
EDIT | ||
| 3 |
|
JavaScriptPrivate Notes & Organizational Tools |
|
EDIT | ||
| 2 |
|
Stylesheet CodingPrivate Notes & Organizational Tools |
|
EDIT | ||
| 123 |
|
Information StructuringPrivate Notes & Organizational Tools |
|
EDIT | ||
| 6 |
|
Template CodingPrivate Notes & Organizational Tools |
|
EDIT | ||
| 76 |
|
AmniotPrivate Notes & Organizational Tools |
|
EDIT | ||
| 58 |
|
FlipVideo - StorePrivate Notes & Organizational Tools |
|
EDIT | ||
| 47 |
|
Organic PlannerPrivate Notes & Organizational Tools |
|
EDIT |
Rotator
items_cinema.tpl.php
-
.box img{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'0.5\'/> </filter> </svg>#grayscale"); filter: gray alpha(opacity=50); -webkit-filter: grayscale(50%); -webkit-transform: translateZ(0); } .box img:hover{ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'> <filter id=\'grayscale\'> <feColorMatrix type=\'saturate\' values=\'1\'/> </filter> </svg>#grayscale"); -webkit-filter: grayscale(0%); }...
Code
Image Desaturation Effect
Stylesheet Coding
-
HTML <div id="photos_rotator"> <ul> <li> <a href="/node/15"> <span class="title">003</span> </a> <div class="rotator_full"><img src="003_0.jpg" alt=""/></div> </li> <li> <a href="/node/14"> <span class="title">002</span> </a> <div class="rotator_full"><img src="002_0.jpg" alt=""/></div> </li> <li> <a href="/node/13"> <span class="title">001</span> </a> <div class="rotator_full"><img src="001_0.jpg" alt=""/></div> </li> </ul> </div> JavaScript jQuery(function($){ function processSlideshow( nextElem ){ currentElem = $("#photos_rotator ul li.selected"); if( !nextElem ){ currentElemIndex = $("#photos_rotator ul li").index(currentElem); nextElem = $('#photos_rotator ul li').get(currentElemIndex+1); if( !nextElem ) nextElem = $("#photos_rotator ul li").get(0); } //...
Code
Slideshow
JavaScript
Stylesheet Coding
JQuery
-
HTML <img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div> JavaScript function refreshCam(id, file) { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); document.getElementById(id).src = file + "?time="+h+m+s; setTimeout('refreshCam("webcamImage","'+file+'")',10000); } window.onload = function(){ if( document.getElementById("webcamImage") ) refreshCam( "webcamImage","http://orgnsm.org/webcam.jpg" ); }...
Code
Webcam Image Refresher
JavaScript
-
w/JavaScript //the callback function run after loading JSONp below function test_results_loaded(data){ //post data to a service via ajax var xhr = new XMLHttpRequest(); xhr.open("POST", "https://orgnsm@orgnsm.org:lkAGWUE01H@orgnsm.testrail.com//index.php?/api/v2/add_result/1", true); xhr.setRequestHeader('Content-Type', 'application/json;'); xhr.setRequestHeader('Accept', 'application/json;'); // send the collected data as JSON xhr.send(JSON.stringify({"status_id":"1"})); xhr.onloadend = function () { alert("Wrote test data"); }; } window.onload = function(){ //add event to a button that loads remote JSONp document.getElementById('loaderButton').onclick = function(){ var script = document.createElement('script'); script.src = 'http://shellfiche.anoml.net/test.php5?callback=test_results_loaded'; document.getElementsByTagName('head')[0].appendChild(script); } } w/JQuery $(document).ready(function(){ $("#loaderButton").click(function(){ $.ajax({ url: 'http://shellfiche.anoml.net/test.php5', dataType: "jsonp", jsonpCall...
Code
AJAX Remote Read, Local Write
JavaScript
JQuery
-
w/JavaScript window.onload = function(){ //create new button var btn = document.createElement("a"); btn.setAttribute("id", "addedbutton"); var btntxt = document.createTextNode("Run Me"); btn.appendChild(btntxt); //inject new button document.getElementById("sidebar").appendChild(btn); //add event to new button document.getElementById('addedbutton').onclick = function(){ alert("Success"); } } w/JQuery $(document).ready(function(){ var test = $("<a href='#'>Run Me</a>").click(function(){ alert("Success"); return false; }); $("body").append(test); });...
Code
DOM Inject and Add Event
JavaScript
JQuery
-
<?php $items = array( 0 => array( "item 1", "2013-09-13", "1" ), 1 => array( "item 2", "2013-09-14", "2" ), 2 => array( "item 3", "2013-09-15", "3" ), ); ######## CALCULATIONS ######### # set per-page var if (isset($_GET["perpage"])) $perpage = $_GET["perpage"]; else $perpage = 10; # calc numb of pages $pages = ceil(count($items) / $perpage); # which page are we on? if( isset($_GET["page"]) && round($_GET["page"]) <= $pages && round($_GET["page"]) > 0 ) $page = round($_GET["page"]); else $page = 1; # calc start and end item $startItem = (($page - 1) * $perpage); $endItem = $startItem + ($perpage - 1); if( $endItem > $items ) $endItem = $endItem - ($endItem % $items); ######## PRINT ITEMS ######### echo( "<div>\n" ); echo( " <ul>\n"); for( $i=$startItem; $i<=$endItem; $i++ ){ echo( " <li>\n"); echo( " <a href=\"/node/".$items[$i][2]."\">\n"); echo( " <span class=\"title\">" . $items[$i][0] . "</span>\n" ); echo( " </a>\n" ); echo( " </li>\n" ); } echo( " </ul&...
Code
Pagination Logic
Template Coding
PHP
View this Site
-
HTML <meta name="viewport" content="width=device-width, initial-scale=1.0;"/> CSS @media (max-width: 480px){ } @media (max-width: 767px){ #container{ padding: 0 25px; } nav ul li a{ font-size: 100%; padding: 15px 0; border-radius: 30px; } nav ul li a svg{ width: 60px; height: 60px; } } @media (min-width: 768px) and (max-width: 979px){ #container{ padding: 0 35px; } nav ul li a{ font-size: 120%; padding: 20px 0; border-radius: 40px; } nav ul li a svg{ width: 80px; height: 80px; } } @media (max-width: 979px){ } @media (min-width: 980px){ /* default rules */ } @media (min-width: 1200px){ #container{ padding: 0 75px; } nav ul li a{ font-size: 170%; padding: 30px 0; border-radius: 60px; } nav ul li a svg{ width: 133px; height: 133px; } }...
Code
Device-Responsive Layout
Stylesheet Coding
View this Site
-
The JavaScript jQuery(function($){ $("#contact").submit(function(){ //grab form values before blowing it out of the DOM in the next line values=$(this).serialize(); $("#contact").html( "<p>Sending message...</p>\n" ); //send the values to the PHP handler $.ajax({ type: "POST", url: $("#contact").attr('action'), data: values, success: function(re){ $("#contact").html(re); } }); return false; }); }); PHP <?php if( $_SERVER["REQUEST_METHOD"] == "POST" ){ $to = "orgnsm@orgnsm.org"; $subject = "Contact through website"; $message = "Message: ".$_POST["message"]."\r\rFrom: ".$_POST["nombre"]."\r\rEmail: ".$_POST["email"]; $from = $_POST["email"]; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo( "<p>Your message has been sent. Thank you</p>\n" ); } ?> HTML <form action="/sites/all/themes/visionarysports/contact.php" method="POST" id="contact"> <div>&...
Code
Dynamic Form Submission
JavaScript
PHP
JQuery
View this Site
-
<?php function getRSS( $url ){ $cobj = curl_init( $url ); curl_setopt( $cobj, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $cobj, CURLOPT_CONNECTTIMEOUT, 0 );//0 = no timeout $tumblr_raw = curl_exec( $cobj ); curl_close( $cobj ); if( $tumblr_raw ){ $tumblr_xml = new DOMDocument(); $tumblr_xml->loadXML( $tumblr_raw ); //echo( "<pre>".$tumblr_xml->saveHTML()."</pre>" ); if( $tumblr_xml->getElementsByTagName("item") instanceof DOMNodeList && $tumblr_xml->getElementsByTagName("item")->item(0) instanceof DOMElement && $tumblr_xml->getElementsByTagName("item")->item(0)->hasChildNodes() ){ foreach( $tumblr_xml->getElementsByTagName("item") as $tweet ){ foreach( $tweet->childNodes as $deetz ){ if( $deetz->nodeType == 1 && $deetz->nodeName == "title" ) $tweet_title = $deetz->textContent; elseif( $deetz->nodeType == 1 && $deetz->nodeName == "pubDate" ) $tweet_date = $deetz->textContent; elseif( $deetz->nodeType == 1 && $deetz->nodeName == "guid" ) $tweet_url = $dee...
Code
Read and Process RSS
Template Coding
-
Style Links HTML <link rel="alternate stylesheet" type="text/css" href="/theme/KATALOG/style.css" title="KATALOG"/> <link rel="alternate stylesheet" type="text/css" href="/theme/SCREEN/style.css" title="SCREEN"/> <link rel="alternate stylesheet" type="text/css" href="/theme/spaecial/style.css" title="spaecial"/> <link rel="alternate stylesheet" type="text/css" href="/theme/touchpanel/style.css" title="touchpanel"/> <link rel="stylesheet" type="text/css" href="/theme/blawk/style.css" title="blawk"/> Style Switch Links HTML <div id="style_chooser"> <a href="#" onclick="setActiveStyleSheet('KATALOG');this.blur();return false;">KATALOG</a> <a href="#" onclick="setActiveStyleSheet('SCREEN');this.blur();return false;">SCREEN</a> <a href="#" onclick="setActiveStyleSheet('touchpanel');this.blur();return false;">(touchpanel)</a> <a href="#" onclick="setActiveStyleSheet('spaecial');this.blur();return false;">spæcial</a>...
Code
Stylesheet Switcher
JavaScript
RSS
items_syndicate.tpl.php
]]>Organic Interfaces http://interfaces.orgnsm.org/syndicateRecent Web Design & Info Code en Thu, 21 Nov 2013 10:55:38 -1000 Login redirect http://interfaces.orgnsm.org/node/91<?php function HOOK_user_login_submit( $form, &$form_state ){ $form_state["redirect"] = ""; } function HOOK_form_user_login_alter( &$form, $form_state ){ $form["#submit"][] = "HOOK_user_login_submit"; } ?>
<?php
db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'");
?> ]]>.box img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'>
<filter id=\'grayscale\'>
<feColorMatrix type=\'saturate\' values=\'0.5\'/>
</filter>
</svg>#grayscale");
filter: gray alpha(opacity=50);
-webkit-filter: grayscale(50%);
-webkit-transform: translateZ(0);
}
.box img:hover{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'>
<filter id=\'grayscale\'>
<feColorMatrix type=\'saturate\' values=\'1\'/>
</filter>
</svg>#grayscale");
-webkit-filter: grayscale(0%);
} ]]><div id="photos_rotator">
<ul>
<li>
<a href="/node/15">
<span class="title">003</span>
</a>
<div class="rotator_full"><img src="003_0.jpg" alt=""/></div>
</li>
<li>
<a href="/node/14">
<span class="title">002</span>
</a>
<div class="rotator_full"><img src="002_0.jpg" alt=""/></div>
</li>
<li>
<a href="/node/13">
<span class="title">001</span>
</a>
<div class="rotator_full"><img src="001_0.jpg" alt=""/></div>
</li>
</ul>
</div>
JavaScript
jQuery(function($){
function processSlideshow( nextElem ){
currentElem = $("#photos_rotator ul li.selected");
if( !nextElem ){
currentElemIndex = $("#photos_rotator ul li").index(currentElem);
nextElem = $('#photos_rotator ul li').get(currentElemIndex+1);
if( !nextElem ) nextElem = $("#photos_rotator ul li").get(0);
}
//fade out
$(currentElem).removeClass("selected");
$(currentElem).find(".rotator_full").css("left","-600px");
setTimeout(function(){
$(currentElem).find(".rotator_full").css("z-index","-2");
$(currentElem).find(".rotator_full").css("left","600px");
}, 700);
//fade in
$(nextElem).addClass("selected");
$(nextElem).find(".rotator_full").css("z-index","-1");
$(nextElem).find(".rotator_full").css("left","0");
}
if( $("#photos_rotator").length ){
processSlideshow( $("#photos_rotator ul li").get(0) );
setInterval(function(){ processSlideshow(); }, 6000);
$("#photos_rotator ul li a").click(function(){
processSlideshow( $(this).parent() );
return false;
});
}
});
CSS
#photos_rotator{
position: relative;
width: 600px;
height: 400px;
margin: 15px auto 0 auto;
z-index: 0;
overflow: hidden;
}
#photos_rotator ul{
list-style: none;
padding: 0;
margin: 0;
width: 300px;
padding: 370px 0 0 25px;
}
#photos_rotator ul:after{
content: "";
display: block;
height: 0;
clear: both;
}
#photos_rotator ul li{
float: left;
width: 30px;
height: 30px;
}
#photos_rotator ul li a{
display: block;
height: 30px;
line-height: 30px;
text-align: center;
text-decoration: none;
}
#photos_rotator ul li.selected a{
background-color: #2bd06a;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#photos_rotator ul li .rotator_full{
z-index: -1;
position: absolute;
top: 0;
left: 600px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
} ]]><img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div>
JavaScript
function refreshCam(id, file) {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
document.getElementById(id).src = file + "?time="+h+m+s;
setTimeout('refreshCam("webcamImage","'+file+'")',10000);
}
window.onload = function(){
if( document.getElementById("webcamImage") )
refreshCam( "webcamImage","http://orgnsm.org/webcam.jpg" );
} ]]>//the callback function run after loading JSONp below
function test_results_loaded(data){
//post data to a service via ajax
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://orgnsm@orgnsm.org:lkAGWUE01H@orgnsm.testrail.com//index.php?/api/v2/add_result/1", true);
xhr.setRequestHeader('Content-Type', 'application/json;');
xhr.setRequestHeader('Accept', 'application/json;');
// send the collected data as JSON
xhr.send(JSON.stringify({"status_id":"1"}));
xhr.onloadend = function () { alert("Wrote test data"); };
}
window.onload = function(){
//add event to a button that loads remote JSONp
document.getElementById('loaderButton').onclick = function(){
var script = document.createElement('script');
script.src = 'http://shellfiche.anoml.net/test.php5?callback=test_results_loaded';
document.getElementsByTagName('head')[0].appendChild(script);
}
}
w/JQuery
$(document).ready(function(){
$("#loaderButton").click(function(){
$.ajax({
url: 'http://shellfiche.anoml.net/test.php5',
dataType: "jsonp",
jsonpCallback: "callback",
success: function( testreply ){
alert("Test results obtained.. Posting results...");
$.ajax({
url: 'https://orgnsm.testrail.com//index.php?/api/v2/add_result/1',
username: "orgnsm@orgnsm.org",
password: "lkAGWUE01H",
contentType: "application/json;",
accepts: "application/json;",
dataType: "json",
type: "POST",
data: '{"status_id": "1"}',
processData: "false",
headers:{"Content-Type": "application/json;"},
beforeSend: function(jqXHR){
jqXHR.overrideMimeType("application/json;");
jqXHR.setRequestHeader("Accept", "application/json;");
},
success: function( postreply ){
alert("Wrote test data");
}
});
}
});
return false;
});
}); ]]>window.onload = function(){
//create new button
var btn = document.createElement("a");
btn.setAttribute("id", "addedbutton");
var btntxt = document.createTextNode("Run Me");
btn.appendChild(btntxt);
//inject new button
document.getElementById("sidebar").appendChild(btn);
//add event to new button
document.getElementById('addedbutton').onclick = function(){
alert("Success");
}
}
w/JQuery
$(document).ready(function(){
var test = $("<a href='#'>Run Me</a>").click(function(){
alert("Success");
return false;
});
$("body").append(test);
}); ]]><?php
$items = array(
0 => array( "item 1", "2013-09-13", "1" ),
1 => array( "item 2", "2013-09-14", "2" ),
2 => array( "item 3", "2013-09-15", "3" ),
);
######## CALCULATIONS #########
# set per-page var
if (isset($_GET["perpage"])) $perpage = $_GET["perpage"];
else $perpage = 10;
# calc numb of pages
$pages = ceil(count($items) / $perpage);
# which page are we on?
if( isset($_GET["page"]) && round($_GET["page"]) <= $pages && round($_GET["page"]) > 0 )
$page = round($_GET["page"]);
else $page = 1;
# calc start and end item
$startItem = (($page - 1) * $perpage);
$endItem = $startItem + ($perpage - 1);
if( $endItem > $items ) $endItem = $endItem - ($endItem % $items);
######## PRINT ITEMS #########
echo( "<div>\n" );
echo( " <ul>\n");
for( $i=$startItem; $i<=$endItem; $i++ ){
echo( " <li>\n");
echo( " <a href=\"/node/".$items[$i][2]."\">\n");
echo( " <span class=\"title\">" . $items[$i][0] . "</span>\n" );
echo( " </a>\n" );
echo( " </li>\n" );
}
echo( " </ul>\n" );
echo( "</div>\n\n" );
# print page links as: URL/?page=##
echo("<ul class=\"pagination\">\n");
if( $page > 1 )
echo(" <li>");
echo(" <a href=\"?page=".($page-1)."&perpage=".$perpage."\" class=\"previous\">Previous</a>");
echo(" </li>\n");
for ($i=1; $i<=$pages; $i++) {
if ($i == $page) {
echo(" <li>");
echo(" <a href=\"?page=".$i."&perpage=".$perpage."\" class=\"active\">".$i."</a>");
echo(" </li>\n");
} else {
echo(" <li>");
echo(" <a href=\"?page=".$i."&perpage=".$perpage."\">".$i."</a>");
echo(" </li>\n");
}
}
if( $page < $pages )
echo(" <li><a href=\"?page=".($page+1)."\" class=\"next\">Next</a></li>\n");
echo("</ul>\n\n");
?> ]]><meta name="viewport" content="width=device-width, initial-scale=1.0;"/>
CSS
@media (max-width: 480px){
}
@media (max-width: 767px){
#container{
padding: 0 25px;
}
nav ul li a{
font-size: 100%;
padding: 15px 0;
border-radius: 30px;
}
nav ul li a svg{
width: 60px;
height: 60px;
}
}
@media (min-width: 768px) and (max-width: 979px){
#container{
padding: 0 35px;
}
nav ul li a{
font-size: 120%;
padding: 20px 0;
border-radius: 40px;
}
nav ul li a svg{
width: 80px;
height: 80px;
}
}
@media (max-width: 979px){
}
@media (min-width: 980px){
/* default rules */
}
@media (min-width: 1200px){
#container{
padding: 0 75px;
}
nav ul li a{
font-size: 170%;
padding: 30px 0;
border-radius: 60px;
}
nav ul li a svg{
width: 133px;
height: 133px;
}
} ]]>jQuery(function($){
$("#contact").submit(function(){
//grab form values before blowing it out of the DOM in the next line
values=$(this).serialize();
$("#contact").html( "<p>Sending message...</p>\n" );
//send the values to the PHP handler
$.ajax({
type: "POST",
url: $("#contact").attr('action'),
data: values,
success: function(re){
$("#contact").html(re);
}
});
return false;
});
});
PHP
<?php
if( $_SERVER["REQUEST_METHOD"] == "POST" ){
$to = "orgnsm@orgnsm.org";
$subject = "Contact through website";
$message = "Message: ".$_POST["message"]."\r\rFrom: ".$_POST["nombre"]."\r\rEmail: ".$_POST["email"];
$from = $_POST["email"];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo( "<p>Your message has been sent. Thank you</p>\n" );
}
?>
HTML
<form action="/sites/all/themes/visionarysports/contact.php" method="POST" id="contact">
<div><input type="text" name="nombre" id="nombre" placeholder="Your Name"/></div>
<div><input type="email" name="email" id="email" placeholder="Your E-mail"/></div>
<div><textarea name="message" id="message" placeholder="Your Message"></textarea></div>
<div><input type="submit" value="Send"/></div>
</form> ]]><?php
function getRSS( $url ){
$cobj = curl_init( $url );
curl_setopt( $cobj, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $cobj, CURLOPT_CONNECTTIMEOUT, 0 );//0 = no timeout
$tumblr_raw = curl_exec( $cobj );
curl_close( $cobj );
if( $tumblr_raw ){
$tumblr_xml = new DOMDocument();
$tumblr_xml->loadXML( $tumblr_raw );
//echo( "<pre>".$tumblr_xml->saveHTML()."</pre>" );
if( $tumblr_xml->getElementsByTagName("item") instanceof DOMNodeList &&
$tumblr_xml->getElementsByTagName("item")->item(0) instanceof DOMElement &&
$tumblr_xml->getElementsByTagName("item")->item(0)->hasChildNodes() ){
foreach( $tumblr_xml->getElementsByTagName("item") as $tweet ){
foreach( $tweet->childNodes as $deetz ){
if( $deetz->nodeType == 1 && $deetz->nodeName == "title" )
$tweet_title = $deetz->textContent;
elseif( $deetz->nodeType == 1 && $deetz->nodeName == "pubDate" )
$tweet_date = $deetz->textContent;
elseif( $deetz->nodeType == 1 && $deetz->nodeName == "guid" )
$tweet_url = $deetz->textContent;
elseif( $deetz->nodeType == 1 && $deetz->nodeName == "description" )
$tumbl_img = $deetz->textContent;
}
$tweetz[] = Array( "title" => $tweet_title,
"date" => $tweet_date,
"url" => $tweet_url,
"img" => $tumbl_img );
}
}
else return "Tumblr is broken";
}
else return "Tumblr is broken";
return $tweetz;
}
if( $tumblr = getRSS("http://ominousss.tumblr.com/rss") ){
echo( "<section id=\"recent-tumbls\">\n" );
echo( "<div><ul>\n" );
//echo("<pre>\n");print_r( $tumblr );echo("</pre>\n");
for( $i=0; $i < 9; $i++ ){
if( isset($tumblr[$i]) ){
echo( "<li>\n" );
echo( "<a href=\"".$tumblr[$i]["url"]."\" rel=\"external\">\n" );
echo( "<span class=\"tumblr_title\">".$tumblr[$i]["title"]."</span>\n" );
echo( "<span class=\"tumblr_date\">\n" );
echo( substr($tumblr[$i]["date"],0,strlen($tumblr[$i]["date"])-6) );
echo( "</span>\n" );
echo( "<span class=\"imgry\">" . $tumblr[$i]["img"] . "</span>\n" );
echo( "</a>\n" );
echo( "</li>\n" );
}
}
echo( "</ul></div>\n" );
echo( "<a href=\"http://ominousss.tumblr.com\" rel=\"external\" title=\"Tumblr page\">Tumblr</a>\n" );
echo( "</section>\n\n" );
}
?> ]]> <link rel="alternate stylesheet" type="text/css" href="/theme/KATALOG/style.css" title="KATALOG"/>
<link rel="alternate stylesheet" type="text/css" href="/theme/SCREEN/style.css" title="SCREEN"/>
<link rel="alternate stylesheet" type="text/css" href="/theme/spaecial/style.css" title="spaecial"/>
<link rel="alternate stylesheet" type="text/css" href="/theme/touchpanel/style.css" title="touchpanel"/>
<link rel="stylesheet" type="text/css" href="/theme/blawk/style.css" title="blawk"/>
Style Switch Links HTML
<div id="style_chooser">
<a href="#" onclick="setActiveStyleSheet('KATALOG');this.blur();return false;">KATALOG</a>
<a href="#" onclick="setActiveStyleSheet('SCREEN');this.blur();return false;">SCREEN</a>
<a href="#" onclick="setActiveStyleSheet('touchpanel');this.blur();return false;">(touchpanel)</a>
<a href="#" onclick="setActiveStyleSheet('spaecial');this.blur();return false;">spæcial</a>
<a href="#" onclick="setActiveStyleSheet('blawk');this.blur();return false;">blawk</a>
</div>
JavaScript functions
function setActiveStyleSheet(title) {
var i, a;
for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if (a.getAttribute("rel")
&& a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("title")) {
a.disabled = true;
document.getElementById( "style_choice_"+a.getAttribute("title") ).className = "";
if (a.getAttribute("title") == title){
a.disabled = false;
document.getElementById( "style_choice_"+title ).className = "selected";
}
}
}
}
function getActiveStyleSheet() {
var i, a;
for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if (a.getAttribute("rel")
&& a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("title")
&& !a.disabled) {
return a.getAttribute("title");
}
}
return null;
}
function getPreferredStyleSheet(){
var i, a;
for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if( a.getAttribute("rel")
&& a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title") ){
return a.getAttribute("title");
}
}
return null;
}
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+"; "+expires+"; "+"path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
if( typeof document.cookie != "undefined" ){
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while( c.charAt(0)==' ' ) c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
}
return null;
}
JavaScript load/unload event
window.onload = function(e){
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if( cookie == null || cookie == "null" ) var title = getPreferredStyleSheet();
else{ var title = cookie;/ *alert("received style through cookie: "+title);* / }
setActiveStyleSheet(title);
}
window.onunload = function(e){
var title = getActiveStyleSheet();
createCookie("style", title, 30);
} ]]>
