Ejemplo n.º 1
0
             }
         }
     }
 }
 foreach ($foundfolders as $key => $value) {
     $text = '';
     if ($module_info = include_module_settings($value)) {
         $text[] = '&nbsp;&nbsp;&nbsp; desc: ' . $module_info['desc'] . '<br />';
         $version = $module_info['version'];
         $name = $module_info['name'];
         if (isset($module_info['requires'])) {
             $requires = $module_info['requires'];
             if (is_array($requires)) {
                 foreach ($requires as $requirement) {
                     $text[] = '&nbsp;&nbsp;&nbsp; requires: ' . $requirement[0] . ' version ' . $requirement[1];
                     if (check_for_enabled_module($requirement[0], $requirement[1])) {
                         $text[] = " - pass";
                     } else {
                         $text[] = " - <b>fail</b>";
                     }
                     $text[] = '<br />';
                 }
             }
         }
         $thename = $name . ' v ' . $version;
         if (file_exists('./' . $value . '/' . $value . '_readme.htm')) {
             echo '<a href = "?action=readme&module=' . $value . '">' . $thename . '</a>';
         } else {
             echo $thename;
         }
         echo ' - <a href = "?action=install&module=' . $value . '">install</a><br />';
Ejemplo n.º 2
0
function check_module_requirements($requires)
{
    if (is_array($requires)) {
        foreach ($requires as $requirement) {
            if (!check_for_enabled_module($requirement[0], $requirement[1])) {
                die('This module requires ' . $requirement[0] . ' version ' . $requirement[1] . ' or greater');
            }
        }
    }
}
Ejemplo n.º 3
0
function create_sitemap_pages()
{
    global $db, $my_base_url, $my_pligg_base, $URLMethod;
    if (XmlSitemaps_use_cache) {
        $icf = "cache/sitemap-pages.xml";
        if (file_exists($icf) && ($s = stat($icf)) && time() - $s['mtime'] < XmlSitemaps_cache_ttl) {
            echo my_file_get_contents($icf);
            return true;
        }
        ob_start();
    }
    echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
    echo '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/09/sitemap.xsd"     xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
    $sql = "SELECT link_modified  FROM " . table_links . " WHERE link_status!='discard' ORDER BY link_modified DESC LIMIT 1";
    $res = $db->get_col($sql);
    if (isset($res[0])) {
        $path = "{$my_base_url}{$my_pligg_base}";
        create_entry(strtotime($res[0]), $path);
    }
    ///////////////// Upcoming.............
    $sql = "SELECT UNIX_TIMESTAMP(link_date)  FROM " . table_links . " WHERE link_status='queued' ORDER BY link_date DESC LIMIT 1";
    $res = $db->get_col($sql);
    if (isset($res[0])) {
        if ($URLMethod == 1) {
            $path = "{$my_base_url}{$my_pligg_base}/upcoming.php";
        } else {
            if ($URLMethod == 2) {
                $path = "{$my_base_url}{$my_pligg_base}/upcoming";
            }
        }
        create_entry($res[0], $path);
    }
    //////////////////////...........categories.................
    $sql = "SELECT category_id,category_name,category_safe_name FROM " . table_categories . " WHERE category_enabled=1 AND category_name!='new category'";
    $cat = $db->get_results($sql);
    foreach ($cat as $i) {
        $sql = "SELECT UNIX_TIMESTAMP(link_published_date),link_id FROM " . table_links . " WHERE link_category=" . $i->category_id . " AND link_status='published' ORDER BY link_published_date DESC LIMIT 1";
        $res = $db->get_col($sql);
        if (isset($res[0])) {
            $path = getmyFullurl('maincategory', urlencode($i->category_safe_name));
            create_entry($res[0], $path);
        }
    }
    ////////////////////.............upcoming categories..........
    foreach ($cat as $i) {
        $sql = "SELECT UNIX_TIMESTAMP(link_date) FROM " . table_links . " WHERE link_category=" . $i->category_id . " AND link_status='queued' ORDER BY link_date DESC LIMIT 1";
        $res = $db->get_col($sql);
        if (isset($res[0])) {
            $path = getmyFullurl('queuedcategory', urlencode($i->category_safe_name));
            create_entry($res[0], $path);
        }
    }
    if (check_for_enabled_module('extra_pages', 0.1)) {
        //.............Tips page...............
        $sql = "SELECT UNIX_TIMESTAMP(modified_date) FROM " . table_prefix . "extra_pages  WHERE type='Tip' ORDER BY modified_date DESC LIMIT 1";
        $res = $db->get_col($sql);
        if (isset($res[0])) {
            if ($URLMethod == 1) {
                $path = "{$my_base_url}{$my_pligg_base}/module.php?module=extra_pages&amp;action=show_tips";
            } else {
                if ($URLMethod == 2) {
                    $path = "{$my_base_url}{$my_pligg_base}/tips";
                }
            }
            create_entry($res[0], $path);
        }
        //.............FAQ page................
        $sql = "SELECT UNIX_TIMESTAMP(modified_date) FROM " . table_prefix . "extra_pages  WHERE type='FAQ' ORDER BY modified_date DESC LIMIT 1";
        $res = $db->get_col($sql);
        if (isset($res[0])) {
            if ($URLMethod == 1) {
                $path = "{$my_base_url}{$my_pligg_base}/module.php?module=extra_pages&amp;action=show_faq";
            } else {
                if ($URLMethod == 2) {
                    $path = "{$my_base_url}{$my_pligg_base}/faq";
                }
            }
            create_entry($res[0], $path);
        }
    }
    //close xml
    echo '</urlset>';
    if (XmlSitemaps_use_cache) {
        $ret = ob_get_contents();
        ob_end_flush();
        my_file_put_contents($icf, $ret);
    }
    return true;
}