Пример #1
0
echo mysql2date(sprintf('%s @ %s', get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $file->file_last_downloaded_date));
?>
</td>
	</tr>
	<tr class="alternate">
		<td><strong><?php 
_e('Allowed To Download:', hacklogdm::textdomain);
?>
</strong></td>
		<td><?php 
echo hacklogdm_admin::file_permission($file->file_permission);
?>
</td>
	</tr>
	<?php 
if (!hacklogdm::is_remote_file(stripslashes($file->file))) {
    ?>
	<tr>
		<td colspan="2" align="center"><input type="checkbox" id="unlinkfile" name="unlinkfile" value="1" />&nbsp;<label for="unlinkfile"><?php 
    _e('Delete File From Server?', hacklogdm::textdomain);
    ?>
</label></td>
	</tr>
	<?php 
}
?>
	<tr class="alternate">
		<td colspan="2" align="center"><input type="submit" name="do"
			value="<?php 
_e('Delete File', hacklogdm::textdomain);
?>
Пример #2
0
 public function download_shortcode($atts)
 {
     //in last line of shortcodes : add_filter('the_content', 'do_shortcode', 11);
     // so the shortcode is trigger before wp_footer
     self::$_add_js = TRUE;
     extract(shortcode_atts(array('id' => '0', 'display' => 'both'), $atts));
     if (!is_feed()) {
         $conditions = array();
         if ($id != '0') {
             if (strpos($id, ',') !== false) {
                 $conditions[] = "file_id IN ({$id})";
             } else {
                 $conditions[] = "file_id = {$id}";
             }
         }
         if ($conditions) {
             return $this->download_embedded(implode(' AND ', $conditions), $display);
         } else {
             return '';
         }
     } else {
         return sprintf(__('Note: There is a file embedded within this post, please visit <a href="%s">this post</a> to download the file.', 'hacklog-downloadmanager'), get_permalink());
     }
 }
Пример #3
0
</th>
					<td><?php 
        echo hacklogdm::format_filesize($total_filesize);
        ?>
</td>
				</tr>
				<tr>
					<th><?php 
        _e('Total Hits:', hacklogdm::textdomain);
        ?>
</th>
					<td><?php 
        echo number_format_i18n($total_filehits);
        ?>
</td>
				</tr>
				<tr class="alternate">
					<th><?php 
        _e('Total Bandwidth:', hacklogdm::textdomain);
        ?>
</th>
					<td><?php 
        echo hacklogdm::format_filesize($total_bandwidth);
        ?>
</td>
				</tr>
			</table>
		</div>
	<?php 
}
// End switch($mode)
Пример #4
0
_e('File Description:', hacklogdm::textdomain);
?>
</strong></td>
		<td><textarea rows="5" cols="50" name="file_des"><?php 
echo htmlspecialchars(stripslashes($file->file_des));
?>
</textarea></td>
	</tr>

	<tr>
		<td><strong><?php 
_e('File Size:', hacklogdm::textdomain);
?>
</strong></td>
		<td><?php 
echo hacklogdm::format_filesize($file->file_size);
?>
<br />
		<input type="text" size="10" name="file_size"
			value="<?php 
echo $file->file_size;
?>
" />&nbsp;<?php 
_e('bytes', hacklogdm::textdomain);
?>
<br />
		<input type="checkbox" id="auto_filesize" name="auto_filesize"
			value="1" checked="checked" />&nbsp;<label for="auto_filesize"><?php 
_e('Auto Detection Of File Size', hacklogdm::textdomain);
?>
</label></td>
Пример #5
0
|	-http://ihacklog.com														       |
|																			       |
+------------------------------------------------------------------------------+
*/
### Check Whether User Can Manage Downloads
if (!current_user_can('manage_downloads')) {
    die('Access Denied');
}
//load the admin class
require dirname(__FILE__) . '/includes/hacklogdm_admin.class.php';
### Variables Variables Variables
$base_name = plugin_basename('hacklog-downloadmanager/download-manager.php');
$base_page = 'admin.php?page=' . $base_name;
$mode = trim(hacklogdm_admin::get('mode'));
$downloads_tables = array($wpdb->downloads);
$downloads_settings = hacklogdm::get_opt_keys();
### Form Processing
if (isset($_POST['do'])) {
    // Decide What To Do
    switch (hacklogdm_admin::post('do')) {
        //  Uninstall Hacklog-DownloadManager
        case __('UNINSTALL Hacklog-DownloadManager', hacklogdm::textdomain):
            if (trim(hacklogdm_admin::post('uninstall_download_yes')) == 'yes') {
                echo '<div id="message" class="updated fade">';
                echo '<p>';
                foreach ($downloads_tables as $table) {
                    $wpdb->query("DROP TABLE {$table}");
                    echo '<span style="color: green;">';
                    printf(__('Table \'%s\' has been deleted.', hacklogdm::textdomain), "<strong><em>{$table}</em></strong>");
                    echo '</span><br />';
                }
Пример #6
0
		</table>


		<p class="submit" align="center"><input type="submit" name="Submit"
												class="button"
												value="<?php 
_e('Save Changes', hacklogdm::textdomain);
?>
" /></p>
	</div>
</form>
<?php 
$download_template_embedded_default = hacklogdm::get_default_value('download_template_embedded');
$download_template_custom_css_default = hacklogdm::get_default_value('download_template_custom_css');
$download_template_popup_default = hacklogdm::get_default_value('download_template_popup');
?>
<script type="text/javascript">
	/* <![CDATA[*/
	function download_default_templates(template) {
		var default_template;
		switch(template) {
			case "embedded":
				default_template = "<?php 
echo hacklogdm_admin::js_fix($download_template_embedded_default[0]);
?>
";
				break;
			case "embedded_2":
				default_template = "<?php 
echo hacklogdm_admin::js_fix($download_template_embedded_default[1]);
Пример #7
0
 * $Date: 2011-12-14 09:33:23 +0000 (Wed, 14 Dec 2011) $
 * @package Hacklog-DownloadManager
 * @encoding UTF-8 
 * @author 荒野无灯 <HuangYeWuDeng> 
 * @link http://ihacklog.com 
 * @copyright Copyright (C) 2011 荒野无灯 
 * @license http://www.gnu.org/licenses/
 * some of the code is from Lester "GaMerZ" Chan	's WP-downloadmanger plugin,
 * Thanks to  Lester "GaMerZ" Chan.  <http://lesterchan.net/wordpress/category/plugins/wp-downloadmanager/>
 */
/*
Copyright 2011 荒野无灯 

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
*/
define('HACKLOGDM_LOADER', __FILE__);
require plugin_dir_path(__FILE__) . '/includes/hacklogdm.class.php';
hacklogdm::init();
Пример #8
0
        $file_hits = intval($file->file_hits);
        $file_permission = hacklogdm_admin::file_permission($file->file_permission);
        $file_name_actual = hacklogdm::get_basename($file_name);
        if ($i % 2 == 0) {
            $style = '';
        } else {
            $style = ' class="alternate"';
        }
        echo "<tr{$style}>\n";
        echo '<td valign="top">' . number_format_i18n($file_id) . '</td>' . "\n";
        echo "<td>{$file_nicename}<br /><strong>&raquo;</strong> <i dir=\"ltr\">" . hacklogdm::snippet_text($file_name, 45) . "</i><br /><br />";
        if (!$ihacklog_tab) {
            echo "<i>" . sprintf(__('Last Updated: %s, %s', hacklogdm::textdomain), $file_updated_time, $file_updated_date) . "</i><br /><i>" . sprintf(__('Last Downloaded: %s, %s', hacklogdm::textdomain), $file_last_downloaded_time, $file_last_downloaded_date) . "</i>";
        }
        echo "</td>\n";
        echo '<td style="text-align: center;">' . hacklogdm::format_filesize($file_size) . '</td>' . "\n";
        echo !$ihacklog_tab ? '<td style="text-align: center;">' . number_format_i18n($file_hits) . '</td>' . "\n" : '';
        echo '<td style="text-align: center;">' . $file_permission . '</td>' . "\n";
        echo "<td>{$file_date} , {$file_time}</td>\n";
        if (!$ihacklog_tab) {
            echo "<td style=\"text-align: center;\"><a href=\"{$base_page}&amp;mode=edit&amp;id={$file_id}\" class=\"edit\">" . __('Edit', hacklogdm::textdomain) . "</a></td>\n";
            echo "<td style=\"text-align: center;\"><a href=\"{$base_page}&amp;mode=delete&amp;id={$file_id}\" class=\"delete\">" . __('Delete', hacklogdm::textdomain) . "</a></td>\n";
        } else {
            echo "<td style=\"text-align: center;\"><input type=\"button\" onclick=\"insert_into_post({$file_id});\" class=\"button button-primary\" name=\"insertintopost\" value=\"" . __('Insert into post', 'hacklog-downloadmanager') . "\" /></td>\n";
        }
        echo '</tr>';
        $i++;
    }
} else {
    echo '<tr><td colspan="9" align="center"><strong>' . __('No Files Found', hacklogdm::textdomain) . '</strong></td></tr>';
}