您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php中论坛帖子展开,书本知识看不懂啊靠~请帮帮小弟我

2025/8/17 6:56:03发布17次查看
php中论坛帖子展开,书本知识看不懂啊靠~,请帮帮我,
m_postid = $postid;
    $this->m_title = $title;
    $this->m_poster = $poster;
    $this->m_posted = $posted;
    $this->m_children =$children;
    $this->m_childlist = array();
    $this->m_depth = $depth;
// we only care what is below this node if it 
    // has children and is marked to be expanded
    // sublists are always expanded
    if(($sublist||$expand) && $children)
    {
      $conn = db_connect();
$query = select * from header where parent = $postid order by posted;
      $result = $conn->query($query);
for ($count=0; $row = @$result->fetch_assoc(); $count++)
      {
        if($sublist||$expanded[ $row['postid'] ] == true)
          $expand = true;
        else
          $expand = false;
        $this->m_childlist[$count]= new treenode($row['postid'],$row['title'],
                                      $row['poster'],$row['posted'],
                                      $row['children'], $expand,
                                      $depth+1, $expanded, $sublist);
      }
    }
  }
function display($row, $sublist = false)
  {
    // as this is an object, it is responsible for displaying itself
// $row tells us what row of the display we are up to 
    // so we know what color it should be
// $sublist tells us whether we are on the main page
    // or the message page.  message pages should have 
    // $sublist = true.  
    // on a sublist, all messages are expanded and there are
    // no + or - symbols.
// if this is the empty root node skip displaying
    if($this->m_depth>-1)  
    {
      //color alternate rows
      echo '       if ($row%2) 
        echo '#cccccc'>;
      else
        echo '#ffffff'>;
// indent replies to the depth of nesting

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product