YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Miscellaneous > Q&A
검색
멤버이름    오토
비밀번호 
 

블로그에서 질문드렸었는데요^^

페이지 정보

작성자 no_profile MintState 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 1건 조회 14,206회 작성일 11-02-01 11:43

본문

우선 db table을 만들어야 합니다. 간단히....


이런식으로 만들고

bbs/write_update.php 파일에서
require_once ("../skin/board/torrent/torrent.php");
// 확장자 알아오기
function torrent_getExt($str) {
		$f = explode(".", $str);
		$l=sizeof($f);
		if($l>1) {
				return strtolower($f[$l-1]);
		} else {
				return '';
		}
}

을 추가해 줍니다. 토런트 클레스를 include하시고

파일을 업로드시 파일정보를 db에 넣는 부분을 찾아서 아래 코드를 추가 해주면 됩니다.
        if (torrent_getExt($upload[$i][source]) == "torrent") {

						$file_full_path = "../data/file/".$bo_table."/".$upload[$i][file];
						if (file_exists($file_full_path)) {
								$torrent_file = file_get_contents($file_full_path);
								$torrent_array = array();
								$torrent_array = BDecode($torrent_file);
								$torrent_hash=sha1(BEncode($torrent_array['info']));

								$announce_list_cnt = count($torrent_array['announce-list']);
								for ($al=0;$al < $announce_list_cnt;$al++) {
										$torrent_announce .= $torrent_array['announce-list'][$al][0]."\n";
								}

								$torrent_files = "";
								if ($torrent_array['info']['length']) {
										$torrent_files .= $torrent_array['info']['name'];
										$torrent_files .= " (".get_filesize($torrent_array['info']['length']).")";
										$torrent_total_size = $torrent_array['info']['length'];
								} else {
										$torrent_total_size = 0;
										for ($tf=0;$tf < count($torrent_array['info']['files']);$tf++) {
												$info_file_path_cnt = count($torrent_array['info']['files'][$tf]['path']);
												$torrent_files .= ($tf+1).": ";
												for ($j=0;$j < $info_file_path_cnt;$j++) {
														$torrent_files .= $torrent_array['info']['files'][$tf]['path'][$j];
														if ($j < $info_file_path_cnt-1) $torrent_files .= "/";
												}
												$torrent_files .=  " (".get_filesize($torrent_array['info']['files'][$tf]['length']).")";
												$torrent_files .=  "\n";
												$torrent_total_size = $torrent_total_size + $torrent_array['info']['files'][$tf]['length'];
										}
								}

				        $sql = " insert into `torrent`
				                    set hash = '".$torrent_hash."',
				                    		announce = '".mysql_real_escape_string($torrent_announce)."',
				                    		comment = '".mysql_real_escape_string($torrent_array['comment'])."',
				                    		creation_date = '".$torrent_array['creation date']."',
				                    		files = '".mysql_real_escape_string($torrent_files)."',
				                    		name = '".mysql_real_escape_string($torrent_array['info']['name'])."',
				                    		total_size = '".$torrent_total_size."',
				                    		bo_table = '$bo_table',
				                        wr_id = '$wr_id',
				                        bf_no = '$i',
				                        regdate = '$g4[time_ymdhis]' ";
				        sql_query($sql);	
						}
						
				}

문론 이것은 추가해 주는 것만이고 수정 삭제시에도 코드를 만들어 주어야 겠죠.
나머지는 쉬우니 님이 알아서...... ㅎㅎ

>
>
> 제가 알고싶은건 torrent.php 파일을 사용하셔서 view.skin.php 에 파일정보를 보이게 하셨는데
> torrent.php 파일을 이용하여
> 게시판에 글을쓸때 같이 정보가 입력되게 만들려고합니다^^
> 블로그에서 말씀하신 대로 따로 테이블을 만들고
> 그 새로만든테이블에 정보를 입력하려고 sir.co.kr , 네이버, 구글 등등 에서 찾아봤는데
> 그 부분에서부터 막히더라구요
> 대부분 설명에서는 wr_x 확장 하는것뿐이고 테이블을 추가해서
> 사용하는건 없더라구요
> 제가 검색을 잘못하는건지....없는건지도 모르겠습니다
> 게시판 테이블 + 새로만든테이블 이렇게 해서 글을 입력하고 불러오려고합니다.
> 너무 광범위하게 설명한건지도 모르겠습니다.
> 도움좀 부탁드리겠습니다^^
>

댓글목록

Total 49건 1 페이지
Q&A 목록
번호 제목 글쓴이 조회 날짜
49 no_profile 길똥이 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 20512 12-13
48 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15826 04-27
47 no_profile shop1234 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15283 01-26
46 no_profile 수리매니아 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15036 02-06
45 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14751 04-14
44 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14539 03-12
43 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14249 04-21
열람중 no_profile MintState 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14207 02-01
41 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14143 04-27
40 no_profile 카가 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14133 03-31
39 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13935 03-25
38 no_profile 태양11 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13718 03-13
37 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13690 04-27
36 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13683 05-14
35 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13624 04-19
34 no_profile 신재영 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13498 04-25
33 no_profile 밤일기 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13449 08-30
32 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13447 04-12
31 no_profile 명예 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13140 04-17
30 no_profile nick1224 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13121 05-25
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™