public static function getDisplayUrlFromHash(&$pParamHash) { global $gBitSystem; $ret = NULL; if (BitBase::verifyId($pParamHash['blog_id'])) { if ($gBitSystem->isFeatureActive('pretty_urls_extended')) { $ret = BLOGS_PKG_URL . 'view/' . $pParamHash['blog_id']; } elseif ($gBitSystem->isFeatureActive('pretty_urls')) { $ret = BLOGS_PKG_URL . $pParamHash['blog_id']; } else { $ret = BLOGS_PKG_URL . 'view.php?blog_id=' . $pParamHash['blog_id']; } } else { $ret = parent::getDisplayUrlFromHash($pParamHash); } return $ret; }
/** * @param pLinkText name of * @param pParamHash different possibilities depending on derived class * @return the link to display the page. */ public static function getDisplayUrlFromHash(&$pParamHash) { $ret = NULL; if (@BitBase::verifyId($pParamHash['root_id']) && ($viewContent = LibertyBase::getLibertyObject($pParamHash['root_id']))) { // pass in cooment hash to the url func incase the root package needs to do something fancy $viewContent->mInfo['comment'] = $pParamHash; $ret = $viewContent->getDisplayUrl() . (@static::verifyId($pParamHash['content_id']) ? "#comment_" . $pParamHash['content_id'] : ''); } elseif (@BitBase::verifyId($pParamHash['content_id'])) { $ret = parent::getDisplayUrlFromHash($pParamHash); $ret .= "#comment_{$pParamHash['content_id']}"; } return $ret; }
/** * Generates the URL to the bitboard page * @return the link to display the page. */ public static function getDisplayUrlFromHash(&$pParamHash) { global $gBitSystem; $ret = NULL; if (!empty($pParamHash['comment']) && !empty($pParamHash['comment']['thread_forward_sequence'])) { // look up base of comment sequece which is BitBoardTopic $seq = explode(".", $pParamHash['comment']['thread_forward_sequence']); $topicRootId = (int) $seq[0]; if (BitBase::verifyId($topicRootId)) { require_once BOARDS_PKG_PATH . 'BitBoardTopic.php'; $hash = array('topic_id' => $topicRootId); $ret = BitBoardTopic::getDisplayUrlFromHash($hash); // we're out of here with our topic url return $ret; } } if (BitBase::verifyId($pParamHash['board_id'])) { if ($gBitSystem->isFeatureActive('pretty_urls') || $gBitSystem->isFeatureActive('pretty_urls_extended')) { $rewrite_tag = $gBitSystem->isFeatureActive('pretty_urls_extended') ? 'view/' : ''; $ret = BOARDS_PKG_URL . $rewrite_tag . 'board/' . $pParamHash['board_id']; } else { $ret = BOARDS_PKG_URL . "index.php?b=" . $pParamHash['board_id']; } } else { $ret = parent::getDisplayUrlFromHash($pParamHash); } return $ret; }
/** * Generates the URL to this wiki page * @param pExistsHash the hash that was returned by LibertyContent::pageExists * @return the link to display the page. */ public static function getDisplayUrlFromHash(&$pParamHash) { global $gBitSystem; if (!empty($pParamHash['title'])) { if ($gBitSystem->isFeatureActive('pretty_urls') || $gBitSystem->isFeatureActive('pretty_urls_extended')) { $rewrite_tag = $gBitSystem->isFeatureActive('pretty_urls_extended') ? 'view/' : ''; $prettyPageName = preg_replace('/ /', '+', $pParamHash['title']); $ret = WIKI_PKG_URL . $rewrite_tag . $prettyPageName; } else { $ret = WIKI_PKG_URL . 'index.php?page=' . urlencode($pParamHash['title']); } } else { $ret = parent::getDisplayUrlFromHash($pParamHash); } return $ret; }