Beispiel #1
0
        $where_arr[] = "`" . $e[0] . "`" . $explode_by . "'" . $e[1] . "'";
    }
    $where_list = implode(" AND ", $where_arr);
    // create sql string
    $sql_string = "SELECT";
    if ($distinct != "") {
        $sql_string = $sql_string . " DISTINCT";
    }
    $sql_string = $sql_string . " " . $select_list . " FROM " . $table_list;
    if ($_POST['where_list'] != "") {
        $sql_string = $sql_string . " WHERE " . $where_list;
    }
    if ($order_by != "") {
        $sql_string = $sql_string . " ORDER BY " . $order_by . " " . $order_rule;
    }
    if ($limit != "") {
        $sql_string = $sql_string . " LIMIT " . $limit;
    }
    // Extract data from database
    $sql = mysql_query($sql_string) or die('error::' . mysql_error());
    //if a match is found
    if (mysql_num_rows($sql) > 0) {
        require_once "../xml/createXml{$php_version}.php";
        $xml_string = createXml($sql);
        echo $xml_string;
    } else {
        echo 'error::No fields found';
    }
} else {
    echo 'error::Invalid POST data';
}
Beispiel #2
0
function updateTanieres($info)
{
    $a = array(chr(140), chr(156));
    $b = array("Oe", "oe");
    // Récupération du fichier contenant les objets des tanieres
    $file = fopen("http://sp.mountyhall.com/SP_GrandesTanieres.php?Numero=" . $info["AuthTroll"] . "&Motdepasse=" . $info["Auth"], "r");
    $data = str_replace($a, $b, trim(stream_get_contents($file)));
    fclose($file);
    // Extrait les tanières de $data et supprime la dernière case de $tanières (case vide)
    $tanieres = preg_split("#\\s+\\#FIN GrandeTaniere [0-9]+\\s*#", preg_replace("#\\#DEBUT GrandeTaniere #", "", $data));
    unset($tanieres[count($tanieres) - 1]);
    // Sépare les éléments ainsi que leurs caractéristiques de chaques tanières
    foreach ($tanieres as $key => $taniere) {
        // Chaque ligne de la chaine deviens une case du tableau
        $taniere = preg_split("#\n#", $taniere);
        // La case "taniere" du tableau contient les informations de la tanière, supprime ensuite l'ancienne case tanière
        $idTaniere = explode(";", $taniere[0]);
        unset($taniere[0]);
        // Découpe la chaine de chaque objets en fonction du charactère ";"
        foreach ($taniere as $key2 => $element) {
            $element = explode(";", $element);
            $element["idTaniere"] = $idTaniere[0];
            $t[$element[2]][] = $element;
        }
    }
    // Ajoute au dossier les fichiers xml d'objet
    foreach ($t as $elements) {
        createXml($elements);
    }
}
Beispiel #3
0
<?php

/*   Autor: Ajiraj   *****/
$ROOT = '';
/*   change below lines to reflect in the joomla admin area  **/
$AUTHOR = 'AjiRaj';
$DESC = 'Module Generated with module-skelton generator';
$DATE = date('d M y');
/*  No need to edit below this  **/
if (isset($_POST['mod_name']) && $_POST['mod_name'] != '') {
    $moduleName_original = $_POST['mod_name'];
    $moduleName = str_replace(" ", "_", $moduleName_original);
    $ROOT = './output/mod_' . $moduleName;
    createFloders($moduleName);
    createEntryPoint($moduleName);
    createXml($moduleName, $moduleName_original);
    createHelper($moduleName);
    createTemplate($moduleName);
    header('Location:complete.php');
} else {
    header('Location:index.php');
}
/**********************   Functions   **************************/
function createFloders($moduleName, $moduleName_original)
{
    global $ROOT;
    $structures = array($ROOT, $ROOT . '/tmpl', $ROOT . '/assets');
    foreach ($structures as $structure) {
        if (!mkdir($structure, 0777, true)) {
            die('Failed to create folders...' . $structure);
        } else {