if (!$vbseo_found) { $vbseo_found_fn = VBSEO_BASEURL; if (@is_dir($vbseo_url_) || !$vbseo_url_) { $vbseo_url_ .= 'index.' . VBSEO_VB_EXT; $vbseo_found_fn = 'index.' . VBSEO_VB_EXT; } $vbseo_root = dirname($vbseo_url_); $vbseo_file = $vbseo_found_fn; if ($vbseo_file == '') { $vbseo_file = 'index.' . VBSEO_VB_EXT; } if (@is_file($vbseo_url_) && (!$vbseo_root || $vbseo_root == '.' || @is_dir($vbseo_root) || @is_dir($vbseo_root2))) { if ($vbseo_root && @is_dir($vbseo_root)) { @chdir($vbseo_root); } vbseo_set_self($_SERVER['REQUEST_URI']); $vbseo_found = true; } else { $vbseo_root = dirname($vbseo_url_); $vbseo_root2 = basename($vbseo_root); if (file_exists($vbseo_found_fn) || file_exists($vbseo_root2 . '/' . $vbseo_found_fn)) { if (!file_exists($vbseo_found_fn)) { @chdir($vbseo_root2); $vbseo_found_fn = $vbseo_root2 . '/' . $vbseo_found_fn; } $vbseo_purl = @parse_url($_SERVER['REQUEST_URI']); if ($_POST) { $vbseo_found = true; } else { vbseo_safe_redirect($vbseo_found_fn . ($vbseo_purl['query'] ? '?' . $vbseo_purl['query'] : ''), array(), true); }
function vbseo_check_multi_urls($aformats, $vbseo_url_) { global $vbseo_found_fn, $vbseo_found; $selfurl = $selfurl_more = ''; foreach ($aformats as $fmt) { if ($vbseo_arr = vbseo_check_url_strict($fmt, $vbseo_url_)) { switch ($fmt) { case 'VBSEO_URL_GROUPS_PICTURE_IMG': if (!$selfurl) { $selfurl = 'picture.'; if (preg_match('#^(\\d+)(d\\d+)?(t)?#', $vbseo_arr['picture_id'], $atm)) { $vbseo_arr['picture_id'] = $atm[1]; } $selfurl_more = (isset($atm[3]) ? '&thumb=1&dl=' . $atm[2] : '') . '&'; } case 'VBSEO_URL_GROUPS_PIC_PAGE': case 'VBSEO_URL_GROUPS_PIC': if (!$selfurl_more) { $selfurl_more = '&do=grouppictures'; } case 'VBSEO_URL_GROUPS_PICTURE_PAGE': case 'VBSEO_URL_GROUPS_PICTURE': if (!$selfurl_more) { $selfurl_more = '&do=picture'; } case 'VBSEO_URL_GROUPS_MEMBERS_PAGE': case 'VBSEO_URL_GROUPS_MEMBERS': if (!$selfurl_more) { $selfurl_more = '&do=viewmembers'; } case 'VBSEO_URL_GROUPS_PAGE': case 'VBSEO_URL_GROUPS_HOME_PAGE': case 'VBSEO_URL_GROUPS_HOME': case 'VBSEO_URL_GROUPS': if ($vbseo_arr['group_name'] && !$vbseo_arr['group_id']) { $vbseo_arr['group_id'] = vbseo_reverse_object('group', $vbseo_arr['group_name']); } $selfurl = ($selfurl ? $selfurl : 'group.') . VBSEO_VB_EXT; $selfurl_more .= $vbseo_arr['group_id'] ? '&groupid=' . $vbseo_arr['group_id'] : ''; if ($vbseo_arr['picture_id']) { $selfurl_more .= '&pictureid=' . $vbseo_arr['picture_id']; } if ($vbseo_arr['page']) { $selfurl_more .= '&page=' . $vbseo_arr['page']; } break; case 'VBSEO_URL_TAGS_ENTRY': case 'VBSEO_URL_TAGS_ENTRYPAGE': if (VBSEO_URL_TAGS_FILTER) { $vbseo_arr['tag'] = vbseo_reverse_object('tag', $vbseo_arr['tag']); } else { $vbseo_arr['tag'] = urlencode($vbseo_arr['tag']); } $selfurl_more = '?tag=' . $vbseo_arr['tag']; if ($vbseo_arr['page']) { $selfurl_more .= '&page=' . $vbseo_arr['page']; } case 'VBSEO_URL_TAGS_HOME': $selfurl = 'tags.' . VBSEO_VB_EXT; break; } if ($selfurl) { if ($selfurl_more[0] == '&') { $selfurl_more[0] = '?'; } $selfurl .= $selfurl_more; vbseo_set_self($selfurl); $vbseo_found_fn = preg_replace('#\\?.*$#', '', $selfurl); $vbseo_found = true; return true; } } } return false; }