텍스트 큐브(이하 큐브)로 업그레이드 하면서,
코드의 변화가 있었는지 스킨이 제대로 작동되지 않았다.
그래서 큐브의 코드를 살펴보았다.
무척 간단하게 코드가 바뀌어 적용하기 더 쉬워졌다.
구글 검색 결과는 {큐브 접속주소}/gsearch/OOOO 형태로 검색이 된다.
아래 코드의 gsearch 부분은 원하는 이름으로 바꾸어 사용할 수 있다.
{큐브 설치 폴더}/blog/gsearch/index.php 파일이다.
이전 태터툴즈에서는 모든 코드를 index.php 파일에 넣었었다.
[code html]
<?php
/// Copyright (c) 2004-2007, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
define('ROOT', '../..');
require ROOT . '/lib/includeForBlog.php';
if (false) {
fetchConfigVal();
}
//$locatives = getLocatives($blogid);
require ROOT . '/lib/piece/blog/begin.php';
require ROOT . '/lib/piece/blog/gsearch.php';
require ROOT . '/lib/piece/blog/end.php';
?>
[/code]
위 코드의 gsearch.php 파일은 새로 만들어야 한다.
{큐브 설치 폴더}/lib/piece/blog/gsearch.php 에 구글검색결과 코드를 넣어준다.
[code html]
<?php
/// Copyright (c) 2004-2007, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
// 2007-09-20 : google search modify
// localog -> googleSearch
$googleSearchView = "<div class=\"localog\">
<div style=\"background:url('http://www.google.com/logos/Logo_25wht.gif') top left no-repeat; font-weight:bold; font-size:12pt; width:600px; height:30px; padding-top:5px; padding-left:90px; border-bottom:1px solid #000;\">구글검색</div>
<!-- Google Search Result Snippet Begins -->
<div id=\"googleSearchUnitIframe\"></div>
<script type=\"text/javascript\">
var googleSearchIframeName = 'googleSearchUnitIframe';
var googleSearchFrameWidth = 700;
var googleSearchFrameborder = 0 ;
var googleSearchDomain = 'www.google.co.kr';
</script>
<script type=\"text/javascript\"
src=\"http://www.google.com/afsonline/show_afs_search.js\">
</script>
<!-- Google Search Result Snippet Ends -->
</div>
";
dress('local',$googleSearchView,$view);
?>
[/code]
다음 코드이다.
예전 코드는 컨텐츠영역 이외의 부분까지 코드에 들어가 있어 수정하기 상대적으로 복잡했지만, 큐브의 코드는 수정하기 편해졌다.
이런식으로 사용하는 블로거가 있을지 모르겠지만, 글을 남겨둔다.









Recent Comment