Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2008
    Messaggi
    266

    inserire password allo script mygallery

    Salve raga, come posso fare dal pannello di controllo ad inserire una password all'album che sto creando nello script mygallery? magari modificando il codice..

  2. #2

    Re: inserire password allo script mygallery

    Originariamente inviato da k4osz
    script mygallery
    lo script non è famoso e la domanda non è chiara
    http://www.miniscript.it
    Se ti sono stato di aiuto in qualche modo in questo forum iscriviti alla fan page di Miniscript - il mio blog di programmazione web.

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2008
    Messaggi
    266
    http://www.planetluc.com/en/scripts_mygallery.php questo è il sito (potete vedere la demo).
    Nel pannello di controllo, per creare l'album ci sono un paio di campi da compilare:
    nome
    descrizione
    upload ecc..

    io vorrei inserire anche un form per mettere la password all'album che vorrei io.

  4. #4
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    e' uno script gia' fatto vedo.
    inserisci un nuovo campo nel DB ((password)(magari MD5))
    nel form che gia' hai, metti il campo "password"
    correggi la query

    Apri la pagina di questo script e posta la parte interessata!

    mi scarico il zip, visto che cercavo qualche cosa gia' fatta.
    ¿Hasta la pasta?

  5. #5
    Utente di HTML.it
    Registrato dal
    Apr 2008
    Messaggi
    266
    Cmq lo script lo sto facendo funzionare senza mysql, quindi non devo inserire niente..
    Il file da modificare è gallery.inc.php:

    credo sia questa parte..
    Codice PHP:
    // display admin cp header
            
    echo "<table border='0' align='center' cellpadding='2' cellspacing='2' class='mgtxt'>\n";
            echo 
    "<tr><td class='mgadmincap'>\n";
            echo 
    "<table width='100%'  border='0' cellpadding='0' cellspacing='0' class='mgtxt'>\n";
            echo 
    "<tr><td ><font color='#FFFFFF'>[b]MyGallery Admin CP[/b]</font></td>\n";
            echo 
    "<td align='right' style='color:#ffffff;'>[[url='$me$getvars']$txtlogout[/url]] </td>\n";
            echo 
    "</tr></table>\n";
            echo 
    "</td></tr>\n";

            
    // if in gallery edit mode
            
    if ($showedit || $_REQUEST['mgaction']=="edit"){
                
    $gal=$_REQUEST['mggal'];
                echo 
    "<tr><td class='mgadmintdbg'>\n";
                echo 
    "[b]$txtediting<em style='letter-spacing:1px'>".$galleries[$gal][1]."[/i][/b]

    \n"
    ;
                echo 
    "<form name='form1' enctype='multipart/form-data' method='post' action='$me$getvars'>\n";
                echo 
    "[b]$txtaddpicscap[/b]
    $txtaddpics
    <input name='mgfile' type='file' id='mgfile' class='mginputln'>
    \n"
    ;
                if (
    $mgConf['watermarkimg'] != "") echo "<input name='mgwatermark' type='checkbox' id='mgwatermark' class='mginputradio' checked='checked'> <label for='mgwatermark'>$txtincludewatermark</label>
    \n"
    ;        
                echo 
    "<input type='submit' name='Submit' value='$txtadd'>\n";
                echo 
    "<input name='mgdo' type='hidden' id='mgdo' value='admin'>\n";
                echo 
    "<input name='mgaction' type='hidden' id='mgdo' value='upload'>\n";
                echo 
    "<input name='mggal' type='hidden' id='mgdo' value='$gal'>\n";
                echo 
    "<input name='mghash' type='hidden' id='mgdo' value='$hash'>\n";
                echo 
    "<center style='color:#cc0000;'>$output</center>\n";
                echo 
    "</form>
    \n"
    ;
                

                
    $caps=getcaps($gal$imgdir);
                
    $i=1;
                
    $pictures getpics($gal$imgdir$mgConf['pathtoscript'], $mgConf['thumbnails']);
                if (
    $pictures!==false){
                
                    echo 
    "<form name='fomr9' method='post' action='$me$getvars'>\n";
                    echo 
    "[b]$txtgalname[/b]
    "
    ;
                    echo 
    "<input name='mggallery' type='text' id='mggallery' style='width:100%;' value='".(stripslashes($galleries[$gal][1]))."' class='mginputln'>

    \n"
    ;
                    echo 
    "[b]$txtdescription[/b]
    "
    ;
                    echo 
    "<textarea name='mgdescr'  id='mgdescr' style='width:100%;' rows='5' class='mginputln'>".(brtonl(stripslashes($galleries[$gal][2])))."</textarea>
    \n"
    ;
                    echo 
    "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='2' class='mgtxt'><tr class='mgsmall'>\n\n";
                    foreach (
    $pictures as $pic){
                        
    $img=($mgConf['thumbnails']) ? $pic['thumb'] : $pic['pic'];
                        
    $size=getimagesize($img);
                        
    $attr=($size[0]>$mgConf['thumbwidth']) ? "width='".$mgConf['thumbwidth']."' height='".($mgConf['thumbwidth']*$size[1]/$size[0])."'" "width='$size[0]' height='$size[1]'";
                        
                        echo 
    "<td width='25%' valign='top' class='mgaltbgcol'>\n";
                   echo 
    "$txtcaption
    <input name='mgcap["
    .$pic['id']."]' type='text' id='mglogin' size='15' value='".(stripslashes($caps[$pic['id']]))."' class='mginputln'>
    \n"
    ;
                   
                        
    // rename file
                        
    echo "$txtfilename
    <input name='mgfilename["
    .$pic['id']."]' type='text' id='mglogin' size='15' value='".$pic['id']."' class='mginputln'>
    \n"
    ;
                        
                        echo 
    "<input name='mgtodel[".$pic['id']."]' type='checkbox' value='1' style='vertical-align:-5px;' id='mgtodel[".$pic['id']."]'>[<label for='mgtodel[".$pic['id']."]'>$txtdelete</label>]
    \n"
    ;
                        echo 
    "[img]$img[/img]\n";
                        echo 
    "</td>\n\n";
                        if (
    fmod($i$mgConf['thumbcolsadmin'])==0) echo "</tr><tr class='mgsmall'>\n";
                        
    $i++;
                    }
                    echo 
    "</tr><tr><td colspan='".$mgConf['thumbcolsadmin']."' align='center' height='40' valign='bottom'>";
                    echo 
    "<input type='submit' name='Submit' value='$txtsavechange'>\n";
                    echo 
    "<input type='button' value='$txtback' onClick='location.href=\"$me$getvars&mgdo=admin\"'>\n";
                    echo 
    "<input name='mgdo' type='hidden' id='mgdo' value='admin'>\n";
                    echo 
    "<input name='mgaction' type='hidden' id='mgdo' value='savegal'>\n";
                    echo 
    "<input name='mghash' type='hidden' id='mgdo' value='$hash'>\n";
                    echo 
    "<input name='mggal' type='hidden' id='mgdo' value='$gal'>\n";
                    echo 
    "</td></tr></table></form>\n";
                }
    // endif $pictures!==false
                
    echo "</td></tr>\n";            
                
            
    // else in not edit mode
            
    }else{
                
                
    // upload new gallery form
                
    echo "<tr><td class='mgadmintdbg'>\n";
                echo 
    "<form name='form1' enctype='multipart/form-data' method='post' action='$me$getvars'>\n";
                echo 
    "[b]$txtnewgal[/b]
    $txtzipdesc

    \n"
    ;
                echo 
    "<table width='100%' border='0' cellspacing='0' cellpadding='1'  class='mgtxt'>\n";
                echo 
    "<tr><td width='100'>$txtgalname:</td>\n";
                echo 
    "<td><input name='mggallery' type='text' id='mggallery' style='width:100%;' class='mginputln'></td></tr>\n";
                echo 
    "<tr><td width='100'>$txtdescription:</td>\n";
                echo 
    "<td><textarea name='mgdescr' type='text' id='mgdescr'style='width:100%;' rows='4' class='mginputln'></textarea></td></tr>\n";
                echo 
    "<tr><td></td><td>";
                if (
    $mgConf['watermarkimg'] != "") echo "<input name='mgwatermark' type='checkbox' id='mgwatermark' class='mginputradio' checked='checked'> <label for='mgwatermark'>$txtincludewatermark</label>";
                echo 
    "</td>\n";
                echo 
    "<tr><td></td>\n";
                echo 
    "<td>($txtselzip
    <input name='mgfile' type='file' id='mgfile' class='mginputln'>\n"
    ;
                echo 
    "</td></tr>\n";
                echo 
    "<tr><td></td>\n";
                echo 
    "<td height='40'>\n";
                echo 
    "<input type='submit' name='Submit' value='$txtbuild'>\n";
                echo 
    "<input name='mgdo' type='hidden' id='mgdo' value='admin'>\n";
                echo 
    "<input name='mgaction' type='hidden' id='mgdo' value='upload'>\n";
                echo 
    "<input name='mghash' type='hidden' id='mgdo' value='$hash'>\n";
                echo 
    "</td></tr></table>\n";
                echo 
    "<center style='color:#cc0000;'>$output</center>\n";
                echo 
    "</form></td></tr>\n";
                
                
    // show gallery list
                
    if($galleries!==false){
                    echo 
    "<tr><td class='mgadmintdbg'>[b]$txtexgals

    [/b]\n"
    ;
                    echo 
    "<table width='100%'  border='0' cellspacing='0' cellpadding='0'  class='mgtxt'>\n";
                    echo 
    "<tr>\n";
                    echo 
    "<td width='30' align='center' class='mgadmincap'><font color='#FFFFFF'>#</font></td>\n";
                    echo 
    "<td class='mgadmincap'><font color='#FFFFFF'>$txtname</font></td>\n";
                    echo 
    "<td class='mgadmincap'></td>\n";
                    echo 
    "</tr>\n";            

                    
    $i=1;
                    
    $bgcol[0]="";
                    
    $bgcol[1]="class='mgaltbgcol'"
                    
    krsort($galleries);
                    
    //print_r($galleries);
                    
    foreach($galleries as $gal){
                        
    $name = (strlen($gal[1]) > 38) ? substr($gal[1], 038)."..." $gal[1];
                        echo 
    "<tr ".$bgcol[fmod($i,2)].">\n";
                        echo 
    "<td align='center'>$i</td>\n";
                        echo 
    "<td>[url='$me$getvars&mggal=$gal[0]']".stripslashes($name)."[/url]</td>\n";
                        echo 
    "<td align='right'>";
                        echo 
    "[url='$me$getvars&mgdo=admin&mgaction=move&mgcmd=up&mgid=$gal[0]']$txtup[/url]\n";
                        echo 
    "[url='$me$getvars&mgdo=admin&mgaction=move&mgcmd=down&mgid=$gal[0]']$txtdown[/url]\n";
                        echo 
    "[url='$me$getvars&mgdo=admin&mgaction=edit&mggal=$gal[0]']$txtedit[/url]\n";
                        echo 
    "[url='javascript: if(confirm(\"$txtasktodel\")){ location.href=\"$me$getvars&mgdo=admin&mgaction=delete&mgid=$gal[0]\";}']$txtdelete[/url]\n";
                        echo 
    "</td>\n";
                        echo 
    "</tr>\n";
                        
    $i++;
                    }
                    echo 
    "</table>\n";
                    echo 
    "</td></tr>\n";
                }
            }
    // endif (not edit mode)
            
    echo "</table>\n";
            
        
    // if not logged in -> admin login form    
        
    }else{ 
            echo 
    "<script language='JavaScript'>\n";
            echo 
    "window.onload=function(){ document.forms['loginform'].elements['mglogin'].focus(); }\n";
            echo 
    "</script>\n";
            echo 
    "<table border='0' align='center' cellpadding='2' cellspacing='2' class='mgtxt'>\n";
            echo 
    "<tr><td class='mgadmincap'><font color='#FFFFFF'>[b]MyGallery Admin CP [/b]</font></td></tr>\n";
            echo 
    "<tr><td class='mgadmintdbg'>\n";
            echo 
    "<form name='loginform' method='post' action='$me$getvars'>\n";
            echo 
    "$txtlogin <input name='mglogin' type='text' id='mglogin' size='20' class='mginputln'>\n";
            echo 
    "$txtpass <input name='mgpwd' type='password' id='mgpwd' size='20' class='mginputln'>\n";
            echo 
    "<input type='submit' name='Submit' value='Login'>\n";
            echo 
    "<input name='mgdo' type='hidden' id='mgdo' value='admin'>\n";
            echo 
    "<input name='mgaction' type='hidden' id='mgaction' value='login'>\n";
            echo 
    "<input name='mghash' type='hidden' id='mgdo' value='$hash'>\n";
            echo 
    "</form></td></tr></table>\n";
        }



    // ***************************** MAIN *****************************
    // ****************************************************************



    // if not in admin mode
    }else{

        if (
    $mgConf['is_cmsms_module'] === true && adminloggedin($logfile)){
            echo 
    "[url='$me$getvars&mgdo=admin']$txtadmin[/url]

    "
    ;
        }
        
        
    // get gallery list from data file
        
    $galleries=false;
        if (
    $gals=file($galfile)){            
                foreach (
    $gals as $gal){
                    
    $galexplode('|'rtrim($gal));
                    
    $galleries[$gal[0]] = array($gal[0], $gal[1], $gal[2]);
                }
                
    krsort($galleriesSORT_NUMERIC);
        }
        
        
    // show the gallery list
        
    if (!isset($_REQUEST['mggal'])){            
        
            if (
    $galleries!==false){
            
                
    // reorganize $galleries array
                
    $foo=$galleries;
                
    $galleries=array();
                foreach (
    $foo as $g$galleries[]=$g;
                
                
    // paging
                
    $page=(is_numeric($_REQUEST['mgpage'])) ? $_REQUEST['mgpage'] : 1;
                
    $start= ($page-1) * $mgConf['gpp'];
                
    $numgals=count($galleries);
                
    $pages=ceil($numgals/$mgConf['gpp']);

                
    $paging=paging($pages"mgpage");
                
                
    // get template for gallleries list
                
    $tpl=getTemplate("GALLERIES"implode(""file($tplfile)));
                
    $tplrow=getTemplate("ROW"$tpl);
                            
                
    $rows="";
                for (
    $i=$start$i<($start+$mgConf['gpp']); $i++){
                    if (
    is_array($galleries[$i])){
                        
    $gal=$galleries[$i];

                        
    // get random preview thumbnail
                        
    $pictures getpics($gal[0], $imgdir$mgConf['pathtoscript'], $mgConf['thumbnails']);
                        
    $c=count($pictures);
                        
    $imgsrc=$pictures[rand(0, ($c-1))]['thumb'];
                        
                        
    $match=array("{urlthumb}""{title}""{description}""{urlgallery}");
                        
    $replace=array($imgsrcstripslashes($gal[1]), $gal[2], $me.$getvars."&mggal=".$gal[0]);
                        
    $rows.=str_replace($match$replace$tplrow);
                    }
                }
                            
                
    $match= array("/\{paging\}/""/<\!\-\-ROW\-\->(.*?)<\!\-\-ROW\-\->/s");
                
    $replace= array($paging$rows);
                
    $html preg_replace($match$replace$tpl);
                echo 
    execTemplate($html);


                
                
            }
    // endif $galleries!==false)
        
        
            
        // show specific gallery
        
    }else{
        
            
    $gal=$_REQUEST['mggal'];
            
            if (
    $pictures getpics($gal$imgdir)){
                
    $numpics=count($pictures);
                        
                
    // show thumbnails page
                
    if (!isset($_REQUEST['mgid']) && $mgConf['thumbnails']){ 
                
                    
    // paging
                    
    $page = (is_numeric($_REQUEST['mgpage'])) ? $_REQUEST['mgpage'] : 1;
                    
    $start = ($page-1) * $mgConf['tpp'];
                    
    $end = ($start $mgConf['tpp'] > $numpics) ? $numpics : ($start $mgConf['tpp']);
                    
    $pages ceil($numpics/$mgConf['tpp']);
                    
    $paging paging($pages"mgpage"); 

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.