vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Call 'fieldx' as a link? (https://vborg.vbsupport.ru/showthread.php?t=295302)

KevinL 02-19-2013 04:14 PM

Call 'fieldx' as a link?
 
I am trying to call a user field as a link in a custom page.

The user adds their custom link in the user field and it is used to link back to the site using the code below...


Code:

<textarea cols="16" name="textarea" onclick="this.focus();this.select()"
rows="1" style="height: 200px; overflow: hidden; width: 256px;">&lt;a
href="  [Needs to be profile field] "&gt;&lt;img border="0"  src="logo.png" /&gt;&lt;/a&gt;</textarea>

Any ideas?

kh99 02-19-2013 04:23 PM

Which template is that in? Does each user see their own link, or is it in a user's profile or post or something like that?

KevinL 02-19-2013 04:32 PM

Thanks for the reply :)

I am creating my own template/page.

Yes each user would edit their settings and change the profile field to the correct URL. Similar to this page:

http://betweennapsontheporch.net/how...-your-sidebar/

The link back would change based on the URL entered in their settings.

kh99 02-19-2013 04:38 PM

OK, so you want all users to see the link of whatever user is being displayed? How are you getting the other user information? Are you caling fetch_userinfo() or something like that?

The data will be in the userfield table, but you don't have to read it from the database yourself unless you're getting all your info directly from the db.

KevinL 02-19-2013 04:44 PM

No. I want each user [that edits the field in settings] to see their [own] link.

SO they will copy the code that is the box and paste it on their site and it will link back to their url.

kh99 02-19-2013 04:55 PM

OK, in that case try this:

Code:

<textarea cols="16" name="textarea" onclick="this.focus();this.select()"
rows="1" style="height: 200px; overflow: hidden; width: 256px;"><a
href="{vb:var bbuserinfo.fieldX}"><img border="0"  src="logo.png"  </img></a></textarea>


where you'd replace 'X' with the actual id of your profile field.

That assumes that the above code is being put in a template. If it's not then you might want to use $vbulletin->userinfo['fieldX'] as part of the html string.

KevinL 02-19-2013 05:08 PM

That works perfect. I forgot the 'vb:var'

Thank you!!


All times are GMT. The time now is 09:14 AM.

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.01046 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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