Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / My shop went all black after editing a file

My shop went all black after editing a file

Started by carlman on 12 Jun 2015, 12:41 PM · Views: 820

Results 1 to 7 of 7
12 Jun 2015, 12:41 PM
#1
carlman avatar

carlman

New Zenner

Join Date:
Oct 2011
Posts:
29
Plugin Contributions:
0

Post #1 by carlman

Hello!
I urgently need your help!
My shop is here: http://www.carlmanevent.se/shop/index.php
and is currently all black :(

I know that Zen Cart is complex and I really try to edit as much as I can in the Admin panel, but before my shop went black, I tried to edit the tpl_main_page.php which is in the "common" folder.

The reason for editing this file, was that after inactivating my banners in the admin apnel, I still got that big area on the top of the page that was white. I read in the code that text about #pane5 was causing this and I went into tpl_main_page-php to put "<--" and "-->" areounf that text. It did not work though and when I edited back so that the file looked as it did before my changes, I got this black page!
I can honestly say that I changed back everything, so I don't know why i can't even see the shop now...

Any ideas?

Here's the area that I first tried to edit, but now is back in its original text:

<div class="scroll"> <div class="extra"> <div class="main-width"> <div class="holder"> <div class="scroll-pane" id="pane5"> <!-- BOF- BANNER #1 display --> <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner- >RecordCount() > 0) { ?> <ul class="blocks"> <?php $new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);
							  // secure pages
							  switch 

($request_type) {
case ('SSL'):

$my_banner_filter=" and banners_on_ssl= " . "1";
break;
case
('NONSSL'):

$my_banner_filter='';
break;
}

							  $sql = "select 

banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search .
$my_banner_filter . " order by banners_sort_order";
$banners_all = $db-

Execute($sql);

							// if no active 

banner in the specified banner group then the box will not show
$banner_cnt = 0;
while
(!$banners_all->EOF) {

$banner_cnt++;
$banner =
zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1);
echo '<li class="scroll-interval">'.zen_display_banner('static', $banners_all-

fields['banners_id']).'</li>';
// add spacing
between banners
if
($banner_cnt < $banners_all->RecordCount()) {

								}
								$banners_all-

MoveNext();
}
?>
</ul>
<?php } } ?>
<!-- EOF- BANNER #1 display -->
</div>
</div>
</div>
</div>
</div>

I know now that I probably should do my editing in the Stylesheet_tm.css file to remove that banner background area,
but I strongly feel that step number 1 is to get the shop back on track and not looking black!

Thanks for all your help and input!

12 Jun 2015, 12:56 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #2 by mc12345678

Check your logs folder for mydebug files. Post content do not include admin folder name if included.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

12 Jun 2015, 1:00 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #3 by mc12345678

As there previously nothing between these curly brackets?

if 
($banner_cnt < $banners_all->RecordCount()) {

}

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

14 Jun 2015, 1:23 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #4 by rodg

carlman:

I tried to edit the tpl_main_page.php which is in the "common" folder.

Just so that we all start on the same page, there is probably more than one 'common' folder.
The default one at /includes/templates/template_default/common/ and one for each of the templates/themes that you have installed. eg: /includes/templates/YOUR_TEMPLATES/common/

If you've edited the tpl_main_page.php in the template_default/common folder you should just replace it with a zencart original.

If you've edited the tpl_main_page.php in the YOUR_TEMPLATE/common folder I suggest you make a backup copy of it, then replace the edited copy with a zencart original (copy the one from the /template_default/common/ folder.

This should get the site functional again, and from there you start to investigate what went wrong with your original edits.

carlman:

Here's the area that I first tried to edit, but now is back in its original text:

The code you supplied is/was next to useless for diagnostic purposes. As well as the item pointed out by mc1->8, the code* as presented* has several line breaks where there shouldn't be any. I/we don't know if those breaks were introduced with your original edit, whether it was the result of the way you 'captured' the code, the way the code was pasted into your posting, or simply a result of line wrapping by the forum software because you failed to enclose the code in the CODE tags ```
code goes here


The fact that these wraps could have been introduced with your original edit means that it is somewhat pointless looking into other possible causes of your problem until this has been eliminated as the cause.  

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

14 Jun 2015, 1:26 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #5 by rodg

mc12345678:

As there previously nothing between these curly brackets?

if
($banner_cnt < $banners_all->RecordCount()) {

}


Note to OP:
I'm pretty sure this was meant to be "WAS there previously nothing between these curly brackets?"

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

14 Jun 2015, 2:06 AM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #6 by mc12345678

RodG:

Note to OP:
I'm pretty sure this was meant to be "WAS there previously nothing between these curly brackets?"

Cheers
RodG

For confirmation, the teacher has properly identified the expectation. :)

Blazing heat, outdoors, typing faster than poor little cellphone browser would work, not going back to fix what I remember originally said Was, but also trying to scan for unbalanced closures, etc...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

15 Jun 2015, 6:28 AM
#7
carlman avatar

carlman

New Zenner

Join Date:
Oct 2011
Posts:
29
Plugin Contributions:
0

Post #7 by carlman

Hello guys!
Thanks for all your time and energy trying to help me!
After calming down a bit, I also realized that the best way would just to upload the original file again.
So I did that and everything is back to normal now.
I also managed to find the .scroll area in the .css file so that white area problem also was resolved.

So thanks again for helping me and being my support!
It's good to know that you're around :)