vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vBulletin integration help? (https://vborg.vbsupport.ru/showthread.php?t=217139)

jchamber2010 06-25-2009 08:07 PM

vBulletin integration help?
 
Hello,

I'm doing a massive vBulletin integration project, however whenever I try to create pages including global.php (so I can use vbulletin variables etc) I get the following error.

Code:

Warning: require_once(/home/xxxxx/subdomains/xxxx/includes/init.php) [function.require-once]: failed to open stream: No such file or directory in /home/xxxx/subdomains/xxxx/forums/global.php on line 23

Fatal error: require_once() [function.require]: Failed opening required '/home/xxxx/subdomains/xxxx/includes/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxx/subdomains/xxxx/forums/global.php on line 23

It seems to be trying to include a file called init.php from the wrong directory, instead of trying to get it from /forums/includes/init.php, it's trying to get it from /includes/init.php... which doesn't exist.

If anyone could help me this would be great.

By the way, the way I currently have it setup is as follows

http://www.my.com/forums = the forums, and where global.php is stored
http://www.my.com/ = website i'm trying to integrate with, and is where I'm trying to include('./forums/global.php'); from

And the forums work fine.

Dismounted 06-26-2009 05:20 AM

PHP Code:

$cwd getcwd();
chdir('./forums');
require_once(
'./global.php');
chdir($cwd); 


jchamber2010 06-27-2009 12:40 AM

thanks that worked perfectly.

Is there a variable that shows how many users are online? or is that something that I will have to code, and if so where is this information stored in the database?

Dismounted 06-27-2009 03:54 AM

Look near the end of index.php - that contains the code to fetch currently active users.

jchamber2010 06-27-2009 02:34 PM

Thanks, that worked perfectly (as always).

The next thing I'm trying to do is figure out new posts, what I'm trying to do is make a column on the left of the page with new posts that the user has not read. I've figured out how to display posts that are the newest in general, but not what is the newest to that user or if this is even possible. Any help is appreciated.

Thanks again Dismount, you're a life saver :)

Cryo 06-27-2009 08:13 PM

You can use the variable $vbulletin->userinfo["lastvisit"] which returns a timestamp from the user's last forum visit. From there, select posts with a timestamp GREATER THAN that. An example query (very, VERY basic) would be...

Code:

SELECT * FROM post WHERE dateline > ". $vbulletin->userinfo["lastvisit"] ." ORDER BY dateline DESC LIMIT 0, 10
That would display the 10 newest posts since the user's last visit. If you have a prefix set you would have to use that in front of the table names as well.

jchamber2010 06-28-2009 12:19 PM

I'd like to do sorta like what the vBa CMPS does where it displays the newest posts, and then bolds the ones that the user hasn't viewed yet, I just can't think of how to do it. By the way, in case it makes any difference to how this would be done I have the "Thread/Forum Read Marking Type" set to "Database (automatic forum marking)"

Thanks again to all that help

Dismounted 06-29-2009 03:42 AM

The read markers are tricky. What I suggest is to look inside forumdisplay.php and see how vBulletin determines the read status.

jchamber2010 06-29-2009 04:08 PM

I actually can't find it in that file, you mind sending me the lines where it can be found (I know you can't post part of the file... or can you?)

Anyway thanks again for all your help

--------------- Added [DATE]1246302266[/DATE] at [TIME]1246302266[/TIME] ---------------

also, how do you get vbmenu_register to work outside of vbulletin run pages, for instance on my homepage... this time I'll provide a link so you can see what I'm trying to do. http://sdev.pcprobs.org/ anyway the QuickLinks dropdown only works on pages that are run by vBulletin, even though I have included all of the javascript files, in the same order as on all of the vBulletin pages, but it still doesn't work.

It only shows up for registered users, so you'll have to register (email activation is off)

Any help with this is appreciated.

Thanks

Dismounted 06-30-2009 03:26 AM

Quote:

Originally Posted by jchamber2010 (Post 1839713)
I actually can't find it in that file, you mind sending me the lines where it can be found

Take a look at lines 452-462 (3.8.2):
PHP Code:

    if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
    {
        
$foruminfo['forumread'] = $vbulletin->forumcache["$foruminfo[forumid]"]['forumread'];
        
$lastread max($foruminfo['forumread'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
    }
    else
    {
        
$bbforumview intval(fetch_bbarray_cookie('forum_view'$foruminfo['forumid']));
        
$lastread max($bbforumview$vbulletin->userinfo['lastvisit']);
    } 

And also 955-956:
PHP Code:

            // build thread data
            
$thread process_thread_array($thread$lastread$foruminfo['allowicons']); 

Quote:

Originally Posted by jchamber2010 (Post 1839713)
http://sdev.pcprobs.org/ anyway the QuickLinks dropdown only works on pages that are run by vBulletin, even though I have included all of the javascript files, in the same order as on all of the vBulletin pages, but it still doesn't work.

Are you 100% sure you have included all necessary JS and associated snippets that are found in the header/footer? (e.g. JS init sequence)


All times are GMT. The time now is 03:08 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.01557 seconds
  • Memory Usage 1,758KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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