$user_data_general["{$perm_name}"] = $perm_value; } $outputthis_error_mesg = ""; $show_external_blogs = TRUE; $outputthis_username = trim(@$user_data_general['outputthis_username']); $outputthis_password = trim(@$user_data_general['outputthis_password']); if (empty($outputthis_username) || empty($outputthis_password)) { $show_external_blogs = FALSE; $outputthis_error_mesg = OUTPUTTHIS_ERROR_MESSAGE; } else { // fetch outputthis targets (if we don't have them in the ext_cache already) $cache_key = "outputthis_targets"; $targets = Cache::getExtCache(PA::$login_uid, $cache_key); if ($targets === NULL) { // not cached $targets = OutputThis::get_targets($outputthis_username, $outputthis_password); if ($targets[0] == 'error') { $show_external_blogs = FALSE; $outputthis_error_mesg = ucfirst($targets[1]); } else { if (!empty($targets)) { // remember them for next time - so we don't have to wait for outputthis on every page view Cache::setExtCache(PA::$login_uid, $cache_key, $targets); } } } } $is_edit = 0; } else { $is_edit = 1; // Temporary solution to hide the external routing in edit mode
include_once "{$path_prefix}/api/Theme/Template.php"; if (!$_GET['uid']) { $uid = $_SESSION['user']['id']; } else { $uid = $_GET['uid']; } $user_destinations = ContentRouting::get_user_destinations((int) $_SESSION['user']['id']); $dest_output_this = array(); $dest_other = array(); //print_r($user_destinations);exit; $k = 0; foreach ($user_destinations as $destination) { if ($destination['blog_type'] == 4) { $dest_output_this['id'] = $destination['id']; $dest_output_this['blog_name'] = $destination['blog_name']; $dest_output_this['blog_url'] = $destination['blog_url']; $dest_output_this['blog_type'] = $destination['blog_type']; } else { $dest_other[$k]['id'] = $destination['id']; $dest_other[$k]['blog_name'] = $destination['blog_name']; $dest_other[$k]['blog_url'] = $destination['blog_url']; $dest_other[$k]['blog_type'] = $destination['blog_type']; $k++; } } if ($dest_output_this) { $targets = OutputThis::get_targets((int) $dest_output_this['id']); } $center_content =& new Template(CURRENT_THEME_FSPATH . "/output_dest.tpl"); $center_content->set('targets', $targets); print $center_content->fetch();