ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 3694


Ignore:
Timestamp:
Aug 11, 2007, 2:25:07 AM (12 years ago)
Author:
ogawa
Message:

監視機能関連の内部関数の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.8.x/webapp/modules/admin/lib/db_admin.php

    r3692 r3694  
    17401740    return $profile;
    17411741}
    1742 function monitor_diary_list($keyword,$page_size,$page)
    1743 {
    1744 
     1742
     1743function monitor_diary_list($keyword, $page_size, $page)
     1744{
    17451745    $page = intval($page);
    17461746    $page_size = intval($page_size);
    17471747   
    1748     $where = " where 1 ";
     1748    $where = " WHERE 1";
    17491749
    17501750    if ($keyword) {
     
    17561756            $keyword = check_search_word( $keyword_list[$i] );
    17571757               
    1758             $where .= " and (c_diary.subject like ? ";
    1759             $where .= " or c_diary.body like ? ) ";
     1758            $where .= " AND (c_diary.subject LIKE ?";
     1759            $where .= " OR c_diary.body LIKE ? )";
    17601760            $params[]="%$keyword%";
    17611761            $params[]="%$keyword%";
     
    17631763    }
    17641764   
    1765     $select = " select c_diary.*";
     1765    $select = "SELECT c_diary.*";
    17661766    $from = " FROM c_diary";
    1767     $order = " ORDER BY r_datetime desc";
     1767    $order = " ORDER BY r_datetime DESC";
    17681768   
    17691769    $sql = $select . $from . $where . $order;
     
    17751775   
    17761776    $sql =
    1777         "SELECT count(*) "
     1777        "SELECT COUNT(*) "
    17781778        . $from
    17791779        . $where ;
    1780     $total_num = db_get_one($sql,$params);
     1780    $total_num = db_get_one($sql, $params);
    17811781   
    17821782    $total_page_num =  ceil($total_num / $page_size);
     
    17841784    $prev = ($page > 1);
    17851785   
    1786     return array($list , $prev , $next, $total_num,$total_page_num); 
    1787 }
    1788 
    1789 function monitor_diary_list4c_diary_id($c_diary_id,$page_size,$page)
    1790 {
    1791 
     1786    return array($list , $prev , $next, $total_num, $total_page_num); 
     1787}
     1788
     1789function monitor_diary_list4c_diary_id($c_diary_id, $page_size, $page)
     1790{
    17921791    $page = intval($page);
    17931792    $page_size = intval($page_size);
    17941793   
    1795     $where = " where c_diary_id = ? ";
    1796     $params[] = $c_diary_id;
    1797    
    1798     $select = " select c_diary.*";
     1794    $where = " WHERE c_diary_id = ? ";
     1795    $params[] = intval($c_diary_id);
     1796   
     1797    $select = "SELECT c_diary.*";
    17991798    $from = " FROM c_diary";
    1800     $order = " ORDER BY r_datetime desc";
     1799    $order = " ORDER BY r_datetime DESC";
    18011800   
    18021801    $sql = $select . $from . $where . $order;
     
    18081807   
    18091808    $sql =
    1810         "SELECT count(*) "
     1809        "SELECT COUNT(*) "
    18111810        . $from
    18121811        . $where ;
    1813     $total_num = db_get_one($sql,$params);
     1812    $total_num = db_get_one($sql, $params);
    18141813   
    18151814    $total_page_num =  ceil($total_num / $page_size);
     
    18171816    $prev = ($page > 1);
    18181817   
    1819     return array($list , $prev , $next, $total_num,$total_page_num); 
    1820 }
    1821 
    1822 function monitor_diary_comment_list($keyword,$page_size,$page)
    1823 {
    1824 
     1818    return array($list , $prev , $next, $total_num, $total_page_num); 
     1819}
     1820
     1821function monitor_diary_comment_list($keyword, $page_size, $page)
     1822{
    18251823    $page = intval($page);
    18261824    $page_size = intval($page_size);
    18271825   
    1828     $where = " where 1 ";
     1826    $where = " WHERE 1 ";
    18291827
    18301828    if ($keyword) {
     
    18361834            $keyword = check_search_word( $keyword_list[$i] );
    18371835               
    1838             $where .= " and (c_diary_comment.body like ? ) ";
    1839             $params[]="%$keyword%";
    1840         }
    1841     }
    1842    
    1843     $select = " select c_diary_comment.*,c_diary.subject";
     1836            $where .= " AND (c_diary_comment.body LIKE ?)";
     1837            $params[] = "%$keyword%";
     1838        }
     1839    }
     1840   
     1841    $select = "SELECT c_diary_comment.*, c_diary.subject";
    18441842    $from = " FROM c_diary_comment"
    18451843        ." LEFT JOIN c_diary ON c_diary.c_diary_id = c_diary_comment.c_diary_id ";
     
    18541852   
    18551853    $sql =
    1856         "SELECT count(*) "
     1854        "SELECT COUNT(*) "
    18571855        . $from
    18581856        . $where ;
    1859     $total_num = db_get_one($sql,$params);
     1857    $total_num = db_get_one($sql, $params);
    18601858   
    18611859    $total_page_num =  ceil($total_num / $page_size);
     
    18631861    $prev = ($page > 1);
    18641862   
    1865     return array($list , $prev , $next, $total_num,$total_page_num); 
    1866 }
    1867 
    1868 function monitor_diary_comment_list4c_diary_comment_id($c_diary_comment_id,$page_size,$page)
     1863    return array($list , $prev , $next, $total_num, $total_page_num); 
     1864}
     1865
     1866function monitor_diary_comment_list4c_diary_comment_id($c_diary_comment_id, $page_size, $page)
    18691867{
    18701868    $page = intval($page);
    18711869    $page_size = intval($page_size);
    18721870
    1873     $where = " where c_diary_comment.c_diary_comment_id = ? ";
    1874     $params[] = $c_diary_comment_id;
    1875    
    1876     $select = " select c_diary_comment.*,c_diary.subject";
     1871    $where = " WHERE c_diary_comment.c_diary_comment_id = ? ";
     1872    $params[] = intval($c_diary_comment_id);
     1873   
     1874    $select = "SELECT c_diary_comment.*, c_diary.subject";
    18771875    $from = " FROM c_diary_comment"
    18781876        ." LEFT JOIN c_diary ON c_diary.c_diary_id = c_diary_comment.c_diary_id ";
     
    18881886   
    18891887    $sql =
    1890         "SELECT count(*) "
     1888        "SELECT COUNT(*) "
    18911889        . $from
    18921890        . $where ;
    1893     $total_num = db_get_one($sql,$params);
     1891    $total_num = db_get_one($sql, $params);
    18941892   
    18951893    $total_page_num =  ceil($total_num / $page_size);
     
    18971895    $prev = ($page > 1);
    18981896   
    1899     return array($list , $prev , $next, $total_num,$total_page_num); 
    1900 }
    1901 
    1902 function monitor_commu_list($keyword,$page_size,$page)
     1897    return array($list , $prev , $next, $total_num, $total_page_num); 
     1898}
     1899
     1900function monitor_commu_list($keyword, $page_size, $page)
    19031901{
    19041902    $page = intval($page);
    19051903    $page_size = intval($page_size);
    19061904   
    1907     $where = " where 1 ";
     1905    $where = " WHERE 1 ";
    19081906
    19091907    if ($keyword) {
     
    19141912            $keyword = check_search_word( $keyword_list[$i] );
    19151913               
    1916             $where .= " AND ((name like ? )";
    1917             $where .= " OR (info like ? ))";
     1914            $where .= " AND ((name LIKE ? )";
     1915            $where .= " OR (info LIKE ? ))";
    19181916            $params[]="%$keyword%";
    19191917            $params[]="%$keyword%";
     
    19211919    }
    19221920   
    1923     $select = " SELECT * ";
     1921    $select = "SELECT * ";
    19241922    $from = " FROM c_commu";
    1925     $order = " ORDER BY r_datetime desc";
     1923    $order = " ORDER BY r_datetime DESC";
    19261924   
    19271925    $sql = $select . $from . $where . $order;
     
    19341932   
    19351933    $sql =
    1936         "SELECT count(*) "
     1934        "SELECT COUNT(*) "
    19371935        . $from
    19381936        . $where ;
    1939     $total_num = db_get_one($sql,$params);
     1937    $total_num = db_get_one($sql, $params);
    19401938   
    19411939    $total_page_num =  ceil($total_num / $page_size);
     
    19431941    $prev = ($page > 1);
    19441942   
    1945     return array($list , $prev , $next, $total_num,$total_page_num); 
    1946 }
    1947 
    1948 function monitor_commu_list4c_commu_id($c_commu_id,$page_size,$page)
     1943    return array($list , $prev , $next, $total_num, $total_page_num); 
     1944}
     1945
     1946function monitor_commu_list4c_commu_id($c_commu_id, $page_size, $page)
    19491947{
    19501948    $page = intval($page);
    19511949    $page_size = intval($page_size);
    19521950   
    1953    
    1954     $where = " where c_commu_id = ? ";
    1955     $params[] = $c_commu_id;
    1956    
    1957     $select = " SELECT * ";
     1951    $where = " WHERE c_commu_id = ? ";
     1952    $params[] = intval($c_commu_id);
     1953   
     1954    $select = "SELECT * ";
    19581955    $from = " FROM c_commu";
    1959     $order = " ORDER BY r_datetime desc";
     1956    $order = " ORDER BY r_datetime DESC";
    19601957   
    19611958    $sql = $select . $from . $where . $order;
     
    19681965   
    19691966    $sql =
    1970         "SELECT count(*) "
     1967        "SELECT COUNT(*) "
    19711968        . $from
    19721969        . $where ;
    1973     $total_num = db_get_one($sql,$params);
     1970    $total_num = db_get_one($sql, $params);
    19741971   
    19751972    $total_page_num =  ceil($total_num / $page_size);
     
    19771974    $prev = ($page > 1);
    19781975   
    1979     return array($list , $prev , $next, $total_num,$total_page_num); 
    1980 }
    1981 
    1982 function monitor_topic_comment_list($keyword,$page_size,$page)
    1983 {
    1984 
     1976    return array($list , $prev , $next, $total_num, $total_page_num); 
     1977}
     1978
     1979function monitor_topic_comment_list($keyword, $page_size, $page)
     1980{
    19851981    $page = intval($page);
    19861982    $page_size = intval($page_size);
    19871983   
    1988     $where = " where ctc.number <> 0  ";
     1984    $where = " WHERE ctc.number <> 0  ";
    19891985
    19901986    if ($keyword) {
     
    19951991            $keyword = check_search_word( $keyword_list[$i] );
    19961992               
    1997             $where .= " AND (ctc.body like ? )";
     1993            $where .= " AND (ctc.body LIKE ? )";
    19981994            $params[]="%$keyword%";
    19991995        }
    20001996    }
    20011997   
    2002     $select = " SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
     1998    $select = "SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
    20031999    $from = " FROM c_commu_topic_comment as ctc"
    20042000            ." LEFT JOIN c_member as m ON ctc.c_member_id = m.c_member_id "
     
    20162012   
    20172013    $sql =
    2018         "SELECT count(*) "
     2014        "SELECT COUNT(*) "
    20192015        . $from
    20202016        . $where ;
    2021     $total_num = db_get_one($sql,$params);
     2017    $total_num = db_get_one($sql, $params);
    20222018   
    20232019    $total_page_num =  ceil($total_num / $page_size);
     
    20252021    $prev = ($page > 1);
    20262022   
    2027     return array($list , $prev , $next, $total_num,$total_page_num); 
    2028 }
    2029 
    2030 function monitor_topic_comment_list4c_commu_topic_comment_id($c_commu_topic_comment_id,$page_size,$page)
     2023    return array($list , $prev , $next, $total_num, $total_page_num); 
     2024}
     2025
     2026function monitor_topic_comment_list4c_commu_topic_comment_id($c_commu_topic_comment_id, $page_size, $page)
    20312027{
    20322028    $page = intval($page);
    20332029    $page_size = intval($page_size);
    20342030   
    2035     $where = " where ctc.number <> 0 AND ctc.c_commu_topic_comment_id = ? ";
    2036     $params[] = $c_commu_topic_comment_id;
    2037    
    2038     $select = " SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
     2031    $where = " WHERE ctc.number <> 0 AND ctc.c_commu_topic_comment_id = ? ";
     2032    $params[] = intval($c_commu_topic_comment_id);
     2033   
     2034    $select = "SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
    20392035    $from = " FROM c_commu_topic_comment as ctc"
    20402036            ." LEFT JOIN c_member as m ON ctc.c_member_id = m.c_member_id "
     
    20522048   
    20532049    $sql =
    2054         "SELECT count(*) "
     2050        "SELECT COUNT(*) "
    20552051        . $from
    20562052        . $where ;
    2057     $total_num = db_get_one($sql,$params);
     2053    $total_num = db_get_one($sql, $params);
    20582054   
    20592055    $total_page_num =  ceil($total_num / $page_size);
     
    20612057    $prev = ($page > 1);
    20622058   
    2063     return array($list , $prev , $next, $total_num,$total_page_num); 
    2064 }
    2065 
    2066 function monitor_topic_list($keyword,$page_size,$page)
     2059    return array($list , $prev , $next, $total_num, $total_page_num); 
     2060}
     2061
     2062function monitor_topic_list($keyword, $page_size, $page)
    20672063{
    20682064    $page = intval($page);
     
    20872083    }
    20882084   
    2089     $select = " SELECT ct.*," .
     2085    $select = "SELECT ct.*," .
    20902086            "ct.name as topic_name,c.name as commu_name," .
    20912087            "m.nickname,ctc.body as body," .
     
    21112107   
    21122108    $sql =
    2113         "SELECT count(*) "
     2109        "SELECT COUNT(*) "
    21142110        . $from
    21152111        . $where ;
    2116     $total_num = db_get_one($sql,$params);
     2112    $total_num = db_get_one($sql, $params);
    21172113   
    21182114    $total_page_num =  ceil($total_num / $page_size);
     
    21202116    $prev = ($page > 1);
    21212117   
    2122     return array($list , $prev , $next, $total_num,$total_page_num); 
    2123 }
    2124 
    2125 function monitor_topic_list4target_c_commu_topic_id($c_commu_topic_id,$page_size,$page)
     2118    return array($list , $prev , $next, $total_num, $total_page_num); 
     2119}
     2120
     2121function monitor_topic_list4target_c_commu_topic_id($c_commu_topic_id, $page_size, $page)
    21262122{
    21272123    $page = intval($page);
     
    21292125   
    21302126    $where = " where ct.c_commu_topic_id = ? ";
    2131     $params[] = $c_commu_topic_id;
    2132    
    2133     $select = " SELECT ct.*," .
     2127    $params[] = intval($c_commu_topic_id);
     2128   
     2129    $select = "SELECT ct.*," .
    21342130            "ct.name as topic_name,c.name as commu_name," .
    21352131            "m.nickname,ctc.body as body," .
     
    21572153        . $from
    21582154        . $where ;
    2159     $total_num = db_get_one($sql,$params);
     2155    $total_num = db_get_one($sql, $params);
    21602156   
    21612157    $total_page_num =  ceil($total_num / $page_size);
     
    21632159    $prev = ($page > 1);
    21642160   
    2165     return array($list , $prev , $next, $total_num,$total_page_num); 
    2166 }
    2167 
    2168 function monitor_review_list($keyword,$page_size,$page)
     2161    return array($list , $prev , $next, $total_num, $total_page_num); 
     2162}
     2163
     2164function monitor_review_list($keyword, $page_size, $page)
    21692165{
    21702166    $page = intval($page);
     
    21862182    }
    21872183   
    2188     $select = " select c_review_comment.*";
     2184    $select = "SELECT c_review_comment.*";
    21892185    $from = " FROM c_review_comment";
    21902186    $order = " ORDER BY r_datetime desc";
     
    22002196
    22012197    $sql =
    2202         "SELECT count(*) "
     2198        "SELECT COUNT(*) "
    22032199        . $from
    22042200        . $where ;
     
    22092205    $prev = ($page > 1);
    22102206   
    2211     return array($list , $prev , $next, $total_num,$total_page_num); 
    2212 }
    2213 
    2214 function monitor_review_list4c_review_id($c_review_comment_id,$page_size,$page)
     2207    return array($list , $prev , $next, $total_num, $total_page_num); 
     2208}
     2209
     2210function monitor_review_list4c_review_id($c_review_comment_id, $page_size, $page)
    22152211{
    22162212    $page = intval($page);
    22172213    $page_size = intval($page_size);
    22182214   
    2219     $where = " where c_review_comment_id = ? ";
    2220     $params[] = $c_review_comment_id;
    2221    
    2222     $select = " select c_review_comment.*";
     2215    $where = " WHERE c_review_comment_id = ? ";
     2216    $params[] = intval($c_review_comment_id);
     2217   
     2218    $select = "SELECT c_review_comment.*";
    22232219    $from = " FROM c_review_comment";
    22242220    $order = " ORDER BY r_datetime desc";
     
    22272223    $list = db_get_all_limit($sql,($page-1)*$page_size,$page_size,$params);
    22282224   
    2229 
    22302225    foreach ($list as $key => $value) {
    22312226        $list[$key]['c_member'] = db_common_c_member4c_member_id_LIGHT($value['c_member_id']);
     
    22342229
    22352230    $sql =
    2236         "SELECT count(*) "
     2231        "SELECT COUNT(*) "
    22372232        . $from
    22382233        . $where ;
    2239     $total_num = db_get_one($sql,$params);
     2234    $total_num = db_get_one($sql, $params);
    22402235   
    22412236    $total_page_num =  ceil($total_num / $page_size);
     
    22432238    $prev = ($page > 1);
    22442239   
    2245     return array($list , $prev , $next, $total_num,$total_page_num); 
     2240    return array($list , $prev , $next, $total_num, $total_page_num); 
    22462241}
    22472242
Note: See TracChangeset for help on using the changeset viewer.