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

Changeset 3695


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r3661 r3695  
    17451745    return $profile;
    17461746}
    1747 function monitor_diary_list($keyword,$page_size,$page)
    1748 {
    1749 
     1747
     1748function monitor_diary_list($keyword, $page_size, $page)
     1749{
    17501750    $page = intval($page);
    17511751    $page_size = intval($page_size);
    17521752   
    1753     $where = " where true ";
     1753    $where = " WHERE true";
    17541754
    17551755    if ($keyword) {
     
    17611761            $keyword = check_search_word( $keyword_list[$i] );
    17621762               
    1763             $where .= " and (c_diary.subject like ? ";
    1764             $where .= " or c_diary.body like ? ) ";
     1763            $where .= " AND (c_diary.subject LIKE ?";
     1764            $where .= " OR c_diary.body LIKE ? )";
    17651765            $params[]="%$keyword%";
    17661766            $params[]="%$keyword%";
     
    17681768    }
    17691769   
    1770     $select = " select c_diary.*";
     1770    $select = "SELECT c_diary.*";
    17711771    $from = " FROM c_diary";
    1772     $order = " ORDER BY r_datetime desc";
     1772    $order = " ORDER BY r_datetime DESC";
    17731773   
    17741774    $sql = $select . $from . $where . $order;
     
    17801780   
    17811781    $sql =
    1782         "SELECT count(*) "
     1782        "SELECT COUNT(*) "
    17831783        . $from
    17841784        . $where ;
    1785     $total_num = db_get_one($sql,$params);
     1785    $total_num = db_get_one($sql, $params);
    17861786   
    17871787    $total_page_num =  ceil($total_num / $page_size);
     
    17891789    $prev = ($page > 1);
    17901790   
    1791     return array($list , $prev , $next, $total_num,$total_page_num); 
    1792 }
    1793 
    1794 function monitor_diary_list4c_diary_id($c_diary_id,$page_size,$page)
    1795 {
    1796 
     1791    return array($list , $prev , $next, $total_num, $total_page_num); 
     1792}
     1793
     1794function monitor_diary_list4c_diary_id($c_diary_id, $page_size, $page)
     1795{
    17971796    $page = intval($page);
    17981797    $page_size = intval($page_size);
    17991798   
    1800     $where = " where c_diary_id = ? ";
    1801     $params[] = $c_diary_id;
    1802    
    1803     $select = " select c_diary.*";
     1799    $where = " WHERE c_diary_id = ? ";
     1800    $params[] = intval($c_diary_id);
     1801   
     1802    $select = "SELECT c_diary.*";
    18041803    $from = " FROM c_diary";
    1805     $order = " ORDER BY r_datetime desc";
     1804    $order = " ORDER BY r_datetime DESC";
    18061805   
    18071806    $sql = $select . $from . $where . $order;
     
    18131812   
    18141813    $sql =
    1815         "SELECT count(*) "
     1814        "SELECT COUNT(*) "
    18161815        . $from
    18171816        . $where ;
    1818     $total_num = db_get_one($sql,$params);
     1817    $total_num = db_get_one($sql, $params);
    18191818   
    18201819    $total_page_num =  ceil($total_num / $page_size);
     
    18221821    $prev = ($page > 1);
    18231822   
    1824     return array($list , $prev , $next, $total_num,$total_page_num); 
    1825 }
    1826 
    1827 function monitor_diary_comment_list($keyword,$page_size,$page)
    1828 {
    1829 
     1823    return array($list , $prev , $next, $total_num, $total_page_num); 
     1824}
     1825
     1826function monitor_diary_comment_list($keyword, $page_size, $page)
     1827{
    18301828    $page = intval($page);
    18311829    $page_size = intval($page_size);
    18321830   
    1833     $where = " where true ";
     1831    $where = " WHERE true ";
    18341832
    18351833    if ($keyword) {
     
    18411839            $keyword = check_search_word( $keyword_list[$i] );
    18421840               
    1843             $where .= " and (c_diary_comment.body like ? ) ";
    1844             $params[]="%$keyword%";
    1845         }
    1846     }
    1847    
    1848     $select = " select c_diary_comment.*,c_diary.subject";
     1841            $where .= " AND (c_diary_comment.body LIKE ?)";
     1842            $params[] = "%$keyword%";
     1843        }
     1844    }
     1845   
     1846    $select = "SELECT c_diary_comment.*, c_diary.subject";
    18491847    $from = " FROM c_diary_comment"
    18501848        ." LEFT JOIN c_diary ON c_diary.c_diary_id = c_diary_comment.c_diary_id ";
     
    18591857   
    18601858    $sql =
    1861         "SELECT count(*) "
     1859        "SELECT COUNT(*) "
    18621860        . $from
    18631861        . $where ;
    1864     $total_num = db_get_one($sql,$params);
     1862    $total_num = db_get_one($sql, $params);
    18651863   
    18661864    $total_page_num =  ceil($total_num / $page_size);
     
    18681866    $prev = ($page > 1);
    18691867   
    1870     return array($list , $prev , $next, $total_num,$total_page_num); 
    1871 }
    1872 
    1873 function monitor_diary_comment_list4c_diary_comment_id($c_diary_comment_id,$page_size,$page)
     1868    return array($list , $prev , $next, $total_num, $total_page_num); 
     1869}
     1870
     1871function monitor_diary_comment_list4c_diary_comment_id($c_diary_comment_id, $page_size, $page)
    18741872{
    18751873    $page = intval($page);
    18761874    $page_size = intval($page_size);
    18771875
    1878     $where = " where c_diary_comment.c_diary_comment_id = ? ";
    1879     $params[] = $c_diary_comment_id;
    1880    
    1881     $select = " select c_diary_comment.*,c_diary.subject";
     1876    $where = " WHERE c_diary_comment.c_diary_comment_id = ? ";
     1877    $params[] = intval($c_diary_comment_id);
     1878   
     1879    $select = "SELECT c_diary_comment.*, c_diary.subject";
    18821880    $from = " FROM c_diary_comment"
    18831881        ." LEFT JOIN c_diary ON c_diary.c_diary_id = c_diary_comment.c_diary_id ";
     
    18931891   
    18941892    $sql =
    1895         "SELECT count(*) "
     1893        "SELECT COUNT(*) "
    18961894        . $from
    18971895        . $where ;
    1898     $total_num = db_get_one($sql,$params);
     1896    $total_num = db_get_one($sql, $params);
    18991897   
    19001898    $total_page_num =  ceil($total_num / $page_size);
     
    19021900    $prev = ($page > 1);
    19031901   
    1904     return array($list , $prev , $next, $total_num,$total_page_num); 
    1905 }
    1906 
    1907 function monitor_commu_list($keyword,$page_size,$page)
     1902    return array($list , $prev , $next, $total_num, $total_page_num); 
     1903}
     1904
     1905function monitor_commu_list($keyword, $page_size, $page)
    19081906{
    19091907    $page = intval($page);
    19101908    $page_size = intval($page_size);
    19111909   
    1912     $where = " where true ";
     1910    $where = " WHERE true ";
    19131911
    19141912    if ($keyword) {
     
    19191917            $keyword = check_search_word( $keyword_list[$i] );
    19201918               
    1921             $where .= " AND ((name like ? )";
    1922             $where .= " OR (info like ? ))";
     1919            $where .= " AND ((name LIKE ? )";
     1920            $where .= " OR (info LIKE ? ))";
    19231921            $params[]="%$keyword%";
    19241922            $params[]="%$keyword%";
     
    19261924    }
    19271925   
    1928     $select = " SELECT * ";
     1926    $select = "SELECT * ";
    19291927    $from = " FROM c_commu";
    1930     $order = " ORDER BY r_datetime desc";
     1928    $order = " ORDER BY r_datetime DESC";
    19311929   
    19321930    $sql = $select . $from . $where . $order;
     
    19391937   
    19401938    $sql =
    1941         "SELECT count(*) "
     1939        "SELECT COUNT(*) "
    19421940        . $from
    19431941        . $where ;
    1944     $total_num = db_get_one($sql,$params);
     1942    $total_num = db_get_one($sql, $params);
    19451943   
    19461944    $total_page_num =  ceil($total_num / $page_size);
     
    19481946    $prev = ($page > 1);
    19491947   
    1950     return array($list , $prev , $next, $total_num,$total_page_num); 
    1951 }
    1952 
    1953 function monitor_commu_list4c_commu_id($c_commu_id,$page_size,$page)
     1948    return array($list , $prev , $next, $total_num, $total_page_num); 
     1949}
     1950
     1951function monitor_commu_list4c_commu_id($c_commu_id, $page_size, $page)
    19541952{
    19551953    $page = intval($page);
    19561954    $page_size = intval($page_size);
    19571955   
    1958    
    1959     $where = " where c_commu_id = ? ";
    1960     $params[] = $c_commu_id;
    1961    
    1962     $select = " SELECT * ";
     1956    $where = " WHERE c_commu_id = ? ";
     1957    $params[] = intval($c_commu_id);
     1958   
     1959    $select = "SELECT * ";
    19631960    $from = " FROM c_commu";
    1964     $order = " ORDER BY r_datetime desc";
     1961    $order = " ORDER BY r_datetime DESC";
    19651962   
    19661963    $sql = $select . $from . $where . $order;
     
    19731970   
    19741971    $sql =
    1975         "SELECT count(*) "
     1972        "SELECT COUNT(*) "
    19761973        . $from
    19771974        . $where ;
    1978     $total_num = db_get_one($sql,$params);
     1975    $total_num = db_get_one($sql, $params);
    19791976   
    19801977    $total_page_num =  ceil($total_num / $page_size);
     
    19821979    $prev = ($page > 1);
    19831980   
    1984     return array($list , $prev , $next, $total_num,$total_page_num); 
    1985 }
    1986 
    1987 function monitor_topic_comment_list($keyword,$page_size,$page)
    1988 {
    1989 
     1981    return array($list , $prev , $next, $total_num, $total_page_num); 
     1982}
     1983
     1984function monitor_topic_comment_list($keyword, $page_size, $page)
     1985{
    19901986    $page = intval($page);
    19911987    $page_size = intval($page_size);
    19921988   
    1993     $where = " where ctc.number <> 0  ";
     1989    $where = " WHERE ctc.number <> 0  ";
    19941990
    19951991    if ($keyword) {
     
    20001996            $keyword = check_search_word( $keyword_list[$i] );
    20011997               
    2002             $where .= " AND (ctc.body like ? )";
     1998            $where .= " AND (ctc.body LIKE ? )";
    20031999            $params[]="%$keyword%";
    20042000        }
    20052001    }
    20062002   
    2007     $select = " SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
     2003    $select = "SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
    20082004    $from = " FROM c_commu_topic_comment as ctc"
    20092005            ." LEFT JOIN c_member as m ON ctc.c_member_id = m.c_member_id "
     
    20212017   
    20222018    $sql =
    2023         "SELECT count(*) "
     2019        "SELECT COUNT(*) "
    20242020        . $from
    20252021        . $where ;
    2026     $total_num = db_get_one($sql,$params);
     2022    $total_num = db_get_one($sql, $params);
    20272023   
    20282024    $total_page_num =  ceil($total_num / $page_size);
     
    20302026    $prev = ($page > 1);
    20312027   
    2032     return array($list , $prev , $next, $total_num,$total_page_num); 
    2033 }
    2034 
    2035 function monitor_topic_comment_list4c_commu_topic_comment_id($c_commu_topic_comment_id,$page_size,$page)
     2028    return array($list , $prev , $next, $total_num, $total_page_num); 
     2029}
     2030
     2031function monitor_topic_comment_list4c_commu_topic_comment_id($c_commu_topic_comment_id, $page_size, $page)
    20362032{
    20372033    $page = intval($page);
    20382034    $page_size = intval($page_size);
    20392035   
    2040     $where = " where ctc.number <> 0 AND ctc.c_commu_topic_comment_id = ? ";
    2041     $params[] = $c_commu_topic_comment_id;
    2042    
    2043     $select = " SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
     2036    $where = " WHERE ctc.number <> 0 AND ctc.c_commu_topic_comment_id = ? ";
     2037    $params[] = intval($c_commu_topic_comment_id);
     2038   
     2039    $select = "SELECT ctc.*,ct.name as topic_name,c.name as commu_name,m.nickname";
    20442040    $from = " FROM c_commu_topic_comment as ctc"
    20452041            ." LEFT JOIN c_member as m ON ctc.c_member_id = m.c_member_id "
     
    20572053   
    20582054    $sql =
    2059         "SELECT count(*) "
     2055        "SELECT COUNT(*) "
    20602056        . $from
    20612057        . $where ;
    2062     $total_num = db_get_one($sql,$params);
     2058    $total_num = db_get_one($sql, $params);
    20632059   
    20642060    $total_page_num =  ceil($total_num / $page_size);
     
    20662062    $prev = ($page > 1);
    20672063   
    2068     return array($list , $prev , $next, $total_num,$total_page_num); 
    2069 }
    2070 
    2071 function monitor_topic_list($keyword,$page_size,$page)
     2064    return array($list , $prev , $next, $total_num, $total_page_num); 
     2065}
     2066
     2067function monitor_topic_list($keyword, $page_size, $page)
    20722068{
    20732069    $page = intval($page);
     
    20922088    }
    20932089   
    2094     $select = " SELECT ct.*," .
     2090    $select = "SELECT ct.*," .
    20952091            "ct.name as topic_name,c.name as commu_name," .
    20962092            "m.nickname,ctc.body as body," .
     
    21162112   
    21172113    $sql =
    2118         "SELECT count(*) "
     2114        "SELECT COUNT(*) "
    21192115        . $from
    21202116        . $where ;
    2121     $total_num = db_get_one($sql,$params);
     2117    $total_num = db_get_one($sql, $params);
    21222118   
    21232119    $total_page_num =  ceil($total_num / $page_size);
     
    21252121    $prev = ($page > 1);
    21262122   
    2127     return array($list , $prev , $next, $total_num,$total_page_num); 
    2128 }
    2129 
    2130 function monitor_topic_list4target_c_commu_topic_id($c_commu_topic_id,$page_size,$page)
     2123    return array($list , $prev , $next, $total_num, $total_page_num); 
     2124}
     2125
     2126function monitor_topic_list4target_c_commu_topic_id($c_commu_topic_id, $page_size, $page)
    21312127{
    21322128    $page = intval($page);
     
    21342130   
    21352131    $where = " where ct.c_commu_topic_id = ? ";
    2136     $params[] = $c_commu_topic_id;
    2137    
    2138     $select = " SELECT ct.*," .
     2132    $params[] = intval($c_commu_topic_id);
     2133   
     2134    $select = "SELECT ct.*," .
    21392135            "ct.name as topic_name,c.name as commu_name," .
    21402136            "m.nickname,ctc.body as body," .
     
    21622158        . $from
    21632159        . $where ;
    2164     $total_num = db_get_one($sql,$params);
     2160    $total_num = db_get_one($sql, $params);
    21652161   
    21662162    $total_page_num =  ceil($total_num / $page_size);
     
    21682164    $prev = ($page > 1);
    21692165   
    2170     return array($list , $prev , $next, $total_num,$total_page_num); 
    2171 }
    2172 
    2173 function monitor_review_list($keyword,$page_size,$page)
     2166    return array($list , $prev , $next, $total_num, $total_page_num); 
     2167}
     2168
     2169function monitor_review_list($keyword, $page_size, $page)
    21742170{
    21752171    $page = intval($page);
     
    21912187    }
    21922188   
    2193     $select = " select c_review_comment.*";
     2189    $select = "SELECT c_review_comment.*";
    21942190    $from = " FROM c_review_comment";
    21952191    $order = " ORDER BY r_datetime desc";
     
    22052201
    22062202    $sql =
    2207         "SELECT count(*) "
     2203        "SELECT COUNT(*) "
    22082204        . $from
    22092205        . $where ;
     
    22142210    $prev = ($page > 1);
    22152211   
    2216     return array($list , $prev , $next, $total_num,$total_page_num); 
    2217 }
    2218 
    2219 function monitor_review_list4c_review_id($c_review_comment_id,$page_size,$page)
     2212    return array($list , $prev , $next, $total_num, $total_page_num); 
     2213}
     2214
     2215function monitor_review_list4c_review_id($c_review_comment_id, $page_size, $page)
    22202216{
    22212217    $page = intval($page);
    22222218    $page_size = intval($page_size);
    22232219   
    2224     $where = " where c_review_comment_id = ? ";
    2225     $params[] = $c_review_comment_id;
    2226    
    2227     $select = " select c_review_comment.*";
     2220    $where = " WHERE c_review_comment_id = ? ";
     2221    $params[] = intval($c_review_comment_id);
     2222   
     2223    $select = "SELECT c_review_comment.*";
    22282224    $from = " FROM c_review_comment";
    22292225    $order = " ORDER BY r_datetime desc";
     
    22322228    $list = db_get_all_limit($sql,($page-1)*$page_size,$page_size,$params);
    22332229   
    2234 
    22352230    foreach ($list as $key => $value) {
    22362231        $list[$key]['c_member'] = db_common_c_member4c_member_id_LIGHT($value['c_member_id']);
     
    22392234
    22402235    $sql =
    2241         "SELECT count(*) "
     2236        "SELECT COUNT(*) "
    22422237        . $from
    22432238        . $where ;
    2244     $total_num = db_get_one($sql,$params);
     2239    $total_num = db_get_one($sql, $params);
    22452240   
    22462241    $total_page_num =  ceil($total_num / $page_size);
     
    22482243    $prev = ($page > 1);
    22492244   
    2250     return array($list , $prev , $next, $total_num,$total_page_num); 
     2245    return array($list , $prev , $next, $total_num, $total_page_num); 
    22512246}
    22522247
Note: See TracChangeset for help on using the changeset viewer.