/**
  * Delete applications
  * @param	array	array of application_id to be deleted.
  */
 function deleteApplications($ids)
 {
     //foreach of these ids, delete all their associations
     foreach ($ids as $id) {
         $app = new Application($id);
         $app->deleteApplication();
     }
     //now delete it from the application table
     $id_list = implode(', ', $ids);
     $sql = "DELETE FROM %ssocial_applications WHERE id IN (%s)";
     queryDB($sql, array(TABLE_PREFIX, $id_list));
 }
 /**
  * Delete applications
  * @param	array	array of application_id to be deleted.
  */
 function deleteApplications($ids)
 {
     global $db;
     //foreach of these ids, delete all their associations
     foreach ($ids as $id) {
         $app = new Application($id);
         $app->deleteApplication();
     }
     //now delete it from the application table
     $id_list = implode(', ', $ids);
     $sql = 'DELETE FROM ' . TABLE_PREFIX . "social_applications WHERE id IN ({$id_list})";
     mysql_query($sql, $db);
 }
Example #3
0
//Display individual application
if (isset($_REQUEST['app_id'])){
	$_REQUEST['app_id'] = intval($_REQUEST['app_id']);
	$app = new Application($_REQUEST['app_id']);	//testing application 1, 2
	
	//Add application
	if (isset($_GET['add']) && intval($_GET['add'])==1){
		$app->addMemberApplication($_SESSION['member_id'], $_GET['app_id']);
		$msg->addFeedback('GADGET_ADDED_SUCCESSFULLY');
		header('Location: '. url_rewrite(AT_SOCIAL_BASENAME.'applications.php', AT_PRETTY_URL_IS_HEADER));
		exit;
	}

	//Delete application
	if (isset($_GET['delete']) && intval($_GET['delete']) > 0) {
		$app->deleteApplication();
		$msg->addFeedback('GADGET_REMOVED_SUCCESSFULLY');
		header('Location: '. $_SERVER['HTTP_REFERER']);
		exit;
	}

	//Display application settings
	if (isset($_GET['settings'])){
		include(AT_INCLUDE_PATH.'header.inc.php');
		$savant->assign('settings', $app->getSettings());	//userPrefs
		$savant->assign('user_settings', $app->getApplicationSettings($_SESSION['member_id']));
		$savant->assign('app_id', $app->getId());	//id
		$savant->display('social/application_settings.tmpl.php');
		include(AT_INCLUDE_PATH.'footer.inc.php');		
		exit;
	}