Bienvenido: ( Identificarse | Registrarse )      
Foros de Trucos Windows
Closed TopicStart new topicStart Poll

Outline · [ Estándar ] · Lineal+

> Tutorial firma en PHP

nobalogic
post May 24 2005, 11:48 PM
Publicado: #1


Photoshop con estilo
***

Grupo: Members
Mensajes: 87
Registrado: 24-May 05
Desde: Nicaragua - CentroAmerica
Miembro nº: 130.908



Haremos esto:

user posted image

Bueno antes que nada, debes de tener conocimientos simples en php,

aclarar que se tiene que tener la librería GD habilitada en el host


El primer comando que necesitas es,

CODE
<?php

Por logica, es el que abre cuando vamos a poner un codigo en php

Ahora tienes que decidir si quieres un texto o una imagen en tu firma...

CODE
header("Content-type: image/GIF");

CODE
header("Content-type: image/GIF");
---> claro donde dice gif tu puedes escoger si cambiarlo por un JPEG JPG PNG etc....

CODE
$image = imagecreatefromGIF("sig.GIF");
ahora este es el comando para poner el fondo ya sea una imagen o un texto eso tu lo decides...

bueno ahora tenemos que poner el texto o textos que quieras que salgan en tu firma...++

CODE
$saying1 = "texto #1";
$saying2 = "12345678910";
$saying3 = "12345678910";
$saying4 = "12345678910";
$saying5 = "12345678910";


Puedes tener mas o menos dependiendo de el tamaño de el texto...
ahora pones Random Quotes o dichoes
CODE
$random = rand(1,2);
if ($random = "1")
$saying1 = "TECCTO";
$saying2 = "1222222222222";
$saying3 = "1233333333333";
$saying4 = "1234444444444";
$saying5 = "1234555555555";
} else if ($random == "2"){
$saying1 = "testo";
$saying2 = "tecto";
$saying3 = "Texto";
$saying4 = "";
$saying5 = "";
};


BUeno yo e puesto 2 random quotes
CODE
$random = rand(1,2);

Pero si quieres agregarle mas solo pon 1,3 y si quieres mas 1,3 etc...
CODE
$random = rand(1,3);


Bueno ahora una de las cosas que mas me gusta es lo de la ip

CODE
if ($_SERVER["HTTP_X_FORWARDED_FOR"]){
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}else{
$ip = $_SERVER["REMOTE_ADDR"];
}
$ip = explode(",", $ip);
$ip = "YOUR ip:".$ip[0];


trata de no cambiar nada asi el codigo no se arruina

CODE
$ip = "YOUR ip:".$ip[0];
---> conformate con cambiar esto y ya

Ahora seguimos con los colores, la verdad es que el blanco y el negro se ven mal, asi que les escogi estos, claro ustedes pueden escoger el que quieran
CODE
// COLORS
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 250, 250, 250);
$orange = imagecolorallocate($image, 220, 210, 60);
$red = imagecolorallocate($image, 250, 0, 0);
$blue = imagecolorallocate($image, 0, 250, 0);
$green = imagecolorallocate($image, 0, 0, 250);
$grey = imagecolorallocate($image, 250, 250, 250);
$grey2 = imagecolorallocate($image, 140, 140, 140);
$grey3 = imagecolorallocate($image, 110, 110, 110);
$grey4 = imagecolorallocate($image, 90, 90, 90);
$grey5 = imagecolorallocate($image, 60, 60, 60);
$grey5 = imagecolorallocate($image, 250, 0, 250);
//end colors


Ahora vamos a poner donde va cada texto y el color de el texto....

CODE
//imagestring($image, fontsize, width, height, text, color);

CODE
imagestring($image, 3, 5, 50, $saying1, $grey);
imagestring($image, 3, 5, 60, $saying2, $grey2);
imagestring($image, 3, 5, 70, $saying3, $grey3);
imagestring($image, 3, 5, 80, $saying4, $grey4);
imagestring($image, 3, 5, 90, $saying5, $grey5);
imagestring($image, 3, 5, 50, $ip, $white);


Tienes que escoger el lugar exacto de donde quieres que vaya el texto si no se vera feo---

CODE
imagestring($image, 3, 5, 50, $ip, $white);
y claro para cambiar de colores has eso....

despues va este codigo
CODE
imagepng($image);
imagedestroy($image);



la firma te deberia de quedar algo asi-...

CODE
<?php

header("Content-type: image/GIF");

$image = imagecreatefromGIF("sig.GIF");

$random = rand(1,2);
if ($saying1 = "que paso paso paso";
$saying2 = "1222222222222";
$saying3 = "1233333333333";
$saying4 = "1234444444444";
$saying5 = "1234555555555";
} else if ($random == "2"){
$saying1 = "di lo que quieras";
$saying2 = "con quien quieras";
$saying3 = "cuando quieras";
$saying4 = "";
$saying5 = "";
};

if ($_SERVER["HTTP_X_FORWARDED_FOR"]){
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}else{
$ip = $_SERVER["REMOTE_ADDR"];
}
$ip = explode(",", $ip);
$ip = "YOUR ip:".$ip[0];

// COLORS
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 250, 250, 250);
$orange = imagecolorallocate($image, 220, 210, 60);
$red = imagecolorallocate($image, 250, 0, 0);
$blue = imagecolorallocate($image, 0, 250, 0);
$green = imagecolorallocate($image, 0, 0, 250);
$grey = imagecolorallocate($image, 250, 250, 250);
$grey2 = imagecolorallocate($image, 140, 140, 140);
$grey3 = imagecolorallocate($image, 110, 110, 110);
$grey4 = imagecolorallocate($image, 90, 90, 90);
$grey5 = imagecolorallocate($image, 60, 60, 60);
$grey5 = imagecolorallocate($image, 250, 0, 250);
//end colors

imagestring($image, 3, 5, 50, $saying1, $grey);
imagestring($image, 3, 5, 60, $saying2, $grey2);
imagestring($image, 3, 5, 70, $saying3, $grey3);
imagestring($image, 3, 5, 80, $saying4, $grey4);
imagestring($image, 3, 5, 90, $saying5, $grey5);
imagestring($image, 3, 5, 100, $ip, $white);

imagepng($image);
imagedestroy($image);
?>



Bueno aqui les dejo una serie de comandos mas avanzados, los cuales le puedes agregar a tu firma hecha en php

Para decir el explorador que usas tu y el que la ve
solo pon

CODE
<?php $browser = "browser:";
if(!$_SERVER["HTTP_USER_AGENT"]){
$browser .= "Unknown";
}else{
$browser .= $_SERVER["HTTP_USER_AGENT"];
} ?>


para poner el nombre de su host

CODE
<?php $hostname = "host name:";
$hostname .= gethostbyaddr($_SERVER['REMOTE_ADDR']);
if($hostname == ""){
$hostname .= "no host found";
}else{
$hostname .= "";
}; ?>


Para mostrar la pagina que quieren ver

CODE
<?php $requested = "requested:";
if(!$_SERVER["REQUEST_URI"]){
$requested .= "Unknown";
}else{
$requested .= $_SERVER["REQUEST_URI"];
} ?>


Para mostrar la pagina que estan viendo

CODE
<?php $showenfrom = "showen from:";
if(!$_SERVER["HTTP_REFERER"]){
$showenfrom .= $_SERVER["SCRIPT_NAME"];
}else{
$showenfrom .= $_SERVER["HTTP_REFERER"];
} ?>


y el tiempo

CODE
<?php
$time = "the date and time is now:";
$time .="Day:";
$time .= date("l dS");
$time .= ", month:";
$time .= date("F");
$time .= ", Year:";
$time .= date("Y");
$time .= ", Time:";
$time .= date("h:i:s A");
?>


Bueno ademas de ponerlos en la firma estos ultimos comandos te pueden funcionar para ponerles en tu web, asi muestra ip navegador etc.....



http://sigx.yuriy.net/

Otro para tener tu firma...

http://www.danasoft.com/



Otros:

What's Playing
http://whatsplaying.sourceforge.net/

Dynamic Signature Images
http://www.nuffsed.net/signature.php

Uptime-Project
http://www.uptime-project.net/page.php?page=home






Author: [N]obalogi[C] wink.gif

Hasta Pronto wink.gif


User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
Closed TopicTopic OptionsStart new topic

Collapse

> Topicos similares

Firma Del MEs Enero09 Nicelan 60 2 Jan 8 2009, 12:27 AM
By: Nicelan
Tutorial: Quitar fondo a un .gif animado titometal 53 0 Jan 6 2009, 11:52 PM
By: titometal
Tutorial Photoshop: Como crear una firma Alhanna 462.459 428 Jan 4 2009, 06:11 PM
By: huvosobi
Sheradow, otra firma del monton. VlakaS 89 3 Jan 3 2009, 05:22 AM
By: huvosobi
Tutorial Acoustica Mp3 Mixer v.2.471 vitrox2007 0 0 Dec 24 2008, 02:41 PM
By: JaCoBo