Welcome, Guest. Please login or register.
March 17, 2010, 06:38:31 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem Website Baker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite .
110175 Posts in 15914 Topics by 9281 Members
Latest Member: s-pax
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Modules (Moderators: Argos, BerndJM)
| | |-+  Downloads Module: Download Gallery v1.0 Final released
Pages: [1] 2 3 ... 10 Go Down Print
Author Topic: Downloads Module: Download Gallery v1.0 Final released  (Read 51376 times)
Woudloper
Guest
« on: November 26, 2005, 12:07:31 AM »

This evening I looked at the download module and thought this would maybe be something for my website. For the several downloads I have I would like to create some kind of the following list:

Quote
Downloads
  • Download name, file type, size
    mm-dd-yyyy
    Nam quis arcu at nisi euismod lobortis. Sed sed massa ut nisi rutrum sollicitudin. Pellentesque luctus tempor quam. Fusce vel lorem. Donec adipiscing, purus in aliquet molestie, ligula lorem ullamcorper urna.
  • Olympus E-500 Quick Start Guide, PDF, 864 KB
05-25-2005
This download contains the English version of the 'Quick Start Guide' for the Olympus E-500.
[/list]

The first option is some dummy content and for the second version I tried to display a real-life version. Can someone tell me if this is possible with the download module for 'Website Baker'.

If it is not possible can someone maybe tell me what needs to be done to achive this to be build into the download module? I have seen that the dowload module now only works with a directory, but would it e.g. be possible to put some information for some of the files in a table and retrieve this information? Would love to see such an implementation. Also hope to hear solutions/suggestions so maybe myself or another module developer can pick this up.

Any code examples would also be great so the further development of such a module will become a bit easier.

Update!!

See this reply in the 'completed modules' thread. There you can find the final release of the 1.0. version of the download gallery. If you have any questions do not hesitate to post a message in this thread. You can also read the other replies because they might answer your question...
« Last Edit: December 23, 2005, 12:04:14 AM by Woudloper » Logged
Woudloper
Guest
« Reply #1 on: November 27, 2005, 04:27:23 PM »

Anybody has some suggestions for the above point I have mentioned? If someone got some tips about how I can achieve something like that I create a database entry for each file in the file section...
Logged
pcwacht
Guest
« Reply #2 on: November 27, 2005, 10:38:07 PM »

My idea,

Clone the news module
Use conten_short for text
Change content_long to link

Then you have groups and commenting system at same time as a bonus


Idea?

John
Logged
hudge

Offline Offline

Posts: 173


WWW
« Reply #3 on: November 27, 2005, 11:21:36 PM »

I agree but I would think you would also want a file upload too so that you dont have to use a link for the file. So your fields would be something  closer to the image gallery mod minus the jpg/png restrictions and then only having one column. I think this is very doable.

So the fields you want are:

Download name (aka title)
file type (reads the extension)
size (reads the file size)
mm-dd-yyyy (reads the date created)
Description

so you really only need: title, upload, description

let me know if this sounds right I can dummy one up later to show you what I mean.
Logged

: Member of the Baker's Dozen :
Baking at 350˚ for 2 hours now...
hudge

Offline Offline

Posts: 173


WWW
« Reply #4 on: November 28, 2005, 12:37:08 AM »

I got one rigged up but has 2 errors and I am out of time.

The link is wrong on view.php line 125

$image_link = WB_URL.MEDIA_DIRECT ORY.'/dl_gallery/image'.$image['image_id'].'.'.$ext;

also the file is renamed on upload, this is what is calling so we need that updated.

Then just a file look up to see ext and size.

here is where my file is at:
http://www.hudge.com/contributes/dl_gallery.zip
Logged

: Member of the Baker's Dozen :
Baking at 350˚ for 2 hours now...
Woudloper
Guest
« Reply #5 on: November 28, 2005, 06:42:26 AM »

I got one rigged up but has 2 errors and I am out of time.

This one looks great! I've installed it seems to be your version suit my needs.

Quote
The link is wrong on view.php line 125

$image_link = WB_URL.MEDIA_DIRECT ORY.'/dl_gallery/image'.$image['image_id'].'.'.$ext;

also the file is renamed on upload, this is what is calling so we need that updated.

I will dig into some of your problems and see what I can do!
Logged
Steven Holder
The Template Master

Offline Offline

Posts: 493



WWW
« Reply #6 on: November 29, 2005, 06:01:16 PM »

make sure you have

Code:
include '../../config.php';

on View.php
Logged
Woudloper
Guest
« Reply #7 on: November 29, 2005, 06:17:40 PM »

Thanks. I am rewriting the module right now. Make it more in line with the other modules I have worked on.
Logged
Woudloper
Guest
« Reply #8 on: November 30, 2005, 09:20:15 AM »

Update

The adjustments to the 'Download Gallery' module are almost implemented and I have also fixed some other stuff (like: preparing it for WB2.6.0.).

The main things I need to sort out are:
  • Remove files when deleting download gallery page
  • Cleanup download_gallery folder when uninstalling the module.

Furthermore I still need to fix the following (as Hugde) said:
  • Implement file icons (based upon the file extension)
    If someone has several icons (same size) I love to see these so I can include this in the module.
  • Write an help section for the module


@ Stefan Holder: What do you men with the 'include ../../config.php'? As the view.php is also working without this...
Logged
Woudloper
Guest
« Reply #9 on: December 01, 2005, 03:36:32 PM »

I need some advice for the last function I am building which I need to get the final release of the download gallery module. Currently I am implementing the 'image based on extension' functionality. To get this working I want to implement the following code:

Code:
<?php
function extension_image($extension) {

//Array overview
$image_array = array ( "jpg""jpeg""jpe""jfif""gif""bmp""dib""png""tif""tiff""wmf""emf" );
$movie_array = array ( "mov""wma" );
$docs_array = array ( "doc""dot" );
$pres_array = array ( "ppa""pps""ppt");
$excel_array = array ( "xla""xlb""xlc""xld""xlk""xll""xlm""xls""xlt""xlv""xlw""xlxml" );
$compr_array = array ( "arj""cab""lzh""tar""tz""zip" );
$pdf_array = array ( "pdf" );
$txt_array = array ( "txt""bat""ini""log");

switch($extension) {

case in_array($extension$image_array):
$extimg "image.gif";
break;
case in_array($extension$movie_array):
$extimg "movie.gif";
break;
case in_array($extension$docs_array):
$extimg "document.gif";
break;
case in_array($extension$pres_array):
$extimg "presentation.gif";
break;
case in_array($extension$excel_array):
$extimg "spreadsheet.gif";
break;
case in_array($extension$compr_array):
$extimg "compression.gif";
break;
case in_array($extension$pdf_array):
$extimg "pdf.gif";
break;
case in_array($extension$txt_array):
$extimg "text.gif";
break;
default:
$extimg "unknown.gif";
break;
}

//create image path
$imgpath WB_URLMEDIA_DIRECTORY '/download_gallery/images/' $extimg;

return $imgpath;

}
?>


If I am correct the above function is a working version, but I have some questions for you here, that are:

  • Q: Do you have some more suggestions for the extension for the several categories?
  • Q: Do you have some suggestions for the image icons that can be used?
    Currently I am using the images that can be found here, thus: , , , , , , , and one for 'unknown'

Hope that someone can help me and make some suggestions for the 'Download Gallery' so I can finalize this module for 2.6.0.
« Last Edit: December 01, 2005, 05:37:21 PM by Woudloper » Logged
pcwacht
Guest
« Reply #10 on: December 01, 2005, 07:19:02 PM »

Not answers but.

extensions and images, make them settings so peops can manage their extensions, that way you'll stay flexible

Suugestions for new ones, dunnoh, you seem rather complete.
Maybe some wb ones,
wb-addon
wb-module
wb-template
wb-language
etc ??

John
Logged
DGEC

Offline Offline

Posts: 382


WWW
« Reply #11 on: December 01, 2005, 09:20:01 PM »

I was going to try to integrate FCKEditor into a Links page, and write my own PHP to do something similar to this download module on my custom, hand-built from scratch site.  If this allows you to easily catagorize downloads....

I may have to do the work to port it over to WB   undecided

You're just making it too good.  Next thing you know, the calendar mod is going to be actually usable.

Logged
Woudloper
Guest
« Reply #12 on: December 02, 2005, 12:14:22 AM »

@ pcwatch: Thanx for the advice. Currently I am working out your suggestion. Now I need to find out how the above mentioned function can be used with an addiotional table where those settings are set... If everything is working I will post a version over here...

Do any of the other modules use popups to modify some content? I would like to do this for the 'extensions'. Hope to hear from you...
Logged
pcwacht
Guest
« Reply #13 on: December 02, 2005, 12:37:47 PM »

modify extensions:

You could allso use a text field, delimite each entry with , use the php function to break the text to array (or to do the reverse)

see explode : http://nl2.php.net/manual/en/function.explode.php
see implode for the reverse : http://nl2.php.net/manual/en/function.implode.php

John



Logged
orbiteleven

Offline Offline

Posts: 27


WWW
« Reply #14 on: December 06, 2005, 06:45:11 PM »

Is there a working (or semi-working) version of this module with a todo list?  I really want the functionallity, and would lend my time.
Logged
Woudloper
Guest
« Reply #15 on: December 06, 2005, 11:04:35 PM »

Thanks to hudge I worked on a new download gallery module (which you can find attached). It has many new features (that have been mentioned here above).

Hopefully some of you can test it and tell me/us what you think of the module. If you find errors please do not hesitate to mention them here so we can work on them and see if we can fix this.

[attachment deleted by admin]
Logged
pcwacht
Guest
« Reply #16 on: December 06, 2005, 11:21:26 PM »

Offtopic, but don't you just love WB, how easy it is to build addons.
I know I do Tongue
Logged
hudge

Offline Offline

Posts: 173


WWW
« Reply #17 on: December 07, 2005, 06:42:20 AM »

Man it is still tough for me. lol I do love it thou.

Hey I am just glad to see we completed another mod. Please add it to the completed section when ready.
Logged

: Member of the Baker's Dozen :
Baking at 350˚ for 2 hours now...
Woudloper
Guest
« Reply #18 on: December 07, 2005, 11:16:43 AM »

I do not want to release the new module directly. First want to hear if some people can:

  • Succesfully install the Download Gallery module;
  • Succesfully create new pages based upon the Download Gallery module;
  • Succesfully add downloadable files to the created page;
  • Succesfully delete downloadable files within a created page;
  • Succesfully change the order of downloadable files;
  • Succesfully change the settings for the Download Gallery page;
    Think of the layout settings, extensions adding/removing for the extension groups)
  • Succesfully delete a page with downloadable files on the page;
  • Succesfully delete a page without downloadable files on the page;
  • Succesfully uninstall the Download Gallery module

(If someone has some other test cases I am willing to hear them!)

If all above testcases have been succesfully reported here in the thread I will put the Download Gallery module in the 'Completed Modules' thread...
Logged
NOWYSIWYG

Offline Offline

Posts: 3


« Reply #19 on: December 08, 2005, 04:00:14 PM »

Thanks for this addon. It works O.K. but here is a small problem, the module does not show in a sections manager.
Logged
Woudloper
Guest
« Reply #20 on: December 08, 2005, 04:39:28 PM »

Thanks for this addon. It works O.K. but here is a small problem, the module does not show in a sections manager.

Could you explain something more about this!? What do you mean with 'it does not show up in the section manager'. Would it be possible that you describe the steps that you have doen in order to get to that specific state!?
Logged
NOWYSIWYG

Offline Offline

Posts: 3


« Reply #21 on: December 08, 2005, 07:00:35 PM »

Maybe it is not intended to, but I would rather see the download module to add a new content block, which would be changed (repositioned) as other content types from the "Pages -> Manage Sections" screen of WB.

The installation went like a charm and the module seemed fully functional when I created a new page based on it. Everything was in there and operational from the "Pages -> Modify Page" screen.

However, later I tried to add this module as a subsection to another page from the dropdown menu on the "Pages -> Manage Sections" screen. But then the system behaved awkwardly - nothing had changed on the screen and the menu selector jumped to the default WYSIWYG option.

I tried to add the section once more but in vain - no mention of a new content type on the screen. But I noticed that after the first attempt the down-pointing arrow appeared along the default content item (while nothing was indicated down there).

I suspected that something nevertheless happened, checked the frontend, and was welcomed with the following message:

Quote
Fatal error: Cannot redeclare human_file_size() (previously declared in d:\microfinance\public_html\modules\download_gallery\view.php:17) in d:\microfinance\public_html\modules\download_gallery\view.php on line 17

I returned back to the backend and clicked on the "Pages -> Modify Page" link and violla, two add file dialogues were there just below the main content area. I could not remove them from the sections management screen but had to delete the entire page.

This is the small problem. Otherwise, the addon is fully functional.

Thanks
Logged
Woudloper
Guest
« Reply #22 on: December 08, 2005, 11:12:47 PM »

I also did some testing and saw the errors you described. They had to do with two problems. The first one was about a wrong info.php file and the other had to do with the functions used in the view.php file. The functions have been stored in a separate file and they are being called with the function: include_once. Hopefully this will solve most of the problems.

Attached you will find a new release candidate of this module. You can also only pick up the three files (info.php, view.php and functions.php) and put them in the download_gallery module. If you perform this last action you should also reload the addons (menu --> settings --> show advanced settings [ scroll down ] --> click 'Reload addons')
Logged
wwwMARKLEYcouk

Offline Offline

Posts: 287



WWW
« Reply #23 on: December 09, 2005, 04:46:02 PM »

hi.. the module looks great and is a very worthwhile effort, good job..

i have a couple things though.. i installed it and i dont get the images for the documents though Sad am i supposed to install them seperate? also when i attempt to modify the settings on a document i get the following error in the popup:

Fatal error: Cannot instantiate non-existent class: database in /home/pmarkley/public_html/play/modules/download_gallery/modify_extensions.php on line 6
Logged

http://www.markley.co.uk
webhosting packages available
Woudloper
Guest
« Reply #24 on: December 09, 2005, 11:30:20 PM »

i have a couple things though.. i installed it and i dont get the images for the documents though Sad am i supposed to install them seperate? also when i attempt to modify the settings on a document i get the following error in the popup:

Fatal error: Cannot instantiate non-existent class: database in /home/pmarkley/public_html/play/modules/download_gallery/modify_extensions.php on line 6

This error has to do with the fact that I have designed the module for WB2.6.0. and not for WB2.5.2. To get it working on 2.5.2. I have to work out some stuff. To get it mostly working it the uncomment the 4th line in the modify_extensions.p hp file. This way you don't get the error message as described above anymore
Logged
Pages: [1] 2 3 ... 10 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!