Skip to content
Snippets Groups Projects
Commit 306eff62 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

NEW: Show last official stable version into system - update page.

parent e9357457
Branches
Tags
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("other"); $langs->load("other");
...@@ -105,14 +106,23 @@ llxHeader('',$langs->trans("Upgrade"),$wikihelp); ...@@ -105,14 +106,23 @@ llxHeader('',$langs->trans("Upgrade"),$wikihelp);
print_fiche_titre($langs->trans("Upgrade"),'','setup'); print_fiche_titre($langs->trans("Upgrade"),'','setup');
print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>'; print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
if ($sfurl = simplexml_load_file('http://sourceforge.net/projects/dolibarr/rss')) {
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
$sfurl = simplexml_load_string($result['content']);
if ($sfurl)
{
$title=$sfurl->channel[0]->item[0]->title; $title=$sfurl->channel[0]->item[0]->title;
function word_limiter( $text, $limit = 30, $chars = '0123456789.' ) {
if( strlen( $text ) > $limit ) { function word_limiter($text, $limit = 30, $chars = '0123456789.')
{
if (strlen( $text ) > $limit)
{
$words = str_word_count($text, 2, $chars); $words = str_word_count($text, 2, $chars);
$words = array_reverse($words, TRUE); $words = array_reverse($words, TRUE);
foreach($words as $length => $word) { foreach($words as $length => $word) {
if( $length + strlen( $word ) >= $limit ) { if ($length + strlen( $word ) >= $limit)
{
array_shift($words); array_shift($words);
} else { } else {
break; break;
...@@ -126,7 +136,9 @@ function word_limiter( $text, $limit = 30, $chars = '0123456789.' ) { ...@@ -126,7 +136,9 @@ function word_limiter( $text, $limit = 30, $chars = '0123456789.' ) {
$str = $title; $str = $title;
print $langs->trans("LastStableVersion").' : <b>'. word_limiter( $str ).'</b><br>'; print $langs->trans("LastStableVersion").' : <b>'. word_limiter( $str ).'</b><br>';
} else { }
else
{
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>'; print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
} }
print '<br>'; print '<br>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment