Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Huisman paulhuisman

View GitHub Profile
View basic_html.html
<!DOCTYPE html>
<html>
<head>
<title>Moo test</title>
</head>
<body>
<h1>Moo</h1>
<p>Lorem ipsum..</p>
</body>
</html>
View modulo_end.php
<div class="block_content">
<?php $c = 0; foreach ($dossiers as $k => $dossier):
if ($c % 4 == 0) print '<div class="clearfix">';?>
<div class="dossier <?php if ($k % 4 == 3) print 'last'; ?>">
<?php if (!empty($dossier->article_image_filepath)): ?>
<a href="<?php print url('node/'.$dossier->nid); ?>"><?php print theme('imagecache', 'op_list', $dossier->article_image_filepath, '', '', array('class' => 'dossier_img')); ?></a>
<?php endif; ?>
<h4><a href="<?php print url('node/'.$dossier->nid); ?>"><?php print $dossier->title; ?></a></h4>
</div>
<?php if ($c % 4 == 3 || $count == (count($dossiers))) print '</div>';
View cookies_timer.php
<?php
$cookie_value = NULL;
if (!isset($_COOKIE['overlay_display'])) {
$cookie_value = TRUE;
setcookie("overlay_display", $cookie_value, time()+31536000); // Expire in one year
}
else {
$cookie_value = intval($_COOKIE['overlay_display'])+1;
setcookie("overlay_display", $cookie_value, time()+31536000);
View php_image_upload.php
<?php
function save($category) {
$packageguide = JRequest::get( 'POST' );
$files = JRequest::get( 'FILES' );
if (isset($files['image_upload']) && !$files['image_upload']['error']) {
$dir = JPATH_ROOT.DS.'media'.DS.'packageguide'.DS.$category;
if(!file_exists($dir)) {
mkdir($dir, 0777, true);
}
move_uploaded_file($files['image_upload']['tmp_name'], $dir.DS.$files['image_upload']['name']);