Jump to content

amhazing

Members
  • Content count

    17
  • Joined

  • Last visited

1 Follower

About amhazing

  • Birthday 04/01/1980

Profile Information

  • Real Name
    Amazing H
  • Location
    Australia
  • Website
  1. amhazing

    Contrib Installer

    Good news - I've created a CIP Builder and created a CIP of it. CIP Builder automatically creates the install.xml file based on a standard way of harvesting contrib data that can be automatically created using winmerge to create patch / diff data (google it). That and a little bit of MS Word Find and Replace. Given the number of contribs I need to get working together I've put a lot of info together on the standard way of creating a CIP from contribs and the tools to use to speed the process up and get it right I work in a windows XP environment though so will have to leave it to the community to mod for Linux.. Putting the doco together and will upload shortly. The CIP has a couple of bugs that I need help with :) (for instance I think there's issues with line breaks and find code in 1.0.16 with Addcode and I'm pulling my hair out ..) Update soon.. HL
  2. amhazing

    Contrib Installer

    Thanks Vlad! Much easier to download! Uploaded and clicked Install and got error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/eat/public_html/catalog/admin/includes/classes/ci_tag.class.php on line 426 Environment Details: Server OS: Linux 2.4.21-37.ELsmp Database: MySQL 4.1.21-standard HTTP Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_jk/1.2.14 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a PHP-CGI/0.1b PHP Version: 4.4.2 (Zend: 1.3.0) I'm working with version 1.0.16 for the moment. Assuming that the XML format will be the same for future versions so shouldn't be too much of an issue.
  3. amhazing

    Contrib Installer

    Wasn't sure how that command above would work but I typed in into the command prompt on my Win XP machine and it actually worked.. Then had to work out where it had put the files :) (I think I must have installed CVS at some stage! or is it part of XP these days??) After that had some problems with it that I reported at vlad's contrib installer support site cip.net.ua that could be PHP4 issues (PHP5 has better object support apparently) I've got a major OSC baseline rebuild project to create an online Enrolment and Attainment Tracking (EAT)system so will be doing a lot of testing and package creation because if I'm going to go to the trouble of installing and compatibility testing and fixing 50 or so standard contribs I want to be able to easily manage and maintain it.. wish me luck :) regards, HL
  4. amhazing

    Contrib Installer

    Hi Vlad, Got this from the moderators :) regards the fact that I added the CIP to the original tabs project. ------------------------- Hello Harry, On the 13th of February you uploaded a contribution addition for Category Tabs. As this is a CIP addition it is meant to be published with the Contrib Installer contribution itself. I have disabled the CIP addition within the Category Tabs contribution so you should upload it again inside the Contrib Installer contribution. Also please add the GPL license and some installation instructions. Kind regards, The osCommerce Contribution Moderators Team --------------------------- Which got me thinking... Contrib Installer is almost a project in itself - I say this because I'm about to go through and create my standard baseline using contrib installer and would intend on creating installers for each of my favourite projects and I'd like to share them, but you're not going to want 15 (or a lot more) CIPs cluttering up the CI project area so I don't agree with the moderators perspective on this one :) I'm happy to put up the hosting space for a project site if you like. One of the things to look at is running a seperate forum on the project so that we can unclutter this thread :) we really need topics areas for installation seperated from CIPs seperate from announcements. A FAQ would be handy. Am happy to setup and help moderating the site if you want.. if you've got a spare domain name point it at ns1.amhazing.com.au and ns2.amhazing.com.au - let me know the domain name and I'll setup a site. Otherwise I can do it as ci.amhazing.com.au (would prefer neutral name though since it's an open source project..) Source forge is the other option.. Comments, suggestions? regards, Harry
  5. amhazing

    Contrib Installer

    Walkthrough of creating a CIP (contrib installer package) I was looking for an idea of how hard it would be to create an install package but couldn't see any comments so I did one to find out and took some notes.. NOTE: version 1.0.14 of contrib installer doesn't work for me so I'm using 1.0.13 instead.. To give you a quick overview: the Installation package is a directory that is the name of the install. Inside this directory there is a directory called catalog in which we put the new files that will be uploaded. There is then an XML file describing the package in the root of the install package directory.. The XML file does the following :- * files to be added (which are stored in catalog directory) * code to be added to a particular file * code to be replaced in a particular file and what to be replaced with. [ and in more complicated versions does SQL ] The first part of the XML file is descriptive information: It includes: Description * Details: - conrib_ref, forum_ref, contrib_type, status, last_update * Comments * Credits The rest of the XML file details the installation using these: * findreplace:- file name, find, replace, originallinenumbers start/end * addcode:- file name, find, add, findlinenumbers start/end * addfile:- filename (and SQL too) I noticed ![CDATA[ ]] gets used alot - it's for enabling the script to easily deal with special characters without lots of escape characters from what the previous posts have said.. I chose to do the category tabs v 1.3 contrib because I'd done it the old fashioned way and knew it was pretty straight forward. (no SQL!!) You can find the contrib here: http://www.oscommerce.com/community/contri...h,category+tabs This is what happened as I went through the process of creating a "CIP": I started with the xml file.. (seemed like a good idea) The top of the file is pretty straight forward - based on the info in the contrib page I created: <contrib> <description> <details contrib_ref="751" forum_ref="00" contrib_type="Features" status="0" last_update="30 Jan 2003" /> <comments>This feature displays the main categories as a set of tabs in the header. A search box was also added to the header. The tabs are generated dynamically and use transparent gifs for the tab corners. As a result, the tab color, highlighted color and text properties can be controlled from the stylesheet. When you are on a main category the tab will be highlighted as long as you are in that category or any of it's subcategories.</comments> <credits>B?rkur Ingi J?nsson and Paul Marshall with CIP by amhazing.com.au</credits> </description> I had a guess about 751 and had no idea about a forum ref and I think it's of type Features.. but since this stuff won't stop it working don't really care too much :) Okay so now look at the install.txt that comes with the category tabs v 1.3 contrib to find out how to build it: Install.txt (cat tabs) "STEP 1 - Backup STEP 2 - Backup" - yep pay attention to these! - I have a read only copy of the 2.2ms2 05113 CATALOG directory ready just in case and did a backup through the tools menu of the admin panel so I'm right to go! "STEP 3. Copy the categories_tab.php file to the catalog/includes directory." I implement this for contrib installer as follows: <addfile> <file name="includes/categories_tab.php" /> </addfile> and I create a directory in the CIP folder catalog called "includes" into which I copy the required file.. "Step 4. Copy the images, trans_corner_left.gif an dtrans_corner_right.gif to the catalog/images/ directory." same sort of thing again.. becomes this in the CIP XML file: <addfile> <file name="images/trans_corner_left.gif" /> </addfile> <addfile> <file name="images/trans_corner_right.gif" /> </addfile> and create a directory called images in catalog and copy images into it.. "Step 5. Open catalog/stylesheet.css, add the folowing at the bottom of the page...." so this would be an add to file. to add to file I need the following information: * addcode:- file name, find, add, findlinenumbers start/end now we want to put this at the end of the file.. so I go and look at my master copy of OSCommerce and find that this is at the end of the file: /* input requirement */ .inputRequirement { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; } between lines 287 and 291 this would translate into: <addcode> <file name="catalog/stylesheet.css" /> <find><![CDATA[/* input requirement */ .inputRequirement { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; }]]></find> <add><![CDATA[ TD.tab { background-color: Navy; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: smaller; } A.tab { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: 10px; color: #ffffff; text-decoration : none; } A.tab:hover { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: 10px; color: #ffcc00; text-decoration : none; } TD.ontab { background-color: #6699ff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: smaller; color: #ffffff; } A.headerLink { background-color: #ffffff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: smaller; color: #000099; text-decoration : none; } A.headerLink:hover { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: smaller; color: #99ccff; text-decoration : none; } A.ontab { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: smaller; color: #3184B5; text-decoration : none; } ]]></add> <findlinenumbers start="287" end="291"/> </addcode> and now last step is: "Step 6. Open catalog/includes/header.php, On or about line 54, replace: <td align="right" valign="bottom"> ...snip... </a>'; ?>??</td> with: <td align="right" valign="top"> ...snip... </td> which seems to be obviously an example of find and replace facility.. format for that is: * findreplace:- file name, find, replace, originallinenumbers start/end so this would look like: <findreplace> <file name="includes/header.php" /> <find><![CDATA[ <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>??<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>??<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>??</td> ]]></find> <replace><![CDATA[ <td align=right" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right"> <tr> <td height="40" align="right" valign="top"><form name="quick_find" method="get" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false);?>"> <input type="text" name="keywords" size="30" maxlength="40" value="<?php echo htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords]));?>"> ?<?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);?></form> </td> <td height="40" align="right" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>??<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>??<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>?? </td> </tr> <tr> <td colspan="2" align="center" valign="bottom" nowrap> <?php include(DIR_WS_INCLUDES . 'categories_tab.php'); ?> </td> </tr> </table> </td> ]]></replace> <originallinenumbers start="54" end="65" /> </findreplace> I used a pretty wide range of 54 to 66 - I checked my master copy of Catalog (MS2.2) and the line appears at about line 57 so I think I'm pretty safe with this line number range. And that's it apart from the closing </contrib> tag.. now to test it.. I call the folder that holds the catalog and XML file "category tabs ver 1.3" (turns out that's where the installer gets the name of the contrib from I think) I ftp up the folder into the catalog/admin/contributions folder (which is what I called it at installation) I go to the admin page catalog/admin click on the tools menu on the left click on contrib installer that is at the top. click on category tabs ver 1.3 in the list of contribs available click on install It responds with an error message: (addcode #1) Can't read file: /home/dadsboat/public_html/catalog/catalog/stylesheet.css which makes sense because I've stuffed up :) first addcode should have been: <addcode> <file name="stylesheet.css" /> instead of catalog/stylesheet.css I fix it and reupload the XML file.. It then comes up with: Couldn't find (findreplace #1) in the file: /home/dadsboat/public_html/catalog/includes/header.php I try removing extra spaces at start and end - no joy I then go to my master copy (that I prepared earlier!!), find the text (line 58) and copy my version of that text instead of the one that came with the contrib. because when I do a find for their version of the text in crimson editor (what I'm using to edit my php files..) in my master copy of CATALOG (MS2.2 SP051113) I don't find their version of the text. I upload the changed install.xml, go back to the installer page and click update.. and it works!!! But does it work?? go to my site front page.. to find it's put: /* Begin category tabs ver 1.3 - installed by Contrib_Installer */ /* End category tabs ver 1.3 - installed by Contrib_Installer */ at the top of the page!! hmm.. what now you say?? I guess I have to hack the contrib_installer to remove the add comments facility :) or if in doubt read the manual :) (from 1.0.14 - which I'm not using but has a manual that helps) ----------------------- When we modify any file by adding some code we wrap this code with comments. When inserted code is a php-code we add comments like /* Begin ....*/ ... (code) /* End ....*/ This is default behaviour. The same result you will get if write: <replace type="php"> <add type="php"> - php-comments If you insert code into HTML code you should write: <add type="html"> <replace type="html"> - will use html-comments Comments will be like this: <!-- Begin .... --> ... (code) <!-- End ....--> This means that if you are trying to modify mixed (html and php) code you will get in problems. Solution: splite inserted code in two parts - html-part and php-part and modify them separatly. ------------------- AAHHH - so I need to go <replace type="html"> to get the comments to show properly in HTML.. Okay, replaced the tag but what do I do - I've installed the package already.. try to do update - it gives an error message. okay so do remove.. it seems to do something. oh well - click contrib installer on tools menu at left and it looks like it's not installed any more.. so I'll reinstall it .. hmm.. click remove, it says removed.. click install again... Couldn't find (findreplace #1) in the file: /home/dadsboat/public_html/catalog/includes/header.php okay.. so lets try the old fashioned repair method of overwriting header.php with the master catalog version.. yay.. shop starts working again (stops complaining about header.php problem..) okay so go through install process with my updated install files.. yay .. looks good!! okay - now the real test - removal! go to contrib installer in tools menu, click item and click remove.. test front - all seems okay!! great!! I'll play with the shop a bit to make sure nothing is broken, do a few orders etc and then I'll move on to the next contrib, maybe something with SQL in it? perhaps I'll look at repairing admin access?? which seems to be broken - I'll post the results of my fault finding on that one next... regards, amhazing Harry
  6. amhazing

    Contrib Installer

    Try version 1.0.13 instead. I had the same problem with 1.0.14 but 1.0.13 came through :) having said that I've gotten all products to install but admin access has problems ... Good luck! amhazing
  7. amhazing

    Contrib Installer

    I rolled back to version 0.5d and it works - after that point I start getting the SQL error above. Comments on installation of 0.5d: I found I had to change /catalog/admin/contrib_installer.php: if($addfile[0]) { for($loop_index = 0; $loop_index < count($addfile) - 1; $loop_index++) { $output .= "<div class=\"section\"><font class=\"section-title\">".COPYING_TO_TEXT."</font>" . DIR_FS_CATALOG . $addfile[$loop_index]['FILE']['@']['NAME'] . "<br>"; if(!copy(MODULE_CONTRIB_INSTALLER_DIR_FS_CONTRIBUTIONS . $_GET["contrib"] . '/catalog/' . $addfile[$loop_index]['FILE']['@']['NAME'], DIR_FS_CATALOG . $addfile[$loop_index]['FILE']['@']['NAME'])) error (COULDNT_COPY_TO_TEXT. $addfile[$loop_index]['FILE']['@']['NAME'], $output . '</div>'); chmod(DIR_FS_CATALOG . $addfile[$loop_index]['FILE']['@']['NAME'], 0755); $output .= "</div>"; } } Specifically Line 534 to chmod of 0755 (rather than 0644) was needed on my server for the "all products" contrib to work (still working on the admin contrib) The other thing was that the install process suggests the wrong folder location for contributions (had to change it to catalog/admin/contributions rather than catalog/contributions) this gets fixed in latter versions.. regards, Harry
  8. amhazing

    Contrib Installer

    actually I missed the spelling mistake - when I fixed the spelling mistake it came good and passed the check. regards, Harry
  9. amhazing

    Contrib Installer

    Same problem here too - was there ever a fix posted? I'm trying to install for the first time on a CPANEL/FANTASTICO install of OSCommerce ms2.2 with security patch 051113 Server Specs: PHP version 4.4.0 MySQL version 4.1.13-standard cPanel Build 10.8.1-RELEASE 30 I did do the check and it came up with no table so I'm guessing something fell over in the database installation section of the initial install. I'll keep working on it. Great Contrib by the way guys - really hope I can get it to work! regards, Harry
  10. amhazing

    dob dropdown

    Neat Contrib - thanks for the quick fix to a standard problem!! regards, HL
  11. amhazing

    Customers extra fields

    Thanks for wrapping up your cross post - helped me solve an ongoing problem :) unrelated to the contrib GREAT CONTRIB BY THE WAY KIT!!! Any plans for adding extra data types :) regards, HL
×