vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   New User CP page (https://vborg.vbsupport.ru/showthread.php?t=218811)

Ldoppea 07-17-2009 12:41 PM

New User CP page
 
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 01:21 PM

You may create your own vb page (see this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.) and then add a link in the UserCP to connect to it.

Ldoppea 07-17-2009 01: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 01: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 02:55 PM

Great! That's right!

In the USERCP_SHELL template each link is managed by the code (here is the Customize link example) :

HTML Code:

<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 03: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 03: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...r_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 04:07 PM

Quote:

Originally Posted by Ldoppea (Post 1850623)
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 04:26 PM

Thanks ;)


All times are GMT. The time now is 08:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01907 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete