Help me with this stuff

by linkzy - 06-02-2016, 07:59 AM
لا إله إلا الله‎
Posts:
6,330
Joined:
Jan 2015
Likes:
300
Credits:
322
Reputation:
162
2 Years of Service
#1
OP
Posted: 06-02-2016, 07:59 AM (This post was last modified: 06-02-2016, 05:54 PM by linkzy.)
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 :'(
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

لا إله إلا الله‎
Posts:
6,330
Joined:
Jan 2015
Likes:
300
Credits:
322
Reputation:
162
2 Years of Service
#2
OP
Posted: 07-02-2016, 12:37 PM (This post was last modified: 07-02-2016, 06:39 PM by linkzy.)
Bumping. if someone knows. please help

Solved. Thanks to Senpai!
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)