vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Calling content.php with a specific query ID from a php script (https://vborg.vbsupport.ru/showthread.php?t=299229)

B-runner 06-17-2013 10:04 PM

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!

kh99 06-17-2013 11:13 PM

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?

B-runner 06-18-2013 12:27 AM

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.

kh99 06-18-2013 10:04 AM

Quote:

Originally Posted by B-runner (Post 2428832)
...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.


All times are GMT. The time now is 07:32 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.01797 seconds
  • Memory Usage 1,726KB
  • 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
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete