This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
exportar-ini.php
68 lines (54 loc) · 2.17 KB
/
exportar-ini.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?
/* ===========================
sabros.us monousuario version 1.8
http://sabros.us/
sabros.us is a free software licensed under GPL (General public license)
=========================== */
/* Este archivo debería ser llamado por el update.php o incluido en él */
header("Content-type: text/html; charset=UTF-8");
include("include/functions.php");
include("include/config.php");
include("include/conex.php");
include("include/tags.php");
$tabla = "CREATE TABLE `".$prefix."opciones` (
`nombre` varchar(100) NOT NULL,
`valor` varchar(255) NOT NULL,
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=MyISAM";
/* Control para verificar que la tabla existe */
$res = mysql_query("SHOW TABLE STATUS LIKE '".$prefix."opciones'",$link);
if(mysql_num_rows($res) == 0){
mysql_query($tabla);
}
function exportarini($opcion,$valor)
{
global $link,$prefix;
$sql = "SELECT * FROM ".$prefix."opciones WHERE (nombre='".$opcion."') LIMIT 1";
$result = mysql_query($sql,$link);
if(mysql_num_rows($result)==0) {
$sql2 = "INSERT INTO ".$prefix."opciones VALUES ('".$opcion."','".$valor."')";
if(mysql_query($sql2,$link))
return true;
else
return false;
} else {
return true;
}
}
$cfg = parse_ini_file("include/config.ini", true);
$multiCont = (isset($cfg['multimedia_content']['allow']))?$cfg['multimedia_content']['allow']:"0";
$tagsColor = (isset($cfg['tags_cloud']['color']))?$cfg['tags_cloud']['color']:"0";
$compartir = (isset($cfg['exportar']['compartir']))?$cfg['exportar']['compartir']:"0";
$desc_badge = (isset($cfg['links_badge']['descripciones']))?$cfg['links_badge']['descripciones']:"0";
$ping = (isset($cfg['sopasabrosa']['ping']))?$cfg['sopasabrosa']['ping']:"0";
$soloNube = (isset($cfg['tags_cloud']['alone_index']))?$cfg['tags_cloud']['alone_index']:"0";
$estiloNube = (isset($cfg['tags_cloud']['posicion']))?$cfg['tags_cloud']['posicion']:"0";
exportarini(multiCont,$multiCont);
exportarini(tagsColor,$tagsColor);
exportarini(compartir,$compartir);
exportarini(desc_badge,$desc_badge);
exportarini(ping,$ping);
exportarini(soloNube,$soloNube);
exportarini(estiloNube,$estiloNube);
header("Location: index.php");
?>