mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Added {ADMIN_UPDATE} shortcode. Checks Sourceforge RSS feed for a newer version of e107, once a day.
This commit is contained in:
53
e107_files/shortcode/admin_update.sc
Normal file
53
e107_files/shortcode/admin_update.sc
Normal file
@@ -0,0 +1,53 @@
|
||||
// $Id: admin_update.sc,v 1.1 2006-12-08 08:10:25 e107coders Exp $
|
||||
|
||||
global $e107cache,$ns;
|
||||
if (is_readable(e_ADMIN."ver.php"))
|
||||
{
|
||||
include(e_ADMIN."ver.php");
|
||||
}
|
||||
|
||||
$feed = "http://sourceforge.net/export/rss2_projfiles.php?group_id=63748";
|
||||
$e107cache->CachePageMD5 = md5($e107info['e107_version']);
|
||||
|
||||
if($cacheData = $e107cache->retrieve("xfeed",3600, TRUE))
|
||||
{
|
||||
return $cacheData;
|
||||
}
|
||||
|
||||
require_once(e_HANDLER."xml_class.php");
|
||||
$xml = new parseXml;
|
||||
require_once(e_HANDLER."magpie_rss.php");
|
||||
|
||||
$ftext = "";
|
||||
if($rawData = $xml -> getRemoteXmlFile($feed))
|
||||
{
|
||||
$rss = new MagpieRSS( $rawData );
|
||||
}
|
||||
|
||||
$current_vrs = floatval(str_replace(".","",$e107info['e107_version']));
|
||||
foreach($rss->items as $val)
|
||||
{
|
||||
|
||||
$search = array((strstr($val['title'],"(")),"e107","released"," v");
|
||||
$version = trim(str_replace($search,"",$val['title']));
|
||||
$numb = str_replace(".","",$version);
|
||||
$vrs = floatval($numb);
|
||||
|
||||
if(($vrs > $current_vrs) && $vrs < 400)
|
||||
{
|
||||
$ftext .= "<a rel='external' href='".$val['link']."' >e107 v".$version."</a><br />\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($ftext){
|
||||
$text = $ftext;
|
||||
}
|
||||
|
||||
$e107cache->set("xfeed", $text, TRUE);
|
||||
if($text)
|
||||
{
|
||||
return $ns -> tablerender(LAN_NEWVERSION, $text);
|
||||
}
|
||||
|
||||
|
@@ -4,9 +4,9 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_admin.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:34:40 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2006-12-08 08:10:25 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
define("ADLAN_0", "News");
|
||||
@@ -268,5 +268,7 @@ define("LAN_CONFIGURE", "Configure");
|
||||
define("LAN_BACK","Back");
|
||||
|
||||
define("LAN_CREDITS","Credits");
|
||||
define("LAN_NEWVERSION","New Version Available");
|
||||
|
||||
|
||||
?>
|
||||
|
@@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_themes/jayya/admin_template.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:35:51 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2006-12-08 08:10:25 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@@ -100,7 +100,7 @@ if (!ADMIN) {
|
||||
if ($prehelp!='') {
|
||||
$ADMIN_HEADER .= $prehelp;
|
||||
} else {
|
||||
$ADMIN_HEADER .= "{ADMIN_SITEINFO}";
|
||||
$ADMIN_HEADER .= "{ADMIN_UPDATE} {ADMIN_SITEINFO}";
|
||||
}
|
||||
|
||||
$ADMIN_HEADER .= "<br />
|
||||
|
@@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/admin_template.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:36:12 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2006-12-08 08:10:25 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@@ -46,6 +46,7 @@ $ADMIN_FOOTER = "</td>
|
||||
<td style='width:17%; vertical-align:top'>
|
||||
{ADMIN_MENU}
|
||||
{ADMIN_PRESET}
|
||||
{ADMIN_UPDATE}
|
||||
{ADMIN_SITEINFO}
|
||||
{ADMIN_DOCS}
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user