Why has my website broken?

Soldato
Joined
1 Sep 2005
Posts
10,001
Location
Scottish Highlands
My site (www.afowler.co.uk) was working perfectly. But then the other week someone mentioned that they couldn't access the gallery section. Well they could access it, but it wasn't loading the images. So I have a look at it and it seems like several pixelpost plugins has somehow switched themselves off. So I turn them back on and that fixes the gallery index (http://www.afowler.co.uk/gallery/index.php?x=browse&pagenum=1&category=)

However the individual image pages are still broken (http://www.afowler.co.uk/gallery/index.php?showimage=630). I used to have buttons that appeared when you hovered over an image with options to see comments, purchasing information or photo information. That info is still there, but you can see it all at the same time, rather than it sliding down with some JS. Can anyone see why it isn't working anymore?

image_template.html (this file is called from the pixelpost index file, as are the header and footer files)
Code:
<script type="text/javascript" src="../secondarynav.js"></script>
<script type="text/javascript" src="../js/ajax.js"></script>
<script type="text/javascript" src="../js/productpricing.js"></script>
<script type="text/javascript" src="../js/dynamicdropdown.js"></script>
<script type="text/javascript" src="../js/slidepanel.js"></script>

<div id="content">
	<br />

	<div class="galleryimagecontainer">	
		<div id="gallerymainimage" style="height:<IMAGE_HEIGHT>px; width:<IMAGE_WIDTH>px; margin: 0 auto;">

			<div id="gallerynextbutton" style="width:32px; height:<IMAGE_HEIGHT>px;">
				<a href="index.php?showimage=<SC_IMAGE_NEXT_ID>&amp;category=<SC_CAT_ID>"><img src="templates/afowler/transparent.gif" width="32px" height="<IMAGE_HEIGHT>px" alt="<IMAGE_NEXT_TITLE>" title="<IMAGE_NEXT_TITLE>"/></a>
			</div>

			<a href="index.php?showimage=<SC_IMAGE_PREVIOUS_ID>&amp;category=<SC_CAT_ID>"><img style="border: 1px solid #ffffff; z-index: 4;" src="images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="<IMAGE_TITLE>" width="<IMAGE_WIDTH>px" height="<IMAGE_HEIGHT>px" id="photo" /></a>

			<div id="gallerypreviousbutton" style="width:32px;  height:<IMAGE_HEIGHT>px;">
				<a href="index.php?showimage=<SC_IMAGE_PREVIOUS_ID>&amp;category=<SC_CAT_ID>"><img src="templates/afowler/transparent.gif" width="32px" height="<IMAGE_HEIGHT>px" alt="<IMAGE_PREVIOUS_TITLE>" title="<IMAGE_PREVIOUS_TITLE>"/></a>
			</div>

			<div id="slidingpanebuttons" style="width:<IMAGE_WIDTH>px; height: 20px;">
				<a href="#" class="showimageinfo"><img src="templates/afowler/details.gif" alt="details" /></a>
				<a href="#" class="showimagecomments"><img src="templates/afowler/comments.gif" alt="comments" />(<IMAGE_COMMENTS_NUMBER>)</a>
				<a href="#" class="showimagesales"><img src="templates/afowler/sales.gif" alt="sales" /></a>
			</div>
		</div>

	</div>

	<br />

	<div class="contenttext">
		<div id="imageexif">
			<div id="imageexiftext">
				<ul>
					<li><strong><IMAGE_TITLE></strong></li>
					<li><EXIF_CAPTURE_DATE></li>
					<li><EXIF_CAMERA_MODEL></li>
					<li>Exposure time:<EXIF_EXPOSURE_TIME></li>
					<li>Aperture: <EXIF_APERTURE></li>
					<li>ISO: <EXIF_ISO></li>
					<li>Focal length: <EXIF_FOCAL_LENGTH></li>
					<li>Viewed this month: <IMAGE_COUNTER></li>
				</ul>
			</div>

			<div id="histogram">
 				<RGBHISTOGRAM>
			</div>
			
		</div>
	</div>

	<div class="contenttext">
		<div id="imagecomments">

			<div id="comment-top">
				<strong><IMAGE_TITLE></strong>
			</div>

			<div id="comments">
				<IMAGE_COMMENTS>
			</div>

			<br />
			
			<div class="contact">
				<form method="post" action="index.php?x=save_comment" accept-charset="UTF-8">				
					<p>
						Name: <input class="inputbox" type="text" name="name" value="<VINFO_NAME>" id="name" />			
						Email: <input class="inputbox" type="text" name="email" value="<VINFO_EMAIL>" id="email" /><br />
						<br />
						Message<br />					
						<textarea class="textarea" name="message" cols="0" rows="0"></textarea><br />
						<br />
					</p>	
					<div style="text-align: right;">
						Enter the code shown in the image:<br /><input class="inputboxsmall" type="text" name="protectwebformcode" value="" /><img src="http://protectwebform.com/image/22356/" alt="protectwebform" style="vertical-align: bottom; width:35px; height:22px; margin-left: 5px" />
						<input class="select" type="submit" value="Add"/>
						<input type="hidden" name="parent_id" value="<IMAGE_ID>" />
						<input type="hidden" name="parent_name" value="<IMAGE_NAME>" />
					</div>					
					<TOKEN>
				</form>
			</div>				
		</div>
	</div>

	<div class="contenttext">
		<div id="imagesales">
			<p>
				Most of my images are available for sale on a range of materials in sizes ranging from 10x8" up to 40" x 32" (Sizes above this, or
				other products are available on request). All prints are printed, mounted and framed by local specialists then signed and shipped
				by myself. All online orders are subject to a £5.00 Shipping fee.
			</p>

			<br />

			<div id="purchasebar">
				<form id="purchasing" onclick="target='paypal';" action="https://www.paypal.com/cgi-bin/webscr" method="post">
					<div>
						<input type="hidden" name="cmd" value="_cart" />
						<input type="hidden" name="upload" value="1" />
						<input type="hidden" name="business" value="[email protected]" />
						<input type="hidden" name="amount" value="0.00" />
						<input type="hidden" name="shipping_1" value="0.00" />
						<input type="hidden" name="item_name_3" value="processing fee" />
						<input type="hidden" name="amount_3" value="5.00" />
						<input type="hidden" name="add" value="1" />	
						<input type="hidden" name="item_name" value="Print of <IMAGE_TITLE>" />

						<input type="hidden" name="on0" value="Size" />
						<input type="hidden" name="on1" value="Paper" />
						<input type="hidden" name="os0" value="" />
						<input type="hidden" name="os1" value="" />

						<input type="hidden" name="shipping" value="5" />
						<input type="hidden" name="no_shipping" value="2" />
						<input type="hidden" name="return" value="http://www.afowler.co.uk/gallery/thankyou.html" />
						<input type="hidden" name="currency_code" value="GBP" />
						<input type="hidden" name="lc" value="GB" />
						<input type="hidden" name="bn" value="PP-ShopCartBF" />


						Select a size:
						<select name="sizedropdown" id="sizedropdown" onchange="javascript: dropdownlist(this.options[this.selectedIndex].value);">
							<option value="1_Small">Small (10"x8") - £30</option>
							<option value="2_Regular">Regular (20"x16") - £50</option>
							<option value="3_Large">Large (40"x32") - £200</option>
						</select>

						Select paper:
						<select name="framingdropdown" id="framingdropdown" style="width:120px;">
							<option value="1_LU">Lustre(+ £0)</option>
							<option value="2_PR">PhotoRag(+ £15)</option>
						</select>

						<input class="select" onclick="calculateordersize(this.form)" name="submit" type="submit" value=" Order " />	
					</div>
				</form>

				<form id="checkoutbutton" onclick="target='paypal';" action="https://www.paypal.com/cgi-bin/webscr" method="post">
					<div>
						<input type="hidden" name="cmd" value="_cart" />
						<input type="hidden" name="business" value="[email protected]" />
						<input class="select" name="submit" type="submit" value=" Checkout " />
						<input type="hidden" name="display" value="1" />
					</div>
				</form>
			</div>

			<br />
			<br />

		</div>
	</div>

	<div id="slidingpane">
	</div>

	<div class="thumbs">
		<SC_THUMB_ROW_REV>
	</div>

</div>


<script type="text/javascript">
var main_nav = "gallery";
navigation();
</script>

<script type="text/javascript">
var secondary_nav = "<SC_CAT_NAME>";
secondarynavigation();
</script>

slidepanel.js
Code:
function clearBox(box) {
		 if(box.value==box.defaultValue) {
	 	 	 box.value = "";
	 	 }
	 }	 
$(document).ready(function(){
  $("div#imagecomments, div#imageexif, div#imagesales").hide();


   $("a.showimagecomments").click(function(){
		if ($("div#imagecomments").css("display") == "none") {
			$("div#imagecomments").slideDown();
			$("div#slidingpane").slideUp();
		} else {
			$("div#imagecomments").slideUp();
			$("div#slidingpane").slideDown();
			}
		
		$("div#imageexif").slideUp();
		$("div#imagesales").slideUp();
		
		return false;


   });
   $("a.showimageinfo").click(function(){
   		if ($("div#imageexif").css("display") == "none") {
			$("div#imageexif").slideDown();
			$("div#slidingpane").slideUp();
		} else {
			$("div#imageexif").slideUp();
			$("div#slidingpane").slideDown();
			}
		$("div#imagecomments").slideUp();
		$("div#imagesales").slideUp();
		
		return false;



   });
   $("a.showimagesales").click(function(){
   		if ($("div#imagesales").css("display") == "none") {
			$("div#imagesales").slideDown();
			$("div#slidingpane").slideUp();
		} else {
			$("div#imagesales").slideUp();
			$("div#slidingpane").slideDown();
			}
		$("div#imagecomments").slideUp();
		$("div#imageexif").slideUp();
		
		return false;


   });
   $("a.showPhoto").click(function(){
   		$("div#slidingpane").slideDown();
		$("div#imagecomments").slideUp();
		$("div#imageexif").slideUp();
		return false;
   });


   
   $("div#slidingpanebuttons").css;
   $("div#gallerymainimage").hover(function(){
   	$("div#slidingpanebuttons").fadeIn();
   }, function(){
   	$("div#slidingpanebuttons").fadeOut();
   });   

   $("div#gallerynextbutton").css;
   $("div#gallerymainimage").hover(function(){
   	$("div#gallerynextbutton").fadeIn();
   }, function(){
   	$("div#gallerynextbutton").fadeOut();
   });  

   $("div#gallerypreviousbutton").css;
   $("div#gallerymainimage").hover(function(){
   	$("div#gallerypreviousbutton").fadeIn();
   }, function(){
   	$("div#gallerypreviousbutton").fadeOut();
   }); 

 });

Any ideas? Because I'm stumped. :/
 
Last edited:
Thanks for the replies.

Have you checked the permissions of the folders that contain your scripts and the images the scripts refer to?

Thanks for the suggestion, but yeah they all look to be fine.

Seems to be working fine for me unless im just not seeing the problem :confused:

Do you get the buttons when you hover over the image? And is all the information below the image hidden until you click on the relevant button?
 
The problem is that you're using jQuery for these effects, but you're failing to load jQuery hence why it's not working :p.

Put this in your template code inside the <body> tags to load jQuery from Google:
PHP:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
 
Hmm, I wonder where that jquery link went to then since it used to work. :confused: Oh, and I've added it with your link, but my site really doesn't like it as it doesn't show the image at all now.
 
Try putting the jQuery script tag above all other script tags. jQuery has to be loaded before the slidepanel.js at least.
 
Try putting the jQuery script tag above all other script tags. jQuery has to be loaded before the slidepanel.js at least.

Buy this man a cookie! :D

Big cheers mate! That worked spot on. Wonder why it went wrong in the first place though. Very weird. Do you recommend calling jQuery from somewhere like google, or from my server?
 
These kinds of things are usually a huge mystery. :D.

From what I understand it's always better to use a content distribution system like Google APIs for this kind of thing. Not only does it reduce bandwidth on your site but it means that your visitors who visit other sites which load jQuery from that same link will already have it cached making your site quicker to load :).

Google is pretty special too as it allows you to select the version of jQuery you want:
http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js = the specific version jQuery 1.3.2
http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js = whatever the latest version of jQuery 1.3.x is
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js = whatever the latest version of jQuery 1.x.x is

So if they rolled out version 1.4.1 and you were using the bottom link it would already be on your site :).
 
Cheers. Looks like I actually had jQuery sitting in my js folder. I must have accidentally deleted the link to it for some reason. Anyway, that works now, so thanks for that. Now to stop the torrent of spam I have been getting recently on my wordpress comments.
 
Heh good look with that.

One thing I would suggest though, is that I don't think the buttons are easy to notice or figure out what they do. You could put a title attribute on the images so that when you hover over them you can see what they do:

PHP:
<img src="templates/afowler/comments.gif" alt="comments" title="comments" />(0)</a>

In Internet Explorer the alt text will show when you hover over the image, but not in Firefox (and I assume Chrome, etc) because the alt text wasn't designed for that, hence the title attribute.

I'd be inclined to put some text links below the image just above the image slider thing. It might clutter the page up a little but it's better to have that and get a sale than to miss one :).
 
Sorry I missed the jquery thing, I've been busy all day getting my portfolio up, I'm sleepy! Are you using akismet for your comments?

No problem. I'm not using askimet yet, but I certainly will be. I stupidly thought I might be able to get away without spam protection. Oh how wrong I was. 200 adverts for viagra later I have switched comments off until I get something in place.
 
Heh good look with that.

One thing I would suggest though, is that I don't think the buttons are easy to notice or figure out what they do. You could put a title attribute on the images so that when you hover over them you can see what they do:

PHP:
<img src="templates/afowler/comments.gif" alt="comments" title="comments" />(0)</a>

In Internet Explorer the alt text will show when you hover over the image, but not in Firefox (and I assume Chrome, etc) because the alt text wasn't designed for that, hence the title attribute.

I'd be inclined to put some text links below the image just above the image slider thing. It might clutter the page up a little but it's better to have that and get a sale than to miss one :).

Thanks for the suggestion. I've added the title tags. Not sure about the text links though. I know what you mean about making it clearer, but I like the minimalist layout I have at the moment. And tbh, I doubt I will ever get many sales from the site. It's there more for promotion and for my own hosting.

I wish I could shoehorn pixelpost into wordpress though and use the wordpress paypal cart. Would make life easier.

If your using wordpress, akismet is bundled as standard? All you need to do is get your wordpress API key and then put it in on your wp dashboard. If it isn't there just get the plugin, it is really easy, and no reason for it not to be installed!

Its the best way as your would be commenters can concentrate on commenting rather than having to enter captchas etc. Akismet is 'invisible' to them

Yeah, I have enabled it now. Don't know why I hadn't turned it on. Let's hope that sorts things out a bit.

Thanks for the help guys. :)
 
Are your order/checkout buttons supposed to be working or not. Because the paypal 'forms' behind the buttons aren't complete at the moment.

Yeah. Again they used to work, but have stopped working recently. What is missing that you can see? Looks like I have been sleep coding or something, and just randomly deleting lines, lol.
 
Code:
<input type="hidden" value="1" name="add"/>
<input type="hidden" value="1" name="upload"/>

You should only have 'add' under your add to cart button, upload is for third party carts that carry out most of the function by themselves.

Add yourself to the 'cookies owed' list. Fixed it perfectly. Thanks a lot. :)
 
Back
Top Bottom