manager mode question
-
I noticed that when I enable manager mode I no longer have the option to have audio files play. Is there a way to change this with the settings? I have a site where I need to have members be able to rename and delete files but also to be able to listen to them without downloading.
-
Sorry. The mechanisms of each mode get in the way of each other. You could create a custom little function that would allow them to enable and disable manager mode. Give me a couple minutes and I’ll give you an example.
Here, add this to your theme’s functions.php file.
class my_custom_fileaway_class { public function __construct() { add_shortcode('fa_manager_toggle', array($this, 'toggle')); } public function toggle() { if(!class_exists('fileaway')) return false; if(isset($_REQUEST['fa_manager'])) { $link = fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array('fa_manager'), true); $output = '<a class="your-css-class" href="'.$link.'" target="_self">Disable Manager Mode</a><br>'; $output .= do_shortcode('[fileaway directories=true manager=true]'); } else { $link = fileaway_utility::querystring(get_permalink(), $_SERVER["QUERY_STRING"], array('fa_manager' => '1')); $output = '<a class="your-css-class" href="'.$link.'" target="_self">Enable Manager Mode</a><br>'; $output .= do_shortcode('[fileaway directories=true playback=extended]'); } return $output; } } new my_custom_fileaway_class;You’ll want to modify the shortcodes, and you can specify the css class for the link.
Then on your page, just use this shortcode:
[fa_manager_toggle]I added the code to the functions.php file but it gave me an error that the } in line 6 was “unexpected” and wouldn’t allow my site to load.
It works fine in my functions.php.
Can you show me the lines before and after the code I provided, including line 6?
Or you could email me your functions.php file to fileaway.plugin@gmail.com and I’ll find your syntax error and send it back to you.
I copied and pasted exactly what you had here:
class my_custom_fileaway_class
{
public function __construct()
{
add_shortcode(‘fa_manager_toggle’, array($this, ‘toggle’));
}
public function toggle()
{
if(!class_exists(‘fileaway’)) return false;
if(isset($_REQUEST[‘fa_manager’]))
{
$link = fileaway_utility::querystring(get_permalink(), $_SERVER[“QUERY_STRING”], array(‘fa_manager’), true);
$output = ‘Disable Manager Mode
‘;
$output .= do_shortcode(‘[fileaway directories=true manager=true]’);
}
else
{
$link = fileaway_utility::querystring(get_permalink(), $_SERVER[“QUERY_STRING”], array(‘fa_manager’ => ‘1’));
$output = ‘Enable Manager Mode
‘;
$output .= do_shortcode(‘[fileaway directories=true playback=extended]’);
}
return $output;
}
}
new my_custom_fileaway_class;Yes, I need to see what’s in your file before and after what you copied and pasted. The syntax error is not in my code.
ok I must have done something wrong the first time, the error went away. But now it is showing all my files instead of the directory that I specified.
As I said, you’ll need to modify the shortcodes in the custom code provided. Or, give me the shortcodes that you had originally, and I will modify it for you and post it here.
These two lines are the lines that you need to modify:
$output .= do_shortcode('[fileaway directories=true manager=true]');and
$output .= do_shortcode('[fileaway directories=true playback=extended]');Just modify the shortcode part. One should have manager mode enabled. The other should have playback enabled, as exampled.
ok thanks!
No problem.
The topic ‘manager mode question’ is closed to new replies.