View Full Version : New User CP page
Ldoppea
07-17-2009, 01:41 PM
Hi,
Is it possible to add a custom page to the User CP?
For exemple, in the "Settings & Options" tab, I want to add a "Edit Localisation" link.
And in the Edit Localisation section, I want to use my own php script wich display a google map instead of simple fields.
Do you know how to do this?
Thanks
Lynne
07-17-2009, 02:21 PM
You may create your own vb page (see this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)) and then add a link in the UserCP to connect to it.
Ldoppea
07-17-2009, 02:41 PM
Thanks for your answer.
So I don't know neither how to add a link in the UserCP nor how to add the sided panel "Control Panel" to a custom page :/
Lynne
07-17-2009, 02:54 PM
I think the control panel is just a 'shell' (USERCP_SHELL template) and so all you need to do is create the stuff to go into the right side column. You would eval that first and then spit out the shell. You should take a look at the code to do some of the other links in there. I think the links are also in the USERCP_SHELL.
Ldoppea
07-17-2009, 03:55 PM
Great! That's right!
In the USERCP_SHELL template each link is managed by the code (here is the Customize link example) :
<if condition="$show['customizelink']">
<tr><td class="$navclass[customize]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=customize">$vbphrase[customize_profile]</a></td></tr>
</if>
For my custom page, I delete the "if" condition (I don't know how to use the $show variable and, fortunately, I want to display this link for all members), I change the href and the do= variable. For the $vbphrase I create a custome vbPhrase.
It's no important but do you know how to use the $show variable?
Now I'll try to create my custom page :)
jacko_162
07-17-2009, 04:06 PM
let us know how you get on, i would also love to show peoples location on USERCP page via a google map :)
Ldoppea
07-17-2009, 04:45 PM
Hi Jacko,
I try to convert my Map page to use it in vBulletin. If possible I'll try to make a module, but I don't know if I'll succeed.
Actually, I use it in a SMF forum : http://www.zbrush.fr/ZBPortail/index.php?page=P&F=Dop_User_Map/User_Map .
In order to make a module, or a product (I don't know the difference), I had to generalize the code. Many parameters like personalized Markers or categories (freelance, pro, student etc) are specifics to ZBrush and are fixed in the code.
Lynne
07-17-2009, 05:07 PM
It's no important but do you know how to use the $show variable?
$show['whatever'] is simply a variable defined in the php code. They do the condition in the php and then set $show['whatever'] to true is the condition is met. So, instead of checking if the person is allowed to see the link by doing some condition on their permissions in the template, they do it in the php code and then set the $show variable based on that. So, if you think you may want to use it later, just put $show['yourvariablename'] equal to true in your php code and then use the conditional around your link in the USERCP_SHELL.
Ldoppea
07-17-2009, 05:26 PM
Thanks ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.