Exemplo n.º 1
0
<?php

require_once './../inc/init.php';
$langid = intval($_GET['langid']);
$urlrewrite = intval($cache_settings['urlrewrite']);
$_viewurl = 'view.php?id={id}&amp;langid={langid}';
_header_('Content-Type:text/xml;');
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$rows = $db->row_select("articles", "langid={$langid}", "500", "id", "posttime desc");
$url = getUrlPath(-1);
$lastmod = getDateStr(time(), "dateonly", false);
print <<<EOT
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

EOT;
$i = 0;
foreach ($rows as $row) {
    $priority = 1 - $i++ / 10000;
    $priority = $priority < 0.6 ? 0.6 : $priority;
    $priority = number_format($priority, 2);
    $viewurl = $_viewurl;
    $viewurl = str_replace('{id}', $row['id'], $viewurl);
    $viewurl = str_replace('{langid}', $langid, $viewurl);
    print <<<EOT
<url>
<loc>{$url}/{$viewurl}</loc>
<priority>{$priority}</priority>
<changefreq>daily</changefreq>
<lastmod>{$lastmod}</lastmod>
</url>
Exemplo n.º 2
0
                exit($_SLANG['ajaxpublic.user.actived']);
            }
            $d = $_SYS['time'] - 24 * 3600;
            $db->row_delete("memberfield", "type=0 and createtime<{$d}");
            $fieldrows = $db->row_query("select count(0) as C from `{$db->pre}memberfield` where memberid={$row['id']} and type=0");
            if (!empty($fieldrows) && $fieldrows[0]['C'] >= 3) {
                exit($_SLANG['ajaxpublic.active.timelimit']);
            }
            $activecode = md5($row['membername'] . $row['memberpass'] . $_SYS['time'] . mt_rand(1000, 9999));
            $memberfield['memberid'] = $row['id'];
            $memberfield['code'] = $activecode;
            $memberfield['createtime'] = $_SYS['time'];
            $memberfield['type'] = 0;
            //用户激活
            $db->row_insert("memberfield", $memberfield);
            $url = getUrlPath() . "/public.php?action=active&uid={$row['id']}&code={$activecode}";
            $subject = _LANG($_SLANG['signup.activeemail.title'], array($cache_settings['webname']));
            $body = _LANG($_SLANG['signup.activeemail.body'], array($row['membername'], "<a href=\"{$cache_settings['url']}\" target=\"_blank\">{$cache_settings['webname']}</a>", "<br /><a href=\"{$url}\" target=\"_blank\">{$url}</a>"));
            require_once 'inc/email.php';
            if (sendMail($row['email'], $subject, $body)) {
                succeedFlag();
            } else {
                echo $_SLANG['ajaxpublic.mailfailed'];
            }
        }
        break;
    default:
        echo "No Such Action";
        break;
}
//OrderForm 生成订单号OrderNum
Exemplo n.º 3
0
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
if (empty($id)) {
    exitRes($_SLANG['attachment.fileid.ne']);
}
$row = $db->row_select_one("attachments", "id={$id}");
if (empty($row)) {
    exitRes($_SLANG['attachment.file.ne']);
}
$filepath = "uploadfile/attachment/" . $row['filepath'];
//if is image and redirect
//if(intval($_GET['r'])==1 && $row['type']==1){
if ($row['type'] == 1) {
    if (!file_exists(ATT_PATH . "/" . $filepath)) {
        exitRes($_SLANG['attachment.filedel']);
    }
    $filepath = getUrlPath() . '/' . $filepath;
    $filepath = preg_replace('/\\/' . ADMIN_DIR . '\\//i', '/', $filepath);
    //ob_end_clean();
    header("HTTP/1.1 301 Moved Permanently");
    header("Last-Modified:" . date('r'));
    header("Expires: " . date('r', time() + 86400));
    header("Location:{$filepath}");
    exit;
}
$filepath = ATT_PATH . "/uploadfile/attachment/" . $row['filepath'];
$filename = stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? urlencode($row['filename']) : $row['filename'];
ob_end_clean();
_header_('Content-Encoding: none');
_header_('Content-Type: application/octet-stream');
_header_('Content-Disposition: attachment; filename="' . $filename . '"');
_header_('Content-Length: ' . filesize($filepath));
Exemplo n.º 4
0
<?php

require_once './../inc/init.php';
_header_('Content-Type:text/xml;');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$url = getUrlPath(0);
$lastmod = getDateStr(time(), 'dateonly', false);
print <<<EOT
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
EOT;
foreach ($cache_langs as $lang) {
    print <<<EOT
<sitemap>
\t<loc>{$url}/channels.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
<sitemap>
\t<loc>{$url}/articlelist.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
<sitemap>
\t<loc>{$url}/productlist.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
EOT;
}
print <<<EOT
</sitemapindex>
EOT
;