Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

photo gallery for oscommerce


Recommended Posts

Can anyone tell me which bit code in which file I need to change

to display most recently uploaded photos at the top of the

page instead of the bottom?

I know it is planned for future updates, but if any can help me now

that would be great!

Link to comment
Share on other sites

  • Replies 320
  • Created
  • Last Reply

Top Posters In This Topic

Just installed this addons and it's really perfect for a tiny gallery!

Thanks to all contributors.

 

i just have a little problem

when i cick on the image it open the image in the same page so the site is gone and we just can't return to the site.

it seems to have a problem with the highslide function (i removed the echo http_server)

anyone else have this problem?

Edited by SambaMambo
Link to comment
Share on other sites

you should copy the style into the stylesheet.css in order to get load by firefox and i.e

 

now i get the loading message but nothing load...

i'm still trying to make it work for the 2.2rc2a.

If anyone has arrived to do it... tell us! ^^

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this contribution, I'm getting a weird error though when using v0.9 (osC v2.2 RC2a, PHP v5.2.5, MySQL v5.0.75)

 

When I try and view My gallery threw My account > My Gallery. I get a screen with

1146 - Table 'heraldso_ccshopv2.TABLE_GALLERY_SUPERUSERS' doesn't exist

select count(*) as total from TABLE_GALLERY_SUPERUSERS where cID = '2'

[TEP STOP]

 

I have verified that both the Gallery and Gallery_Superusers exist in the database. I've also tried making my test user a super user. The change is registered in the sql database, I checked, but I still get this error.

 

Thinking I fuged the install somewhere, I went back and rechecked all the file edits and everything is as it should be.

 

______

 

Also, I noticed that Admin > Gallery > Clean Gallery results in the following error

Cleaning folder ../gallery/thumbnails ... 

Warning: dir(../gallery/thumbnails) [function.dir]: failed to open dir: No such file or directory in 'root'/catalog/admin/gallery.php on line 52

Fatal error: Call to a member function on a non-object in 'root'/catalog/admin/gallery.php on line 53

 

condensing 'root' to where everything is installed)[/code]

 

Thinking that this was caused by the files not existing, I try doing an admin upload, and get

Warning: copy(root/catalog/gallery/2_1.jpg) [function.copy]: failed to open stream: No such file or directory in 'root'/catalog/admin/gallery_upload.php on line 57

Warning: Cannot modify header information - headers already sent by (output started at 'root'/catalog/admin/gallery_upload.php:57) in root/catalog/admin/includes/functions/general.php on line 22

(again condensing root to where the stuff actually is)

 

Anyone have any ideas on where I could begin to try and fix this.

I do use STS but for sake of testing, disabled it to see if it makes a difference, it doesn't.

Thanks in advance :)

Edited by Chubbs
Link to comment
Share on other sites

Guess it doesn't allow editing after a set time... Hate double posting.

 

Anyways I read back a few pages. As far as my "Warning: Cannot modify header information" problem goes. The suggested extra charters after ?> isn't whats causing it. I checked the general.php file, and all other admin files I had to edit.

Link to comment
Share on other sites

I ended up getting it working.

After making the /catalog/gallery/ folder myself and giving it 777 permissions assuming thats what was needed, and fixing my catalog/includes/database_tables.php file (somehow the gallery addititon didn't save). I applyed Lee's fix for the highslide java script calls.

 

After successfully adding a picture threw My account> Gallery, I got the error in the ../boxes/gallery.php fixed by Lee again here

 

after getting all that fixed and working the admin upload fixed itself... I didn't have to do anything to get it to start working.

 

Next came using a file compairsion program I compaired the highslide css so I could combine it and put it into the main style sheet. I found when 'trying' to edit one the other would take over so just put it all in one uniform place. Prior to this the Edit and Comments boxes were completely screwy.

 

All thats left is to edit the css of the iframes so that it suits the site.

A big thanks to the contributer for the contribution, and Thank you Lee for having already fixed my problems once I found them :)

Link to comment
Share on other sites

Ahhh, box height. I wasn't able to overcome that. I will revisit it and see if I can fix it.

....

lildog

 

OK, let me fix boxes/gallery.php for infobox height

 

line 50

$box_text .= '<table border=0 cellpadding=0 cellspacing=0 width="100%" height="155" id="special'.$row.'">

 

spot "155" it is height in pix, if nessesary change this size to fit your needs.

Link to comment
Share on other sites

I've got another problem.

Before fixing the logout problem, When trying to leave a comment on a picture in the gallery I was getting booted to index.php and logged out. The comment isn't saved.

 

Since telling highslide to keep the osCid in the form box, Im now just booted to index.php and the comment isn't saved.

 

I've looked in the gallery_processes.php even, and I can't seem to figure this out.

 

Gallery is installed at http://www.v2.chubbscorner.com/catalog/gallery.php if someone wants to verify.

 

(tested in Opera 9 and IE 7)

Link to comment
Share on other sites

  • 2 weeks later...
OK, let me fix boxes/gallery.php for infobox height

 

line 50

<?php
/*
Photo Gallery for osCommerce version 0.6


 $Id: shipping.php,v 1.22 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce  Released under the GNU General Public License

Site design by www.micrographx.be
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/gallery.php');

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link('gallery.php'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<script type="text/javascript" src="/highslide/highslide.js"></script>
<script type="text/javascript">   

<?php if (isset($_GET['autoload'])) {?>
hs.addEventListener(window, "load", function() { 
  // click the element virtually: 
  document.getElementById("autoload<?php echo $_GET['autoload'];?>").onclick(); 
}); 
<?php } ?>
hs.registerOverlay({
overlayId: 'closebutton',
position: 'top right',
fade: 2 // fading the semi-transparent overlay looks bad in IE
});

hs.graphicsDir = '/highslide/graphics/';
//hs.padToMinWidth = true;
//hs.minWidth = 400;
</script>

<style type="text/css">
.highslide-wrapper div { font-family: Verdana, Helvetica;}
.highslide {cursor: url(<?php echo HTTP_SERVER ?>/highslide/graphics/zoomin.cur), pointer;outline: none;text-decoration: none;}
.highslide-active-anchor img {visibility: hidden;}
.highslide img {/*border: 2px solid gray;*/}
.highslide:hover img {border-color: silver;}
.highslide-wrapper, .drop-shadow {background: white;}
.highslide-image {border: 10px solid white;}
.highslide-image-blur {}
.highslide-heading{ text-align:center; font-weight:bold; font-size:12px; background-color:#FFFFFF;}
.highslide-caption {
   display: none;
   border: 0px solid #745224;
   font-family: Verdana, Helvetica;
padding:10px;
padding-top:0px;
background: white;
text-align:left;
color:#666666;
font-size:10px;
text-align:justify;
}
.highslide-loading {
   display: block;
color: black;
font-size: 8pt;
font-family: sans-serif;
font-weight: bold;
   text-decoration: none;
padding: 2px;
border: 1px solid black;
   background-color: white;
   padding-left: 22px;
   background-image: url(<?php echo HTTP_SERVER ?>/highslide/graphics/loader.white.gif);
   background-repeat: no-repeat;
   background-position: 3px 1px;
}

a.highslide-credits,a.highslide-credits i {
   padding: 2px;
   color: silver;
   text-decoration: none;
font-size: 10px;
}
a.highslide-credits:hover,a.highslide-credits:hover i {
   color: white;
   background-color: gray;
}
a.highslide-full-expand {
background: url(<?php echo HTTP_SERVER ?>/highslide/graphics/fullexpand.gif) no-repeat;
display: block;
margin: 0 10px 10px 0;
width: 34px;
height: 34px;
}
.highslide-overlay {display: none;}

/* Mac-style close button */
.closebutton {
position: relative;
top: -20px;
left: 20px;
width: 30px;
height: 30px;
cursor: hand; /* ie */
cursor: pointer; /* w3c */
background: url(<?php echo HTTP_SERVER ?>/highslide/graphics/close.png);
/* For IE6, remove background and add filter */
_background: none;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo HTTP_SERVER ?>/highslide/graphics/close.png', sizingMethod='scale');
}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_INFORMATION; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

<?php
 $gallery_query_raw ="select id, cID, pID, comment, title, description from ". TABLE_GALLERY ." order by pID desc";
 $gallery_split = new splitPageResults($gallery_query_raw, MAX_GALLERY_PICS);

 if (($gallery_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $gallery_split->display_count(TEXT_DISPLAY_NUMBER_OF_PHOTOS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $gallery_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main">
			<table width="100%">
			<?php
				$aantal_kol = 3;
				$rij = 1;
				$kolom = 1;
				//aantal foto's in elke map bepalen
				$dir = "gallery/";
				//$sql = mysql_query("SELECT * FROM gallery");
				$sql = tep_db_query($gallery_split->sql_query);
				while($fotos = tep_db_fetch_array($sql)){
					$file = $fotos['cID']."_".$fotos['pID'].".jpg";
					$auteur = mysql_fetch_array(mysql_query("SELECT customers_firstname,customers_lastname FROM customers WHERE customers_id=".$fotos['cID']));
					if ($kolom == 1) { echo "\n".'<td align="center" class="main"><a id="autoload'.$fotos['cID'].$fotos['pID'].'" href="' . tep_href_link($dir.$file) . '" class="highslide" onclick="return hs.expand(this,{headingText: \''.$fotos['title'].'\'})">'.tep_image($dir . $file, '', 150, 150, 'hspace="5" vspace="5"').'</a><br>'.stripslashes($fotos['title']);					
					echo '<div class="highslide-caption"><div style="text-align:center;margin-top:-2px;">'.AUTEUR.' '.$auteur['customers_firstname']." ".$auteur['customers_lastname']."</div><p>";

					if ($fotos['description'] != '') {
						echo '<div style="font-style:italic;border:1px solid #666666;background:#ffffcc">'.stripslashes($fotos['description']).'</div><p>';
					}

					//bestaande commentaar uitlezen
					$comment = explode('<-->',$fotos['comment']);
					if ($fotos['comment'] != '') {
						foreach ($comment as $val) {
							$commentaar = explode ('///',$val);
							echo '<b>'.stripslashes($commentaar[0]) . "</b>: ".stripslashes($commentaar[1]).'<hr style="border:0;height:1px;color:#666666;background:#666666;">';
						}
					} else {
						echo TEXT_NO_COMMENTS.'<hr style="border:0px;border-top:1px solid #666666;">';
					}
					echo '<b>'.TEXT_PLACE_COMMENT.'</b><br>';

					//nieuwe commentaar
					<form enctype="multipart/form-data" action="gallery_user.php" method="POST">
					echo '<form name="form'.$fotos['cID'].$fotos['pID'].'" action="gallery_process.php" method="POST">';
					echo '<input type="text" name="comment_naam" value="'.TEXT_NAME.'" onClick="this.value=\'\'">';
					echo '<input type="hidden" name="cID" value="'.$fotos['cID'].'">';
					echo '<input type="hidden" name="pID" value="'.$fotos['pID'].'">';
					echo '<textarea name="comment_tekst" onClick="this.value=\'\'">'.TEXT_COMMENT.'</textarea>';
					echo '<input type="submit" name="action" value="ok"></form>';

					echo '</div></td>';
					if ($kolom == $aantal_kol) {
						echo '</tr>';
						$kolom = 0;
					}
					$rij ++;
					$kolom ++;
				}
				if ($kolom <= $aantal_kol) {echo '</tr>';}
			?>
			<div id="closebutton" class="highslide-overlay closebutton" onClick="return hs.close(this)" title="Close"></div>

			</table><p><?php echo TEXT_LINK; ?>
</p>
		</td>
         </tr>
       </table></td>
     </tr>
<?php
 if (($gallery_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $gallery_split->display_count(TEXT_DISPLAY_NUMBER_OF_PHOTOS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $gallery_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main" valign="center" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'.TEXT_CONTINUE; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>

   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

what is wrong?

Link to comment
Share on other sites

  • 2 weeks later...

This is a great contribution, if only I could get it working proper.

 

It works, but... I have changed the maximum height, width and size of the allowed pictures, and it is now possible to upload larger pictures, but...

In the gallery (and also where the users can upload pictures) the thumbnails show, but when you click on the picture, you can mostly only get a medium size picture - not the full size. But the odd thing is, that with maybe 1 picture out of 20 I can get the full size picture - using the expand button. I keep deleting the browser cache, but that does not help.

 

I installed OTF auto thumbnail, but then I couldn't see any pictures, so I deleted it again. Any ideas?

Link to comment
Share on other sites

Hmm... Figured out the problem - Don't add pictures created/saved in Photoshop as jpg. But if I open the picture I saved from Photoshop in Paint and save, then the picture is perfect online. Small thumbnail, medium picture when you click once, and larger picture when you click enlarge. But still a very odd problem.

 

Does anyone know of this problem, and maybe have a solution?

Link to comment
Share on other sites

It seems like I wrote too soon. Problem was not with photoshop.

 

If I upload the same picture (size 500x375) six times, this is the result I get when clicking on the pictures:

 

1. upload: 400x283 pixels

2. upload: 400x282 pixels

3. upload: 784x710 pixels

4. upload: 400x282 pixels

5. upload: 500x375 pixels - CORRECT SIZE

6. upload: 500x375 pixels - CORRECT SIZE

 

It is the same picture again and again, but different results.

Link to comment
Share on other sites

hello i'm from indonesia.. and use your amazing add ons..

but, i found a little bug on mine..

i've upload many photos, but there is an error on my left box..

there is a picture can't show and display "Go to Gallery" text..

sorry if my language so confuse you..

i approriate if you would send the solution to my email

[email protected]

Thanks a lot

Link to comment
Share on other sites

Hello, you have answer in error report, FILENAME_GALLERY is unknown for server

you forgot to define FILENAME_GALLERY in filenames.php

  //SIMPLE GALLERY Start
 define('FILENAME_GALLERY', 'gallery.php');
 define('FILENAME_GALLERY_USER', 'gallery_user.php');
 //SIMPLE GALLERY End

 

Hi, great cont, but i have a problem

 

After clicking upload i have this mistake

 

Not Found

The requested URL /catalog/FILENAME_GALLERY was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Here is my CODE

 

gallery.php

Link to comment
Share on other sites

No, I have no problems at all now with the contribution (except the box height)

 

I think it may be a reason of some added mods or local server settings. May be resonable to give in Install.txt a two ways for gallery_user.php

<form enctype="multipart/form-data" action="gallery_user.php" method="POST">

or

<?php echo tep_draw_form('fotouploaden', 'gallery_user.php?osCsid=' . $osCsid  ,'post', 'enctype="multipart/form-data"');?>

 

Hello Leveera,

 

As I had some unused other Add-Ons in my site, I started from a new osCOmmerce-site, with only this addon, including the OTF.

 

Even then I have to login again when I try to upload pictures. Where should I put the 2 pices of code you mentioned in your post?

 

regards,

 

Arnold

Link to comment
Share on other sites

Hello All,

 

As I posted yesterday, uploading does not completely works fine from the shop

What I can do is:

Uploading files as site admin (in the admin-module) and put them on a customers name.

 

Also:

When I am loged in in the shop as user, I can see the options: edit, view comment and delete.

When I choose edit, I get a highslide popup with the loginscreen of the shop in it.

When I choose view comments, I see the comments

when I choose delete, I have to login again and the picture is deleted.

 

Any Ideas?

 

regards,

 

Arnold

Edited by maatwerk
Link to comment
Share on other sites

Hello All,

 

After reading no-one else has the same problem I 'allowed' myself to publish it on the internet to see what happens:

Gallery at h&h Miniatuurshop

 

When openened in IE7, the page is ssslllllloooooooooooowwwwwww and then suddenly is there, without the column_right (which never comes)

 

When openened in FireFox3, the page needs 8 seconds to load, also first without the column_right. After nearly 1 minute column_right appears.

Netscape7 reacts the same as FF3.

 

Is this normal?

 

Regards,

 

Arnold

Link to comment
Share on other sites

When openened in IE7, the page is ssslllllloooooooooooowwwwwww and then suddenly is there, without the column_right (which never comes)

 

........

Is this normal?

........

 

No, I found out that same 'spammer' entered a lot of stupid viagra text in the comment of 1 picture. After I removed it, all browsers were as fast as the others.

 

Is this a vulnerabilty of the gallery?

 

Regards,

 

Arnold

Link to comment
Share on other sites

  • 2 weeks later...

This looks like a great contribution but one question: Does anyone have a live working version of this on their website? The demo links from the earlier posts in this thread all seem to have disappreared.

Debbie Harrison

 

Link to comment
Share on other sites

Regardless I have uploaded and isntalled the contrib and just adding auto thumbnails (2.4?) and so far so good.

 

I also edited the install.txt file a bit better as my poor eyes couldn't take the current great big block of text. I hope this small nitpick helps. ;)

Debbie Harrison

 

Link to comment
Share on other sites

I have this contribution and the OTF Auto thumbnailer installed but on uploading I get the following message:

 

There was an error uploading the file xxxxx.jpg, please try again!

 

I have changes the CHMOD on both /images/ folder and created and modded the thumbnails folder. I may go back on installation instructions just to make sure every thing was done OK. But any suggestions/ideas at this stage would be great.

 

Thanks in advance

Debbie Harrison

 

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...