Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

File Library v1.0


tobycatlin

Recommended Posts

Installed ok but my files.php displays things wrong :( it doesnt appear to mix with my current skin...

 

Cant edit my post :( anyway.. figured it out, its cos im using a template system! in the end I added it in a similar way to "define mainpage"

 

my files.php ended up looking like:

 

     <?php

/*
File library v1.3
files.php

Copyright (t)(c) 2005

Released under the GNU General Public License

Simple file listing script allowing a cover image to be attached to a file an displayed by section

Changes:
31-03-2005 - minor change
-added if statement in case this script is run when there are no files in the files table
*/

$section_query = tep_db_query("SELECT DISTINCT file_section FROM files WHERE file_status = '1'");

if ($section_query) {
   while ($section = tep_db_fetch_array($section_query)){
	 echo '<br><table align="center" ><tr><td class="infoBoxContents" colspan="2"><table width="100%" cellspacing="0" cellpadding="0"><tr>
   <td width="11">' . tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif') . '</td><td class="infoBoxHeading">'.$section[file_section].'</td><td width="11">' . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif') .'</td>
    </tr></table></td></tr>';
	 
	 $file_query = tep_db_query("SELECT * FROM files WHERE file_status = '1' AND file_section = '$section[file_section]'");
	 
	 while ($file = tep_db_fetch_array($file_query)){
	 echo '<tr valign="top">';
	 
	 if ($file[file_image_path]){
   echo '<td class="main" >'. tep_image( $file[file_image_path], $file[file_title], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT).'</td>';
	 }else{
   echo '<td class="infoBoxContents"></td>';
	 }
	 
	 echo '<td width="400" class="infoBoxContents"><b>' . $file[file_title]. '</b><br>' . $file[file_description] .'<br><br><b><a href="' . $file[file_path] . '" target="_BLANK" class="infoBoxContents">download...</a></b></td></tr>';

   echo '<tr><td></td></tr>';

	 }//end while 
 }//end distinct while
}else{
 echo 'No files found';
}
 ?>


     </td>
     </tr>
   </table

Edited by snout
Link to comment
Share on other sites

  • 1 month later...

I am getting the below error after installing this what looks to be a great conrtib. It appears in the admin page after clicking on files.

 

 

 

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 '-20, 20' at line 1

 

select * from files order by file_title limit -20, 20

Link to comment
Share on other sites

Or not. I find that adding the file is fine. No problems. However, when I come to change the image for another, I get the below error:

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in c:\program files\e-novative\WAMP\www\catalog\admin\files.php on line 66

 

Warning: reset() [function.reset]: Passed variable is not an array or object in c:\program files\e-novative\WAMP\www\catalog\admin\includes\functions\database.php on line 55

 

Warning: Variable passed to each() is not an array or object in c:\program files\e-novative\WAMP\www\catalog\admin\includes\functions\database.php on line 79

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 'where file_id = '4'' at line 1

 

update files se where file_id = '4'

 

[TEP STOP]

Link to comment
Share on other sites

  • 7 months later...

Hi All,

 

I have a FRESH install of Oscommerce 2.2ms2-051113 with only CCGV installed.

Apache 2.0.55, PHP 5.1.1, MySQL 4.1

 

I performed the install of File Library v1.31 (31 Mar 2005).

 

I have found numerous issues all of which have already been stated on various posts. These are all the errors summed up which need to be rectified...

 

1. Few Cosmetic Errors:

- Please fill out the following information for the new country".

- Language definitions for TEXT_FILES_COVER_IMAGE, TEXT_DELETE_IMAGE, and NAVBAR_TITLE

 

2. An attempt to load any file larger than 1.99MB causes the error "Warning: No file uploaded." and an empty file record to be created.

I have tried this with jpg, bmp, wmv and pdf.

 

3. An attempt to edit an existing file in admin produces:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Program Files\Apache Group\Apache2\htdocs\catalog\mky\files.php on line 66

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\Program Files\Apache Group\Apache2\htdocs\catalog\mky\includes\functions\database.php on line 55

Warning: Variable passed to each() is not an array or object in C:\Program Files\Apache Group\Apache2\htdocs\catalog\mky\includes\functions\database.php on line 79
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 'where file_id = '4'' at line 1

update files se where file_id = '4'

[TEP STOP]

 

A response to these issues would be greatly appreciated.

Link to comment
Share on other sites

  • 7 years later...

Someone alive here ?

Get some problems..

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /users/xxxxxx/www/shop/xxxxxx/files.php on line 66

 

Warning: reset() expects parameter 1 to be array, null given in /users/xxxxxx/www/shop/xxxxxx/includes/functions/database.php on line 59

 

Warning: Variable passed to each() is not an array or object in /users/xxxxxx/www/shop/xxxxxx/includes/functions/database.php on line 83

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where file_id = '1'' at line 1

 

update files se where file_id = '1'

Edited by TriCon

SELECT signatur FROM dummesprueche WHERE forumsbezug > 0

Link to comment
Share on other sites

You will probably run into quite a few problems with an addon that has not been updated in 8+ years but for the one you mention, open the files.php line and on line 66 you will see something like array_merge(...,...). After the comma, insert (array).

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...