PDA

View Full Version : How to include vbulletin info on non-vb page? (look ma, no [request])


27 Jul 2000, 00:31
Quick wink to JimF... and trying to follow his standard =P

I would like to be able to great my visitors on the front page of my site as well, using the info already gathered in vbulletin.

Is there a way that I can call the Name, Last Visit, Number of registered users, and other such items from the VB front page and use it on my sites front page?

Can I update the last visited date if they visit the site front page OR the vb front page?

Any help would be great!

27 Jul 2000, 13:50
thease are one of the things i will be adding to my board if i deside to go to this board. I can just make a small snip of a script that does this, but it might be a while before i get it done.

28 Jul 2000, 13:58
Nevermind all your helpfull people... I figured it out!! Took some more digging and a little playing but I got it.

I would post the way to do it, but it seems that no one is interested. If you are, then go ahead and reply.

28 Jul 2000, 15:47
I have to admit to being interested.. if no one else is you can feel free to email it to me, Id love to know

28 Jul 2000, 15:53
I'd have a use to do this too... please feel free to post the steps if it isn't too much trouble.

Thanks,
-Chris

28 Jul 2000, 19:50
Well,
What you'd have to do is follow the style that VB does with their other PHP files...

Create a PHP file, and put in it:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



That creates a DB connection to your vB mySQL DB, and now you can do anything you want with it!

However, if this PHP file is outside of your VB directory you must make sure that you put the path to global.php in the require( ) function call or it will fail.
Example:
Your VB directory is here: /home/httpd/www/boards/vb
Your PHP file is located here: /home/httpd/www/boards


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Ok, now that you have the PHP doc connecting, you can place any code within the <?PHP ?> brackets - just like you are developing in VB!

28 Jul 2000, 23:51
I almost have to laugh. I make a request and no one responds or states that they are interested in it either. When I say that I figured it out, I get 2 requests from others that are interested and then someone posts how to do it FOR me.

Where were you people when I needed you BEFORE I figured it out?!?!?!? :)

Anyway... thanks mrogish for posting that. Saves me some typing.

When I did the above the first time it worked until the global.php required the admin/config.php which is puked on. So to fix that I did the below:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


The chdir tells the script to start thinking it's in that new directory. And for some reason I couldn't get mine to work until I put the full path to the global.php as well.

Hope that helps if you have the same problem as I do.

Next time, speak up if you want a similar feature... it encourages the hackers to respond more then if it's just a single person :)

29 Jul 2000, 21:59
Aaron,
Sorry about that -- the large number of posts that the hack forum gets tends to push things to the bottom of the page, hence loss of exposure, etc., especially when there is a lot of talk about big things like PM and such.

Glad to help though! :)

21 Aug 2000, 01:24
I am bringning this thread as it is what I am trying to do (display the members/threads/posts numbers on a non vb page)

now... I did what was explained above with no success.

Also... I believe this hack displays the information on a PHP file right? What about displaying the info on a non php file (shtml)

Thanks in advance if you can explain me the steps.

21 Aug 2000, 04:34
Yes you have to use a .php file to use php code, unless you know of some way to execute .php from a .shtml file

Anyway this is what I did to get it to work using a .php file. PHP can give you fits with the right path and such so you have to do a chdir. Without the $DOCUMENT_ROOT, the require will fail.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Make sure you put this as the FIRST thing in your index.php, nothing before it, no spaces, etc. If you don't you will get warnings about header information already being sent. You won't see these warnings if you already have a cookie set on your forum but your guests will and you would never know it if you never log out.

Then just use the vb Variables, i.e. like this for example



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



[Edited by rangersfan on 08-21-2000 at 12:35 AM]

21 Aug 2000, 05:46
You can set up Apache to parse any number of files for PHP code, it is well documented on http://www.apache.org.

21 Aug 2000, 06:05
I finally got it working. I was having an issue though because I use the main.php3 page (This is our home page) as the template for all the other pages like news which is (main.php3?id=news). I was running into a parsing error because when I tried to goto the news page, it said the news include file could not be found. This obvious because the chdir has changed it postition for me. Now I am new to php so I tried all sorts of linking to get it to that damn file and what ended up working was this

<?php
include($DOCUMENT_ROOT . "/drumnbasscc/" . "$id.inc");
?>

Not sure if this helps anyone but just thought I would post this hoe. Also I had to do my chdir wierd. I have a feeling it is due to the cukie server layout but this was the only for me not get parse errors

<?php
chdir("../forum");
require("../forum/global.php3");
?>

If someone could maybe help me on organizing the code I would love the help. But at least this is working now.

Kode
http://www.drumnbass.cc

21 Aug 2000, 06:16
Correct me if I'm wrong, but couldn't you put the code in a file.php, then include it in the .shtml file? :)

P.S. Hi Mano! *waves*

[Edited by WebStyles on 08-21-2000 at 02:17 AM]

21 Aug 2000, 06:25
well i got tired of trying to include bits of info on non vb pages... so i included the entire frontpage via SSI lol

http://www.animeboards.net/

23 Aug 2000, 13:54
well i am trying the including of vb info on a non vb page at http://animeboards.net/index2.php3 but can't seem to format the welcome back user output to the same font type and size as the below 3 text links on that page...

also how do i display

total threads | total posts
total registered members :
and newest member on this page ?

15 Sep 2000, 16:36
I also need to get this infomation

total threads | total posts
total registered members :

15 Sep 2000, 16:50
hehe again it's all in one post

http://www.vbulletin.com/forum/showthread.php?threadid=2658

19 Nov 2000, 10:54
How would I go about using the user defined vB header and footer fields on a non vB page ? I am going to set up a forum related page, and would like it to have the standard forum appearance...

Sorry if this is answered elsewhere, but I couldn't find anything by browsing or searching... :(

03 Apr 2001, 12:21
if the file is in the same directory as the forum is that the correct code?



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

RobAC
03 Apr 2001, 17:25
Craig,
On a non php page (html document) you would use the include command: <!-- #include virtual="file name" -->

On a php page, you need to use a require command like this:

<?PHP
require( "global.php" );
?>

dons
19 Apr 2001, 12:46
In 2.0 Beta 5 I can't get the $bbuserid etc vars if the user has chosen not to Cookie. How can I get at this info for these users...(obviously AFTER they login).

thanks..dcs

dons
19 Apr 2001, 13:09
I changed to use $bbuserinfo[ userid ] instead and this seems to work reliably in 2.0 Beta 5