This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In order to put <sup></sup> tags in the format string, | |
// you have to escape all letters that are in | |
// http://php.net/manual/en/function.date.php | |
echo date('F j<\s\up>S</\s\up> Y', $timestamp); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ini_set("display_errors","on"); | |
//*************** | |
// | |
//Author: Andrew McClenaghan / Echidna Solutions Corp. | |
//Date: August 3, 2010 | |
// | |
//*************** | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT date_format(FROM_UNIXTIME(u.access), '%Y %M %D') FROM users u ORDER by u.access DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This is what I normally do: | |
if($something == "string") { ... } | |
//The problem is, if I accidentally miss an = then it would be an assignment! | |
if($something = "string") { /* uh oh! */ } | |
//To prevent this, get in the habit of reversing the order: | |
if("string" == $something) { ... } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: '/myphpajaxpath', | |
type: 'post', | |
data: 'postvar=1&postvar2=2&postvarthree=3', | |
succes: function(msg) { | |
alert("yay!"+msg); | |
}, | |
error: function(msg) { | |
console.log("An error occurred: "+msg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="film"> | |
<div class="imgbox"> | |
<div style="background-image: url(ribbon.php?text=2010)" class="year"> | |
</div> | |
<img height="151" width="200" alt="In tellus" src="robot1.gif" /> | |
</div> | |
<h4><a href="/in-tellus-libero">In tellus libero</a></h4> | |
<p>In tellus libero, pretium et rhoncus ut, fringilla et enim. Duis at dolor non dolor ultricies…</p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 3.2.5 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Sep 26, 2010 at 09:43 PM | |
-- Server version: 5.1.44 | |
-- PHP Version: 5.3.2 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("input[type=text]").each(function(){ | |
if($(this).attr("title").length > 0) { | |
//do the thing, to $(this) | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mymodule_menu(){ | |
$languages = language_list('enabled'); | |
$items = array(); | |
foreach ($languages[1] as $lang) { | |
$items[t('my_path', array(), $lang->language)] = array( | |
'title' => t('Page Title', array(), $lang->language), | |
'page callback' => 'pagefunction', |