Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

photo gallery for oscommerce


Recommended Posts

Hi Matt

 

Me again, with a fresh head and a fresh install I tired again and again and I still get the one original error

 

I have spent so much time doing this its mad LOL! I shall wait and see what the future holds and keep up with the progress as I really love the idea of this contribution and the basic no frills gallery worked just fine. I am grateful for all your work.

What version of PHP and MySQL are you using?

 

Try the following:

Replace line 7:

$sql = mysql_fetch_array(mysql_query("SELECT title, description FROM gallery WHERE cID=".$_GET['cID']." AND pID=".$_GET['pID'])) or die(mysql_error());

with:

$cID = $_GET['cID'];
$pID = $_GET['pID'];
$sql = mysql_fetch_array(mysql_query("SELECT title, description FROM gallery WHERE cID=".$cID." AND pID=".$pID)) or die(mysql_error());

Let me know if any errors.

 

If that still does not work, in the code i posted just above, replace the 3rd and last line with (dont do this if the above solution works!):

$sql = mysql_fetch_array(mysql_query("SELECT title, description FROM gallery WHERE cID='".$cID."' AND pID='".$pID."'")) or die(mysql_error());

 

This error is when you try to add a title/description, but what if you add a comment from the public part, does that work?

Edited by killerwhale65

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

  • Replies 320
  • Created
  • Last Reply

Top Posters In This Topic

PHP 5.2.6

 

MySQL version 5.0.51a

 

First edit with the above suggestion produced this error code

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxxxxxx/public_html/ribbonrie/gallery_process.php on line 9
Unknown column 'gallery_user.php' in 'where clause'

 

tried the 2nd edit and.....

Parse error: syntax error, unexpected '}' in /home/xxxxxxx/public_html/ribbonrie/gallery_process.php on line 29

 

So sorry if I made an error, my gallery_process.php is below so you can check, I really do wish I could help myself more.

 

<?php
 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/gallery_user.php');


          if (isset($_GET['edit']) && $_GET['edit']=='yes') {
               $cID = $_GET['cID'];
               $pID = $_GET['pID'];
               $sql = mysql_fetch_array(mysql_query("SELECT title, description FROM gallery WHERE cID='".$cID."' AND pID='".$pID."'")) or die(mysql_error());
	$titel = SET_TITLE;
} else {
	$titel = stripslashes($sql['title']);
}
if ($sql['description']=='') {
	$desc = SET_DESCRIPTION;
} else {
	$desc = stripslashes($sql['description']);
}
?>
<form name="form" action="gallery_user.php" method="post" target="_parent">
<input type="text" name="title" value="<?php echo $titel;?>" onClick="this.select()">
<input type="hidden" name="cID" value="<?php echo $_GET['cID'];?>">
<input type="hidden" name="pID" value="<?php echo $_GET['pID'];?>">
<textarea name="description" onClick="this.select()"><?php echo $desc;?></textarea>
<input type="submit" value="save" name="edittitle">
</form>

<?php
} else {
$naam = addslashes($_POST['comment_naam']);
       $tekst = addslashes($_POST['comment_tekst']);
$cID =$_POST['cID'];
$pID = $_POST['pID'];
//echo $naam." ///".$tekst." ".$cID." ///".$pID;

$bestaande_comment = mysql_fetch_array(mysql_query("SELECT comment FROM gallery WHERE cID=".$cID." AND pID=".$pID));

if ($bestaande_comment['comment'] != '') {$spacer='<-->';}

$nieuw_comment = $bestaande_comment['comment'].$spacer.$naam."///".$tekst;

mysql_query("UPDATE gallery SET comment='".$nieuw_comment."' WHERE cID=".$cID." AND pID=".$pID);

header("Location: gallery.php?autoload=".$cID.$pID);
}
?>

 

I have not got past this so have not even moved onto the fact that I can't see any of the info on the gallery images when I try as a general user. No name info etc is displayed.

 

For the first time I am putting on my very brave hat and providing a link to the site. Its not an open shop (2 weeks to go) and has much still to be done however, its Here I would like to help get this running hence a BIG step for me to post this here :blush:

 

Thank you!!

Link to comment
Share on other sites

something is wrong with your file, use this:

<?php
 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/gallery_user.php');


if (isset($_GET['edit']) && $_GET['edit']=='yes') {
$cID = $_GET['cID'];
$pID = $_GET['pID'];
$sql = mysql_fetch_array(mysql_query("SELECT title, description FROM gallery WHERE cID=".$cID." AND pID=".$pID)) or die(mysql_error());
if ($sql['title']=='') {
	$titel = SET_TITLE;
} else {
	$titel = stripslashes($sql['title']);
}
if ($sql['description']=='') {
	$desc = SET_DESCRIPTION;
} else {
	$desc = stripslashes($sql['description']);
}
?>
<form name="form" action="gallery_user.php" method="post" target="_parent">
<input type="text" name="title" value="<?php echo $titel;?>" onClick="this.select()">
<input type="hidden" name="cID" value="<?php echo $_GET['cID'];?>">
<input type="hidden" name="pID" value="<?php echo $_GET['pID'];?>">
<textarea name="description" onClick="this.select()"><?php echo $desc;?></textarea>
<input type="submit" value="save" name="edittitle">
</form>

<?php
} else {
$naam = addslashes($_POST['comment_naam']);
$tekst = addslashes($_POST['comment_tekst']);
$cID =$_POST['cID'];
$pID = $_POST['pID'];
//echo $naam." ///".$tekst." ".$cID." ///".$pID;

$bestaande_comment = mysql_fetch_array(mysql_query("SELECT comment FROM gallery WHERE cID=".$cID." AND pID=".$pID)) or die(mysql_error());

if ($bestaande_comment['comment'] != '') {$spacer='<-->';}

$nieuw_comment = $bestaande_comment['comment'].$spacer.$naam."///".$tekst;

mysql_query("UPDATE gallery SET comment='".$nieuw_comment."' WHERE cID=".$cID." AND pID=".$pID);

header("Location: gallery.php?autoload=".$cID.$pID);
}
?>

 

Look out when pasting this that the linebreaks are kept. I always have the problem when pasting code from the forum that the linebreaks are lost and that the code becomes 1 long line.

 

I have registered on your site for testing ...

 

First thing i notice is a problem with the highslide javascript. Where have you placed it? Because it says that the hs variable is not defined, so i thing the highslide.js file is not in /highslide.

Edited by killerwhale65

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

I saw you there, how weird it is having 'company' LOL But grateful for your time.

 

Path to Highslide - /public_html/ribbonrie/highslide/highslide.js

 

Pasted (carefully) your code above and

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxxxxxx/public_html/ribbonrie/gallery_process.php on line 9
Unknown column 'gallery_user.php' in 'where clause'

Edited by Design Recollections
Link to comment
Share on other sites

this error has become irrelevant now that i know your javascript is not working. You could have known sooner because when you click a picture it does not open a popup but loads the pic in a new page. We lost a lot of time now.

 

In gallery.php, change line 25:

<script type="text/javascript" src="highslide/highslide.js"></script>

to:

<script type="text/javascript" src="http://designrecollections.co.uk/ribbonrie/highslide/highslide.js"></script>

If that does not work, you will need to change the location of the js file in the code above to match with your situation.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

What can I say but I am sorry. As I have often said, I am new and learning and wish very much to help myself and not to bother others. Its very frustrating but we all have to start somewhere.

 

I change the code to your suggestion and checked the location, still no pop up. Please do not concern yourself further with it. I shall continue to learn at my own pace and work things out.

 

Many thanks once again.

Link to comment
Share on other sites

What can I say but I am sorry. As I have often said, I am new and learning and wish very much to help myself and not to bother others. Its very frustrating but we all have to start somewhere.

 

I change the code to your suggestion and checked the location, still no pop up. Please do not concern yourself further with it. I shall continue to learn at my own pace and work things out.

 

Many thanks once again.

There must be something with the location of the highslide.js file, that is my best guess. I am out of options here, i would need FTP access to dig further.

Please look here as how it is supposed to behave, cause i think that, although you said the previous version worked, the previous version also did not show the popups on your site because of the javascript error: http://www.minitair.be/gallery.php

 

Let me know if you find a solution.

Edited by killerwhale65

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

Hi Matt -

 

This is a great contrib! Thank you.

 

I got the same error as that Armand on Sept 7th

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/autolief/domains/website.com/public_html/catalog/gallery_process.php on line 35

 

I did as you said and commented out lines 35-43 and added that little piece of code

echo $cID." ".$pID;

to gallery_process.php

 

Now when I go to edit a pic I do see a blank white page and no error anymore.

what do I do now? the site is chocolategelt.com

PHP Version 4.4.1

 

Much appreciated

Irina

Link to comment
Share on other sites

Hi Matt -

 

This is a great contrib! Thank you.

 

I got the same error as that Armand on Sept 7th

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/autolief/domains/website.com/public_html/catalog/gallery_process.php on line 35

 

I did as you said and commented out lines 35-43 and added that little piece of code

echo $cID." ".$pID;

to gallery_process.php

 

Now when I go to edit a pic I do see a blank white page and no error anymore.

what do I do now? the site is chocolategelt.com

PHP Version 4.4.1

 

Much appreciated

Irina

Can you give me a direct link to the gallery? I tried www.chocolategelt.com/gallery.php but that does not work.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

I did as you said and commented out lines 35-43 and added that little piece of code

echo $cID." ".$pID;

to gallery_process.php

Can you undo these changes so we can start from there? I have created a test account on your website.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

http://www.alpha-model-sports.com/test_store3/gallery.php

 

As you can see the fonts cant be seen and also the left and right sizes are too big.... any way i can change the size so it looks like the rest of the store?

 

Thanks

 

Guys,

I have a similar issue where the layout went stupid.

 

Screen Shot of Problem

 

Thanks

Dru

Link to comment
Share on other sites

Guys,

I have a similar issue where the layout went stupid.

 

Screen Shot of Problem

 

Thanks

Dru

Simply change the layout of your gallery.php file, to match the one of your other files. The gallery is made with the layout of the default template, so any changes you have done to the default template will also have to be done in the gallery. In your case it looks like you are having 1 colum too much.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

done! Thank you

Your login system does not work. When i log in i get a "page cannot be displayed", however it turns out that i am logged in.

 

In gallery_user.php, please give me the value of the variable $link, around line 280.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

Your login system does not work. When i log in i get a "page cannot be displayed", however it turns out that i am logged in.

 

In gallery_user.php, please give me the value of the variable $link, around line 280.

 

here is the value

$link = 'gallery_process.php?edit=yes&pID='.$fotos['pID'].'&cID='.$fotos['cID'];

 

Yes, I know about this issue, it is because I am using an ssl certificate provided by my hosting company, so the https link looks different from non-secure one. The page is not found after you log in because it's looking for a link https://ss42.shared.server-system.net/catal...allery_user.php, but is should be https://ss42.shared.server-system.net/~choc...allery_user.php. I couldn't find a place where to change that in your files yet.

 

Thank you

Link to comment
Share on other sites

here is the value

$link = 'gallery_process.php?edit=yes&pID='.$fotos['pID'].'&cID='.$fotos['cID'];

 

Yes, I know about this issue, it is because I am using an ssl certificate provided by my hosting company, so the https link looks different from non-secure one. The page is not found after you log in because it's looking for a link https://ss42.shared.server-system.net/catal...allery_user.php, but is should be https://ss42.shared.server-system.net/~choc...allery_user.php. I couldn't find a place where to change that in your files yet.

 

Thank you

 

I fixed the link problem. I guess it's coded in includes/languages/english/gallery.php

define('TEXT_LINK', 'Click <a href="had to change this link/gallery_user.php">here</a> to add your own pictures to this gallery.');

 

However, the errors while trying to edit pictures in user_gallery.php remain

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site202/fst/var/www/html/catalog/gallery_process.php on line 35

 

Warning: Cannot modify header information - headers already sent by (output started at /www/html/catalog/gallery_process.php:35) in /www/html/catalog/gallery_process.php on line 43

Link to comment
Share on other sites

here is the value

$link = 'gallery_process.php?edit=yes&pID='.$fotos['pID'].'&cID='.$fotos['cID'];

Try changing the link value to:

$link = 'gallery_process.php?edit=yes&pID=1&cID=8339';

That works only for the picture i have uploaded, so only for testing purposes. When i enter this link directly in the address bar of my browser, then it works and no errors appear.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

Try changing the link value to:

$link = 'gallery_process.php?edit=yes&pID=1&cID=8339';

That works only for the picture i have uploaded, so only for testing purposes. When i enter this link directly in the address bar of my browser, then it works and no errors appear.

 

Yes, I see that the direct link works for the picture which you uploaded... But the dynamic code still retuns an error... any ideas?

 

Thank you!

Link to comment
Share on other sites

Yes, I see that the direct link works for the picture which you uploaded... But the dynamic code still retuns an error... any ideas?

 

Thank you!

Well, as you can see, clicking 'edit' moved you to a page with the URL

http://www.chocolategelt.com/catalog/gallery_process.php/edit/yes/pID/1/cID/8339

This URL is not what it is supposed to be

http://www.chocolategelt.com/catalog/gallery_process.php?edit=yes&pID=1&cID=8339

Notice the difference?

 

Most likely you are using some contribution that breaks your URL into pieces. But with the broken pieces it does not work anymore because the URL is transferring variables, and with the "broken pieces URL", those variables are lost because the = and & signs are lost. So it cannot work this way.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

error1: replace line 35 with

$bestaande_comment = mysql_fetch_array(mysql_query("SELECT comment FROM gallery WHERE cID=".$cID." AND pID=".$pID)) or die(mysql_error());

and give me the new error

 

Error2 is probably connected with error1.

 

I replaced line 35 as you recommended. the second line of error message changed

this is the error I got:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site202/fst/var/www/html/catalog/gallery_process.php on line 35

You have an error in your SQL syntax near 'AND pID=' at line 1

 

btw, I tried all the other fixes you suggested as well.

 

Thank you!

Link to comment
Share on other sites

Well, as you can see, clicking 'edit' moved you to a page with the URL

http://www.chocolategelt.com/catalog/gallery_process.php/edit/yes/pID/1/cID/8339

This URL is not what it is supposed to be

http://www.chocolategelt.com/catalog/gallery_process.php?edit=yes&pID=1&cID=8339

Notice the difference?

 

Most likely you are using some contribution that breaks your URL into pieces. But with the broken pieces it does not work anymore because the URL is transferring variables, and with the "broken pieces URL", those variables are lost because the = and & signs are lost. So it cannot work this way.

 

 

yes, of course, you are right. I think it is the SEO urls.

Link to comment
Share on other sites

yes, of course, you are right. I think it is the SEO urls.

 

 

I fixed it simply by replacing these in gallery_user.php

$link = 'gallery_process.php?edit=yes&pID='.$fotos['pID'].'&cID='.$fotos['cID'];

echo '[<a href="'.tep_href_link($link).'" onclick="return hs.htmlExpand(this, { objectType: \'iframe\',outlineType: \'rounded-white\', outlineWhileAnimating: true } )">' .TEXT_EDIT.'</a>]<br>';

 

with this

echo'[<a href=gallery_process.php?edit=yes&pID='.$fotos['pID].'&cID='.$fotos['cID'].'"onclick="return hs.htmlExpand(this, { objectType: \'iframe\',outlineType: \'rounded-white\', outlineWhileAnimating: true } )">'.TEXT_EDIT.'</a>]<br>';

 

this fix might be helpful to anyone running SEO urls

 

This is a great contrib, thank you very much and we'll look forward to updates!

Cheers

Irina

Link to comment
Share on other sites

I fixed it simply by replacing these in gallery_user.php

$link = 'gallery_process.php?edit=yes&pID='.$fotos['pID'].'&cID='.$fotos['cID'];

echo '[<a href="'.tep_href_link($link).'" onclick="return hs.htmlExpand(this, { objectType: \'iframe\',outlineType: \'rounded-white\', outlineWhileAnimating: true } )">' .TEXT_EDIT.'</a>]<br>';

 

with this

echo'[<a href=gallery_process.php?edit=yes&pID='.$fotos['pID].'&cID='.$fotos['cID'].'"onclick="return hs.htmlExpand(this, { objectType: \'iframe\',outlineType: \'rounded-white\', outlineWhileAnimating: true } )">'.TEXT_EDIT.'</a>]<br>';

 

this fix might be helpful to anyone running SEO urls

 

This is a great contrib, thank you very much and we'll look forward to updates!

Cheers

Irina

Unfortunately, it is wrong to use links this way, because it will loose session data like currency and language once you click on it. You need to link using the tep_href_link function, otherwise you will get situations like switching to the default language or currency when you click on the link. So this solution may solve your problem, but it creates another huge problem for the user. I would suggest not to use this solution.

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

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