2015년 9월 17일 목요일

라라벨 사용하기~ㅎ

프레임워크 코드이그나이트를 써서

테이블 에 목록을 뿌리고, 페이징구현, 검색(1개필드) 구현 까지 해봤다

수요일은 mysql에러 socket(2) 이런 에러였는데 소켓이 자꾸 지워져서 데몬이 못올라가서 나는 에러다. 현상은 알겠는데 원인과 해결법은 몰라서 그냥 os밀고 다시 설치하니까 잘올라온다.

목요일 코드이그나이터 vs 라라벨 고민고민하다가 결국 라라벨 선택하고 6시쯤 라라벨 관련 서적 한개 구매후 집에와서 설정하는데
두둥! 이거뭐 설정하는데 왜이렇게 삽질이 필요한지 ㅎㅎ 라라벨을 몰라서 삽질하는게 아니고
apache2 을 모르고 ubuntu(linux)명령어를 모르니까 더 심한 삽질을 한다.

나중에 또필요할거같아서 올려둔다. 이건 httpd-vhosts.conf 파일 내용이다.
해당디렉토리의 권한이 없어서 포비든이 뜬다. ^_^

아! 그리고 /etc/apache2/apache2.conf 파일에서 httpd-vhosts.conf을 include해줘야한다.
그리고 /etc/hosts.conf 에서 127.0.0.1 laravel.dev 이런식으로 지정해주면 끝!
그래야 laravel.dev 이런식으로  가상으로  서버를 만든다는 그런내용인듯하다

어려워서 homstead인가 그쪽으로 가려다가 그쪽은 더어려운거같아서 ㅎㅎ



# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
#    ServerName dummy-host.example.com
#    ServerAlias www.dummy-host.example.com
#    ErrorLog "logs/dummy-host.example.com-error.log"
#    CustomLog "logs/dummy-host.example.com-access.log" common
#</VirtualHost>
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "logs/dummy-host2.example.com-error.log"
#    CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/home/kyungtai/workspace/learning-laravel/public"
    ServerName laravel.dev

<Directory "/home/kyungtai/workspace/learning-laravel/public">
   Order allow,deny
   Allow from all
   # New directive needed in Apache 2.4.3:
   Require all granted
</Directory>

</VirtualHost>

2015년 9월 7일 월요일

씬나는 월요일?



가사는 대충  뜻은

말말말

그동안 어떻게 참았지?  입열지마세요 시끄라우니까~ 이런뜻인가? ㅎㅎ




You say come over, let's have a little chat
And I say "Okay, I guess I'm fine with that"
But as we get to talking, I could go insane
You just kept speakin' those words and it started to hurt my brain.
One word after the other, no space for me to say
"Sorry but I've got to go we'll talk another day"
Sitting there still tryin' to smile but it seems impossible
'Cause honestly I was getting.
Tired of words, words, words
Don't want 'em anymore
Words, words, words
How could I deal with them before?
It's like they've taken over and there's nowhere I can hide
What good do they bring? Never fixed anything
So as you can see that's why I'm not speaking
Words.
Everywhere I go words are coming at me
From on the radio and on the T.V.
People stop to say "Hello" but that isn't what I need
What I want from these words is to be free
One word after the other, no space for me to say
"I have to leave and get some space, I've got to get away"
Sitting there impatiently trying not to cry
'Cause honestly I was getting
Tired of words, words, words
Don't want 'em anymore
Words, words, words
How could I deal with them before?
It's like they've taken over and there's nowhere I can hide
What good do they bring? Never fixed anything
So as you can see that's why I'm not speaking
What's the point of narrating life
'Cause you know that words will only hurt you inside
You make your promises and then you break them
Who says forgiveness can be written down with a pen
I hold your hand and try to let it go
But you keep on bringing back feelings and they show
Your light keeps dimming everything around
And the words I'm feeling, they can't be found
To explain how I feel right now
Words, words, words
Don't want 'em anymore
Words, words, words
How could I deal with them before?
It's like they've taken over and there's nowhere I can hide
What good do they bring? Never fixed anything
So as you can see that's why I'm not speaking
Words

2015년 8월 31일 월요일

부트스트랩 관련 소스 생성 해주는 사이트

http://www.bootply.com/

http://www.layoutit.com/

그냥 신기할따름

안에서 클릭질 몇번으로 왠만한 샘플코드가 자동으로 생성되어서 하단에

미리보기로 제공된다.

놀라울따름

2015년 8월 25일 화요일

휴대폰 (스마트폰) 분실시 찾을수 있는 방법



구글 로그인이 필요합니다.


이쪽으로 접속후 로그인 -> 기다리면

약 2km 반경으로 위치를 찾아줍니다.

벨울리기 /  잠금 / 초기화


벨울리기는 가장 큰음량으로 벨을 울려주며


초기화는 비밀스런 사진이라든가 파일을 삭제해주는 그런 기능인듯합니다.





2015년 8월 16일 일요일

jquery를 이용한 선택된 요소가 몇번째인지 찾고 해당요소의 값을 변경 또는 가져오는 방법

우선 참조한 사이트는

jQuery:: 이벤트가 발생한 요소 찾기(event.target)

http://blog.dokenzy.com/archives/291


$('.als-item a img').click(function(event){
    var index = $("img").index(this);
    var num_ = $("img:eq("+index+")").attr("value");

}

상단의 소스는 img요소의 갯수를 세고
클릭한 요소가 몇번째인지 알수 있도록해준다.

php 반복문 내에서  이미지가 반복되며 해당이미지에 value라는 속성으로 특정 값이
있는 상황에서 이미지를 클릭하면 num값을 가져와서 뭔가 작업할때 사용하였다.

2015년 8월 5일 수요일

ㅠ_ㅠ php코딩!


우선 저는 mysqli_connection()함수를 사용합니다. 그래서 plan폴더 내에 lib/dbconnection으로 terra/lib와 

별도로 구분해 놓았습니다.  사실 내용은같습니다만 (혼용하면 에러가 빈번하게 발생해서 )


common.php 의 내용입니다

Class board
 변수:   q_table  q_where  q_column   쿼리에서사용하는  테이블, 조건, 필드명입니다.
            q_sch,   q_fld                            쿼리에서사용하는 검색필드내용,  검색할 필드입니다.
 page, page_set, block_set         페이징기능의 페이지,  페이지수설정, 블록설정 입니다.

함수: check_admin_session()              관리자 계정 정보가 세션에 포함되어있는지 확인한후 없으면 최상위 index로 리다이렉트
check_login_session()              회원정보가 세션에 포함되어 있는지 확인후 없으면 최상위 index로 리다이렉트
search_and_paging()               검색및 페이징처리를 합니다  반환값은 배열[블록스트링, 게시물결과(10)]

image_FileUpload()                  이미지 업로드 기능'만' 합니다  자세히 분석하지 않고 그냥 함수로 묶어만 놓아서 버그가 많습니다 다시 손봐야할 함수 입니다.



클래스 및 변수 함수화 하면서 느낀점이 함수안에서 멤버로 접근하기가 생각보다 까다롭구나
라고 느껴졌습니다 (이전까지는 그냥 include 할 php파일 내에 그저 함수화 , 변수화 )

dbconnection을 어떻게 불러와야할지 몰라 현재 그냥 클래스 내에서 mysqli_connection (,,,,)
이런식으로 사용하는데 PDO는 먼지  잘 모르겠네요