crear un slide infinito HTML+CSS+ JQUERY


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {
       $('#carousel_ul li:first').before($('#carousel_ul li:last'));
       $('#right_scroll').click(function(){
           var item_width = $('#carousel_ul li').outerWidth() + 10;
           var left_indent = parseInt($('#carousel_ul').css('left')) - item_width;
           $('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){  
               $('#carousel_ul li:last').after($('#carousel_ul li:first'));
               $('#carousel_ul').css({'left' : '0'});
           });
       });
       $('#left_scroll').click(function(){
           var item_width = $('#carousel_ul li').outerWidth() + 10; //704
           var left_indent = parseInt($('#carousel_ul').css('left')) + item_width;
           $('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){  
           $('#carousel_ul li:first').before($('#carousel_ul li:last'));
           $('#carousel_ul').css({'left' : '0'});
           });
       });
 });
</script>
<style type="text/css">

#carousel_inner {
float:left; /* important for inline positioning */
width:630px; /* important (this width = width of list item(including margin) * items shown */
overflow: hidden;  /* important (hide the items outside the div) */
/* non-important styling bellow */
background: #F0F0F0;
}

#carousel_ul {
position:relative;
left:-210px; /* important (this should be negative number of list items width(including margin) */
list-style-type: none; /* removing the default styling for unordered list items */
margin: 0px;
padding: 0px;
width:9999px; /* important */
/* non-important styling bellow */
padding-bottom:10px;
}

#carousel_ul li{
float: left; /* important for inline positioning of the list items */                                  
width:200px;  /* fixed width, important */
/* just styling bellow*/
padding:0px;
height:110px;
background: #000000;
margin-top:10px;
margin-bottom:10px;
margin-left:5px;
margin-right:5px;
}

#carousel_ul li img {
.margin-bottom:-4px; /* IE is making a 4px gap bellow an image inside of an anchor (<a href...>) so this is to fix that*/
/* styling */
cursor:pointer;
cursor: hand;
border:0px;
}
#left_scroll, #right_scroll{
float:left;
height:130px;
width:15px;
background: #C0C0C0;
}
#left_scroll img, #right_scroll img{
/*styling*/
cursor: pointer;
cursor: hand;
}
</style>
</head>
<body>
  <div id='carousel_container'>
 <div id='left_scroll'><img src='http://web.enavu.com/demos/left.png' /></div>
  <div id='carousel_inner'>
        <ul id='carousel_ul'>
            <li><a href='#'><img src='https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcT0-t7aRQx24Y9VRys7mW2C3asKXgonkCVMisvPUXqAeE-MhIBgWw' /></a></li>
            <li><a href='#'><img src='http://www.tengopaginaweb.com/apellidobeltri/Escudo%20Belltree.gif' /></a></li>
            <li><a href='#'><img src='http://t3.gstatic.com/images?q=tbn:ANd9GcRHMKEj0It-nMhbdHkpteYv42KFsbhsL1Up0UyEnj5ZxMcgSaUjyFg294jj' /></a></li>
            <li><a href='#'><img src='http://imagenesfotos.com/wp-content/2009/10/escudos11.JPG' /></a></li>
            <li><a href='#'><img src='http://imagenesfotos.com/wp-content/2009/10/escudos11.JPG' /></a></li>
        </ul>
  </div>
  <div id='right_scroll'><img src='http://web.enavu.com/demos/right.png' /></div>
  </div>
</body>
</html>

crear una aplicacion en Facebook y subir foto con php


<?php
/**
datos para crear con tu cuenta de facebook  un APP:


Display Name: NOMBREAPLIACION
Namespace: ESPACIODENOMBRE
Correo electrónico de contacto: XXX
App Domains: vacio
Categoría: otra


Selecciona como tu aplicación se intrega con Facebook
Aplicación en Facebook
Canvas Page: http://apps.facebook.com/ESPACIODENOMBRE
Canvas URL:  http://urldetuphp/carpeta/
URL segura de la página principal de la aplicación: https://urldetuphp/carpeta/


*/

// URL de la aplicación
$urlApp = "http://apps.facebook.comESPACIODENOMBRE/";
// ID y Secret ID de la aplicación
$appId = "XXXXXXXXXXX";
$secret = "XXXXXXXXXXXXXXXXXXXXX";
//Llamada al Facebook SDK
include_once "facebook.php";
// Instanciamos el objeto Facebook
$facebook = new Facebook(array('appId' => $appId,
                               'secret' => $secret,
                               'cookie' => true));
// Obtenemos una session
$user = $facebook->getUser();
if (!$user){
// Si el usuario no está autentificado crea una URL para hacerlo.
// Se usa 'scope' para pedir permisos separados por coma.
// Se usa 'redirect_uri' para redireccionar a esa URL despues de la acción del usuario
$loginUrl = $facebook->getLoginUrl(
            array(
                'scope' => 'read_stream,publish_stream,photo_upload,user_photos,user_photo_video_tags',
                'redirect_uri' => $urlApp
            )
    );
echo "<script type=\"text/javascript\">top.location.href = '$loginUrl';</script>";
} else {

 //Le indicamos a facebook que vamos a subir un archivo a su plataforma.
 $facebook->setFileUploadSupport(true);
        //Indicamos que vamos a entrar en la seccion albums del usuario
 $albums = $facebook->api('/me/albums');
 //Navegamos dentro de los albumes para encontrar alguno con nombre 'profile'
$album_uid = "";
        foreach ($albums['data'] as $album) {
       if($album['type'] == 'wall'){//si encontramos algun album con nombre "muro", tomamos su identificador para subir nuestra imagen en este album
                $album_uid = $album['id'];
//echo "wall id ".$album_uid;
            }
        }
if($album_uid == ""){
//echo "no existe el albun ";
/***********************************************/
//SI NO EXISTE EL ALBUN CREAMOS UNO
//Componemos nuestro array con los datos de nuestro album nombre y descripcion.
$album_details = array(
'message'=> 'mi descripcion ',
'name'=> 'albun q yo quiero'
);
//Indicamos a facebook que vamos a crear un album
$create_album = $facebook->api('/me/albums', 'post', $album_details);
//Tomamos el identificador del album creado.
$album_uid = $create_album['id'];
/***********************************************/
}

 //Componemos el array que tendra los datos de nuestra imagen mensaje, nombre, path donde se encuentra la imagen album donde lo vamos a depositar.
        $photo_details = array(
            'message'=> 'Photo message'
        );
        $file = 'fotoesperada.jpg';
        $photo_details['image'] = '@' . realpath($file);
 //Luego de esto enviamos a $facebook los datos de nuestra imagen
        $upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);
     echo '<a href="http://www.facebook.com/photo.php?fbid='.$upload_photo['id'].'" target="_blank">Mira la foto aqui.</a>';
    // Hasta aquí el usuario tendría que estar autentificado con la aplicación.
   // $yo = $facebook->api('/me');
  //  print_r($yo);
}
?>

Editar PDF con FPDI y FPDP y PHP


Descargar  FPDI con fpdf_ptl de http://www.setasign.de/products/pdf-php-solutions/fpdi/downloads/
y fpdf de http://www.fpdf.org/

Forma de escribir infornacion a raiz de un pdf con estilos e imagenes:::

<?php
include_once 'acceder.php';
require_once('pdf/fpdf.php');
require_once('pdf/fpdi.php');
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('certificado.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx,null,null,null,null,true);
// now write some text above the imported page
$nombre = "Periquito Pin-Pin";
$nombre= strtoupper($nombre);
$nom_count = strlen($nombre);
//formula para cuadrar el nombre en el certificado dependiendo su longitud
if($nom_count>50)
$x = 55;
else{
$nombre_espacio = 60;
if($nom_count<23)
$nombre_espacio = 72;
$x= $nombre_espacio + (66-$nom_count);
}
//////////////////////
$p_general ="";
$p_categoria="";
$n_competencia = "";
$edad="";
$t_liquido="";

/*NOMBRE*/
$pdf->SetFont('Arial','B', 15);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 98);
$pdf->Write(0, $nombre);

$x=160;
//NOMBRE/
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 137);
$pdf->Write(0, $p_general);
/*NOMBRE*/
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 145);
$pdf->Write(0, $p_categoria);
//NOMBRE/
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 152);
$pdf->Write(0, $n_competencia);
//NOMBRE/
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 159);
$pdf->Write(0, $edad);
//NOMBRE/
$pdf->SetFont('Arial','', 9);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($x, 166);
$pdf->Write(0, $t_liquido);

$pdf->Output('diploma2008.pdf', 'D');



CommentFB