back-up your database first just in case. You may need to re-save your permalink settings after upgrading if your downloads stop working.
Version: 3.2
Author: Mike Jolley
Author URI: http://blue-anvil.com
*/
/* Copyright 2006 Michael Jolley (email : jolley.small.at.googlemail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
################################################################################
// Vars and version
################################################################################
global $wp_db_version;
if ($wp_db_version < 8201) {
// Pre 2.6 compatibility (BY Stephen Rider)
if ( ! defined( 'WP_CONTENT_URL' ) ) {
if ( defined( 'WP_SITEURL' ) ) define( 'WP_CONTENT_URL', WP_SITEURL . '/wp-content' );
else define( 'WP_CONTENT_URL', get_option( 'url' ) . '/wp-content' );
}
if ( ! defined( 'WP_CONTENT_DIR' ) ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
if ( ! defined( 'WP_PLUGIN_URL' ) ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
if ( ! defined( 'WP_PLUGIN_DIR' ) ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
}
$dlm_build="B20090622";
$wp_dlm_root = WP_PLUGIN_URL."/download-monitor/";
global $table_prefix;
$wp_dlm_db = $table_prefix."DLM_DOWNLOADS";
$wp_dlm_db_cats = $table_prefix."DLM_CATS";
$wp_dlm_db_formats = $table_prefix."DLM_FORMATS";
$wp_dlm_db_stats = $table_prefix."DLM_STATS";
$wp_dlm_db_log = $table_prefix."DLM_LOG";
$wp_dlm_db_meta = $table_prefix."DLM_META";
$def_format = get_option('wp_dlm_default_format');
$dlm_url = get_option('wp_dlm_url');
$downloadtype = get_option('wp_dlm_type');
if (empty($dlm_url))
$downloadurl = $wp_dlm_root.'download.php?id=';
else
$downloadurl = get_bloginfo('url').'/'.$dlm_url;
//$downloadurl = get_bloginfo('wpurl').'/'.$dlm_url;
/* Changed to url so that wordpress in a sub dir works with custom urls */
load_plugin_textdomain('wp-download_monitor', WP_PLUGIN_URL.'/download-monitor/languages/', 'download-monitor/languages/');
################################################################################
// ADD MEDIA BUTTONS AND FORMS
################################################################################
function wp_dlm_add_media_button() {
global $wp_dlm_root;
$url = WP_PLUGIN_URL.'/download-monitor/uploader.php?tab=add&TB_iframe=true&height=500&width=640';
if (is_ssl()) $url = preg_replace( '/^http:\/\//', 'https://', $url );
echo '
';
}
################################################################################
// HANDLE UPDATES
################################################################################
function wp_dlm_update() {
global $dlm_build;
add_option('wp_dlm_build', $dlm_build, 'Version of DLM plugin', 'no');
if ( get_option('wp_dlm_build') != $dlm_build ) {
// Init again
wp_dlm_init();
// Update the build
update_option('wp_dlm_build', $dlm_build);
}
}
################################################################################
// Set up menus within the wordpress admin sections
################################################################################
function wp_dlm_menu() {
global $wp_dlm_root;
// Add a new top-level menu:
add_menu_page(__('Downloads','wp-download_monitor'), __('Downloads','wp-download_monitor'), 'user_can_edit_downloads', __FILE__ , 'wp_dlm_admin', $wp_dlm_root.'/img/menu_icon.png');
// Add submenus to the custom top-level menu:
add_submenu_page(__FILE__, __('Edit','wp-download_monitor'), __('Edit','wp-download_monitor') , 'user_can_edit_downloads', __FILE__ , 'wp_dlm_admin');
add_submenu_page(__FILE__, __('Add New','wp-download_monitor') , __('Add New','wp-download_monitor') , 'user_can_add_new_downloads', 'dlm_addnew', 'dlm_addnew');
add_submenu_page(__FILE__, __('Add Existing','wp-download_monitor') , __('Add Existing','wp-download_monitor') , 'user_can_add_existing_downloads', 'dlm_addexisting', 'dlm_addexisting');
add_submenu_page(__FILE__, __('Configuration','wp-download_monitor') , __('Configuration','wp-download_monitor') , 'user_can_config_downloads', 'dlm_config', 'wp_dlm_config');
if (get_option('wp_dlm_log_downloads')=='yes') add_submenu_page(__FILE__, __('Log','wp-download_monitor') , __('Log','wp-download_monitor') , 'user_can_view_downloads_log', 'dlm_log', 'wp_dlm_log');
}
add_action('admin_menu', 'wp_dlm_menu');
################################################################################
// ADMIN HEADER
################################################################################
function wp_dlm_head() {
global $wp_db_version, $wp_dlm_root;
// Provide css based on wordpress version.
if ($wp_db_version < 9872) {
// 2.5 + 2.6 with new interface
echo '';
} else {
// 2.7
echo '';
}
if (
$_REQUEST['page']=='dlm_addnew' ||
$_REQUEST['page']=='dlm_addexisting' ||
$_REQUEST['page']=='download-monitor/wp-download_monitor.php' ||
$_REQUEST['page']=='download-monitor/wp-download_monitor.php'
) {
?>
add_cap( 'administrator', 'user_can_config_downloads' );
$wp_roles->add_cap( 'administrator', 'user_can_edit_downloads' );
$wp_roles->add_cap( 'administrator', 'user_can_add_new_downloads' );
$wp_roles->add_cap( 'administrator', 'user_can_add_existing_downloads' );
$wp_roles->add_cap( 'administrator', 'user_can_view_downloads_log' );
global $wp_dlm_db,$wp_dlm_db_cats,$wp_dlm_db_formats,$wpdb,$wp_dlm_db_stats,$wp_dlm_db_log,$wp_dlm_db_meta;
// Get Collation
$collate = "";
if($wpdb->supports_collation()) {
if(!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset";
if(!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate";
}
// Create tables
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR (200) NOT NULL ,
`filename` LONGTEXT NOT NULL ,
`file_description` LONGTEXT NULL ,
`dlversion` VARCHAR (200) NOT NULL ,
`postDate` DATETIME NOT NULL ,
`hits` INT (12) UNSIGNED NOT NULL ,
`user` VARCHAR (200) NOT NULL ,
`category_id` INT (12) NULL,
`members` INT (1) NULL,
`mirrors` LONGTEXT NULL,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db_cats." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` LONGTEXT NOT NULL ,
`parent` INT (12) UNSIGNED NOT NULL,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db_formats." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR (250) NOT NULL ,
`format` LONGTEXT NOT NULL,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db_stats." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`download_id` INT UNSIGNED NOT NULL,
`date` DATE NOT NULL ,
`hits` INT (12) UNSIGNED NOT NULL,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db_log." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`download_id` INT UNSIGNED NOT NULL,
`user_id` INT UNSIGNED NOT NULL,
`date` DATETIME NULL ,
`ip_address` VARCHAR (200) NULL ,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS ".$wp_dlm_db_meta." (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`meta_name` LONGTEXT NOT NULL ,
`meta_value` LONGTEXT NOT NULL ,
`download_id` INT (12) UNSIGNED NOT NULL,
PRIMARY KEY ( `id` )) $collate;";
$result = $wpdb->query($sql);
$q = $wpdb->get_results("select * from $wp_dlm_db;");
if ( empty( $q ) ) {
$wpdb->query("TRUNCATE table $wp_dlm_db");
}
return;
}
################################################################################
// Reinstall function
################################################################################
function wp_dlm_reinstall() {
global $wpdb, $wp_dlm_db, $wp_dlm_db_cats;
// GET OLD DATA
$wpdb->show_errors;
$query = sprintf("SELECT * from %s;",
$wpdb->escape( $wp_dlm_db ));
$result_d = $wpdb->get_results($query);
if($result_d && $wpdb->num_rows>0) {
$values="";
foreach($result_d as $d) {
$id=$d->id;
$title=$d->title;
$filename=$d->filename;
$dlversion=$d->dlversion;
$postDate=$d->postDate;
$hits=$d->hits;
$user=$d->user;
$members=$d->members;
$category_id=$d->category_id;
$mirrors=$d->mirrors;
$file_description=$d->file_description;
$values.='("'.$id.'","'.$title.'","'.$filename.'","'.$dlversion.'","'.$postDate.'","'.$hits.'","'.$user.'","'.$members.'","'.$category_id.'","'.$mirrors.'","'.$file_description.'"),';
}
$values = substr_replace($values,"",-1);
}
$query = sprintf("SELECT * from %s;",
$wpdb->escape( $wp_dlm_db_cats ));
$result_cats = $wpdb->get_results($query);
if($result_cats && $wpdb->num_rows>0) {
$values2="";
foreach($result_cats as $d) {
$id=$d->id;
$name=$d->name;
$parent=$d->parent;
$values2.='("'.$id.'","'.$name.'","'.$parent.'"),';
}
$values2 = substr_replace($values2,"",-1);
}
// DROP TABLES
$sql = 'DROP TABLE IF EXISTS `'.$wp_dlm_db.'`';
$wpdb->query($sql);
$sql = 'DROP TABLE IF EXISTS `'.$wp_dlm_db_cats.'`';
$wpdb->query($sql);
wp_dlm_init();
// Change Collation (we forgot to do this in older versions)
if($wpdb->supports_collation()) {
if(!empty($wpdb->charset)) $char_set = $wpdb->charset;
if(!empty($wpdb->collate)) $collate = 'collate '.$wpdb->collate;
}
if ($char_set) {
global $wp_dlm_db_formats,$wp_dlm_db_stats,$wp_dlm_db_log,$wp_dlm_db_meta;
$wpdb->query('ALTER TABLE '.$wp_dlm_db_formats.' convert to character set '.$char_set.' '.$collate.';');
$wpdb->query('ALTER TABLE '.$wp_dlm_db_stats.' convert to character set '.$char_set.' '.$collate.';');
$wpdb->query('ALTER TABLE '.$wp_dlm_db_log.' convert to character set '.$char_set.' '.$collate.';');
$wpdb->query('ALTER TABLE '.$wp_dlm_db_meta.' convert to character set '.$char_set.' '.$collate.';');
}
// ADD OLD DATA
if (!empty($values)) {
$query_ins = sprintf("INSERT INTO %s (id, title, filename, dlversion, postDate, hits, user, members, category_id, mirrors, file_description) VALUES %s;",
$wpdb->escape( $wp_dlm_db ),
$values);
$wpdb->query($query_ins);
}
if (!empty($values2)) {
$query_ins = sprintf("INSERT INTO %s (id, name, parent) VALUES %s;",
$wpdb->escape( $wp_dlm_db_cats ),
$values2);
$wpdb->query($query_ins);
}
}
################################################################################
// MAGIC QUOTES - WORDPRESS DOES THIS BUT ADDS THE SLASHES BACK - I DONT WANT THEM!
################################################################################
if (!function_exists('wp_dlm_magic')) {
function wp_dlm_magic() {
if (!function_exists('stripit')) {
function stripit($in) {
if (!is_array($in)) $out = stripslashes($in); else $out = $in;
return $out;
}
}
//if (get_magic_quotes_gpc() || get_magic_quotes_runtime() ){
$_GET = array_map('stripit', $_GET);
$_POST = array_map('stripit', $_POST);
$_REQUEST = array_map('stripit', $_REQUEST);
//}
return;
}
}
################################################################################
// INSERT BUTTON ON POST SCREEN
################################################################################
function wp_dlm_ins_button() {
//set globals
global $table_prefix,$wpdb,$wp_dlm_db,$wp_dlm_db_cats;
if( strpos($_SERVER['REQUEST_URI'], 'post.php')
|| strstr($_SERVER['PHP_SELF'], 'page-new.php')
|| strstr($_SERVER['PHP_SELF'], 'page.php')
|| strstr($_SERVER['PHP_SELF'], 'post-new.php') )
{
// select all downloads
$query_select = sprintf("SELECT * FROM %s ORDER BY id;",
$wpdb->escape($wp_dlm_db));
$downloads = $wpdb->get_results($query_select);
$js .= '';
if (!empty($downloads)) {
$js .= '';
// select all cats
$query_select_cats = sprintf("SELECT * FROM %s WHERE parent=0 ORDER BY id;",
$wpdb->escape( $wp_dlm_db_cats ));
$cats = $wpdb->get_results($query_select_cats);
if (!empty($cats)) {
$js .= '';
}
?>
escape($wp_dlm_db_formats),
$wpdb->escape($id));
$format = $wpdb->get_row($query_select);
return $format->format;
}
################################################################################
// SHORTCODES
################################################################################
function wp_dlm_shortcode_download( $atts ) {
extract(shortcode_atts(array(
'id' => '0',
'format' => '0',
'autop' => false
), $atts));
$output = '';
$cached_code = wp_cache_get('download_'.$id.'_'.$format);
if($cached_code == false) {
global $wpdb,$wp_dlm_root,$wp_dlm_db,$wp_dlm_db_formats,$wp_dlm_db_cats, $def_format, $dlm_url, $downloadurl, $downloadtype, $wp_dlm_db_meta;
if ($id>0) {
// Handle Formats
if (!$format && $def_format>0) {
$format = wp_dlm_get_custom_format($def_format);
} elseif ($format>0 && is_numeric($format) ) {
$format = wp_dlm_get_custom_format($format);
} else {
// Format is set!
$format = html_entity_decode($format);
}
if (empty($format) || $format=='0') {
$format = '{title} ({hits})';
}
// Get download info
$d = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wp_dlm_db WHERE id = %s" , $id ) );
if ($d) {
switch ($downloadtype) {
case ("Title") :
$downloadlink = urlencode($d->title);
break;
case ("Filename") :
$downloadlink = $d->filename;
$links = explode("/",$downloadlink);
$downloadlink = urlencode(end($links));
break;
default :
$downloadlink = $d->id;
break;
}
$format = str_replace('\\"',"'",$format);
$fpatts = array('{url}', '{id}', '{user}', '{version}', '{title}', '{size}', '{hits}', '{image_url}', '{description}', '{description-autop}', '{category}');
$fsubs = array( $downloadurl.$downloadlink , $d->id, $d->user, $d->dlversion , $d->title , wp_dlm_get_size($d->filename) , $d->hits , get_option('wp_dlm_image_url') , $d->file_description , wpautop($d->file_description) );
// Category
if ($d->category_id>0) {
$c = $wpdb->get_row("SELECT name FROM $wp_dlm_db_cats where id=".$d->category_id." LIMIT 1;");
$fsubs[] = $c->name;
preg_match("/{category,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
$fsubs[] = $match[1].$c->name.$match[2];
} else {
$fsubs[] = "";
preg_match("/{category,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
$fsubs[] = "";
}
// Hits (special) {hits, none, one, many)
preg_match("/{hits,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
if ( $d->hits == 1 )
{
$text = str_replace('%',$d->hits,$match[2]);
$fsubs[] = $text;
}
elseif ( $d->hits > 1 )
{
$text = str_replace('%',$d->hits,$match[3]);
$fsubs[] = $text;
}
else
{
$text = str_replace('%',$d->hits,$match[1]);
$fsubs[] = $text;
}
// Version
preg_match("/{version,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
if ($d->dlversion) $fsubs[] = $match[1].$d->dlversion.$match[2]; else $fsubs[] = "";
// Date
preg_match("/{date,\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
if ($d->postDate) $fsubs[] = date_i18n($match[1],strtotime($d->postDate)); else $fsubs[] = "";
// Other
preg_match("/{description,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
if ($d->file_description) $fsubs[] = $match[1].$d->file_description.$match[2]; else $fsubs[] = "";
preg_match("/{description-autop,\s*\"([^\"]*?)\",\s*\"([^\"]*?)\"}/", $format, $match);
$fpatts[] = $match[0];
if ($d->file_description) $fsubs[] = $match[1].wpautop($d->file_description).$match[2]; else $fsubs[] = "";
// tags
$tags = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wp_dlm_db_meta WHERE download_id = %s AND meta_name = 'tags'" , $id ) );
if (!$tags) $tags = 'Untagged';
$fpatts[] = "{tags}";
$fsubs[] = $tags;
// Thumbnail
$thumbnail = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wp_dlm_db_meta WHERE download_id = %s AND meta_name = 'thumbnail'" , $id ) );
if (!$thumbnail) $thumbnail = $wp_dlm_root.'/page-addon/thumbnail.gif';
$fpatts[] = "{thumbnail}";
$fsubs[] = $thumbnail;
// meta
if (preg_match("/{meta-([^,]*?)}/", $format, $match)) {
$meta_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wp_dlm_db_meta WHERE download_id = %s" , $id ) );
$meta_names = array();
foreach($meta_data as $meta) {
$fpatts[] = "{meta-".$meta->meta_name."}";
$fsubs[] = $meta->meta_value;
$fpatts[] = "{meta-autop-".$meta->meta_name."}";
$fsubs[] = wpautop($meta->meta_value);
$meta_names[] = $meta->meta_name;
}
// Blank Meta
$meta_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wp_dlm_db_meta WHERE meta_name NOT IN ( %s )" , implode(',', $meta_names) ) );
foreach($meta_data as $meta) {
$fpatts[] = "{meta-".$meta->meta_name."}";
$fsubs[] = '';
$fpatts[] = "{meta-autop-".$meta->meta_name."}";
$fsubs[] = '';
}
}
$output = str_replace( $fpatts , $fsubs , $format );
} else $output = '[Download not found]';
} else $output = '[Download id not defined]';
wp_cache_set('download_'.$id.'_'.$format, $output);
} else {
$output = $cached_code;
}
if ($autop && $autop != "false") return wpautop($output);
return $output;
}
add_shortcode('download', 'wp_dlm_shortcode_download');
################################################################################
// LEGACY TAGS SUPPORT
################################################################################
function wp_dlm_parse_downloads($data) {
if (substr_count($data,"[download#")) {
preg_match_all("/\[download#([0-9]+)#format=([0-9]+)\]/", $data, $matches, PREG_SET_ORDER);
if ( sizeof( $matches ) > 0 ) foreach ($matches as $val) {
$code = '[download id="'.$val[1].'" format="'.$val[2].'"]';
$data = str_replace( $val[0] , $code , $data );
} // End foreach
// Handle Non-formatted downloads
preg_match_all("/\[download#([0-9]+)/", $data, $matches, PREG_SET_ORDER);
$patts = array();
$subs = array();
if ( sizeof( $matches ) > 0 ) foreach ($matches as $val) {
$patts[] = "[download#" . $val[1] . "]";
$subs[] = '[download id="'.$val[1].'"]';
// No hit counter
$format = '{title}';
$patts[] = "[download#" . $val[1] . "#nohits]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// URL only
$format = '{url}';
$patts[] = "[download#" . $val[1] . "#url]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// Description only
$format = '{description}';
$patts[] = "[download#" . $val[1] . "#description]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// Description (autop) only
$format = '{description-autop}';
$patts[] = "[download#" . $val[1] . "#description_autop]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// Hits only
$format = '{hits}';;
$patts[] = "[download#" . $val[1] . "#hits]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// Image link
$format = '';
$patts[] = "[download#" . $val[1] . "#image]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// Regular download link WITH filesize
$format = '{title} ({hits}) - {size}';
$patts[] = "[download#" . $val[1] . "#size]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
// No hit counter + filesize
$format = '{title} ({size})';
$patts[] = "[download#" . $val[1] . "#size#nohits]";
$subs[] = '[download id="'.$val[1].'" format="'.htmlspecialchars($format).'"]';
} // End foreach
$data = str_replace($patts, $subs, $data);
} // End if [download# found
global $wpdb, $wp_dlm_db, $wp_dlm_db_meta, $wp_dlm_db_cats, $downloadurl, $downloadtype;
// Handle CATEGORIES
if (substr_count($data,"[download_cat#")) {
$patts = array();
$subs = array();
preg_match_all("/\[download_cat#([0-9]+)#format=([0-9]+)\]/", $data, $result, PREG_SET_ORDER);
if ($result) foreach ($result as $val) {
$format = wp_dlm_get_custom_format($val[2]);
if ($format) {
$format = str_replace('\\"',"'",$format);
// Traverse through categories to get sub-cats
$the_cats = array();
$the_cats[] = $val[1];
$the_cats = wp_dlm_get_sub_cats($the_cats);
// Get downloads for category and sub-categories
$query = "SELECT * FROM $wp_dlm_db WHERE category_id IN (".implode(',',$the_cats).") ORDER BY 'title'";
$downloads = $wpdb->get_results($query);
// GENERATE LIST
$links = '
'.__('Download edited Successfully',"wp-download_monitor").' - '.$info.'
'.__('Download edited Successfully',"wp-download_monitor").'
'.__('Download deleted Successfully',"wp-download_monitor").'
'.__('Stats successfully reset for selected downloads',"wp-download_monitor").'
'.__('Selected Downloads deleted Successfully',"wp-download_monitor").'
'.__('Downloads edited successfully',"wp-download_monitor").'
.
Download URL updated - You need to re-save your permalinks settings (Options/settings -> Permalinks) for the changes to occur in your blog.
If your .htaccess file cannot be written to by WordPress, add the following to your .htaccess file above the "# BEGIN WordPress" line:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^download/([^/]+)$ *your wp-content dir*/plugins/download-monitor/download.php?id=$1 [L]
replacing "download/" with your custom url and "*your wp-content dir*" with your wp-content directory.
',"wp-download_monitor"); echo 'Download URL updated - You need to re-save your permalinks settings (Options/settings -> Permalinks) for the changes to occur in your blog.
If your .htaccess file cannot be written to by WordPress, remove the following from your .htaccess file if it exists above the "# BEGIN WordPress" line:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^download/([^/]+)$ *your wp-content dir*/plugins/download-monitor/download.php?id=$1 [L]
replacing "download/" with your previous custom url and "*your wp-content dir*" with your wp-content directory.
',"wp-download_monitor"); echo 'Options updated
',"wp-download_monitor"); echo ''.__('Category updated',"wp-download_monitor").'
'.__('Category added',"wp-download_monitor").'
'.__('Category was not added. Try Recreating the download database from the configuration page.',"wp-download_monitor").'
'.__('Category deleted Successfully',"wp-download_monitor").'
'.__('Database recreated',"wp-download_monitor").'
'.__('Formats updated',"wp-download_monitor").'
'.__('Format added',"wp-download_monitor").'
'.__('Format deleted Successfully',"wp-download_monitor").'
'.__("Download added Successfully","wp-download_monitor").'
'.__("Download added Successfully","wp-download_monitor").' - '.$info.'
'.__("Download added Successfully","wp-download_monitor").'
'.__("Download added Successfully","wp-download_monitor").' - '.$info.'
| '.$log->id.' | '.$log->title.' | '.$file.' | '; if ($log->user_id) { $user_info = get_userdata($log->user_id); echo $user_info->user_login . ' ('.$user_info->ID.')'; } echo ' | '.$log->ip_address.' | '.$date.' | '; } echo '
| '.__('No downloads logged.',"wp-download_monitor").' | |||||
'.__('No Downloads Found',"wp-download_monitor").'
'; $retval .= "| '.date_i18n($dateformat,$date).' |
| '.$d->title.' | |
| '.__('No stats yet',"wp-download_monitor").' | |