vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   User Titles (https://vborg.vbsupport.ru/showthread.php?t=39569)

Boofo 06-08-2002 04:18 PM

I did what you said here and put a 3 in for the x part of it (because I have 3 titles at present) but nothing shows up for the titles or minimum posts. Any ideas? I'm using the showtitles template and it doesn't show anything for those 2 variables in there.

Quote:

Originally posted by Xenon
you'll have a problem: since you don't know how much titles you have, you can't make dynamic variables because in the templates you cannot make a loop to call them all.
you maust make a small sort of formating, or you make your template hardcoded to 3 or 4 or whatever count of your titles..

but if you want to do so:
replace this
PHP Code:

$titletext="";
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext.="<tr><td>".$title[minposts]."</td><td>".$title[title]."</td></tr>";
  } 

with this:
PHP Code:

$counter=0;
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext[$counter]=$title[title];
    
$titleposts[$counter]=$title[minposts];
    
$counter++;
  } 

then you can user $titletext[x] and $titleposts[x] in your templates


Xenon 06-08-2002 04:48 PM

look at the counter variable it starts at 0, so if you have 3 titles you must choose 2 for title nr.3 *gg*

or put the line $counter++ two lines upper

Boofo 06-08-2002 06:33 PM

I put the counter line two lines up and it works great! Thank you very much. When I get the page done, I will put a link to it for you to check out. :) Thanks again!

Quote:

Originally posted by Xenon
look at the counter variable it starts at 0, so if you have 3 titles you must choose 2 for title nr.3 *gg*

or put the line $counter++ two lines upper



All times are GMT. The time now is 05:40 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.01783 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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