━━━━ ◇ ━━━━
기타

아보카도에 커서 넣기이

개요

마우스 포인터를 파비콘처럼 파일로 업로드하여 홈페이지 전체에 적용하는 방법에 대해서 적습니다.

수정하는 파일은 다음과 같습니다.

  • adm/config_form.php
  • adm/config_form_update.php
  • css/default.css

 

수정 방법

adm/config_form.php

다음을 찾습니다.

if(!isset($config['cf_mobile_pages'])) {
	sql_query(" ALTER TABLE `{$g5['config_table']}`
					ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ", true);
	sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
}

 

 

그 아래나 위에 다음 블럭을 삽입합니다.

if(!isset($config['cf_cursor'])) {
	sql_query(" ALTER TABLE `{$g5['config_table']}`
					ADD `cf_cursor` varchar(255) NOT NULL DEFAULT '' AFTER `cf_site_img` ", true);
}

 

 

다음을 찾습니다.

		<tr>
			<th rowspan="2">파비콘</th>
			<td>
				<?php echo help('파비콘 확장자는 ico 로 등록해 주셔야 적용됩니다.') ?>
				직접등록&nbsp;&nbsp; <input type="file" name="cf_favicon_file" value="" size="50">
			</td></tr><tr>
			<td>
				외부경로&nbsp;&nbsp; <input type="text" name="cf_favicon" value="<?=$config['cf_favicon']?>" size="50"/>
			</td>
		</tr>

 

아래나 위에 다음 블럭을 삽입합니다.

		<tr>
			<th rowspan="2">마우스 커서</th>
			<td>
				<?php echo help('커서 확장자는 cur 로 등록해 주셔야 적용됩니다. 애니메이션 커서 불가능.') ?>
				직접등록&nbsp;&nbsp; <input type="file" name="cf_cursor_file" value="" size="50">
			</td></tr><tr>
			<td>
				외부경로&nbsp;&nbsp; <input type="text" name="cf_cursor" value="<?=$config['cf_cursor']?>" size="50"/>
			</td>
		</tr>

 

 

adm/config_form_update.php

if ($_FILES['cf_favicon_file']['name']) {
	// 확장자 따기
	$exp = explode(".", $_FILES['cf_favicon_file']['name']);
	$exp = $exp[count($exp)-1];

	$image_name = "site_favicon.".$exp;
	upload_file($_FILES['cf_favicon_file']['tmp_name'], $image_name, $site_style_path);
	$cf_favicon = $site_style_url."/".$image_name;
}

 

위 부분을 찾아 위나 아래에 다음 블럭을 추가합니다.

if ($_FILES['cf_cursor_file']['name']) {
	// 확장자 따기
	$exp = explode(".", $_FILES['cf_cursor_file']['name']);
	$exp = $exp[count($exp)-1];

	$image_name = "site_cursor.".$exp;
	upload_file($_FILES['cf_cursor_file']['tmp_name'], $image_name, $site_style_path);
	$cf_cursor = $site_style_url."/".$image_name;
}

 

그리고 cf_site_img = '{$cf_site_img}', 부분을 찾아 엔터 후 cf_cursor = '{$cf_cursor}',를 넣어주세요.

 

css/default.css

html {~~} 칸을 찾아 그 아래에 다음을 넣습니다.

html * {cursor: url('../data/site/site_cursor.cur'), auto;}

 

일부 포인터 지정이 되어서 바뀌는 것이 신경쓰일 경우, html * {cursor: url('../data/site/site_cursor.cur'), auto;} 옆에 !important를 넣으시면 됩니다.

그래도 적용 안 되는 것들은 !important의 마수에 침식당해서 어쩔 수 없는 겁니다. 수동으로 없애세요. 그리고 !important 남용에 경각심을 가집시다.

 

이제 관리자 페이지에서 찾아 업로드하시면 됩니다.

'기타' 카테고리의 다른 글

아보카도 에디션 버그 리포팅하기  (0) 2023.06.09
스타일 처리 우선순위  (0) 2022.10.23
COMMENT