Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wrong path called in Gallery Integrated mod?


jwsfun

Recommended Posts

Has anyone else installed the Gallery Integrated contribution?

I had no problems with the actual install itself, but I've run into an problem with the path to display images (I can't even get the included sample images to display). The script from the gallery.php is below:

 

<?php
$nmbr=25; //qty pics per page
$file="gallery.php"; //main file
$rep1="sm_$rpd"; //thumbnain prefix;)
$rp="gallery/$rpd"; // path to gallery folders
$rep="gallery/$rep1"; // another path to gallery folders
// LISTING DE TOUTES LES IMAGES
$i=0;
$handle=@opendir("$rep");

//let us scan your dirs for pics
function txt1($cle)
{
global $txt0;
$txtt="gallery.ini";
$filetxt = file($txtt);
$counttxt = count($filetxt);
for ($b = 0; $b < $counttxt; $b++)
{
list($namejpg,$comment)=explode("::", $filetxt[$b]);
if ($cle==$namejpg){
$txt0= "<b>$comment</b><br>";  return;
}
else
{
$txt0="";
}
}
}
while ($fichier = @readdir($handle))
{
$extension=substr($fichier,-3);
if($fichier!="." && $fichier!=".." && (eregi("gif",$extension)||eregi("jpg",$extension))) 
 {
$listing[$fichier]=filemtime("$rp/$fichier");
 $per[$i]=$fichier;
 }
$i++;
}
@closedir($handle);
//If found pics - show them, if nothing - show text_gallery_information 
if(!is_array($listing)) 
{
echo TEXT_GALLERY_INFORMATION;
}
else
{
arsort($listing); //Sorting;)
$i=1;
$rw=1;
$xyz=1;
$kolvo=0;
while (list($cle,$val) = each($listing))
 {
 if($kolvo==0){	
 $xzy=date("d.m.y ",filemtime("$rp/$cle"));
 $xzyz=$cle;
 }
 if(!$namezzz)
{
$namezzz=$xzyz;
}
$im[$xyz].="<td align=\"center\"  valign=\"top\" style=\"padding: 3\"><a href=\"$file?rpd=$rpd&rrr=$rrr&namezzz=$cle\"><IMG border=\"0\"  SRC=\"$rep/$cle\" alt=\"Uploaded: " .date("d.m.y ",filemtime("$rp/$cle"))."\nToday: " .date("d.m.y ")."\"></a><br><font face=\"Arial Narrow\" size=\"2\">";
txt1($cle);
if(date("d.m.y ")==date("d.m.y ",filemtime("$rp/$cle"))){
$im[$xyz].=$txt0."<font color=red>".date("d.m.y ",filemtime("$rp/$cle"))."</font><br>";
}
else
{
$im[$xyz].=$txt0.date("d.m.y ",filemtime("$rp/$cle"));
}
$im[$xyz].="</font></b></td>\n";	
if($i==$nmbr){if($xyz==$rrr){
$linew.="<b>[$xyz]</b>\n";
}
else
{
 $linew.="<a href=\"$file?rpd=$rpd&rrr=$xyz&namezzz=$namezzz\">[$xyz]</a> \n";
}
$i=0;$xyz++;}
if($rw==5){$rw=0;$im[$xyz].="</tr><tr>";}

 $i++;
 $rw++;
 $kolvo++;

 }
 if($i<$nmbr&&$i>0){if($xyz==$rrr){

 $linew.="<b>[$xyz]</b>\n";
 }	
	 else
 {
 $linew.="<a href=\"$file?rpd=$rpd&rrr=$xyz&namezzz=$namezzz\">[$xyz]</a> ";$i=0;$xyz++;}
 }

 if($xyz==25){$linew.="<br>";};
if($rr<5&&$rr>0){$rr=0;$im[$xyz].="</tr><tr>";}
if(file_exists("$rep/$image"))
 {
 $size = getimagesize ("$rp/$cle/$namezzz");
 $imgsize="width=\"250\" height=\"".$size[1]*250/$size[0]."\"";
 echo "<center><font face=\"Veranda\" size=\"2\">$linew</font><p>\n";
 echo "<table border=\"1\" bordercolor=\"#D2E9FF\" style=\"border-collapse: collapse\" width=\"520\">";
 echo "<TD vAlign=top align=middle rowspan=\"6\"><a href=\"javascript:openGalary('$rp/$cle/$namezzz')\"><img border=\"0\" src=\"$rp/$cle/$namezzz\" $imgsize alt=\"$namezzz\"></a></td>";
 echo "$im[$rrr]";
 echo "</tr></table>";
 echo "<b><font face=\"Tahoma\" size=\"2\">Total pics: <font color=red>$kolvo</font><br>Most recent pic: <font color=red><a href=\"javascript:openGalary('$rp/$xzyz')\" alt=\"!!!Recent pic!!!\">$xzyz</a></font>, uploaded: <font color=red>$xzy</font></font></b>\n";
 echo "<p><font face=\"Veranda\" size=\"2\">$linew</font><p>\n";
	 }
       }
?>

 

I think the path problem lies in the first 8 lines (I could be wrong :lol: ):

 

$nmbr=25; //qty pics per page
$file="gallery.php"; //main file
$rep1="sm_$rpd"; //thumbnain prefix;)
$rp="gallery/$rpd"; // path to gallery folders
$rep="gallery/$rep1"; // another path to gallery folders
// LISTING DE TOUTES LES IMAGES
$i=0;
$handle=@opendir("$rep");

 

Can someone take a look at this to see if it's correct? Or, if you've got it installed and can help me get it running, please reply. Thank you.

Link to comment
Share on other sites

try to right click the empty image and see what path it thinks the image is at....this is a good way to narrow it down

 

I havent used this contrib so I am not sure how well it works...also are you SEF on...if so then turn it off and see if that fixes it. If it does fix it then you have to figure out how to make the contrib SEF compatible.

Link to comment
Share on other sites

Jesse,

 

I checked it out:

 

res://C:\WINDOWS\System32\shdoclc.dll/http_404.htm#http://bluefiregifts.com/shop/shop/gallery.php?rpd=first&rrr=1

 

Why is system info showing when viewing the properties of this page?

 

also are you SEF on...
Do you mean my firewall?
Link to comment
Share on other sites

Hi Jeff

1) the info below is your windows server default error page

QUOTE

res://C:\WINDOWS\System32\shdoclc.dll/http_404.htm#http://bluefiregifts.com/shop/shop/gallery.php?rpd=first&rrr=1

 

2) sef

no its not your firewall, it's Search-Engine Safe URLs

Go to admin and confguration,

about halfway down the page you will see the option

Use Search-Engine Safe URLs (still in development) = true (or false)

maybe you should use false for now,

 

3) have you alredy fixed your problem?

as when I go to

http://bluefiregifts.com/shop/gallery.php your gallery and pics work fine, BUT

your links in your pages point to

http://bluefiregifts.com/shop/shop/gallery.php?-----etc

NOTICE THE EXTRA / shop in the url

suggests an error in your path in config, in gallery config file?

 

if you delete the extra /shop from the url the page displays ok.

so look for the paths to /shop/gallery in the config file and delete /shop part

ex, /gallery

 

I Hope I have been able to help here,

I am not too good at this php stuff yet but I think I have read this one ok

 

regards

Ian

Link to comment
Share on other sites

Ian,

 

Thanks for the info...

 

1. My site is hosted by another company...I do not own my own server [yet]. So, the error or reason this shows up is still confusing.

 

2. I have never used Search Engine Safe URLS and always keep it set to false.

 

3. The extra 'shop' was a bit of a bizarre mystery: I couldn't find this in the gallery.php file anywhere but it may have occurred when I attempted to change the linking itself (the extra "/gallery" bit). I don't know how you're able to view the gallery and pics...I get a blank page ("The page cannot be found") when I click on one of the gallery category links.

 

Any ideas? I'm rather new to php/css myself...

Link to comment
Share on other sites

Hi Jeff,

I have sat up all night for you :rolleyes:

 

1)First try typing in the browsers address bar

http://www.bluefiregifts.com/

You will see your directorystructure on your server (UPLOAD A BLANK index.html FILE/PAGE) if you dont want it shown to public!!

 

2) click on gallery.php and the gallery will load as it should,

then if you hover over the link to your galleries you will see in the status bar on bottom of browser the url it is pointing to,

if you click on the link yo get the error page yes? look in the address bar you see the extra shop/ part of the url yes?

I think you will find this in the gallery.php file between lines

147 - 153 as shown below, where you see <a href="shop/gallery.php? remove shop/ three instances yes? I marked them here in red ok?

 

<td class="pageHeading" align="center" nowrap><align="center">

<a href="shop/gallery.php?rpd=first&rrr=1&osCsid=ceccd79d1c6b931f9b07afde8e7c3e1a"><img src="images/gallery_actionfigures.gif" border="0" alt="Action Figures"></a>

          

<a href="shop/gallery.php?rpd=second&rrr=1&osCsid=ceccd79d1c6b931f9b07afde8e7c3e1a"><img src="images/gallery_memorabilia.gif" border="0" alt="Memorabilia"></a>

          

<a href="shop/gallery.php?rpd=third&rrr=1&osCsid=ceccd79d1c6b931f9b07afde8e7c3e1a"><img src="images/gallery_propreplicas.gif" border="0" alt="Prop Replicas"></a></td>

</tr>

 

I think you have it then

good luck

Ian

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