touchdez Posted July 6, 2013 Share Posted July 6, 2013 I need someone to write a piece of code for this: Explanation: I want to upload a picture, choose which album to use, have a description and a file attached to the picture. I want to click on this picture on my website and download the file attached to it. Is there anyone that can help me with this? Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2013 Share Posted July 6, 2013 This is not really a job for few /few tens of minutes. I am sure you would find people willing to do this, but for a fee, not for free. 1 Link to comment Share on other sites More sharing options...
touchdez Posted July 6, 2013 Author Share Posted July 6, 2013 (edited) I understand that, PSfever.com. I have written the piece of code that you see in the picture, by have no idea how to write the bit that does the database. That is the only bit of information that I am looking for. Here is the code as it is at the moment: /** * Create table */ protected function createTable() { $sql1 = 'CREATE TABLE `'._DB_PREFIX_.'freebies` ( `id_image` int(10) unsigned NOT NULL auto_increment, `id_album` int(2) NOT NULL, `caption` varchar(256) NULL, PRIMARY KEY (`id_image`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $sql2 = 'CREATE TABLE `'._DB_PREFIX_.'freebies_album` ( `id_album` int(10) unsigned NOT NULL auto_increment, `title` varchar(256) NULL, `short_description` text NULL, `description` text NULL, PRIMARY KEY (`id_album`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; if( !Db::getInstance()->Execute($sql1) ) return false; if( !Db::getInstance()->Execute($sql2) ) return false; return true; } Edited July 6, 2013 by touchdez (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 7, 2013 Share Posted July 7, 2013 where you want to display these pictures? how you attaching files for each picture in the "gallery" ? Link to comment Share on other sites More sharing options...
touchdez Posted July 8, 2013 Author Share Posted July 8, 2013 vekia, a while ago you helped me to do a CMS page with free designs, done in a table format, which works well, by the way. I want to display these pictures on the Free Designs, but want to do it with a module instead of a CMS page. The module is the azgallery module, with some modifications. It will be easier to upload the designs this way, than to try and resize each picture manually to fit into the table - it looks better. In hindsight, I want to be able to click on the name,not the picture. Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 So, basically, you need this module to be modified, and add all the image upload code +database storing? Where are those images supposed to show up at the end, after they're uploaded? Link to comment Share on other sites More sharing options...
touchdez Posted July 8, 2013 Author Share Posted July 8, 2013 (edited) That is correct, Nemo1. I have a page called Freebies on my website: http://touchdezines.com/shop/gallery I would like this page to look the same as the Gallery page. At the moment I have it that a customer has to be logged in to get the free designs. Which files do I need to post here? Edited July 8, 2013 by touchdez (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 hmmm. If I click on gallery, I get a 404 quick question: is the module already hooking to cms pages? I assume it is, since the gallery is a CMS page as well? Link to comment Share on other sites More sharing options...
touchdez Posted July 8, 2013 Author Share Posted July 8, 2013 (edited) I fixed it, Nemo1. I am not sure if the Gallery is hooking to a CMS page - I don't think so, since I didn't create a page for it. The Freebies page is a CMS page, though. I don't know what is going on with the Gallery now - it is there and then it is not. I will see whether I can fix it - sorry about that. Got it! Edited July 8, 2013 by touchdez (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 i cant access to gallery page, still 404 Link to comment Share on other sites More sharing options...
touchdez Posted July 8, 2013 Author Share Posted July 8, 2013 Sorry, vekia, here is the link again: http://touchdezines.com/shop/gallery Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 okay thanks i checked it and it works so my questions is, how you want to attach the file to each picture? as far as i know there is no option for that, so you have to modify the module and this is what you expect, right? Link to comment Share on other sites More sharing options...
touchdez Posted July 8, 2013 Author Share Posted July 8, 2013 That is right, vekia. I have already done some modifications to it and called the module something else, like freedesigns instead of azgallery, but I cannot get the zip file to attach to the picture, like I did in the CMS page called Freebies Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 and what you think about additional field where you will put the url to the file that you will upload manually via FTP ? it's easier than huge modification of the module to support "uploading" and attaching files... just let me know what you think about that Link to comment Share on other sites More sharing options...
touchdez Posted July 9, 2013 Author Share Posted July 9, 2013 (edited) vekia, that is fine with me, as long as I can get the zip file attached to the picture or the name thereof. I don't like the CMS page I created, as I will have to keep creating pages, the more free designs I have. With the modified module it will not be the case. Am I wrong in thinking it is just another line to be written to the table, the code which is in post #3 above? Edited July 9, 2013 by touchdez (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 9, 2013 Share Posted July 9, 2013 well, it's necessary to create new field in the datbase you mentioned above. I don't know how the full module code looks like, but i think that you should also change the object definition of course only when this module is based on it. If it isn't, you have to modify form to upload the picture + scripts to insert the "file url" field to the db Link to comment Share on other sites More sharing options...
touchdez Posted July 9, 2013 Author Share Posted July 9, 2013 Shall I send you the files, vekia? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now