PDA

View Full Version : HELP NEEDED.. should be simple fix


E
03-25-2002, 09:20 AM
ok.. in addition too the points hack im trying too make it so u get an automatic number of points for posting new threads in certain forums.... the number of points u get changes thru the different forums... anyway this is what i have too add in my newthread.php but when i do so all new threeads end up in the forum of the last If statement related too $dapadd
// ############################## start add DAP #################################\
if ($HTTP_POST_VARS['action']!=="newthread" and $HTTP_POST_VARS['action']!=="postthread") {
// start ap\
$dapfield="field6";
if ($forumid="19"){
$dapadd=4;
}
if ($forumid="2"){
$dapadd=2;
}
if ($forumid="16"){
$dapadd=2;
}
if ($forumid="8"){
$dapadd=1;
}
if ($forumid="20"){
$dapadd=1;
}
if ($forumid="21"){
$dapadd=5;
}
if ($forumid="19"){
$dapadd=4;
}
if ($forumid="40"){
$dapadd=2;
}
if ($forumid="41"){
$dapadd=2;
}
$dapstr=$DB_site->query_first("SELECT $dapfield FROM userfield WHERE userid='$bbuserinfo[userid]'");
$dap=$dapstr[$dapfield];
$dapamt=$dapstr[$dapfield];
if ($dap='') {
$dap=0;
}
else {
$postdap = ($dapamt + $dapadd);
$DB_site->query("UPDATE userfield SET field6='$postdap' WHERE userid='$bbuserinfo[userid]'");
}
}
All new threads goto the forum of the last if statement:
if ($forumid="41"){
$dapadd=2;
}
^^that one...
You still get the right points for making threads in these forums but they dont stay there... help needed as soon as possible.....
Thanks in advance
---
E

Lesane
03-25-2002, 10:00 AM
$DB_site->query("UPDATE userfield SET field6=field6+$postdap WHERE userid='$bbuserinfo[userid]'");

E
03-26-2002, 03:23 AM
ok... i dont see how that helps.. ...wouldnt that just make it the current Point value x2 + dapadd... .that doesnt help with the problem of threads ending up in wrong forums.... any other help?

E
03-26-2002, 05:46 AM
Anyone wanna actually help :( it would be gretaly appreciated

Issvar
03-26-2002, 07:45 AM
You write if (forumid=1) { ... }, change that to if (forumid==1) { ... }, same for other forum numbers. Currently the forumid is changed all the time instead of checked.

Admin
03-26-2002, 07:56 AM
// ############################## start add DAP #################################
if ($HTTP_POST_VARS['action']!='newthread' and $HTTP_POST_VARS['action']!='postthread') {
// start ap
$dapfield = 'field6';

switch ($forumid) {
case 19:
$dapadd = 4;
break;
case 2:
case 16:
case 40:
case 41:
$dapadd = 2;
break;
case 8:
case 20:
$dapadd = 1;
break;
case 21:
$dapadd = 5;
break;
}

$DB_site->query("UPDATE userfield SET $dapfield=$dapfield+$dapadd WHERE userid=$bbuserinfo[userid]");
}

E
03-26-2002, 08:01 AM
thanks guys ill go test this now...

E
03-26-2002, 09:15 AM
works great thanks FireFLy :)