Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2007, 02:25 PM
Freezerator Freezerator is offline
 
Join Date: Nov 2001
Location: Den Haag
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Making url with info from profile field

Hi Guys,

I have setup a profile field where a user can put a name in.
Then i try to creat a link with that info, say:

www.site.com/$bbuserinfo['field11']/

and then i would create a link with the info out of field11. But whatever i try, i can't seem to get it to work. Can someone give me some pointers to resolve this?
Reply With Quote
  #2  
Old 03-04-2007, 02:39 PM
Zachariah's Avatar
Zachariah Zachariah is offline
 
Join Date: Feb 2002
Location: Canoga Park, CA
Posts: 2,125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What page do you want to show this on ?
Reply With Quote
  #3  
Old 03-04-2007, 08:13 PM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been trying to do this same thing.

I'd want to to show up in the postbit and the profile page.
Reply With Quote
  #4  
Old 03-04-2007, 10:25 PM
MarkPW MarkPW is offline
 
Join Date: Apr 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In postbit you use: $post[]. I'm not sure about the profile page (for custom fields). I think it's either $userinfo[] or $profilefield[].
Reply With Quote
  #5  
Old 03-05-2007, 12:38 PM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I'd use http://$post[11].site.com ?
Reply With Quote
  #6  
Old 03-05-2007, 05:02 PM
Gray Matter Gray Matter is offline
 
Join Date: May 2005
Posts: 260
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brent H View Post
So I'd use http://$post[11].site.com ?
No, you'd need to use:

Code:
http://$post[field11].site.com
And if you wanted this to work on the member info page, you would use:

Code:
http://$userinfo[field11].site.com
Reply With Quote
  #7  
Old 03-06-2007, 07:44 AM
Freezerator Freezerator is offline
 
Join Date: Nov 2001
Location: Den Haag
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And in postbit $postbit[field11]

Ill give it a try

<a href="http://$post[field11].site.com">Sitename</a>

works

Thanks!

<!--scooterbase-->
<a href="http://www.scooterbase.net/profiles/$post[field11/">ScooterbaseID</a>

This doesn't work. I get this error:

vBulletin Message
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/forum/public_html/forum/forum/includes/adminfunctions_template.php(3596) : eval()'d code on line 54

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Reply With Quote
  #8  
Old 03-06-2007, 11:56 PM
MarkPW MarkPW is offline
 
Join Date: Apr 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Parse error:...expecting ']'
You missed an ] after $post[field11

Should be $post[field11]
Reply With Quote
  #9  
Old 03-07-2007, 07:00 AM
Freezerator Freezerator is offline
 
Join Date: Nov 2001
Location: Den Haag
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

D0h

It works now, so i share my final code to show something in the postbit, only when the field is filled in:
Code:
<if condition="!empty($post[field11])"><div><a href="http://www.site.com/profiles/$post[field11]/" TARGET="_blank">Your link text</a></div></if>
Maybe someone has also a use for this in the future
Reply With Quote
  #10  
Old 03-07-2007, 07:43 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Firstly $post['field11'] should be $post[field11] in templates.
Secondly, !empty($post[field11]) is more efficient than $post[field11] != ''.
Reply With Quote
Reply

Thread Tools
Display Modes

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:41 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.04165 seconds
  • Memory Usage 2,247KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete