| 카페홈 | 회원가입 | 로그인

그누보드

카페정보
내정보

🍬 카페명 : 그누보드

👔 카페장 : 최고관리자

🕛 개설일 : 2023-01-04

👪 회원수 : 2명

👀 총 방문자 : 110명

레벨 : 비회원

카페 회원이 아닙니다.
카페가입 후 이용하세요.

그누보드

그누보드 | seo.php

페이지 정보

작성자 모아 작성일23-02-14 22:02 조회41회 댓글0건

본문

<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가


$seo_title      = '';

$seo_desc       = '';

$seo_image      = '';

$seo_url        = '';

$seo_author     = '';

$seo_date       = '';

$seo_site_name  = '';

$seo_tag        = '';

$seo_robots     = "index, follow";


if ($g4['title'])

    $seo_title = $g5['title'];


if ($g5['title'])

    $seo_title = $g5['title'];


$seo_title = preg_replace("/\n/", " ", $seo_title);

$seo_title = preg_replace("/\"/", "", $seo_title);

$seo_title = preg_replace("/'/", "", $seo_title);

$seo_title = preg_replace("/,/", "", $seo_title);

$seo_title = preg_replace("/http:\/\/[^\s]+/", "", $seo_title);

$seo_title = trim($seo_title);

$seo_title = cut_str($seo_title, 255);


$seo_site_name = cut_str(trim(strip_tags($config['cf_title'])), 255);


if ($bo_table and $wr_id and $write)

{

    $sql = " select bf_file ";

    $sql.= "   from {$g5['board_file_table']} ";

    $sql.= "  where bo_table = '{$bo_table}' ";

    $sql.= "    and wr_id = '{$wr_id}' ";

    $sql.= "    and bf_width > 0 ";

    $sql.= "  order by bf_width desc ";

    $sql.= "  limit 1 ";


    $fb_file = sql_fetch($sql);


    if ($fb_file) {

        $seo_image = G5_URL."/data/file/".$bo_table."/".$fb_file['bf_file'];

    }

    else {

        preg_match_all("/


        $mat = '';

        for ($i=0, $m=count($matchs[1]); $i<$m; ++$i)

        {

            $mat = $matchs[1][$i];


            // 이모티콘 제외

            if (strstr($mat, "mw.basic.comment.image")) $mat = '';

            if (strstr($mat, "mw.emoticon")) $mat = '';

            if (preg_match("/cheditor[0-9]\/icon/i", $mat)) $mat = '';


            if ($mat) {

                $seo_image = $mat;

                break;

            }

        }


        if (!$mat) {

            $seo_image = G5_PATH."/data/file/".$bo_table."/thumbnail/".$wr_id.".jpg";


            if (!@is_file($seo_image))

                $seo_image = G5_PATH."/data/file/".$bo_table."/thumbnail/".$wr_id;


            if (!@is_file($seo_image))

                $seo_image = G5_PATH."/data/file/".$bo_table."/thumb/".$wr_id;


            if (!@is_file($seo_image))

                $seo_image = '';

            else

                $seo_image = str_replace(G5_PATH, G5_URL, $seo_image);

        }

    }


    $seo_title = cut_str(trim(strip_tags($write['wr_subject'])), 255);


    $seo_desc = $write['wr_content'];

    $seo_desc = trim(preg_replace("/{이미지:[0-9]+}/iUs", "", $seo_desc));

    $seo_desc = strip_tags($seo_desc);

    $seo_desc = explode("\n", $seo_desc);

    for ($i=0, $m=count($seo_desc); $i<$m; $i++) {

        $seo_desc[$i] = trim($seo_desc[$i]);

    }

    $seo_desc = implode(" ", $seo_desc);

    $seo_desc = preg_replace("/\n/", " ", $seo_desc);

    $seo_desc = preg_replace("/\"/", "", $seo_desc);

    $seo_desc = preg_replace("/'/", "", $seo_desc);

    $seo_desc = preg_replace("/,/", "", $seo_desc);

    $seo_desc = preg_replace("/http:\/\/[^\s]+/", "", $seo_desc);

    $seo_desc = trim($seo_desc);

    $seo_desc = cut_str($seo_desc, 255);


    $seo_date = $write['wr_datetime'];


    $seo_author = $write['wr_name'];


    $seo_tag = $board['bo_subject'];



    if (strstr($write['wr_option'], 'secret'))

        $seo_robots = "noindex";


    $seo_url = mw_seo_url($bo_table, $wr_id);

}


if (!$seo_title)

    $seo_title = $mw['config']['cf_title'];


if (!$seo_image or !@is_file(str_replace(G5_URL, G5_PATH, $seo_image)))

    $seo_image = G5_DATA_URL."/seo/sns_image.png";


$seo_image_size = @getimagesize(str_replace(G5_URL, G5_PATH, $seo_image));

$seo_image_x = $seo_image_size[0];

$seo_image_y = $seo_image_size[1];


if (!$seo_url)

    $seo_url  = set_http($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);


if (!$seo_desc)

    $seo_desc = addslashes($mw['config']['cf_desc']);


if (!$seo_author)

    $seo_author = addslashes($mw['config']['cf_author']);


if (!$seo_author) {

    $tmp = get_member($config['cf_admin'], "mb_nick");

    $seo_author = $tmp['mb_nick'];

}


$seo_favicon = '';

if (is_file(G5_DATA_PATH.'/seo/favicon.ico') and filesize(G5_DATA_PATH.'/seo/favicon.ico'))

    $seo_favicon = G5_DATA_URL.'/seo/favicon.ico';


$seo_phone_icon = '';

if (is_file(G5_DATA_PATH.'/seo/phone_icon.png') and filesize(G5_DATA_PATH.'/seo/phone_icon.png'))

    $seo_phone_icon = G5_DATA_URL.'/seo/phone_icon.png';


ob_start();

?>

<?php if ($seo_favicon) { ?>

<?php } ?>









<?php if ($bo_table and $board['bo_use_rss_view'] and $board['bo_read_level'] == 1) : ?>

" />

" />

" />

<?php endif; ?>



{

    "@context": "http://schema.org",

    "@type": "BlogPosting",

    "mainEntityOfPage":{

        "@type":"WebPage",

        "@id":"<?php echo $seo_url?>"

    },

    "headline": "<?php echo $seo_title?>",

    "image": {

        "@type": "ImageObject",

        "url": "<?php echo $seo_image?>",

        "height": '<?php echo $seo_image_y?>',

        "width": '<?php echo $seo_image_x?>'

    },

    "datePublished": "<?php echo date('c', strtotime($seo_date))?>",

    "dateModified": "<?php echo date('c', strtotime($seo_date))?>",

    "author": {

        "@type": "Person",

        "name": "<?php echo $seo_author?>"

    },

    "publisher": {

        "@type": "Organization",

        "name": "<?php echo $seo_author?>",

    },

    "description": "<?php echo $seo_desc?>"

}


<?php

$seo = ob_get_clean();


return $seo;


추천 0 비추천 0

포인트 선물 선물명단 선물하기

최소 5P ~ 최대 100000000P 까지 가능합니다.
로그인 후 선물하실 수 있습니다.

선물 받은 내용이 없습니다.



댓글 0
등록된 댓글이 없습니다.
카페 : cf_gnu 그누보드
💬포인트AD       - ...      - ...      - ...