Double Posts FTW !
Soo, I've spent the last X number of hours filling my store and making it beautiful only to realize that I'm running into a deal breaker.
I'm having trouble with this code:
<?php
// Original Virtuemart Code:
// $Itemid = "&Itemid=".$this->getShopItemid();
// VM-Expert Hack – Start
// Strip the parameters from the $text variable and parse to a temporary array
$tmp_text=str_replace('amp;','',substr($text,strpos($text,'?')));
if(substr($tmp_text,0,1)=='?') $tmp_text=substr($tmp_text,1);
parse_str($tmp_text,$ii_arr);
// Init the temp. Itemid
$tmp_Itemid='';
$db = new ps_DB;
// Check if there is a menuitem for a product_id (highest priority)
if ($ii_product_id=intval($ii_arr['product_id'])) {
$db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%product_id=$ii_product_id%' AND published=1");
if( $db->next_record() ) $tmp_Itemid = $db->f("id");
}
// Check if there is a menuitem for a category_id
$ii_cat_id=intval($ii_arr['category_id']);
if ( $ii_cat_id && $tmp_Itemid=='') {
$db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%category_id=$ii_cat_id%' AND published=1");
if( $db->next_record() ) $tmp_Itemid = $db->f("id");
}
// Check if there is a menuitem for a flypage
$ii_flypage=$ii_arr['flypage'];
if ($ii_flypage && $tmp_Itemid=='') {
$db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%flypage=$ii_flypage%' AND published=1");
if( $db->next_record() ) $tmp_Itemid = $db->f("id");
}
// Check if there is a menuitem for a page
$ii_page=$ii_arr['page'];
if ($ii_page && $tmp_Itemid=='') {
$db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%page=$ii_page%' AND published=1");
if( $db->next_record() ) $tmp_Itemid = $db->f("id");
}
// If we haven't found an Itemid, use the standard VM-Itemid
$Itemid = "&Itemid=" . ($tmp_Itemid ? $tmp_Itemid : $this->getShopItemid());
// VM-Expert Hack - End
?>
I've been told my problems will be solved if I replace a certain part of a php file to correct some crazy errors coded into VM (menu item ID's getting mixed up with Joomla ID's), this will heavily effect SEO if not corrected, and any SEO plugin components will not function because it just loops and 404's.
My problem is I don't code, I have tried to replace the code line-by-line but it gets medded up...am I right in assuming that where it sayes 'AND' that is not a new line???
EDIT: WTF the BB PHP tags answered my question LoLz
NM.....