vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Noobie array help, please. (https://vborg.vbsupport.ru/showthread.php?t=211226)

Dismounted 04-16-2009 05:31 AM

Did you create and (edit the code to) use the appropriate templates?

robertpro2a 04-16-2009 05:54 AM

Ooops, I forgot to change it thanks. But what doesn't make sense to me is, in the above loop you made, it is not doing anything to assign the rows to the variable.

PHP Code:

while ($row $vbulletin->db->fetch_array($data))
{
    eval(
'$templatebits .= "' fetch_template('range_results') . '";');
   
//this is just fetching the template...


I've tested it also by putting $templatebits in the HTML template and nothing appears.


In the style manager:

"range_results"

PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
<
title>$vboptions[bbtitle]</title>
$headinclude
</head>
<
body>
results:
$templatebits

$navbar 


Dismounted 04-16-2009 06:34 AM

range_resultbit
Code:

<br />Title: $row[title]
range_results
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>

$header
$navbar

<p>Results:
$templatebits</p>

$footer
</body>
</html>

PHP Code:

$templatebits '';
$data $vbulletin->db->query_read("
    SELECT *
    FROM gun_ranges
    WHERE state = '" 
$vbulletin->db->escape_string($state) . "'
    LIMIT 5
"
);

while (
$row $vbulletin->db->fetch_array($data))
{
    eval(
'$templatebits .= "' fetch_template('range_resultbit') . '";');
}

eval(
'print_output("' fetch_template('range_results') . '");'); 


TigerC10 04-16-2009 02:15 PM

Quote:

Originally Posted by robertpro2a (Post 1792226)
Tiger: I think the reason why yours is doing it is because you can't echo within the php file, since its meant to display the template.

1) I just gave the echo code to show you how to access the var.

2) You can echo anything within a php file. The echo command is the same as print.

robertpro2a 04-16-2009 05:34 PM

Quote:

Originally Posted by Dismounted (Post 1792253)
range_resultbit
Code:

<br />Title: $row[title]
range_results
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>

$header
$navbar

<p>Results:
$templatebits</p>

$footer
</body>
</html>

PHP Code:

$templatebits '';
$data $vbulletin->db->query_read("
    SELECT *
    FROM gun_ranges
    WHERE state = '" 
$vbulletin->db->escape_string($state) . "'
    LIMIT 5
"
);

while (
$row $vbulletin->db->fetch_array($data))
{
    eval(
'$templatebits .= "' fetch_template('range_resultbit') . '";');
}

eval(
'print_output("' fetch_template('range_results') . '");'); 



YES!!! It works. Thanks! I owe you a beer if you're ever in the Baltimore area.

Tiger: You too buddy!


All times are GMT. The time now is 12:20 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.01503 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete