Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

display infobox on ONE PAGE ONLY (index.php)


sheena

Recommended Posts

Does anynow know how to add an infobox, so that it appears on one page only eg. only on the index.php page.

 

I've created a new infobox by editing the "english.php", "column_left.php" and "image.php" (which is my new infobox and based on information.php)

 

I've added a new box under categories which will contain an image only, however it appears on every page of the site.

 

How can i limit it to the index.php only since i dont actually edit the index.php to create it???

 

 

Please help if you can....

 

sheena

Link to comment
Share on other sites

infobox's are placed in column_left.php and column_right.php.

 

You may either place a condition in left / right to have selective display (so you need to pass some variable / or use global values) or create replica of left / right and define them in other pages.

 

 

Cheers,

Gaurav

Best Regards,
Gaurav

Link to comment
Share on other sites

infobox's are placed in column_left.php and column_right.php.

 

You may either place a condition in left / right to have selective display (so you need to pass some variable / or use global values) or create replica of left / right and define them in other pages.

Cheers,

Gaurav

 

 

Thanks Gaurav,

 

Sorry to be a pain, but Im not to well versed in PHP... so what you just said makes sense, but what exact code do you add to column_left.php to make it selective for a particular infobox on index.php for example.

 

If you dont know, any ideas where i could find out.... this forum's search facility is crap!

 

sheena

Link to comment
Share on other sites

You would have to use if condition -- dummy code below for your perusal ..

 

if($_PHP_SELF !='/catalog/index.php')
{
require(DIR_WS_BOX .'new_box');
}

 

Cheers

Gaurav

 

 

Sorry Gaurav to be a pain. I know you've probably a million other things to do, but as i said im useless when it comes to coding in php.

 

Could you be more specific, i mean if possible could you provide the code i need, or at least say where to place it and on which files.

 

Below is the code i have used so far to add the box (displaying on all pages).... link to my site so you can see http://www.little.ie/towerhatch/index.php

 

 

column_left.php

 

<?php

if (isset($HTTP_GET_VARS['products_id'])) {

} else {

if (isset($cPath) && tep_not_null($cPath)) {

} else {

include(DIR_WS_BOXES . 'image.php');

}

}

?>

 

image.php

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_IMAGE);

 

new infoBoxHeading2($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<img src="images/shipping.jpg" width="92" height="101">');

 

new infoBox1($info_box_contents);

?>

 

 

english.php

 

// categories box text in includes/boxes/categories.php

define('BOX_HEADING_CATEGORIES', 'Wine List');

define('BOX_HEADING_IMAGE', 'Image');

 

 

Apologies again. If you could help i'd appreciate it so much, as the clients is looking to have the site finished by the end of the week and im in an awful hurry!

 

thanx

 

sheena

Link to comment
Share on other sites

So that I understand your question clearly... you don't want WINE LIST to show up on ANY PAGE other then index.

 

Is that what you wish to achieve? please confirm.

 

 

Thanks

Gaurav

Best Regards,
Gaurav

Link to comment
Share on other sites

So that I understand your question clearly... you don't want WINE LIST to show up on ANY PAGE other then index.

 

Is that what you wish to achieve? please confirm.

Thanks

Gaurav

 

no sorry i only want the infobox below it (image) to show up on index.php only, not winelist!

 

thanks

Link to comment
Share on other sites

no sorry i only want the infobox below it (image) to show up on index.php only, not winelist!

 

thanks

modify column_left.php to define image.php within this IF condition. Or post column_left ( or right .. which ever you have used) to give exact mod.

if($PHPSELF == 'index.php'){
include(DIR_WS_BOXES . 'image.php');
}

 

 

So image.php would get invoked only when page is index.php.. on rest all pages .. it won't show up.

 

Cheers

Gaurav

Best Regards,
Gaurav

Link to comment
Share on other sites

modify column_left.php to define image.php within this IF condition. Or post column_left ( or right .. which ever you have used) to give exact mod.

if($PHPSELF == 'index.php'){
include(DIR_WS_BOXES . 'image.php');
}

So image.php would get invoked only when page is index.php.. on rest all pages .. it won't show up.

 

Cheers

Gaurav

 

 

hi guarav thanks for the suggestion,

 

i did what you said. i added that if statement to the code but i didn't work. i tried placing it in a number of different locations within the if block but no luck.

 

if my code was as follows, where exactly do i place the new code you suggested. could you show me how the completed code should look?

 

original code on column left

 

 

<?php

if (isset($HTTP_GET_VARS['products_id'])) {

} else {

if (isset($cPath) && tep_not_null($cPath)) {

} else {

include(DIR_WS_BOXES . 'image.php');

}

}

?>

Link to comment
Share on other sites

  • 2 weeks later...
hi guarav thanks for the suggestion,

 

i did what you said. i added that if statement to the code but i didn't work. i tried placing it in a number of different locations within the if block but no luck.

 

if my code was as follows, where exactly do i place the new code you suggested. could you show me how the completed code should look?

 

original code on column left

<?php

if (isset($HTTP_GET_VARS['products_id'])) {

} else {

if (isset($cPath) && tep_not_null($cPath)) {

} else {

include(DIR_WS_BOXES . 'image.php');

}

}

?>

 

Can anyone please help me. I have a strict deadline to meet and im running out of time....

Link to comment
Share on other sites

Can anyone please help me. I have a strict deadline to meet and im running out of time....

Multiple posts are not allowed.

If it is on one page onlyyou will need to put it in that page, not column left or column right. Maybe create a new column left called column_left_1.php and set it to be called in lieu of the original on one page only. Have to define filename.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...