コード例 #1
0
ファイル: function.inc.php プロジェクト: kaloslee/WeiXianPin
function echolia($liclass, $title, $url)
{
    //输出带链接的列表子项
    echo '<li>';
    echoa($title, $url);
    echo '</li>';
}
コード例 #2
0
    public function displays_members()
    {
        global $bdd;
        $queryListMembers = $bdd->query('SELECT m.membre_login, gm.membre_statut FROM ' . TABLE_MEMBERS_GROUPS . ' AS gm 
										LEFT JOIN ' . TABLE_MEMBERS . ' AS m ON m.membre_id = gm.membre_id 
										WHERE gm.groupe_id = ? ORDER BY gm.membre_statut, m.membre_login', array($this->ownerId));
        while ($dataListMembers = $bdd->fetch($queryListMembers)) {
            echoa($dataListMembers);
        }
    }
コード例 #3
0
ファイル: exempleList.php プロジェクト: wedesign-pf/Tit
// Explications sur les propriétés de $listCols:
//
// la propriété "width" peut être soit en px soit en %
// la propriété "update" doit être un chiffre pour indiquer le nombre d'occurence autorisée, mettre 0 pour illimité
// la proprité "class" permet d'indiquer une classe CSS à ajouter à la colonne (pour personnaliser l'affichage) ou mettre "notGoMaj" pour ne pas autoriser le click vers la page de mise à jour (pratique si il y a une action spécifique au click dans cette colonne).
// la propriété "orderOk" permet d'autoriser (1) ou non (0) le tri sur cette colonne (en cliquant sur le nom de la colonne).
// la propriété "assValues" permet d'attribuer une liste de valeurs à une colonne (par exemple pour afficher un titre au lieu d'un identifiant)
// la propriété "action" peut contenir:
// - image, file, link, video : affiche automatiquement un lien vers le type de média correspondant
// - inList :  permet de valider la liste avec la valeur du champ dans $__POST["actionInList"]
// - page : // NE PAS UTILISER
// - lightbox : permet d'afficher une lightbox, voir l'exemple script JS à ajouter dans exempleList.tpl
// Boutons supplémentaires à coté du bouton Ajouter
$boutons[] = array("label" => "Export", "action" => DOS_CLIENT_ADMIN . "remoteTest.php", "assAction" => "ajouter");
if ($__POST["actionInList"] == "testin") {
    echoa("eeeeeeeeeeeeee");
}
include DOS_INCPAGES_ADMIN . "list-init.php";
////////////////////////////////////////////////////////////////
// Action sur la liste ///////////////
if ($__POST["actionInList"] == "delete") {
    // suppression
    foreach ($_POST as $k => $v) {
        if (strpos($k, "deleteMe") === 0) {
            $idDel = substr($k, 8);
            if ((int) $idDel) {
                $myDelete = new myDelete(__FILE__);
                $myDelete->table = $myTable;
                $myDelete->where = "id={$idDel}";
                $result = $myDelete->execute();
                deleteMediasbyIdParent("xxxx", $idDel);
コード例 #4
0
ファイル: class.site.php プロジェクト: wedesign-pf/Tit
 public function load_pages($debug = 0)
 {
     //   if(is_array($this->pages)) { return false; } // si existe déjà, on passe
     $pages = array();
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $this->PREFIXE_TBL_GEN . "pages";
     $mySelect->fields = "*";
     $mySelect->where = "lg=:lg AND actif=1";
     $mySelect->whereValue["lg"] = array($this->current_lang, PDO::PARAM_STR);
     $mySelect->orderby = "id ASC";
     $result = $mySelect->query();
     foreach ($result as $row) {
         $idPage = stripslashes($row["id"]);
         $datasPages = $row;
         // si tag_title vide : tag_title = page_titre
         if ($datasPages["page_tag_title"] == "") {
             $datasPages["page_tag_title"] = $datasPages["page_titre"];
         }
         // page_url = URL simple sans arbo ni type de page
         // insert chemin absolue si !!racine!!
         $datasPages["page_url"] = str_replace($this->SEPVAR . "racine" . $this->SEPVAR, $this->RACINE, $datasPages["page_url"]);
         $pages[$idPage] = $datasPages;
     }
     $this->pages = $pages;
     $this->loadUrlPages();
     if ($debug == 1) {
         echoa($pages);
     }
     return true;
 }
コード例 #5
0
ファイル: pages_std.php プロジェクト: wedesign-pf/Tit
if (is_array($dataMedias["videos"])) {
    foreach ($dataMedias["videos"] as $x => $video) {
        $media = array();
        $media["legende"] = $video["legende"];
        $media["thumb"] = $video["thumb"];
        $media["button"]["video"] = array("link" => $video["player"]);
        $obj_module = new module("_hoverme");
        $obj_module->params = $media;
        $obj_module->return = true;
        $dataStd["videos"][$i]["imgHover"] = $obj_module->load();
        $i++;
    }
}
if (is_array($dataMedias["images"])) {
    foreach ($dataMedias["images"] as $x => $image) {
        echoa($params_module["noFirstImage"]);
        if ($params_module["noFirstImage"] == true && $x == 1) {
            continue;
        }
        $media = array();
        $media["legende"] = $image["legende"];
        $media["thumb"] = $image["vig0"];
        $media["image"] = $image["image"];
        $media["rel"] = 'group';
        $media["imgLiquid"] = "imgLiquidFill";
        $obj_module = new module("_hoverme");
        $obj_module->params = $media;
        $obj_module->return = true;
        $dataStd["images"][$i]["imgHover"] = $obj_module->load();
        $i++;
    }
コード例 #6
0
ファイル: class.bdd.php プロジェクト: wedesign-pf/code-g
 public function execute($debug = 0)
 {
     //$this->table > table="cli_resa";
     //$this->where > "pays=:pays AND date=:date AND nom!=''"
     //$this->whereValue > "AX" ou array('AX') ou array(140819,PDO::PARAM_INT)
     global $PDO;
     global $thisSite;
     try {
         $PDO->lock_table($this->table);
         if ($this->table == "") {
             return 0;
         }
         $requete = "DELETE FROM " . $this->table;
         if ($this->where != "") {
             $requete .= " WHERE " . $this->where . " ";
         }
         $result = $PDO->get_instante()->prepare($requete);
         if (is_array($this->whereValue)) {
             foreach ($this->whereValue as $key => $value) {
                 if (is_array($value)) {
                     list($val, $param) = $value;
                 } else {
                     $val = $value;
                 }
                 $result->bindValue(':' . $key, $val, $param);
             }
         }
         if ($debug == 1) {
             echoa($requete);
         }
         $r = $result->execute();
         $PDO->unlock_table($this->table);
     } catch (Exception $e) {
         global $gestionLogs;
         $gestionLogs->erreursPDO($e, $requete, $this->script);
     }
     return $r;
 }
コード例 #7
0
 public function _from_xtcode_to_xml($texte)
 {
     $texte = htmlspecialchars($texte);
     $texte = str_replace('&quot;', '"', $texte);
     $texte = preg_replace('`\\|code(="(.+)")\\|(.*)\\|/code\\|`isU', '<code nom="$2"><![CDATA[$3]]></code>', $texte);
     $texte = preg_replace('`\\|minicode(="(.+)")\\|(.*)\\|/minicode\\|`isU', '<minicode nom="$2"><![CDATA[$3]]></minicode>', $texte);
     $texte = nl2br($texte);
     $texte = str_replace('<br />', '<saut />', $texte);
     foreach ($this->_tags as $key => $keyConfig) {
         if (substr_count($texte, $key) > 0) {
             $nbParams = array_key_exists('nbParams', $keyConfig) ? $keyConfig['nbParams'] : 0;
             $keyConfig['type'] = array_key_exists('type', $keyConfig) ? $keyConfig['type'] : 'normale';
             $keyConfig['name_xml'] = array_key_exists('name_xml', $keyConfig) ? $keyConfig['name_xml'] : $key;
             if ($keyConfig['type'] == 'normale' || $keyConfig['type'] == 'image') {
                 $toAddXtc = null;
                 $toAddXml = null;
                 $addI = 0;
                 $indicMiddle = 1;
                 if ($keyConfig['type'] == 'image') {
                     $texte = preg_replace('`\\|image\\|(.+)\\|/image\\|`isU', '<image lien="$1">Image Utilisateur</image>', $texte);
                 }
                 for ($i = 1; $i <= $nbParams; $i++) {
                     $verifP = array_key_exists('choicesParam_' . $i, $keyConfig) && $keyConfig['choicesParam_' . $i] == true ? '(' . $keyConfig['choicesParam_' . $i] . ')' : '(.+)';
                     if ($i == 1) {
                         if (array_key_exists('optionalParam_' . $i, $keyConfig)) {
                             if ($keyConfig['optionalParam_' . $i] === true) {
                                 $texte = preg_replace('`\\|' . $key . '\\|(.+)\\|/' . $key . '\\|`isU', '<' . $keyConfig['name_xml'] . '>$' . $indicMiddle . '</' . $keyConfig['name_xml'] . '>', $texte);
                             } elseif ($keyConfig['optionalParam_' . $i] == true && array_search($keyConfig['optionalParam_' . $i], $keyConfig) == true) {
                                 $texte = preg_replace('`\\|' . $key . '\\|(.+)\\|/' . $key . '\\|`isU', '<' . $keyConfig['name_xml'] . ' ' . $keyConfig['optionalParam_' . $i] . '="$1">$1</' . $keyConfig['name_xml'] . '>', $texte);
                             }
                         } elseif (array_key_exists('defaultXml_' . $i, $keyConfig)) {
                             $texte = preg_replace('`\\|' . $key . '\\|(.+)\\|/' . $key . '\\|`isU', '<' . $keyConfig['name_xml'] . ' ' . $keyConfig['paramXml_' . $i] . '="' . $keyConfig['defaultXml_' . $i] . '">$' . $indicMiddle . '</' . $keyConfig['name_xml'] . '>', $texte);
                         }
                         $toAddXtc .= '="' . $verifP . '"';
                         $indicMiddle = 2;
                     } else {
                         if (array_key_exists('optionalParam_' . $i, $keyConfig) && $keyConfig['optionalParam_' . $i] === true) {
                             $texte = preg_replace('`\\|' . $key . $toAddXtc . '\\|(.+)\\|/' . $key . '\\|`isU', '<' . $keyConfig['name_xml'] . $toAddXml . '>$' . $indicMiddle . '</' . $keyConfig['name_xml'] . '>', $texte);
                         }
                         $toAddXtc .= ' ' . (isset($keyConfig['paramXtc_' . $i]) ? $keyConfig['paramXtc_' . $i] : $keyConfig['paramXml_' . $i]) . '="' . $verifP . '"';
                         $indicMiddle = $nbParams + 1;
                     }
                     $toAddXml .= ' ' . $keyConfig['paramXml_' . $i] . '="$' . $i . '"';
                 }
                 $texte = preg_replace('`\\|' . $key . $toAddXtc . '\\|(.+)\\|/' . $key . '\\|`isU', '<' . $keyConfig['name_xml'] . $toAddXml . '>$' . $indicMiddle . '</' . $keyConfig['name_xml'] . '>', $texte);
             }
         }
     }
     load('phpmathpublisher/mathpublisher', INC_LOAD);
     $results = array();
     while (preg_match('`\\|math\\|(.*)\\|/math\\|`isU', $texte, $results)) {
         $str = $results[1];
         if (strlen($str) > 1000) {
             $texte = str_replace('|math|' . $str . '|/math|', '', $texte);
             continue;
         }
         $img = mathfilter('<m>' . $str . '</m>', 15, ROOTU . 'cache/maths/');
         $matches = array();
         preg_match('`"(http://.+)"`isU', $img, $matches);
         echoa($matches);
         $adresse = trim($matches[0], '"');
         $texte = str_replace('|math|' . $str . '|/math|', '<math lien="' . $adresse . '" form="' . $str . '" />', $texte);
         break;
     }
     #$texte = preg_replace('`<code(\snom="(.+)")>(.*)<br />(.*)</code>`isU', '<code nom="$2">$3$4</code>', $texte );
     #$texte = preg_replace('`<minicode(\snom="(.+)")>((.*)<saut />(.*))*</minicode>`isU', '<minicode nom="$2">$4$5</minicode>', $texte );
     #		$texte = preg_replace('`<liste>(<saut />\s)*<puce>`sU', '<liste><puce>', $texte);
     #		$texte = preg_replace('`</puce>(<saut />\s)*<puce>`sU', '</puce><puce>', $texte);
     #		$texte = preg_replace('`</puce>(<br />\s)*<liste>`sU', '</puce><liste>', $texte);
     #		$texte = preg_replace('`</liste>(<br />\s)*</puce>`sU', '</liste></puce>', $texte);
     #		$texte = preg_replace('`</puce>(<br />\s)*</liste>`sU', '</puce></liste>', $texte);
     $this->xml_content = $texte;
     return $texte;
 }
コード例 #8
0
ファイル: class.form.php プロジェクト: wedesign-pf/Tit
 public function get_datas($debug = 0)
 {
     global $myAdmin;
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $this->tables;
     $mySelect->fields = $this->fields;
     $mySelect->limit = 1;
     $mySelect->where = $this->whereFull;
     foreach ($this->whereValuebyLg as $clg => $whereValueFull) {
         $mySelect->whereValue = $whereValueFull;
         $result = $mySelect->query($debug);
         $row = current($result);
         //echoa($row);
         if (is_array($row)) {
             foreach ($row as $k => $v) {
                 $k = htmlspecialchars($k, ENT_QUOTES);
                 $row[$k] = htmlspecialchars($row[$k], ENT_QUOTES);
             }
             $this->datasForm[$clg] = $row;
         } else {
             $this->datasForm[$clg] = array();
         }
         //echoa($row);
     }
     if ($debug == 3) {
         echoa($this->datasForm);
     }
     return 1;
 }
コード例 #9
0
<?php

require_once '../../kernel/begin.php';
load('members/authorizations');
load('members/groups');
echoa($rights);
var_dump($rights->verif(RIGHT_READ));
var_dump($rights->verif(RIGHT_MODIFY));
var_dump($rights->verif(RIGHT_DELETE));
var_dump($rights->verif(RIGHT_MODERATE));
コード例 #10
0
ファイル: class.logs.php プロジェクト: wedesign-pf/Tit
 public function addlog($prefixe_log, $erreur)
 {
     global $thisSite;
     if ($adminActive == true) {
         $prefixe = "adm_";
         $path = "../";
     } else {
         $prefixe = "";
         $path = "";
     }
     // Enregistrement de l'erreur dans un fichier txt
     $file_log = $path . $thisSite->DOS_LOGS . $prefixe . 'logs' . $prefixe_log . "_" . date('Y-m-d') . '.txt';
     $handle = @fopen($file_log, "a");
     //
     if ($handle) {
         $xx = fwrite($handle, $erreur);
         fclose($handle);
     } else {
         //echo("Erreur d'ouverture du fichier.");
         echoa("{$erreur}");
     }
     //$this->mail_send('*****@*****.**',$this->email_erreur,$erreur,'LOGS PDO SITE ' . $thisSite->RACINE . " : " . $type_erreur );
 }
コード例 #11
0
$lang->setModule('cours', 'gerer');
require_once 'cours.class.php';
$action = isset($_GET['action']) ? $_GET['action'] : 'voirListeTous';
switch ($action) {
    case 'voirListeTous':
        $cours = new Cours(false, $member->getId());
        break;
    case 'ajouterTutoriel':
        $form = new Form(translate('title_add_form'));
        $form->add_fieldset();
        $form->add_input('cours_nom', 'cours_nom', translate('cours_name_form'));
        $form->add_textarea('cours_introduction', 'cours_introduction', translate('cours_intro_form'));
        $form->add_textarea('cours_conclusion', 'cours_conclusion', translate('cours_conclu_form'));
        $choixCategory = $form->add_box('cours_isCategorie', 'checkbox');
        $choixCategory->add('isCategory', 'isCategory', translate('cours_isCategory_form'));
        echoa($form);
        $listeCategories = $form->add_list('cours_categorie', 'cours_categorie', translate('cours_category_form'));
        $requeteCategories = $bdd->query('SELECT cours_level, cours_id, cours_nom FROM ' . TABLE_COURS . ' WHERE cours_type = 0 ORDER BY cours_gauche');
        while ($donneesCategories = $bdd->fetch($requeteCategories)) {
            $suffixe = NULL;
            for ($i = 0; $i < $donneesCategories['cours_level']; $i++) {
                $suffixe .= '--';
            }
            $suffixe .= '>';
            $listeCategories->add($suffixe . ' ' . htmlspecialchars($donneesCategories['cours_nom']), $donneesCategories['cours_id']);
        }
        $form->add_button();
        $fh = new FormHandle($form);
        $fh->handle();
        if ($fh->okay()) {
            $dataCours['coursNom'] = $fh->get('cours_nom');