function plugin_referer_action() { global $vars, $referer; global $_referer_msg; // Setting: Off if (!$referer) { return array('msg' => '', 'body' => ''); } if (isset($vars['page']) && $vars['page'] != '' && is_page($vars['page'])) { $sort = empty($vars['sort']) ? '0d' : $vars['sort']; return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort)); } $pages = auth::get_existpages(TRACKBACK_DIR, '.ref'); if (empty($pages)) { return array('msg' => '', 'body' => ''); } else { $body = ''; $sort = empty($vars['sort']) ? '0d' : $vars['sort']; foreach ($pages as $page) { $body .= '<h2>' . make_pagelink($page) . '</h2>'; $body .= plugin_referer_body($page, $sort); } return array('msg' => 'referer list', 'body' => $body); } }
function plugin_referer_action() { global $vars, $referer; $qm = get_qm(); // Setting: Off if (!$referer) { return array('msg' => '', 'body' => ''); } if (isset($vars['page']) && is_page($vars['page'])) { $sort = empty($vars['sort']) ? '0d' : $vars['sort']; return array('msg' => $qm->m['plg_referer']['title'], 'body' => plugin_referer_body($vars['page'], $sort)); } $pages = get_existpages(TRACKBACK_DIR, '.ref'); if (empty($pages)) { return array('msg' => '', 'body' => ''); } else { return array('msg' => $qm->m['plg_referer']['title_list'], 'body' => page_list($pages, 'referer', FALSE)); } }
function plugin_referer_action() { global $vars, $referer; global $_referer_msg; // Setting: Off if (!$referer) { return array('msg' => '', 'body' => ''); } if (isset($vars['page']) && is_page($vars['page'])) { $sort = empty($vars['sort']) ? '0d' : $vars['sort']; return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($vars['page'], $sort)); } $pages = get_existpages(TRACKBACK_DIR, '.ref'); if (empty($pages)) { return array('msg' => '', 'body' => ''); } else { return array('msg' => 'referer list', 'body' => page_list($pages, 'referer', false)); } }
function plugin_referer_action() { global $vars, $referer, $use_pingback; global $_referer_msg; // Setting: Off if (!$referer) { return array('msg' => $_referer_msg['msg_referer'], 'body' => $_referer_msg['msg_disabled']); } $page = isset($vars['page']) ? $vars['page'] : null; $kind = isset($vars['kind']) ? $vars['kind'] : null; $max = isset($vars['max']) ? (int) $vars['max'] : -1; if (empty($page)) { return array('msg' => $_referer_msg['msg_referer'], 'body' => $_referer_msg['msg_notfound']); } if (empty($kind)) { return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => join("\n", array('<div class="tabs" role="application">' . "\n" . '<ul role="tablist">' . "\n" . '<li role="tab"><a href="' . get_cmd_uri('referer', $page, null, array('kind' => 'referer')) . '">' . $_referer_msg['msg_referer'] . '</a></li>', '<li role="tab"><a href="' . get_cmd_uri('referer', $page, null, array('kind' => 'searchkey')) . '">' . $_referer_msg['msg_searchkey'] . '</a></li>', '<li role="tab"><a href="' . get_cmd_uri('referer', $page, null, array('kind' => 'mutual')) . '">' . $_referer_msg['msg_mutual'] . '</a></li>', $use_pingback ? '<li role="tab"><a href="' . get_cmd_uri('referer', $page, null, array('kind' => 'pingback')) . '">' . $_referer_msg['msg_pingback'] . '</a></li>' : null, '</ul>', '</div>'))); } $wiki = Factory::Wiki($page); if ($wiki->isValied() && $wiki->isReadable()) { if ($kind === 'pingback') { return array('msg' => sprintf($_referer_msg['msg_pingback_title'], $page), 'body' => plugin_referer_pingback($page)); } $data = Factory::Referer($page)->get(); if (!isset($data)) { return '<p class="alert alert-warning">' . $_referer_msg['msg_no_data'] . '</p>'; } switch ($kind) { case 'skeylist': // searchkeylist.inc.phpのなごり // searchkeylist.inc.phpのなごり case 'searchkey': return array('msg' => sprintf($_referer_msg['msg_searchkey_title'], $page), 'body' => plugin_referer_searchkeylist($data, $max)); break; case 'linklist': // linklist.inc.phpのなごり // linklist.inc.phpのなごり case 'mutual': return array('msg' => sprintf($_referer_msg['msg_mutual_title'], $page), 'body' => plugin_referer_mutual($data, $max)); break; case 'referer': return array('msg' => $_referer_msg['msg_H0_Refer'], 'body' => plugin_referer_body($data)); break; default: return array('msg' => $_referer_msg['msg_referer'], 'body' => plugin_referer_body($data)); break; } } $pages = Auth::get_existpages(REFERER_DIR, '.ref'); if (empty($pages)) { return array('msg' => $_referer_msg['msg_referer'], 'body' => $_referer_msg['msg_notfound']); } else { return array('msg' => $_referer_msg['msg_referer_list'], 'body' => page_list($pages, 'referer', FALSE)); } }