vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   profile field (https://vborg.vbsupport.ru/showthread.php?t=47456)

Sketch 01-07-2003 02:39 AM

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

okrogius 01-07-2003 10:39 AM

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.

Sketch 01-07-2003 12:54 PM

I follow you but customfield5 doesn't work... :(

Sketch 01-07-2003 01:44 PM

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?

Sketch 01-08-2003 01:30 PM

come on, anybody?

okrogius 01-08-2003 03:53 PM

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.

Sketch 01-09-2003 01:43 AM

thanks. It works. :)

okrogius 01-09-2003 10:24 AM

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.


All times are GMT. The time now is 10:00 PM.

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.01242 seconds
  • Memory Usage 1,737KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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