Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with adding contrib code into index or STS templates?


ozstar

Recommended Posts

Hi,

 

I am trying to get the MP3 osplayer working in an STS Template site and have been able to insert all the changes in other files as per the author's instructs however I can't get one.

 

He says to add this into catalog/index.php but I can't see where I could do that in the STS index.php, I thought maybe it should not be in index.php but in one of the template areas.

 

Any help here please ?

 

Thanks

 

 

Oz

 

:)

 

 

catalog/index.php

 

Line 39 : after

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

Add :

<!-- osPLayer Start //-->

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,

scrollbars=no,resizable=no,copyhistory=no,width=193,height=265,

screenX=0,screenY=0,top=300,left=450')

}

 

//--></script>

<!-- osPlayer end //-->

Link to comment
Share on other sites

Hi,

 

I am trying to get the MP3 osplayer working in an STS Template site and have been able to insert all the changes in other files as per the author's instructs however I can't get one.

 

He says to add this into catalog/index.php but I can't see where I could do that in the STS index.php, I thought maybe it should not be in index.php but in one of the template areas.

 

Any help here please ?

 

Thanks

 

 

Oz

 

:)

 

 

catalog/index.php

 

Line 39 : after

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

Add :

<!-- osPLayer Start //-->

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,

scrollbars=no,resizable=no,copyhistory=no,width=193,height=265,

screenX=0,screenY=0,top=300,left=450')

}

 

//--></script>

<!-- osPlayer end //-->

 

 

 

Oz just checked my files and it is right there in catalog/index.php

 

 

 

Just follow that instruction and insert the little sniblett below line 39 with your text editor.

Link to comment
Share on other sites

Hi starcad,

 

Do you know hpow many times I looked at that crazy file?? I can't believe I missed it. Thanks for the 'proof read!

 

Still, even though I fixed that, I cannot see the osplayer in the catalog side of

the store even though the Admin side works perfectly.

 

I have the player working on both sides in a clean oscommerce store however this store has the STS template system and I don't know anything about it.

 

I will go and look at all my files again for the 3rd time as I may have missed something like I did with the index.php.

 

Thanks again

 

Oz :)

Link to comment
Share on other sites

I try to add a forum block but it wasn't working.

 

Here is my file:

 

 

$sts->start_capture();

require(DIR_WS_BOXES . 'forumbox.php');

$sts->stop_capture('forumbox', 'box'); //

 

$sts->start_capture();

echo "\n<!-- Start Category Menu -->\n";

echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', '');

echo tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');

echo "</form>\n";

echo "<!-- End Category Menu -->\n";

$sts->stop_capture('catmenu');

 

function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {

global $languages_id;

 

if (!is_array($category_tree_array)) $category_tree_array = array();

if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => "Catalog");

 

if ($include_itself) {

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");

$category = tep_db_fetch_array($category_query);

$category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);

}

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");

while ($categories = tep_db_fetch_array($categories_query)) {

if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);

$category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '   ', $exclude, $category_tree_array);

}

 

return $category_tree_array;

}

 

/* // START COMPATIBILITY WITH STS 2 AND 3: $footer

// Uncomment this piece of code if you want $footer like in STS.

// Keep it as comment if you want to have $footer displaying only the copyright info.

$sts->start_capture();

?>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr class="footer">

<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

</tr>

</table>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center" class="smallText">

<?php echo FOOTER_TEXT_BODY ?>

</td>

</tr>

</table>

<?php

$sts->stop_capture('footer');

// END COMPATIBILITY WITH STS 2 AND 3: $footer */

 

/* // START COMPATIBILITY WITH STS 2 AND 3: $banner

$sts->start_capture();

if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo $sts->template['banner_only']; ?></td>

</tr>

</table>

<?php

}

$sts->stop_capture('banner');

// END COMPATIBILITY WITH STS 2 AND 3: $banner */

 

/* // START COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_

// See if there are any $url_ or $urlcat_ variables in the template file, if so, flag to read them

if (strpos($sts->template['template_html'], "\$cat_") or strpos($sts->template['template_html'], "\$urlcat_") ) {

print "<!-- STS: Reading $cat_ and $urlcat_ tags, recommend not using them -->";

$get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION);

// Loop through each category (in each language) and create template variables for each name and path

while ($categories_description = tep_db_fetch_array($get_categories_description_query)) {

$cPath_new = tep_get_path($categories_description['categories_id']);

$path = substr($cPath_new, 6); // Strip off the "cPath=" from string

 

$catname = $categories_description['categories_name'];

$catname = str_replace(" ", "_", $catname); // Replace Spaces in Category Name with Underscores

 

$sts->template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);

$sts->template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);

$sts->template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);

$sts->template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);

}

}

*/ // END COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_

?>

 

 

Can you let me know what to write? I am a bit confused. Thanks for this nice module btw!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...