-
Search Results
-
Hi,
I use the above plugin with [wpdm-archive] shortcode in a page. The problem is that not all categories are shown(6 instead of 7) and when I click on a category it says no downloads found despite the fact that there are downloads in the category.
URL: http://e-thessalia.gr/%CF%80%CE%B5%CF%81%CE%B9%CE%BF%CF%87%CE%AE-%CF%83%CF%85%CE%BD%CE%B4%CF%81%CE%BF%CE%BC%CE%B7%CF%84%CF%8E%CE%BD/Topic: URL Structure
I just installed Pro 3.3.7. When I add a new package, I see a “Custom package url” of:
http://www.carlsonsw.com/download/underground-mining-2014-box-image-jpg/However, on my live site “wordpress” is added to the URL:
http://www.carlsonsw.com/wordpress/download/underground-mining-2014-box-image-jpgHow can I fix this? Wasn’t an issues with the free version.
Thanks, Todd
Hi there :), Thanks for awesome download plugin.
I still have some issues on these;
First of all here is my url for website http://www.seafdec.org/test/seafdec-publications/
1. The page layout, I’d like to have only 2 columns instead of 3. Is it possible? Can you help me on this?
2. I’d like to have only the categories menu show on the page (don’t need the latest package below).
3. The side widget (please see Latest Publications) Is it possible to remove the dot? i know it’s related to list style in css but i don’t know where to make change on this.
These all of my concern now 🙂 Thank you very muchGreat news, I got it working, and it’s working great!
Just need to clean up some things, and finish it to be fully dynamic (there is one new wp_option I may need to store, and maybe add a few inputs to file-manager/add-new-package for it). I also need to add some if conditions, to properly handle my script to only be triggered if “FTP-DUMP” or something is enabled. I’d like to clean up my handling of absolute/relative paths too. It’s very dirty still.
So far, I only had to add change one block of code, and add a new block.
Then, I referenced my own script in it’s own PHP file, and I just include it once if admin.php?page=file-manager&task=RefreshPackage, it pulls the needed references to define it’s variables from $_GET[‘id] (WPDM’s file package DB records). I built it off your current Add/Edit system.Here is the change log to your source:
[the code tags on this forum seem to trim some of my code, so I will also attach a .txt]
**NOTE:**
I always apply source formatting via Dreamweaver when I edit files, so my line numbers won't match unless you do that first.
Therefore, relying on line numbers isn't best, so I will also reference local objects/*///////////////////////////////////////////////////////////////
//in: list-files.php
+:
[replaces][div class="button-group"](near line 119 w/ applied source formatting)
creates a new button for "Refresh Package" on the Download Package Management back-end page, and inserts a line break () in button-group div
so that all the buttons fit in the table cell
//////////////////////////////////////////////////////////////*/<a class="button" href="admin.php?page=file-manager&task=RefreshPackage&id=" style="color: #90F">Refresh Package
<a class="button" href="admin.php?page=file-manager&task=EditPackage&id=">Edit<a class="button" href="admin.php?page=file-manager/add-new-package&clone=" style="color: #336699">Clone
<a class="button" target="_blank" href='' style="color: #005500">View
<a href="admin.php?page=file-manager&task=DeleteFile&id=" class="button submitdelete" style="color: #cc0000" rel=" " title="Permanently">Delete/*///////////////////////////////////////////////////////////////
//in: wpdm.php
+:
[appended][fuction RefreshPackage()](added near line 409 w/ applied source formatting)
adds function for "Refresh Package" button to refresh the package's item
//////////////////////////////////////////////////////////////*/
function RefreshPackage(){global $wpdb, $current_user;
get_currentuserinfo();
$cond_uid = wpdm_multi_user()&&!wpdm_is_custom_admin()?"and uid='{$current_user->ID}'":"";$id = $_GET['id'];
$table_name = "{$wpdb->prefix}ahm_files";
$file = $wpdb->get_row("SELECT * FROM {$table_name} WHERE `id` = {$id} $cond_uid", ARRAY_A);
if(!$file[id]) {
$error = "Sorry, You don't have permission to edit that file!";
include("error-page.php");
return;
}include('refreshpackage.php');
}
and this is the code for my refreshpackage.php, needs to be cleaned up now as I said:
$dir) {
// find first non-matching dir
if($dir === $to[$depth]) {
// ignore this directory
array_shift($relPath);
} else {
// get number of remaining dirs to $from
$remaining = count($from) - $depth;
if($remaining > 1) {
// add traversals up to first matching dir
$padLength = (count($relPath) + $remaining - 1) * -1;
$relPath = array_pad($relPath, $padLength, '..');
break;
} else {
$relPath[0] = './' . $relPath[0];
}
}
}
return implode('/', $relPath);
}
/* END RELATIVE PATH COMPARER *//* DEFINE VARS */
$packageID = $_GET['id'];
$siteurl = site_url();
$wpmdpath = WPDM_BASE_DIR;
$zippath = $file[sourceurl]; //full path needs to be trimmed below...
$zipfilename = basename($file[sourceurl]); //file name
$zippath = str_replace($zipfilename,"",$zippath); //trim trailing file name
$sourceDIRname = "http://www.example.com/downloads/General-Packages/imagesonly/"; //need to dynamically define this later. MUST BE ON SAME SERVER!!
/* END DEFINE VARS *//* CLEAN/TRIM SOURCE PATHS */
//the idea here is to trim all the prefixes to the file-sourceurl and the site_url(), so we can compare them, even if
//the site_url is http://example.com and the file-sourceurl is http://www.example.com/file.zip, or hopefully even if it was a local WP site.
//
//trim possible url prefixes..
$zippath = str_replace("http://","",$zippath);
$zippath = str_replace("www.","",$zippath);
$zippath = str_replace("//","",$zippath);
$zippath = str_replace("\\","",$zippath);
$siteurl = str_replace("http://","",$siteurl);
$siteurl = str_replace("www.","",$siteurl);
$siteurl = str_replace("//","",$siteurl);
$siteurl = str_replace("\\","",$siteurl);
$sourceDIRname = str_replace("http://","",$sourceDIRname);
$sourceDIRname = str_replace("www.","",$sourceDIRname);
$sourceDIRname = str_replace("//","",$sourceDIRname);
$sourceDIRname = str_replace("\\","",$sourceDIRname);
//trim off remaining site url...
$zippath = str_replace($siteurl,"",$zippath);
$sourceDIRname = str_replace($siteurl,"",$sourceDIRname);
/* END CLEAN/TRIM SOURCE PATHS *//**************************************/
/* COMPARE PATHS TO FIND REAL REL PATH */
/* FOR ZIP-SOURCE-DIR & ZIP-OUTPUT-DIR */
$sourcefolder = wpmd_getRelativePath("./", $sourceDIRname); // must be rel to $wpmdpath
$outputfolder = wpmd_getRelativePath("./", $zippath); // must be rel to $wpmdpath
/**************************************/$timeout = 100000 ; // Default: 50000
// This creates the zip file
$dirlist = new RecursiveDirectoryIterator($sourcefolder);
$filelist = new RecursiveIteratorIterator($dirlist);// Set the php timeout
ini_set('max_execution_time', $timeout);
// Defines the action
$zip = new ZipArchive();
?>
open("$zipfilename", ZipArchive::OVERWRITE) !== TRUE) {
die ("Could not open archive");
}// adds files to the file list
foreach ($filelist as $key►$value) {
//fix archive paths
$path = str_replace($sourcefolder, "", $key);$zip->addFile(realpath($key), $path) or die ("ERROR: Could not add file: $key");
}// closes the archive
$zip->close();
//move to output if necessary
if ($outputfolder != "./") {
if (copy("./" . $zipfilename,"" .$outputfolder . "/" . $zipfilename . "")) {
unlink("./" . $zipfilename);
}
}
echo "Archive ". $zipfilename . " created successfully!";
?>
Of course, I will also add a location href at the end of my script to reload page?=file-manager, and will echo a “Successful!” message there when it’s done. Now I get to smooth out all the details! 🙂
Do you think any of this may be of benefit to you?