getrow() 가 뭔가요? > 자유게시판

자유게시판

getrow() 가 뭔가요? 정보

기타 getrow() 가 뭔가요?

본문

rss 리더기를 설치중인데 아래와 같은 에러가 납니다.
아시는 분 좀 가르쳐 주세요.

=====================================================================
Fatal error: Call to undefined function: getrow() in /home/hosting_users/hyusignet/www/rss/function.php on line 227
===================================================================

function.php에서 해당부분은 아래와 같습니다.

============================ function.php 해당 부분 ======================
223    ## 사용자 정보 얻기
224    function getUser($uid){
225   global $CONN;
226      $qry = "select userid,userpw from rss_user where userid = '$uid'";
227      return $CONN->getRow($qry);
228    }
=============================================================================

위 rss리더기는 http://kldp.net/projects/hanathereader/에서 배포하는 Hanathe_Rss_Reader.0.7입니다.


============================ function.php 전체 소스 ======================

<?php

############################ SITE INFO 관리
## Site 목록
function getSiteLists($cid=''){
global $userid,$CONN;
if ( $cid > 0 ) $addqry = " and cid = '$cid'";
else $addqry = "";
if ( empty($userid)) return false;
$qry = "select id,rss_url,rss_name,rss_cache_time,rss_opentype,rss_listnum,rss_listtype from rss_info where userid = '$userid' $addqry";
return $CONN->getAll($qry);
}
## Site 목록 하나
function getSiteList($id){
global $userid,$CONN;
if ( empty($id) || empty($userid)) return false;
$qry = "select id,rss_url,rss_name,rss_cache_time,rss_opentype,rss_listnum,rss_listtype  from rss_info where userid = '$userid' and id = '$id'";
return $CONN->getRow($qry);
}
## Site 목록 저장
function setSiteList($post){
global $userid,$CONN;
if ( empty($post) || empty($userid)) return false;
$qry = "insert into rss_info ( id,userid,rss_url,rss_name,rss_cache_time,rss_opentype,rss_listnum,rss_listtype ,rss_date,cid) values (
'','$userid',
'".$post['rss_url']."',
'".$post['rss_name']."',
'".$post['rss_cache_time']."',
'".$post['rss_opentype']."',
'".$post['rss_listnum']."',
'".$post['rss_listtype']."',
'".time()."',
'".$post['cid']."'
)";
$CONN->Query($qry);
if ( $CONN->affectedRows() == 1 ) return true;
else return false;
}

## Site 목록 수정
function updateSiteList($post){
global $userid,$CONN;
if ( empty($post) || empty($userid)) return false;
$qry = "update rss_info set
rss_url = '".$post['rss_url']."',
rss_name = '".$post['rss_name']."',
rss_cache_time = '".$post['rss_cache_time']."' ,
rss_opentype = '".$post['rss_opentype']."' ,
rss_listnum= '".$post['rss_listnum']."' ,
rss_listtype= '".$post['rss_listtype']."'
where id = '".$post['id']."'";
$rst = $CONN->Query($qry);
//if ( $CONN->affectedRows() == 1 ) return true;
//else return false;
if ( DB::isError($rst)) die($rst->getMessage());
else return true;
}

## Site 목록 삭제
function deleteSiteList($id){
global $userid,$CONN;
if ( empty($id) || empty($userid)) return false;
$qry = "delete from rss_info where userid = '$userid' and id = '$id'";
$CONN->Query($qry);
if ( $CONN->affectedRows() == 1 ) return true;
else return false;
}


############################ CATEGORY 관리
## category 목록
function getCategory($cid=''){
global $userid,$CONN;
if ( empty($userid)) return false;
if ( $cid ) $aqry = " and cid = '$cid'";
$qry = "select cid,cname from rss_category where userid = '$userid' $aqry ";
return $CONN->getAll($qry);
}
## category 입력
function setCategory($post){
global $userid,$CONN;
if ( empty($post) ||  empty($userid)) return false;
$qry = "insert into rss_category values ('', '$userid', '".$post['cname']."')";
$rst = $CONN->Query($qry);
if ( $CONN->affectedRows() == 1 ) return true;
else return false;
//if ( DB::isError($rst)) die($rst->getMessage());
}
## category 수정
function updateCategory($post){
global $userid,$CONN;
if ( empty($post) ||  empty($userid)) return false;
$qry = "update rss_category set cname = '".$post['cname']."' where cid = '".$post['cid']."'";
$rst = $CONN->Query($qry);
//if ( $CONN->affectedRows() == 1 ) return true;
//else return false;
if ( DB::isError($rst)) die($rst->getMessage());
else return true;
}
## category 삭제
function deleteCategory($cid){
global $userid,$CONN;
if ( empty($cid) ||  empty($userid)) return false;

$qry2 = "select count(*) from rss_info where userid = '$userid' and  cid = '$cid'";
$count = $CONN->getOne($qry2);
if ( $count > 0 ) die(" $cid 카테고리에 포함된 모든 사이트정보를 먼저 지우세요 !1");


$qry = "delete from rss_category where userid = '$userid' and  cid = '".$cid."'";
$CONN->Query($qry);
if ( $CONN->affectedRows() == 1 ) return true;
else return false;
}

####################################### RSS
## RSS 내용 목록
function getRssInfo($url,$id,$time=''){
global $rss,$userid;
$utf=$addfunc=false;

//id,rss_url,rss_name,rss_cache_time,rss_opentype,rss_listnum,rss_listtype
$inf = getSiteList($id);
$url = $inf[1];
$time = $inf[3];
$listnum = $inf[5];
if ( $inf[4] == 2 ) $win_target = ' target=_new';
if ( $time > 0 ) $cache_file = $userid . "_".$id ;
else $cache_file = '';
$rss->setCachePath(dirname(__FILE__).'/cache/');
$rss->parse($url,$cache_file,$time);
$meta = $rss->getData(ONYX_META);
//echo htmlentities(print_r($meta));
$img = $rss->getData(ONYX_IMAGE);
//echo htmlentities(print_r($meta));
$textinput = $rss->getData(ONYX_TEXTINPUT);
//echo htmlentities(print_r($textinput));
if ( function_exists('mb_detect_encoding') && function_exists('iconv')){
// php 컴파일시 --with-iconv --enable-mbstring 했는지 확인
$addfunc=true;
}
if ( $addfunc == true ){ // iconv,mb_detect_encodeing 함수 사용가능하면
$A_data = @implode("",$meta);
if ( eregi("utf-8",mb_detect_encoding($A_data)) ){
foreach( $meta as $k => $v ) $meta[$k] = iconv("utf-8","euc-kr",$v);
$utf=true;
}
}
## 상단 제목와 이미지 있으면
if ( $meta['title'] ){
if ( $img['url'] ){
if ( $img['width'] && $img['height'] ) $img_size = ' width='.$img['width'].' height='.$img['height'];
$img_link = '<a href='.$img['link']. $win_target .'><img src='.$img['url'].$img_size.' border=0></a>  ';
}
if ( $meta['link'] )
echo "<center><br><font size=5>".$img_link."<a href=".$meta['link'].$win_target.">".$meta['title']."</a></font></center><br>\n";
else
echo "<center><h2> ".$img_link.$meta['title']."</h2></center>\n";
}

echo "<table border=0 width=96% cellpadding=6 align=center>\n
<tr bgcolor=silver>
<th><font color=>번호</font></th> <th><font color=>제  목</font></th>
<th><font color=>날  짜</font></th></tr>\n";
$in=1;
while ($item = $rss->getNextItem()) {
if ( $addfunc == true ){ // iconv,mb_detect_encodeing 함수 사용가능하면
if ( $utf == false && $ct == '' ){
$A_data = implode("",$item);
if ( eregi("utf",mb_detect_encoding($A_data)) ) $utf=true; $ct=1;
}
}
if ( $utf == true )
foreach( $item as $k => $v ) $item[$k] = iconv("utf-8","euc-kr",$v);
if ( $item['title'] )
echo "<tr>
<th width=40>$in</th>
<td> <a href=".$item['link'].$win_target.">".$item['title']."</a></td>
<td> ".$item['pubDate']."</td>
</tr> \n ";
if ( $inf[6] == 2 &&  $item['description'])
echo  "<tr>
<td width=40> </td><td bgcolor=#dfdfdf colspan=2> ".$item['description']."</td></tr>\n";

if ( $listnum > 0 && $listnum == $in ) return;
$in++;
}
// 검색 폼 등 TEXTINPUT 출력
if ( $textinput ) getTextInput($textinput);
echo "</table>";
}
## RSS TEXTINPUT 출력
function getTextInput($ti){
if ( $ti['title'] )
echo  "
<tr>\n
<td width=40> </td>\n
<td colspan=2>\n
<form action=".$ti['link']."><input type=text name=".$ti['name'].">
<input type=submit value='확인'></form>
</td></tr>\n";
}

#################### UserID Check
function userCheck(){
global $_SESSION,$userid;
if ( $_SESSION['userid'] ) $userid = $_SESSION['userid'];
else die("사용자 인증 에러 - 나가시오 !!!!  No : 27754");
}
## 사용자 추가
function setUser($post){
global $CONN;
$userpw = md5($post['iuserpw']);
$qry = "insert into rss_user ( userid,userpw,usermail,indate ) values(
'".$post['iuserid']."',
'".$userpw."',
'".$post['iusermail']."',
'".time()."')";
$CONN->Query($qry);
if ( $CONN->affectedRows() != 1 ) return false;
else return true;
}
## 사용자 정보 얻기
function getUser($uid){
global $CONN;
$qry = "select userid,userpw from rss_user where userid = '$uid'";
return $CONN->getRow($qry);
}
## 사용자 로그인 카운트 추가
function addCount($userid){
global $CONN;
$qry = "update rss_user set count = count + 1 where userid = '$userid'";
$CONN->Query($qry);
}

?>

============================================================================
추천
0

댓글 9개

'하나더'의 README 테스트환경에 나와있는, PEAR DB 관련한 문제인가 봅니다.

제가 제대로 이해한 상황이 아니라서
*정확한 해결책은 모르고요-_-;
혼자 이것저것 찾아본거나마 아래에 적어 둡니다.
정확한 내용이 아니라 무작정 믿으시면 낭패 보실수도 (--)(__)

한 2개월정도 잠수타야할 상황이라 거의 못오게 되어,
아직 새로나온 업데이트도 못하고 있습니다.
오늘은 조금 시간이 많아서 한번 찾아본건데, 덕분이 많이 배운게 있습니다.
컴퓨터를 못하게 되니, 하고 싶은게 잔뜩 생각나네요.
'하나더' 도 한번 설치해보려고 했던거고, 그누용 rss수집기에도 기웃거리고싶고,
새로나온 업데이트 분석(?)도 해보고 싶고, rss generator도 마무리하고싶고,
냉동개구리님이 올리시는 만화들도 찬찬히 보고프고......
지금맘같아선, 뭐든 하나 시작하기만 하면 완벽하게 끝장낼수 있을듯...

아, 놀구파라 ㅠㅜ 그누 금단증상은 너무 괴로워요.

Au revoir~!

---------------------------------------

-PEAR가 뭔지는 잘모르지만 -_-a 그냥 추가모듈 이려니 하고 생각하고 있음.
  php 4.? 부터 디폴트로 설치(?)되는가 봄. 옵션으로 disable 가능한듯.
  (phpinfo()를 자주 보는데 거기에선 내역 못찾겠음.)
  pear가 설치(?)된 디렉토리는 include_path 에 자동 포함되나 봄.
  ( 설치할때 지정가능한듯, 제 계정은 /usr/local/lib/php 또는 /usr/share/pear )

-'하나더'의 db_connect.php 에서 DB.php를 require 해서 class만듬
  폴더안에 없는 파일이라 한참 찾았는데, include_path 에 포함되어 있었음.
 DB.php 에서 PEAR.php 와 DB/mysql.php 를 include 함.
 DB/mysql.php 에서 DB/common.php 를 include 함.

-getRow() 는 common.php 에 정의됨.

-pear가 제대로 설치(?)된 제 계정 한곳에선 별 문제없이 '하나더' 설치됨.

-다른계정하나는 pear가 있긴있는데... 설치시 디렉토리 지정이 잘못되서..
 include_path에 포함안됨. 그래서 파일못찾는다는 fatal에러남.
 * pear 디렉토리에 있는 DB.php와 PEAR.php 를 카피해서 '하나더'디렉에 저장.
 fatal에러 없어짐. 대신, getrow() undefine 에러남.
 * DB폴더만들고 그 안에 mysql.php와 common.php 카피해둠.
 여기까지 해보니, 대충 되는듯함
 (sqlite가 안되서? 게시판은 에러나지만 rss카테고리추가, 읽기,파싱은 잘됨.
  어쨋든 getRow()부분은 이상없이통과)
 
-pear 와 pear db 의 설치법을 보니, 그냥 배포되는 php소스를 업로드하고,
 그 디렉토리를 include_path에 포함시키기만 하면 되는듯한데... 그래서,
 서버와는 별 상관없이, 바로 위에 적은 '카피법' 사용이 가능하지 않을까함-_-a
호스팅회사의 문제인듯 합니다.
다른 호스팅 업체 계정에 설치해 보니 잘 됩니다.
x 같은 cafe24네요.
cafe24는 오로지 홈페이지만 돌릴 수 있는거 같습니다.
블로그하고는 거리가 머네요.

관심가져 주신 KSN님 감사합니다.
제가 직접 설치해봤는데
잘 됩니다.
설치과정은

db_connect.php 파일수정

$user = ( $main_user ) ? $main_user : '디비사용자명';
$pass = ( $main_password ) ? $main_password : '디비패스워드';
$host = ( $main_host ) ? $main_host : 'localhost';
$db_name = ( $main_database ) ? $main_database : '디비명';
이렇게 수정하고
rss.sql  파일은 디비에 넣으시면 됩니다.
mysql -u 유저명 -p 디비계정명  < rss.sql

이렇게 설치하니  위에 메시지가 안나옴
함수에서 결과 안나와서 그런메세지가 나온가 봅니다.
블로그는 전혀 모르지만 ....
일반 유저들이 다루기에는 좀 힘든거 같습니다.
까만도둑님 화이팅 ....
//지니아빠님
봤는데 제가 모르는 내용만 있어서 여전히 헤메고 있습니다.

//KSN님
해당파일에(function.php) include 시키는 내용은 없습니다.
구름님 링크는 자바의 getRow 함수에 관한 내용이구~~
php 내장함수에도없느것 같은데~~
그러면 사용자 함수인것 같은데
include 된 라이브러리 파일 조사하고 만약 있으면  include 경로 문제인것 같다는
느낌이네요~~
전체 195,355 |RSS
자유게시판 내용 검색

회원로그인

진행중 포인트경매

  1. 참여6 회 시작24.04.25 20:23 종료24.05.02 20:23
(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT