vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Placing some vb elements into non-bv pages (https://vborg.vbsupport.ru/showthread.php?t=188443)

Chris11987 08-21-2008 05:41 AM

PHP Code:

<?php
chdir 
('./forums'); 
require_once(
'./global.php'); 
require_once(
DIR '/includes/functions_user.php');  
?>

I'm using that now, and still no luck.

Dismounted 08-21-2008 08:40 AM

Please post the complete file you are using now.

Chris11987 08-21-2008 07:10 PM

This is the entire content of the page I'm testing:

PHP Code:

<?php
    
echo '<' '?xml version="1.0" encoding="utf-8"?' '>';
    
chdir ('./forums'); 
    require_once(
'./global.php'); 
      require_once(
'./includes/functions_user.php');  
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">


// AVATAR
<?php

if ($avatarurl == '' OR !$vbulletin->options['avatarenabled'] OR ($avatarurl['hascustom'] AND !($userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canuseavatar']) AND !$userinfo['adminavatar']))
{
    
$show['avatar'] = false;
}
else
{
    
$show['avatar'] = true;
    
$userinfo['avatarsize'] = $avatarurl[1];
    
$userinfo['avatarurl'] = $avatarurl[0];

?>


Dismounted 08-22-2008 09:25 AM

You aren't actually using the fetch_avatar_url() function...

Chris11987 08-22-2008 01:57 PM

Wow, how did I miss that one line? I know I was using it originally because I was getting an error from it at one time. I must have taken it out to get rid of the error.

I put it back in on the new test file I showed you and now I get a database error:

PHP Code:

Database error in vBulletin 3.7.1:
MySQL Error   You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
Error Number  
1064 

My avatars are using my files, not my database. I double checked.

Dismounted 08-23-2008 04:33 AM

Please post the file you are using. Just saying "I put it in" doesn't really explain where.

Chris11987 08-23-2008 08:41 AM

1 Attachment(s)
There.

The url of the file is mydomainname.com/avitest.php, and the url of my forums is mydomainname.com/forums/, it that helps.

Dismounted 08-23-2008 10:02 AM

$vbulletin->userinfo is the array for the logged in user's info, not $userinfo.

Chris11987 08-23-2008 08:20 PM

I replaced the $userinfo's with $vbulletin->userinfo's and still get a blank page.

Lynne 08-23-2008 08:32 PM

I took your php page, replaced the $userinfo with $vbulletin->userinfo and I get a page that simply says:

// AVATAR

But, since you aren't using a template to spit anything out and you aren't echoing anything in your php, I would not expect any other result.

edit: I meant to add, if I add this, I get something to spit out. I'm not sure it's the best way to do this though (someone else may comment on that).
PHP Code:

 echo "<img src='/forums/" .$vbulletin->userinfo['avatarurl']. "'>"



All times are GMT. The time now is 09:39 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.01741 seconds
  • Memory Usage 1,742KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (2)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