Beispiel #1
0
 function parse($f, $mdes, $m1, $m2, $m3, $mrs, $mnum)
 {
     if ($mnum < 10) {
         $numfill = "0" . $mnum;
     } else {
         $numfill = $mnum;
     }
     $val = $m1;
     switch ($f) {
         case "menu":
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["t_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["t_name"]);
                     break;
                 case "enname":
                     $val = getTextt($m3, $mrs["t_enname"]);
                     break;
                 case "pid":
                     $val = $mrs["t_pid"];
                     break;
                 case "title":
                     $val = $mrs["t_title"];
                     break;
                 case "key":
                     $val = $mrs["t_key"];
                     break;
                 case "des":
                     $val = $mrs["t_des"];
                     break;
                 case "link":
                     if ($this->L['type'] == 'auto') {
                         $an = $this->P['vodtypeid'] > 0 ? 'list' : 'search';
                         $col = $this->P['vodtypeid'] > 0 ? 'id' : 'typeid';
                         $val = $this->getLink($this->L['table'], $an, $this->T, array($col => $mrs['t_id']));
                     } else {
                         $val = $this->getLink($this->L['table'], 'type', $mrs, $row);
                     }
                     break;
                 case "count":
                     if ($this->L['table'] == "art") {
                         $typearr = $GLOBALS['MAC_CACHE']['arttype'][$mrs["t_id"]];
                         $val = $this->getDataCount('art', " and a_type in (" . $typearr["childids"] . ")");
                     } else {
                         $typearr = $GLOBALS['MAC_CACHE']['vodtype'][$mrs["t_id"]];
                         $val = $this->getDataCount('vod', " and d_type in (" . $typearr["childids"] . ")");
                     }
                     break;
             }
             break;
         case "class":
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["c_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["c_name"]);
                     break;
                 case "enname":
                     $val = getTextt($m3, $mrs["c_enname"]);
                     break;
                 case "pid":
                     $val = $mrs["c_pid"];
                     break;
                 case "link":
                     if ($this->L['type'] == 'auto') {
                         $an = $this->P['vodtypeid'] > 0 ? 'list' : 'search';
                         $col = $this->P['vodtypeid'] > 0 ? 'class' : 'classid';
                         $val = $this->getLink('vod', $an, $this->T, array($col => $mrs['c_id']));
                     } else {
                         $val = $this->getLink('vod', 'search', $mrs, array('classid' => $mrs['c_id']));
                     }
                     break;
             }
             break;
         case "topic":
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["t_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["t_name"]);
                     break;
                 case "enname":
                     $val = getTextt($m3, $mrs["t_enname"]);
                     break;
                 case "sort":
                     $val = $mrs["t_sort"];
                     break;
                 case "title":
                     $val = $mrs["t_title"];
                     break;
                 case "key":
                     $val = $mrs["t_key"];
                     break;
                 case "des":
                     $val = $mrs["t_des"];
                     break;
                 case "addtime":
                     $val = getDatet($m3, $mrs["t_addtime"]);
                     break;
                 case "time":
                     $val = getDatet($m3, $mrs["t_time"]);
                     break;
                 case "level":
                     $val = $mrs["t_level"];
                     break;
                 case "hits":
                     $val = $mrs["t_hits"];
                     break;
                 case "dayhits":
                     $val = $mrs["t_dayhits"];
                     break;
                 case "weekhits":
                     $val = $mrs["t_weekhits"];
                     break;
                 case "monthhits":
                     $val = $mrs["t_monthhits"];
                     break;
                 case "content":
                     $val = getTextt($m3, $mrs["t_content"]);
                     break;
                 case "contenttext":
                     $val = getTextt($m3, strip_tags($mrs["t_content"]));
                     break;
                 case "remarks":
                     $val = getTextt($m3, $mrs["t_remarks"]);
                     break;
                 case "pic":
                     $val = $mrs["t_pic"];
                     if (strpos("," . $val, "http://") <= 0) {
                         if ($GLOBALS['MAC']['upload']['remote'] == 1) {
                             $val = $GLOBALS['MAC']['upload']['remoteurl'] . $val;
                         } else {
                             $val = MAC_PATH . $val;
                         }
                     }
                     break;
                 case "count":
                     $val = $this->getDataCount($this->L['table'] . '_relation', " and r_type=2 and r_a=" . $mrs["t_id"]);
                     break;
                 case "link":
                     $val = $this->getLink($this->L['table'], 'topic', $mrs, $row);
                     break;
             }
             break;
         case "link":
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["l_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["l_name"]);
                     break;
                 case "type":
                     $val = $mrs["l_type"] == 1 ? "图片" : "文字";
                     break;
                 case "link":
                     $val = $mrs["l_url"];
                     break;
                 case "pic":
                     $val = $mrs["l_logo"];
                     break;
             }
             break;
         case "gbook":
             $bgcolorArr = array("D66203", "513DBD", "784E1A", "C55200", "DA6912", "537752", "C58200", "519DBD", "D60103", "531752");
             $reg2 = '~(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)~';
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["g_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["g_name"]);
                     break;
                 case "content":
                     $val = regReplace(getTextt($m3, $mrs["g_content"]), "\\[em:(\\d{1,})?\\]", "<img src=\"" . MAC_PATH . "images/face/\$1.gif\" border=0/>");
                     break;
                 case "reply":
                     $val = getTextt($m3, $mrs["g_reply"]);
                     break;
                 case "ip":
                     $val = preg_replace($reg2, "\$1.\$2.*.*", long2ip($mrs["g_ip"]));
                     break;
                 case "time":
                     $val = getDatet($m3, $mrs["g_time"]);
                     break;
                 case "replytime":
                     $val = getDatet($m3, $mrs["g_replytime"]);
                     break;
                 case "color":
                     $val = '#' . $bgcolorArr[rand(1, 9)];
                     break;
             }
             break;
         case "comment":
             $bgcolorArr = array("D66203", "513DBD", "784E1A", "C55200", "DA6912", "537752", "C58200", "519DBD", "D60103", "531752");
             $reg2 = '~(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)~';
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "id":
                     $val = $mrs["c_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["c_name"]);
                     break;
                 case "content":
                     $val = regReplace(getTextt($m3, $mrs["c_content"]), "\\[em:(\\d{1,})?\\]", "<img src=\"" . MAC_PATH . "images/face/\$1.gif\" border=0/>");
                     break;
                 case "ip":
                     $val = preg_replace($reg2, "\$1.\$2.*.*", long2ip($mrs["c_ip"]));
                     break;
                 case "time":
                     $val = getDatet($m3, $mrs["c_time"]);
                     break;
                 case "color":
                     $val = '#' . $bgcolorArr[rand(1, 9)];
                     break;
             }
             break;
         case "vod":
             $typearr = $GLOBALS['MAC_CACHE']['vodtype'][$mrs["d_type"]];
             if (!is_array($typearr)) {
                 return;
             }
             $tp = $GLOBALS['MAC_CACHE']['vodtype'][$typearr["t_pid"]];
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "numjoin":
                     $val = $this->L['start'] + $mnum;
                     if ($val < 10) {
                         $val = "0" . $val;
                     }
                     break;
                 case "id":
                     $val = $mrs["d_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["d_name"]);
                     break;
                 case "encodename":
                     $val = urlencode($mrs["d_name"]);
                     break;
                 case "colorname":
                     $val = getTextt($m3, $mrs["d_name"]);
                     if (!empty($mrs["d_color"])) {
                         $val = "<font color=" . $mrs["d_color"] . ">" . $val . "</font>";
                     }
                     break;
                 case "subname":
                     $val = getTextt($m3, $mrs["d_subname"]);
                     break;
                 case "enname":
                     $val = getTextt($m3, $mrs["d_enname"]);
                     break;
                 case "ennamelink":
                     $val = getKeysLink($mrs["d_enname"], "pinyin");
                     break;
                 case "state":
                     $val = $mrs["d_state"];
                     break;
                 case "color":
                     $val = $mrs["d_color"];
                     break;
                 case "pic":
                     $val = $mrs["d_pic"];
                     if (strpos("," . $val, "http://") <= 0) {
                         if ($GLOBALS['MAC']['upload']['remote'] == 1) {
                             $val = $GLOBALS['MAC']['upload']['remoteurl'] . $val;
                         } else {
                             $val = MAC_PATH . $val;
                         }
                     }
                     break;
                 case "picthumb":
                     $val = $mrs["d_picthumb"];
                     if (strpos("," . $val, "http://") <= 0) {
                         if ($GLOBALS['MAC']['upload']['remote'] == 1) {
                             $val = $GLOBALS['MAC']['upload']['remoteurl'] . $val;
                         } else {
                             $val = MAC_PATH . $val;
                         }
                     }
                     break;
                 case "picslide":
                     $val = $mrs["d_picslide"];
                     if (strpos("," . $val, "http://") <= 0) {
                         if ($GLOBALS['MAC']['upload']['remote'] == 1) {
                             $val = $GLOBALS['MAC']['upload']['remoteurl'] . $val;
                         } else {
                             $val = MAC_PATH . $val;
                         }
                     }
                     break;
                 case "letter":
                     $val = getTextt($m3, $mrs["d_letter"]);
                     break;
                 case "letterlink":
                     $val = getKeysLink($mrs["d_letter"], "letter");
                     break;
                 case "tag":
                     $val = getTextt($m3, $mrs["d_tag"]);
                     break;
                 case "taglink":
                     $val = getKeysLink($mrs["d_tag"], "tag");
                     break;
                 case "starring":
                     $val = getTextt($m3, $mrs["d_starring"]);
                     break;
                 case "starringlink":
                     $val = getKeysLink($mrs["d_starring"], "starring");
                     break;
                 case "directed":
                     $val = getTextt($m3, $mrs["d_directed"]);
                     break;
                 case "directedlink":
                     $val = getKeysLink($mrs["d_directed"], "directed");
                     break;
                 case "area":
                     $val = $mrs["d_area"];
                     break;
                 case "arealink":
                     $val = getKeysLink($mrs["d_area"], "area");
                     break;
                 case "year":
                     $val = $mrs["d_year"] == 0 ? '未知' : $mrs["d_year"];
                     break;
                 case "yearlink":
                     $val = getKeysLink($mrs["d_year"] == 0 ? '未知' : $mrs["d_year"], "year");
                     break;
                 case "lang":
                     $val = $mrs["d_lang"];
                     break;
                 case "langlink":
                     $val = getKeysLink($mrs["d_lang"], "lang");
                     break;
                 case "level":
                     $val = $mrs["d_level"];
                     break;
                 case "stint":
                     $val = $mrs["d_stint"];
                     break;
                 case "stintdown":
                     $val = $mrs["d_stintdown"];
                     break;
                 case "hits":
                     $val = $mrs["d_hits"];
                     break;
                 case "dayhits":
                     $val = $mrs["d_dayhits"];
                     break;
                 case "weekhits":
                     $val = $mrs["d_weekhits"];
                     break;
                 case "monthhits":
                     $val = $mrs["d_monthhits"];
                     break;
                 case "content":
                     $val = getTextt($m3, $mrs["d_content"]);
                     break;
                 case "contenttext":
                     $val = getTextt($m3, strip_tags($mrs["d_content"]));
                     break;
                 case "remarks":
                     $val = getTextt($m3, $mrs["d_remarks"]);
                     break;
                 case "up":
                     $val = $mrs["d_up"];
                     break;
                 case "down":
                     $val = $mrs["d_down"];
                     break;
                 case "score":
                     $val = $mrs["d_score"];
                     break;
                 case "scoreall":
                     $val = $mrs["d_scoreall"];
                     break;
                 case "scorenum":
                     $val = $mrs["d_scorenum"];
                     break;
                 case "duration":
                     $val = $mrs["d_duration"];
                     break;
                 case "addtime":
                     $val = getDatet($m3, $mrs["d_addtime"]);
                     break;
                 case "time":
                     $val = getDatet($m3, $mrs["d_time"]);
                     break;
                 case "from":
                     $val = getVodXmlText("vodplay", "play", $mrs["d_playfrom"]);
                     break;
                 case "fromdown":
                     $val = getVodXmlText("voddown", "down", $mrs["d_downfrom"]);
                     break;
                 case "link":
                     $val = $this->getLink('vod', 'detail', $typearr, $mrs);
                     break;
                 case "playlink":
                     $val = str_replace(array('{src}', '{num}'), array('1', '1'), $this->getLink('vod', 'play', $typearr, $mrs));
                     break;
                 case "playlinks":
                     $val = '';
                     $arr = explode('$$$', $mrs['d_playfrom']);
                     $cc = count($arr);
                     if (empty($mrs['d_playfrom']) || $cc == 0) {
                         break;
                     }
                     $xmlarr = $GLOBALS['MAC_CACHE']['vodplay'];
                     $url = $this->getLink('vod', 'play', $typearr, $mrs);
                     for ($i = 0; $i < $cc; $i++) {
                         $show = $xmlarr[$arr[$i]]['show'];
                         $lnk = str_replace(array('{src}', '{num}'), array($i + 1, '1'), $url);
                         $val .= '<a href="' . $lnk . '" target="_blank" class="playlink_' . $arr[$i] . '">' . $show . '</a> ';
                     }
                     unset($arr, $xmlarr);
                     break;
                 case "downlink":
                     $val = str_replace(array('{src}', '{num}'), array('1', '1'), $this->getLink('vod', 'down', $typearr, $mrs));
                     break;
                 case "downlinks":
                     $val = '';
                     $arr = explode('$$$', $mrs['d_downfrom']);
                     $cc = count($arr);
                     if (empty($mrs['d_downfrom']) || $cc == 0) {
                         break;
                     }
                     $xmlarr = $GLOBALS['MAC_CACHE']['voddown'];
                     $url = $this->getLink('vod', 'down', $typearr, $mrs);
                     for ($i = 0; $i < $cc; $i++) {
                         $show = $xmlarr[$arr[$i]]['show'];
                         $lnk = str_replace(array('{src}', '{num}'), array($i + 1, '1'), $url);
                         $val .= '<a href="' . $lnk . '" target="_blank" class="downlink_' . $arr[$i] . '">' . $show . '</a> ';
                     }
                     unset($arr, $xmlarr);
                     break;
                 case "type":
                     $val = $mrs["d_type"];
                     break;
                 case "typepid":
                     $val = $typearr["t_pid"];
                     break;
                 case "typeplink":
                     $val = $this->getLink('vod', 'type', $tp, $mrs);
                     break;
                 case "typepname":
                     $val = $tp["t_name"];
                     break;
                 case "typepenname":
                     $val = $tp["t_enname"];
                     break;
                 case "typepkey":
                     $val = $tp["t_key"];
                     break;
                 case "typepdes":
                     $val = $tp["t_des"];
                     break;
                 case "typelink":
                     $val = $this->getLink('vod', 'type', $typearr, $mrs);
                     break;
                 case "typename":
                     $val = $typearr["t_name"];
                     break;
                 case "typeenname":
                     $val = $typearr["t_enname"];
                     break;
                 case "typekey":
                     $val = $typearr["t_key"];
                     break;
                 case "typedes":
                     $val = $typearr["t_des"];
                     break;
                 case "typetitle":
                     $val = $typearr["t_title"];
                     break;
                 case "typeexpandlink":
                     $val = '';
                     break;
                 case "classname":
                     $val = '';
                     if (!empty($mrs['d_class'])) {
                         $rc = false;
                         $ids = explode(',', $mrs['d_class']);
                         foreach ($ids as $a) {
                             if (!empty($a)) {
                                 $arr = $GLOBALS['MAC_CACHE']['vodclass'][$a];
                                 if ($rc) {
                                     $val .= '&nbsp;';
                                 }
                                 $val .= $arr['c_name'];
                                 $rc = true;
                             }
                         }
                         unset($ids);
                     }
                     break;
                 case "classlink":
                     $val = '';
                     if (!empty($mrs['d_class'])) {
                         $rc = false;
                         $ids = explode(',', $mrs['d_class']);
                         foreach ($ids as $a) {
                             if (!empty($a)) {
                                 $arr = $GLOBALS['MAC_CACHE']['vodclass'][$a];
                                 $mrs['id'] = $typearr['t_id'];
                                 $mrs['class'] = $arr['c_id'];
                                 $lnk = $this->getLink('vod', 'list', $typearr, $mrs);
                                 if ($rc) {
                                     $val .= '&nbsp;';
                                 }
                                 $val .= "<a target='_blank' href='" . $lnk . "' />" . $arr['c_name'] . "</a>";
                                 $rc = true;
                             }
                         }
                         unset($ids);
                     }
                     break;
                 case "topiclink":
                     $val = '';
                     if (!empty($mrs['d_topic'])) {
                         $rc = false;
                         $ids = explode(',', $mrs['d_topic']);
                         foreach ($ids as $a) {
                             if (!empty($a)) {
                                 $arr = $GLOBALS['MAC_CACHE']['vodtopic'][$a];
                                 $lnk = $this->getLink('vod', 'topic', $arr, $mrs);
                                 if ($rc) {
                                     $val .= '&nbsp;';
                                 }
                                 $val .= "<a target='_blank' href='" . $lnk . "' />" . $arr['t_name'] . "</a>";
                                 $rc = true;
                             }
                         }
                         unset($ids);
                     }
                     break;
                 case "userfav":
                     $val = "<a href=\"javascript:void(0)\" onclick=\"MAC.UserFav('" . $mrs["d_id"] . "');return false;\"/>会员收藏</a>";
                     break;
                 default:
                     $val = $m1;
                     break;
             }
             break;
         case "art":
             $typearr = $GLOBALS['MAC_CACHE']['arttype'][$mrs["a_type"]];
             if (!is_array($typearr)) {
                 return;
             }
             $tp = $GLOBALS['MAC_CACHE']['arttype'][$typearr["t_pid"]];
             switch ($m2) {
                 case "num":
                     $val = $mnum;
                     break;
                 case "numfill":
                     $val = $numfill;
                     break;
                 case "numjoin":
                     $val = $this->P['start'] + $mnum;
                     break;
                 case "id":
                     $val = $mrs["a_id"];
                     break;
                 case "name":
                     $val = getTextt($m3, $mrs["a_name"]);
                     break;
                 case "encodename":
                     $val = urlencode($mrs["a_name"]);
                     break;
                 case "colorname":
                     $val = getTextt($m3, $mrs["a_name"]);
                     if (!empty($mrs["a_color"])) {
                         $val = "<font color=" . $mrs["a_color"] . ">" . $val . "</font>";
                     }
                     break;
                 case "letter":
                     $val = getTextt($m3, $mrs["a_letter"]);
                     break;
                 case "letterlink":
                     $val = getKeysLink($mrs["a_letter"], "letter", 'art');
                     break;
                 case "subname":
                     $val = getTextt($m3, $mrs["a_subname"]);
                     break;
                 case "enname":
                     $val = getTextt($m3, $mrs["a_enname"]);
                     break;
                 case "from":
                     $val = getTextt($m3, $mrs["a_from"]);
                     break;
                 case "remarks":
                     $val = getTextt($m3, $mrs["a_remarks"]);
                     break;
                 case "tag":
                     $val = getTextt($m3, $mrs["a_tag"], 'art');
                     break;
                 case "taglink":
                     $val = getKeysLink($mrs["a_tag"], "tag", 'art');
                     break;
                 case "content":
                     $val = $mrs["a_content"];
                     if ($this->P['pagetype'] == "detail") {
                         $val = $this->P['content'];
                     }
                     $val = getTextt($m3, $val);
                     break;
                 case "contenttext":
                     $val = $mrs["a_content"];
                     if ($this->P['pagetype'] == "detail") {
                         $val = $this->P['content'];
                     }
                     $val = strip_tags($val);
                     $val = getTextt($m3, strip_tags($val));
                     break;
                 case "author":
                     $val = getTextt($m3, $mrs["a_author"]);
                     break;
                 case "color":
                     $val = $mrs["a_color"];
                     break;
                 case "up":
                     $val = $mrs["a_up"];
                     break;
                 case "down":
                     $val = $mrs["a_down"];
                     break;
                 case "hits":
                     $val = $mrs["a_hits"];
                     break;
                 case "dayhits":
                     $val = $mrs["a_dayhits"];
                     break;
                 case "weekhits":
                     $val = $mrs["a_weekhits"];
                     break;
                 case "monthhits":
                     $val = $mrs["a_monthhits"];
                     break;
                 case "addtime":
                     $val = getDatet($m3, $mrs["a_addtime"]);
                     break;
                 case "time":
                     $val = getDatet($m3, $mrs["a_time"]);
                     break;
                 case "pic":
                     $val = $mrs["a_pic"];
                     if (strpos("," . $val, "http://") <= 0) {
                         if ($GLOBALS['MAC']['upload']['remote'] == 1) {
                             $val = $GLOBALS['MAC']['upload']['remoteurl'] . $val;
                         } else {
                             $val = MAC_PATH . $val;
                         }
                     }
                     break;
                 case "link":
                     $val = $this->getLink('art', 'detail', $typearr, $mrs);
                     break;
                 case "level":
                     $val = $mrs["a_level"];
                     break;
                 case "type":
                     $val = $mrs["a_type"];
                     break;
                 case "typepid":
                     $val = $typearr["t_pid"];
                     break;
                 case "typeplink":
                     $val = $this->getLink('art', 'type', $tp, $mrs);
                     break;
                 case "typepname":
                     $val = $tp["t_name"];
                     break;
                 case "typepenname":
                     $val = $tp["t_enname"];
                     break;
                 case "typepkey":
                     $val = $tp["t_key"];
                     break;
                 case "typepdes":
                     $val = $tp["t_des"];
                     break;
                 case "typeptitle":
                     $val = $tp["t_title"];
                     break;
                 case "typelink":
                     $val = $this->getLink('art', 'type', $typearr, $mrs);
                     break;
                 case "typename":
                     $val = $typearr["t_name"];
                     break;
                 case "typeenname":
                     $val = $typearr["t_enname"];
                     break;
                 case "typekey":
                     $val = $typearr["t_key"];
                     break;
                 case "typedes":
                     $val = $typearr["t_des"];
                     break;
                 case "typetitle":
                     $val = $typearr["t_title"];
                     break;
                 case "topiclink":
                     $val = '';
                     if (!empty($mrs['a_topic'])) {
                         $rc = false;
                         $ids = explode(',', $mrs['a_topic']);
                         foreach ($ids as $a) {
                             if (!empty($a)) {
                                 $arr = $GLOBALS['MAC_CACHE']['arttopic'][$a];
                                 $lnk = $this->getLink('art', 'topic', $arr, $mrs);
                                 if ($rc) {
                                     $val .= '&nbsp;';
                                 }
                                 $val .= "<a target='_blank' href='" . $lnk . "' />" . $arr['t_name'] . "</a>";
                                 $rc = true;
                             }
                         }
                         unset($ids);
                     }
                     break;
                 default:
                     $val = $m1;
                     break;
             }
             break;
         default:
             break;
     }
     unset($typearr, $tp);
     $markstr = str_replace($m1, $val, $mdes);
     return $markstr;
 }
Beispiel #2
0
 function parse($mtype, $mdes, $m1, $m2, $m3, $mrs, $mnum)
 {
     global $db, $mac, $cache;
     if ($mnum < 10) {
         $numfill = "0" . $mnum;
     } else {
         $numfill = $mnum;
     }
     switch ($mtype) {
         case "type":
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "numfill":
                     $markstr = replaceStr($mdes, $m1, $numfill);
                     break;
                 case "id":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_id"]);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_name"]);
                     break;
                 case "enname":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_enname"]);
                     break;
                 case "key":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_key"]);
                     break;
                 case "des":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_des"]);
                     break;
                 case "link":
                     if ($this->par_table == "art") {
                         $markstr = replaceStr($mdes, $m1, $this->getArtTypeLink($mrs["t_id"], $mrs["t_name"], $mrs["t_enname"], true));
                     } else {
                         $markstr = replaceStr($mdes, $m1, $this->getVodTypeLink($mrs["t_id"], $mrs["t_name"], $mrs["t_enname"], true));
                     }
                     break;
                 case "linktype":
                     if ($this->par_table == "vod") {
                         $alink = $this->getVodTypeLink($mrs["t_id"], $mrs["t_name"], $mrs["t_enname"], false);
                         switch (app_vodlistviewtype) {
                             case 0:
                             case 3:
                                 $str = "-1" . "-{area}-{year}-" . $mac["order"] . "-" . $mac["by"] . "." . app_vodsuffix;
                                 break;
                             case 1:
                                 $str = "&page=1&area={area}&year={year}&order=" . $mac["order"] . "&by=" . $mac["by"];
                                 break;
                             default:
                                 $str = "." . app_vodsuffix;
                                 break;
                         }
                         $str = replaceStr($str, "{year}", $mac["year"]);
                         $alink = $alink . replaceStr($str, "{area}", urlencode($mac["area"]));
                         $markstr = replaceStr($mdes, $m1, $alink);
                     }
                     break;
                 case "count":
                     if ($this->par_table == "art") {
                         $typearr = getValueByArray($cache[1], "t_id", $mrs["t_id"]);
                         if (is_array($typearr)) {
                             $where = " and a_type in (" . $typearr["childids"] . ")";
                         } else {
                             $where = " and a_type=" . $mrs["t_id"];
                         }
                         $datacount = $db->getOne("SELECT count(*) FROM {pre}art WHERE 1=1=" . $where);
                         $markstr = replaceStr($mdes, $m1, $datacount);
                     } else {
                         $typearr = getValueByArray($cache[0], "t_id", $mrs["t_id"]);
                         if (is_array($typearr)) {
                             $where = " and d_type in (" . $typearr["childids"] . ")";
                         } else {
                             $where = " and d_type=" . $mrs["t_id"];
                         }
                         $datacount = $db->getOne("SELECT count(*) FROM {pre}vod WHERE 1=1 " . $where);
                         $markstr = replaceStr($mdes, $m1, $datacount);
                     }
                     break;
                 default:
                     $markstr = $mdes;
                     break;
             }
             break;
         case "link":
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "numfill":
                     $markstr = replaceStr($mdes, $m1, $numfill);
                     break;
                 case "id":
                     $markstr = replaceStr($mdes, $m1, $mrs["l_id"]);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["l_name"]));
                     break;
                 case "type":
                     if ($mrs["l_type"] == "pic") {
                         $linktype = "图片";
                     } else {
                         $linktype = "文字";
                     }
                     $markstr = replaceStr($mdes, $m1, $linktype);
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, $mrs["l_url"]);
                     break;
                 case "pic":
                     $markstr = replaceStr($mdes, $m1, $mrs["l_logo"]);
                     break;
             }
             break;
         case "area":
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, $mrs);
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, app_installdir . "search.php?area=" . urlencode($mrs));
                     break;
             }
             break;
         case "lang":
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, $mrs);
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, app_installdir . "search.php?language=" . urlencode($mrs));
                     break;
             }
             break;
         case "year":
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, $mrs);
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, app_installdir . "search.php?year=" . $mrs);
                     break;
             }
             break;
         case "vod":
             if ($mac["vodtypeid"] == -1) {
                 $typearr = getValueByArray($cache[0], "t_id", $mrs["d_type"]);
             } else {
                 if (strpos("," . $mrs["d_type"], "," . $mac["vodtypeid"] . ",") > 0) {
                     $typearr = $this->page_typearr;
                 } else {
                     $typearr = getValueByArray($cache[0], "t_id", $mrs["d_type"]);
                 }
             }
             if (strpos($mdes, "topic") > 0) {
                 $topicarr = getValueByArray($cache[2], "t_id", $mrs["d_topic"]);
             }
             if (!is_array($typearr)) {
                 return;
             }
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "numfill":
                     $markstr = replaceStr($mdes, $m1, $numfill);
                     break;
                 case "numjoin":
                     $markstr = replaceStr($mdes, $m1, $this->startnum + $mnum);
                     break;
                 case "id":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_id"]);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_name"]));
                     break;
                 case "encodename":
                     $markstr = replaceStr($mdes, $m1, urlencode($mrs["d_name"]));
                     break;
                 case "colorname":
                     if ($mrs["d_color"] == "") {
                         $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_name"]));
                     } else {
                         $markstr = replaceStr($mdes, $m1, "<font color=\"" . $mrs["d_color"] . "\">" . getTextt($m3, $mrs["d_name"]) . "</font>");
                     }
                     break;
                 case "subname":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_subname"]));
                     break;
                 case "enname":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_enname"]));
                     break;
                 case "ennamelink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_enname"], "pinyin"));
                     break;
                 case "state":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_state"]);
                     break;
                 case "color":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_color"]);
                     break;
                 case "pic":
                     $pic = $mrs["d_pic"];
                     if (app_ftp == 1 && app_ftpurl != "") {
                         $pic = app_ftpurl . $pic;
                     } else {
                         if (strpos("," . $pic, "http://") <= 0) {
                             $pic = app_installdir . $pic;
                         } else {
                             $pic = $pic . "";
                         }
                     }
                     if (strpos($pic, "douban") !== false) {
                         $pic = 'http://weixin.joyplus.tv/image.php?imgurl=' . urlencode($pic);
                     }
                     $markstr = replaceStr($mdes, $m1, $pic);
                     break;
                 case "starring":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_starring"]));
                     break;
                 case "starringlink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_starring"], "starring"));
                     break;
                 case "directed":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["d_directed"]));
                     break;
                 case "directedlink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_directed"], "directed"));
                     break;
                 case "area":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_area"]);
                     break;
                 case "arealink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_area"], "area"));
                     break;
                 case "year":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_year"]);
                     break;
                 case "yearlink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_year"], "year"));
                     break;
                 case "language":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_language"]);
                     break;
                 case "languagelink":
                     $markstr = replaceStr($mdes, $m1, getKeysLink($mrs["d_language"], "language"));
                     break;
                 case "level":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_level"]);
                     break;
                 case "stint":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_stint"]);
                     break;
                 case "hits":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_hits"]);
                     break;
                 case "dayhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_dayhits"]);
                     break;
                 case "weekhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_weekhits"]);
                     break;
                 case "monthhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_monthhits"]);
                     break;
                 case "content":
                     //                    	var_dump(repPse($mrs["d_content"],$mrs["d_id"]));
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, repPse($mrs["d_content"], $mrs["d_id"])));
                     break;
                 case "contenttext":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, strip_tags(repPse($mrs["d_content"], $mrs["d_id"]))));
                     break;
                 case "remarks":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_remarks"]);
                     break;
                 case "good":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_good"]);
                     break;
                 case "bad":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_bad"]);
                     break;
                 case "score":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_score"]);
                     break;
                 case "scorecount":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_scorecount"]);
                     break;
                 case "scorepjf":
                     if ($mrs["d_scorecount"] == 0) {
                         $markstr = replaceStr($mdes, $m1, "0.0");
                     } else {
                         $pjf = round($mrs["d_score"] / $mrs["d_scorecount"], 1);
                         if (strpos($pjf, ".") <= 0) {
                             $pjf = $pjf . ".0";
                         }
                         $markstr = replaceStr($mdes, $m1, $pjf);
                     }
                     break;
                 case "addtime":
                     $markstr = replaceStr($mdes, $m1, getDatet($m3, $mrs["d_addtime"]));
                     break;
                 case "time":
                     $markstr = replaceStr($mdes, $m1, getDatet($m3, $mrs["d_time"]));
                     break;
                 case "from":
                     $markstr = replaceStr($mdes, $m1, getVodXmlText("vodplay.xml", "player", $mrs["d_playfrom"], 1));
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, $this->getVodLink($mrs["d_id"], $mrs["d_name"], $mrs["d_enname"], $typearr["t_id"], $typearr["t_name"], $typearr["t_enname"]));
                     break;
                 case "playlink":
                     $markstr = replaceStr($mdes, $m1, $this->getVodPlayUrl($mrs["d_id"], $mrs["d_name"], $mrs["d_enname"], $typearr["t_id"], $typearr["t_name"], $typearr["t_enname"], 1, 1));
                     break;
                 case "type":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_type"]);
                     break;
                 case "typelink":
                     $markstr = replaceStr($mdes, $m1, $this->getVodTypeLink($typearr["t_id"], $typearr["t_name"], $typearr["t_enname"], true));
                     break;
                 case "typename":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_name"]);
                     break;
                 case "typeenname":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_enname"]);
                     break;
                 case "typekey":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_key"]);
                     break;
                 case "typedes":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_des"]);
                     break;
                 case "topic":
                     $markstr = replaceStr($mdes, $m1, $mrs["d_topic"]);
                     break;
                 case "topicname":
                     if (is_array($topicarr)) {
                         $markstr = replaceStr($mdes, $m1, $topicarr["t_name"]);
                     } else {
                         $markstr = replaceStr($mdes, $m1, "");
                     }
                     break;
                 case "topiclink":
                     if (is_array($topicarr)) {
                         $markstr = replaceStr($mdes, $m1, $this->getVodTopicLink($mrs["d_topic"], $topicarr["t_name"], $topicarr["t_enname"], true));
                     } else {
                         $markstr = replaceStr($mdes, $m1, "###");
                     }
                     break;
                 case "userfav":
                     $markstr = replaceStr($mdes, $m1, "<a href=\"javascript:void(0)\" onclick=\"userFav('" . $mrs["d_id"] . "');return false;\"/>会员收藏</a>");
                     break;
                 case "desktop":
                     $markstr = replaceStr($mdes, $m1, "<a href=\"javascript:void(0)\" onclick=\"desktop('" . $mrs["d_name"] . "');return false;\"/>保存到桌面</a>");
                     break;
                 default:
                     $markstr = $mdes;
             }
             break;
         case "art":
             if ($mac["arttypeid"] == -1) {
                 $typearr = getValueByArray($cache[1], "t_id", $mrs["a_type"]);
             } else {
                 if (strpos("," . $mrs["ad_type"], "," . $mac["arttypeid"] . ",") > 0) {
                     $typearr = $this->page_typearr;
                 } else {
                     $typearr = getValueByArray($cache[1], "t_id", $mrs["a_type"]);
                 }
             }
             if (strpos($mdes, "topic") > 0) {
                 $topicarr = getValueByArray($cache[3], "t_id", $mrs["a_topic"]);
             }
             if (!is_array($typearr)) {
                 return;
             }
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "numfill":
                     $markstr = replaceStr($mdes, $m1, $numfill);
                     break;
                 case "numjoin":
                     $markstr = replaceStr($mdes, $m1, $this->startnum + $mnum);
                     break;
                 case "id":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_id"]);
                     break;
                 case "title":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_title"]));
                     break;
                 case "colortitle":
                     if ($mrs["a_color"] == "") {
                         $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_title"]));
                     } else {
                         $markstr = replaceStr($mdes, $m1, "<font color=\"" . $mrs["a_color"] . "\">" . getTextt($m3, $mrs["a_title"]) . "</font>");
                     }
                     break;
                 case "subtitle":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_subtitle"]));
                     break;
                 case "entitle":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_entitle"]));
                     break;
                 case "from":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_from"]));
                     break;
                 case "content":
                     $content = $mrs["a_content"];
                     if ($this->page_type == "art") {
                         $content = $this->page_content;
                     }
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $content));
                     break;
                 case "contenttext":
                     $content = $mrs["a_content"];
                     if ($this->page_type == "art") {
                         $content = $this->page_content;
                     }
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, strip_tags($content)));
                     break;
                 case "author":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["a_author"]));
                     break;
                 case "color":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_color"]);
                     break;
                 case "hits":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_hits"]);
                     break;
                 case "dayhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_dayhits"]);
                     break;
                 case "weekhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_weekhits"]);
                     break;
                 case "monthhits":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_monthhits"]);
                     break;
                 case "addtime":
                     $markstr = replaceStr($mdes, $m1, getDatet($m3, $mrs["a_addtime"]));
                     break;
                 case "time":
                     $markstr = replaceStr($mdes, $m1, getDatet($m3, $mrs["a_time"]));
                     break;
                 case "pic":
                     $pic = $mrs["a_pic"];
                     if (strpos("," . $pic, "http://") <= 0) {
                         $pic = app_installdir . $pic;
                     } else {
                         $pic = $pic . "";
                     }
                     if (strpos($pic, "douban") !== false) {
                         $pic = 'http://weixin.joyplus.tv/image.php?imgurl=' . urlencode($pic);
                     }
                     $markstr = replaceStr($mdes, $m1, $pic);
                     break;
                 case "link":
                     $markstr = replaceStr($mdes, $m1, $this->getArtLink($mrs["a_id"], $mrs["a_title"], $mrs["a_entitle"], $typearr["t_id"], $typearr["t_name"], $typearr["t_enname"], true));
                     break;
                 case "type":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_type"]);
                     break;
                 case "typelink":
                     $markstr = replaceStr($mdes, $m1, $this->getArtTypeLink($typearr["t_id"], $typearr["t_name"], $typearr["t_enname"], true));
                     break;
                 case "typename":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_name"]);
                     break;
                 case "typeenname":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_enname"]);
                     break;
                 case "typekey":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_key"]);
                     break;
                 case "typedes":
                     $markstr = replaceStr($mdes, $m1, $typearr["t_des"]);
                     break;
                 case "topic":
                     $markstr = replaceStr($mdes, $m1, $mrs["a_topic"]);
                     break;
                 case "topicname":
                     if (is_array($topicarr)) {
                         $markstr = replaceStr($mdes, $m1, $topicarr["t_name"]);
                     } else {
                         $markstr = replaceStr($mdes, $m1, "");
                     }
                     break;
                 case "topiclink":
                     if (is_array($topicarr)) {
                         $markstr = replaceStr($mdes, $m1, $this->getArtTopicLink($mrs["a_topic"], $topicarr["t_name"], $topicarr["t_enname"], true));
                     } else {
                         $markstr = replaceStr($mdes, $m1, "###");
                     }
                     break;
                 default:
                     $markstr = $mdes;
                     break;
             }
             break;
         case "topic":
             //var_dump($mtype);var_dump($mdes);var_dump($m1);var_dump($m2);var_dump($m3);var_dump($mrs);var_dump($mnum);
             switch ($m2) {
                 case "num":
                     $markstr = replaceStr($mdes, $m1, $mnum);
                     break;
                 case "numfill":
                     $markstr = replaceStr($mdes, $m1, $numfill);
                     break;
                 case "id":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_id"]);
                     break;
                 case "name":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["t_name"]));
                     break;
                 case "enname":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["t_enname"]));
                     break;
                 case "sort":
                     $markstr = replaceStr($mdes, $m1, $mrs["t_sort"]);
                     break;
                 case "pic":
                     if ($this->par_table == "art") {
                         $markstr = replaceStr($mdes, $m1, $mrs["t_pic"]);
                     } else {
                         $t_pic = $mrs["t_pic"];
                         if (isN($t_pic)) {
                             $t_pic = $db->getone("SELECT d_pic FROM mac_vod, mac_vod_topic_items WHERE  d_id = vod_id and topic_id =" . $mrs["t_id"]);
                             //                              if(isN($t_pic1['d_pic_ipad'])){
                             //                              	$t_pic=$t_pic1['d_pic'];
                             //                              }else {
                             //                              	$t_pic=$t_pic1['d_pic_ipad'];
                             //                              }
                         }
                         $markstr = replaceStr($mdes, $m1, $t_pic);
                     }
                     break;
                 case "count":
                     if ($this->par_table == "art") {
                         $datacount = $db->getOne("SELECT count(a_id) FROM {pre}art WHERE a_topic=" . $mrs["t_id"]);
                         $markstr = replaceStr($mdes, $m1, $datacount);
                     } else {
                         $datacount = $db->getOne("SELECT count(id) FROM {pre}vod_topic_items WHERE flag=1 and topic_id=" . $mrs["t_id"]);
                         $markstr = replaceStr($mdes, $m1, $datacount);
                     }
                     break;
                 case "des":
                     $markstr = replaceStr($mdes, $m1, getTextt($m3, $mrs["t_des"]));
                     break;
                 case "link":
                     if ($this->par_table == "art") {
                         $markstr = replaceStr($mdes, $m1, $this->getArtTopicLink($mrs["t_id"], $mrs["t_name"], $mrs["t_enname"], true));
                     } else {
                         $markstr = replaceStr($mdes, $m1, $this->getVodTopicLink($mrs["t_id"], $mrs["t_name"], $mrs["t_enname"], true));
                     }
                     break;
                 default:
                     $markstr = $mdes;
                     break;
             }
             break;
         default:
             break;
     }
     return $markstr;
 }