Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 10-03-2002, 02:38 PM
xxxsaint's Avatar
xxxsaint xxxsaint is offline
 
Join Date: Jun 2002
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok , I am a total noob when it comes to php coding, I did the happy dance for about 15 minutes when I figured out how to make any name any color I wanted in the ' currently active users ' list , so is there any way to make a php code that would do this :


Quote:

(yes i know this isn't a code LOL, I'm trying to convey my idea )

$base = round(100 / $question_count);
$pct = $totalcorrect * $base;

If $pct = 100 then

$storeamount = 100 * $totalcorrect;
$updatestore = $DB_site->query("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]'");

else


$storeamount = 10 * $totalcorrect;
$updatestore = $DB_site->query("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]'");

See this way , if someone took a 10 question quiz and got 9 or less right , it will give 10 points per question , but if they got all 10 right and scored 100% , it would award them $1000

make any sense , sorry if it doesnt :P
Reply With Quote
  #22  
Old 10-03-2002, 09:11 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, it would be nice if you release this as an addon when it's working.
Reply With Quote
  #23  
Old 10-03-2002, 09:39 PM
xxxsaint's Avatar
xxxsaint xxxsaint is offline
 
Join Date: Jun 2002
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it works now as far as paying x amount of points per correct answer , if that's all you intend to do with it , without the perfect score bonus , it's ready
Reply With Quote
  #24  
Old 10-04-2002, 07:57 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by xxxsaint
Ok , I am a total noob when it comes to php coding, I did the happy dance for about 15 minutes when I figured out how to make any name any color I wanted in the ' currently active users ' list , so is there any way to make a php code that would do this :

See this way , if someone took a 10 question quiz and got 9 or less right , it will give 10 points per question , but if they got all 10 right and scored 100% , it would award them $1000

make any sense , sorry if it doesnt :P
PHP Code:
if ($totalcorrect=='10') {
      
$storeamount 100 $totalcorrect;
      } else {
      
$storeamount 10 $totalcorrect;
      } 
Reply With Quote
  #25  
Old 10-04-2002, 11:49 AM
xxxsaint's Avatar
xxxsaint xxxsaint is offline
 
Join Date: Jun 2002
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perfect man , very nice job. I installed and tested it all out , it works fine with no problems at all. Thanks for all the help you did on this and for allowing me to release this as an add on , which I did just now, right here :


https://vborg.vbsupport.ru/showthrea...threadid=44279
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 04:29 AM.


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.03812 seconds
  • Memory Usage 2,207KB
  • 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
  • (1)bbcode_php
  • (2)bbcode_quote
  • (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
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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