function getTopicHtml($modelid)
 {
     /*获取发帖分类信息*/
     global $tid, $imgpath;
     $topicfielddb = array();
     $topichtml = "\r\n<style>\r\n.pp td{padding:5px 10px;}\r\n.msg {\r\n\tbackground: #fff url({$imgpath}/pccheck.gif) no-repeat 0 -37px;\r\n\tborder: 1px solid #fff;\r\n\tdisplay: inline;\r\n\tmargin-left: 5px;\r\n\tpadding: 2px 2px 2px 20px;\r\n\tvertical-align : -2px;\r\n\t*vertical-align : 0;\r\n}\r\n.error {\r\n\tbackground-position: 2px -37px;\r\n\tbackground-color: #fef1f0;\r\n\tborder-color: #ffb3b6;\r\n\tcolor:#f14a10;\r\n\tzoom:1;\r\n\theight:17px;\r\n\toverflow:hidden;\r\n}\r\n.pass {\r\n\tbackground-position: 2px -57px;\r\n\twidth:22px;\r\n\theight:21px;\r\n}\r\n</style><script type=\"text/javascript\" src=\"js/pw_pccheck.js\"></script>";
     $topichtml .= "<script type=\"text/javascript\" src=\"js/date.js\"></script><table width=\"100%\"><tr class=\"pp f_two\"><td colspan=2>" . getLangInfo('other', 'pc_must') . "</td></tr>";
     if ($tid) {
         $tablename = GetTopcitable($modelid);
         $fieldone = $this->db->get_one("SELECT * FROM {$tablename} WHERE tid=" . S::sqlEscape($tid));
     }
     $query = $this->db->query("SELECT fieldid,name,fieldname,type,rules,descrip,ifmust,vieworder,textsize FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid) . " AND ifable=1 ORDER BY vieworder,fieldid ASC");
     while ($rt = $this->db->fetch_array($query)) {
         if ($tid) {
             $rt['fieldvalue'] = $fieldone[$rt['fieldname']];
         }
         list($rt['name1'], $rt['name2']) = explode('{#}', $rt['name']);
         $topicfielddb[$rt['vieworder']][$rt['fieldid']] = $rt;
     }
     $tabindex = 3;
     //tab键
     foreach ($topicfielddb as $key => $value) {
         if ($key == 0) {
             foreach ($value as $k => $v) {
                 $v['tabindex'] = $tabindex;
                 $ifmust = '';
                 $v['ifmust'] && ($ifmust = "<span class=\"s1\">*</span>");
                 $topichtml .= "<tr class=\"pp f_two\"><td width=\"100\">{$v['name1']}:{$ifmust}</td><td>";
                 $topichtml .= postTopic::getTopicType($v) . " " . $v['name2'];
                 $topichtml .= " <span class='gray'>{$v['descrip']}</span></td></tr>";
             }
         } else {
             $topichtml .= "<tr class=\"pp\">";
             $i = 0;
             foreach ($value as $k => $v) {
                 $v['tabindex'] = $tabindex;
                 $ifmust = '';
                 $v['ifmust'] && ($ifmust = "<span class=\"s1\">*</span>");
                 if ($i == 0) {
                     $topichtml .= "<td style=\"width:100px;\">{$v['name1']}:{$ifmust}</td><td>";
                 }
                 $i > 0 && ($topichtml .= $v['name1'] . '&nbsp;');
                 $topichtml .= postTopic::getTopicType($v) . " " . $v['name2'];
                 $i++;
             }
             $topichtml .= " <span class='gray'>{$v['descrip']}</span></td></tr>";
         }
         $tabindex++;
     }
     $topichtml .= "</table>";
     return $topichtml;
 }
Beispiel #2
0
 function getTopicHtml($modelid)
 {
     /*获取发帖分类信息*/
     global $tid, $imgpath;
     $topicfielddb = array();
     $topichtml = "\r\n<style>.tr3 .w{margin-right:10px;}\r\n.msg {\r\n\tbackground: #fff url({$imgpath}/pccheck.gif) no-repeat -25px -75px;\r\n\tborder: 1px solid #fff;\r\n\tdisplay: inline;\r\n\tmargin-left: 5px;\r\n\tfont-size:13px;\r\n\tpadding: 2px 2px 2px 18px;\r\n\tvertical-align : -1px;\r\n\t*vertical-align : 5px;\r\n\t_vertical-align : 3px;\r\n}\r\n\r\n.pass {\r\n\tbackground-position: 1px -57px;\r\n\tbackground-color: #E6FFE6;\r\n\tborder-color: #00BE00;\r\n}\r\n\r\n.error {\r\n\tbackground-position: 1px -38px;\r\n\tbackground-color: #FFF2E9;\r\n\tborder-color: #FF6600;\r\n}\r\n</style><script language=\"JavaScript\" src=\"js/pw_pccheck.js\"></script>";
     $topichtml .= "<script language=\"JavaScript\" src=\"js/pcdate.js\"></script><script language=\"JavaScript\" src=\"js/desktop/Compatibility.js\"></script><table width=\"100%\"><tr class=\"tr3\"><td colspan=2>" . getLangInfo('other', 'pc_must') . "</td></tr>";
     if ($tid) {
         $tablename = GetTopcitable($modelid);
         $fieldone = $this->db->get_one("SELECT * FROM {$tablename} WHERE tid=" . pwEscape($tid));
     }
     $query = $this->db->query("SELECT fieldid,name,fieldname,type,rules,descrip,ifmust,vieworder,textsize FROM pw_topicfield WHERE modelid=" . pwEscape($modelid) . " AND ifable=1 ORDER BY vieworder,fieldid ASC");
     while ($rt = $this->db->fetch_array($query)) {
         if ($tid) {
             $rt['fieldvalue'] = $fieldone[$rt['fieldname']];
         }
         list($rt['name1'], $rt['name2']) = explode('{#}', $rt['name']);
         $topicfielddb[$rt['vieworder']][$rt['fieldid']] = $rt;
     }
     foreach ($topicfielddb as $key => $value) {
         if ($key == 0) {
             foreach ($value as $k => $v) {
                 $ifmust = '';
                 $v['ifmust'] && ($ifmust = "<font color=\"#FF0000\">*</font>");
                 $topichtml .= "<tr class=\"tr3\"><td width=\"100\">{$v['name1']}:{$ifmust}</td><td>";
                 $topichtml .= postTopic::getTopicType($v) . $v['name2'];
                 $topichtml .= "</td></tr>";
             }
         } else {
             $topichtml .= "<tr class=\"tr3\">";
             $i = 0;
             foreach ($value as $k => $v) {
                 $ifmust = '';
                 $v['ifmust'] && ($ifmust = "<font color=\"#FF0000\">*</font>");
                 if ($i == 0) {
                     $topichtml .= "<td style=\"width:100px;\">{$v['name1']}:{$ifmust}</td><td>";
                 }
                 $i > 0 && ($topichtml .= $v['name1'] . '&nbsp;');
                 $topichtml .= postTopic::getTopicType($v) . $v['name2'];
                 $i++;
             }
             $topichtml .= "</td></tr>";
         }
     }
     $topichtml .= "</table>";
     return $topichtml;
 }