tupali_fork/milfs/css/estilos.php

78 lines
1.7 KiB
PHP
Raw Normal View History

2016-10-29 15:07:15 +00:00
<?php
header("Content-Type: text/css");
echo dibuja_clase();
function dibuja_clase(){
2016-11-26 22:38:14 +00:00
$link=Conectarse();
2016-11-26 06:35:47 +00:00
mysqli_query("SET NAMES 'utf8'");
2016-10-29 15:07:15 +00:00
$consulta = "SELECT elemento FROM estilos GROUP BY elemento";
2016-11-26 06:35:47 +00:00
$sql=mysqli_query($consulta,$link);
2016-10-29 15:07:15 +00:00
if (mysql_num_rows($sql)!='0'){
mysql_data_seek($sql, 0);
while( $row = mysql_fetch_array( $sql ) ) {
$elemento= dibuja_elemento($row[elemento]);
$resultado .= "$row[elemento]{
$elemento
}\n";
}
}
print $resultado;
return;
}
function dibuja_elemento($elemento){
2016-11-26 22:38:14 +00:00
$link=Conectarse();
2016-11-26 06:35:47 +00:00
mysqli_query("SET NAMES 'utf8'");
2016-10-29 15:07:15 +00:00
$consulta = "SELECT * FROM estilos WHERE elemento = '$elemento' ";
2016-11-26 06:35:47 +00:00
$sql=mysqli_query($consulta,$link);
2016-10-29 15:07:15 +00:00
if (mysql_num_rows($sql)!='0'){
while( $row = mysql_fetch_array( $sql ) ) {
if($row[color] !=='') {$color = "$row[color]";}else{$color="";}
$resultado .= "$row[label]:$row[valor] $color ;\n";
}
2016-11-26 22:38:14 +00:00
2016-10-29 15:07:15 +00:00
}
return $resultado;
}
2016-10-29 15:07:15 +00:00
function Conectarse(){
2016-11-26 22:38:14 +00:00
$servidor = "";
$usuario = "";
$password = "";
$db = "";
2016-10-29 15:07:15 +00:00
if ( !isset ( $link ) ) {
2016-11-26 22:38:14 +00:00
@include("includes/datos.php");
if(!isset($db)) {
2016-11-26 00:14:27 +00:00
include("../milfs/includes/datos.php");
}
if (!($link=mysqli_connect($servidor,$usuario,$password,$db)))
2016-10-29 15:07:15 +00:00
{
echo "Error conectando a la base de datos.";
exit();
}
2016-11-26 06:35:47 +00:00
/* if (!mysqli_select_db($db,$link))
2016-10-29 15:07:15 +00:00
{
echo "Error seleccionando la base de datos.";
exit();
}
*/
$_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url;
$_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size;
2016-10-29 15:07:15 +00:00
return $link;
}
}
?>