/** * Searches the zenphoto.org home page for the current zenphoto download * locates the version number of the download and compares it to the version * we are running. * * @return string If there is a more current version on the WEB, returns its version number otherwise returns FALSE * @since 1.1.3 */ function checkForUpdate() { $webVersion = false; if (is_connected() && class_exists('DOMDocument')) { require_once dirname(__FILE__) . '/zenphoto_news/rsslib.php'; $recents = RSS_Retrieve("http://www.zenphoto.org/index.php?rss=news&category=changelog"); if ($recents) { array_shift($recents); $article = array_shift($recents); // most recent changelog article $v = trim(str_replace('zenphoto-', '', basename($article['link']))); $c = explode('-', ZENPHOTO_VERSION); $c = array_shift($c); if ($v && version_compare($c, $v, "<")) { $webVersion = $v; } } } return $webVersion; }
function RSS_Display($url, $size) { global $RSS_Content; $opened = false; $page = ""; RSS_Retrieve($url); if ($size > 0) { $recents = array_slice($RSS_Content, 0, $size); } foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened == true) { $page .= "</ul>\n"; $opened = false; } $page .= "<b>"; } else { if ($opened == false) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $link = $article["link"]; $description = $article["description"]; $page .= "<li><a href=\"{$link}\">{$title}</a>"; if ($description != false) { $page .= "<br>{$description}"; } $page .= "</li>\n"; if ($type == 0) { $page .= "</b><br />"; } } if ($opened == true) { $page .= "</ul>\n"; } return $page . "\n"; }
function RSS_Display($url, $size = 15, $site = 0, $withdate = 0) { global $RSS_Content; $opened = false; $page = ""; $site = intval($site) == 0 ? 1 : 0; RSS_Retrieve($url); if ($size > 0) { $recents = array_slice($RSS_Content, $site, $size + 1 - $site); } foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened == true) { $page .= "</ul>\n"; $opened = false; } // $page .="<b>"; $t_site = 1; $titleClass = "orange"; } else { if ($opened == false) { $page .= "<ul class=\"rssitems\">\n"; $opened = true; $t_site = 0; $titleClass = ""; } } $title = $article["title"]; $link = $article["link"]; $t_site == 1 ? $page .= "<ul class=\"rsssite\">\n" : ''; $page .= "<li><a href=\"{$link}\" title=\"\" class=\"link_out " . $titleClass . "\">" . utf8_decode($title) . "</a>"; if ($withdate) { $date = $article["date"]; $page .= ' <span class="rssdate">' . $date . '</span>'; } $description = $article["description"]; if ($description != false) { $page .= "<br><span class='rssdesc'>" . utf8_decode($description) . "</span>"; } $page .= "</li>\n"; $t_site == 1 ? $page .= "</ul>\n" : ''; if ($type == 0) { // $page .="</b><br />"; // $page .="<br />"; } } if ($opened == true) { $page .= "</ul>\n"; } return $page . "\n"; }
function RSS_Display($url, $size = 15, $site = 0, $withdate = 0) { global $RSS_Content; $opened = false; $page = ""; $site = intval($site) == 0 ? 1 : 0; RSS_Retrieve($url); if ($size > 0) { $recents = array_slice($RSS_Content, $site, $size + 1 - $site); } foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened == true) { $page .= "</ul>\n"; $opened = false; } $page .= "<b>"; } else { if ($opened == false) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $link = $article["link"]; $page .= "<li><a href=\"{$link}\">{$title}</a>"; if ($withdate) { $date = $article["date"]; $page .= ' <span class="rssdate">' . $date . '</span>'; } $article2 = $article["description"]; if ($article2 != false) { $page .= "<br><span class='rssdesc'>{$article2}</span>"; } $page .= "</li>\n"; if ($type == 0) { $page .= "</b><br />"; } } if ($opened == true) { $page .= "</ul>\n"; } //return $page."\n"; }
function Common_Display($url, $size = 25, $chanopt = false, $descopt = false, $dateopt = false) { global $Common_Content; global $Common_Style; global $Common_Date_Font; $opened = false; $page = ""; if (Atom_Retrieve($url) === false) { if (RSS_Retrieve($url) === false) { return "{$url} empty...<br />"; } } if ($size > 0) { $size += 1; // add one for the channel $recents = array_slice($Common_Content, 0, $size); } foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($chanopt != true) { continue; } if ($opened == true) { $page .= "</ul>\n"; $opened = false; } //$page .="<b>"; } else { if ($opened == false && $chanopt == true) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $link = $article["link"]; $page .= "<" . $Common_Style . "><a href=\"{$link}\">{$title}</a>"; if ($descopt != false) { $description = $article["description"]; if ($description != false) { $page .= "<br>{$description}"; } } if ($dateopt != false) { $updated = $article["updated"]; if ($updated != false) { $page .= "<br /><font {$Common_Date_Font}>{$updated}</font>"; } } $page .= "</" . $Common_Style . ">\n"; /* if($type == 0) { $page .="<br />"; } */ } if ($opened == true) { $page .= "</ul>\n"; } return $page . "\n"; }
$source = '<a href="' . $link . '">' . $clone . '</a>'; } else { $source = $clone; } $source = '<br /> ' . sprintf(gettext('source: %s'), $source); } $graphics_lib = zp_graphicsLibInfo(); ?> <li> <?php printf(gettext('Zenphoto version <strong>%1$s [%2$s] (%3$s)</strong>'), ZENPHOTO_VERSION, '<a title="' . ZENPHOTO_FULL_RELEASE . '">' . ZENPHOTO_RELEASE . '</a>', $official); echo $source; if (extensionEnabled('check_for_update') && TEST_RELEASE) { if (is_connected() && class_exists('DOMDocument')) { require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/zenphoto_news/rsslib.php'; $recents = RSS_Retrieve("http://www.zenphoto.org/index.php?rss=news&category=changelog"); if ($recents) { array_shift($recents); $article = array_shift($recents); // most recent changelog article $v = trim(str_replace('zenphoto-', '', basename($article['link']))); $c = explode('-', ZENPHOTO_VERSION); $c = array_shift($c); if ($v && version_compare($c, $v, '>')) { ?> <p class="notebox"> <a href="http://www.zenphoto.org/news/zenphoto-<?php echo $c; ?> "> <?php
function printNews() { ?> <div class="box overview-utility"> <h2 class="h2_bordered"><?php echo gettext("News from Zenphoto.org"); ?> </h2> <?php if (is_connected()) { require_once dirname(__FILE__) . '/zenphoto_news/rsslib.php'; require_once SERVERPATH . '/' . ZENFOLDER . '/template-functions.php'; $recents = RSS_Retrieve("http://www.zenphoto.org/index.php?rss=news&withimages"); if ($recents) { $opened = false; $recents = array_slice($recents, 1, 5); $shorten = getOption('zenphoto_news_length'); foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened) { ?> </ul> <?php $opened = false; } ?> <b /> <?php } else { if (!$opened) { ?> <ul> <?php $opened = true; } } $title = $article["title"]; $date = zpFormattedDate(DATE_FORMAT, strtotime($article["pubDate"])); $link = $article["link"]; if ($shorten) { $description = shortenContent($article["description"], $shorten, '...'); } else { $description = false; } ?> <li><a href="<?php echo $link; ?> "><strong><?php echo $title; ?> </strong> (<?php echo $date; ?> )</a> <?php if ($description != false) { ?> <br /> <?php echo $description; } ?> </li> <?php if ($type == 0) { ?> <br /> <?php } } if ($opened) { ?> </ul> <?php } } else { ?> <ul> <li><?php printf(gettext('Failed to retrieve link <em>%s</em>'), 'http://www.zenphoto.org/index.php?rss=news&withimages'); ?> </li> </ul> <?php } } else { ?> <ul> <li><?php echo gettext('A connection to <em>Zenphoto.org</em> could not be established.'); ?> </li> </ul> <?php } ?> </div> <?php }
function RSS_Display($url, $size = 15, $site = 0) { $opened = false; $page = ""; $site = intval($site) == 0 ? 1 : 0; if ($size <= 0) { return ''; } $recents = array_slice(RSS_Retrieve($url), $site, $size + 1 - $site); foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened) { $page .= "</ul>\n"; $opened = false; } $page .= "<b />"; } else { if (!$opened) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $format = DATE_FORMAT; $date = zpFormattedDate($format, strtotime($article["pubDate"])); $link = $article["link"]; $description = $article["description"]; $page .= "<li><a href=\"{$link}\"><strong>{$title}</strong> ({$date})</a>"; if ($description != false) { $page .= "<br />{$description}"; } $page .= "</li>\n"; if ($type == 0) { $page .= "<br />"; } } if ($opened) { $page .= "</ul>\n"; } return $page . "\n"; }
function RSS_Display($urls = array(), $size = 15, $site = 0) { global $RSS_Content; $site = 0; $opened = false; $page = ""; $site = intval($site) == 0 ? 1 : 0; RSS_Retrieve($urls); RSS_Sort(); if ($size > 0) { $recents = array_slice($RSS_Content, 0, $size); } $page .= "<table>"; foreach ($recents as $article) { $channel = $article["channel"]; $title = $article["title"]; $link = $article["link"]; $description = $article["description"]; $date = $article["date"]; $image = $article["image"]; $page .= "<tr>\n\t\t\t\t\t<td><img src=\"themes/default/img/" . $image . ".png\" alt=\"\"></td>\n\t\t\t\t\t<td class=\"title\">\n\t\t\t\t\t\t<a target=\"_blank\" href=\"{$link}\">" . (strlen($title) > 25 ? substr($title, 0, 25) . "..." : $title) . "</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>" . date('d/m/Y', strtotime($date)) . "</td>\n\t\t\t\t</tr>"; } $page .= "</table>"; return $page . "\n"; }
function RSS_Display($url, $size = 15, $site = 0) { global $RSS_Content; global $bdd; $opened = false; $page = ""; $site = intval($site) == 0 ? 1 : 0; RSS_Retrieve($url); if ($size > 0) { $recents = array_slice($RSS_Content, $site, $size + 1 - $site); } foreach ($recents as $article) { $type = $article["type"]; if ($type == 0) { if ($opened == true) { $page .= "</ul>\n"; $opened = false; } $page .= "<b>"; } else { if ($opened == false) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $link = $article["link"]; $description = $article["description"]; $pubDate = $article["pubDate"]; $page .= "<li><a href=\"{$link}\">{$title}</a> "; $page .= '<div class="form"> <button data-url="' . $link . '"> J\'aime </button></div>'; if ($description != false) { $page .= "<br>{$description} {$pubDate}"; } $page .= "</li>\n"; if ($type == 0) { $page .= "</b><br />"; } } if ($opened == true) { $page .= "</ul>\n"; } return $page . "\n"; if ($opened == true) { $article .= "</div>\n"; } return $article; }