[Plugin: WordPress Download Monitor] Table output format for [#show_downloads]
-
The current implementation of wp_dlm_all seems to put a lot of information in the title attribute of the link, but does not show the file description, etc., on the page.
Everyone’s needs are different, but I changed the function to output a table with the file title, name, version, date, hits, and description. I prefer this output, so I figured I’d share. Maybe Mike will integrate an option for customizing the output of [#show_downloads] in the future? ??
The code changes to wp-download_monitor.php:
@@ -1926,7 +1931,8 @@ $downloadtype = get_option('wp_dlm_type'); if (!empty($dl)) { - $retval = '<ul class="downloadList">'; + $retval = '<table class="download_table">'; + $retval .= '<tr><th>What</th><th>Version</th><th>Date Posted</th><th>Hits</th><th>Description</th></tr>'; foreach($dl as $d) { $date = date("jS F Y", strtotime($d->postDate)); switch ($downloadtype) { @@ -1942,9 +1948,10 @@ $downloadlink = $d->id; break; } - $retval .= '<li><a href="'.$downloadurl.$downloadlink.'" title="'.__('Version',"wp-download_monitor").' '.$d->dlversion.' '.__('downloaded',"wp-download_monitor").' '.$d->hits.' '.__('times',"wp-download_monitor").' - '.__('Added',"wp-download_monitor").' '.$date.'" >'.$d->title.' ('.$d->hits.')</a></li>'; + $when = date('d F Y', strtotime($d->postDate)); + $retval .= "<tr><td><b><a href=\"$downloadurl$downloadlink\">$d->title</a></b></td><td>$d->dlversion</td><td>$when</td><td>$d->hits</td><td>$d->file_description</td></tr>"; } - $retval .='</ul>'; + $retval .='</table>'; } } return $retval;
Enjoy,
[signature moderated Please read the Forum Rules]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: WordPress Download Monitor] Table output format for [#show_downloads]’ is closed to new replies.