コード例 #1
0
ファイル: faq.php プロジェクト: omusico/jianli
                $c .= '<p class="other">' . yjl_wbdate($r_z['dateline']) . '</p></div>';
            }
            $a[$r_res['qzid']][] = '<a href="faq-c' . $r_res['cid'] . '.html">' . $a_qzca[$r_res['cid']] . '</a>';
            if ($c_hd > 0) {
                if ($user_id > 0 && $uadb[$user_id]['qx'] == 0) {
                    $a[$r_res['qzid']][] = '<a href="#" onclick="$(this).load(\'j/zanqz.php?id=' . $r_res['qzid'] . '\');return false;">赞' . ($r_res['c_zan'] > 0 ? '(' . $r_res['c_zan'] . ')' : '') . '</a>';
                } else {
                    if ($r_res['c_zan'] > 0) {
                        $a[$r_res['qzid']][] = '赞(' . $r_res['c_zan'] . ')';
                    }
                }
            } elseif ($user_id > 0 && $uadb[$user_id]['qx'] == 5 && $udb['iszxjl'] > 0 && ($r_res['jluid'] == 0 || $r_res['jluid'] == $user_id)) {
                $a[$r_res['qzid']][] = '<a href="faq-' . $r_res['qzid'] . '.html">回答</a>';
            }
            $a[$r_res['qzid']][] = '<a href="faq-' . $r_res['qzid'] . '.html">详情</a>';
            $c .= '<p class="other">' . (isset($a[$r_res['qzid']]) ? '<span>' . join('|', $a[$r_res['qzid']]) . '</span>' : '') . yjl_wbdate($r_wb['dateline']) . '</p>
							</div>
						</li>';
        } while ($r_res = mysql_fetch_assoc($res));
        mysql_free_result($res);
        $c .= '</ul>';
        //if($tp_res>1)$c.=yjl_newpage($page, $tp_res, 'faq_topic');
        if ($tp_res > 1) {
            $c .= yjl_newhmpage('faq-new-p[p].html', $page, $tp_res, 'faq_topic');
        }
    }
    mysql_free_result($a_res);
    $c .= '</div><br /><br />';
}
$c .= '</div>
		</div>
コード例 #2
0
ファイル: function.php プロジェクト: omusico/jianli
function yjl_homeqz($r_res)
{
    global $yjl_dbprefix, $dbprefix, $uadb, $yjl_tpath, $a_qzca;
    $c_hd = 0;
    $q_reu = sprintf('select b.* from %s as a, %s as b where a.qzid=%s and a.tid=b.tid and a.uid<>%s order by a.datetime desc limit 1', $yjl_dbprefix . 'qz_topic', $dbprefix . 'topic', $r_res['qzid'], $r_res['uid']);
    $reu = mysql_query($q_reu) or die('');
    $r_reu = mysql_fetch_assoc($reu);
    if (mysql_num_rows($reu) > 0) {
        $c_hd = 1;
        $r_wb = $r_reu;
        $r_zf[$r_wb['tid']] = $r_res;
        if (!isset($uadb[$r_reu['uid']])) {
            $uadb[$r_reu['uid']] = yjl_udb($r_reu['uid']);
        }
    } else {
        $r_wb = $r_res;
    }
    mysql_free_result($reu);
    $c = '<li id="wb_' . $r_wb['tid'] . '"><div class="left">
								<a href="user-' . $r_wb['uid'] . '.html"><img src="' . yjl_face($r_wb['uid'], $uadb[$r_wb['uid']]['face']) . '" /></a>
								<div class="m_sp1">监理师</div>
							</div><div class="right">
								<h3><a href="#"><a href="user-' . $r_wb['uid'] . '.html">' . yjl_substrs($uadb[$r_wb['uid']]['nc']) . '</a></a>:';
    if ($r_wb['longtextid'] > 0) {
        $q_reu = sprintf('select `longtext` from %s where id=%s and tid=%s limit 1', $dbprefix . 'topic_longtext', $r_wb['longtextid'], $r_wb['tid']);
        $reu = mysql_query($q_reu) or die('');
        $r_reu = mysql_fetch_assoc($reu);
        if (mysql_num_rows($reu) > 0) {
            $c .= $r_reu['longtext'];
        } else {
            $r_wb['longtextid'] = 0;
        }
        mysql_free_result($reu);
    }
    if ($r_wb['longtextid'] == 0) {
        $c .= yjl_wbdecode($r_wb['content']);
    }
    $c .= '</h3>';
    if ($r_wb['imageid'] != '') {
        $ai = explode(',', $r_wb['imageid']);
        foreach ($ai as $v) {
            $q_reu = sprintf('select photo, width, height from %s where id=%s limit 1', $dbprefix . 'topic_image', $v);
            $reu = mysql_query($q_reu) or die('');
            $r_reu = mysql_fetch_assoc($reu);
            if (mysql_num_rows($reu) > 0) {
                $ou = str_replace('./', '', $r_reu['photo']);
                $bu = str_replace('_o.jpg', '_s.jpg', $ou);
                $img_a[$r_wb['tid']][$v] = '<a href="#" onclick="openimg(\'' . $yjl_tpath . $ou . '\', ' . $r_reu['width'] . ', ' . $r_reu['height'] . ');return false;" title="点击查看大图"><img src="' . $yjl_tpath . $bu . '" alt=""/></a>';
            }
            mysql_free_result($reu);
        }
    }
    if ($r_wb['videoid'] > 0) {
        $q_reu = sprintf('select video_url, video_img from %s where id=%s limit 1', $dbprefix . 'topic_video', $r_wb['videoid']);
        $reu = mysql_query($q_reu) or die('');
        $r_reu = mysql_fetch_assoc($reu);
        if (mysql_num_rows($reu) > 0) {
            $img_a[$r_wb['tid']]['v' . $r_wb['videoid']] = '<a href="' . $r_reu['video_url'] . '" target="_blank" title="点击查看视频"><img src="images/blank.gif" style="background: #fff url(' . ($r_reu['video_img'] != '' ? $yjl_tpath . str_replace('./', '', $r_reu['video_img']) : 'images/vi_d.jpg') . ') no-repeat center;" alt=""/></a>';
        }
        mysql_free_result($reu);
    }
    if (isset($img_a[$r_wb['tid']])) {
        $c .= join(' ', $img_a[$r_wb['tid']]);
    }
    if (isset($r_zf[$r_wb['tid']])) {
        $r_z = $r_zf[$r_wb['tid']];
        $c .= '<div class="active_bg"></div><div class="active clearfix"><h3><a href="user-' . $r_z['uid'] . '.html">' . $uadb[$r_z['uid']]['nc'] . '</a>:';
        if ($r_z['longtextid'] > 0) {
            $q_reu = sprintf('select `longtext` from %s where id=%s and tid=%s limit 1', $dbprefix . 'topic_longtext', $r_z['longtextid'], $r_z['tid']);
            $reu = mysql_query($q_reu) or die('');
            $r_reu = mysql_fetch_assoc($reu);
            if (mysql_num_rows($reu) > 0) {
                $c .= $r_reu['longtext'];
            } else {
                $r_z['longtextid'] = 0;
            }
            mysql_free_result($reu);
        }
        if ($r_z['longtextid'] == 0) {
            $c .= yjl_wbdecode($r_z['content']);
        }
        $c .= '</h3>';
        if ($r_z['imageid'] != '') {
            $ai = explode(',', $r_z['imageid']);
            foreach ($ai as $v) {
                $q_reu = sprintf('select photo, width, height from %s where id=%s limit 1', $dbprefix . 'topic_image', $v);
                $reu = mysql_query($q_reu) or die('');
                $r_reu = mysql_fetch_assoc($reu);
                if (mysql_num_rows($reu) > 0) {
                    $ou = str_replace('./', '', $r_reu['photo']);
                    $bu = str_replace('_o.jpg', '_s.jpg', $ou);
                    $img_a[$r_z['tid']][$v] = '<a href="#" onclick="openimg(\'' . $yjl_tpath . $ou . '\', ' . $r_reu['width'] . ', ' . $r_reu['height'] . ');return false;" title="点击查看大图"><img src="' . $yjl_tpath . $bu . '" alt=""/></a>';
                }
                mysql_free_result($reu);
            }
        }
        if ($r_z['videoid'] > 0) {
            $q_reu = sprintf('select video_url, video_img from %s where id=%s limit 1', $dbprefix . 'topic_video', $r_z['videoid']);
            $reu = mysql_query($q_reu) or die('');
            $r_reu = mysql_fetch_assoc($reu);
            if (mysql_num_rows($reu) > 0) {
                $img_a[$r_z['tid']]['v' . $r_z['videoid']] = '<a href="' . $r_reu['video_url'] . '" target="_blank" title="点击查看视频"><img src="images/blank.gif" style="background: #fff url(' . ($r_reu['video_img'] != '' ? $yjl_tpath . str_replace('./', '', $r_reu['video_img']) : 'images/vi_d.jpg') . ') no-repeat center;" alt=""/></a>';
            }
            mysql_free_result($reu);
        }
        if (isset($img_a[$r_z['tid']])) {
            $c .= join(' ', $img_a[$r_z['tid']]);
        }
        $c .= '<p class="other">' . yjl_wbdate($r_z['dateline']) . '</p></div>';
    }
    $c .= '<p class="other">';
    $a[$r_res['qzid']][] = '<a href="faq-c' . $r_res['cid'] . '.html">' . $a_qzca[$r_res['cid']] . '</a>';
    if ($r_res['c_zan'] > 0) {
        $a[$r_res['qzid']][] = ' 赞(' . $r_res['c_zan'] . ')';
    }
    $a[$r_res['qzid']][] = '<a href="faq-' . $r_res['qzid'] . '.html">详情</a>';
    $c .= (isset($a[$r_res['qzid']]) ? '<span>' . join(' |', $a[$r_res['qzid']]) : '') . '</span>';
    $c .= yjl_wbdate($r_wb['dateline']);
    $c .= '</p></div></li>';
    return $c;
}