本文整理汇总了PHP中ewiki_db::GETALL方法的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_db::GETALL方法的具体用法?PHP ewiki_db::GETALL怎么用?PHP ewiki_db::GETALL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ewiki_db
的用法示例。
在下文中一共展示了ewiki_db::GETALL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ewiki_page_since_updates
function ewiki_page_since_updates($id = 0, $data = 0)
{
$orderby = "lastmodified";
$asc = -1;
$print = "%02dT %02dH %02dM %02dS";
$title = "Aktualisierung seit";
$sorted = array();
$result = ewiki_db::GETALL(array($orderby, "flags", "version"));
while ($row = $result->get()) {
if (EWIKI_DB_F_TEXT == ($row["flags"] & EWIKI_DB_F_TYPE)) {
$sorted[$row["id"]] = $row[$orderby];
}
}
if ($asc != 0) {
arsort($sorted);
} else {
asort($sorted);
}
foreach ($sorted as $name => $value) {
$x = time() - $value;
$dy = (int) ($x / 86400);
$hr = (int) ($x % 86400 / 3600);
$mn = (int) ($x % 86400 % 3600 / 60);
$se = $x % 86400 % 3600 % 60;
$sorted[$name] = sprintf($print, $dy, $hr, $mn, $se);
}
$o .= ewiki_list_pages($sorted);
return $o;
}
示例2: PROPFIND
function PROPFIND($path, $props)
{
#-- page name, prep
$id = $this->id($path);
$files = array();
#-- list pages
if (!strlen($id) || $id == "/") {
$oldest_time = 2 * UNIX_MILLENNIUM;
$result = ewiki_db::GETALL(array());
while ($data = $result->get(1, 0x137f)) {
if ($this->depth >= WEBDAV_DIR_DEPTH) {
$files[] = $this->fileinfo($data);
}
$oldest_time = min($oldest_time, $data["created"]);
}
#-- add entry for virtual root directory
$data = array("id" => "/", "created" => $oldest_time);
$files[] = $this->dirinfo($data);
} else {
$version = NULL;
$data = ewiki_db::GET($id, $version);
if ($data) {
$files[] = $this->fileinfo($data);
}
}
#-- fin
return $files;
}
示例3: ewiki_page_wiki_mini_tarball_dump
function ewiki_page_wiki_mini_tarball_dump($id, $data, $action)
{
global $ewiki_config, $ewiki_plugins;
#-- get all pages / binary files
$result = ewiki_db::GETALL(array("id", "version", "flags"));
if ($result) {
#-- HTTP headers
header("Content-Type: application/x-tar");
header("Content-Disposition: attachment; filename=\"InitPages.tar.gz\"");
#-- start tar file
$tarball = new ewiki_virtual_tarball();
$tarball->open(0);
#-- convert all pages
while ($row = $result->get(0, 0x1037)) {
$id = $row["id"];
$row = ewiki_db::GET($id);
$content =& $row["content"];
$fn = $id;
if (!$row || !$row["id"] || !$row["content"]) {
continue;
}
#-- for tarball
$perms = array("mtime" => $row["lastmodified"], "uname" => "ewiki", "mode" => 0664 | ($row["flags"] & EWIKI_DB_F_WRITEABLE ? 02 : 00));
#-- add file
$tarball->add($fn, $content, $perms);
}
#-- end output
$tarball->close();
}
#-- fin
die;
}
示例4: ewiki_page_recentchanges
function ewiki_page_recentchanges($recentchanges, $data, $action)
{
global $ewiki_plugins, $ewiki_links;
#-- start output
$ewiki_links = true;
$o = "";
$o .= ewiki_make_title($recentchanges, $recentchanges, 2);
#-- options
$minor_edits = $_GET["minor"] ? 1 : 0;
#-- select timeframe
if (($days = $_REQUEST["days"]) < 1) {
$days = 7;
}
$timeframe = time() - $days * 24 * 3600;
#-- fetch pages modified in given timeframe
$result = ewiki_db::GETALL(array("meta", "lastmodified", "author"));
$changes = array();
$meta = array();
while ($row = $result->get(0, 0x137, EWIKI_DB_F_TEXT)) {
if ($row["lastmodified"] >= $timeframe) {
#-- id->time array
$id = $row["id"];
$changes[$id] = $row["lastmodified"];
#-- collect also info for previous changes of current page
$meta[$id] = array();
ewiki_page_rc_more($row, $meta[$id], $timeframe, $minor_edits);
}
}
#-- sort results into date catalogue
arsort($changes);
$last_date = "";
$datestr = ewiki_t("DAY");
$e = array();
foreach ($changes as $id => $date) {
$date = strftime($datestr, $date);
if ($date != $last_date) {
$last_date = $date;
}
$e[$date][] = $id;
unset($changes[$id]);
}
#-- mk output
$o .= $ewiki_plugins["rc"][0]($e, $meta);
#-- add an <form>
if ($days == 7) {
$days = 30;
}
$url = ewiki_script("", $recentchanges);
$o .= ewiki_t(<<<EOT
<br />
<form action="{$url}" method="GET">
<input type="hidden" name="id" value="{$recentchanges}">
_{show last} <input type="text" name="days" value="{$days}" size="5">
<input type="submit" value="_{days}">
</form>
<br />
EOT
);
return $o;
}
示例5: ewiki_page_wantedpages
function ewiki_page_wantedpages($id, $data, $action)
{
#-- collect referenced pages
$result = ewiki_db::GETALL(array("refs"));
while ($row = $result->get()) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
$refs .= $row["refs"];
}
#-- build array
$refs = array_unique(explode("\n", $refs));
#-- strip existing pages from array
$refs = ewiki_db::FIND($refs);
foreach ($refs as $id => $exists) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
$wanted[] = $id;
}
}
#-- print out
$o .= "<ul>\n";
foreach ($wanted as $page) {
$o .= " <li>" . ewiki_link($page) . "</li>\n";
}
$o .= "<ul>\n";
return $o;
}
示例6: ewiki_valid_pages
function ewiki_valid_pages($bool_allowimages = 0, $virtual_pages = 0)
{
//$time=getmicrotime();
global $ewiki_plugins;
$result = ewiki_db::GETALL(array("flags", "refs", "meta"));
while ($row = $result->get()) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $str_null, "view")) {
continue;
}
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT || ($bool_allowimages ? $row["meta"]["class"] == "image" : 0)) {
$temp_refs = explode("\n", $row["refs"]);
foreach ($temp_refs as $key => $value) {
if (empty($value)) {
unset($temp_refs[$key]);
}
}
if ($row["meta"]["class"] == "image") {
$a_validpages[$row["id"]] = $temp_array = array("refs" => $temp_refs, "type" => "image", "touched" => FALSE);
} else {
$a_validpages[$row["id"]] = $temp_array = array("refs" => $temp_refs, "type" => "page", "touched" => FALSE);
}
unset($temp_refs);
}
}
if ($virtual_pages) {
#-- include virtual pages to the sitemap.
$virtual = array_keys($ewiki_plugins["page"]);
foreach ($virtual as $vp) {
if (!EWIKI_PROTECTED_MODE || !EWIKI_PROTECTED_MODE_HIDING || ewiki_auth($vp, $str_null, "view")) {
$a_validpages[$vp] = array("refs" => array(), "type" => "page", "touched" => FALSE);
}
}
}
return $a_validpages;
}
示例7: ewiki_action_rss
function ewiki_action_rss($id, &$data, $action)
{
$list = array();
#-- recentchanges as rss
if (strtoupper($id) == "RSS") {
$res = ewiki_db::GETALL(array("id", "flags", "version", "lastmodified"));
$sort = array();
while ($data = $res->get(0, 0x137, EWIKI_DB_F_TEXT)) {
$sort[$data["id"]] = $data["lastmodified"];
}
arsort($sort);
$limit = 100;
foreach ($sort as $id => $uu) {
$list[] = ewiki_db::GET($id);
if ($limit-- < 0) {
break;
}
}
} else {
$list[] = $data;
for ($v = $data["version"] - 1; $v >= 1; $v--) {
$d = ewiki_db::GET($id, $v);
$list[] = $d;
}
}
ewiki_feed($list);
}
示例8: ewiki_page_wordindex
function ewiki_page_wordindex($id, $data, $action)
{
global $ewiki_plugins;
$o = ewiki_make_title($id, $id, 2);
$src = "";
$result = ewiki_db::GETALL(array("flags"));
while ($row = $result->get()) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
$src .= " " . $row["id"];
}
}
$src = ewiki_split_title($src, "SPLIT", 0);
$chars = strtr(EWIKI_CHARS_U . EWIKI_CHARS_L, "_", " ");
$src = preg_replace("/[^{$chars}]/", " ", $src);
$src = explode(" ", $src);
$src = array_unique($src);
//@ADD: word counting
unset($src[""]);
natcasesort($src);
$sorted = array();
foreach ($src as $i => $word) {
if (strlen($word) >= 2) {
$sorted[] = array(EWIKI_PAGE_POWERSEARCH, array("where" => "id", "q" => $word), $word, "");
}
}
unset($src);
$pf_list_pages = $ewiki_plugins["list_dict"][0];
$o .= ewiki_list_pages($sorted, $limit = 0, $vat = 1, $pf_list_pages);
return $o;
}
示例9: ewiki_edit_form_append_pageimgcntrl
function ewiki_edit_form_append_pageimgcntrl($id, $data, $action)
{
global $ewiki_config;
#-- fetch and asort images
$sorted = array();
$result = ewiki_db::GETALL(array("flags", "created", "meta"));
while ($row = $result->get()) {
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_BINARY && strpos($row['meta']['Content-Type'], 'image/') === 0) {
if (isset($ewiki_config['image-galleries'][EWIKI_PAGE_LOGOCNTRL_GALLERY])) {
foreach ($ewiki_config['image-galleries'][EWIKI_PAGE_LOGOCNTRL_GALLERY] as $field => $value) {
if ($row['meta'][$field] != $value) {
continue 2;
}
}
}
if (!EWIKI_PROTECTED_MODE || EWIKI_PROTECTED_MODE_HIDING <= 0.5 || ewiki_auth($row["id"], $uu, "binary-get")) {
$sorted[$row["id"]] = substr($row['meta']["Content-Location"] . ' (' . $row["id"] . ')', 0, 70);
//echo("adding ".$row["id"].", ".$sorted[$row["id"]]."<br />");
}
}
}
arsort($sorted);
#-- start selector
$o = '
<br /><label for="pageimagecntrl">Choose Page Image (<A href="' . ewiki_script(EWIKI_PAGE_LOGOCNTRL_GALLERY) . '">view thumbnails</A>):</label>
<select id="pageimagecntrl" name="pageimagecntrl">' . '<option value="-1" ' . (!isset($data['meta']['pageimage']) || $data['meta']['pageimage'] == '' ? ' selected="selected"' : '') . '>None</option>';
foreach ($sorted as $image => $name) {
$o .= '<option value="' . htmlentities($image) . '"' . (isset($data['meta']['pageimage']) && $image == $data['meta']['pageimage'] ? ' selected="selected"' : '') . '>' . htmlentities($name) . '</option>';
}
$o .= "</select>\n";
return $o;
}
示例10: ewiki_view_append_linktree
function ewiki_view_append_linktree($id, $data, $action)
{
global $ewiki_config;
$refs = ewiki_db::GETALL(array("refs"));
$refs = ewiki_f_parent_refs($refs);
#-- $dest
if (empty($ewiki_config["root_page"])) {
if (defined("EWIKI_LINKTREE_DEST")) {
$ewiki_config["root_page"] = EWIKI_LINKTREE_DEST;
} else {
$ewiki_config["root_page"] = EWIKI_PAGE_INDEX;
}
}
$dest =& $ewiki_config["root_page"];
$depth = 0;
$paths = array($id => $id);
$current = $id;
/*
* $paths["Current"] = "Current";
* $paths["WorldWideWeb\nWikiWikiWeb\nErfurtWiki"] = "ErfurtWiki";
*/
#-- retry until at least one $path is found
while (!in_array($dest, $paths) && $depth <= 15 && count($paths) <= 100000) {
$depth++;
#-- expand every last path entry
foreach ($paths as $pathkey => $uu) {
#-- mk subkey from pathkey
if ($p = strrpos($pathkey, "\n")) {
$lkey = substr($pathkey, $p + 1);
} else {
$lkey = $pathkey;
}
#-- append tree leafs
if ($walk = $refs[$lkey]) {
foreach ($walk as $add => $uu) {
$paths[$pathkey . "\n" . $add] = $add;
}
unset($refs[$lkey]);
}
}
}
#-- print results
foreach ($paths as $key => $name) {
$tree = array_reverse(explode("\n", $key));
$GLOBALS["ewiki_page_sections"] = array();
if ($name == $dest && count($tree) >= 2) {
$GLOBALS["ewiki_page_sections"][] = $tree[1];
if (EWIKI_LINKTREE_UL) {
$o .= ewiki_f_tree($tree, 0);
} else {
$o .= ewiki_f_tree2($tree, 0);
}
}
}
$o && ($o = "<div class=\"link-tree\">{$o}</div>\n");
return $o;
}
示例11: wikiapi_getRecentChanges
function wikiapi_getRecentChanges($since = UNIX_MILLENNIUM)
{
$r = array();
$result = ewiki_db::GETALL(array("flags", "lastmodified"));
while ($row = $result->get(0, 0x20)) {
if (EWIKI_DB_F_TEXT == ($row["flags"] & EWIKI_DB_F_TYPE)) {
if (!isset($since)) {
$r[] = $row["id"];
} elseif ($row["lastmodified"] >= $since) {
$r[] = wikiapi_pageinfo($data);
}
}
}
return $r;
}
示例12: cmd_ls
function cmd_ls($ls)
{
if (count($ls) == 1 && $ls[0] == "-l") {
cmd_ll(NULL);
} else {
$rx = preg_glob($ls);
$all = ewiki_db::GETALL(array("id"));
while ($row = $all->get()) {
if ($rx && !preg_match($rx, $row["id"])) {
continue;
}
echo $row["id"] . "\n";
}
}
}
示例13: ewiki_mpi_phpwiki_allusers
function ewiki_mpi_phpwiki_allusers($action, &$args, &$iii, &$s)
{
$authors = array();
$result = ewiki_db::GETALL(array("author"));
while ($row = $result->get()) {
if ($uu = strtok($row["author"], "(")) {
$authors[trim($uu)] = 1;
}
}
$authors = array_keys($authors);
natcasesort($authors);
foreach ($authors as $a) {
$o .= "· " . ewiki_link_regex_callback(array($a)) . "<br />\n";
}
return $o;
}
示例14: ewiki_page_random
function ewiki_page_random(&$id, &$data, $action)
{
global $ewiki_plugins;
$result = ewiki_db::GETALL(array("flags"));
while ($row = $result->get()) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
$pages[] = $row["id"];
}
}
$pages = array_merge($pages, $ewiki_plugins["page"]);
$n = rand(0, count($pages));
$id = $pages[$n];
return ewiki_page($id);
}
示例15: ewiki_sync_local
function ewiki_sync_local($func, $args = NULL)
{
switch (strtoupper(trim($func, ":"))) {
case "GET":
return ewiki_db::GET($args[0], $args[1]);
case "WRITE":
return ewiki_db::WRITE($args);
case "LIST":
$all = ewiki_db::GETALL(array("id", "version"));
$r = array();
while ($row = $all->get()) {
$r[$row["id"]] = $row["version"];
}
return $r;
default:
}
}