Skip to content

Instantly share code, notes, and snippets.

View juanramon's full-sized avatar

Juan Ramón Díaz juanramon

  • Lifull Connect
  • Barcelona, Spain
View GitHub Profile
<script type="text/javascript">
function checkAll (frm, check) {
var aa = document.getElementById(frm);
for (var i = 0 ; i < aa.elements.length ; i++) {
aa.elements[i].checked = check;
}
}
function checkCat(id, check) {
var lay = document.getElementById("cat" + id);
<script type="text/javascript">
function checkAll (frm, check) {
var aa = document.getElementById(frm);
for (var i = 0 ; i < aa.elements.length ; i++) {
aa.elements[i].checked = check;
}
}
function checkCat(id, check) {
var lay = document.getElementById("cat" + id);
$.widget( "ui.autocomplete", {
options: {
appendTo: "body",
delay: 300,
minLength: 1,
position: {
my: "left top",
at: "left bottom",
collision: "none"
},
@juanramon
juanramon / item-post.php
Created December 3, 2010 17:18
item-post file from modern theme without country and region
<script src="<?php echo WEB_PATH;?>/oc-includes/js/tabber-minimized.js"></script>
<link type="text/css" href="<?php echo WEB_PATH;?>/oc-includes/css/tabs.css" media="screen" rel="stylesheet" />
<?php ItemForm::location_javascript(); ?>
<?php if(!isset($_GET['catId'])) { $_GET['catId'] = -1; }; ?>
<div id="home_header"><div><?php _e('Post your item'); ?></div></div>
<div align="center">
<div id="add_item_form">
<form action="item.php" method="post" enctype="multipart/form-data" onSubmit="return checkForm()">
<input type="hidden" name="action" value="post_item" />
@juanramon
juanramon / home.php
Created December 7, 2010 10:50
home.php file from modern theme
<script>
$(document).ready(function() {
$('div.category_body').mouseover(function() {
$(this).css('border-bottom', '1px solid #F38527');
});
$('div.category_body').mouseout(function() {
$(this).css('border-bottom', '1px solid #eee');
});
@juanramon
juanramon / mail.php
Created December 10, 2010 09:39
Mail test
<?php
$to = "mail@example.com";
$header = "From: {$to}";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body, $header)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
@juanramon
juanramon / .htaccess
Created January 7, 2011 16:17
.htaccess file of drupal7
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@juanramon
juanramon / header.php
Created January 10, 2011 18:06
Header.php file from modern theme
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php echo osc_page_title(); ?></title>
<meta name="generator" content="OSClass <?php echo OSCLASS_VERSION; ?>" />
<link href="<?php echo osc_themeResource('style.css'); ?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo WEB_PATH; ?>/oc-includes/js/tiny_mce/tiny_mce.js"></script>
<script src="<?php echo WEB_PATH; ?>/oc-includes/js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="<?php echo WEB_PATH; ?>/oc-includes/js/jquery-ui-1.8.5.js" type="text/javascript"></script>
@juanramon
juanramon / session.php
Created January 20, 2011 09:20
Check if session is working well
<?php
$session_path = ini_get('session.save_path');
if( file_exists($session_path) ) {
echo 'Session path exists: ' . $session_path;
} else {
echo 'Session path doesn\'t exist: ';
echo $session_path;
exit();
}
@juanramon
juanramon / locale.php
Created February 3, 2011 11:02
oc-includes/osclass/locale.php
<?php
/**
* OSClass – software for creating and publishing online classified advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*