Results 1 to 6 of 6

Thread: PHP .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    morf's Avatar
    Join Date: Jun:2002
    Location: Skaville
    Posts: 2,331

    PHP .

    , PHP-

    php , gal-title.txt . , .

    , gal-title.txt, , .

    PHP , gal-desc.txt:

    Code:
    function getDirDesc($dir){
        $file=$dir.GAL_FILE;
        if(file_exists($file)){
            $fd=@fopen($file,'r');
            while(!feof($fd))
                $desc.=@fread($fd,1024);
        }
        return $desc;
    }
    :

    Code:
    <?php
    if($dir!=''){
        echo "\t<hr/>\n";
        echo "\t".get(42).":<br/><br/>\n";
    
        echo "\t<form method=\"get\" action=\"\"><div>\n";
        echo "\t\t".str_replace("/","",str_replace("_"," ",$curr_dir))."\n";
        if($rename&&$pic==''){
            echo "\t\t<input type=\"hidden\" name=\"dir\" value=\"{$dir}\" />\n";
            echo "\t\t<input type=\"hidden\" name=\"rename\" value=\"true\" />\n";
            echo "\t\t<input type=\"hidden\" name=\"confirm\" value=\"true\" />\n";
            echo "\t\t<br/><input name=\"name\" value=\"".str_replace("_"," ",$curr_dir)."\" />\n";
            echo "\t\t<input type=\"submit\" value=\"".get(43)."\" /><br/>\n";
        }
        else
            echo "\t\t[<a href=\"?dir={$dir}&amp;rename=true\">".get(43)."</a>]\n";
    
        $desc=getDirDesc(BASE_DIR.$dir);
        if($desc==''&&!$edit) $desc=get(48);
    
        if($edit&&$pic==''){
            echo "\t\t<input type=\"hidden\" name=\"dir\" value=\"{$dir}\" />\n";
            echo "\t\t<input type=\"hidden\" name=\"edit\" value=\"true\" />\n";
            echo "\t\t<input type=\"hidden\" name=\"confirm\" value=\"true\" />\n";
            echo "\t\t<textarea name=\"desc\" cols=\"25\" rows=\"15\">{$desc}</textarea><br/>\n";
            echo "\t\t<input type=\"submit\" value=\"".get(47)."\" />\n";
        }
        else{
            echo "\t\t<span class=\"description\">{$desc}\n";
            echo "\t\t[<a href=\"?dir={$dir}&amp;edit=true\">".get(49)."</a>]</span>\n";
        }
        echo "\t</div></form>\n";
    
    
    }
    ?>
    GAL_FILE settings.php
    Code:
    define("GAL_FILE","gal-desc.txt");
    ....

    1. setings.php :
    Code:
    define("GAL_TITLE","gal-title.txt");
    2. PHP :
    Code:
    function getDirTitle($dir){
        $file=$dir.GAL_TITLE;
        if(file_exists($file)){
            $fd=@fopen($file,'r');
            while(!feof($fd))
                $desc.=@fread($fd,1024);
        }
        return $desc;
    }
    3. , GAL_FILE, GAL_TITLE. 1-2 , .

    , gal-desc.txt. , gal-title.txt. get(..) , - . ... , ,

    ,

    : . gal-title.txt . .
    Last edited by morf; 9th January 2007 at 11:21.

  2. #2
    Registered User dil's Avatar
    Join Date: Sep:2003
    Location: ,
    Posts: 1,125
    SPGM

    .


    Code:
     echo "\t\t<input type=\"submit\" value=\"".get(47)."\" />\n";
    get(47) , SPGM

  3. #3
    morf's Avatar
    Join Date: Jun:2002
    Location: Skaville
    Posts: 2,331
    SPGM e

    - SPG . . SPGM gal-title.

    47 : $messages['en'][47]="Save";

  4. #4
    Registered User dil's Avatar
    Join Date: Sep:2003
    Location: ,
    Posts: 1,125
    ..

    FireFox SPGM + ,
    IE

  5. #5
    morf's Avatar
    Join Date: Jun:2002
    Location: Skaville
    Posts: 2,331
    . - . - .

    , gal-title.txt

    7 ?

  6. #6
    Registered User dil's Avatar
    Join Date: Sep:2003
    Location: ,
    Posts: 1,125
    function writeGalDesc

    , 7 -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |