{"id":15359765,"url":"https://github.com/redhog/uweb","last_synced_at":"2025-04-06T01:41:30.300Z","repository":{"id":7903142,"uuid":"9284309","full_name":"redhog/uWeb","owner":"redhog","description":null,"archived":false,"fork":false,"pushed_at":"2013-04-09T19:13:49.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T07:54:01.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://redhog.org/uWeb","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-07T22:26:05.000Z","updated_at":"2013-04-20T22:35:55.000Z","dependencies_parsed_at":"2022-09-07T05:50:14.264Z","dependency_job_id":null,"html_url":"https://github.com/redhog/uWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2FuWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2FuWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2FuWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2FuWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhog","download_url":"https://codeload.github.com/redhog/uWeb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423492,"owners_count":20936622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:46:13.079Z","updated_at":"2025-04-06T01:41:30.249Z","avatar_url":"https://github.com/redhog.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Short installation notes\nIf you are running PHP4, you must install the PHP_Compat Pear package:\n'pear install PHP_Compat'.\n\nInstall PostgreSQL support for PHP.\n\nYou need to edit config.php to point to the database, and load\nuweb.sql into the db. If you want example data loaded to play with\nload uweb.data.sql aswell. Otherwise, run the sql-statement\n\ninsert into account (name, password) values ('myusername', 'mypassword');\n\n\n# Using uWeb\nIf you installed uWeb in http://myserver/uWeb, go to\nhttp://myserver/uWeb/uweb.php/ and click your way from there (PHP does\nnot support PATH_INFO for index.php!).\n\n\n# Customizing uWeb\n\nuWeb uses a list of template directories defined in the config-file\nwith the $templatesdirs variable to create the design of the web-page.\nThe templates in one directory overrides templates in another listed\nafter the first one in the config-file. Example:\n\n$templatesdirs=array(\"site-templates\", \"templates\");\n\nFiles from \"site-templates\" will override files from \"templates\".\n\nYou generally want to have \"templates\" as the last item in all but\nvery strange cases, as that template provides good defaults.\n\n\n## How the templating work\n\nIt's far easier to explain this by example. For this example, we\nassume $templatesdirs=array(\"my-site\", \"my-company\", \"templates\").\n\nWhen a user enters the URL\nhttp://myserver/uWeb/uweb.php/boats/sailing-boats/wooden?action=view,\nuWeb will try to load templates for the path\n/boats/sailing-boats/wooden with action=view.\n\nThe first template loaded is a template called \"page\", and it might in\nturn load other templates, like \"menu\", \"top-banner\", \"object\" and\n\"children\".\n\nTo load the \"page\" template for /boats/sailing-boats/wooden with\naction \"view\", the following files are searched for, in the order\nbelow, and the first one found is loaded:\n\n    my-site/page/boats/sailing-boats/wooden/nonrecursive.view.php\n    my-company/page/boats/sailing-boats/wooden/nonrecursive.view.php\n    templates/page/boats/sailing-boats/wooden/nonrecursive.view.php\n\n    my-site/page/boats/sailing-boats/wooden/view.php\n    my-site/page/boats/sailing-boats/view.php\n    my-site/page/boats/view.php\n    my-site/page/view.php\n    my-company/page/boats/sailing-boats/wooden/view.php\n    my-company/page/boats/sailing-boats/view.php\n    my-company/page/boats/view.php\n    my-company/page/view.php\n    templates/page/boats/sailing-boats/wooden/view.php\n    templates/page/boats/sailing-boats/view.php\n    templates/page/boats/view.php\n    templates/page/view.php\n\n    my-site/page/boats/sailing-boats/wooden/default.php\n    my-site/page/boats/sailing-boats/default.php\n    my-site/page/boats/default.php\n    my-site/page/default.php\n    my-company/page/boats/sailing-boats/wooden/default.php\n    my-company/page/boats/sailing-boats/default.php\n    my-company/page/boats/default.php\n    my-company/page/default.php\n    templates/page/boats/sailing-boats/wooden/default.php\n    templates/page/boats/sailing-boats/default.php\n    templates/page/boats/default.php\n    templates/page/default.php\n\nNote that templates with other extensions than .php can be loaded in\nthe same manner, and that the action=view is assumed if no other\naction is specified. Other standard actions include \"edit\", \"save\",\n\"log-in\" and \"log-in-save\".\n\nTo load templates, the functions findTemplateServerPath and\nfindTemplateClientPath are used. The only difference between them is\nthat the former returns a path that you can do require() on from\nwithin PHP, while the path returned by the latter one is suitable to\ninclude in a script tag in the HTML you output.\n\nExample usages:\n\n    require(findTemplateServerPath(\"/boats/sailing-boats/wooden\", \"page\", \"view\", \"php\"));\n    echo \"\u003cscript src='\" .findTemplateClientPath(\"/boats/sailing-boats/wooden\", \"page\", \"view\", \"css\") . \"'\u003e\u003c/script\u003e\";\n\n\n### Template sets\n\nIt is sometimes usefull to load a set of templates and concatenate\nthem all. For example, such templates can provide \"boxes\" to show on\nthe side of a web-page.\n\nTemplate sets works very much like templates, except you use the\nfunctions findTemplateSetServerPath and findTemplateSetClientPath\ninstaed of findTemplateServerPath and findTemplateClientPath, and\nthese functions return an array of template files instaed of a single\nfile.\n\nWhil the template functions search for templates directly under e.g.\nmy-company/page, the template set functions does a directory listing\nunder each \"template\" director, and searches for templates in all of\nthose.\n\nExample:\n\n    findTemplateSetServerPath(\"/boats/sailing-boats/wooden\", \"boxes\", \"view\", \"php\")\n\nwill list the directories under\n\n    my-site/boxes\n    my-company/boxes\n    templates/boxes\n\nsay that the directories found are\n\n    my-site/boxes/ticker\n    my-site/boxes/search\n    my-company/boxes/ticker\n    templates/boxes/search\n    templates/boxes/info\n\nthen the return value of the above call will be\n\n    array(\n     findTemplateServerPath(\"/boats/sailing-boats/wooden\", \"boxes/ticker\", \"view\", \"php\"),\n     findTemplateServerPath(\"/boats/sailing-boats/wooden\", \"boxes/search\", \"view\", \"php\"),\n     findTemplateServerPath(\"/boats/sailing-boats/wooden\", \"boxes/info\", \"view\", \"php\"))\n\n\n## Objects\n\nBest explanation is to see any template that deals with objects\n(\"object\" and \"children\"). There is one \"big\" function that might\ndeserve an explanation here though, getObjects.\n\ngetObjects is used both to list/search for objects, and to get their\nproperties.\n\nIt takes the following parameters:\n\n * $path The path under which to perform the search, such as /boats/sailing-boats/wooden\n\n * $relation Specifies how $path is interpreted:\n   * 0 means return the object specified by $path\n   * 1 means return all children of the object specified by $path\n   * 2 means return all descendants of the object specified by $path\n\n * $requires Restricts objects returned to ones having some specific properties set. E.g. to only return objects that are both visible and have the title \"Blurb\", set $requires to array(\"Visible =\u003e \"yes\", \"Title\" =\u003e \"Blurb\").\n\n *$properties List of properties to include in the output, or NULL to include all properties.\n\nThe return value is easies explained by an example (again):\n\n    array(\n     4711 =\u003e array('paths' =\u003e array('/boats/sailing-boats/wooden/sskaukasus', '/boats/large/sskaukasus'),\n                   'properties' =\u003e array('Visible' =\u003e 'yes',\n                                         'Title' =\u003e 'S/S Kaukasus',\n                                         'Body' =\u003e 'S/S Kaukasus is one of our fines wooden +12m long boats with a total of 60m^s sail area.'))\n     4712 =\u003e array('paths' =\u003e array('/boats/sailing-boats/metal/ssmaria', '/boats/small/ssmaria'),\n                   'properties' =\u003e array('Visible' =\u003e 'yes',\n                                         'Title' =\u003e 'S/S Maria',\n                                         'Body' =\u003e 'S/S Maria is a 6m long easy-sailed boat perfect for the first-timer')))\n\n(here 4711 and 4712 are the object identifiers of the objects. You\nwill usually not use these numbers, but the paths to the objects, e.g.\n/boats/sailing-boats/wooden/sskaukasus or /boats/small/ssmaria).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fuweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhog%2Fuweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fuweb/lists"}