merge -c2902 from trunk to branch 2.0.

- Add home and identification buttons after installation.
- Use fetchRemote function for remote site actions.
- Corrections in fetchRemote fnction.
- Move PLUGIN_PICTURE_BEFORE in picture.tpl.

git-svn-id: http://piwigo.org/svn/branches/2.0@2903 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
patdenice 2008-11-23 17:25:24 +00:00
parent a1e6ae0f15
commit 60f2d18f1f
12 changed files with 38 additions and 23 deletions

View file

@ -1948,6 +1948,21 @@ function cat_admin_access($category_id)
*/
function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0)
{
// Try to retrieve data from local file?
if (!url_is_remote($src))
{
$content = @file_get_contents($src);
if ($content !== false)
{
is_resource($dest) ? @fwrite($dest, $content) : $dest = $content;
return true;
}
else
{
return false;
}
}
// After 3 redirections, return false
if ($step > 3) return false;
@ -1964,8 +1979,9 @@ function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0)
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = @curl_exec($ch);
$header_length = @curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$status = @curl_getinfo($ch, CURLINFO_HTTP_CODE);
@curl_close($ch);
if ($content !== false)
if ($content !== false and $status >= 200 and $status < 400)
{
if (preg_match('/Location:\s+?(.+)/', substr($content, 0, $header_length), $m))
{

View file

@ -44,8 +44,9 @@ function remote_output($url)
{
global $template, $page;
if($lines = @file($url))
if (fetchRemote($url, $result))
{
$lines = explode("\r\n", $result);
// cleaning lines from HTML tags
foreach ($lines as $line)
{
@ -112,8 +113,9 @@ SELECT COUNT(id) AS count
$clf_url = $url.'create_listing_file.php';
$clf_url.= '?action=test';
$clf_url.= '&version='.PHPWG_VERSION;
if ( ($lines = @file($clf_url)) !== false)
if (fetchRemote($clf_url, $result))
{
$lines = explode("\r\n", $result);
$first_line = strip_tags($lines[0]);
if (!preg_match('/^PWG-INFO-2:/', $first_line))
{

View file

@ -48,7 +48,7 @@ function RemoteSiteReader($url, $listing_url)
if (!isset($listing_url))
{
$this->listing_url = $this->site_url.'/listing.xml';
$this->listing_url = $this->site_url.'listing.xml';
}
else
{
@ -65,11 +65,10 @@ function open()
{
global $errors;
if (@fopen($this->listing_url, 'r'))
if ($xml_content = getXmlCode($this->listing_url))
{
$this->site_dirs = array();
$this->site_files = array();
$xml_content = getXmlCode($this->listing_url);
$info_xml_element = getChild($xml_content, 'informations');
if (getAttribute($info_xml_element , 'phpwg_version') != PHPWG_VERSION)
{

View file

@ -145,6 +145,12 @@ TD {
</tr>
</table>
</form>
{else}
<p>
<br />
<input type="button" name="index" value="{'home'|@translate}" onClick="document.location = 'index.php';"/>
<input type="button" name="identification" value="{'Identification'|@translate}" onClick="document.location = 'identification.php';"/>
</p>
{/if}
</div> {* content *}
<div style="text-align: center">{$L_INSTALL_HELP}</div>

View file

@ -121,18 +121,11 @@ function getXmlCode( $filename )
ini_set("pcre.backtrack_limit", pow(2, 32));
}
$file = fopen( $filename, 'r' );
if ( !$file )
if (!fetchRemote($filename, $xml_content))
{
return false;
}
$xml_content = '';
while ( !feof( $file ) )
{
$xml_content .= fgets( $file, 1024 );
}
fclose( $file );
$xml_content = str_replace( "\n", '', $xml_content );
$xml_content = str_replace( "\t", '', $xml_content );

View file

@ -57,7 +57,7 @@ $lang['step2_pwd_conf_info'] = 'Prüfung';
$lang['step1_err_copy'] = 'Kopieren Sie den Text in rosaen zwischen Bindestriche und fügen Sie ihn in die Datei "include / mysql.inc.php" (Warnung: mysql.inc.php müssen nur enthalten, was in rosa, keine Zeile zurück oder Leerzeichen)';
$lang['install_help'] = 'Brauchen Sie Hilfe? Stellen Sie Ihre Frage auf der <a href="%s"> Forum Piwigo </ a>.';
$lang['install_end_message'] = 'Die Konfiguration der Piwigo abgeschlossen ist, hier ist der nächste Schritt<br /><br />
* Gehen Sie auf die Identifizierung Seite: [ <a href="./identification.php">Identifizierung</a> ] und verwenden Sie die Login / Passwort für Webmaster<br />
* Gehen Sie auf die Identifizierung Seite und verwenden Sie die Login / Passwort für Webmaster<br />
* diesem Login ermöglicht Ihnen den Zugang zu den Verwaltungs-Panel und den Anweisungen, um Platz Bilder in Ihre Verzeichnisse.';
$lang['conf_mail_webmaster'] = 'Webmaster Mail-Adresse';
$lang['conf_mail_webmaster_info'] = 'Besucher können sich nicht Kontakt Site Administrator mit diesem E-Mail';

View file

@ -59,7 +59,7 @@ $lang['step2_pwd_conf'] = 'Password [confirm]';
$lang['step2_pwd_conf_info'] = 'verification';
$lang['install_help'] = 'Need help ? Ask your question on <a href="%s">Piwigo message board</a>.';
$lang['install_end_message'] = 'The configuration of Piwigo is finished, here is the next step<br /><br />
* go to the identification page : [ <a href="identification.php">identification</a> ] and use the login/password given for webmaster<br />
* go to the identification page and use the login/password given for webmaster<br />
* this login will enable you to access to the administration panel and to the instructions in order to place pictures in your directories';
$lang['conf_mail_webmaster'] = 'Webmaster mail address';
$lang['conf_mail_webmaster_info'] = 'Visitors will be able to contact site administrator with this mail';

View file

@ -57,7 +57,7 @@ $lang['step2_pwd_conf_info'] = 'Comprobación';
$lang['step1_err_copy'] = 'Copie el texto en rosa entre las rayas y pegúelo en el fichero mysql.inc.php que se encuentra en el repertorio " include " a la base del lugar donde usted instaló a Piwigo (el fichero mysql.inc.php debe contener SÓLO lo que está en rosa entre las rayas, ninguna vuelta a la línea o espacio es autorizado)';
$lang['install_help'] = '¿ Necesidad de ayudante? Plantee su cuestión sobre él <a href="%s">foro de Piwigo</a>.';
$lang['install_end_message'] = 'La configuración de la aplicación correctamente se celebró, coloca en la etapa próxima<br /><br />
* Vaya sobre la página de identificación : [ <a href="./identification.php">identificación</a> ] Y conéctese con pseudo dado para el webmaster<br />
* Vaya sobre la página de identificación y conéctese con pseudo dado para el webmaster<br />
* Éste le permite acceder a la parte administración y a las instrucciones para colocar las imágenes en los repertorios.';
$lang['conf_mail_webmaster'] = 'Dirige e-mail del Administrador';
$lang['conf_mail_webmaster_info'] = 'Los visitadores podrán ponerse en contacto con usted por este mail';

View file

@ -57,7 +57,7 @@ $lang['step2_pwd_conf_info'] = 'Vérification';
$lang['step1_err_copy'] = 'Copiez le texte en rose entre les tirets et collez-le dans le fichier mysql.inc.php qui se trouve dans le répertoire "include" à la base de l\'endroit où vous avez installé Piwigo (le fichier mysql.inc.php ne doit comporter QUE ce qui est en rose entre les tirets, aucun retour à la ligne ou espace n\'est autorisé)';
$lang['install_help'] = 'Besoin d\'aide ? Posez votre question sur le <a href="%s">forum de Piwigo</a>.';
$lang['install_end_message'] = 'La configuration de l\'application s\'est correctement déroulée, place à la prochaine étape<br /><br />
* allez sur la page d\'identification : [ <a href="./identification.php">identification</a> ] et connectez-vous avec le pseudo donné pour le webmaster<br />
* allez sur la page d\'identification et connectez-vous avec le pseudo donné pour le webmaster<br />
* celui-ci vous permet d\'accéder à la partie administration et aux instructions pour placer les images dans les répertoires.';
$lang['conf_mail_webmaster'] = 'Adresse e-mail de l\'Administrateur';
$lang['conf_mail_webmaster_info'] = 'Les visiteurs pourront vous contacter par ce mail';

View file

@ -57,7 +57,7 @@ $lang['step2_pwd_conf_info'] = 'verifica';
$lang['step1_err_copy'] = 'Copiate il testo in rosa trà i trattini e mettetelo nel file mysql.inc.php che si trova nella directory "include" alla base del vostro sito dove aveto installato Piwigo (il file mysql.inc.php non deve contenere altro che ciò che è in rosa tra i trattini, nessun ritorno a capo o spazio è autorizzato)';
$lang['install_help'] = 'Bisogno di un aiuto? Visitate il <a href="%s">forum di Piwigo</a>.';
$lang['install_end_message'] = 'La configurazione di Piwigo è conclusa. Procedete al prossimo step<br /><br />
* collegatevi alla pagina d\'accesso: [ <a href="identification.php">Accedi ora</a> ] e usate il vostro nome utente e password del Webmaster<br />
* collegatevi alla pagina d\'accesso e usate il vostro nome utente e password del Webmaster<br />
* a questo punto sarete abilitati all\'accesso al pannello di amministrazione in cui troverete le istruzioni per l\'inserimento delle immagini nelle vostre directory';
$lang['conf_mail_webmaster'] = 'Indirizzo email del Amministratore';
$lang['conf_mail_webmaster_info'] = 'i visitatori potranno contattarvi utilizzando questo indirizzo email';

View file

@ -59,7 +59,7 @@ $lang['step2_pwd_conf'] = 'Wachtwoord [bevestigen]';
$lang['step2_pwd_conf_info'] = 'verificatie';
$lang['install_help'] = 'Hulp nodig ? stel een vraag op het <a href="%s" target="_blank">Piwigo forum</a>.';
$lang['install_end_message'] = 'Het installeren van Piwigo is klaar, de volgende stap is<br /><br />
* Ga naar de Indentificatie pagina: [ <a href="identification.php">Indentificatie</a> ] gebruik hiervoor het eerder opgegeven gebruikersnaam met wachtwoord<br />
* Ga naar de Indentificatie pagina en gebruik hiervoor het eerder opgegeven gebruikersnaam met wachtwoord<br />
* Deze gebruikersnaam geeft u toegang tot de beheermenu zodat u afbeeldingen op uw website kan plaatsen';
$lang['conf_mail_webmaster'] = 'Webmaster email adres';
$lang['conf_mail_webmaster_info'] = 'Het is mogelijk dat bezoekers contact opnemen met de beheerder middels e-mail';

View file

@ -25,6 +25,8 @@
</div>
{/if}
{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
<div id="imageHeaderBar">
<div class="browsePath">
<a href="{$U_HOME}" rel="home">{'home'|@translate}</a>
@ -37,7 +39,6 @@
{/if}
</div>
{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
<div id="imageToolBar">
<div class="randomButtons">
{if isset($U_SLIDESHOW_START) }
@ -278,6 +279,4 @@ y.callService(
</div>
{/if} {*comments*}
{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}