aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-11-23 17:23:57 +0000
committerpatdenice <patdenice@piwigo.org>2008-11-23 17:23:57 +0000
commitc74e2ab49ee08101b38b3904a49037fcd6f9403c (patch)
treeb1c5cdaa0af1f3e63ad4375bdef1d3e5576a1b86
parent61d8bf79c169e601b480bf54fc393c453b8874a0 (diff)
- 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/trunk@2902 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/include/functions.php18
-rw-r--r--admin/site_manager.php6
-rw-r--r--admin/site_reader_remote.php5
-rw-r--r--admin/template/goto/install.tpl6
-rw-r--r--include/functions_xml.inc.php9
-rw-r--r--language/de_DE/install.lang.php2
-rw-r--r--language/en_UK/install.lang.php2
-rw-r--r--language/es_ES/install.lang.php2
-rw-r--r--language/fr_FR/install.lang.php2
-rw-r--r--language/it_IT/install.lang.php2
-rw-r--r--language/nl_NL/install.lang.php2
-rw-r--r--template/yoga/picture.tpl5
12 files changed, 38 insertions, 23 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index a8193d3af..fc11101fc 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -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))
{
diff --git a/admin/site_manager.php b/admin/site_manager.php
index b965b26e8..ea7f060cd 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -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))
{
diff --git a/admin/site_reader_remote.php b/admin/site_reader_remote.php
index 31ae3e792..5c350acf8 100644
--- a/admin/site_reader_remote.php
+++ b/admin/site_reader_remote.php
@@ -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)
{
diff --git a/admin/template/goto/install.tpl b/admin/template/goto/install.tpl
index a0e8eff6f..bea5cddb4 100644
--- a/admin/template/goto/install.tpl
+++ b/admin/template/goto/install.tpl
@@ -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>
diff --git a/include/functions_xml.inc.php b/include/functions_xml.inc.php
index 1a849d434..81ae48dde 100644
--- a/include/functions_xml.inc.php
+++ b/include/functions_xml.inc.php
@@ -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 );
diff --git a/language/de_DE/install.lang.php b/language/de_DE/install.lang.php
index d2c897a08..5eab1aa5e 100644
--- a/language/de_DE/install.lang.php
+++ b/language/de_DE/install.lang.php
@@ -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';
diff --git a/language/en_UK/install.lang.php b/language/en_UK/install.lang.php
index c34bb2e30..aa2d24652 100644
--- a/language/en_UK/install.lang.php
+++ b/language/en_UK/install.lang.php
@@ -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';
diff --git a/language/es_ES/install.lang.php b/language/es_ES/install.lang.php
index 960dddc4c..f142ab457 100644
--- a/language/es_ES/install.lang.php
+++ b/language/es_ES/install.lang.php
@@ -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';
diff --git a/language/fr_FR/install.lang.php b/language/fr_FR/install.lang.php
index d9b69f3f6..cc628ab2e 100644
--- a/language/fr_FR/install.lang.php
+++ b/language/fr_FR/install.lang.php
@@ -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';
diff --git a/language/it_IT/install.lang.php b/language/it_IT/install.lang.php
index ba811445b..e0f7935b4 100644
--- a/language/it_IT/install.lang.php
+++ b/language/it_IT/install.lang.php
@@ -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';
diff --git a/language/nl_NL/install.lang.php b/language/nl_NL/install.lang.php
index 15fc4d24f..63f62abc6 100644
--- a/language/nl_NL/install.lang.php
+++ b/language/nl_NL/install.lang.php
@@ -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';
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index b8f3ec522..26450a21c 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -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}