{"id":371,"date":"2006-02-20T13:31:20","date_gmt":"2006-02-20T04:31:20","guid":{"rendered":"http:\/\/terzeron.com\/?p=371"},"modified":"2006-02-20T13:31:20","modified_gmt":"2006-02-20T04:31:20","slug":"%ed%81%ac%eb%a0%88%ec%9d%b4%ec%a7%80%ec%9b%b9%eb%b3%b4%eb%93%9ccrazywwwboard-301-%eb%8d%b0%ec%9d%b4%ed%84%b0%eb%a5%bc-%ec%a0%9c%eb%a1%9c%eb%b3%b4%eb%93%9czeroboard%eb%a1%9c-%eb%b3%80%ed%99%98%ed%95%98","status":"publish","type":"post","link":"https:\/\/terzeron.com\/?p=371","title":{"rendered":"\ud06c\ub808\uc774\uc9c0\uc6f9\ubcf4\ub4dc(CrazyWWWBoard) 3.0.1 \ub370\uc774\ud130\ub97c \uc81c\ub85c\ubcf4\ub4dc(Zeroboard)\ub85c \ubcc0\ud658\ud558\uae30"},"content":{"rendered":"<pre class=\"brush: php\">#!\/usr\/bin\/env perl\n#\n# crazy2zero.pl\n#\n# CrazyWWWBoard-3.0.1\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub358 GDBM \ub370\uc774\ud130\ub97c zeroboard\ub85c \uc62e\uae30\uae30 \uc704\ud55c\n# \ubcc0\ud658 \uc2a4\ud06c\ub9bd\ud2b8\n# 1. \uc81c\ub85c\ubcf4\ub4dc\uc5d0\uc11c \uad00\ub9ac\uc790 \uad8c\ud55c\uc73c\ub85c \uc0c8\ub85c\uc6b4 \uac8c\uc2dc\ud310\uc744 \uc0dd\uc131\ud55c\ub2e4.\n# 2. \uc774 \ubcc0\ud658 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \uc2e4\ud589\ud558\uc5ec SQL \ud30c\uc77c\uc744 \uc0dd\uc131\ud55c\ub2e4.\n# 3. SQL \ud30c\uc77c\uc744 MySQL\uc5d0 \ub85c\ub4dc\ud55c\ub2e4.\n# 4. \uac8c\uc2dc\ubb3c\uc774 \ubcf4\uc774\uc9c0 \uc54a\uc73c\uba74, \ub2e4\uc74c\uc744 \uc2e4\ud589\ud55c\ub2e4.\n# update zetyx_board_1997 set total_article = <\uac8c\uc2dc\ubb3c \uac2f\uc218>;\n# 5. \uc81c\ub85c\ubcf4\ub4dc\uc5d0\uc11c \uad00\ub9ac\uc790 \uad8c\ud55c\uc73c\ub85c \uac8c\uc2dc\ubb3c \uc815\ub9ac\ub97c \ud55c \ubc88 \uc218\ud589\ud574 \uc900\ub2e4.\n#\n# ToDo or Bugs\n# 1) prev_no, next_no\uc5d0 \ub300\ud55c \ucc98\ub9ac\uac00 \uc81c\ub300\ub85c \ub418\uc5b4 \uc788\uc9c0 \uc54a\uc74c\n# 2) father, child\uc5d0 \ub300\ud55c \uad00\uacc4\uac00 \ubd88\uba85\ud655\ud568(thread \uac1c\ub150\uc774 \uc5c6\uc74c)\n# 3) \uc0ac\uc6a9\uc790 \uad8c\ud55c\uc774 \ubd80\uc5ec\ub418\uc9c0 \uc54a\uc74c(\uc5b4\uca54 \uc218 \uc5c6\ub294 \ubb38\uc81c)\n\nuse FileHandle;\nuse English;\nuse GDBM_File;\nuse Time::Local;\n\n# \ub2e4\uc74c \uc124\uc815\uc744 \ubcc0\uacbd\ud560 \uac83\n#my $dbmfilename = \"XXXXXXXXXXXXX.gdbm\";\nmy $dbmfilename = \"95.gdbm\";\nmy $tablename = \"zetyx_board_YYYYYYYYYYYYYY\";\nmy $outfilename = \"ZZZZZZZZZZZZZ.sql.txt\";\n\nmy %hash;\nmy $no = 1;\nmy $prev_no = 1;\nmy $count = 0;\nmy $max_num = 0;\nmy $key;\nmy $value;\n\nmy $subject;\nmy $thread;\nmy $access;\nmy $date;\nmy $year;\nmy $mon;\nmy $mday;\nmy $hour;\nmy $min;\nmy $sec;\nmy $reg_date;\nmy $ip;\nmy $domain;\nmy $email;\nmy $filename;\nmy $name;\nmy $text;\nmy $depth;\nmy $addr;\nmy $password;\n\ntie(%hash, \"GDBM_File\", $dbmfilename, $GDBM_RDONLY, 0644) or\ndie \"can't open GDBM file\\n\";\n\nsub get_hash_value {\nmy $no = shift @_;\nmy $name = shift @_;\n$key = $no . \".\" . $name;\n$key =~ s\/$\/\\x00\/;\n$value = $hash{$key};\n$value =~ s\/\\x00$\/\/;\n$value;\n}\n\n$OUTPUT_AUTOFLUSH = 1;\nprint \"Determining all keys in the GDBM file...\\n\";\nmy @list = keys %hash;\nprint \"Determining maximum article number...\\n\";\nprint \"|\";\nprint \"\";\nforeach $a_key (@list) {\n$a_key =~ \/(\\d+)\\.\\w+\/;\nif ($max_num < $1) {\n$max_num = $1;\n}\n\n$count++;\nif ($count == 10) {\nprint \"\\b-\";\nprint \"\";\n} elsif ($count == 20) {\nprint \"\\b\\\\\";\nprint \"\";\n} elsif ($count == 30) {\nprint \"\\b|\";\nprint \"\";\n} elsif ($count == 40) {\nprint \"\\b\/\";\nprint \"\";\n$count = 0;\n}\n}\nprint \"\\bThe maximum article number: $max_num\\n\";\n\nprint \"Writing SQL statements to a file...\\n\";\nopen(FILE, \"> $outfilename\") or\ndie \"can't open file '$outfilename' for writing, $!\\n\";\nfor ($no = 1; $no <= $max_num; $no++) {\n$subject = get_hash_value($no, \"Subject\");\nif (not defined $subject or $subject eq \"\") {\nnext;\n}\n$subject =~ s\/\\'\/\\\\\\'\/g;\n$thread = get_hash_value($no, \"Thread\");\n$access = get_hash_value($no, \"Access\");\n$date = get_hash_value($no, \"Date\");\n($year, $mon, $mday, $hour, $min, $sec) =\n$date =~ \/(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)\/;\n$sec = 0;\n#print \"$year $mon $mday $hours $min $sec\\n\";\n$reg_date = timelocal($sec, $min, $hour, $mday, $mon - 1, $year);\n\n$ip = get_hash_value($no, \"IP\");\n$domain = get_hash_value($no, \"Domain\");\nif (defined $domain and $domain ne \"\") {\n$addr = $domain;\n} else {\n$addr = $ip;\n}\n$email = get_hash_value($no, \"Email\");\n$filename = get_hash_value($no, \"Filename\");\n$name = get_hash_value($no, \"Name\");\n$name =~ s\/\\'\/\\\\\\'\/g;\n$password = get_hash_value($no, \"Password\");\n$text = get_hash_value($no, \"Text\");\n$text =~ s\/\\'\/\\\\\\'\/g;\n$text =~ s\/\\r\/\/g;\n$text =~ s\/\\n\/\\\\n\/g;\nif (defined $thread and $thread ne \"0\" and $thread ne \"\") {\n$depth = 1;\n} else {\n$depth = 0;\n}\n\nprint FILE \"insert into $tablename values ($no, 1, -$no, 0, 0, \";\nprint FILE ($no - 1) . \", \" . ($no + 1) . \", $thread, 0, 0, 0, \";\nprint FILE \"'$text', '$addr', '$password', '$name', '', '$email', \";\nprint FILE \"'$subject', '', '', 1, '', '', '', '', '', '', '', 0, 0, \";\nprint FILE \"$reg_date, $access, 0, 0, '', '');\\n\";\n\n$count++;\nif ($count == 10) {\nprint \"\\b-\";\nprint \"\";\n} elsif ($count == 20) {\nprint \"\\b\\\\\";\nprint \"\";\n} elsif ($count == 30) {\nprint \"\\b|\";\nprint \"\";\n} elsif ($count == 40) {\nprint \"\\b\/\";\nprint \"\";\n$count = 0;\n}\n}\nclose(FILE);\n\nuntie %hash;<\/pre>\n<div class=\"fb-background-color\">\n\t\t\t  <div \n\t\t\t  \tclass = \"fb-comments\" \n\t\t\t  \tdata-href = \"https:\/\/terzeron.com\/?p=371\"\n\t\t\t  \tdata-numposts = \"100\"\n\t\t\t  \tdata-lazy = \"true\"\n\t\t\t\tdata-colorscheme = \"light\"\n\t\t\t\tdata-order-by = \"time\"\n\t\t\t\tdata-mobile=true>\n\t\t\t  <\/div><\/div>\n\t\t  <style>\n\t\t    .fb-background-color {\n\t\t\t\tbackground: #ffffff !important;\n\t\t\t}\n\t\t\t.fb_iframe_widget_fluid_desktop iframe {\n\t\t\t    width: 100% !important;\n\t\t\t}\n\t\t  <\/style>\n\t\t  ","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/env perl # # crazy2zero.pl # # CrazyWWWBoard-3.0.1\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub358 GDBM \ub370\uc774\ud130\ub97c zeroboard\ub85c \uc62e\uae30\uae30 \uc704\ud55c # \ubcc0\ud658 \uc2a4\ud06c\ub9bd\ud2b8 # 1. \uc81c\ub85c\ubcf4\ub4dc\uc5d0\uc11c \uad00\ub9ac\uc790 \uad8c\ud55c\uc73c\ub85c \uc0c8\ub85c\uc6b4 \uac8c\uc2dc\ud310\uc744 \uc0dd\uc131\ud55c\ub2e4. # 2. \uc774 \ubcc0\ud658 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \uc2e4\ud589\ud558\uc5ec SQL \ud30c\uc77c\uc744 \uc0dd\uc131\ud55c\ub2e4. # 3. SQL \ud30c\uc77c\uc744 MySQL\uc5d0 \ub85c\ub4dc\ud55c\ub2e4. &hellip; <a href=\"https:\/\/terzeron.com\/?p=371\">\uacc4\uc18d \uc77d\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[13,9],"tags":[],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-programming","category-9"],"_links":{"self":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371"}],"version-history":[{"count":0,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"wp:attachment":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}