GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge branch 'p2ex-nightly-hack' · unpush/p2-php@4ebed56

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • aas.php
  • cli
    • .htaccess
    • P2CommandRunner.php
    • fetch-subject-txt.php
  • conf
    • conf.inc.php
    • conf_admin.inc.php
    • conf_admin_ex.inc.php
    • conf_constant_def.txt
    • conf_hostcheck.php
    • conf_ic2.inc.php
    • conf_user_def.inc.php
    • conf_user_def_ex.inc.php
    • conf_user_def_i.inc.php
    • conf_user_style.inc.php
  • cookie.php
  • css.php
  • css
    • ic2_iphone.css
    • ic2_popinfo.css
    • iphone.css
    • iv2_iphone.css
    • menu_i.css
  • doc
    • ChangeLog.txt
    • ImageCache2
      • ic2_install.phps
    • iui
      • LICENSE.txt
      • NOTICE.txt
      • README.txt
      • releaseNotes.txt
  • edit_aborn_word.php
  • edit_conf_user.php
  • edit_user_font.php
  • editfavita.php
  • editfile.php
  • editpref.php
  • editrss.php
  • first_cont.php
  • gsearch.php
  • httpcmd.php
  • ic2.php
  • ic2_fitimage.php
  • ic2_getinfo.php
  • ic2_getter.php
  • ic2_manager.php
  • ic2_mkthumb.php
  • ic2_setrank.php
  • ic2_setter.php
  • ic2_viewtable.php
  • img
    • show.png
    • video.png
  • import.php
  • index.php
  • info.php
  • info_sp.php
  • iui
    • backButton.png
    • blueButton.png
    • cancel.png
    • grayButton.png
    • iui.css
    • iui.js
    • listArrow.png
    • listArrowSel.png
    • listGroup.png
    • loading.gif
    • pinstripes.png
    • selection.png
    • thumb.png
    • toggle.png
    • toggleOn.png
    • toolButton.png
    • toolbar.png
    • whiteButton.png
  • iv2.php
  • js
    • asciiart.js
    • fitimage.js
    • htmlpopup.js
    • htmlpopup_resizable.js
    • ic2_iphone.js
    • ic2_popinfo.js
    • ic2_switch.js
    • ic2g.js
    • ic2m.js
    • ic2s.js
    • ic2vt.js
    • iphone.js
    • iv2.js
    • iv2_iphone.js
    • iv2m.js
    • loadthumb.js
    • menu_i.js
    • ngabornctl.js
    • preview_video.js
    • respopup.js
    • respopup_iphone.js
    • sb_iphone.js
    • smartpopup.js
    • spm_iphone.js
  • lib
    • BbsMap.php
    • BrdCtl.php
    • BrdMenu.php
    • DataPhp.php
    • FavSetManager.php
    • FileCtl.php
    • HostCheck.php
    • Login.php
    • NgAbornCtl.php
    • P2HttpExt.php
    • P2Util.php
    • PresetManager.php
    • ResHist.php
    • Session.php
    • SettingTxt.php
    • ShowBrdMenuK.php
    • ShowBrdMenuPc.php
    • ShowThread.php
    • ShowThreadK.php
    • ShowThreadPc.php
    • StrCtl.php
    • StrSjis.php
    • SubjectTxt.php
    • Thread.php
    • ThreadList.php
    • ThreadRead.php
    • Wap.php
    • conf_user_updater.inc.php
    • dele.inc.php
    • emoji.inc.php
    • expack
      • ActiveMona.php
      • ExpackLoader.php
      • activemona.class.php
      • google
        • Converter.php
        • Renderer.php
        • Search.php
        • Search
          • Common.php
          • PearSoap.php
          • SoapExtension.php
      • ic2
        • DataObject
          • BlackList.php
          • Common.php
          • Errors.php
          • Images.php
        • EditForm.php
        • Matrix.php
        • QuickForm
          • Rules.php
        • Switch.php
        • Thumbnailer.php
        • Thumbnailer
          • Common.php
          • Gd.php
          • Imagemagick.php
          • Imagick.php
          • Imagick09.php
          • Imlib2.php
          • Magickwand.php
        • buildimgcell.inc.php
        • findexec.inc.php
        • getvalidvalue.inc.php
        • loadconfig.inc.php
        • managedb.inc.php
        • matrix.class.php
        • quickrules.class.php
        • templates
          • _html.tpl.html
          • _iv2_lightbox.tpl.html
          • _iv2_reset.tpl.html
          • _label.tpl.html
          • ic2g.tpl.html
          • ic2mng.tpl.html
          • ic2s.tpl.html
          • ic2vt.tpl.html
          • iv2.tpl.html
          • iv2a.tpl.html
          • iv2i.tpl.html
          • iv2ip.tpl.html
          • iv2m.tpl.html
          • preview.tpl.html
      • post_options.inc.php
      • post_options_k.inc.php
      • rss
        • common.inc.php
        • getimage.inc.php
        • menu.inc.php
        • parser.inc.php
        • read.inc.php
        • read_k.inc.php
        • setrss.inc.php
        • subject.inc.php
        • subject_k.inc.php
      • tgrep
        • menu_quick.inc.php
        • menu_recent.inc.php
        • view.inc.php
        • view_k.inc.php
        • view_x.inc.php
    • filectl.class.php
    • fontconfig.inc.php
    • getsetposlines.inc.php
    • index_print_k.inc.php
    • login2ch.inc.php
    • login_first.inc.php
    • md5_crypt.inc.php
    • menu.inc.php
    • menu_iphone.inc.php
    • p2util.class.php
    • p2util.inc.php
    • post_form.inc.php
    • post_options_loader.inc.php
    • read_filter_k.inc.php
    • read_footer.inc.php
    • read_footer_k.inc.php
    • read_header.inc.php
    • read_header_k.inc.php
    • read_jump_k.inc.php
    • read_machibbs.inc.php
    • read_new.inc.php
    • read_res_hist.inc.php
    • read_shitaraba.inc.php
    • sb_footer.inc.php
    • sb_footer_k.inc.php
    • sb_header.inc.php
    • sb_header_k.inc.php
    • sb_print.inc.php
    • sb_print_k.inc.php
    • sb_toolbar.inc.php
    • sb_toolbar_k.inc.php
    • setfav.inc.php
    • setfavita.inc.php
    • setpalace.inc.php
    • settaborn.inc.php
    • settaborn_off.inc.php
    • showbrdmenupc.class.php
    • showthread.class.php
    • sort_threadlist.inc.php
    • spm_k.inc.php
    • subject_new.inc.php
    • thread.class.php
    • threadlist.class.php
  • login.php
  • login2ch.php
  • menu.php
  • menu_async.php
  • menu_i.php
  • menu_k.php
  • menu_side.php
  • post.php
  • post_form.php
  • read.php
  • read_async.php
  • read_copy_k.php
  • read_filter.php
  • read_filter_k.php
  • read_new.php
  • read_new_k.php
  • read_res_hist.php
  • read_rss.php
  • setting.php
  • skin
    • blackboard.php
    • classicWP.php
    • edit_user_font.tpl.html
    • flat.php
    • flat2.php
    • metal.php
    • tangerine.php
  • spm_k.php
  • style
    • edit_conf_user_css.inc
    • editfavita_css.inc
    • editpref_css.inc
    • fitimage_css.inc
    • info_css.inc
    • iv2_css.inc
    • login2ch_css.inc
    • login_css.inc
    • login_first_css.inc
    • menu_css.inc
    • mona_css.inc
    • mystyle_css.php
    • post_css.inc
    • prvw_css.inc
    • read_css.inc
    • setting_css.inc
    • style_css.inc
    • subject_css.inc
  • subject.php
  • subject_new.php
  • subject_rss.php
  • tgrepc.php
  • tgrepctl.php
  • title.php
  • tripper.php
  • viewtxt.php

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎aas.php‎

Copy file name to clipboardExpand all lines: aas.php
+48-26Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?php
2-
/* vim: set fileencoding=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: */
3-
/* mi: charset=Shift_JIS */
42
/**
53
* Ascii Art Scope for rep2
64
*
@@ -37,19 +35,19 @@
3735

3836
// {{{ p2基本設定読み込み&認証
3937

40-
require_once 'conf/conf.inc.php';
38+
require_once './conf/conf.inc.php';
4139

4240
$_login->authorize();
4341

4442
if (!$_conf['expack.aas.enabled']) {
45-
exit('<html><body><p>AASは無効です。<br>conf/conf_admin_ex.inc.php の設定を変えてください。</p></body></html>');
43+
p2die('AASは無効です。', 'conf/conf_admin_ex.inc.php の設定を変えてください。');
4644
}
4745

4846
// }}}
4947
// {{{ 設定
5048

5149
// このファイルの文字コード
52-
define('AAS_SCRIPT_CHARSET', 'SJIS-win');
50+
define('AAS_SCRIPT_CHARSET', 'CP932');
5351

5452
// HTML→プレーンテキスト変換処理の文字コード
5553
define('AAS_INTERNAL_CHARSET', 'UTF-8');
@@ -218,8 +216,8 @@
218216

219217
// レス読み込み
220218
if (empty($errors) && $_SERVER['REQUEST_METHOD'] != 'POST') {
221-
require_once P2_LIB_DIR . '/threadread.class.php';
222-
$aThread = &new ThreadRead;
219+
require_once P2_LIB_DIR . '/ThreadRead.php';
220+
$aThread = new ThreadRead;
223221
$aThread->setThreadPathInfo($host, $bbs, $key);
224222
if (!$aThread->readDat()) {
225223
$errors[] = 'datが読み込めませんでした。';
@@ -257,7 +255,7 @@
257255
// {{{ メイン処理
258256

259257
// 文字コード変換
260-
$text = mb_convert_encoding($text, AAS_INTERNAL_CHARSET, 'SJIS-win');
258+
$text = mb_convert_encoding($text, AAS_INTERNAL_CHARSET, 'CP932');
261259

262260
// 制御文字以外をすべて数値文字参照に変換
263261
$regex = '/&(\\w+|#x([[:xdigit:]]{1,4}))(;|\\b)/';
@@ -276,11 +274,7 @@
276274
$text = mb_convert_encoding($text, $_conf['expack.aas.output_charset'], AAS_INTERNAL_CHARSET);
277275
*/
278276
// エラーハンドラを設定
279-
/*if (version_compare(phpversion(), '5.0.0', '>')) {
280-
set_error_handler('aas_ttfErrorHandler', E_WARNING);
281-
} else {
282-
set_error_handler('aas_ttfErrorHandler');
283-
}*/
277+
//set_error_handler('aas_ttfErrorHandler', E_WARNING);
284278

285279
// 元のテキストの文字数が多いとエラーになるので
286280
// テキストボックスの大きさ判定用の文字列を作成
@@ -391,8 +385,7 @@
391385
// Bug #24155 (gdImageRotate270 rotation problem).
392386
//$new_image = imagerotate(imagerotate($image, 180, $bgcolor), 90, $bgcolor);
393387
imagedestroy($image);
394-
unset($image);
395-
$image = &$new_image;
388+
$image = $new_image;
396389
}
397390

398391
// エラーハンドラを戻す
@@ -420,6 +413,7 @@
420413

421414
// }}}
422415
// {{{ 関数
416+
// {{{ aas_toNumericEntity()
423417

424418
/**
425419
* 実体参照・と16進数の数値参照を10真数の数値参照に変換する
@@ -458,6 +452,9 @@ function aas_toNumericEntity($e)
458452
return $_conf['expack.aas.unknown_char'];
459453
}
460454

455+
// }}}
456+
// {{{ aas_decodeHTMLEntity()
457+
461458
/**
462459
* 実体参照・数値参照をデコードする
463460
*
@@ -503,6 +500,9 @@ function aas_decodeHTMLEntity($e)
503500
return $_conf['expack.aas.unknown_char'];
504501
}
505502

503+
// }}}
504+
// {{{ aas_getTextBoxSize()
505+
506506
/**
507507
* テキストボックスの大きさを計算する
508508
*/
@@ -516,6 +516,9 @@ function aas_getTextBoxSize($size, $font, $hint, $lines)
516516
return array($box_width, $box_height);
517517
}
518518

519+
// }}}
520+
// {{{ aas_isTextInPicture()
521+
519522
/**
520523
* テキストが画像に収まり切るかチェックする
521524
*/
@@ -528,28 +531,35 @@ function aas_isTextInPicture($size, $font, $hint, $lines, $max_width, $max_heigh
528531
return true;
529532
}
530533

534+
// }}}
535+
// {{{ aas_parseColor()
536+
531537
/**
532538
* 3桁または6桁の16進数表記の色指定を array(int, int, int) に変換して返す
533539
*/
534540
function aas_parseColor($hex)
535541
{
536-
if (!preg_match('/^#?([[:xdigit:]]{3}|[[:xdigit:]]{6})$/', $hex)) {
542+
if (!preg_match('/^#?(?:[[:xdigit:]]{3}|[[:xdigit:]]{6})$/', $hex)) {
537543
return false;
538544
}
539-
if ($hex{0} == '#') {
540-
$hex = substr($hex, 1);
545+
if ($hex[0] == '#') {
546+
$dec = hexdec(substr($hex, 1));
547+
} else {
548+
$dec = hexdec($hex);
541549
}
542-
if (strlen($hex) == 3) {
543-
$r = hexdec($hex{0});
544-
$g = hexdec($hex{1});
545-
$b = hexdec($hex{2});
546-
return array($r * 16 + $r, $g * 16 + $g, $b * 16 + $b);
550+
if (strlen($hex) < 6) {
551+
$r = ($dec & 0xf00) >> 8;
552+
$g = ($dec & 0xf0) >> 4;
553+
$b = $dec & 0xf;
554+
return array(($r << 4) | $r, ($g << 4) | $g, ($b << 4) | $b);
555+
} else {
556+
return array(($dec & 0xff0000) >> 16, ($dec & 0xff00) >> 8, $dec & 0xff);
547557
}
548-
preg_match('/(..)(..)(..)/', $hex, $colors);
549-
array_shift($colors);
550-
return array_map('hexdec', $colors);
551558
}
552559

560+
// }}}
561+
// {{{ aas_ttfErrorHandler()
562+
553563
/**
554564
* imagettftext(), imagettfbbox() の入力文字列が大きすぎたときのエラー処理
555565
*/
@@ -569,3 +579,15 @@ function aas_ttfErrorHandler($errno, $errstr, $errfile, $errline)
569579
}
570580

571581
// }}}
582+
// }}}
583+
584+
/*
585+
* Local Variables:
586+
* mode: php
587+
* coding: cp932
588+
* tab-width: 4
589+
* c-basic-offset: 4
590+
* indent-tabs-mode: nil
591+
* End:
592+
*/
593+
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:
Collapse file

‎cli/.htaccess‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Order allow,deny
2+
Deny from all
Collapse file

‎cli/P2CommandRunner.php‎

Copy file name to clipboard
+111Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?php
2+
/**
3+
* rep2expack - command runner
4+
*/
5+
6+
// {{{ CONSTANTS
7+
8+
if (!defined('P2_CLI_DIR')) {
9+
define('P2_CLI_DIR', dirname(__FILE__));
10+
}
11+
12+
// }}}
13+
// {{{ P2CommandRunner
14+
15+
/**
16+
* コマンドラインツールを走らせるユーティリティクラス
17+
*
18+
* @static
19+
*/
20+
class P2CommandRunner
21+
{
22+
// {{{ fetchSubjectTxt()
23+
24+
/**
25+
* subject.txtの並列ダウンロードを実行する
26+
*
27+
* @param string $mode
28+
* @param array $_conf
29+
* @return bool
30+
*/
31+
static public function fetchSubjectTxt($mode, array $_conf)
32+
{
33+
// コマンド生成
34+
$args = array(escapeshellarg($_conf['expack.php_cli_path']));
35+
if ($_conf['expack.dl_pecl_http']) {
36+
$args[] = '-d';
37+
$args[] = 'extension=' . escapeshellarg('http.' . PHP_SHLIB_SUFFIX);
38+
}
39+
$args[] = escapeshellarg(P2_CLI_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php');
40+
41+
switch ($mode) {
42+
case 'fav':
43+
case 'recent':
44+
case 'res_hist':
45+
case 'merge_favita':
46+
$args[] = sprintf('--mode=%s', $mode);
47+
break;
48+
default:
49+
return false;
50+
}
51+
52+
if ($_conf['expack.misc.multi_favs']) {
53+
switch ($mode) {
54+
case 'fav':
55+
$args[] = sprintf('--set=%d', $_conf['m_favlist_set']);
56+
break;
57+
case 'merge_favita':
58+
$args[] = sprintf('--set=%d', $_conf['m_favita_set']);
59+
break;
60+
}
61+
}
62+
63+
// 標準エラー出力を標準出力にリダイレクト
64+
$args[] = '2>&1';
65+
66+
$command = implode(' ', $args);
67+
68+
//$GLOBALS['_info_msg_ht'] .= '<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>';
69+
70+
// 実行
71+
$pipe = popen($command, 'r');
72+
if (!is_resource($pipe)) {
73+
p2die('コマンドを実行できませんでした。', $command);
74+
}
75+
76+
$output = '';
77+
while (!feof($pipe)) {
78+
$output .= fgets($pipe);
79+
}
80+
81+
$status = pclose($pipe);
82+
if ($status != 0) {
83+
$GLOBALS['_info_msg_ht'] .= sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status);
84+
}
85+
86+
if ($output !== '') {
87+
if ($status == 2) {
88+
$GLOBALS['_info_msg_ht'] .= $output;
89+
} else {
90+
$GLOBALS['_info_msg_ht'] .= '<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>';
91+
}
92+
}
93+
94+
return ($status == 0);
95+
}
96+
97+
// }}}
98+
}
99+
100+
// }}}
101+
102+
/*
103+
* Local Variables:
104+
* mode: php
105+
* coding: cp932
106+
* tab-width: 4
107+
* c-basic-offset: 4
108+
* indent-tabs-mode: nil
109+
* End:
110+
*/
111+
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.