
{"id":319,"date":"2009-01-08T21:39:39","date_gmt":"2009-01-08T20:39:39","guid":{"rendered":"http:\/\/www.geas.de\/test\/?page_id=319"},"modified":"2018-05-24T21:55:36","modified_gmt":"2018-05-24T19:55:36","slug":"help-files","status":"publish","type":"page","link":"https:\/\/www.geas.de\/?page_id=319","title":{"rendered":"Help Files"},"content":{"rendered":"<p>not working, yet<br \/>\n<!--\n<?php\n\n$query_s = $_SERVER['QUERY_STRING'];\n$query_s = urldecode(rawurldecode($query_s));\n\nif (count($args = explode(\"help=\",$query_s)) > 1)\n{\n    $args = explode(\"\/\",$args[count($args)-1]);\n    $help = $args[count($args)-1];\n}\n\n$path = '\/var\/geas\/dgd\/mud\/d\/System\/doc\/help\/general\/';\n\nif (!isset($help))\n{\n    $lines = get_dirlist($path);\n    $text  = '';\n    $index = 0;\n    \n    foreach ($lines as $line_num => $line)\n    {\n        global $text, $index;\n    \n        if (strlen($line) < strlen($path)+2)\n            continue;\n    \n        $fname = substr($line,strlen($path)+2);\n    \n        if ($text == '')\n        {\n            $text = '\n\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" valign=\"top\" width=\"100%\">';\n        }\n    \n        if ($index == 0)\n        {\n           $text = $text.'<TR>';\n        }\n    \n        $text = $text.'\n\n<td><a href=\"?page_id=319&help='.$fname.'\">'.$fname.'<\/a><\/td>\n\n';\n    \n        if ($index == 3)\n        {\n            $text  = $text.'<\/TR>';\n            $index = 0;\n            continue;\n        }\n    \n        $index++;\n    }\n    \n    $text = 'In the game you can access these help-pages by typing:<br \/>\"help &lt;filename&gt;\" - for example: \"help aid\"<br \/>'.$text.'<\/table>\n\n';\n}\nelse\n{\n    $text = '<br \/>';\n    \n    if (is_file($path.$help))\n        $l = file ($path.$help);\n    \n    $ind  = 0;\n    \n    if (count($l)>0)\n    {\n        while (strlen($l[count($l)-1]) < 2)\n            unset ($l[count($l)-1]);\n    \n        foreach ($l as $l_n=> $ll)\n        {\n            $pieces = explode (\"<\", $ll);\n    \n            if (count($pieces)>1)\n                $ll = implode(\"&#60;\",$pieces);\n    \n            $pieces = explode (\">\", $ll);\n    \n            if (count($pieces) $gt; 1)\n                $ll = implode(\"&#62;\",$pieces);\n    \n            $key = stristr($ll,\"NAME\");\n    \n            if (strstr($ll,\"NAME\") || strstr($ll,\"NOTA BENE\") || strstr($ll,\"SYNOPSIS\") ||\n                strstr($ll,\"EXAMPLE\") || strstr($ll,\"SEE ALSO\") || strstr($ll,\"NOTE\") ||\n                strstr($ll,\"DESCRIPTION\") || strstr($ll,\"OPTIONS\"))\n            {\n                $text = $text.'<B>'.$ll.'<\/B>';\n    \n                if (strstr($ll,\"SEE ALSO\"))\n                    $ind = 1;\n            }\n            else if ($ind == 1)\n            {\n                $pieces = explode (\",\", $ll);\n                $ll = implode(\"\",$pieces);\n                $pieces = explode (\" \", $ll);\n    \n                foreach ($pieces as $l_x=> $p)\n                {\n                    if ($p == '')\n                    {\n                        $text = $text.\" \";\n                        continue;\n                    }\n    \n                    if ($pieces[count($pieces)-1] == $p)\n                        $text = $text.'<a href=\"?page_id=319&help='.$p.'\">'.$p.'<\/a>';\n                    else\n                        $text = $text.'<a href=\"?page_id=319&help='.$p.'\">'.$p.'<\/a>, ';\n                }\n            }\n            else\n                $text = $text.$ll;\n        }\n        \n        $text = '\n\n<pre>'.$text.'<\/pre>\n\n';\n    }\n}\n\n\necho $text; \n\n\nfunction get_dirlist($start_dir)\n{\n    exec(\"ls -R $start_dir\/\",$f_list);\n    $dir_str = $start_dir;\n    $filelist[0] = $start_dir;\n    $i = 1;\n    \n    for ($count=0; $count<count($f_list); $count++)\n    {\n        if ($f_list[$count] == \"\")\n            continue;\n    \n        if (substr($f_list[$count],strlen($f_list[$count])-1,1) == \":\")\n        {\n            $dir_str = substr($f_list[$count],0,strlen($f_list[$count])-1);\n            $filelist[$i] = $dir_str;\n            $i++;\n        }\n        else\n        {\n            $file_str = \"$dir_str\/$f_list[$count]\";\n    \n            if (is_file($file_str))\n            {\n                $filelist[$i] = $file_str;\n                $i++;\n            }\n        }\n    }\n    \n    return $filelist;\n}\n\n?>\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>not working, yet<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":168,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/pages\/319"}],"collection":[{"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geas.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":36,"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions\/787"}],"up":[{"embeddable":true,"href":"https:\/\/www.geas.de\/index.php?rest_route=\/wp\/v2\/pages\/168"}],"wp:attachment":[{"href":"https:\/\/www.geas.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}