Guest User

settings

a guest
Dec 3rd, 2016
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.27 KB | None | 0 0
  1. <?php
  2.  
  3. class Settings
  4. {
  5.     private $db;
  6.     private $md5id;
  7.     private $instagram_username; //string
  8.     private $instagram_password; //string
  9.     private $like = 0; //[ 0 - 1]
  10.     private $comment = 0; // [0 - 1]
  11.     private $follow = 0; // [0 - 1]
  12.     private $unfollow = 0; // [0  1]
  13.     private $upload_photo = 0; // [0 - 1]
  14.     private $target = null; //[tags - usernames - locations]
  15.     private $targetCommenters = 0; //[0 - 1]
  16.     private $targetLikers = 0; //[0 - 1]
  17.     private $targetFollowType = 0; //[0 , followers, followings, both]
  18.     private $media_type; // [any - photo - video]
  19.     private $min_likes; //[0-9]
  20.     private $max_likes; //[0-9]
  21.     private $min_comments; //[0-9]
  22.     private $max_comments; //[0-9]
  23.     private $media_age; //[ any - 1h - 12h - 1d - 3d - 1w - 2w - 1M]
  24.     private $user_profile; // [0 - low - medium - High]
  25.     private $min_followers; //[0-9]
  26.     private $max_followers; //[0-9]
  27.     private $min_followings; //[0-9]
  28.     private $max_followings; //[0-9]
  29.     private $user_relation; //[0-9]
  30.     private $min_posts; //[0-9]
  31.     private $max_posts; //[0-9]
  32.     private $max_tags; //[0-9]
  33.     private $tag_tag; //[0-1]
  34.     private $location_tag; // [0-1]
  35.     private $username_tag; // [0-1]
  36.     private $dont_comment_same_user; //[0-1]
  37.     private $dont_follow_same_user; //[0-1]
  38.     private $dont_follow_privet_user; //[0-1]
  39.     private $follow_cycle; //[0-9]
  40.     private $unfollow_cycle; //[0-9]
  41.     private $unfollow_source; // [ db or all ]
  42.     private $unfollow_who_dont_follow_back; //[0-1]
  43.     private $autostop_likes_count; //[0-9]
  44.     private $autostop_comments_count; //[0-1]
  45.     private $autostop_follows_count; //[0-1]
  46.     private $autostop_unfollows_count; //[0-1]
  47.     private $autostop_timer; // hh-mm 09-23
  48.     private $autostop_no_activity; // [1h - 3h -12h - 1d - 3d - 1w];
  49.     private $activity_schedule; // array needs helper to fix time fromat
  50.     private $list_tags; // array()
  51.     private $list_users; // array()
  52.     private $list_locations; // array()
  53.     private $list_comments; // array()
  54.     private $blacklist_tags; // array()
  55.     private $blacklist_keywords; // array()
  56.     private $time_zone; // stirng()
  57.  
  58.  
  59.     function __construct()
  60.     {
  61.         $this->db = MyDb::getInstance()->getConnection();
  62.     }
  63.  
  64.     public function setSettings($md5id)
  65.     {
  66.         $settings_row = $this->db->queryFirstRow('SELECT settings,username,password FROM accounts WHERE md5id=%s', $md5id);
  67.        
  68.         $settings_arr = json_decode($settings_row['settings'], true);
  69.         $this->md5id = $md5id;
  70.         $this->instagram_username = $settings_row['username'];
  71.         $this->instagram_password = $settings_row['password'];
  72.         $this->like = $settings_arr['likeCheckbox'];
  73.         $this->comment = $settings_arr['commentsCheckbox'];
  74.         $this->follow = $settings_arr['followCheckbox'];
  75.         $this->unfollow = $settings_arr['unfollowCheckbox'];
  76.         $this->upload_photo = $settings_arr['schedulePhotoUploadCheckbox'];
  77.         $this->target = $settings_arr['targetType'];
  78.         $this->targetCommenters = $settings_arr['targetMediaCommentersCheckbox'];
  79.         $this->targetLikers = $settings_arr['targetMediaLikersCheckbox'];
  80.         $this->targetFollowType = $settings_arr['targetFollowType'];
  81.         $this->media_type = $settings_arr['mediaType'];
  82.         $this->min_likes = $settings_arr['inpMinimumLikes'];
  83.         $this->max_likes = $settings_arr['inpMaximumLikes'];
  84.         $this->min_comments = $settings_arr['inpMinComments'];
  85.         $this->max_comments = $settings_arr['inpMaxComments'];
  86.         $this->media_age = $settings_arr['mediaAge'];
  87.         $this->user_profile = $settings_arr['userProfileFilter'];
  88.         $this->min_followers = $settings_arr['inpMinFollowers'];
  89.         $this->max_followers = $settings_arr['inpMaxFollowers'];
  90.         $this->min_followings = $settings_arr['inpMinFollowings'];
  91.         $this->max_followings = $settings_arr['inpMaxFollowings'];
  92.         $this->user_relation = $settings_arr['userRelationFilter'];
  93.         $this->min_posts = $settings_arr['inpMinMediaCount'];
  94.         $this->max_posts = $settings_arr['inpMaxMediaCount'];
  95.         $this->max_tags = $settings_arr['inpTagsCount'];
  96.         $this->tag_tag = $settings_arr['tagAndTagCheckbox'];
  97.         $this->username_tag = $settings_arr['usernameAndTagCheckbox'];
  98.         $this->location_tag = $settings_arr['locationAndTagCheckbox'];
  99.         $this->dont_comment_same_user = $settings_arr['dontCommentSameUserCheckbox'];
  100.         $this->dont_follow_same_user = $settings_arr['followDontSameUserCheckbox'];
  101.         $this->dont_follow_privet_user = $settings_arr['followDontPrivateUserCheckbox'];
  102.         $this->follow_cycle = $settings_arr['inpFollowCycle'];
  103.         $this->unfollow_cycle = $settings_arr['inpunFollowCycle'];
  104.         $this->unfollow_source = $settings_arr['unfollowSource'];
  105.         $this->unfollow_who_dont_follow_back = $settings_arr['unfollowWhoDontFollowMeCheckbox'];
  106.         $this->autostop_likes_count = $settings_arr['inpLikeLimit'];
  107.         $this->autostop_comments_count = $settings_arr['inpCommentLimit'];
  108.         $this->autostop_follow_count = $settings_arr['inpFollowLimit'];
  109.         $this->autostop_unfollow_count = $settings_arr['inpUnfollowLimit'];
  110.         $this->autostop_timer = $settings_arr['inpTimeLimit'];
  111.         $this->autostop_no_activity = $settings_arr['downtimeLimit'];
  112.         $this->activity_schedule = json_decode($settings_arr['activitySchedule'], true);
  113.         $this->list_tags = json_decode($settings_arr['tagsListInput'], true);
  114.         $this->list_users = json_decode($settings_arr['usernamesInput'], true);
  115.         $this->list_locations = json_decode($settings_arr['locationTagsInput'], true);
  116.         $this->list_comments = json_decode($settings_arr['commentsTagsInput'], true);
  117.         $this->blacklist_tags = json_decode($settings_arr['tagsBlackListInput'], true);
  118.         $this->blacklist_keywords = json_decode($settings_arr['keyWordsBlackListInput'], true);
  119.     }
  120.  
  121.  
  122.     public function getSettingRow()
  123.     {
  124.         return $this->settings_row;
  125.     }
  126.  
  127.     public function getmd5id()
  128.     {
  129.         return $this->md5id;
  130.     }
  131.  
  132.  
  133.     public function getInstagramUsername()
  134.     {
  135.         return $this->instagram_username;
  136.     }
  137.  
  138.     public function getInstagramPassword()
  139.     {
  140.         return $this->instagram_password;
  141.     }
  142.  
  143.     public function getLike()
  144.     {
  145.         return $this->like;
  146.     }
  147.  
  148.     public function getComment()
  149.     {
  150.         return $this->comment;
  151.     }
  152.  
  153.     public function getFollow()
  154.     {
  155.         return $this->follow;
  156.     }
  157.  
  158.     public function getunFollow()
  159.     {
  160.         return $this->unfollow;
  161.     }
  162.  
  163.     public function getUploadPhoto()
  164.     {
  165.         return $this->upload_photo;
  166.     }
  167.  
  168.     public function getTarget()
  169.     {
  170.         return $this->target;
  171.     }
  172.  
  173.     public function getTargetCommenters()
  174.     {
  175.         return $this->targetCommenters;
  176.     }
  177.  
  178.     public function getTargetLikers()
  179.     {
  180.         return $this->targetLikers;
  181.     }
  182.  
  183.     public function getTargetFollowType()
  184.     {
  185.         return $this->targetFollowType;
  186.     }
  187.  
  188.     public function getMediaType()
  189.     {
  190.         return $this->media_type;
  191.     }
  192.  
  193.     public function getMinLikes()
  194.     {
  195.         return $this->min_likes;
  196.     }
  197.  
  198.     public function getMaxLikes()
  199.     {
  200.         return $this->max_likes;
  201.     }
  202.  
  203.     public function getMinComments()
  204.     {
  205.         return $this->min_comments;
  206.     }
  207.  
  208.     public function getMaxComments()
  209.     {
  210.         return $this->max_comments;
  211.     }
  212.  
  213.     public function getMediaAge()
  214.     {
  215.         return $this->media_age;
  216.     }
  217.  
  218.     public function getUserProfile()
  219.     {
  220.         return $this->user_profile;
  221.     }
  222.  
  223.     public function getMinFollowers()
  224.     {
  225.         return $this->min_followers;
  226.     }
  227.  
  228.     public function getMaxFollowers()
  229.     {
  230.         return $this->max_followers;
  231.     }
  232.  
  233.     public function getMinFollowings()
  234.     {
  235.         return $this->min_followings;
  236.     }
  237.  
  238.     public function getMaxFollowings()
  239.     {
  240.         return $this->max_followings;
  241.     }
  242.  
  243.     public function getUserRelation()
  244.     {
  245.         return $this->user_relation;
  246.     }
  247.  
  248.     public function getMinPosts()
  249.     {
  250.         return $this->min_posts;
  251.     }
  252.  
  253.     public function getMaxPosts()
  254.     {
  255.         return $this->max_posts;
  256.     }
  257.  
  258.     public function getMaxTags()
  259.     {
  260.         return $this->max_tags;
  261.     }
  262.  
  263.     public function getTagTag()
  264.     {
  265.         return $this->tag_tag;
  266.     }
  267.  
  268.     public function getUsernameTag()
  269.     {
  270.         return $this->username_tag;
  271.     }
  272.  
  273.     public function getLocationTag()
  274.     {
  275.         return $this->location_tag;
  276.     }
  277.  
  278.     public function getDontCommentSameUser()
  279.     {
  280.         return $this->dont_comment_same_user;
  281.     }
  282.  
  283.     public function getDontFollowSameUser()
  284.     {
  285.         return $this->dont_follow_same_user;
  286.     }
  287.  
  288.     public function getDontFollowPrivetUser()
  289.     {
  290.         return $this->dont_follow_privet_user;
  291.     }
  292.  
  293.     public function getFollowCycle()
  294.     {
  295.         return $this->follow_cycle;
  296.     }
  297.  
  298.     public function getUnFollowCycle()
  299.     {
  300.         return $this->unfollow_cycle;
  301.     }
  302.  
  303.     public function getUnFollowSource()
  304.     {
  305.         return $this->unfollow_source;
  306.     }
  307.  
  308.     public function getUnFollowWhoDontFollowBack()
  309.     {
  310.         return $this->unfollow_who_dont_follow_back;
  311.     }
  312.  
  313.     public function getAutostopLikesCount()
  314.     {
  315.         return $this->autostop_likes_count;
  316.     }
  317.  
  318.     public function getAutostopCommentsCount()
  319.     {
  320.         return $this->autostop_comments_count;
  321.     }
  322.  
  323.     public function getAutostopFollowCount()
  324.     {
  325.         return $this->autostop_follows_count;
  326.     }
  327.  
  328.     public function getAutostopUnFollowCount()
  329.     {
  330.         return $this->autostop_unfollows_count;
  331.     }
  332.  
  333.     public function getAutostopTimer()
  334.     {
  335.         return $this->autostop_timer;
  336.     }
  337.  
  338.     public function getAutostopNoActivity()
  339.     {
  340.         switch ($this->autostop_no_activity)
  341.         {
  342.             case "1h":
  343.                 $this->autostop_no_activity = "1 hours";
  344.                 break;
  345.             case "3h":
  346.                 $this->autostop_no_activity = "3 hours";
  347.                 break;
  348.             case "12h":
  349.                 $this->autostop_no_activity = "12 hours";
  350.                 break;
  351.             case "1d":
  352.                 $this->autostop_no_activity = "1 day";
  353.                 break;
  354.             case "3d":
  355.                 $this->autostop_no_activity = "3 day";
  356.                 break;
  357.             case "1w":
  358.                 $this->autostop_no_activity = "1 week";
  359.                 break;
  360.         }
  361.         return $this->autostop_no_activity;
  362.     }
  363.  
  364.     public function getActivitySchedule()
  365.     {
  366.         return $this->activity_schedule;
  367.     }
  368.  
  369.     public function getListTags()
  370.     {
  371.         return $this->list_tags;
  372.     }
  373.  
  374.     public function getListUsers()
  375.     {
  376.         return $this->list_users;
  377.     }
  378.  
  379.     public function getListComments()
  380.     {
  381.         return $this->list_comments;
  382.     }
  383.  
  384.     public function getListBlacklistTags()
  385.     {
  386.         return $this->blacklist_tags;
  387.     }
  388.  
  389.     public function getListBlacklistKeywords()
  390.     {
  391.         return $this->blacklist_keywords;
  392.     }
  393.  
  394.  
  395.  
  396. }
  397.  
  398. ?>
Add Comment
Please, Sign In to add comment