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 06-17-2013, 10:04 PM
B-runner B-runner is offline
 
Join Date: May 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calling content.php with a specific query ID from a php script

I am trying to find a way to call content.php with a query string from another php script. Without a query string, a stripped down version of the script, that works, would be:

PHP Code:
<?php
include("content.php");
die();
?>
but the include does not allow a query string. So I've been trying various forms of using $_GET, $_SERVER, $_SESSION and by using curl as others recommend (elsewhere), but I'm not finding the right way. Curl might work but I'm getting a "Request Entity Too Large" error.

So this reads as to what I'm after:
PHP Code:
<?php
include("content.php?###");
die();
?>
Where ### is a predefined constant- but again, it's not supported.



I was also wondering if there is a way to do it within VB, if you look into content.php, you'll see:

PHP Code:
define('VB_PRODUCT''vbcms');
define('VB_ENTRY'1);
define('VB_ROUTER_SEGMENT''content');
define('GET_EDIT_TEMPLATES''picture');
define('CMS_SCRIPT'true);
define('THIS_SCRIPT''vbcms');
define('FRIENDLY_URL_LINK''vbcms');

// Bootstrapping
require_once('vb/bootstrap.php'); 

Is it possible to define the page number ID before calling the bootstrap.php (or content.php)? Where does the query string get parsed anyway?


I'm just starting to work with VB & php, so thank you for any help!
Reply With Quote
  #2  
Old 06-17-2013, 11:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe you should be able to set parameters by setting $_GET and/or $_REQUEST. It depends on which parameters you're trying to set and how the vb code looks for them.

I don't know exactly what your script does, but maybe you could do what you're trying to do using plugins?
Reply With Quote
  #3  
Old 06-18-2013, 12:27 AM
B-runner B-runner is offline
 
Join Date: May 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, kh99.

What I'm really trying to do is this:
PHP Code:
 <?php
include("content.php?###");
die();
?>
Based on some account, one should be able to use $_GET as follows to make it work:
PHP Code:
 <?php
$_GET
['###']="0";
include(
"content.php");
die();
?>
But it doesn't, it just servers up the default content.php so using $_GET in this way didn't work. I'm not sure if there is a proper use of GET for this. As an side note, I realized VB is unusual in how it uses the query string since there is no =, you just get the query term.

I will look into $_REQUEST - but you're right, it depends how VB is looking for things, so that is why I was wondering where it parses the query string? I gave up on that for now after looking in the bootstrap.php since it gets into a lot of PHP code I'm not at all familiar with.
Reply With Quote
  #4  
Old 06-18-2013, 10:04 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by B-runner View Post
...but you're right, it depends how VB is looking for things, so that is why I was wondering where it parses the query string?
Oh, sorry, that's what you were asking. I see now, content.php is different in that it seems to do it's own parsing of the url. It looks like maybe it's in class_core.php, function resolve_request_url(), around line 2070, but I'm not sure. That code looks like it uses one of the values out of $_SERVER that has the url as a string.
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 08:27 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.03422 seconds
  • Memory Usage 2,198KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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