Version Notes
Magento 1.3: if you use another language than english or german, than the "Strong Identifier" attribute is named "EAN Code" in the backend. But it also works well with GTIN-8 or GTIN-14 (configurable in the global MSemantic configuration). You can rename the label of this attribute manually in the table eav_attribute (attribute_code is gr_ean).
Download this release
Release Info
Developer | Magento Core Team |
Extension | Semantium_MSemanticBasic |
Version | 1.2.6.5 |
Comparing to | |
See all releases |
Code changes from version 1.2.6.1 to 1.2.6.5
- app/code/community/Semantium/MSemanticBasic/Block/Product.php +1 -1
- app/code/community/Semantium/MSemanticBasic/Model/GoodRelations.php +107 -91
- app/code/community/Semantium/MSemanticBasic/Model/Observer.php +1 -1
- app/code/community/Semantium/MSemanticBasic/changelog.txt +14 -0
- app/code/community/Semantium/MSemanticBasic/etc/config.xml +3 -3
- app/code/community/Semantium/MSemanticBasic/sql/msemanticbasic_setup/mysql4-install-1.2.6.5.php +80 -0
- app/code/community/Semantium/MSemanticBasic/sql/msemanticbasic_setup/mysql4-upgrade-1.2.6.1-1.2.6.5.php +81 -0
- package.xml +4 -4
app/code/community/Semantium/MSemanticBasic/Block/Product.php
CHANGED
@@ -43,7 +43,7 @@ class Semantium_MSemanticBasic_Block_Product extends Mage_Catalog_Block_Product_
|
|
43 |
|
44 |
protected function _toHtml()
|
45 |
{
|
46 |
-
$html = "\n<!-- MSEMANTIC 1.2.6.
|
47 |
$html .="\n";
|
48 |
$id = Mage::registry('current_product')->getId();;
|
49 |
$product = Mage::getModel('catalog/product')->load($id);
|
43 |
|
44 |
protected function _toHtml()
|
45 |
{
|
46 |
+
$html = "\n<!-- MSEMANTIC 1.2.6.5 begin -->";
|
47 |
$html .="\n";
|
48 |
$id = Mage::registry('current_product')->getId();;
|
49 |
$product = Mage::getModel('catalog/product')->load($id);
|
app/code/community/Semantium/MSemanticBasic/Model/GoodRelations.php
CHANGED
@@ -473,8 +473,7 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
473 |
public function pOffering()
|
474 |
{
|
475 |
$productId = $this->Product->getId();
|
476 |
-
$product =
|
477 |
-
|
478 |
$statements = "";
|
479 |
$grOffering = "";
|
480 |
$statements .= $this->pOffers();
|
@@ -490,6 +489,37 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
490 |
$statements .= $this->acceptedPaymentMethods();
|
491 |
$statements .= $this->deliveryMethods();
|
492 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
$localeCode = $this->sysinfo->getLocaleCode();
|
494 |
// product name
|
495 |
$pName = $this->Product->getName();
|
@@ -504,10 +534,10 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
504 |
//$statements .= Mage::getStoreConfig('catalog/review');
|
505 |
//review stuff
|
506 |
$statements .= "
|
507 |
-
<div rel=\"foaf:maker\" resource=\"urn:goodrelations_shop_extensions:msemantic:v1.2.6.
|
508 |
$array = Mage::getStoreConfig('catalog/review');
|
509 |
-
if ($array['allow_guest'] == 1) // reviews active
|
510 |
-
|
511 |
$grOffering .= $this->rdff->wrapStatements($statements, $this->getURI('offering'), "gr:Offering");
|
512 |
$isSaleable = $this->Product->isSaleable();
|
513 |
|
@@ -533,7 +563,7 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
533 |
protected function pReview()
|
534 |
{
|
535 |
$productId = $this->Product->getId();
|
536 |
-
$product =
|
537 |
$storeId = Mage::app()->getStore()->getId();
|
538 |
|
539 |
Mage::getModel('review/review')->getEntitySummary($product, $storeId);
|
@@ -577,69 +607,79 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
577 |
$priceSpecifications = "";
|
578 |
$productId = $this->Product->getId();
|
579 |
|
580 |
-
$product =
|
581 |
$storeId = Mage::app()->getStore()->getId();
|
582 |
|
583 |
-
//check if tax is in price
|
584 |
-
$tax = Mage::helper('tax');
|
585 |
-
if ($tax->displayPriceIncludingTax()) { $propArray["gr:valueAddedTaxIncluded"] = 'true'; }
|
586 |
-
else { $propArray["gr:valueAddedTaxIncluded"] = 'false'; }
|
587 |
-
|
588 |
-
|
589 |
-
// check if special price
|
590 |
-
|
591 |
-
if ($this->Product->getSpecialPrice()) {
|
592 |
-
$propArray_reg = array(
|
593 |
-
"gr:hasCurrencyValue" => round($this->Product->getPrice(1), 2), // 1 unit
|
594 |
-
"gr:hasCurrency" => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
595 |
-
"gr:hasUnitOfMeasurement" => "C62" // price per unit
|
596 |
-
);
|
597 |
-
$propArray_special = array(
|
598 |
-
"gr:hasCurrencyValue" => round($this->Product->getSpecialPrice(1), 2), // 1 unit
|
599 |
-
"gr:hasCurrency" => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
600 |
-
"gr:hasUnitOfMeasurement" => "C62" // price per unit
|
601 |
-
);
|
602 |
-
|
603 |
-
$statements = $this->rdff->properties($propArray_special,$this->getReplacements());
|
604 |
-
|
605 |
-
if ( $this->Product->getSpecialToDate() ){
|
606 |
-
$validproperties = array(
|
607 |
-
"gr:validFrom" => $this->div->dateToIso8601( $this->Product->getSpecialFromDate() ),
|
608 |
-
"gr:validThrough" => $this->div->dateToIso8601( $this->Product->getSpecialToDate() )
|
609 |
-
);
|
610 |
-
$statements .= $this->rdff->properties($validproperties, $this->getReplacements());
|
611 |
-
}
|
612 |
-
else { $statements .= $this->validFromThrough();}
|
613 |
-
|
614 |
-
$attributes = $this->rdff->wrapStatements($statements, $this->getURI("specialUnitPriceSpecification"), "gr:UnitPriceSpecification" );
|
615 |
-
}
|
616 |
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
|
644 |
|
645 |
$priceSpecifications .= $this->rdff->wrapRel($attributes, "gr:hasPriceSpecification");
|
@@ -747,7 +787,7 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
747 |
|
748 |
|
749 |
$productId = $this->Product->getId();
|
750 |
-
$product =
|
751 |
$storeId = Mage::app()->getStore()->getId();
|
752 |
|
753 |
|
@@ -834,31 +874,7 @@ $manufacturers = $attribute->getSource()->getAllOptions(false);
|
|
834 |
|
835 |
// dawn of template style
|
836 |
|
837 |
-
// Inventory - VALID
|
838 |
-
|
839 |
-
|
840 |
-
if ($product->getTypeId() != "bundle" and $product->getTypeId() != "configurable") {
|
841 |
|
842 |
-
if ($product->getStockItem()->getManageStock())
|
843 |
-
{
|
844 |
-
|
845 |
-
$inv = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
|
846 |
-
}
|
847 |
-
else {
|
848 |
-
if ($product->isSaleable()) {/*$inv = 42;*/}
|
849 |
-
}
|
850 |
-
|
851 |
-
if (isset($inv)) {
|
852 |
-
$statements .= "
|
853 |
-
<div rel=\"gr:hasInventoryLevel\">
|
854 |
-
<div typeof=\"gr:QuantitativeValue\">
|
855 |
-
<div property=\"gr:hasMinValue\" content=\"".round($inv,0)."\" datatype=\"xsd:float\"></div>
|
856 |
-
<div property=\"gr:hasUnitOfMeasurement\" datatype=\"xsd:string\" content=\"C62\"></div>
|
857 |
-
</div>
|
858 |
-
</div>";
|
859 |
-
}
|
860 |
-
|
861 |
-
}
|
862 |
|
863 |
|
864 |
|
473 |
public function pOffering()
|
474 |
{
|
475 |
$productId = $this->Product->getId();
|
476 |
+
$product = $this->Product->load($productId);
|
|
|
477 |
$statements = "";
|
478 |
$grOffering = "";
|
479 |
$statements .= $this->pOffers();
|
489 |
$statements .= $this->acceptedPaymentMethods();
|
490 |
$statements .= $this->deliveryMethods();
|
491 |
|
492 |
+
|
493 |
+
|
494 |
+
// Inventory - VALID
|
495 |
+
|
496 |
+
|
497 |
+
if ($product->getTypeId() != "bundle" and $product->getTypeId() != "configurable") {
|
498 |
+
|
499 |
+
if ($product->getStockItem()->getManageStock())
|
500 |
+
{
|
501 |
+
|
502 |
+
$inv = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
|
503 |
+
}
|
504 |
+
else {
|
505 |
+
if ($product->isSaleable()) {/*$inv = 42;*/}
|
506 |
+
}
|
507 |
+
|
508 |
+
if (isset($inv)) {
|
509 |
+
$statements .= "
|
510 |
+
<div rel=\"gr:hasInventoryLevel\">
|
511 |
+
<div typeof=\"gr:QuantitativeValue\">
|
512 |
+
<div property=\"gr:hasMinValue\" content=\"".round($inv,0)."\" datatype=\"xsd:float\"></div>
|
513 |
+
<div property=\"gr:hasUnitOfMeasurement\" datatype=\"xsd:string\" content=\"C62\"></div>
|
514 |
+
</div>
|
515 |
+
</div>";
|
516 |
+
}
|
517 |
+
|
518 |
+
}
|
519 |
+
|
520 |
+
|
521 |
+
|
522 |
+
|
523 |
$localeCode = $this->sysinfo->getLocaleCode();
|
524 |
// product name
|
525 |
$pName = $this->Product->getName();
|
534 |
//$statements .= Mage::getStoreConfig('catalog/review');
|
535 |
//review stuff
|
536 |
$statements .= "
|
537 |
+
<div rel=\"foaf:maker\" resource=\"urn:goodrelations_shop_extensions:msemantic:v1.2.6.5\"></div>";
|
538 |
$array = Mage::getStoreConfig('catalog/review');
|
539 |
+
#if ($array['allow_guest'] == 1) // reviews active
|
540 |
+
$statements .= $this->pReview();
|
541 |
$grOffering .= $this->rdff->wrapStatements($statements, $this->getURI('offering'), "gr:Offering");
|
542 |
$isSaleable = $this->Product->isSaleable();
|
543 |
|
563 |
protected function pReview()
|
564 |
{
|
565 |
$productId = $this->Product->getId();
|
566 |
+
$product = $this->Product->load($productId);
|
567 |
$storeId = Mage::app()->getStore()->getId();
|
568 |
|
569 |
Mage::getModel('review/review')->getEntitySummary($product, $storeId);
|
607 |
$priceSpecifications = "";
|
608 |
$productId = $this->Product->getId();
|
609 |
|
610 |
+
$product = $this->Product->load($productId);
|
611 |
$storeId = Mage::app()->getStore()->getId();
|
612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
613 |
|
614 |
+
//check if tax is in price
|
615 |
+
$tax = Mage::helper('tax');
|
616 |
+
$priceIncludesTax = $tax->displayPriceIncludingTax();
|
617 |
+
|
618 |
+
if ($priceIncludesTax) $propArray["gr:valueAddedTaxIncluded"] = 'true';
|
619 |
+
else $propArray["gr:valueAddedTaxIncluded"] = 'false';
|
620 |
+
|
621 |
+
// check if special price
|
622 |
+
if ($this->Product->getSpecialPrice() && strtotime($this->Product->getSpecialToDate()) > strtotime("now")) {
|
623 |
+
|
624 |
+
// Add tax if needed
|
625 |
+
if ($priceIncludesTax) $price = $tax->getPrice($this->Product, $this->Product->getPrice(1));
|
626 |
+
else $price = $this->Product->getPrice(1);
|
627 |
+
$propArray_reg = array(
|
628 |
+
"gr:valueAddedTaxIncluded" => $propArray["gr:valueAddedTaxIncluded"],
|
629 |
+
"gr:hasCurrencyValue" => round($price, 2), // 1 unit
|
630 |
+
"gr:hasCurrency" => Mage::getStoreConfig("currency/options/default"),
|
631 |
+
"gr:hasUnitOfMeasurement" => "C62" // price per unit
|
632 |
+
);
|
633 |
+
|
634 |
+
// Add tax if needed
|
635 |
+
if ($priceIncludesTax) $price = $tax->getPrice($this->Product, $this->Product->getSpecialPrice(1));
|
636 |
+
else $price = $this->Product->getSpecialPrice(1);
|
637 |
+
$propArray_special = array(
|
638 |
+
"gr:valueAddedTaxIncluded" => $propArray["gr:valueAddedTaxIncluded"],
|
639 |
+
"gr:hasCurrencyValue" => round($price, 2), // 1 unit
|
640 |
+
"gr:hasCurrency" => Mage::getStoreConfig("currency/options/default"),
|
641 |
+
"gr:hasUnitOfMeasurement" => "C62" // price per unit
|
642 |
+
);
|
643 |
+
|
644 |
+
$statements = $this->rdff->properties($propArray_special,$this->getReplacements());
|
645 |
+
|
646 |
+
if ( $this->Product->getSpecialToDate() ){
|
647 |
+
$validproperties = array(
|
648 |
+
"gr:validFrom" => $this->div->dateToIso8601( $this->Product->getSpecialFromDate() ),
|
649 |
+
"gr:validThrough" => $this->div->dateToIso8601( $this->Product->getSpecialToDate() )
|
650 |
+
);
|
651 |
+
$statements .= $this->rdff->properties($validproperties, $this->getReplacements());
|
652 |
+
}
|
653 |
+
else { $statements .= $this->validFromThrough();}
|
654 |
+
|
655 |
+
$attributes = $this->rdff->wrapStatements($statements, $this->getURI("specialUnitPriceSpecification"), "gr:UnitPriceSpecification" );
|
656 |
+
}
|
657 |
+
|
658 |
+
|
659 |
+
else {
|
660 |
+
// pricing
|
661 |
+
if ($product->getTypeId() == "bundle") {
|
662 |
+
// get min price of bundle
|
663 |
+
$minmax = $product->getPriceModel()->getPrices($product);
|
664 |
+
$propArray["gr:hasMinCurrencyValue"] = round($minmax[0],2);
|
665 |
+
$propArray["gr:hasMaxCurrencyValue"] = round($minmax[1],2);
|
666 |
+
}
|
667 |
+
else {
|
668 |
+
// Add tax if needed
|
669 |
+
if ($priceIncludesTax) $price = $tax->getPrice($this->Product, $this->Product->getFinalPrice(1));
|
670 |
+
else $price = $this->Product->getFinalPrice(1);
|
671 |
+
$propArray["gr:hasCurrencyValue"] = round($price, 2);
|
672 |
+
}
|
673 |
+
|
674 |
+
// rest of array
|
675 |
+
$propArray["gr:hasCurrency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
676 |
+
$propArray["gr:hasUnitOfMeasurement"] = "C62";
|
677 |
+
|
678 |
+
$statements = $this->rdff->properties($propArray,$this->getReplacements());
|
679 |
+
$statements .= $this->validFromThrough();
|
680 |
+
|
681 |
+
$attributes = $this->rdff->wrapStatements($statements, $this->getURI("unitPriceSpecification"), "gr:UnitPriceSpecification" );
|
682 |
+
}
|
683 |
|
684 |
|
685 |
$priceSpecifications .= $this->rdff->wrapRel($attributes, "gr:hasPriceSpecification");
|
787 |
|
788 |
|
789 |
$productId = $this->Product->getId();
|
790 |
+
$product = $this->Product->load($productId);
|
791 |
$storeId = Mage::app()->getStore()->getId();
|
792 |
|
793 |
|
874 |
|
875 |
// dawn of template style
|
876 |
|
|
|
|
|
|
|
|
|
877 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
878 |
|
879 |
|
880 |
|
app/code/community/Semantium/MSemanticBasic/Model/Observer.php
CHANGED
@@ -25,7 +25,7 @@ class Semantium_MSemanticBasic_Model_Observer
|
|
25 |
protected function notifySWSE($submission_url="http://gr-notify.appspot.com/submit?uri=") {
|
26 |
$email = Mage::getStoreConfig('trans_email/ident_general/email');
|
27 |
$base_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
28 |
-
$sitemap_url = $submission_url.$base_url."sitemap.xml"."&contact=".$email."&agent=msemantic-1.2.6.
|
29 |
$this->_httpGet($sitemap_url);
|
30 |
}
|
31 |
|
25 |
protected function notifySWSE($submission_url="http://gr-notify.appspot.com/submit?uri=") {
|
26 |
$email = Mage::getStoreConfig('trans_email/ident_general/email');
|
27 |
$base_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
28 |
+
$sitemap_url = $submission_url.$base_url."sitemap.xml"."&contact=".$email."&agent=msemantic-1.2.6.5";
|
29 |
$this->_httpGet($sitemap_url);
|
30 |
}
|
31 |
|
app/code/community/Semantium/MSemanticBasic/changelog.txt
CHANGED
@@ -1,6 +1,20 @@
|
|
1 |
Changelog:
|
2 |
***************
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
1.2.6.1
|
5 |
|
6 |
* feature:
|
1 |
Changelog:
|
2 |
***************
|
3 |
|
4 |
+
1.2.6.5 (1.2.7 beta)
|
5 |
+
* features:
|
6 |
+
improved getprice code
|
7 |
+
loading of products more efficient
|
8 |
+
added configuration instruction to http://semantium.de/msemantic/readme.html
|
9 |
+
|
10 |
+
* bugfixes:
|
11 |
+
outdated special prices fixed
|
12 |
+
reviews show also if config to registered only
|
13 |
+
missing inventory levels in Google Rich Snippets Testing Tool: inventory level now attachted to offering instead of TypeAndQuantityNode
|
14 |
+
removed now obsolete dump.rdf section in readme
|
15 |
+
Use standard display currency instead of base currency
|
16 |
+
|
17 |
+
|
18 |
1.2.6.1
|
19 |
|
20 |
* feature:
|
app/code/community/Semantium/MSemanticBasic/etc/config.xml
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
<config>
|
14 |
<modules>
|
15 |
<Semantium_MSemanticBasic>
|
16 |
-
<version>1.2.6.
|
17 |
<depends>
|
18 |
<Mage_Page />
|
19 |
</depends>
|
@@ -142,13 +142,13 @@
|
|
142 |
|
143 |
<crontab>
|
144 |
<jobs>
|
145 |
-
<
|
146 |
<!-- daily at 1:00 am -->
|
147 |
<schedule><cron_expr>0 1 * * *</cron_expr></schedule>
|
148 |
<run>
|
149 |
<model>msemanticbasic/observer::submitSemanticWebData</model>
|
150 |
</run>
|
151 |
-
</
|
152 |
</jobs>
|
153 |
</crontab>
|
154 |
|
13 |
<config>
|
14 |
<modules>
|
15 |
<Semantium_MSemanticBasic>
|
16 |
+
<version>1.2.6.5</version>
|
17 |
<depends>
|
18 |
<Mage_Page />
|
19 |
</depends>
|
142 |
|
143 |
<crontab>
|
144 |
<jobs>
|
145 |
+
<catalog_grnotify_ping>
|
146 |
<!-- daily at 1:00 am -->
|
147 |
<schedule><cron_expr>0 1 * * *</cron_expr></schedule>
|
148 |
<run>
|
149 |
<model>msemanticbasic/observer::submitSemanticWebData</model>
|
150 |
</run>
|
151 |
+
</catalog_grnotify_ping>
|
152 |
</jobs>
|
153 |
</crontab>
|
154 |
|
app/code/community/Semantium/MSemanticBasic/sql/msemanticbasic_setup/mysql4-install-1.2.6.5.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MSemanticBasic Magento Extension
|
4 |
+
* @package Semantium_MSemanticBasic
|
5 |
+
* @copyright (c) 2010 Semantium, Uwe Stoll <stoll@semantium.de>
|
6 |
+
* @author Michael Lambertz <michael@digitallifedesign.net>
|
7 |
+
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
8 |
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
9 |
+
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
10 |
+
**/
|
11 |
+
$installer = $this;
|
12 |
+
|
13 |
+
$installer->installEntities();
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
// perform HTTP GET on endpoint with given URL
|
18 |
+
function _semantiumMsemanticInstallHttpGet($url)
|
19 |
+
{
|
20 |
+
// file operations are allowed
|
21 |
+
if (ini_get('allow_url_fopen') == '1') {
|
22 |
+
$str = file_get_contents($url);
|
23 |
+
if($str === false) {
|
24 |
+
$http_status_code = "";
|
25 |
+
for($i=0; $i<count($http_response_header); $i++)
|
26 |
+
{
|
27 |
+
if(strncasecmp("HTTP", $http_response_header[$i], 4)==0)
|
28 |
+
{
|
29 |
+
// determine HTTP response code
|
30 |
+
$http_status_code = preg_replace("/^.{0,9}([0-9]{3})/i", "$1", $http_response_header[$i]);
|
31 |
+
break;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
echo "<p class=\"error\">Submission failed: ".$http_status_code."</p>";
|
35 |
+
}
|
36 |
+
return $str;
|
37 |
+
}
|
38 |
+
// file operations are disallowed, try it like curl
|
39 |
+
else {
|
40 |
+
$url = parse_url($url);
|
41 |
+
$port = isset($url['port'])?$url['port']:80;
|
42 |
+
|
43 |
+
$fp = fsockopen($url['host'], $port);
|
44 |
+
|
45 |
+
if(!$fp) {
|
46 |
+
echo "<p class=\"error\">Cannot retrieve $url</p>";
|
47 |
+
return false;
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
// send the necessary headers to get the file
|
51 |
+
fwrite($fp, "GET ".$url['path']."?".$url['query']." HTTP/1.0\r\n".
|
52 |
+
"Host:". $url['host']."\r\n".
|
53 |
+
"Accept: text/html\r\n".
|
54 |
+
"User-Agent: GoodRelations Extension for Joomla v2\r\n".
|
55 |
+
"Connection: close\r\n\r\n");
|
56 |
+
|
57 |
+
// retrieve response from server
|
58 |
+
$buffer = "";
|
59 |
+
$status_code_found = false;
|
60 |
+
$is_error = false;
|
61 |
+
while($line = fread($fp, 4096))
|
62 |
+
{
|
63 |
+
$buffer .= $line;
|
64 |
+
if(!$status_code_found && ($pos=strpos($line, "HTTP"))>=0) {
|
65 |
+
// extract HTTP response code
|
66 |
+
$response = explode("\n", substr($line, $pos));
|
67 |
+
$http_status_code = preg_replace("/^.{0,9}([0-9]{3})/i", "$1", $response[0]);
|
68 |
+
$is_error = !preg_match("/(200|406)/i", $http_status_code); // accepted status codes not resulting in error are 200 and 406
|
69 |
+
$status_code_found = true;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
fclose($fp);
|
73 |
+
|
74 |
+
$pos = strpos($buffer,"\r\n\r\n");
|
75 |
+
if($is_error)
|
76 |
+
echo "<p class=\"error\">Submission failed: ".$http_status_code."</p>";
|
77 |
+
return substr($buffer,$pos);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
app/code/community/Semantium/MSemanticBasic/sql/msemanticbasic_setup/mysql4-upgrade-1.2.6.1-1.2.6.5.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MSemanticBasic Magento Extension
|
4 |
+
* @package Semantium_MSemanticBasic
|
5 |
+
* @copyright (c) 2010 Semantium, Uwe Stoll <stoll@semantium.de>
|
6 |
+
* @author Michael Lambertz <michael@digitallifedesign.net>
|
7 |
+
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
|
8 |
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
9 |
+
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
10 |
+
**/
|
11 |
+
$installer = $this;
|
12 |
+
|
13 |
+
|
14 |
+
$installer->installEntities();
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
// perform HTTP GET on endpoint with given URL
|
19 |
+
function _semantiumMsemanticInstallHttpGet($url)
|
20 |
+
{
|
21 |
+
// file operations are allowed
|
22 |
+
if (ini_get('allow_url_fopen') == '1') {
|
23 |
+
$str = file_get_contents($url);
|
24 |
+
if($str === false) {
|
25 |
+
$http_status_code = "";
|
26 |
+
for($i=0; $i<count($http_response_header); $i++)
|
27 |
+
{
|
28 |
+
if(strncasecmp("HTTP", $http_response_header[$i], 4)==0)
|
29 |
+
{
|
30 |
+
// determine HTTP response code
|
31 |
+
$http_status_code = preg_replace("/^.{0,9}([0-9]{3})/i", "$1", $http_response_header[$i]);
|
32 |
+
break;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
echo "<p class=\"error\">Submission failed: ".$http_status_code."</p>";
|
36 |
+
}
|
37 |
+
return $str;
|
38 |
+
}
|
39 |
+
// file operations are disallowed, try it like curl
|
40 |
+
else {
|
41 |
+
$url = parse_url($url);
|
42 |
+
$port = isset($url['port'])?$url['port']:80;
|
43 |
+
|
44 |
+
$fp = fsockopen($url['host'], $port);
|
45 |
+
|
46 |
+
if(!$fp) {
|
47 |
+
echo "<p class=\"error\">Cannot retrieve $url</p>";
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
// send the necessary headers to get the file
|
52 |
+
fwrite($fp, "GET ".$url['path']."?".$url['query']." HTTP/1.0\r\n".
|
53 |
+
"Host:". $url['host']."\r\n".
|
54 |
+
"Accept: text/html\r\n".
|
55 |
+
"User-Agent: GoodRelations Extension for Joomla v2\r\n".
|
56 |
+
"Connection: close\r\n\r\n");
|
57 |
+
|
58 |
+
// retrieve response from server
|
59 |
+
$buffer = "";
|
60 |
+
$status_code_found = false;
|
61 |
+
$is_error = false;
|
62 |
+
while($line = fread($fp, 4096))
|
63 |
+
{
|
64 |
+
$buffer .= $line;
|
65 |
+
if(!$status_code_found && ($pos=strpos($line, "HTTP"))>=0) {
|
66 |
+
// extract HTTP response code
|
67 |
+
$response = explode("\n", substr($line, $pos));
|
68 |
+
$http_status_code = preg_replace("/^.{0,9}([0-9]{3})/i", "$1", $response[0]);
|
69 |
+
$is_error = !preg_match("/(200|406)/i", $http_status_code); // accepted status codes not resulting in error are 200 and 406
|
70 |
+
$status_code_found = true;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
fclose($fp);
|
74 |
+
|
75 |
+
$pos = strpos($buffer,"\r\n\r\n");
|
76 |
+
if($is_error)
|
77 |
+
echo "<p class=\"error\">Submission failed: ".$http_status_code."</p>";
|
78 |
+
return substr($buffer,$pos);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Semantium_MSemanticBasic</name>
|
4 |
-
<version>1.2.6.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/lgpl.html">GNU/LGPL</license>
|
7 |
<channel>community</channel>
|
@@ -18,9 +18,9 @@ The following ressources emphasize the positive outcome of using GoodRelations:
|
|
18 |
* How To Get Ranked Without Resorting to Outdated SEO Tactics [http://www.solutions-answers-results.com.au/index.php/Ways-to-Improve-Your-Website/How-To-Get-Ranked-Without-Resorting-to-Outdated-SEO-Tactics.html]</description>
|
19 |
<notes>Magento 1.3: if you use another language than english or german, than the "Strong Identifier" attribute is named "EAN Code" in the backend. But it also works well with GTIN-8 or GTIN-14 (configurable in the global MSemantic configuration). You can rename the label of this attribute manually in the table eav_attribute (attribute_code is gr_ean).</notes>
|
20 |
<authors><author><name>Uwe Stoll (Semantium)</name><user>auto-converted</user><email>stoll@semantium.de</email></author></authors>
|
21 |
-
<date>2012-
|
22 |
-
<time>
|
23 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Semantium_MSemanticBasic.xml" hash="3eb345a90c04b8804822c9636b7d7555"/></dir></target><target name="magecommunity"><dir name="Semantium"><dir name="MSemanticBasic"><dir name="Block"><file name="Business.php" hash="164ff85e939eac555bc06584c733eb2d"/><file name="Datadump.php" hash="66ff7727bfdc279382d4f55ffa6d5891"/><file name="Product.php" hash="
|
24 |
<compatible/>
|
25 |
<dependencies/>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Semantium_MSemanticBasic</name>
|
4 |
+
<version>1.2.6.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/lgpl.html">GNU/LGPL</license>
|
7 |
<channel>community</channel>
|
18 |
* How To Get Ranked Without Resorting to Outdated SEO Tactics [http://www.solutions-answers-results.com.au/index.php/Ways-to-Improve-Your-Website/How-To-Get-Ranked-Without-Resorting-to-Outdated-SEO-Tactics.html]</description>
|
19 |
<notes>Magento 1.3: if you use another language than english or german, than the "Strong Identifier" attribute is named "EAN Code" in the backend. But it also works well with GTIN-8 or GTIN-14 (configurable in the global MSemantic configuration). You can rename the label of this attribute manually in the table eav_attribute (attribute_code is gr_ean).</notes>
|
20 |
<authors><author><name>Uwe Stoll (Semantium)</name><user>auto-converted</user><email>stoll@semantium.de</email></author></authors>
|
21 |
+
<date>2012-05-02</date>
|
22 |
+
<time>11:37:13</time>
|
23 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Semantium_MSemanticBasic.xml" hash="3eb345a90c04b8804822c9636b7d7555"/></dir></target><target name="magecommunity"><dir name="Semantium"><dir name="MSemanticBasic"><dir name="Block"><file name="Business.php" hash="164ff85e939eac555bc06584c733eb2d"/><file name="Datadump.php" hash="66ff7727bfdc279382d4f55ffa6d5891"/><file name="Product.php" hash="d5776fd82ceb8ee379f1bdaf8275e22c"/><file name="Thanks.php" hash="5039b62205679115ebef99b34192df0a"/></dir><dir name="controllers"><file name="IndexController.php" hash="2d014e2316ba23adb1be2e0821a126ea"/></dir><dir name="etc"><file name="config.xml" hash="b80090aff414d63266d61c6ca506db2f"/><file name="system.xml" hash="e708829b17a24c7bc68d6162fcec5dd0"/></dir><dir name="Helper"><file name="AbstractFormat.php" hash="389d775df5b90a9b960a52906fed6f78"/><file name="Data.php" hash="fc2043acb2695b5304e9b762831cd208"/><file name="Div.php" hash="eec533dee2be1f0469a15fefb5d06330"/><file name="Rdfaformat.php" hash="d69598a270dc2f5e1118456c8f16b254"/><file name="Rdfformat.php" hash="d7718fdca1c77e92668c6a3a3f76bdbd"/><file name="Sysinfo.php" hash="3edac7805c663bd0d82ba85714a39dfb"/></dir><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="a39d88f13dae76082a009743e368aa3f"/></dir></dir></dir><dir name="Source"><file name="Strongid.php" hash="13d8833eee26a5f8b870b65f44b4ce0b"/><file name="Valid.php" hash="650c03155a9a8797514fb7e596929d15"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Product"><file name="Attributes.php" hash="b6f58c1b5737686f7b47796e12e1084c"/></dir></dir></dir></dir><file name="Business.php" hash="678c1a77374b33707bacb5ce57c6afc9"/><file name="GoodRelations.php" hash="bb97156fe8d6970f12ec196b41aa32ca"/><file name="Observer.php" hash="e32bcd03050972775f4f765094783364"/><file name="RDFs.php" hash="f7f73eb5d812195156f5f7c2143f1636"/><file name="VCard.php" hash="a697c5fd451fdf62f8317aae70b5c84c"/></dir><dir name="sql"><dir name="msemanticbasic_setup"><file name="mysql4-install-0.8.0.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.8.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.8.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.8.3.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.8.4.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.8.5.php" hash="810144e6e3eff6073895b501ecee97f2"/><file name="mysql4-install-0.8.6.php" hash="810144e6e3eff6073895b501ecee97f2"/><file name="mysql4-install-0.9.0.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.4.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.5.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.6.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.7.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.8.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.9.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.9.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-0.9.9.3.1 copy 1.php" hash="e5ef3335b06dbb07829a63dd17db3c6c"/><file name="mysql4-install-0.9.9.3.1.php" hash="e5ef3335b06dbb07829a63dd17db3c6c"/><file name="mysql4-install-0.9.9.3.2.php" hash="ae7bacad38ef06f8f12e61f943bf17f7"/><file name="mysql4-install-0.9.9.3.3.php" hash="d2210860f97c46faf1b1c758f1c3530f"/><file name="mysql4-install-0.9.9.3.4.php" hash="745c332d15adbf5d5c92fab04e993f1b"/><file name="mysql4-install-0.9.9.3.5.php" hash="d6eda2c6f7495fd6397c7519c0f06830"/><file name="mysql4-install-0.9.9.3.6.php" hash="694b9cfce33213193099a51735efe79e"/><file name="mysql4-install-0.9.9.3.7.php" hash="67d9edfb0a91a4ad863dfeb95101cdbe"/><file name="mysql4-install-0.9.9.3.8.php" hash="dc41a32c350b609eeb8010e825ab6b0e"/><file name="mysql4-install-0.9.9.3.9.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-0.9.9.3.php" hash="d6a89aab9e44aa47478744ad2c9ae6c4"/><file name="mysql4-install-0.9.9.4.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-0.9.9.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-install-1.1.0.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.1.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.2.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.3.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.4.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.5.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.6.1.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.6.5.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-install-1.2.6.php" hash="9d4c7920ded55142506596e87fac901f"/><file name="mysql4-upgrade-0.8.0-0.8.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.8.1-0.8.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.8.2-0.8.3.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.8.3-0.8.4.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.8.4-0.9.0.php" hash="810144e6e3eff6073895b501ecee97f2"/><file name="mysql4-upgrade-0.9.0-0.9.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.1-0.9.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.2-0.9.4.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.4-0.9.5.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.5-0.9.6.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.6-0.9.7.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.7-0.9.8.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.8-0.9.9.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.9-0.9.9.1.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.9.1-0.9.9.2.php" hash="24bb680b77c72bd957d8e941e1c02c07"/><file name="mysql4-upgrade-0.9.9.2-0.9.9.3.php" hash="6a75f3ece98e56356dca07548d69d29b"/><file name="mysql4-upgrade-0.9.9.3-0.9.9.3.1.php" hash="c5a452e2646b50fb576cfe305f659434"/><file name="mysql4-upgrade-0.9.9.3.1-0.9.9.3.2.php" hash="6dc3aa90d38ec7ad92d804094ef6f4ab"/><file name="mysql4-upgrade-0.9.9.3.2-0.9.9.3.3.php" hash="e123ae7f0c214e4044e5dac17f3be7d8"/><file name="mysql4-upgrade-0.9.9.3.3-0.9.9.3.4.php" hash="745c332d15adbf5d5c92fab04e993f1b"/><file name="mysql4-upgrade-0.9.9.3.4-0.9.9.3.5.php" hash="bddd63eedc4e81ecd25c63995782891d"/><file name="mysql4-upgrade-0.9.9.3.5-0.9.9.3.6.php" hash="6b057032af23dd1937a0314593c0e457"/><file name="mysql4-upgrade-0.9.9.3.6-0.9.9.3.7.php" hash="6b057032af23dd1937a0314593c0e457"/><file name="mysql4-upgrade-0.9.9.3.7-0.9.9.3.8.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-0.9.9.3.9-0.9.9.4.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.1.1-1.2.2.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.1.2-1.2.3.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.3-1.2.4.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.5-1.2.6.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.6-1.2.6.1.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="mysql4-upgrade-1.2.6.1-1.2.6.5.php" hash="b93259ef17eb9ea97b9d153001eb5f57"/><file name="script.sh" hash="0168886ab4f6a6c2658fada0f5ff3727"/></dir></dir><file name="changelog.txt" hash="cfa5ab5608430a3056af16c9013e3427"/></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Semantium_MSemanticBasic.csv" hash="a4bfc26d36e33d5c9ed00da83fa8f99c"/></dir><dir name="en_GB"><file name="Semantium_MSemanticBasic.csv" hash="a4bfc26d36e33d5c9ed00da83fa8f99c"/></dir><dir name="en_US"><file name="Semantium_MSemanticBasic.csv" hash="a4bfc26d36e33d5c9ed00da83fa8f99c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="msemanticbasic.xml" hash="47f8ae8742ea9cb25be73e711d6dfa64"/></dir><dir name="template"><dir name="semantium"><file name="dump.phtml" hash="26ff96865f95e91ee5d5596a30fea112"/></dir></dir></dir></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies/>
|
26 |
</package>
|