Quote:
Originally Posted by noypiscripter
The userid of the profile being viewed is not available in the $vbulletin variable. Just extract and parse it from the current profile URL.
PHP Code:
$url = $_SERVER['REQUEST_URI']; preg_match('/\/.*\/([0-9]+)\-.*/', $url, $matches); if (count($matches) > 1) { echo 'Userid: ' . $matches[1]; }
|
Nice solution.
Because profile userid is available in $vbulletin->scriptpath, my solution was:
PHP Code:
$to = strpos($vbulletin->scriptpath,"-");
$pageuserid = substr($vbulletin->scriptpath,8,($to-8));
Kind of the same way, but also differently.