vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Making url with info from profile field (https://vborg.vbsupport.ru/showthread.php?t=141117)

Freezerator 03-04-2007 02:25 PM

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?

Zachariah 03-04-2007 02:39 PM

What page do you want to show this on ?

Brent H 03-04-2007 08:13 PM

I've been trying to do this same thing.

I'd want to to show up in the postbit and the profile page.

MarkPW 03-04-2007 10:25 PM

In postbit you use: $post[]. I'm not sure about the profile page (for custom fields). I think it's either $userinfo[] or $profilefield[].

Brent H 03-05-2007 12:38 PM

So I'd use http://$post[11].site.com ?

Gray Matter 03-05-2007 05:02 PM

Quote:

Originally Posted by Brent H (Post 1196207)
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

Freezerator 03-06-2007 07:44 AM

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.

MarkPW 03-06-2007 11:56 PM

Quote:

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

Should be $post[field11]

Freezerator 03-07-2007 07:00 AM

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 :)

Dismounted 03-07-2007 07:43 AM

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


All times are GMT. The time now is 08:43 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.01098 seconds
  • Memory Usage 1,735KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete