vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=327067

Userid in PHP-Module
by BulliM
01 Feb 2019 10:24

I've extended user profile site with a PHP-Module, which includes a php file. In this file I need to compare two variables.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

First variable is userid from user, who visits the profile. Second is whos profile you watch.

In my script, second variable is empty. How can I get access to user profiles userid in my included PHP-Script?

--------------- Added 01 Feb 2019 at 18:05 ---------------

Frustrating.

noypiscripter 03 Feb 2019 06:09

The userid of the profile being viewed is not available in the $vbulletin variable. Just extract and parse it from the current profile URL.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


BulliM 03 Feb 2019 08:17

Quote:

Originally Posted by noypiscripter (Post 2598351)
The userid of the profile being viewed is not available in the $vbulletin variable. Just extract and parse it from the current profile URL.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Nice solution.

Because profile userid is available in $vbulletin->scriptpath, my solution was:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Kind of the same way, but also differently.

noypiscripter 03 Feb 2019 19:14

What does scriptpath return? Can you give an example?

BulliM 03 Feb 2019 19:27

Quote:

Originally Posted by noypiscripter (Post 2598365)
What does scriptpath return? Can you give an example?

/member/123-username


All times are GMT. The time now is 18:45.

Powered by vBulletin® Version 3.8.14
Copyright © 2022, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.