Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating a custom page with HTML content


Guest

Recommended Posts

Hi I want to create a page similar to contact_us.php but instead of just having text in the content box i want to put html (i.e. add a few pictures etc)

 

Is this possible do do?, I've already searched all the guides but only found info on adding boxes using plain text content.

Link to comment
Share on other sites

You can create the page however you want it using full html code. Then at the very beginning add this on the first line

<?php

and on the very last line, add this

?>

Then when you link to the page, use the tep_href_link function and the shop will function normally and the page will behave as it should.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You can create the page however you want it using full html code. Then at the very beginning add this on the first line
<?php

and on the very last line, add this

?>

Then when you link to the page, use the tep_href_link function and the shop will function normally and the page will behave as it should.

 

Jack

 

ok thanks, what is tep_href_link and how do i use it?

Link to comment
Share on other sites

It's a function in oscommerce that creates a link with a session ID attached. It's syntax varies with where you want to use it. Just look at a link, say in the includes/header.php file, to see how it is used. Or post your link here and someone will convert it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I thought includes/application_top.php is what kept the session id.

 

from application_top.php

// check if sessions are supported, otherwise use the php3 compatible session class
 if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'osCsid');
define('PHP_SESSION_PATH', $cookie_path);
define('PHP_SESSION_DOMAIN', $cookie_domain);
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCsid');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
session_set_cookie_params(0, $cookie_path, $cookie_domain);
 } elseif (function_exists('ini_set')) {
ini_set('session.cookie_lifetime', '0');
ini_set('session.cookie_path', $cookie_path);
ini_set('session.cookie_domain', $cookie_domain);
 }

// set the session ID if it exists
  if (isset($HTTP_POST_VARS[tep_session_name()])) {
 tep_session_id($HTTP_POST_VARS[tep_session_name()]);
  } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {
 tep_session_id($HTTP_GET_VARS[tep_session_name()]);
  }

// start the session
 $session_started = false;
 if (SESSION_FORCE_COOKIE_USE == 'True') {
tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
  tep_session_start();
  $session_started = true;
}
 } elseif (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));
$spider_flag = false;

if (tep_not_null($user_agent)) {
  $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

  for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
	if (tep_not_null($spiders[$i])) {
	  if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
		$spider_flag = true;
		break;
	  }
	}
  }
}

if ($spider_flag == false) {
  tep_session_start();
  $session_started = true;
}
 } else {
tep_session_start();
$session_started = true;
 }

// set SID once, even if empty
 $SID = (defined('SID') ? SID : '');

// verify the ssl_session_id if the feature is enabled
 if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
$ssl_session_id = getenv('SSL_SESSION_ID');
if (!tep_session_is_registered('SSL_SESSION_ID')) {
  $SESSION_SSL_ID = $ssl_session_id;
  tep_session_register('SESSION_SSL_ID');
}

if ($SESSION_SSL_ID != $ssl_session_id) {
  tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
}
 }

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Link to comment
Share on other sites

The SID has to be attached to the link and that is handled by the tep_href_link function.

 

Jack

Gotcha. Will the html page need the application_top to maintain the SID if linking back to the Site. I'm assuming you would need to use the tep_href_link there also.

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Link to comment
Share on other sites

Gotcha. Will the html page need the application_top to maintain the SID if linking back to the Site. I'm assuming you would need to use the tep_href_link there also.
No, you don't need to include application_top if it is just going to be html content. If that page is going to have links to the shop, then yes, it will need application_top and you will need to use tep_href_link.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Ok let me explain what im trying to do

 

goto this page:

 

http://www.kestrelproav.com/catalog/conditions.php

 

basically i want to create another page like this where i can edit "Conditions of use" and all text in this box, but i also want to add a few images, using html i presume.

 

Can anybody help? thanks

Are you saying you want two Conditions pages? You can add whatever html you want, or just plain text, to the existing page in the english/conditions.php file. Is that what you are trying to do?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Are you saying you want two Conditions pages? You can add whatever html you want, or just plain text, to the existing page in the english/conditions.php file. Is that what you are trying to do?

 

Jack

 

I want to create about 5 or six pages like conditions but i want to add html.

 

I'm going to go and try and edit conditions.php iteself and see how far i get.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...