Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/12/2008, 17:41
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Respuesta: APORTE: Crear un foro con PHP (nuevo)

functiones.ini.php (parte 2 de 2)
Código PHP:
function ir($url){
echo 
"<script type=\"text/javascript\">
<!--
window.location.href='"
.$url."';
-->
</script>"
;
}
function 
now(){
return @
date("Y-m-d")." ".@date("H-i-s");
}
function 
fecha($fecha){
$sep=explode(" ",$fecha);
$sub=explode("-",$sep[0]);
return 
$sub[2] . "-" $sub[1] . "-" $sub[0];
}
function 
issetPagina($id,$paginas){
    foreach(
$paginas as $k => $v)        {
        if(
$k==$id){
        return 
$v;
        break;
        }
    }
    return 
false;
}
function 
dirForo($id){
global 
$config;
$isset=issetPagina($id,$config['paginas']);
if(
$isset[0]=="Inicio"){
$title=is_numeric($_GET['p'])?titlePost($_GET['p']):"Inicio";
$mas=$title!="Inicio"?' &raquo; <a href="' $isset[1] . '">' $isset[0] . '</a>':"";
$url=$_GET['p'];
}elseif(
$isset)
$title=$isset[0];
else
$title="Error";
$dir='<a href="index.php?id=inicio">' addslashes(htmlentities(trim($config['titulo']))) . '</a> ' $mas ' &raquo; <a 

href="' 
$isset[1] . $url '">' $title '</a>';
return 
$dir;
}
function 
verTitle($id="inicio"){
global 
$config;
$isset=issetPagina($id,$config['paginas']);
$p=$isset?$isset[0]:"Error";
if(
$p=="Inicio")
$p=is_numeric($_GET['p'])?titlePost($_GET['p']):"Inicio";
return 
$p;

Despues creen una carpeta que se llame tema y en ella crear una carpeta que se llame 1 (por el tema 1) y en esa carpeta pongan:
1.error.html
Código HTML:
ERROR<br>
No se a encontrado la direcion a la que quieres acceder.
1.foro.html
Código HTML:
<table width="100%" border="0" cellpadding="0" cellspacing="2" class="table-foro">
  <tr>
    <td width="72%" valign="top" bgcolor="#EAF1FF"><strong>{TITLE}</strong></td>
    <td width="28%" valign="top" class="foro-credit"><strong>Por: </strong>{POR}<br />
      <strong>Ultimo mensaje: </strong>{ULTIMO}<br />
      <strong>Respuestas: </strong>{RESPUESTAS} </td>
  </tr>
</table> 
1.index.html
Código HTML:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{TITLEWEB}</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	color: #000000;
}
body {
	background-color: #EAF1FF;
}
a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #0000FF;
}
.menu {
	background-color: #FFFFFF;
	text-align: center;
	margin-top: 3px;
	margin-bottom: 3px;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #000000;
	height: 24px;
}
.menu a:link,
.menu a:visited{
	font-weight: bold;
	background-color: #FFFFFF;
	margin: 2px;
	display: block;
	width: 200px;
	color: #000000;
	float: left;
	text-align: center;
	text-decoration: none;
}
.menu a:hover{
	background-color: #DFEAFF;
	text-decoration: underline;
	color: #000000;
}
.table-sec {
	background-color: #E1EBFF;
	padding: 5px;
	border: 1px solid #6699FF;
}
.menu a:active{
	background-color: #EAF1FF;
}
a:active {
	color: #0066FF;
}
.title {
	font-size: 24px;
	font-weight: bold;
	color: #000000;
	text-decoration: none;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #666666;
}
#responder a{
	color: #000000;
	text-decoration: none;
	background-color: #FFFFFF;
	padding: 3px;
	border: 2px solid #000000;
	display: block;
	height: 24px;
	width: 200px;
	text-align: center;
}
.table {
	border: 2px solid #666666;
}
.credit-web {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	border-top-width: 1px;
	border-top-style: dotted;
	border-top-color: #000000;
}
.sub-credit {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #000000;
}
.credit-post {
	background-color: #D7E3FF;
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
}
.title-post {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	color: #000000;
	text-decoration: none;
	background-color: #EAF0FF;
}
.bord-post {
	border: 1px solid #666666;
}
#bbcodes a:link {
	background-color: #FFFFFF;
	padding: 7px;
	border: 1px solid #999999;
}
.table-foro {
	background-color: #FFFFFF;
	padding-top: 3px;
	padding-right: 3px;
	padding-left: 3px;
	border-bottom-width: 2px;
	border-bottom-style: solid;
	border-bottom-color: #000000;
	margin-bottom: 5px;
}
.foro-credit {
	background-color: #D2E1FF;
	border-left-width: 1px;
	border-left-style: dotted;
	border-left-color: #6699FF;
	font-size: 12px;
	color: #000000;
	text-decoration: none;
	padding-left: 3px;
}
-->
</style>
<script type="text/javascript">
<!--
function insertCampo(tag1,tag2,campo){
	var input = document.getElementById(campo);
		if(typeof document.selection != 'undefined' && document.selection) {
			var str = document.selection.createRange().text;
			input.focus();
			var sel = document.selection.createRange();
			sel.text = tag1 + str + tag2;
			sel.select();
			return;
		}
		else if(typeof input.selectionStart != 'undefined'){
				if(typeof input.scrollTop != 'undefined'){
					var st=input.scrollTop;
					var sl=input.scrollTop;
				}
			var start = input.selectionStart;
			var end = input.selectionEnd;
			var insText = input.value.substring(start, end);
			input.value = input.value.substr(0, start) + tag1 + insText +tag2+ 

input.value.substr(end);
			input.focus();
			if(typeof input.scrollTop != 'undefined'){
					input.scrollTop=st;
					input.scrollTop=sl;
			}
			

input.setSelectionRange(start+2+tag.length+insText.length+3+tag.length,start+2+tag.length+insText.length+3+tag

.length);
			return;
		}
		else{
			input.value+=tag1+tag2;
			return;
		}
}
function imagen(){
var image=prompt("URL de la imagen:","http://");
if(image)
insertCampo("[img]" + image,"[/img]","mensaje");
}
function url(){
var title=prompt("Titulo:","");
var url=prompt("URL:","http://");
if(title && url)
insertCampo("[url=" + url + "]" + title,"[/url]","mensaje");
}
-->
</script>
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="#FFFFFF" 

class="table">
  <tr>
    <td colspan="2"><div class="title">{TITLE}</div><div class="menu">{MENU}</div></td>
  </tr>
  <tr>
    <td colspan="2"><div>{FORO}</div></td>
  </tr>
  <tr>
    <td width="215" align="center" class="credit-web"><a href="http://validator.w3.org/check?uri=referer"><img
        src="http://www.w3.org/Icons/valid-xhtml10"
        alt="Valid XHTML 1.0 Transitional" width="88" height="31" border="0" /></a><a 

href="http://jigsaw.w3.org/css-validator/"><img style="border:0;width:88px;height:31px"
            src="http://jigsaw.w3.org/css-validator/images/vcss"
            alt="¡CSS Válido!" /></a></td>
    <td width="666" align="center" class="credit-web"><a href="http://www.halfmusic.com.ar/" target="_blank" 

class="sub-credit">Half Music </a><br />      
    Todos los derechos resrvados 2008 </td>
  </tr>
</table>
</body>
</html> 
1.responder.html
Código HTML:
<div align="center" id="responder">
  <div align="left"><a href="index.php?id=tema&p={ID}">Responder</a></div>
</div> 
1.login-act.html
Código HTML:
<a href="index.php?id=inicio">Inicio</a><a href="index.php?id=tema">Nuevo tema </a><a href="salir.php" 

onclick="if(confirm('¿Seguro de salir?')){return true; }else{ return false; }">Salir</a> Hola {USER}
1.login.html
Código HTML:
<a href="index.php?id=inicio">Inicio</a><a href="index.php?id=login">Login</a><a 

href="index.php?id=registrarse">Registrarse</a> 
Continua en el siguiente post...
__________________
Half Music - www.halfmusic.com