MyBB-Plugins Forums

Full Version: [Release] MyPlaza [code] Thanks 1.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Well, if you put "return;" it won't return much I think O.o
I'd make that return true; or false;
It's cool that you're coding this btw Smile.
Thx. This help Smile

Now I'm must clear code, and recode to Myplaza Plugin.
I'm Try Relase this plugin until week.
PHP Code:
$puid=intval($post['uid']);
$uuid=intval($mybb->user['uid']);
$costed=1;
user_change_money($uuid, -$costed);
$costed=0.1;
user_change_money($puid$costed); 

I don't know why this functions don't change money.
Don't return any error

Can I must specyfic additional globals?

PHP Code:
global $db,$mybb,$post
So what you're trying to do is remove 1 from the user that's viewing the post and give 0.1 to the user that has posted. Right? Can I see your whole function?
PHP Code:
//thanks function

function myplazacode_do_thank($pid$tid$puid)
{


    global 
$db,$mybb,$post;
    
$check_query $db->simple_select("myplazanocodethx","*" ,"adduid='{$mybb->user['uid']}' AND pid='$pid' AND tid='$tid'");
    if(
$db->num_rows($check_query))
        return;
    
$check_query $db->simple_select("posts","uid","pid='$pid'");
    if(
$db->num_rows($check_query)==1)//  post exsits
    
{
    
$uuid=intval($mybb->user['uid']);
    
$costed=1;
    
user_change_money($uuid, -$costed);
    
$costed=0.1;
    
user_change_money($puid$costed);
    
    
    
$tmp=$db->fetch_array($check_query);    
        
$database = array (
            
"txid" => NULL
            
"adduid" => $uuid,
            
"pid" => $pid,
            
"tid" => $tid
        
);
        
$db->insert_query("myplazanocodethx"$database); //add thank to thx table
        
    
}

is the part thats not working the user_change_money?
Yes
are you sure? try placing "die();" before that and tell me if you get a blank page
Blank Page.


Add thanks part Is ok
PHP Code:
$tmp=$db->fetch_array($check_query);    
        
$database = array (
            
"txid" => NULL
            
"adduid" => $uuid,
            
"pid" => $pid,
            
"tid" => $tid
        
);
        
$db->insert_query("myplazanocodethx"$database); //add thank to thx table 



But problem is in:
PHP Code:
$uuid=intval($mybb->user['uid']);
    
$costed=intval($mybb->settings['unhide_cost']);
    die();
    
user_change_money($uuid, -$costed);
    
$costed=intval($mybb->settings['unhiden_bonus']);
    
user_change_money($puid$costed); 


All function
PHP Code:
function myplazacode_do_thank($pid$tid$puid)
{


    global 
$db,$mybb,$post;
    
$check_query $db->simple_select("myplazanocodethx","*" ,"adduid='{$mybb->user['uid']}' AND pid='$pid' AND tid='$tid'");
    if(
$db->num_rows($check_query))
        return;
    
$check_query $db->simple_select("posts","uid","pid='$pid'");
    if(
$db->num_rows($check_query)==1)//  post exsits
    
{
    
$uuid=intval($mybb->user['uid']);
    
$costed=intval($mybb->settings['unhide_cost']);
    die();
    
user_change_money($uuid, -$costed);
    
$costed=intval($mybb->settings['unhiden_bonus']);
    
user_change_money($puid$costed);
    
    
    
$tmp=$db->fetch_array($check_query);    
        
$database = array (
            
"txid" => NULL
            
"adduid" => $uuid,
            
"pid" => $pid,
            
"tid" => $tid
        
);
        
$db->insert_query("myplazanocodethx"$database); //add thank to thx table
        
    
}

PHP Code:
user_change_money($uuid, -$costed); 

Does the user lose money here?
Pages: 1 2 3 4 5 6 7