I've searched high and low and posted at the official forums but am yet to receive any help. I was wondering if anyone has written a DownloadsPlus plugin for pnTresmailer. I have attempted it but for some reason cannot get any output. I did notice that downloadsplus does not use the postnuke table prefix and was wondering if this might be the problem.
Any pointers appreciated.
Cheers,
Brad
- mercromina responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 08:01 PM
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnTresmailer Plugin for DownloadsPlus
-
- Rank: Helper
- Registered: Mar 30, 2003
- Last visit: Oct 21, 2009
- Posts: 683
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 16
Code
<?php
// $Id: newsletter_mod_tpl.php,v 1.1.1.1 2002/09/15 22:26:15 root Exp $
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2002 by the PostNuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: foyleman
// Purpose of file: Downloads Module for pnTresMailer
// ----------------------------------------------------------------------
// variable that need to be defined for the system
$modversion['file_name'] = 'downloadsplus'; // the name of this php file
$modversion['mod_name'] = 'DownloadsPlus'; // the name of the module you are writing this for
$modversion['multi_output'] = '1'; // is there a quantity spec, or simply return output 1:true, 0:false
$modversion['mod_edit'] = '0'; // can this plugin be edited 1:true, 0:false
$modversion['version'] = '1.0';
$modversion['function_name'] = 'latest_downloadsplus'; // the name of the function listed below
$modversion['description'] = 'Latest DownloadsPlus'; // brief description of this module
$modversion['author'] = 'Brad';
$modversion['contact'] = 'http://www.harmoniseit.com/';
// function named as above, in this case the format is for the HTML part of the mailer
function latest_downloadsplus_html($mod_id, $nl_url, $ModName) {
$prefix = pnConfigGetVar('prefix');
$language = pnConfigGetVar('language');
// name the lang file the same as this file
include("modules/$ModName/modules/lang/$language/downloadsplus.php");
// get the module setting from the database
$modsql = mysql_query("SELECT mod_qty, mod_data FROM $prefix"._nl_modules." WHERE mod_id = '$mod_id'");
list($mod_qty, $mod_data) = mysql_fetch_row($modsql);
// clear the output variable
// title of the page to show up
$output = "<b>"._LATESTDOWNLOADSPLUS.":</b><br><br>\n";
// query the database and generate your output in the amount of mod_qty
$sql = mysql_query("SELECT dp_lid, dp_title, dp_description, dp_filesize FROM downloadsplus_downloads ORDER BY dp_date DESC limit 0,$mod_qty");
while(list($dp_lid, $dp_title, $dp_description, $dp_filesize) = mysql_fetch_row($sql)) {
$output .= "<a href=\"$nl_url/modules.php?op=modload&name=DownloadsPlus&file=index&req=viewdownloaddetails&lid=$dp_lid&ttitle=$dp_title\" target=\"_blank\"><b>$dp_title</b></a><br>\n";
$output .= "$dp_description<br>\n";
$output .= ""._FILESIZE.": $dp_filesize "._BYTES."<br><br>\n";
}
// strip the slashes out all at once
$output = stripslashes($output);
// send the output to the system (it must be output and not another variable name)
return $output;
}
// function named as above, in this case the format is for the TEXT part of the mailer
function latest_downloadsplus_text($mod_id, $nl_url, $ModName) {
$prefix = pnConfigGetVar('prefix');
$language = pnConfigGetVar('language');
// name the lang file the same as this file
include("modules/$ModName/modules/lang/$language/downloadsplus.php");
// get the module setting from the database
$modsql = mysql_query("SELECT mod_qty, mod_data FROM $prefix"._nl_modules." WHERE mod_id = '$mod_id'");
list($mod_qty, $mod_data) = mysql_fetch_row($modsql);
// clear the output variable
// title of the page to show up
$output = ""._LATESTDOWNLOADSPLUS.":\n\n";
// query the database and generate your output in the amount of mod_qty
$sql = mysql_query("SELECT dp_lid, dp_title, dp_description, dp_filesize FROM downloadsplus_downloads ORDER BY dp_date DESC limit 0,$mod_qty");
while(list($dp_lid, $dp_title, $dp_description, $dp_filesize) = mysql_fetch_row($sql)) {
$output .= "$dp_title\n";
$output .= "$dp_description\n";
$output .= "$nl_url/modules.php?op=modload&name=DownloadsPlus&file=index&req=viewdownloaddetails&lid=$dp_lid&ttitle=$dp_title\n";
$output .= ""._FILESIZE.": $dp_filesize "._BYTES."\n\n";
}
// strip the slashes out all at once
$output = stripslashes($output);
// send the output to the system (it must be output and not another variable name)
return $output;
}
?>
You'll also need to add a lang file too but thats a no brainer. Cheers!
Now if only the insert would work..
Brad
- Moderated by:
- Support
