コード例 #1
0
 function lmm_dashboard_widget()
 {
     global $wpdb;
     $O4 = get_option("leafletmapsmarker_options");
     if ($O4["defaults_marker_custom_icon_url_dir"] == "no") {
         $defaults_marker_icon_dir = l3;
         $defaults_marker_icon_url = O2;
     } else {
         $defaults_marker_icon_dir = htmlspecialchars($O4["defaults_marker_icon_dir"]);
         $defaults_marker_icon_url = htmlspecialchars($O4["defaults_marker_icon_url"]);
     }
     $table_name_markers = $wpdb->prefix . "leafletmapsmarker_markers";
     $widgets = get_option("dashboard_widget_options");
     $widget_id = "lmm-admin-dashboard-widget";
     $number_of_markers = isset($widgets[$widget_id]) && isset($widgets[$widget_id]["items"]) ? absint($widgets[$widget_id]["items"]) : 4;
     if (la($Oa = FALSE, $lb = TRUE) === TRUE && la() === FALSE) {
         $l5 = get_option("leafletmapsmarker_version_pro");
         echo "<div style=\"padding: 3px 5px;background-color: #FFEBE8;border: 1px solid #CC0000;border-radius: 3px;color: #333;\"><strong>" . __("Warning: your access to updates and support for Maps Marker Pro has expired!", "lmm") . "</strong><br/>";
         $lc = get_option("leafletmapsmarker_version_pro_latest");
         if ($lc != NULL && $lc > $l5) {
             echo __("Latest available version:", "lmm") . " <a href='https://www.mapsmarker.com/v" . $lc . "p' target='_blank' title='" . esc_attr__("click to show release notes", "lmm") . "'>" . $lc . "</a> " . "(<a href='www.mapsmarker.com/changelog/pro/' target='_blank'>" . __("show all available changelogs", "lmm") . "</a>)<br/>";
         }
         echo sprintf(__("You can continue using version %s without any limitations. Nevertheless you will not be able to get updates including bugfixes, new features and optimizations as well as access to our support system. ", "lmm"), $l5) . "<br/>" . sprintf(__("<a href=\"%s\">Please renew your access to updates and support to keep your plugin up-to-date and safe</a>.", "lmm"), l1 . "admin.php?page=leafletmapsmarker_license") . "</div>";
         echo "<hr style=\"border:0;height:1px;background-color:#d8d8d8;\"/>";
     }
     $Oe = $wpdb->get_results($wpdb->prepare("SELECT `id`,`markername`,`icon`,`createdon`,`createdby` FROM `{$table_name_markers}` ORDER BY `createdon` desc LIMIT %d", $number_of_markers), ARRAY_A);
     if ($Oe != NULL) {
         echo "<table style=\"margin-bottom:5px;\"><tr>";
         foreach ($Oe as $row) {
             $icon = $row["icon"] == NULL ? O1 . "leaflet-dist/images/marker.png" : $defaults_marker_icon_url . "/" . $row["icon"];
             echo "<td><a href=\"" . l1 . "admin.php?page=leafletmapsmarker_marker&id=" . $row["id"] . "\" title=\"" . esc_attr__("edit marker", "lmm") . "\"><img src=\"" . $icon . "\" style=\"width:80%;\"></a>";
             echo "<td style=\"vertical-align:top;line-height:1.2em;\">";
             echo "<a href=\"" . l1 . "admin.php?page=leafletmapsmarker_marker&id=" . $row["id"] . "\" title=\"" . esc_attr__("edit marker", "lmm") . "\">" . htmlspecialchars(stripslashes($row["markername"])) . "</a><br/>" . __("created on", "lmm") . " " . date("Y-m-d - h:m", strtotime($row["createdon"])) . ", " . __("created by", "lmm") . " " . $row["createdby"];
             echo "</td></tr>";
         }
         echo "</table>";
     } else {
         echo "<p style=\"margin-bottom:5px;\">" . __("No marker created yet", "lmm") . "</p>";
     }
     if (!isset($widgets[$widget_id]["blogposts"])) {
         $lf = 1;
     } else {
         if (isset($widgets[$widget_id]["blogposts"]) && $widgets[$widget_id]["blogposts"] == 1) {
             $lf = 0;
         } else {
             $lf = 1;
         }
     }
     function lmm_spc_custom_name($Of)
     {
         return "mapsmarker-dashboard-widget-rss-item-cache";
     }
     if ($lf == 1 && $O4["misc_whitelabel_backend"] == "disabled") {
         require_once ABSPATH . WPINC . DIRECTORY_SEPARATOR . "class-simplepie.php";
         $lg = new simplepie();
         if (file_exists($defaults_marker_icon_dir . DIRECTORY_SEPARATOR . "readme-icons.txt")) {
             $lg->enable_cache(TRUE);
             $lg->set_cache_location($location = $defaults_marker_icon_dir);
             $lg->set_cache_name_function("lmm_spc_custom_name");
             $lg->set_cache_duration(0250600);
         } else {
             $lg->enable_cache(FALSE);
         }
         $lg->set_feed_url("http://feeds.feedburner.com/MapsMarkerPro");
         $lg->set_stupidly_fast(TRUE);
         $lg->enable_order_by_date(TRUE);
         $lg->init();
         $lg->handle_content_type();
         echo "<hr style=\"border:0;height:1px;background-color:#d8d8d8;\"/><strong><p>" . __("Latest blog posts from www.mapsmarker.com", "lmm") . "</p></strong>";
         if ($lg->get_items() == NULL) {
             $blogpost_url = "<a href=\"https://www.mapsmarker.com/news\" target=\"_blank\">https://www.mapsmarker.com/news</a>";
             echo sprintf(__("Feed could not be retrieved, please try again later or read the latest blog posts at %s", "lmm"), $blogpost_url);
         }
         foreach ($lg->get_items(0, 3) as $item) {
             echo "<p  style=\"margin:0.5em 0;\">" . $item->get_date("j F Y") . ": <strong><a href=\"" . $item->get_permalink() . "?ref=dashboard\">" . $item->get_title() . "</a></strong></p>" . PHP_EOL;
         }
         echo "<p><a style=\"text-decoration:none;\" href=\"https://www.mapsmarker.com\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-website-home.png\" width=\"16\" height=\"16\" alt=\"mapsmarker.com\"> MapsMarker.com</a>&nbsp;<a style=\"text-decoration:none;\" title=\"" . esc_attr__("MapsMarker affiliate program - sign up now and receive commissions up to 50%!", "lmm") . "\" href=\"https://www.mapsmarker.com/affiliates\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-affiliates.png\" width=\"16\" height=\"16\" alt=\"" . esc_attr__("MapsMarker affiliate program - sign up now and receive commissions up to 50%!", "lmm") . "\"> " . __("Affiliates", "lmm") . "</a>&nbsp;<a style=\"text-decoration:none;\" title=\"" . esc_attr__("MapsMarker reseller program - re-sell with a 20% discount!", "lmm") . "\" href=\"https://www.mapsmarker.com/reseller\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-resellers.png\" width=\"16\" height=\"16\" alt=\"" . esc_attr__("MapsMarker reseller program - re-sell with a 20% discount!", "lmm") . "\"> " . __("Resellers", "lmm") . "</a>&nbsp;<a style=\"text-decoration:none;\" href=\"https://www.mapsmarker.com/reviews\" target=\"_blank\" title=\"" . esc_attr__("please rate this plugin on wordpress.org", "lmm") . "\"><img src=\"" . O1 . "inc/img/icon-star.png\" width=\"16\" height=\"16\" alt=\"" . esc_attr__("please rate this plugin on wordpress.org", "lmm") . "\"> " . __("rate plugin", "lmm") . "</a>&nbsp;<a href=\"https://translate.mapsmarker.com/projects/lmm\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-translations.png\" width=\"16\" height=\"16\" alt=\"translations\"> " . __("translations", "lmm") . "</a>&nbsp;<a href=\"https://twitter.com/mapsmarker\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-twitter.png\" width=\"16\" height=\"16\" alt=\"twitter\"> Twitter</a>&nbsp;<a href=\"https://facebook.com/mapsmarker\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-facebook.png\" width=\"16\" height=\"16\" alt=\"facebook\"> Facebook</a>&nbsp;<a href=\"https://www.mapsmarker.com/+\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-google-plus.png\" width=\"16\" height=\"16\" alt=\"google+\"> Google+</a>&nbsp;<a style=\"text-decoration:none;\" href=\"https://www.mapsmarker.com/changelog/pro\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-changelog-header.png\" width=\"16\" height=\"16\" alt=\"changelog\"> " . __("Changelog", "lmm") . "</a>&nbsp;<a href=\"https://feeds.feedburner.com/MapsMarker\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-rss.png\" width=\"16\" height=\"16\" alt=\"rss\"> RSS</a>&nbsp;<a href=\"http://feedburner.google.com/fb/a/mailverify?uri=MapsMarker\" target=\"_blank\"><img src=\"" . O1 . "inc/img/icon-rss-email.png\" width=\"16\" height=\"16\" alt=\"rss-email\"> " . __("E-Mail", "lmm") . "</a></p>";
     }
 }
コード例 #2
0
ファイル: getFacebook.php プロジェクト: eguicciardi/ada
}
if (!isset($format)) {
    $format = "atom10";
} else {
    if (!in_array($format, array('atom10', 'rss20'))) {
        $format = "atom10";
    }
}
if (!isset($showDescription) || !is_numeric($showDescription)) {
    $showDescription = 0;
}
if (!isset($count) || !is_numeric($count)) {
    $count = 20;
}
$url = "http://www.facebook.com/feeds/page.php?format={$format}&id={$id}";
$spObj = new simplepie();
$spObj->set_feed_url($url);
$spObj->init();
// $spObj->set_cache_location('./cache')
// $spObj->enable_cache(true);
$rss_items = array();
$i = 0;
$clearfix = CDOMElement::create('div', 'class:clearfix')->getHtml();
foreach ($spObj->get_items() as $item) {
    $title = html_entity_decode($item->get_title());
    if ($title == '' && !$showDescription) {
        continue;
    }
    $facebookDIV = CDOMElement::create('div', 'class:facebookContainer');
    $facebookLINK = CDOMElement::create('a', 'href:' . $item->get_link());
    $facebookLINK->setAttribute('target', '_blank');