Skip to content

Instantly share code, notes, and snippets.

@adahhane
adahhane / gist:2690664
Created May 13, 2012 22:56
my get_post
<?php
add_filter( 'pre_get_posts', 'my_get_posts' );
function my_get_posts( $query ) {
if ( is_home()){
$query->set( 'post_type', array( 'information','post') );
}
return $query;
}
?>
<?php
include 'theme_options.php';
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<div class="sidebox rounded">',
'after_widget' => '</div>',
'before_title' => '<h3 class="sidetitl">',
'after_title' => '</h3>',
@adahhane
adahhane / header.php
Created May 13, 2012 22:13
Header Page
<?php if (wp_loaded() === true) { ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="description" content="<?php bloginfo('description') ?>" />
@adahhane
adahhane / index.php
Created May 13, 2012 22:11
HomePage
<?php wp_get_header(); ?>
<?php include (TEMPLATEPATH . '/tab.php'); ?>
<div id="content" class="rounded">
<!DOCTYPE html>
<html lang="fr">
<head>
<link href="css/screen.css" rel="stylesheet" media="screen" type="text/css">
<link href="css/jquery.ennui.contentslider.css" rel="stylesheet" type="text/css" media="screen,projection" />
@adahhane
adahhane / gist:1069831
Created July 7, 2011 15:56
Add Methode
<?php
public function add(){
$idGroup=$_GET['idGroup'];
$groups=new Groups();
$groups->setId($idGroup);
$group=$groups->fetch();
foreach($group as $item){
$group=$item->getName();
}
$member=$this->get("Security")->getUser()->getLogin();
<!DOCTYPE html>
<html lang="fr">
<head>
<link href="css/screen.css" rel="stylesheet" media="screen" type="text/css">
<link href="css/jquery.ennui.contentslider.css" rel="stylesheet" type="text/css" media="screen,projection" />
<?php
public function others(){
//OLD METHOD
$group=new Groups();
$allGroups=$group->fetchAll();
$groups=array();
$idGroups=array();
$idMyGroups=array();
$detailGroups=new GroupDetails();
$dGroups=$detailGroups->fetchall();
@adahhane
adahhane / gist:1063488
Created July 4, 2011 15:26
OtherGroups
<?php
public function others(){
$group=new Groups();
$allGroups=$group->fetchAll();
$groups=array();
$idGroups=array();
$detailGroups=new GroupDetails();
$dGroups=$detailGroups->fetchall();
$detailGroups->setMember($this->get("Security")->getUser()->getId());
$memberGroup=$detailGroups->fetch();
@adahhane
adahhane / subscribe.php
Created June 29, 2011 10:41
subcribeMethod
<?php
public function subscribe(){
if(isset($_POST['member'])){
if(!empty($_POST['member']['login']) and !empty($_POST['member']['password']) and !empty($_POST['member']['email'])){
$_POST['member']['password']=md5($_POST['member']['password']);
$member=new Member();
$member->setLogin($_POST['member']['login']);
$members=$member->fetch();