vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Trouble with a variable (https://vborg.vbsupport.ru/showthread.php?t=99129)

MetalAges 10-23-2005 08:13 PM

Trouble with a variable
 
I have this code, which isn't grabbing the variable from the URL string, but if I hard code a forum id it works. Code:

Code:

<?php
error_reporting(7);

$templatesused='latest_hostedthreadbits,latest_hostedthreads';


require('./global.php');

$latest = $db->query_read("SELECT * FROM thread WHERE forumid='$fid' ORDER BY lastpost DESC LIMIT 10");


while ($recent = $db->fetch_array($latest)) {

$title = $recent['title'];
$id = $recent['threadid'];
 eval("\$latest_threads .= \"".fetch_template("latest_hostedthreadbits")."\";");
}




eval("print_output(\"".fetch_template('latest_hostedthreads')."\");");

?>

Include in my PHP page:
Code:

<?php include('http://www.ultimatemetal.com/forum/hosted10.php?s=&fid=143&size=1&face=verdana&vlink=666699&link=336699&alink=000000&body=&text=000000'); ?>
As I said, everything works if I substitute forumid='$fid' with forumid='143' etc.

Am I doing something wrong or has something change in 3.5.0 that makes it to where I can no longer grab that variable in that format?

EDIT: This script grabs the top ten latest threads in any given forum and allows bands (in my case) to display this on their sites. Everything worked pre-3.5.0 upgrade.

Marco van Herwaarden 10-25-2005 11:55 AM

You will need to make those variables available first. Add the following after global.php:
PHP Code:

$vbulletin->input->clean_array_gpc('r', array(
    
'fid'        => TYPE_UINT,
));
$fid $vbulletin->GPC['fid']; 

The same for other variables you need.

MetalAges 11-01-2005 06:05 PM

Thank you sir! Works now :)

Marco van Herwaarden 11-01-2005 08:17 PM

Glad to help you.


All times are GMT. The time now is 07:55 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.00963 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_php_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