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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-28-2003, 07:01 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default /me needs help ;)

PHP Code:
$getthebanners $DB_site->query("SELECT * FROM artists");
while(
$boohoo $DB_site->fetch_array($getthebanners)) {
eval(
"dooutput(\"".gettemplate("displayartists")."\");");

When i put $boohoo[name] in the displayartists template it only calls the name of one artist and not all

Btw name is a field in the table artists

Any ideas?

Regards

- miSt
Reply With Quote
  #2  
Old 03-28-2003, 07:59 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mist hope this helps...

PHP Code:
$getthebanners $DB_site->query"SELECT * FROM artists" );
  while( 
$boohoo $DB_site->fetch_array$getthebanners ) )
    eval( 
"\$theartists.= \"".gettemplate'displayartistsbit' )."\" ;" );

  eval( 
"dooutput( \"".gettemplate'displayartists' )."\" );" );
  exit; 
you need the create a template "displayartistsbit" and put in there the info you want to repeat... then the "displayartists" template is the main template... in which you put the "$theartists" to echo the loop that you created...

hope that helps Mist...

regards,
g-force2k2
Reply With Quote
  #3  
Old 03-29-2003, 11:43 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahhh thanks g-force...

I understand the concept now

Good to see you back btw

- miSt
Reply With Quote
  #4  
Old 03-29-2003, 05:33 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Btw g-force that was the right idea but it didn't work. I had to add braces

PHP Code:
$gettheartists $DB_site->query"SELECT * FROM artists" );
  while( 
$boohoo $DB_site->fetch_array$gettheartists ) ) {
    eval( 
"\$theartists.= \"".gettemplate'displayartistsbit' )."\" ;" );
  }
  eval( 
"dooutput( \"".gettemplate'displayartists' )."\" );" );
  exit; 
Regards

- miSt
Reply With Quote
  #5  
Old 03-29-2003, 05:57 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As you always should for multiple-line blocks to prevent problems that look fine but that are only the illusion of indenting.
Reply With Quote
  #6  
Old 03-31-2003, 02:37 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm... you sure Mist?

because to my knowledge you don't need to add brackets for one line codes... unless you altered the code in anyway ( adding more info inside the while for instance )

because the example:
PHP Code:
if( $this == "that: )
  echo 
$this
is the same as:
PHP Code:
if( $this == "that" )
{
  echo 
$this;

just if you don't have brackets it will only read one line to my knowledge if you added more code thats probably why you got an error...

regards,
g-force2k2
Reply With Quote
  #7  
Old 03-31-2003, 04:51 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's extremely bad style to do that first example because it can very easily lead to screwups when editing the code.
Reply With Quote
  #8  
Old 03-31-2003, 04:53 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

100% sure - PPN helped me out with it and said put brackets and then it worked

- miSt
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 11:38 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.03848 seconds
  • Memory Usage 2,236KB
  • 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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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