Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

surfalot

Pioneers
  • Posts

    2,312
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by surfalot

  1. How I would proceed in that case would be to compare the contrib file with the original file from a fresh download of osC2.2MS2. Then it will become obvious what parts changed and you can try to work out where it's suppose to go in your heavily modified file from that.

     

    I marked the changes with "BOF: More Pics 6" and "EOF: More Pics". there are only 4 changes. All the line numbers are referencing the contrib's product_info.php.

     

    1) lines 72-74: is simply adding

    p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6,

    to the line original line 72 that starts (placed after p.products_image,) :

    $product_info_query = tep_db_query("select p.products_id...

     

    2) Lines 90-133 are all new. Placed just before the end php code tag ( ?> ) that comes after the change above.

     

    3) line 149: In the product_info.php of the contrib package I have commented out the original image code using /* */ so it can remain for reference. I'm thinking of adding a switch to easily turn on and off the contrib completely which will use the code, so don't remove it, just comment it out like in line 149 of product_info.php in the contrib. This is the original code

    <?php
    if (tep_not_null($product_info['products_image'])) {
    ?>
    	  <table border="0" cellspacing="0" cellpadding="2" align="right">
    		<tr>
    		  <td align="center" class="smallText">
    <script language="javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
    //--></script>
    <noscript>
    <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
    </noscript>
    		  </td>
    		</tr>
    	  </table>
    <?php
    }

    Replace with

    <?php /* BOF: More Pics 6
    if (tep_not_null($product_info['products_image'])) {
    ?>
    	  <table border="0" cellspacing="0" cellpadding="2" align="right">
    		<tr>
    		  <td align="center" class="smallText">
    <script language="javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
    //--></script>
    <noscript>
    <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
    </noscript>
    		  </td>
    		</tr>
    	  </table>
    <?php
    }  */
    if (MOPICS_TABLE_LOCATION=='above') {
      echo '		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    		<tr>
    		  <td align="center" class="smallText">'.$mopics_output.'</td>
    		</tr>
    	  </table>
    	   <br>'."\n";
    } else if (MOPICS_TABLE_LOCATION=='sides') {
      echo $mopics_output;
    }
    // EOF: More Pics 6
    ?>

     

    4) Add the code in Lines 216 to 225, all new.

     

    Hope that helps.

  2. danimaia,

     

    I'll bet what you are doing is this...

     

    Type type type type type type type type.[hit return]

    [hit return]

    Type type type type type type type type type type type type type type type type.[hit return]

    etc...

     

    then it comes out in one line without the spacing from [return]s. When it is displayed on a page the browser ignores [return]s.

     

    What you need to do is to use basic HTML tags to create the spacing you require.

     

    HTML Example with 2 paragraphs:

    <p>Type type type type type type type type.</p>
    <p>Type type type type type type type type.</p>

     

    If you want formatting in that box, you need to use some basic HTML. Go Googling for a basic HTML tutorial that will show you how to make paragraphs, bold & italicize items, font sizes, etc.

     

    Sorry for the misunderstanding. I talk about code so much sometimes I forget not everyone here knows HTML. There are a couple of good contributions here that are what we call a WYSIWYG editor. A WYSIWYG text entry box will let you just type what you want and your page will display it exactly like you formatted it. If you have one of these installed in your admin you can avoid learning HTML for now.

     

    Hope this helped.

  3. In my store, one of my categories is Cheese, and i have a long description about it. If i can't put the formatted text in the header, how can i save it formatted to a database and put in the body of the page?

    OK, I see where you are talking about now. But it seems to work on the base install I have. Are the HTML tags getting removed from the text you are saving in that field or just not displaying right?

  4. Abstract:

    More Pics 6 allows you to add up to 6 additional pics to each product. The pics

    can be different sizes and different types (jpg,gif,png,...). The image pop-up

    will display forward and next buttons so the customer can page through each

    larger image without needing to go back to the main product page. You will have

    the ability to configure the number of rows and columns to display the products

    in on the main products info page. If more images are defined then columns and

    rows are defined the remaining images can be viewed in the pop-up. You will also

    be able to configure whether the images show above the description, below the

    description or on either side of the description.

     

    Many thanks to all that have contributed to this contrib. All are credited.

     

    Get it here:

    http://www.oscommerce.com/community/contributions,1611

  5. Can I save fomatted text in my header_tags_description, with the paragraphs that i defined?

    This not only wouldn't be a good idea, but w3c.org specs for the Title tag actually forbid using any HTML tags within the <title> tag (http://www.w3.org/MarkUp/html3/dochead.html at the bottom). There really shouldn't be any reason to. generally speaking, you should avoid html tags in any of these fields.

  6. I installed complete version 2.5.5 and now when I go to edit a product, at the bottom of the page I get the following error.

     

    Fatal error: Call to undefined function: tep_get_products_head_title_tag() in /home/www/mysite.com/admin/categories.php on line 579

     

    I also can't submit my product edit as a result. Any suggestions?

    I would guess you didn't do the instructions in the Install_Admin.TXT file that is in the contribution package. there are several functions that need to be entered into the admin/includes/functions/general.php file there.

  7. No reason other than I didn't think about it. The way I used is the standard way of doing it and I just did it out of habit. Have you tried your method? I'm not sure it wil give a correct path (although it may work) due to the way slashes are added.

     

    Jack

     

    Looks like it does work. At least with a RHE 3 apache 1.3.34 PHP 4.3.11 server. Besides the tests, I echoed the combination and it's building the right path.

     

    The main reason I was asking was to see if you had posibly run into a server that didn't get the right value for $DOCUMENT_ROOT global, which is used in the default osC install to get DIR_FS_DOCUMENT_ROOT. Fantastico doesn't use that global to define the DIR_FS_DOCUMENT_ROOT. They hard code the path, incorectly I might add. Which made me think maybe they and you had run into a situation in which the global $DOCUMENT_ROOT doesn't work right.

     

    I have tried it with a default install of osC and a version I have that has the /admin/ outside the catalog directory. I also looked at the default install for Fantastico. They incorrectly add a trailing slash in the DIR_FS_DOCUMENT_ROOT constant.

     

    Because of that, I checked it with DIR_FS_CATALOG instead of the combo DIR_FS_DOCUMENT_ROOT.DIR_WS_CATALOG. That works in a copy-over install for the default osC, and with the admin in a location outsite of the catalog, and a fantastico installation. I think doing an aboslute path with DIR_FS_CATALOG would be the best route. I prefer to use the predefined absolute paths.

     

    The only other issue I can think of at the moment is the difference between 'nix and win machines, but if you can get away with hardcoding '../' and '/header_tags.php' for an include, this shouldn't be an issue. Any comments on that?

     

    So I suppose if you don't object, I'll try the DIR_FS_CATALOG constant instead of the relative path in the update I'm putting together.

     

    I also found another little glitch while testing this. In the admin/header_tags_english.php file (Text Control from the menu), if you put an apostrophe in the text and save, then save again, and again, a number of forward slashes start to pile up in front of the apostrophe. This only happens in the "Default" group a the top of the page. All the others work just fine. I tracked it to lines 27-29 of the file. Those addslashes() shouldn't be there. If they are removed, the Default group works with apostrophes. The addslashes() were not being done to the rest of the input and looks like it was being taken care of elsewhere.

     

    Can you confirm that those are extraneous? Or was there a reason they were added there and maybe something else should be done?

     

    Todd

  8. i have deleted some code where i think i added in the wrong place and now the following error appears:

     

    Parse error: parse error, unexpected $ in /catalog2/admin/categories.php on line 1137

     

    Like julielan above, it's most likely a goof in adding the HTC code to your /catalog2/admin/categories.php near or above line 1137. compare with like lines in the contrib's catalog_for_new_shop_only/admin/categories.php file. (not necesarily the same line number if you have other contributions installed)

  9. Hi, everything works great under the "Header Tag" Column, thus I'm having a problem to log in to "Category". I received a "PARSE ERROR" message. Pls. see it listed below and please help me to correct it. Thank you. Kady

     

    Parse error: parse error, unexpected T_CASE in /home/julielan/public_html/admin/categories.php on line 1032

     

     

    It's most likely a small goof in making the additions there. Recheck your Header Tags Controller additions around line number 1032 in the admin/categories.php file. Verify against the similar lines in this contribution's file catalog_for_new_shop_only/admin/categories.php. (not necesarily the same line number if you have other contributions installed)

  10. Jack,

     

    Obviously the little fix I posted was flawed thinking that it would fix for all. The only solution to this working in both the default installation and having the admin directory in locations other than default is to use an absolute path like such:

     

    DIR_FS_DOCUMENT_ROOT.DIR_WS_CATALOG.DIR_WS_LANGUAGES.$language.'/header_tags.php';

     

    instead of the current method of relative path:

     

    '../' . DIR_WS_LANGUAGES . $language . '/header_tags.php';

     

    Was there a reason you didn't do it this way? (I did finally find your little note about this in the install (doah))

     

    Todd

  11. I try to stay away from the database since it causes unnecessary bloat. But the more important reason is that I wanted it to be compatible with previous versions in which the files had to be edited manually.

    Bloat is a necessary thing to utililize the db for what is meant to do. If a person is concerned about it, they simply need to limit the additional things they install.

    But the more important reason is that I wanted it to be compatible with previous versions in which the files had to be edited manually.

    Yeah, I meant I'd have done it differently from the beginning. (your additions are just fine) :)

    -----------

    So, knowing what you know now about the latest upload, do you want to collaborate and compare what I have put together with what you have in storage so the next upload is as complete as possible? I'll do it if you send me your latest zip. I'll just run it through beyond compare for a quick look.

  12. yes that is what i am saying. i make the change it stays there for a little while then goes back to the original text.

     

    The only thought I had was this... Those settings are in a file not the database. If you are maybe "synchronizing" changes to your server each night from FTP or Dreamweaver, that will overwrite what the admin does. If this is true, you need to synchronize down the files includes/header_tags.php and includes/languages/english/header_tags.php after making that change in the Header Tags admin.

     

    but... going to the public catalog pages and viewing source of each product only gives my defaulted meta info. What am I doing wrong?

     

    You got me baffled. The only guess I have is that maybe this installation of HTC is an upgrade? Are you sure you have the latest catalog/includes/header_tags.php and catalog/includes/languages/english/header_tags.php uploaded and not an older version there? By your description, the code snippet has to be in your product_info.php and those files have to be there. Since those conditions are met, is should work.

  13. Your statement that it "could have been implemented better" is the problem I was trying to express. I spent a lot of time on the last 10 or 15 updates. My coding style is my own. There is always someone that thinks they can do it better. And that may be. But then the coding style isn't mine anymore and if I plan to support it, I have just doubled my workload. That's not something any of the authors enjoy, I'm sure. I know I don't.

     

    Yes, I know what infallible means but your usage didn't make any sense to me since I don't see that. And you obviously have not read some of my posts since I make mistakes as much as the next poster. :) And updates to my contributions are, at times, only to fix my own errors - which I readily admit to.

     

    Oh, and by the way, you said "Feel free to check yourself. The missing define you have in the update doc, and the new install doc, but it's not in the catalog_for_new_shop..."

     

    From and a search of the english file shows it is there. I think you fell victim to the "fixes" I was speaking about earlier by grabbing an updated version.

     

    Jack

     

    I'm sure your programming is just fine. I just would have put it all in the DB instead manually setting up defines for each file. that's all I was talking about. I still have a store that has a 2.2 version well before the decision to put tags in the DB.

     

    Yeah I understand how that update vs. support works. That is a problem if you choose to continue supporting. I just wanted to roll-up the things I found plus the other little update posts instead of posting another little fix. I've been using it for years thought I'd contribute back. I would not put up a post if I wasn't willing to support it. I don't want to step on anyones toes either.

     

    I don't have the first clue what infobroker 14 Sep 2005 update is all about. so that is being left out.

     

    >> I think you fell victim to the "fixes" I was speaking about earlier by grabbing...

     

    That is strange, I must be completely insane. are you sure you are downloading the Jack_mcs 7 Sep 2005 post? I've downloaded and unpacked it 3 times today alone. I even tried 241's upload which includes the full zip of 2.5.5. I don't get it. Same thing.

     

    I too grep the package and get the same results each time, it's not there in my download of Jack_mcs 7 Sep 2005. The way I found the error was when I did the fresh copy-over install. It showed BOX_HEADER_TAGS_FILL_TAGS in the admin menu. What ever. It will be there in my upload.

  14. Try going to admin->Header Tags->Page Control and add a new page. Call it XXX. Update it so it saves it. Now go to includes/header_tags.php. If you don't see a block of code for XXX then you have something wrong with the installation.

     

    I see where it is changing now. Thanks for your patience on that issue. I can think of a couple different ways that part could have been implemented better.

     

    Infallible is "Incapable of erring" or as I tried to use it, "Incapable of erring" attitude. Basically meaning some folks here don't think they are capable of making a mistake. It was just the way that sentence read, not "my version" that made me think of that.

     

    I had a little extra time and thought I would pass on my corrections to the community. And while I was at it, I might as well include the other tid bits that were uploaded.

     

    I guess that concludes my research, I'll upload the updated package.

     

    Todd

  15. Both files need write permissions since new sections are added when a page is added in admin->Page Control. If the version you uploaded works, then that should be the one you use.

     

    Jack

     

    I guess I'll just take you and 241's word for it. I see only code in the catalog/includes/header_tags.php (i.e switch (true) { case (strstr) } etc.). The meta data is in catalog/includes/languages/english/header_tags.php only. When I edit tags and save them it changes only catalog/includes/languages/english/header_tags.php not catalog/includes/header_tags.php. When I add new pages is saves to catalog/includes/languages/english/header_tags.php. Category tags as saved to the DB, products tags are saved to the DB. How or what is changing this file (catalog/includes/header_tags.php) is beyond me. It's not changing on my server. I'm just trying to accurate by discussing things with folks. But it doesn't seem like anyone wants to listen.

     

    As for the other changes, I can't comment on them. At least a few of the things you mentioned were not present in my latest version and were introduced by others. So they didn't need "fixing" in my version.

     

    Woh! the infallable attitudes I'm getting here in these forums are truly amazing. Nobody is making any judgments (least of all me). I started with your upload 2.5.5 (7 Sep 2005), as stated. I just wanted to contribute my experiences while installing the great contrib. Everything I have fixed/updated was in that package you upload 7 Sep 2005. Maybe someone switched the files on the server... ;-)

     

    Feel free to check yourself. The missing define you have in the update doc, and the new install doc, but it's not in the catalog_for_new_shop_only/../english.php file, just as I state. same goes for the rest of them. At little bit of humility goes a long way for respect.

     

    I'm not perfect either, that is why I offered it to you for a check. I thought this was a community, I'm just trying to be communal and not look like I'll trying to take over anything. But if you don't care either way, I'll just upload it. I guess I'm just a crazy man with 25 years of programming experience. (started with assembly on the Apple II in '80)

  16. Jack,

     

    I found a couple more glitches to the 2.5.5 package. I have pretty much completed rolling-up of most of the partial contribs since 2.5.5 into a new complete package. the additions/corrections follow:

     

    -> added install notes about file permissions from 241 (16 Oct 2005).

    -> added install notes about some hosts restricting PHP CHMOD from HenSod (9 Sep 2005)

    -> corrections for stores with /admin/ outside the catalog directory. surfalot (2 Oct 2005)

    -> added the tep_ function to the (Explain) info links in two pages, without this, the link

    didn't work on stores with Administration Access Level Accounts installed. (new)

    -> moved remaining language to the language file. (new)

    -> included the now complete French language files contributed by: maxime (13 Sep 2005)

    -> Merged XHTML compliant header code contributed by: yansfung (10 Sep 2005)

    -> Added Missing define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags'); in english.php new-shop replace files

    -> removed an error in the catalog_for_new_shop_only/admin/categories.php file. This was step

    two of the Install_Admin.php for the admin/categories.php file. Should have been a replacement.

    The person making this file instead did an Add After. (would not have affected the functionality)

     

     

    the instuction notes at the end of the catalog install are:

     

     

    ================================================================================

    ===========

    These next two steps are not necessarily needed by everyone. The information is included

    to help those that may need it. You can determine whether you need to take these step

    by completing the installation and going to the admin, select the "Header Tags" admin menu

    item, select "Text Control", then change an item and save the settings. If is saves, skip

    these steps. If you have an error, take a look at the following 2 potential steps.

    ================================================================================

    ===========

     

    POTENTIAL STEP #1

     

    ADDITIONAL INSTALL INSTRUCTIONS (by Steve(aka 241))

     

    It is a vital to make sure these files have the correct permissions to allow the Header Tags

    admin to access and change them. The permissions should be set to CHMOD 666. If you do not know

    what this is, ask your host to help you do this.

     

    catalog/includes/header_tags.php

    catalog/includes/languages/english/header_tags.php

     

    And off course and other header_tags.php created for languages:

    catalog/includes/languages/<language>/header_tags.php

     

    =======================================================

     

    POTENTIAL STEP #2

     

    Issue reported by H. S?derlind ([email protected]) on 2005-09-09

     

    Some hosts restrict a function used in catalog/admin/includes/functions/header_tags.php.

    If you get an error regarding the chmod() php function in this file, and you have addressed

    the file permission stated above, you may have to comment out the function. The following

    will direct you to the problem and provide the solution.

     

    OPEN: catalog/admin/includes/functions/header_tags.php

     

    Around line 201 you find this code:

     

    if (!is_writable($filename))

    {

    if (!chmod($filename, 0666)) {

    echo "Cannot change the mode of file ($filename)";

    exit;

    }

    }

     

    Replce that with the following code:

     

    if (!is_writable($filename))

    {

    echo "The file isn't writable";

    exit;

    /* if (!chmod($filename, 0666)) {

    echo "Cannot change the mode of file ($filename)";

    exit;

    } */

    }

     

    -------------------------

     

    I was talking with 241 about his notes. He seems to think that catalog/includes/header_tags.php needs write permissions. But this file doesn't have meta data stored in it. I believe the special permissions should only be on the catalog/includes/languages/english/header_tags.php file. What do you think?

     

    any thing else you'd like to add to a roll-up package? What to look it over before I post it? I did to a new shop replace install to check the work last night.

    -todd

  17. Just to be clear, fill tags doen't fill in the products name. If that is missing, you will need to edit the product and add it. If the name disappears after you make a change, try replacing the categories file with the one in the contribution to see if the problem still occurs. I suspect there is a problem in the file causing the name to be erased.

     

    Jack

     

    Hi Jack,

     

    kirchenbauer ended up removing the Title input box when making changes to the categories.php. I think I got her fixed up.

     

    -todd

  18. I tried it will another product and it did the same

    thing (Product Name was blank), but I made

    sure that I cancelled it instead of clicking update.

     

    That's a nifty trick.

     

    *Back-up* your database to be safe.

     

    If you run the fill tags again, does the product name come back?

     

    if not...

     

    Run this SQL in phpMyAdmin:

     

    UPDATE products_description SET products_head_title_tag='', products_head_desc_tag='', products_head_keywords_tag='';

     

    This will clear all the header tags. I tested the SQL on my test store, should not be a problem.

     

    does the product name come back then?

×
×
  • Create New...