![]() |
Placing some vb elements into non-bv pages
Can someone tell me what I would need to do to let certain elements of the forums (like PM total, username/login, avatar etc) appear on a custom, non-vb page (and not in the forums directory)? All I found so far was an article about creating vb-powered pages using templates, which isn't what I'm looking for.
|
You can use the same article and just not use the template system.
|
<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>
That was the article I mentioned. It seems as if the page itself is being ran by vbulletin, though. |
As long as you inclide global.php you can use any php script, or just use the example in the above thread and remove calling the templates etc.
|
Hi,
how would iuse a require fuction on the vb powered page? <?php "staff/request.php"; ?> thats what im using, but its not displaying :( |
Please start your a new thread describing your problem.
|
Everytime I use include or require_once, for the global.php file, it results in a fatal error and is unable to load the page.
|
Without knowing the code you are now using or the error message you get, we can't give more assistence.
|
Warning: require_once (*********************) [function.require-once]: failed to open stream: No such file or directory in ***************/forums/global.php on line 20
I'm trying to make this page outside of my forums directory. |
You still have not provided the code you are using, nor the full error messages.
|
Quote:
PHP Code:
|
I did that and the page is coming up without error now, but nothing from vb works when I place it on the page, like avatars for example. I tried this code for an avatar:
Code:
<table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> |
I don't believe that is the code to get you to the avatar. You are calling a script (image.php) not an image. You need to call an actual image in order to have an image displayed. Where did you get that code from?
|
From the article. What would be the proper code to display an avatar for a member if they were logged in?
|
Quote:
I'm not really sure what to use for the avatar. I looked in the postbit template and this is what is in there: HTML Code:
<a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> |
Avatars can be accessed using image.php - but only if avatars are stored in the database. You can access avatars stored in the file system using fetch_avatar_url().
|
Mine are stored as files, so I'd need to use fetch. Can you give me the exact code (using an example file path) I would need for an avatar to appear?
|
Take a look in member.php around line 395:
PHP Code:
|
I then get this error:
Fatal error: Call to undefined function fetch_avatar_url() in ********************** on line 16 I'm using this code in the header: PHP Code:
|
You need to include the user functions to be able to use it:
PHP Code:
|
PHP Code:
|
Please post the complete file you are using now.
|
This is the entire content of the page I'm testing:
PHP Code:
|
You aren't actually using the fetch_avatar_url() function...
|
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:
|
Please post the file you are using. Just saying "I put it in" doesn't really explain where.
|
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. |
$vbulletin->userinfo is the array for the logged in user's info, not $userinfo.
|
I replaced the $userinfo's with $vbulletin->userinfo's and still get a blank page.
|
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:
|
All times are GMT. The time now is 01: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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|