Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2009, 01:41 PM
Ldoppea Ldoppea is offline
 
Join Date: Apr 2009
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 07-17-2009, 02:21 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 07-17-2009, 02:41 PM
Ldoppea Ldoppea is offline
 
Join Date: Apr 2009
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 :/
Reply With Quote
  #4  
Old 07-17-2009, 02:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 07-17-2009, 03:55 PM
Ldoppea Ldoppea is offline
 
Join Date: Apr 2009
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 07-17-2009, 04:06 PM
jacko_162 jacko_162 is offline
 
Join Date: Jul 2009
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

let us know how you get on, i would also love to show peoples location on USERCP page via a google map
Reply With Quote
  #7  
Old 07-17-2009, 04:45 PM
Ldoppea Ldoppea is offline
 
Join Date: Apr 2009
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 07-17-2009, 05:07 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ldoppea View Post
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.
Reply With Quote
  #9  
Old 07-17-2009, 05:26 PM
Ldoppea Ldoppea is offline
 
Join Date: Apr 2009
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04319 seconds
  • Memory Usage 2,240KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete