Ok, ignore anything i've said previously - I found a script that works, save that it doesn't destinguish between forums I want posts to count and those I don't.
PHP Code:
// ------ Power Level Hack ------- //
// Edit values here v
$powerlevel_forums[]=array("id" => 51, "min" => 6000, "max" => 8000); // Training
$powerlevel_forums[]=array("id" => 52, "min" => 6000, "max" => 10000); // Saga
$powerlevel_forums[]=array("id" => 53, "min" => 8000, "max" => 12000); // Afterlife
$powerlevel_forums[]=array("id" => 70, "min" => 6000, "max" => 8000); // Archive - Training
$powerlevel_forums[]=array("id" => 71, "min" => 6000, "max" => 10000); // Archive - Saga
// Edit values here ^
$i=0;
while(!$fid && $i<count($powerlevel_forums))
{
if($_GET['f']==$powerlevel_forums[$id][id])
$fid=$i;
$i++;
}
if($fid)
{
$uid=$vbulletin->userinfo['userid'];
$increase=rand($powerlevel_forums[$fid][min],$powerlevel_forums[$fid][max])+1;
mysql_query("UPDATE gf_userfield SET field5=field5+$increase WHERE userid=$uid");
}
// ------ Power Level Hack ------- //
My friend, who helped me write this up, showed me the coding in waht he called 'regular' PHP, because he found the vB definitions for everything confusing - wether this is the source of our problem or not, I don't know.
for ANYONE who can help, I can offer a big big hug that is
totally platonic but pleasent none the less.
Thanks in advance and I hope I'm not breaking any rules here... *crosses fingers*
- Kovash
Ok, I put the above code into functions_newpost.php and it works fine, save that it doesn't distinguish between the forums I've told it to use and others;
ie, I want it to be invoked for 51, 52, 53, 70 and 71 - but it invokes with every post in every forum.
Any help would be appriciated.
- Kovash
PHP Code:
// ------ Power Level Hack ------- //
$powerlevel_forums[]=array("id" => 51, "min" => 6000, "max" => 8000); // Training
$powerlevel_forums[]=array("id" => 52, "min" => 6000, "max" => 10000); // Saga
$powerlevel_forums[]=array("id" => 53, "min" => 8000, "max" => 12000); // Afterlife
$powerlevel_forums[]=array("id" => 70, "min" => 6000, "max" => 8000); // Archive - Training
$powerlevel_forums[]=array("id" => 71, "min" => 6000, "max" => 10000); // Archive - Saga
// ---- Edit Values ---------------^--------------^-------------^
$i=0;
$fid=false;
while(!$fid && $i<count($powerlevel_forums))
{
if($foruminfo['forumid']==$powerlevel_forums[$i][id])
$fid=$i;
$i++;
}
if($fid !== false)
{
$uid=$vbulletin->userinfo['userid'];
$increase=rand($powerlevel_forums[$fid][min],$powerlevel_forums[$fid][max])+1;
$query="UPDATE gf_userfield SET field5=field5+$increase WHERE userid=$uid";
mysql_query($query);
}
// ------ Power Level Hack ------- //
wooo! it works now - all I had to do was create a new userfield, edit this code into functions_newpost.php and point the code toward the correct field.
So, thanks for anyone who read this thread as I worked it out
- Kovash