Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2009, 09:07 PM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 06-26-2009, 06:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$cwd getcwd();
chdir('./forums');
require_once(
'./global.php');
chdir($cwd); 
Reply With Quote
  #3  
Old 06-27-2009, 01:40 AM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 06-27-2009, 04:54 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look near the end of index.php - that contains the code to fetch currently active users.
Reply With Quote
  #5  
Old 06-27-2009, 03:34 PM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 06-27-2009, 09:13 PM
Cryo Cryo is offline
 
Join Date: Dec 2003
Location: Buffalo, NY
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 06-28-2009, 01:19 PM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 06-29-2009, 04:42 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The read markers are tricky. What I suggest is to look inside forumdisplay.php and see how vBulletin determines the read status.
Reply With Quote
  #9  
Old 06-29-2009, 05:08 PM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 06-30-2009, 04:26 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jchamber2010 View Post
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 View Post
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)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08013 seconds
  • Memory Usage 2,265KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete