<?php

require_once '../../../include/conmysql.php';
require_once '../../../include/public_function.php';
require_once '../../../include/bbs_function.php';
$public_function = new public_function();
$bbs_function = new bbs_function();
$blog_userid = $_SESSION['UID'];
$blog_type = $_SESSION['UTYPE'];
$fatieid = str_replace(" ", "", $_GET['fatieid']);
$fatiepage = 1;
$result = $bbs_function->shoucangTieZi($fatieid, $blog_userid, CURRENT_TIME);
if ($result == "no") {
    echo "<script>alert('已经收藏该帖子,不能重复收藏.');location.href='../shyule_bbs_scan.php?fatieid=" . $fatieid . "&page=" . $fatiepage . "'</script>";
} else {
    if ($result == "no1") {
        echo "<script>alert('不能收藏自己所发的帖子.');location.href='../shyule_bbs_scan.php?fatieid=" . $fatieid . "&page=" . $fatiepage . "'</script>";
    } else {
        if ($result == "no2") {
            echo "<script>location.href='../shyule_bbs_scan.php?fatieid=" . $fatieid . "&page=" . $fatiepage . "'</script>";
        } else {
            echo "<script>location.href='../shyule_bbs_scan.php?fatieid=" . $fatieid . "&page=" . $fatiepage . "'</script>";
        }
    }
}