Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Would Like To Make An Example / Photo Gallery Page In The Information Box Or New Box Below It


RC Heli Pilot

Recommended Posts

Hi All.

I have been stuck on this page here for hours now:

http://www.oscommerce.com/forums/index.php?sho...nvoice&st=0

 

I would like to make an Example / Photo Gallery Page for pictures of the work that i've done and one day i hope to be able to add a page #2 and page #3 and so on.

 

Just on that first page they show Many,... Many Examples and More Examples for the people who have asked questions and then there are better written Examples with shorter code. I'm just going to tell you know,... I'm Confused! :( :'(

 

So far i've created a new folder just to keep everything separate and organized and i've downloaded the following files:

 

/shop/conditions.php

/shop/includes/languages/english/conditions.php

/shop/includes/application_top.php

/shop/includes/languages/english.php

 

 

I've renamed "/shop/conditions.php" to "/shop/gallery.php"

 

On line 15 & 17 I've renamed

 

 

require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS));

 

To:

 

 

require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GALLERY);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_GALLERY));

 

I then renamed /shop/includes/languages/english/conditions.php file to /shop/includes/languages/english/gallery.php

 

 

But,... Post #2 in that thread never says what to do with the file /shop/includes/languages/english/gallery.php file.

 

So, I changed lines 13 & 14 from:

 

define('NAVBAR_TITLE', 'Conditions of Use');
define('HEADING_TITLE', 'Conditions of Use');

 

To

 

define('NAVBAR_TITLE', 'Welcome to our Photo Gallery');
define('HEADING_TITLE', 'Welcome to our Photo Gallery');

 

 

Is that Correct?

 

Now for the file /shop/includes/application_top.php

 

Where is the best place to add this code:

 

// New page gallery.php

define('FILENAME_GALLERY', 'gallery.php');

 

The instructions say just to add it to the file, save it and upload it but i know from experence that you "Just" can't "Add It" anywhere inside the file so,... Wheres the best place to insert this code in to that file?

 

 

Now for the /shop/includes/languages/english.php file.

 

Do i find this code starting on line 122

 

// information box text in includes/boxes/information.php
define('BOX_HEADING_INFORMATION', 'Information');
define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
define('BOX_INFORMATION_SHIPPING', 'Shipping & Exchanges');

 

 

As you can see i've changed Shipping & Returns to Shipping & Exchanges.

 

But anyway,... Is this the code to write to have it in the "Information Box" below:

define('BOX_INFORMATION_GALLERY', 'Photo Gallery');

 

Directly under this code on line 122

 

// information box text in includes/boxes/information.php
define('BOX_HEADING_INFORMATION', 'Information');
define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
define('BOX_INFORMATION_SHIPPING', 'Shipping & Exchanges');
define('BOX_INFORMATION_CONTACT', 'Contact Us');
define('BOX_INFORMATION_GALLERY', 'Photo Gallery');

 

 

Just a couple more questions please,...

What is the code to have the Photo Gallery Link in it's own Box directly under the Information Box and have the Box named "Other Interest"?

 

 

Once i get this firat main page created, How do i go about adding a 2nd or 3rd or 4th page and so on?

 

1 Last Question please,...

 

Is there a Better way of going about and doing this instead of the way i've described above?

 

I wished they would have added some sort of option to be able to just add pages like this from the Admin, How could they not think that people wouldnt want to be adding more pages to their site,... :-

 

 

I really hope i havent confused you and i really appreciate your help in helping me solving this.

 

Thanks

RCHP.

Link to comment
Share on other sites

I figured out why it wasnt showing up in the Information Box.

 

I needed to add the command to the information.php file.

 

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_GALLERY . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
	   '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

 

Now that i've gotten it to show up i just need my other questions answered please.

Link to comment
Share on other sites

first off, kudos for diving in and trying to make it work. :thumbsup:

 

So, I changed lines 13 & 14 from:

Is that Correct?

 

if i understand what you're trying to do, yeah that looks right so far.

 

 

Where is the best place to add this code:

 

// New page gallery.php

define('FILENAME_GALLERY', 'gallery.php');

 

there is a file called includes/filenames.php where this should go.

 

What is the code to have the Photo Gallery Link in it's own Box directly under the Information Box and have the Box named "Other Interest"?

 

i'm not sure i understand what you're asking. do you mean you want to create a new infobox underneath the "Information" one? to do this, you'd need to modify includes/column_left.php and just add a new one in. take a look at the file and i think you'll see what i mean. or just add your gallery link to the existing infobox.

 

Once i get this firat main page created, How do i go about adding a 2nd or 3rd or 4th page and so on?

 

i wouldn't add more pages, i'd add a parameter to the page. something like gallery.php?page=2. then, inside the gallery.php code, look at the page value to display the requested image and create the links back to page 1 and forward to page 3. maybe even have the code count the number of image files in a gallery image folder so you wouldn't have to make code changes...just drop in new files. depends on how fancy you want to get.

 

Is there a Better way of going about and doing this instead of the way i've described above?

 

probably a matter of opinion. but if you're going to turn this page into something that allows you to view multiple images and automatically determine which ones to display, then this is (imho) a pretty good solution. it's simple enough, and given your level of coding ability (no offense intended) probably the easiest thing to do.

 

I wished they would have added some sort of option to be able to just add pages like this from the Admin, How could they not think that people wouldnt want to be adding more pages to their site,... :-

 

i'm sure they thought there would be more pages added to a site. but since they have no way of knowing what those pages are and what their functionality would be, it's very hard to plan for them. and how would you get the admin code to "edit" your existing pages to put the link to your new page in, and create and infobox for you? that sounds hard to me.... self-editing code is never easy. there's just no way to tell ahead of time what the needs will be. the easiest way to do it is to just take an existing page and start hacking and slashing at it until it starts doing what you want it to do. fortunately, with an open source product like this, you have the code and can use a text editor to make it do whatever you want.

 

good luck with it. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...