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 01-07-2003, 02:39 AM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default profile field

Trying to add a hidden extra profile field to my global nav bar so clients can login to their cpanel account. (See link at http://forum.hostareus.com)

Thing is not all customers will have entered their domain (not the same as their profile website address...this is an extra profile field called Domain). If they have entered a doain, I want to enter http://domainname.com/cpanel as the link. If they haven't I want to NOT display the cpanel link.

Question is, I guess, what's the best way to get that field on that global nav bar?

Aaron
Reply With Quote
  #2  
Old 01-07-2003, 10:39 AM
okrogius okrogius is offline
 
Join Date: Dec 2001
Location: USA
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if you want to display the link globally then you can make good use of the phpinclude template.

Include in it: (note: not sure if the customfieldx is the proper name)

PHP Code:
if ( empty($bbuserinfo[customfieldx]) ) {
$cpanelLogin '';
} else {
$cpanelLogin $bbuserinfo[customfieldx] . ':2082';

Then you can use $cpanelLogin in all of your templates. No code changes are needed.
Reply With Quote
  #3  
Old 01-07-2003, 12:54 PM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I follow you but customfield5 doesn't work...
Reply With Quote
  #4  
Old 01-07-2003, 01:44 PM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, figured it our...$bbuserinfo[field5]

Anyways, see http:forum.hostareus.com to see wha tI mean.

This is the code I'm using in phpinclude:
PHP Code:
if ( empty($bbuserinfo[field5]) ) {
$cpanelLogin '';
} else {
$cpanelLogin "<a class='topnav' href='http://$bbuserinfo[field5]:2082'>cPanel</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp . ':2082'";

This is a portion of the code in the header:
PHP Code:
 <!-- toplinks -->
   <
class="topnav" href="http://$cpanelLogin">cPanel</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp
   
<class="topnav" href="usercp.php?s=$session[sessionhash]">Profile</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
   <
class="topnav" href="register.php?s=$session[sessionhash]&action=signup">Register</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp
There's 2 problems here:

1) No cpanel link is supposed to be displayed if profile field 5 is blank.

2) that link is supposed to link to THEIRDOMAIN:2082. Instead it points to the page the user is on...

Any clues whats going on?
Reply With Quote
  #5  
Old 01-08-2003, 01:30 PM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

come on, anybody?
Reply With Quote
  #6  
Old 01-08-2003, 03:53 PM
okrogius okrogius is offline
 
Join Date: Dec 2001
Location: USA
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:

PHP Code:
if ( empty($bbuserinfo[field5]) ) {
$cpanelLogin '';
} else {
$cpanelLogin '<a class="topnav" href="http://' $bbuserinfo[field5] . ':2082">cPanel</a>';

And in your header template you need to have just $cpanelLogin, no <a> tags, etc.
Reply With Quote
  #7  
Old 01-09-2003, 01:43 AM
Sketch Sketch is offline
 
Join Date: Apr 2002
Location: Baltimore, Maryland
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks. It works.
Reply With Quote
  #8  
Old 01-09-2003, 10:24 AM
okrogius okrogius is offline
 
Join Date: Dec 2001
Location: USA
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OH , and not to ruin your mood of your announcements forum, this ireally a template modification, not a code hack.

Feel free to ask if you need any more help doing something with vb.
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 06:14 AM.


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.02006 seconds
  • Memory Usage 2,242KB
  • 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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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