Exemple #1
0
// Affichage
$image = $row[2];
$comment = $row[3];
list($gallery) = sql_fetch_row(sql_query("select nom from " . $NPDS_Prefix . "tdgal_gal where id='{$row['1']}'"));
list($gal_acces) = sql_fetch_row(sql_query("select acces from " . $NPDS_Prefix . "tdgal_gal where id='{$row['1']}'"));
$chemin = "modules/{$ModPath}/imgs/" . $image;
list($width, $height, $type, $attr) = @getimagesize("{$chemin}");
$h_i = $height + 40;
$w_i = $width + 40;
if (file_exists($chemin)) {
    if ($width > 100) {
        $width = 100;
    }
    $ibid = '<img class="img-fluid card-img-top" src="modules/' . $ModPath . '/imgs/' . $image . '" border="0" />';
}
//Affichage de l'image
$content .= '<div class="card">';
if ($image != "") {
    $content .= "<a href=\"javascript:picview('{$chemin}', '{$image}', '{$comment}', '{$w_i}', '{$h_i}')\">{$ibid}</a>";
} else {
    $content .= "<p class=\"card-text text-xs-center\">" . gal_trans("vous n'avez accés à aucune galerie") . "</p>";
}
//Affichage de l'invite de connexion dans le bloc si galerie privée
if (!isset($user) and $gal_acces != 0) {
    /* 0 pour accès public */
    $content .= "<div class=\"card-block\"><p class=\"card-text text-xs-center\"><a href=\"user.php\">" . gal_trans("Galerie Privée, connectez vous") . "</a></p>";
    $content .= '</div></div>';
} else {
    $content .= "<div class=\"card-block\"><p class=\"card-text text-xs-center\"><a href=\"modules.php?ModPath={$ModPath}&ModStart=gal&op=gal&galid={$row['1']}\">" . $gallery . "</a></p>";
    $content .= '</div></div>';
}
Exemple #2
0
    die;
}
// For More security
global $language;
include_once "modules/{$ModPath}/gal_conf.php";
include_once "modules/{$ModPath}/gal_func.php";
include_once "modules/{$ModPath}/lang/{$language}.php";
if (!isset($data)) {
    redirect_url("modules.php?ModPath={$ModPath}&ModStart=gal");
}
$card_data = array();
$card_data = @unserialize(@base64_decode($data));
list($width, $height, $type, $attr) = getimagesize($card_data['pf']);
$message = "<!DOCTYPE html>\n";
$message .= "<head>\n";
$message .= "<title>" . gal_trans("Une e-carte pour vous") . "</title>\n";
$message .= '<meta http-equiv="content-type" content="text/html" />';
$message .= '<meta charset="utf-8" />';
$message .= '<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />';
$message .= '<meta http-equiv="x-ua-compatible" content="ie=edge" />';
$message .= '<meta http-equiv="content-script-type" content="text/javascript" />';
$message .= '<meta http-equiv="content-style-type" content="text/css" />';
$message .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />\n";
$message .= "</head>\n";
$message .= "<body>\n";
$message .= "<br />\n";
$message .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" align=\"center\">\n";
$message .= "<tr><td bgcolor=\"#000000\">\n";
$message .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\" bgcolor=\"#ffffff\">\n";
$message .= "<tr><td valign=\"top\">\n";
$message .= "<img src=\"" . $card_data['pf'] . "\" border=\"1\" {$attr} /><br />\n";
Exemple #3
0
function PrintExportCat()
{
    global $NPDS_Prefix, $ThisFile;
    echo "<form action=\"" . $ThisFile . "\" method=\"post\" name=\"FormCat\">";
    echo "<input type=\"hidden\" name=\"subop\" value=\"massexport\">";
    echo '
      <fieldset class="form-group">
      <label for="">' . gal_trans("Nom de la catégorie") . '</label>
      <select name="cat" class="form-control" id="">
      <option value="none" selected>' . gal_trans("Choisissez") . '</option>';
    $query = sql_query("SELECT id,nom,acces FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid='0' ORDER BY nom ASC");
    while ($row = sql_fetch_row($query)) {
        echo '<option value=' . $row[0] . '>' . stripslashes($row[1]) . '</option>';
    }
    echo '
      </select>
      </fieldset>
      <input class="btn btn-secondary" type="submit" value=' . gal_trans("Exporter") . '>
      </form>';
}
Exemple #4
0
while ($row = sql_fetch_row($query)) {
    $where2 .= "(gal_id='{$row['0']}')";
    $i++;
    if ($i < $count) {
        $where2 .= " OR ";
    }
}
$query = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_img WHERE {$where2} ORDER BY RAND() LIMIT 0,1");
$row = sql_fetch_row($query);
// Affichage
$image = $row[2];
$comment = $row[3];
list($gallery) = sql_fetch_row(sql_query("SELECT nom FROM " . $NPDS_Prefix . "tdgal_gal WHERE id='{$row['1']}'"));
$chemin = "modules/{$ModPath}/imgs/" . $image;
list($width, $height, $type, $attr) = @getimagesize("{$chemin}");
$h_i = $height + 40;
$w_i = $width + 40;
if (file_exists($chemin)) {
    if ($width > 100) {
        $width = 100;
    }
    $ibid = '<img class="img-fluid card-img-top" src="modules/' . $ModPath . '/imgs/' . $image . '" border="0" />';
}
$content .= '<div class="card">';
if ($image != "") {
    $content .= "<a href=\"javascript:picview('{$chemin}','{$image}','{$comment}','{$w_i}','{$h_i}')\">{$ibid}</a>";
} else {
    $content .= '<p class="card-text text-xs-center">' . gal_trans("vous avez accès à aucune galerie") . '</p>';
}
$content .= '<div class="card-block"><p class="card-text text-xs-center"><a href="modules.php?ModPath=npds_galerie&amp;ModStart=gal&amp;op=gal&amp;galid=' . $row[1] . '">' . $gallery . '</a></p>';
$content .= '</div></div>';
Exemple #5
0
function AddImgs($imgscat, $newcard1, $newdesc1, $newcard2, $newdesc2, $newcard3, $newdesc3, $newcard4, $newdesc4, $newcard5, $newdesc5, $user_connecte)
{
    global $language, $MaxSizeImg, $MaxSizeThumb, $ModPath, $ModStart, $NPDS_Prefix, $ThisFile, $adminmail, $nuke_url, $notif_admin;
    include_once "modules/upload/lang/upload.lang-{$language}.php";
    include_once "modules/upload/clsUpload.php";
    $newdesc1 = $newdesc1 . gal_trans(" proposé par ") . $user_connecte;
    $newdesc2 = $newdesc2 . gal_trans(" proposé par ") . $user_connecte;
    $newdesc3 = $newdesc3 . gal_trans(" proposé par ") . $user_connecte;
    $newdesc4 = $newdesc4 . gal_trans(" proposé par ") . $user_connecte;
    $newdesc5 = $newdesc5 . gal_trans(" proposé par ") . $user_connecte;
    $year = date("Y");
    $month = date("m");
    $day = date("d");
    $hour = date("H");
    $min = date("i");
    $sec = date("s");
    echo '<h4 class="breadcrumb"><a href="' . $ThisFile . '">' . gal_trans("Accueil") . '</a></h4>';
    echo '<p>' . gal_trans("Proposer des images") . '</p>';
    echo "<ul>";
    $soumission = false;
    $i = 1;
    while ($i <= 5) {
        $img = "newcard{$i}";
        $tit = "newdesc{$i}";
        if (!empty(${$img})) {
            $newimg = stripslashes(removeHack(${$img}));
            if (!empty(${$tit})) {
                $newtit = addslashes(removeHack(${$tit}));
            } else {
                $newtit = "";
            }
            $upload = new Upload();
            $upload->maxupload_size = 200000 * 100;
            $origin_filename = trim($upload->getFileName("newcard" . $i));
            $filename_ext = strtolower(substr(strrchr($origin_filename, "."), 1));
            if ($filename_ext == "jpg" or $filename_ext == "gif") {
                $newfilename = $year . $month . $day . $hour . $min . $sec . "-" . $i . "." . $filename_ext;
                if ($upload->saveAs($newfilename, "modules/{$ModPath}/imgs/", "newcard" . $i, true)) {
                    if (function_exists('gd_info') or extension_loaded('gd')) {
                        @CreateThumb($newfilename, "modules/{$ModPath}/imgs/", "modules/{$ModPath}/imgs/", $MaxSizeImg, $filename_ext);
                        @CreateThumb($newfilename, "modules/{$ModPath}/imgs/", "modules/{$ModPath}/mini/", $MaxSizeThumb, $filename_ext);
                    }
                    if (sql_query("INSERT INTO " . $NPDS_Prefix . "tdgal_img VALUES ('','{$imgscat}','{$newfilename}','{$newtit}','','0','1')")) {
                        echo "<li>" . gal_trans("Photo envoyée avec succès, elle sera traitée par le webmaster") . " : {$origin_filename}</li>";
                        $soumission = true;
                    } else {
                        echo "<li><span class=\"text-danger\">" . gal_trans("Impossible d'ajouter l'image en BDD") . " : {$origin_filename}</span></li>";
                        @unlink("modules/{$ModPath}/imgs/{$newfilename}");
                        @unlink("modules/{$ModPath}/mini/{$newfilename}");
                    }
                } else {
                    echo "<li><span class=\"text-danger\">" . $upload->errors . "</span></li>";
                }
            } else {
                if ($filename_ext != "") {
                    echo "<li><span class=\"text-danger\">" . gal_trans("Ce fichier n'est pas un fichier jpg ou gif") . " : {$origin_filename}</span></li>";
                }
            }
        }
        $i++;
    }
    echo "</ul>";
    if ($notif_admin and $soumission) {
        $subject = gal_trans("Nouvelle soumission de Photos");
        $message = gal_trans("Des photos viennent d'être proposées dans la galerie photo du site ") . $nuke_url . gal_trans(" par ") . $user_connecte;
        send_email($adminmail, $subject, $message, "", true, "html");
    }
}
Exemple #6
0
        case "massexport":
            MassExportCat($cat);
            break;
        case "ordre":
            ordre($img_id, $ordre);
            break;
        default:
            $ncateg = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid='0'"));
            $nsscat = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid!='0'"));
            $numgal = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_gal"));
            $ncards = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_img"));
            $ncomms = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_com"));
            $nvotes = sql_fetch_row(sql_query("SELECT COUNT(id) FROM " . $NPDS_Prefix . "tdgal_vot"));
            $nviews = sql_fetch_row(sql_query("SELECT SUM(view) FROM " . $NPDS_Prefix . "tdgal_img"));
            echo '<br />';
            echo '<h4>' . gal_trans("Tableau récapitulatif") . '</h4>';
            echo '<ul class="list-group">
   <li class="list-group-item">' . gal_trans("Nombre de catégories") . '<span class="label label-default pull-xs-right">' . $ncateg[0] . '</span></li>
   <li class="list-group-item">' . gal_trans("Nombre de sous-catégories") . '<span class="label label-default pull-xs-right">' . $nsscat[0] . '</span></li>   
   <li class="list-group-item">' . gal_trans("Nombre de galeries") . '<span class="label label-default pull-xs-right">' . $numgal[0] . '</span></li>
   <li class="list-group-item">' . gal_trans("Nombre d'images") . '<span class="label label-default pull-xs-right">' . $ncards[0] . '</span></li>   
   <li class="list-group-item">' . gal_trans("Nombre de commentaires") . '<span class="label label-default pull-xs-right">' . $ncomms[0] . '</span></li> 
   <li class="list-group-item">' . gal_trans("Nombre de votes") . '<span class="label label-default pull-xs-right">' . $nvotes[0] . '</span></li>   
   <li class="list-group-item">' . gal_trans("Images vues") . '<span class="label label-default pull-xs-right">' . $nviews[0] . '</span></li>
   <li class="list-group-item">' . gal_trans("Version du module") . '<span class="label label-default pull-xs-right">Version : ' . $npds_gal_version . '</span></li>   
   </ul>
   ';
            break;
    }
    adminfoot('fv', '', '', '');
}