Jump to content
Latest News: (loading..)
kymation

[Contribution] Documents Manager

Recommended Posts

Thanks now removed that command and get the following error.

 

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `configuration_group` (`configuration_group_id`, `c

 

I know this relates to the ID number as pointed out in the warning, but i have changed the ID many times and still get the error.

 

How do you find the next id in PHPmyadmin?

 

Hello wrong is in sql, you need add ";" at end of all

DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 

like

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; 

 

and it works

Share this post


Link to post
Share on other sites

HI,I have found this bug.

in the file catalog / documents.php NO. 94 Line

 

----FIND:

$documents_array[$documents_index] = array ('name' => $documents_name,

----REPLACE WITH:

$documents_array[$documents_index] = array ('name' => $documents['documents_name'],

 

 

in the file catalog / documents.php NO. 212 Line

----FIND:

echo ' <td class=main><a href="' . DIR_WS_DOCUMENTS . $document['type_name'] . '/' . $document['name'] . '.' . $document['extension'] . '">';

----REPLACE WITH:

echo ' <td class=main><a href="' . DIR_WS_DOCUMENTS . $document['type_name'] . '/' . $document['name'] . '">';

 

in the file catalog / documents.php NO. 213 Line

----FIND:

echo $document['name'] . '.' . $document['extension'] . ' (' . number_format ($document['size']) . ' k)';

----REPLACE WITH:

echo $document['name'] .' (' . number_format ($document['size']) . ' k)';

 

 

ok! :rolleyes:

Share this post


Link to post
Share on other sites

Not exactly a bug, that's just a different way of doing exactly the same thing. Either will work.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Not exactly a bug, that's just a different way of doing exactly the same thing. Either will work.

 

Regards

Jim

 

 

Hi Jim & Boboo,

 

It might be the exact thing, but for me it's a bug fix 'cause finally I can see my download-files on documents.php. Something I couldn't do for so long and Jim didn't find the clue either.

 

So Boboo: keep up the good work. And thanx anyone (especially Jim for writing this great contribution !).

 

Kind regards,

 

Marcus

Share this post


Link to post
Share on other sites

That's very interesting. It implies that pathinfo() doesn't work properly. PHP bug? I wish I could test this, but the original version works correctly everywhere I've used it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

That's very interesting. It implies that pathinfo() doesn't work properly. PHP bug? I wish I could test this, but the original version works correctly everywhere I've used it.

 

Regards

Jim

 

Hi Jim,

 

It seems like a bug in pathinfo() 'cause the script itself is correct. What Boboo just did is simply removed the PHP function and created one of it's own. It has the same result so simply it could not fail.

 

Apparently pathinfo() should be the issue here.

 

Regards,

Marcus

Share this post


Link to post
Share on other sites

Actually, he bypassed the 'filename' part in the echo statements. The 'extension' part apparently works, since that's needed to determine the file type.

 

It's obvious that I should read the manual more often. The 'filename' part requires PHP 5.2 or higher. People with older versions would have the problem. I need to apply this fix and release it.

 

Thanks (and apologies for doubting) to Boboo for finding the problem and fixing it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I've added an updated version to the distribution page. Anyone who has been having the problem with filenames showing up in catalog/documents.php should replace that file with the one in the distribution.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I've added an updated version to the distribution page. Anyone who has been having the problem with filenames showing up in catalog/documents.php should replace that file with the one in the distribution.

 

Regards

Jim

 

Hi Jim,

 

The new version is working fine for me. Just wanted to let you know.

 

Regards,

Marcus

Share this post


Link to post
Share on other sites

Hi Jim, Everyone

 

Thank you for your contribution and promptly modify the problem.

I am not a professional PHP programmer, only to find the problem and simply achieved.

:blush:

Share this post


Link to post
Share on other sites

I'm not really a programmer, I just play one on this forum. Thanks to everyone who reported the bug and prodded me into fixing it.

 

Extra thanks for boboo for providing code. I changed your code a bit to fix the duplicate file checker. I realize most people don't need that feature, but there are a couple I know of that do, so I wanted to make it work for everyone as well.

 

If you find any more bugs, post them here. I'll try to keep up with the different PHP versions in the future.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

HI!

 

'Delete' is not working.

 

I can't delete the uploaded file. It can delete the title and the sort order; it also deletes it from the web page till you click 'Update'. But in doesn't delete it from the server. Help !

 

mibo

Share this post


Link to post
Share on other sites

Hi!

 

I have installed this contribution and it works great, thanks again for the great job. :thumbsup:

 

I have created a new Document Type according to the instructions and added documents to it. This are documents with price and since I have my shop set up to show prices only to login customers I would like that this new Document Type becomes only visible after the customer hat logged in.

I am not a PHP expert so if you have any idea how I could manage this and which files I have to edit it would be great.

I know the logic should be something like:

 

if (document_types_id = '9' && customers_group_id != '0') {

display document

} else{

don't display document

}

 

Please help ASAP, my shop should come on-line on Monday and this is the only thing I have not able to get working. :blink:

 

Thanks in advance,

 

Mrstech

Share this post


Link to post
Share on other sites

Hi,

 

I was just wondering if anyone might have written some installation instructions for this contribution? I think this will really useful but as there are 15 files to modify, using winmerge to compare against my heavily modified site will be a real pain. I know the readme file says that using a file compare program is easier than actual instructions, but it would be nice to have a choice.

 

Thanks,

 

Nick

Edited by longhorn1999

Share this post


Link to post
Share on other sites

Well actually I got this thing installed using winmerge with a lot less hassle than expected. I still say better instructions would be useful, especially since there's a bit of conflict with the Info Pages Unlimited contribution and some parts of general.php appear in winmerge as if they should be overwritten when they of course they should not be, but everything works great. Thanks for this add-on!

Share this post


Link to post
Share on other sites

Please feel free to write better instructions if you want to. I'm just too busy to attempt it. Just be prepared to support what you write and maintain it as well. Trust me; it's not that easy.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

For everyone who didn't get an answer here: It's because this forum silently deletes my subscriptions at random times. This is a major problem, and there's nothing I can do about it. If you don't get an answer after a day or so, PM me with a link to your post. I do support what I write.

 

If you are still having a problem, please post again. I'll be watching this thread until the next time the forum deletes it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Please feel free to write better instructions if you want to. I'm just too busy to attempt it. Just be prepared to support what you write and maintain it as well. Trust me; it's not that easy.

 

Regards

Jim

 

 

That's quite alright. I've learned now in my short time on these forums to try things out before I complain too much. :) Thanks again for this add-on. It really is useful and something that not all of my competition has...

Share this post


Link to post
Share on other sites

Can anyone tell me if editing files is as simple as dropping in the '// Start Documents Manager ........ // End Documents Manager' into any of the files that already exist.

 

Like Nick, my site has modifications on it that makes certain files look nothing like the ones in the contrib therefore making it difficult to determine what actual changes are needed to be made. I am not experienced so I do rely on written instructions to make things work even though I use Beyond Compare.

 

Any help appreciated.

 

Nav

 

 

 

 

Hi,

 

I was just wondering if anyone might have written some installation instructions for this contribution? I think this will really useful but as there are 15 files to modify, using winmerge to compare against my heavily modified site will be a real pain. I know the readme file says that using a file compare program is easier than actual instructions, but it would be nice to have a choice.

 

Thanks,

 

Nick

Share this post


Link to post
Share on other sites

A couple more things to do: There are some single lines that are marked

// Documents Manager
$some_code_here;

Don't forget the new files as well.

 

You should be fine if you get all of the marked chunks of code. Beyond Compare should highlight all of the changes for you as well, so they will be easy to spot.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

I installed your wonderful contribution without a glitch but I find that when I try to download any of the *.pdf files from my website I only get the first 621 bytes of the file downloaded and therefore unreadable. (You can try downloading from http://www.chameleonisland.co.nz/Forms). I have checked security permissions from my server provider and they have no problems there end.

 

Thank you for help.

 

Ollie

Share this post


Link to post
Share on other sites

The 621 bytes you are getting are the standard Apache 500 server error message. Try removing the .htaccess file from the documents directory and see if that changes anything.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

The 621 bytes you are getting are the standard Apache 500 server error message. Try removing the .htaccess file from the documents directory and see if that changes anything.

 

Regards

Jim

 

Hi Jim!

 

Thanks for your response ... I am now able to download the files by removing the .htaccess. However, is there a security risk in having the /documents folder without the .htacess file?

 

Cheers

Ollie

Share this post


Link to post
Share on other sites

Yes, the file is there mostly for security. I would try again with the .htaccess file, and disable part of it at a time until your downloads work again. I suspect that the problem is the Force Download section (lines 18-22.) Try that first.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Yes, the file is there mostly for security. I would try again with the .htaccess file, and disable part of it at a time until your downloads work again. I suspect that the problem is the Force Download section (lines 18-22.) Try that first.

 

Regards

Jim

 

Thank you again Jim ... I now the download working with the .htaccess file and please note the change I have made for "Force download" ... I have only included the extension .pdf because that is the only file type that can downloaded for the moment...:

 

# Prevent directory listing

IndexIgnore *

Options All -Indexes

 

# Secure directory by disabling script execution

AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi

Options -ExecCGI

<Files ~ "\.(php*|s?p?html|cgi|pl)$">

deny from all

</Files>

 

# Don't show this file

<Files .htaccess>

order allow,deny

deny from all

</Files>

 

# Force download files

AddType application/octet-stream .pdf

 

Cheers

Ollie

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×