|
View previous topic :: View next topic |
| Author |
Message |
BobCat Nice poster


Offline Joined: Apr 03, 2008 Posts: 85 Location: Gold Coast, Australia
|
Posted: Mon Nov 03, 2008 3:08 am Post subject: Custom DownloadsPro |
|
I have made a second DownloadsPro module called it MapsDB
i want a totally seperate module just for game maps (map file and screen shot)
I got it all working (changed the _downloads to _mapdb)
Everything is fine except when you click on the file to download i either get a blank page (http error 500) /index.php?name=MapDB&get=1&mirror=1
or tested on other site i get
| Code:: |
Fatal error: Call to undefined method CPG_File::secure_mapdb() in D:\SITES\wamp\www\Test1\modules\MapDB\index.php on line 262 |
which is on line 262
| PHP: |
if (!CPG_File::secure_mapdb($error, $dl_url, $dl_filename)) {
|
Anyone know how to fix this bug? any input welcome.
BobCat's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache2.2.16/MySQL5.0.91/PHP5.2.14/DF9.2.3.3
|
|
| Back to top |
|
 |
Phoenix • Many Posts •


Offline Joined: Apr 19, 2004 Posts: 8799 Location: Netizen
|
Posted: Mon Nov 03, 2008 3:56 am Post subject: Re: Custom DownloadsPro |
|
You've gone too far with renaming everything associated with "download".
The function secure_download() is a core DF function, nothing to do with DLpro, and should have been left as is.
_________________ • DonationsPro for DragonflyCMS, SMF, MyBB, vBulletin •
Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
BobCat Nice poster


Offline Joined: Apr 03, 2008 Posts: 85 Location: Gold Coast, Australia
|
Posted: Mon Nov 03, 2008 4:21 am Post subject: Re: Custom DownloadsPro |
|
Thanks for the quick reply
I worked out if i disable the security code it worked fine but i would rather have it as safe as possible, will go over it all and fix what u mentioned.
Thanks again
BobCat's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache2.2.16/MySQL5.0.91/PHP5.2.14/DF9.2.3.3
|
|
| Back to top |
|
 |
WebSiteGuru 1000+ Posts Club


Offline Joined: Jun 09, 2005 Posts: 2318
|
Posted: Mon Nov 03, 2008 3:55 pm Post subject: Re: Custom DownloadsPro |
|
Then you might want to back track and change The function secure_download() back to the original.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1
|
|
| Back to top |
|
 |
BobCat Nice poster


Offline Joined: Apr 03, 2008 Posts: 85 Location: Gold Coast, Australia
|
Posted: Tue Nov 04, 2008 5:27 am Post subject: Re: Custom DownloadsPro |
|
ok got it done and working fine
demo:
df-outpost.com/index.php?name=MapDB
This is handy for Gamers who want a seperate section just for maps.
Im using DP ver 3 as the base,
How can i add a ScreenShot to the blocks
e.g. "Latest Map" block-Latest_Map showing title and screenshot of the last added map.
*note* i have seen previous posts in forums related to SS in blocks but coding didn't seem to work for me or out of date.
Im using DF2.1.0 and DownloadsProv3
BobCat's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache2.2.16/MySQL5.0.91/PHP5.2.14/DF9.2.3.3
|
|
| Back to top |
|
 |
rlgura 1000+ Posts Club


Offline Joined: Mar 27, 2006 Posts: 1146 Location: Cleveland, OH USA
|
Posted: Tue Nov 04, 2008 6:15 pm Post subject: Re: Custom DownloadsPro |
|
I added ss for the Top-Ten downloads block - works with DF 9.2.1 and Downloads Pro 3.0.0.14
| Code:: |
<?php
/******************************************************
Downloads Pro: Designed exclusively for Dragonfly CMS
*****************************************************
Copyright � 2005 - 2006 by Trevor Eckart and DJMaze
http://dragonflycms.org
Please see the included LICENSE.txt for the terms and
conditions that govern your use of this module
$Source: block-Top10_Downloads_Center.php,v $
$Revision: 1.0 $
$Author: trevor, rlgura $
$Date: 2007/04/24 17:46:00 $
******************************************************/
if (!defined('CPG_NUKE')) { exit; }
global $db, $prefix;
$dl_mod = 'Downloads';
$dl_mod_prefix = $prefix.'_'.strtolower($dl_mod);
require_once('modules/'.$dl_mod.'/functions/linking.inc');
$content = '';
if (!is_active($dl_mod)) {
$content = 'ERROR';
return trigger_error($dl_mod.' module is inactive', E_USER_WARNING);
}
$a = 1;
$result = $db->sql_query("SELECT d.lid, d.title, SUM(s.hits) AS hits, ss.url AS img_url, d.desc_short FROM ".$dl_mod_prefix."_downloads d
LEFT JOIN ".$dl_mod_prefix."_stats s ON (s.id = d.lid)
LEFT JOIN ".$dl_mod_prefix."_screenshots ss ON (ss.id = d.screen)
WHERE d.active=1 GROUP BY s.id ORDER BY hits DESC LIMIT 0,10");
if ($db->sql_numrows($result) < 1) {
$content = 'ERROR';
return trigger_error('There are no downloads in '.$dl_mod, E_USER_WARNING);
}
while (list($lid, $dtitle, $hits, $ss, $desc) = $db->sql_fetchrow($result)) {
if ($ss) {
if (ereg('://', $ss)) {
$ss .= '" width="100'; }
else { $ss = dl_thumbimage($ss).'" width="100';}
}
else { $ss = dl_image('download.png').'" width="100'; }
$content .= '<table><tr><td>';
$content .= '<img src="'.$ss.'" border="0" alt="" /> </td>';
$content .= '<td>'.$a.': <a href="'.getlink($dl_mod.'&file=details&id='.$lid).'">'.$dtitle.'</a><br /><br />';
$content .= $desc.'</td>';
$content .= '</tr></table><hr />';
$a++;
}
$db->sql_freeresult($result); |
_________________ Admin - Great Lakes Web Designs
Theme Designer - WebSite Guru Designs
Site Admin - Families with Food Allergies
rlgura's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.27-grsec/Apache 2.2.11/MySQL 5.0.67-community-log/PHP 5.2.8/DF 9.2.1
|
|
| Back to top |
|
 |
BobCat Nice poster


Offline Joined: Apr 03, 2008 Posts: 85 Location: Gold Coast, Australia
|
Posted: Wed Nov 05, 2008 1:23 am Post subject: Re: Custom DownloadsPro |
|
Thanks rugura, your a champ!
i edit it a bit to only show the SS and Title and also test to be under not beside. view on link above
cool, thanks again.
BobCat's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache2.2.16/MySQL5.0.91/PHP5.2.14/DF9.2.3.3
|
|
| Back to top |
|
 |
BobCat Nice poster


Offline Joined: Apr 03, 2008 Posts: 85 Location: Gold Coast, Australia
|
Posted: Wed Nov 05, 2008 7:02 am Post subject: Re: Custom DownloadsPro |
|
i found a bug..
When i activate the block it works fine but now i can't access the downloads section, get 404 error, diable the block and it's fine.
I have added the code i changed below to see the changes i made.
| PHP: |
<?php /****************************************************** Downloads Pro: Designed exclusively for Dragonfly CMS ***************************************************** Copyright � 2005 - 2006 by Trevor Eckart and DJMaze dragonflycms.org
Please see the included LICENSE.txt for the terms and conditions that govern your use of this module
$Source: block-Top10_Maps.php,v $ $Revision: 1.0 $ $Author: trevor, rlgura $ $Date: 2007/04/24 17:46:00 $ ******************************************************/ if (!defined('CPG_NUKE')) { exit; }
global $db, $prefix;
$dl_mod = 'MapDB'; $dl_mod_prefix = $prefix.'_'.strtolower($dl_mod); require_once('modules/'.$dl_mod.'/functions/linking.inc'); $content = ''; if (!is_active($dl_mod)) { $content = 'ERROR'; return trigger_error($dl_mod.' module is inactive', E_USER_WARNING); }
$a = 1; $result = $db->sql_query("SELECT d.lid, d.title, SUM(s.hits) AS hits, ss.url AS img_url, d.desc_short FROM ".$dl_mod_prefix."_mapdb d LEFT JOIN ".$dl_mod_prefix."_stats s ON (s.id = d.lid) LEFT JOIN ".$dl_mod_prefix."_screenshots ss ON (ss.id = d.screen) WHERE d.active=1 GROUP BY s.id ORDER BY hits DESC LIMIT 0,3"); if ($db->sql_numrows($result) < 1) { $content = 'ERROR'; return trigger_error('There are no maps in '.$dl_mod, E_USER_WARNING); } while (list($lid, $dtitle, $hits, $ss, $desc) = $db->sql_fetchrow($result)) { if ($ss) { if (ereg('://', $ss)) { $ss .= '" width="100'; } else { $ss = dl_thumbimage($ss).'" width="100';} } else { $ss = dl_image('download.png').'" width="100'; } $content .= '<table><tr><td>';
$content .= '<td>'.$a.': <a href="'.getlink($dl_mod.'&file=details&id='.$lid).'">'.$dtitle.'</a><br /><br />'; $content .= '<img src="'.$ss.'" border="0" alt="" /><br> </td>'; $content .= '</tr></table><hr />'; $a++; } $db->sql_freeresult($result);
|
BobCat's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache2.2.16/MySQL5.0.91/PHP5.2.14/DF9.2.3.3
|
|
| Back to top |
|
 |
rlgura 1000+ Posts Club


Offline Joined: Mar 27, 2006 Posts: 1146 Location: Cleveland, OH USA
|
Posted: Wed Nov 05, 2008 6:31 pm Post subject: Re: Custom DownloadsPro |
|
Downloads module won't show when this block is displayed with it? Does MapDB module show? Probably due to this block calling linking.inc
Just don't display this block along with Downloads module.
_________________ Admin - Great Lakes Web Designs
Theme Designer - WebSite Guru Designs
Site Admin - Families with Food Allergies
rlgura's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.27-grsec/Apache 2.2.11/MySQL 5.0.67-community-log/PHP 5.2.8/DF 9.2.1
|
|
| Back to top |
|
 |
macuserau Nice poster


Offline Joined: May 18, 2006 Posts: 124 Location: South Coast Australia
|
Posted: Tue Oct 11, 2011 11:34 am Post subject: Re: Custom DownloadsPro |
|
is this Modded module available for DL
macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) unix / Apache 2.2.15 / MySQL 5.0.92 / PHP 5.3.8/ CMS 9.3.3.0
|
|
| Back to top |
|
 |
macuserau Nice poster


Offline Joined: May 18, 2006 Posts: 124 Location: South Coast Australia
|
Posted: Mon Oct 24, 2011 8:42 am Post subject: Re: Custom DownloadsPro |
|
I too have duplicated and modified this module along the lines that BobCat has.
I want a totally seperate module just for Permission Notes
I am receiving this error
Fatal error: Call to undefined function can_note() in /home/cofscout/public_html/modules/Notes/index.php on line 195
Line 195 is
$cpgtpl->assign_vars(array(
Anyone know how to fix this bug? any input welcome.
macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) unix / Apache 2.2.15 / MySQL 5.0.92 / PHP 5.3.8/ CMS 9.3.3.0
|
|
| Back to top |
|
 |
Phoenix • Many Posts •


Offline Joined: Apr 19, 2004 Posts: 8799 Location: Netizen
|
Posted: Mon Oct 24, 2011 8:55 am Post subject: Re: Custom DownloadsPro |
|
You have changed references to can_download to can_note without also renaming the function itself.
Since you missed that, there is also the possibility that you may have missed other instances of can_download.
_________________ • DonationsPro for DragonflyCMS, SMF, MyBB, vBulletin •
Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
macuserau Nice poster


Offline Joined: May 18, 2006 Posts: 124 Location: South Coast Australia
|
Posted: Mon Oct 24, 2011 9:08 am Post subject: Re: Custom DownloadsPro |
|
Thank you
I will review it and see if i can fix it.
macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) unix / Apache 2.2.15 / MySQL 5.0.92 / PHP 5.3.8/ CMS 9.3.3.0
|
|
| Back to top |
|
 |
macuserau Nice poster


Offline Joined: May 18, 2006 Posts: 124 Location: South Coast Australia
|
Posted: Mon Oct 24, 2011 9:22 am Post subject: Re: Custom DownloadsPro |
|
Thanks I found the other one in the index.php all good now.
macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) unix / Apache 2.2.15 / MySQL 5.0.92 / PHP 5.3.8/ CMS 9.3.3.0
|
|
| Back to top |
|
 |
macuserau Nice poster


Offline Joined: May 18, 2006 Posts: 124 Location: South Coast Australia
|
Posted: Mon Oct 24, 2011 9:33 am Post subject: Re: Custom DownloadsPro |
|
I have a question about the theme (page view) when you click on the note (download) the detail page looks mess up. I am not sure why this occurs, could some one offer some advice?
look here www.cofscouts.org.au/i...tails&id=2
macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) unix / Apache 2.2.15 / MySQL 5.0.92 / PHP 5.3.8/ CMS 9.3.3.0
|
|
| Back to top |
|
 |
|
|