Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 12, 2012, 07:58:34 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
149621
Posts in
21098
Topics by
7537
Members
Latest Member:
lotte2
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
Downloads Module: Download Gallery v1.0 Final released
Pages:
1
[
2
]
3
4
...
10
Go Down
Author
Topic: Downloads Module: Download Gallery v1.0 Final released (Read 64194 times)
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #25 on:
December 11, 2005, 12:37:59 AM »
Nice module!
I did a mod of the settings content though, to match it somehow with the regular News layout. I left out the date though, because I have no use for it in the site I am working on now. You can see a test install on
http://www.nvpit.nl/cms/pages/leden/downloads.php
. The settings I used are:
Quote
<style type="text/css">
.line, .line_rightalign { border-bottom: 1px solid #DDDDDD; }
.line_rightalign { text-align: right; white-space: nowrap; font-size: 10px; }
</style>
Quote
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="display: [DISPLAY_PREVIOUS_NEXT_LINKS]">
<tr>
<td width="35%" align="left">« [PREVIOUS_PAGE_LINK]</td>
<td width="30%" align="center">[OF]</td>
<td width="35%" align="right">[NEXT_PAGE_LINK] »</td>
</tr>
</table>
Quote
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
Quote
<td class="line"><img src="[FTIMAGE]"><a href="[LINK]" target="_blank"><b>[TITLE]</b></a></td><td class="line_rightalign">type: [EXT] | grootte: [SIZE]</span></td>
<tr>
<td colspan="2">[DESCRIPTION]<p></td>
</tr>
The last box is empty.
«
Last Edit: December 11, 2005, 03:50:29 PM by Argos
»
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
bhhenry
Offline
Posts: 51
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #26 on:
December 11, 2005, 02:08:14 AM »
OK, I have installed the module, and it works quite nicely for me so far.
You can see it in action here:
http://new.bhhenry.com/pages/council-newsletter.php
.
Many thanks to argos for the great layout settings customization he posted below. I added another column to the file loop table to space the description to fit directly under the title.
I also added a WYSIWYG section to the top of the page rather than editing the header layout settings by hand.
My only suggestion would be to have the WYSIWYG editor available (optionally) to edit the description text.
Logged
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #27 on:
December 11, 2005, 02:18:36 AM »
Quote from: bhhenry on December 11, 2005, 02:08:14 AM
Many thanks to argos for the great layout settings customization he posted below. I added another column to the file loop table to space the description to fit directly under the title.
You're welcome
Nice little mod with the extra column!
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
kibmcz
Offline
Posts: 216
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #28 on:
December 11, 2005, 02:40:56 AM »
With Download Gallery v1.0 RC2 installed i get the following error when i use WB's search function. It goes away when i remove the module.
Code:
Fatal error: Call to a member function numRows() on a non-object in C:\Program Files\xampp\htdocs\wb\search\search.php on line 203
Logged
bhhenry
Offline
Posts: 51
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #29 on:
December 11, 2005, 02:44:49 AM »
Quote from: kibmcz on December 11, 2005, 02:40:56 AM
With Download Gallery v1.0 RC2 installed i get the following error when i use WB's search function.
Ugh.
I get something similar:
Code:
Fatal error: Call to a member function on a non-object in /home/blah/new.bhhenry.com/search/search.php on line 203
Logged
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #30 on:
December 11, 2005, 03:01:22 AM »
Me too, although the search itself works fine.
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Marden
Guest
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #31 on:
December 11, 2005, 04:59:14 PM »
Is there a way of allowing users to add files for downloading but not be posted till the admin has a chance to look at the file first??
Logged
Woudloper
Guest
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #32 on:
December 12, 2005, 06:02:32 PM »
Thanks for the replies given in this topic. This always helps a developer a lot to find bugs and add new features. First I am going to look into the search problem some (
which some of you have reported
). Which fields should be searchable? In the next Release Candidate I think I will only make the title and the description field searchable.
If that is finished I am going to think about Argos his suggestion for the layout. What do you guys think? Should I skip the
<dl>
list and step over to a
<table>
?
@ Marden:
If you would like something as you mentioned the best thing to do is modify the module a bit and but the 'active' field default on 'not active'. Then you should instruct your users not to change that (
or you can even remove this from the modification section or make the 'active' only visible for the administrator
)
test for updating, I am getting session warnings when posting here at the forum....
«
Last Edit: December 12, 2005, 06:39:25 PM by Woudloper
»
Logged
kibmcz
Offline
Posts: 216
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #33 on:
December 12, 2005, 06:57:23 PM »
Quote from: Woudloper on December 12, 2005, 06:02:32 PM
Thanks for the replies given in this topic. This always helps a developer a lot to find bugs and add new features. First I am going to look into the search problem some (
which some of you have reported
). Which fields should be searchable? In the next Release Candidate I think I will only make the title and the description field searchable.
If that is finished I am going to think about Argos his suggestion for the layout. What do you guys think? Should I skip the
<dl>
list and step over to a
<table>
?
@ Marden:
If you would like something as you mentioned the best thing to do is modify the module a bit and but the 'active' field default on 'not active'. Then you should instruct your users not to change that (
or you can even remove this from the modification section or make the 'active' only visible for the administrator
)
test for updating, I am getting session warnings when posting here at the forum....
Title, File, Description should be searchable.
«
Last Edit: December 12, 2005, 06:58:55 PM by kibmcz
»
Logged
Woudloper
Guest
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #34 on:
December 12, 2005, 09:32:56 PM »
Update (new release candidate 3!!)
After the above mentioned comment I released a new version of the 'Download Gallery' which will not have the search errors anymore and also has the layout of Argos (
which is more in line with the news version
).
If you have any questions do not hesitate to ask them here in the forum thread. If no questions/bugs/etc. will be reported in the forum here I will make this release the final version and put it in the 'completed modules' thread.
Logged
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #35 on:
December 12, 2005, 09:35:09 PM »
Cool
By the way: because I removed the date and time parameters, and you used my version of the settings, they are not there anymore in the new RC module. Maybe other people like to have these parameters, so I suggest you stick them back in...
«
Last Edit: December 13, 2005, 01:20:23 PM by Argos
»
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
JTux
Offline
Posts: 13
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #36 on:
December 13, 2005, 12:48:01 PM »
Thanks for this great module. It works a treat. I have one request, if you are intending to make further modifications, and that is to make the default placement of new uploaded files placed at the top of the generated list. At the moment new files are added to the bottom of the list.
But perhaps there is an easy way to change how this works within the current release that someone can explain to me?
Logged
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #37 on:
December 13, 2005, 01:33:06 PM »
Good suggestion. I have another few
- get rid of filesizes in bytes and round them up to 1kb
- get rid of decimals in case of kb, just round them down or up to whole sizes
- just use 1 decimal in case of MB
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
bhhenry
Offline
Posts: 51
Re: Downloads Module: Download Gallery v1.0 RC2 released
«
Reply #38 on:
December 13, 2005, 03:45:33 PM »
Quote from: Woudloper on December 12, 2005, 09:32:56 PM
I released a new version of the 'Download Gallery' which will not have the search errors anymore and also has the layout of Argos (
which is more in line with the news version
).
Can I just copy the new files over to update from RC2?
Logged
Woudloper
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #39 on:
December 13, 2005, 04:18:49 PM »
Quote
make the default placement of new uploaded files placed at the top of the generated list. At the moment new files are added to the bottom of the list.
This will include a whole other logic from the backend code if you ask me. Besides that, the behaviour for this module is more or less the same as for the news module as mentioned earlier by Argos. What could be done is to add a sorting order to the display table, but this also applies a new option that should be added to the settings page. Think this feature request will not make it for the first release.
Quote
Good suggestion. I have another few
- get rid of filesizes in bytes and round them up to 1kb
- get rid of decimals in case of kb, just round them down or up to whole sizes
- just use 1 decimal in case of MB
Nice suggestions, but don't think these will be implemented into the first release of the download gallery module. If you would like to change the display you can modifiy the function for the file size which can be found in the 'functions.php' file.
If you can adjust the function down below or point me to a better version on the internet I can take a look at it and see if this is workable for the download gallery...
Code:
<?php
function
human_file_size
(
$size
) {
$filesizename
= array(
" Bytes"
,
" KB"
,
" MB"
,
" GB"
,
" TB"
,
" PB"
,
" EB"
,
" ZB"
,
" YB"
);
return
round
(
$size
/
pow
(
1024
, (
$i
=
floor
(
log
(
$size
,
1024
)))),
2
) .
$filesizename
[
$i
];
}
?>
Quote
Can I just copy the new files over to update from RC2?
No you should deinstall the older version and reinstall the new version, because I changed some parts of the 'install.php' file. This file is only called when you install the complete database. You can also update the database, but I have no time to write an update script for only the search fix (
since this is also not a final release of the module
).
Thanks for all the responses!
«
Last Edit: December 13, 2005, 05:59:56 PM by Woudloper
»
Logged
pcwacht
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #40 on:
December 13, 2005, 11:06:45 PM »
Code:
<?php
function
human_file_size
(
$size
) {
$filesizename
= array(
" Bytes"
,
" KB"
,
" MB"
,
" GB"
,
" TB"
,
" PB"
,
" EB"
,
" ZB"
,
" YB"
);
return
round
(
$size
/
pow
(
1024
, (
$i
=
floor
(
log
(
$size
,
1024
))))) .
$filesizename
[
$i
];
}
?>
Just remove the ,2 in the round function.
From php.net:
Code:
echo round(3.4); // 3
echo round(3.5); // 4
echo round(3.6); // 4
echo round(3.6, 0); // 4
If you want to round 1.1 to 2, just add .5 to it
return round($size/pow(1024, ($i = floor(log($size, 1024))))+.5) . $filesizename[$i];
Have fun,
John
Logged
Woudloper
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #41 on:
December 13, 2005, 11:18:41 PM »
@ pcwatch
: I've also found the following code:
human readable sizes
. Isn't this something for this module?? It's needs a little adjustment for this module I think... This function has also an option for rounding, etc...
Logged
pcwacht
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #42 on:
December 14, 2005, 12:13:14 AM »
Yours seem less code (execution time) while running.
If you wanna round things up:
// Return string
if ($retstring === null) {
$retstring = '%01.2f %s';
}
change the '%01.2f %s' to '%01 %s'
'
I would go with the first one
Make some settings in settings page like:
round UP? If rounded, round it up? ie 1.4 becomes 2, 1.0 stays 1
decimals? : store the wanted decimals in a variable, like 0 for none, 2 for 0.11 etc
if ($roundup>0) && ($decimals==0) (
$addition=.45;
} else {
$addition = 0 ;
}
return round($size/pow(1024, ($i = floor(log($size, 1024))))+$addition, $decimals) . $filesizename[$i];
Looks much neater to me then the other code
John
Logged
Argos
Moderator
Offline
Posts: 2084
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #43 on:
December 14, 2005, 01:17:45 AM »
I feel very stupid, but is this something I can use right now? And if so, where should I change what? Sorry for my ignorance
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Woudloper
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #44 on:
December 14, 2005, 08:58:01 AM »
Quote from: Argos on December 14, 2005, 01:17:45 AM
I feel very stupid, but is this something I can use right now? And if so, where should I change what? Sorry for my ignorance
It should be possible if someone modifies the human_file_size function without the setting pcwacht is talking about. Then you can just modify the functions.php file and replace the function. Today I don't have any time left, thus if someone wants to give it a try you can post the adjused version of the function in this thread...
@ pcwacht:
Could you explain this part of the code some more
$addition=.45;
Where does the
.45
come from and what does this mean? Hope to hear from you! To come back. If I understand you correctly you mean that I need to add two options (
to the main settings
). One for the roundup (true/false) and another one for the number of decimals (0, 1, 2, 3, 4, 5)??
«
Last Edit: December 14, 2005, 05:35:13 PM by Woudloper
»
Logged
pcwacht
Guest
Re: Downloads Module: Download Gallery v1.0 RC3 released
«
Reply #45 on:
December 14, 2005, 07:37:58 PM »
The two options: yes
Some want roundings, some don't (option 1)
Some want 1 decimal, others 3 (as in 1.000) (option 2)
Or reduce it to one option, 0 decimals is simular to no rounding
round()
when you round something (with no decimals) it will do the following:
1.1 stays 1
1.49 stays 1
1.50 becomes 2
With Mb's and Kb's you want to know it's size
When you round, the size looks less then it is, so sometimes you want to show 2 instead of 1 when it is 1.432 Mb
That's where the addition of .45 (or less) comes in (it is basicly just showing more then you have
)
1 still stays 1 (1.45)
1.1 becomes 2 (1.55)
etc
So allmost 1 stays 1 and 1 and a bit becomes 2
John
Logged
Woudloper
Guest
Downloads Module: Download Gallery v1.0 RC4 released
«
Reply #46 on:
December 16, 2005, 10:21:22 AM »
Update (Release Candidate 4)!!
After looking at the suggestions of pcwatch I have updated the Download Gallery Module to RC4. Please all test this version and say what you think of this version. For the ones who are interested I have also included an update script.
If pcwacht can take a look at the function I created based upon his ideas I would be very happy!
Logged
pcwacht
Guest
Re: Downloads Module: Download Gallery v1.0 RC4 released
«
Reply #47 on:
December 16, 2005, 12:13:01 PM »
Hi Woudloper,
The function hfs looks good to me
John
Logged
bhhenry
Offline
Posts: 51
Re: Downloads Module: Download Gallery v1.0 RC4 released
«
Reply #48 on:
December 17, 2005, 01:29:13 AM »
Quote from: Woudloper on December 16, 2005, 10:21:22 AM
I have updated the Download Gallery Module to RC4. Please all test this version and say what you think of this version. For the ones who are interested I have also included an update script.
I copied over the new files and ran the update script -- seems to work fine so far. Thanks.
If anyone is interested, I changed the "file loop" settings customization so that the description text is not under the file icon. (See
http://test.ugca.com/pages/architectural-control.php
.)
Code:
<td valign="middle"><img src="[FTIMAGE]"></td>
<td class="line"><a href="[LINK]" target="_blank"><b>[TITLE]</b></a>
</td>
<td class="line_rightalign" valign="bottom">type: [EXT] | size: [SIZE]</span></td>
<tr>
<td> </td>
<td colspan="2">[DESCRIPTION]<p></td>
</tr>
Logged
JTux
Offline
Posts: 13
Re: Downloads Module: Download Gallery v1.0 RC4 released
«
Reply #49 on:
December 20, 2005, 11:53:35 AM »
Works fine for me too.
bhhenry said:
Quote
If anyone is interested, I changed the "file loop" settings customization so that the description text is not under the file icon. (See
http://test.ugca.com/pages/architectural-control.php
.)
I'm interested. Where do I change this code?
Logged
Pages:
1
[
2
]
3
4
...
10
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
-----------------------------
English
-----------------------------
=> Help & Support
-----------------------------
General
-----------------------------
=> WebsiteBaker Website Showcase
-----------------------------
English
-----------------------------
=> Modules
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
-----------------------------
General
-----------------------------
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
-----------------------------
General
-----------------------------
=> Security Announcements
-----------------------------
Deutsch (German)
-----------------------------
=> Hilfe/Support
-----------------------------
General
-----------------------------
=> Documentation
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
=> Module & Snippets
-----------------------------
English
-----------------------------
=> Archive (posts up to 2007)
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Deutsch (German)
-----------------------------
=> jQuery
=> Tutorials
=> Templates & Design
-----------------------------
English
-----------------------------
=> jQuery
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
===> Suggestions
-----------------------------
Deutsch (German)
-----------------------------
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
===> Vorschläge
-----------------------------
English
-----------------------------
===> Software bugs
-----------------------------
Deutsch (German)
-----------------------------
===> Softwarefehler
=====> Module / Extensions
-----------------------------
English
-----------------------------
=====> Modules / Extensions
-----------------------------
Deutsch (German)
-----------------------------
===> Erfahrungs und Testberichte
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...