vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Integrate LeSane's Store with Trivia (https://vborg.vbsupport.ru/showthread.php?t=42169)

xxxsaint 08-11-2002 04:50 PM

Integrate LeSane's Store with Trivia
 
could this be done , so that every answer a person gets right on the trivia hack would gain them X amount of points in lesane's store ??

I'm not sure if this is the right forum for this request , so forgive me if it's not , I just think it would be kool and add to both hacks :D

Mr_P 08-11-2002 05:37 PM

good request as well m8

i asked for this in lesane`s hack as well

more incentive to play the quiz then if they win something but if its possible to add then its gotta be possible to delete as well if they get below a certain score.

Hope lesane`s see`s this post.

xxxsaint 08-11-2002 11:08 PM

yes , right now I'm manually doing it and it's keeping me plenty busy :D

xxxsaint 08-20-2002 06:17 PM

any news on this yet ?

xxxsaint 09-04-2002 10:18 PM

I'll PAY someone to integrate this with lesane's store so that every question answerd correctly = X amount of points predefined in the Admin panel.

Lesane 09-06-2002 11:57 AM

I don't have the hack installed but i guess that you can put the code by the end result. You can check how many questions the user has answered correctly and then update his points with an amount of x points.

This code below should work, not tested:

Find in quiz.php: (around line 310)

PHP Code:

$pct  $totalcorrect $base

Add AFTER it:

PHP Code:

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

This gives 10 points for every good answer. Let me know if this work correctly for you.

NuclioN 09-06-2002 12:28 PM

Warning: Unexpected character in input: '\' (ASCII=92) state=1

Maybe a typo ;)

xxxsaint 09-07-2002 04:57 AM

I get this :

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in quiz.php on line 638

Parse error: parse error, unexpected T_VARIABLE in quiz.php on line 638

Lesane 09-07-2002 09:47 AM

I edited my code.

NuclioN 09-07-2002 10:38 AM

Well...did it work for you lesane?

Lesane 09-07-2002 11:38 AM

Like i said, i don't have the hack installed so i cannot test it.

xxxsaint 09-07-2002 12:57 PM

That one gives this :
Parse error: parse error, unexpected T_STRING in quiz.php on line 319

xxxsaint 09-26-2002 09:04 AM

bump :( :( :(

xxxsaint 09-30-2002 09:46 PM

ok well this latest code that lesane tried to help me with gives me this error :

Quote:

Parse error: parse error in /****/****/****/****/forums/quiz.php on line 320
and my line 320 is this :

$current_time = vbdate($timeformat, time());


any ideas , help , suggestions would be greatly apprecieated.

xxxsaint 09-30-2002 10:12 PM

Hey Hey , I think I am getting closer here , after reading thru some of the php help files , I noticed that Lesane left out a " in his code line ,

Quote:

$updatestore = $DB_site->query_first("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]');
so I inserted it
Quote:

$updatestore = $DB_site->query_first("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]'");
and it did award points in a quiz i did for a test , but now it gave me this error


Quote:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /****/****/****/****/forums/admin/db_mysql.php on line 154
which when I look that up comes from this block of code :

Quote:

function fetch_array($query_id=-1,$query_string="") {
// retrieve row
if ($query_id!=-1) {
$this->query_id=$query_id;
}
if ( isset($this->query_id) ) {
$this->record = mysql_fetch_array($this->query_id);
} else {
if ( !empty($query_string) ) {
$this->halt("Invalid query id (".$this->query_id.") on this query: $query_string");
} else {
$this->halt("Invalid query id ".$this->query_id." specified");
}
}

return $this->record;
}

and line 154 is this line right here :

Quote:


$this->record = mysql_fetch_array($this->query_id);


Any help will be extremely apprecieated.

Lesane 10-02-2002 06:15 AM

Try this line:

PHP Code:

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


xxxsaint 10-02-2002 09:09 AM

WHOOOOO HOOOOOOo !!!!!!!!



THAT'S IT !

TY TY TY TY TY TY TY TY so very much man, you just don't know how much time i was spending manually going in there and awarding points , I really apprecieate your help :D

xxxsaint 10-02-2002 09:10 AM

I've seen others asking for this hack so you might wanna release it :D

xxxsaint 10-02-2002 09:41 AM

Now that the code is working and paying 10 points for every correct answer , is there a way to reward those that get 100% on their quiz and give them 1000 points instead of 100 ?

Lesane 10-03-2002 01:46 PM

I'm glad it's working properly now. :)

I have it way too busy to release a hack, you have my permission to use the code and release it as an addon if you want.

If you want to give them 1000 points instead of 100 then find this line in quiz.php:

PHP Code:

$storeamount 10 $totalcorrect

And change it to:

PHP Code:

$storeamount 100 $totalcorrect


xxxsaint 10-03-2002 02:38 PM

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

NuclioN 10-03-2002 09:11 PM

Yep, it would be nice if you release this as an addon when it's working. ;)

xxxsaint 10-03-2002 09:39 PM

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 :D

Lesane 10-04-2002 07:57 AM

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;
      } 


xxxsaint 10-04-2002 11:49 AM

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


All times are GMT. The time now is 11:08 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.01217 seconds
  • Memory Usage 1,777KB
  • 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
  • (6)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete