Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param int $id
- * To fetch all options for the custom ID
- * @param string $key
- * String in a format accepted name of key in options table to find it
- **/
- function plugin_option($id, $key, $type)
- {
- $get_option_val = row_one("plugins_options", "op_key='".$key."' and the_id='".$id."' and the_type='".$type."' " , "");
- if(!empty($get_option_val))
- {
- return $get_option_val['op_value'];
- }else {
- return "";
- }
- }
- /**
- * @param string $key
- * String in a format accepted name of key in options table to find it
- * @param string $val
- * String in a format accepted the new value of key in options table to update it
- **/
- function update_plugin_option($id, $key, $val, $type)
- {
- $check_option_name = row_one("plugins_options", "op_key='".$key."' and the_id='".$id."' and the_type='".$type."' ", "");
- if(!empty($check_option_name))
- {
- $value = array();
- $value["op_value"] = $val;
- update("plugins_options", $value,"op_key='".$key."' and the_id='".$id."' and the_type='".$type."' ","");
- }else {
- $value = array();
- $value['the_id'] = $id;
- $value['the_type'] = $type;
- $value['op_key'] = $key;
- $value['op_value'] = $val;
- Insertdb("plugins_options", $value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement