Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2010, 04:06 AM
razec razec is offline
 
Join Date: Nov 2009
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Problems integrating external PHP pages with VB4

I have some PHP-based forms that I would like to include with VB4. I want to make sure that the following applies:

1. The scripts interact with vBulletin's configuration (mainly to access the same database information, and to be able to determine if the user is logged in), and
2. they need to use the same styling and heading as the CMS.

I've installed VB4 in the root of my website, so going to http://www.mysite.com/, which is located at /home/content/myuser/html on my server. For starters, I just created a simple script to test this:

Code:
<?

        define('CWD', '/home/content/myuser/html');

        include(CWD . '/includes/init.php');
        include(CWD. '/includes/class_dm.php');

        global $db, $vbulletin;

        echo '<p>Your user ID: ' . $vbulletin->userinfo['userid'] . '</p>';

?>
The browser output of this is:

VB_AREA and THIS_SCRIPT must be defined to continue


What am I doing wrong here? Also, since I'm planning ahead, how can I have my scripts build the standard page header used by the CMS/forums (the welcome/notifications/my profile/etc with the site logo)?
Reply With Quote
  #2  
Old 01-03-2010, 04:43 AM
derfelix derfelix is offline
 
Join Date: Nov 2001
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this... above your define('CWD', '/home/content/myuser/html');

add:
define('THIS_SCRIPT', 'test_script');
define('VB_AREA', 'test_area');
you might need
define('CMS_SCRIPT', true); but i dont know...

What I would do first, prior of doing anything like that..
READ: https://vborg.vbsupport.ru/showthread.php?t=228112
(excellent How to by Lynne)

F.
Reply With Quote
  #3  
Old 01-03-2010, 04:54 AM
razec razec is offline
 
Join Date: Nov 2009
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Adding the "THIS_SCRIPT" and "VB_AREA" defines worked. I didn't try it with the CMS_SCRIPT define.

Thanks for your help, and thanks for the link. I'll check it out and post again if I have any more questions.
Reply With Quote
  #4  
Old 01-03-2010, 04:54 AM
sebz2009 sebz2009 is offline
 
Join Date: Aug 2009
Location: Sydney, Australia
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[HOW TO - vB4] Create a own vBulletin page

[HOW TO - vB4] Rendering templates and registering variables - a short guide
Reply With Quote
  #5  
Old 01-03-2010, 05:31 PM
razec razec is offline
 
Join Date: Nov 2009
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, so I have my new external pages working and using new VB templates. What I can't do is figure out how to integrate PHP into the template. It's just ignored. I know how to do this with widgets but how does it work with VB4 templates?

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

Actually, nevermind that. I think I found a few ways I can approach it. Thanks.
Reply With Quote
Reply


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 09:47 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.03642 seconds
  • Memory Usage 2,197KB
  • 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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete