From 59074db2c35bcbe5c6d3afb4ea02f34849dd8758 Mon Sep 17 00:00:00 2001 From: Saqib Razzaq Date: Fri, 4 Nov 2016 15:51:54 +0500 Subject: [PATCH 1/2] Removed junk curl request --- upload/actions/file_uploader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/actions/file_uploader.php b/upload/actions/file_uploader.php index d92d30b5..cfdd2b9b 100644 --- a/upload/actions/file_uploader.php +++ b/upload/actions/file_uploader.php @@ -40,7 +40,7 @@ switch($mode) $vid = $Upload->submit_upload($vidDetails); - // sending curl request to content .ok + /*// sending curl request to content .ok $call_bk = PLUG_URL."/cb_multiserver/api/call_back.php"; $ch = curl_init($call_bk); $ch_opts = array( @@ -60,7 +60,7 @@ switch($mode) curl_setopt_array($ch,$charray); curl_exec($ch); - curl_close($ch); + curl_close($ch);*/ // inserting into video views as well $query = "INSERT INTO " . tbl("video_views") . " (video_id, video_views, last_updated) VALUES({$vid}, 0, " . time() . ")"; From 569155624ef7a828a28364c8ce75851b3eb1207a Mon Sep 17 00:00:00 2001 From: Saqib Razzaq Date: Fri, 4 Nov 2016 16:33:32 +0500 Subject: [PATCH 2/2] Added gotPlugin() function for checking if a plugin is installed and active --- upload/includes/functions.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/upload/includes/functions.php b/upload/includes/functions.php index a2060bfd..cf36ad1f 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -5733,6 +5733,26 @@ return $date->getTimestamp(); } + /** + * Check if a plugin is installe, active and has main file + * @param : { string } { $mainFile } { File to run check against } + * @author : Saqib Razzaq + * @since : 4th November, 2016 + * + * @return : { boolean } { true or false matching pattern } + */ + + function gotPlugin($mainFile) { + global $db; + $installCheck = $db->select(tbl('plugins'),'plugin_folder,plugin_active',"plugin_file = '$mainFile'"); + $pluginFolder = $installCheck[0]['plugin_folder']; + $pluginStatus = $installCheck[0]['plugin_active']; + + if (!empty($pluginFolder) && $pluginStatus != 'no') { + return file_exists(PLUG_DIR.'/'.$pluginFolder.'/'.$mainFile); + } + } + include( 'functions_db.php' ); include( 'functions_filter.php' );