Edit

Error message

  • Notice: Undefined variable: monthCounts in include() (line 12 of /homepages/21/d93015512/htdocs/library/organic_connectivity/date_overview.tpl.php).
  • Notice: Trying to access array offset on value of type null in include() (line 12 of /homepages/21/d93015512/htdocs/library/organic_connectivity/date_overview.tpl.php).
  • Notice: Undefined variable: monthCounts in include() (line 14 of /homepages/21/d93015512/htdocs/library/organic_connectivity/date_overview.tpl.php).
  • Warning: array_reverse() expects parameter 1 to be array, null given in include() (line 14 of /homepages/21/d93015512/htdocs/library/organic_connectivity/date_overview.tpl.php).
  • Warning: Invalid argument supplied for foreach() in include() (line 21 of /homepages/21/d93015512/htdocs/library/organic_connectivity/date_overview.tpl.php).
  • Notice: Undefined offset: 0 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 1 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 2 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 3 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 4 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 5 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 6 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 7 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 8 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 9 in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 42 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 0 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 1 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 2 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 3 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 4 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 5 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 6 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 7 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 8 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).
  • Notice: Undefined offset: 9 in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Notice: Trying to get property 'connections' of non-object in include() (line 150 of /homepages/21/d93015512/htdocs/library/organic_connectivity/items_map.tpl.php).
  • Warning: Invalid argument supplied for foreach() in search_for_attribute() (line 641 of /homepages/21/d93015512/htdocs/library/organic_connectivity/io.php).

Items

Items

112

Per Page

/ 12

Subject Attribute

Nodes Posts Things

Blocks

items_blocks.tpl.php

Nodes

items_nodes.tpl.php

  • Login redirect

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    <?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

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    So 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

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    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

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics

    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);
            }
            //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

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Types

    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" );
    
    }
  • AJAX Remote Read, Local Write

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics

    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",
       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

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics

    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);
    
    });
  • Pagination Logic

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation 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

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Types
    Installation URL: 
    http://code.orgnsm.org/viewport.html

    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;
        }
    }
  • Dynamic Form Submission

    Context: 
    Connection: 
    Attribute Type: 
    Types
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://stage.orgnsm.org/code/form.html

    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><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>

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 redirect
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 Important
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 Effect
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> Slideshow
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 Refresher
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 Write
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 Event
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 Logic
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 Layout
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 Submission
EDIT

Rotator

items_cinema.tpl.php

Calendar

date_overview.tpl.php

Start date

  • After Christ (Era Vulgaris)
  • New Aeon
Total Items

RSS

items_syndicate.tpl.php




    

        Organic Interfaces

        http://interfaces.orgnsm.org/syndicate

        Recent 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";
}

?>
]]> 91 Thu, 21 Nov 2013 10:55:38 -1000 Make Drupal Module Most Important http://interfaces.orgnsm.org/node/90 <?php db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'"); ?> ]]> 90 Thu, 21 Nov 2013 10:43:37 -1000 Image Desaturation Effect http://interfaces.orgnsm.org/node/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\'/> </filter> </svg>#grayscale"); -webkit-filter: grayscale(0%); } ]]> 89 Thu, 19 Sep 2013 12:05:44 -1000 Slideshow http://interfaces.orgnsm.org/node/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>
   </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;
}
]]>
88 Fri, 13 Sep 2013 18:33:19 -1000
Webcam Image Refresher http://interfaces.orgnsm.org/node/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" );

}
]]>
87 Wed, 11 Sep 2013 12:54:58 -1000
AJAX Remote Read, Local Write http://interfaces.orgnsm.org/node/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"); };

}



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;

 });


});
]]>
85 Mon, 09 Sep 2013 10:36:19 -1000
DOM Inject and Add Event http://interfaces.orgnsm.org/node/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(){
  alert("Success");
  return false;
 });

 $("body").append(test);

});
]]>
84 Mon, 09 Sep 2013 10:09:11 -1000
Pagination Logic http://interfaces.orgnsm.org/node/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; # 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"); ?> ]]> 82 Tue, 27 Aug 2013 14:13:17 -1000 Device-Responsive Layout http://interfaces.orgnsm.org/node/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 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;
    }
}
]]>
81 Tue, 27 Aug 2013 14:03:40 -1000
Dynamic Form Submission http://interfaces.orgnsm.org/node/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 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>
]]>
80 Tue, 27 Aug 2013 13:35:47 -1000

Global

items_map.tpl.php