Some question about ideas

Issue #134 resolved
Former user created an issue

Originally reported on Google Code with ID 134

Hey

Multiple language support:

I believe you already thought about support for international languages?
What do think about it? 

------------------

Upgrade Notification:
How about offering a message in the footer saying: There is a new version of phpLiteAdmin
1.9.5

This is easy done:
create here a js file with the content: var upgrade = '1.9.4';

that all, now we need to call the script in phpliteadmin.php and compare with VERSION

<script src="http://code.google.com/p/phpliteadmin/upgrade.js"></scrip>
<script>
if(upgrade > '<?php echo VERSION; ?>'){
document.getElementById("upgrade").innerHTML = "There is a new version of <a href='http://code.google.com/p/phpliteadmin'>phpLiteAdmin
" + upgrade + "</a>";
}
</script>

Reported by teryaki1963 on 2012-11-07 12:27:21

Comments (3)

  1. Christopher Kramer
    Mulilanguage: Yes, of course this seems to be a good idea. Here again we'll have to
    think about how we handle this in respect to our single-file approach. We could of
    course put all languages in the single file, but handling languages as additional optional
    files would be a better way I'd say.
    
    Update Notification: In general a good idea. But why implementing this as JS? Why not
    using php?
    
    like:
    <?php
    $version = file_get_contents("http://..../version.txt");
    if($version>VERSION) echo "New version, download here...";
    ?>
    
    Note: we need to be careful with > on version numbers: string "1.8.10" < "1.8.2" might
    cause problems.
    
    We could also easily add an auto-update feature. Something like this (not tested, only
    to illustrate how it's done):
    <?php
    
    if(isset($_GET['update1']) {
    // download the file to phpliteadmin_new.php
    $new_file=file_get_contents($url_to_new_version);
    file_put_contents("phpliteadmin_new.php",$new_file);
    // redirect there
    header("Location: phpliteadmin_new.php?update2");
    }
    if(isset($_GET['update2']) {
    // delete the old version
    unlink('phpliteadmin.php');
    // copy the new version to phpliteadmin.php
    copy('phpliteadmin_new.php','phpliteadmin.php');
    // redirect there
    header("Location: phpliteadmin_new.php?update3");
    }
    if(isset($_GET['update3])) {
    // delete the temporary file (_new)
    unlink('phpliteadmin_new.php');
    }
    
    ?>
    
    And on top of that, replace the configuration in the new file with the old one.
    To do so we could have a comment in the new version like
    // CONFIG_REPLACE_MARKER_FOR_AUTOUPDATES
    It should be placed after the default settings.
    
    And then in the first step of the update process, replace this marker with the current
    settings like password and databases.
    
    ___
    
    
    I think we should open 2 or 3 separate issues, as these are completely different things:
    Multilanguage, Update notification, Autoupdate
    

    Reported by crazy4chrissi on 2012-11-07 12:53:49

  2. Former user Account Deleted
    file_get_contents does not work if allow_url_fopen is disabled (same in my case too)
    I thought of JS cause its much easier and it works fine.
    
    if you want to handle it with php then better use CURL.
    Yah i offer also live update for Havalite CMS. if you need the CURL function, you can
    find it in havalite/data/updater.php. There is also unzip function (just in case...).
    
    ok i'll wait for the new issues
    

    Reported by teryaki1963 on 2012-11-07 13:25:00

  3. Christopher Kramer
    Ok, I separated this into 3 issues so I am closing this one.
    
    Please refer to the following issues:
    issue #135: Multilanguage support
    issue #136: Upgrade-Notification
    issue #137: Auto-Update
    

    Reported by crazy4chrissi on 2012-11-07 13:40:42 - Status changed: Done

  4. Log in to comment