Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 09-22-2008, 11:08 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well i don't know what you are trying with that explode, so no clue how to correct it. But i doubt you need it at all, try removing it.
Reply With Quote
  #12  
Old 09-22-2008, 12:19 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You wanted to separate all the "time values" and use them in select boxes - so just use the variables $day, $month, $year, etc., as defined by list().

Do you know what list() does?
Reply With Quote
  #13  
Old 09-22-2008, 02:31 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had got it working but the small problem that remained with list() was that it INSERTED the selected value at the top in the list box rather than CHOOSING.

So, after lot of fiddling and referring to profile.php (modifyprofile_birthday template) I reached to this:-

PHP Code:
$row_timestamp explode('-'vbdate('j-n-Y-H-i-s'$result['TIMESTAMP']));
        
$dayselected["$row_timestamp[0]"] = 'selected="selected"';
        
$monthselected["$row_timestamp[1]"] = 'selected="selected"';
        
$year $row_timestamp[2];
        
$hour $row_timestamp[3];
        
$minute $row_timestamp[4];
        
$second $row_timestamp[5]; 
and in template we can do this way:-

HTML Code:
<option value="1" $dayselected[1]>01</option>
<option value="2" $dayselected[2]>02</option>
<option value="3" $dayselected[3]>03</option>

and so on...
Don't you think this is the better way? coz this works perfect and it chooses instead of inserting.

Thanks
Reply With Quote
  #14  
Old 09-22-2008, 02:57 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Errr - my code does exactly the same as yours - assigning $year/$hour/etc...
PHP Code:
$date explode('-'vbdate('j-n-Y-H-i-s'$dateline));
list(
$day$month$year$hour$minute$second) = $date;

$dayselected["$day"] = 'selected="selected"';
$dayselected["$month"] = 'selected="selected"'
And so on...
Reply With Quote
  #15  
Old 09-22-2008, 08:57 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

okk.. I am facing a strange problem now with list boxes.

I am retreiving a score of 1 to 10 in list box. The number 10 is never retrieved/selected. Only happening with 10.

I have this in PHP

PHP Code:
$scor $result['colscore'];
$score["$scor[0]"] = 'selected="selected"'
and in template:-

HTML Code:
<select name="scscore" size="1" id="scscore">
<option value="1" $score[1]>1</option>
<option value="2" $score[2]>2</option>
<option value="3" $score[3]>3</option>
<option value="4" $score[4]>4</option>
<option value="5" $score[5]>5</option>
<option value="6" $score[6]>6</option>
<option value="7" $score[7]>7</option>
<option value="8" $score[8]>8</option>
<option value="9" $score[9]>9</option>
<option value="10" $score[10]>10</option></select>
Not sure what i am doing wrong !

Thanks
Reply With Quote
  #16  
Old 09-23-2008, 05:34 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried debugging it yourself? Checking every step for the value?
Reply With Quote
  #17  
Old 09-23-2008, 06:37 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh yes sir, I did check everything, then only i posted.

strange thing is that the scores 1 - 9 are retrieving fine. Its just happening with number 10. When I use text field, it shows fine. Its just some problem with list box selecting 10.

And I just noticed that it is happening with every two digit number like 11, 12 etc. They aren't being selected in the list box. Something with arrays ?
Reply With Quote
  #18  
Old 09-23-2008, 07:11 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure you have the '10' entry in the array. Arrays are 0-based, so 10 entries wil have the values 0-9.
Reply With Quote
  #19  
Old 09-23-2008, 07:18 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

see all I have is this

What change do I need to make there ?

thanks
Reply With Quote
  #20  
Old 09-26-2008, 06:14 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can somebody please please look into my problem..... I am not able to figure this out.

I am retrieving a score of 1 to 10 in list box. The number 10 is never retrieved/selected. Only happening with 10. However, 1 to 9 retrieve okay. 10 does show using text field BUT not in list box.

I have this in PHP:-

PHP Code:
$scor $result['colscore'];
$score["$scor[0]"] = 'selected="selected"'
and this in template:-

HTML Code:
<select name="scscore" size="1" id="scscore">
<option value="1" $score[1]>1</option>
<option value="2" $score[2]>2</option>
<option value="3" $score[3]>3</option>
<option value="4" $score[4]>4</option>
<option value="5" $score[5]>5</option>
<option value="6" $score[6]>6</option>
<option value="7" $score[7]>7</option>
<option value="8" $score[8]>8</option>
<option value="9" $score[9]>9</option>
<option value="10" $score[10]>10</option></select>
I have no idea what wrong is here.

Thank you.. any help is much appreciated !
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04408 seconds
  • Memory Usage 2,274KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete