MyBB Support

Help me with this stuff

Submitted by linkzy, , Thread ID: 17875

Thread Closed
06-02-2016, 07:59 AM
This post was last modified: 06-02-2016, 05:54 PM by linkzy
#1
Hey!
I was making a plugin which can count threads of user from a specific fid.

PHP Code:
$query $db->query("SELECT `uid`,`fid` FROM ".TABLE_PREFIX."threads WHERE uid='"$uid ."' AND fid='".$mybb->settings['resourcecount_fidcount']."' "); 

The code above can get the user thread only from one fid like I go to setting and write 2, it'll count threads of the user only from 2 and when I write 2,3 it doesn't count from fid 2,3. One way is to use (fid="4" OR fid="2") but I don't know how to make this stuff work with the setting . I want to make a setting which can count threads from several fid.

Current setting i use

PHP Code:
$setting_res = array(
'name'=> 'resourcecount',
  
'title'=> 'Resource Count',
  
'description'=> "Custom Resource count plugin settings",
  
'disporder'=> '1',
  
'isdefault'=> 'no'
  
);
      
$db->insert_query('settinggroups'$setting_res);

  
$fid $db->insert_id();
    
$resourcecount_setting = array(
        
'name'=> 'resourcecount_fidcount',
  
'title'=> "Count FID",
  
'description'=> "any one forum id you want to count user resource from",
  
'optionscode'=> 'text',
  
'value'=> '2'
  
'disporder'=> '1',
  
'gid'=> intval($fid)
  );
  
$db->insert_query('settings'$resourcecount_setting); 
and if there's any vuln. please tell me so I can fix it

Thanks Smile

Bumping. Where are all those experts

Bumperinho! Is someone here to help me :'(
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Help me with this stuff

OP
This post was last modified: 07-02-2016, 06:39 PM by linkzy
#2
Bumping. if someone knows. please help

Solved. Thanks to Senpai!
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |



Users browsing this thread: 1 Guest(s)