¹®¼ÀÇ ÀÔ·ÂÀº °£´ÜÈ÷ spreadsheet¸¦ ÀÌ¿ëÇؼ ¸¸µé¾î¼ ÇÏ¸é °£´ÜÇÒµí ½ÍÁö¸¸, ³ªÁßÀÇ À¯Áöº¸¼ö¸¦ À§Çؼ´Â ¾Æ¹«·¡µµ web¿¡¼ ¹®¼¸¦ ¹Þ¾Æ¿À´Â °ÍÀÌ ´õ Çö¸íÇÒ °Í °°¾Æ¼ phpµîÀ» ÀÌ¿ëÇؼ ¸¸µé±â·Î Çß½À´Ï´Ù.
- DB_insert.php·Î formÀ¸·Î ¹Þ¾Æ¿Â data¸¦ hoze´ÔÀÇ WebTeXÀÇ µµ¿òÀ» ¹Þ¾Æ¼ ġȯÈÄ¿¡ Áý¾î ³Ö´Â °ÍÀÔ´Ï´Ù. DB_insert.txt (1.08 KB) (*wikiƯ¼º»ó php´Â ¿Ã¶ó°¡Áö ¾Ê½À´Ï´Ù.)
¼öÁ¤ formÀÔ´Ï´Ù. ¼öÁ¤Àº µÎ°³ÀÇ ÀԷ°ªÀ» °¡Áö°í ÀÛ¾÷À» Çß½À´Ï´Ù. °ÅÀÇ ¼öÁ¤À» ÇÏ´Â »ç¶÷Àº Á¦°¡ ÇÒ°ÍÀ¸·Î »ý°¢ÀÌ µÇ¹Ç·Î main_disease_id¸¦ °¡Áö°í ÀÛ¾÷À» ÇÏ·Á°í ÇÏ°í ÀÖ½À´Ï´Ù. µÎ°³ÀÇ php ÈÀÏÀÌ ÀÖ½À´Ï´Ù.
ã¾Æ¼ º¸±âÆûÀº source data¸¦ ±×´ë·Î º¸¿©ÁÖ´Â °Í°ú htmlÈ Çؼ º¸¿©ÁÖ´Â µÎ°³ÀÇ ¹æ¹ýÀ¸·Î ÇÏ¿´½À´Ï´Ù. html·Î Çؼ º¸¿©ÁÖ´Â ¹æ¹ýÀ¸·Î´Â À§ÀÇ preg_replace()ÇÔ¼ö¸¦ ÀÌ¿ëÇß½À´Ï´Ù. source ±×´ë·Î º¸±â´Â º°´Ù¸¥ ÇÊ¿ä°¡ ¾øÀ»°Í °°°í htmlÈ Çؼ º¸±â¸¸ phpÈÀÏÀ» linkÇÕ´Ï´Ù.
- mySQL¿¡ µé¾î ÀÖ´Â dataÁß¿¡¼ \commandµÈ ºÎºÐÀ» ÀûÀýÈ÷ htmlÈ Çϱâ
- mySQLÀÇ dataµéÀº Á÷Á¢ TeX·Î Á÷Á¢ »Ì¾Æ¾²±â À§Çؼ ¸î°¡Áö ¸í·É¹®ÀÌ µé¾î°¡ ÀÖ´Ù. ¸í·É¹®ÀÇ Á¾·ù·Î´Â
- \prefix{text} Á¢µÎ¾î --> html¿¡¼ º¯È¯Àº text ~ ÀÔ´Ï´Ù.
- \postfix{text} Á¢¹Ì»ç --> html¿¡¼ º¯È¯Àº ~ text ÀÔ´Ï´Ù.
- \synonym{text} ºñ½ÁÇѸ» --> html¿¡¼ º¯È¯Àº ºñ½ÁÇѸ» text ÀÔ´Ï´Ù.
- \cnm{text} dhucsÀÇ macro --> html¿¡¼ º¯È¯Àº text
- \dis_ref{text} --> html¿¡¼ º¯È¯Àº ÂüÁ¶ text
- \idxcnt --> html¿¡¼ º¯È¯Àº Ư¼ö¹®ÀÚ ÇÑ°³·Î º¯È¯ÇÏ¸é µÉ°Í °°À½.
- \ --> ¾ø¾Ö±â
- ÀÌ ¸í·É¹®Àº Disease_Ko¿Í Definiton field¿¡¸¸ µé¾î ÀÖ¾î¼ ÀÌ µÎ field¿¡¼ÀÇ data¸¦ printÇϱâÀü¿¡ ¹Ì¸® Çѹø phpÁ¤±ÔÇ¥Çö½ÄÀ» ÀÌ¿ëÇؼ Àüó¸®ÇÏ°í ³ÈÄ¿¡ html viewÇØÁØ´Ù.
- Á¤±ÔÇ¥Çö½ÄÀÇ Ç¥ÇöÀ¸·Î´Â
$search_regex = array ("/\\\prefix{(.*?)}/i","/\\\postfix{(.*?)}/i",
"/\\\synonym{(.*?)}/i","/\\\cnm\{(.*?)}/i","/\\\dis_ref\{(.*?)}/i",
"/\\\idxcnt/i","/&/i","/\\\/i");
$replace_regex = array ("\\1 ~","~ \\1"
,"¡ººñ½ÁÇѸ»¡» <span style=text-decoration:underline overline;>\\1</span>"
,"¡º\\1¡»","¡ºÂüÁ¶¡»<span style=text-decoration:underline;> \\1</span>"
,"¢º","&","");
$html_Disease_Ko = preg_replace($search_regex, $replace_regex, $search_result[Disease_Ko]);
$search_regex = array ("/\\\prefix{(.*?)}/i","/\\\postfix{(.*?)}/i",
"/\\\synonym{(.*?)}/i","/\\\cnm\{(.*?)}/i","/\\\dis_ref\{(.*?)}/i",
"/\\\idxcnt/i","/&/i","/\\\/i");
$replace_regex = array ("<span style=\"font-style: italic; font-weight: bold;\">\\1
~</span>","<span style=\"font-style: italic; font-weight: bold;\">~ \\1</span>",
"<br>¡ººñ½ÁÇѸ»¡» <span style=text-decoration:underline overline;>\\1</span>",
"¡º\\1¡»","<br>¡ºÂüÁ¶¡»<span style=text-decoration:underline;> \\1</span>",
"<br>¢¹","&","");
$html_Definition = preg_replace($search_regex, $replace_regex, $search_result[Definition]);