Tag Archive for mini

Mini-height

min-height:500px;
  height:auto !important;
  height:500px;

source

Mini Textile class

<?php

class TextiLite{

/*
TextiLite:
A lightweight version of Textile built with PHP by Evan Walsh
Version 001

Based on the work of:
<a href="http://codeigniter.com/wiki/BBCode_Helper/" >http://codeigniter.com/wiki/BBCode_Helper/</a>
<a href="http://codeigniter.com/forums/viewthread/69615/" >http://codeigniter.com/forums/viewthread/69615/</a>

Supports:
<br/> by the way of newline
*Text* => <strong>Text</strong>
_Text_ => <em>Text</em>
!http://image.url! => <img src="http://image.url"/>
"Text":http://text.url => <a href="http://text.url" title="Text">Text</a>
*/

function paragraph($text){
$paragraphs = explode("

", $text);
$output = null;
foreach($paragraphs as $paragraph) {
$output .= "
<p>".$paragraph."</p>
";
}
return $output;
}

function textile($text = null){
$regex = array(
'/(.+)
(.+)/',
'/*([^*]+)*/',
'/_([^*]+)_/',
'/(!)((?:http|https)(?::/{2}[w]+)(?:[/|.]?)(?:[^s"]*))(!)/',
'/(")(.*?)(").*?((?:http|https)(?::/{2}[w]+)(?:[/|.]?)(?:[^s"]*))/',
);
$replace = array(
"$1<br/>$2",
"<strong>$1</strong>",
"<em>$1</em>",
"<img src="$2"/>",
"<a href="$4" title="$2">$2</a>",
);
return preg_replace($regex,$replace,$text);
}

function process($text){
$text = $this->paragraph($text);
$text = $this->textile($text);
return $text;
}

}

?>

source

Month Table

function minimonth($d = "", $m = "", $y = "")
{
if(empty($d)) $d = date("j");
if(empty($m)) $m = date("m");
if(empty($y)) $y = date("Y");
$today = mktime(0, 0, 0, $m, $d, $y);
$first = mktime(0, 0, 0, $m, 1, $y);

$prev_month = date("n", strtotime("-1 month", $today));
$prev_year = date("Y", strtotime("-1 month", $today));
$next_month = date("n", strtotime("+1 month", $today));
$next_year = date("Y", strtotime("+1 month", $today));

$caption = date("F Y", $today);

$out = "<table id='minimonth' cellspacing='0'>";
$out .= "<tr><td class='caption'><a href='#' onclick='cd($prev_month, $prev_year)'>«</a></td><td class='caption' colspan='5'>$caption</td><td><a href='#' onclick='cd($next_month, $next_year)'>»</a></td></tr>";
$out .= "<tr class='week'><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>";

$w = date("w", $first);
if($w > 0)
{
$out .= "<tr>";
for($i = 0; $i < $w; $i++) $out .= "<td></td>";
}

for($i = 1; $i <= date("t", $today); $i++)
{
if(date("w", mktime(0, 0, 0, $m, $i, $y)) == 0) $out .= "<tr>";
$out .= "<td id='d$i' class='day'><a href='#' onclick='pick($i)'>$i</a></td>";
if(date("w", mktime(0, 0, 0, $m, $i, $y)) == 6) $out .= "</tr>";
}

$w = date("w", mktime(0, 0, 0, $m, $i - 1, $y));
for($i = $w; $i < 6; $i++) $out .= "<td></td>";

$out .= "</tr></table>";

echo $out;
}

source