vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   calling mysql fields into a .php webpage (https://vborg.vbsupport.ru/showthread.php?t=138288)

Murty 02-02-2007 10:24 PM

calling mysql fields into a .php webpage
 
Hey guys,
I currently am customizing my forum a fair bit.
And i have got stuck on this problem.

Situation:
I have created a .php document that displays a youtube video and it works fine.

What I want:
I want this .php document to display a users youtube video, so i need to get the field from the database and make it so the .php document can call it and use the link from it to display the video.

The server is called: 'localhost'
The database is called 'db_vbulletin'
The table is called 'userfield'
The field is called 'field39'

But saying this, the youtube video link will be different between users, so im not sure what kind of factor that would have.

If i am posting in the wrong place or there is a better forum, please direct me.
Thanks.

Murty

Bump

Murty 02-04-2007 12:11 PM

Bump

Antivirus 02-04-2007 10:45 PM

Hi murty, If the youtube url is stored in a custom profile field within vbulletin, you should just be able to call the url with $vbulletin->userinfo['field39'] in your template as the url like:

<a href="$vbulletin->userinfo['field39']>youtube link</a>

Murty 02-05-2007 12:25 AM

Thanks for the reply antivirus.
But i just tried your idea, and it comes up with this first:

Quote:

userinfo['field39']>youtube link
When i click on that, it comes up with this:

Quote:

Not Found
The requested URL /forum/$vbulletin- was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Any ideas?

Kirk Y 02-05-2007 02:07 AM

If you're using this in a template:
Code:

$bbuserinfo[field39]
If you're using this in Plugins:
Code:

$vbulletin->userinfo['field39']

Murty 02-05-2007 02:42 AM

Yeah, but im not using a plugin. I'm using a .php file in the forum root.

Kirk Y 02-05-2007 05:12 PM

If you've included global.php then the Plugin code I posted above should work.

Murty 02-05-2007 08:27 PM

What do you mean, 'included global.php'?

Kirk Y 02-06-2007 12:11 AM

Code:

require_once('./global.php');

Murty 02-06-2007 04:34 AM

hmm, not sure how this is meant to work, but it hasnt so...

Bump


All times are GMT. The time now is 06:45 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.01110 seconds
  • Memory Usage 1,726KB
  • 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)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete