[email protected]
Forum Replies Created
-
Forum: Plugins
In reply to: [RAD Dropbox Uploader] Upload Form always appears at top of pageI am no PHP programmer, but I have fixed this bug for myself. I did the following:
In
rad-dropbox-uploader/rad-dropbox-uploader.php
On line 110, you declare the shortcode handler function:
function rad_dropbox_shortcode( $atts )
I added one line:
return $var_sHTML;
2. In your supporting file:
rad-dropbox-uploader/inc/shortcode.php
I defined a variable to hold the HTML form output:
$var_sHTML = '';
Then concatenated the HTML for the form to it:
$var_sHTML .= <HTML form declaration here>
The handler function now returns the HTML form to the WordPress engine, rather than simply echoing it to the browser. The HTML form code replaces the shortcode in your user’s HTML and problem solved ??
Andrew
PS Below I have pasted my edited code for your file:
rad-dropbox-uploader/inc/shortcode.php
<?php extract(shortcode_atts(array("dir" => $directory, "button" => 'Upload To Dropbox!'), $atts)); $rad_dropbox_settings = admin_url( 'admin.php?page=rad_dropbox_settings', '' ); if (empty($wp_settings_check)) { echo '<div class="message-yellow">You must enter your Dropbox account details first! Please go to the <a href="'.$rad_dropbox_settings.'">settings</a> page!</div><br>'; } echo $message; //beginning of mods here $var_sHTML = ''; // concatenates the string below (the def of the HTML form) to the null string declared above. // HTML below now concatenated with $variables instead of echoing their values $var_sHTML .= '<form method="POST" enctype="multipart/form-data" class="rad-dropbox-uploader"> <input type="hidden" name="dest" value="' . $dir . '" /> <div class="rad-dropbox-file"> <div style="margin-bottom:10px;"> <b>Upload Resume or Headshot</b> </div> <input type="file" name="file" class="rad-dropbox-file" /> </div> <div class="rad-dropbox-button"> <input type="submit" value="' . $button . '" class="rad-dropbox-button" /> </div> </form>'; ?>
Forum: Plugins
In reply to: [RAD Dropbox Uploader] Upload Form always appears at top of pageRad-dropbox version: 1.1.0
Hello,
I have had trouble uploading to a specific drop box directory.
[rad-dropbox dir=”/Path/To/Folder”]I am able to:
1. upload to the root of my dropbox account
2. upload to a /uploads directory when I specify that path under the settings.However when I try to upload to a different directory by specifying a dir attribut in my shortcode such as: [rad-dropbox dir=”/folder1/folder2″] the files are instead uploaded to the default directory set under settings rather than to the correct folder.
Thanks again for a nice plug-in. And please let me know if there is any further testing I can do.