FILE COMPARISON
Produced: 14/08/2007 8:40:28 PM
   
Mode:  Differences with Context  
Left base folder: E:\cc_3.0.17\upload  
Right base folder: E:\seomod\upload  
   
File: admin\categories\index.php  
64         $record["cat_father_id"] = $db->mySQLSafe($_POST['cat_father_id']);     = 64         $record["cat_father_id"] = $db->mySQLSafe($_POST['cat_father_id']);    
65         $record["cat_image"] = $db->mySQLSafe($_POST['imageName']);   65         $record["cat_image"] = $db->mySQLSafe($_POST['imageName']);
66         $record["per_ship"] = $db->mySQLSafe($_POST['per_ship']);    66         $record["per_ship"] = $db->mySQLSafe($_POST['per_ship']); 
67         $record["item_ship"] = $db->mySQLSafe($_POST['item_ship']);   67         $record["item_ship"] = $db->mySQLSafe($_POST['item_ship']);
68         $record["item_int_ship"] = $db->mySQLSafe($_POST['item_int_ship']);   68         $record["item_int_ship"] = $db->mySQLSafe($_POST['item_int_ship']);
69         $record["per_int_ship"] = $db->mySQLSafe($_POST['per_int_ship']);   69         $record["per_int_ship"] = $db->mySQLSafe($_POST['per_int_ship']);
    -+ 70     /* <rf> search engine friendly mod */
      71         if($config['seftags']) {
      72                 $record["cat_metatitle"] = $db->mySQLSafe($_POST['cat_metatitle']);
      73                 $record["cat_metadesc"] = $db->mySQLSafe($_POST['cat_metadesc']);
      74                 $record["cat_metakeywords"] = $db->mySQLSafe($_POST['cat_metakeywords']);
      75                 if($config['sefcustomurl'] == 1) $record["cat_sefurl"] = $db->mySQLSafe($_POST['cat_sefurl']);         
      76         }
      77     /* <rf> end mod */
70   = 78  
71         if($_POST['cat_id']>0) {   79         if($_POST['cat_id']>0) {
72                   80                
73                 // update product count. This is gona be tricky!!!   81                 // update product count. This is gona be tricky!!!
74                 if($_POST['oldFatherId']!==$_POST['cat_father_id'] && $_POST['noProducts']>0) {   82                 if($_POST['oldFatherId']!==$_POST['cat_father_id'] && $_POST['noProducts']>0) {
75                   83                
 
280   </tr> = 288   </tr>
281   <tr>   289   <tr>
282     <td class="tdText"><?php echo $lang['admin']['categories']['per_int_item']; ?></td>   290     <td class="tdText"><?php echo $lang['admin']['categories']['per_int_item']; ?></td>
283     <td><input name="per_int_ship" value="<?php echo $results[0]['per_int_ship']; ?>" type="text" class="textbox" size="6" /></td>   291     <td><input name="per_int_ship" value="<?php echo $results[0]['per_int_ship']; ?>" type="text" class="textbox" size="6" /></td>
284   </tr>   292   </tr>
285   <?php } ?>   293   <?php } ?>
    -+ 294 <!-- <rf> search engine friendly mod -->
      295 <?php if($config['seftags']) { ?>
      296                 <tr><td colspan="2"><p>
      297                 <table width="100%"  border="0" cellspacing="0" cellpadding="4" class="mainTable">
      298                   <tr>
      299                     <td colspan="2" class="tdTitle"><strong>Search Engine Friendly URL Meta Data For Category</strong></td>
      300                   </tr>
      301                   <tr>
      302                     <td width="30%" class="tdText"><strong><?php echo $lang['admin']['settings']['browser_title']; ?></strong></td>
      303                     <td align="left"><input name="cat_metatitle" type="text" size="35" class="textbox" value="<?php if(isset($results[0]['cat_metatitle'])) echo $results[0]['cat_metatitle']; ?>" /></td>
      304                   </tr>
      305                   <tr>
      306                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_desc'];?></strong></td>
      307                     <td align="left"><textarea name="cat_metadesc" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['cat_metadesc'])) echo $results[0]['cat_metadesc']; ?></textarea></td>
      308                   </tr>
      309                   <tr>
      310                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_keywords'];?></strong> <?php echo $lang['admin']['settings']['comma_separated'];?></td>
      311                     <td align="left"><textarea name="cat_metakeywords" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['cat_metakeywords'])) echo $results[0]['cat_metakeywords']; ?></textarea></td>
      312                   </tr>
      313 <?php if($config['sefcustomurl'] == 1) { ?>
      314                   <tr>
      315                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo 'Custom URL:';?></strong></td>
      316                     <td align="left">http://ccroot/<input name="cat_sefurl" type="text" size="20" class="textbox" value="<?php if(isset($results[0]['cat_sefurl'])) echo $results[0]['cat_sefurl']; ?>" />/c_xx.html</td>
      317                   </tr>                          
      318 <?php } ?>                               
      319                 </table>
      320                 </p></td></tr>
      321 <?php } ?>
      322 <!-- <rf> end mod -->
286   <tr> = 323   <tr>
287     <td>&nbsp;</td>   324     <td>&nbsp;</td>
288     <td>   325     <td>
289         <input type="hidden" name="noProducts" value="<?php echo $results[0]['noProducts']; ?>" />   326         <input type="hidden" name="noProducts" value="<?php echo $results[0]['noProducts']; ?>" />
290         <input type="hidden" name="oldFatherId" value="<?php echo $results[0]['cat_father_id']; ?>" />   327         <input type="hidden" name="oldFatherId" value="<?php echo $results[0]['cat_father_id']; ?>" />
291         <input type="hidden" name="cat_id" value="<?php echo $results[0]['cat_id']; ?>" />   328         <input type="hidden" name="cat_id" value="<?php echo $results[0]['cat_id']; ?>" />
292         <input type="submit" name="Submit" class="submit" value="<?php if(isset($_GET["edit"]) && $_GET["edit"]>0){ echo $modeTxt; } else { echo $modeTxt;  } ?>" /></td>   329         <input type="submit" name="Submit" class="submit" value="<?php if(isset($_GET["edit"]) && $_GET["edit"]>0){ echo $modeTxt; } else { echo $modeTxt;  } ?>" /></td>
293   </tr>   330   </tr>
294 </table>   331 </table>
295 </form>   332 </form>
296 <?php } ?>   333 <?php } ?>
297 <?php include("../includes/footer.inc.php"); ?>   334 <?php include("../includes/footer.inc.php"); ?>
   
File: admin\docs\siteDocs.php  
56                 $msg = "<p class='warnText'>".$lang['admin']['docs']['delete_fail']."</p>"; = 56                 $msg = "<p class='warnText'>".$lang['admin']['docs']['delete_fail']."</p>";
57         }   57         }
58 } elseif(isset($_POST['docId']) && $_POST['docId']>0){   58 } elseif(isset($_POST['docId']) && $_POST['docId']>0){
59     59  
60 $record["doc_name"] = $db->mySQLSafe($_POST['doc_name']);                 60 $record["doc_name"] = $db->mySQLSafe($_POST['doc_name']);              
61 $record["doc_content"] = $db->mySQLSafe($_POST['FCKeditor']);   61 $record["doc_content"] = $db->mySQLSafe($_POST['FCKeditor']);
    -+ 62 /* <rf> search engine friendly url mod */
      63 if($config['seftags']) {
      64         $record["doc_metatitle"] = $db->mySQLSafe($_POST['doc_metatitle']);
      65         $record["doc_metadesc"] = $db->mySQLSafe($_POST['doc_metadesc']);
      66         $record["doc_metakeywords"] = $db->mySQLSafe($_POST['doc_metakeywords']);
      67         if($config['sefcustomurl'] == 1) $record["doc_sefurl"] = $db->mySQLSafe($_POST['doc_sefurl']); 
      68 }
      69 /* <rf> end mod */
62                                                         = 70                                                        
63 $where = "doc_id = ".$db->mySQLSafe($_POST['docId']);   71 $where = "doc_id = ".$db->mySQLSafe($_POST['docId']);
64     72  
65 $update =$db->update($glob['dbprefix']."CubeCart_docs", $record, $where);   73 $update =$db->update($glob['dbprefix']."CubeCart_docs", $record, $where);
66                           74                        
67         if($update == TRUE){   75         if($update == TRUE){
 
72   = 80  
73 } elseif(isset($_POST['docId']) && empty($_POST['docId'])){   81 } elseif(isset($_POST['docId']) && empty($_POST['docId'])){
74     82  
75     83  
76 $record["doc_name"] = $db->mySQLSafe($_POST['doc_name']);                 84 $record["doc_name"] = $db->mySQLSafe($_POST['doc_name']);              
77 $record["doc_content"] = $db->mySQLSafe($_POST['FCKeditor']);     85 $record["doc_content"] = $db->mySQLSafe($_POST['FCKeditor']);  
    -+ 86 /* <rf> search engine friendly url mod */
      87 if($config['seftags']) {
      88         $record["doc_metatitle"] = $db->mySQLSafe($_POST['doc_metatitle']);
      89         $record["doc_metadesc"] = $db->mySQLSafe($_POST['doc_metadesc']);
      90         $record["doc_metakeywords"] = $db->mySQLSafe($_POST['doc_metakeywords']);
      91         if($config['sefcustomurl'] == 1) $record["doc_sefurl"] = $db->mySQLSafe($_POST['doc_sefurl']);         
      92 }
      93 /* <rf> end mod */
78   = 94  
79 $insert = $db->insert($glob['dbprefix']."CubeCart_docs", $record);   95 $insert = $db->insert($glob['dbprefix']."CubeCart_docs", $record);
80     96  
81         if($insert == TRUE){   97         if($insert == TRUE){
82                 $msg = "<p class='infoText'>'".$_POST['doc_name']."' ".$lang['admin']['docs']['add_success']."</p>";   98                 $msg = "<p class='infoText'>'".$_POST['doc_name']."' ".$lang['admin']['docs']['add_success']."</p>";
83         } else {   99         } else {
 
127 } = 143 }
128 $oFCKeditor->Create();   144 $oFCKeditor->Create();
129 ?></td>   145 ?></td>
130   </tr>   146   </tr>
131   <tr>   147   <tr>
132     <td class="tdRichText">   148     <td class="tdRichText">
    <> 149  
      150 <!-- <rf> search engine friendly mod -->
      151 <?php if($config['seftags']) { ?>
      152                 <p>
      153                 <table width="100%"  border="0" cellspacing="0" cellpadding="4" class="mainTable">
      154                   <tr>
      155                     <td colspan="2" class="tdTitle"><strong>Search Engine Friendly URL Meta Data For Site Document</strong></td>
      156                   </tr>
      157                   <tr>
      158                     <td width="30%" class="tdText"><strong><?php echo $lang['admin']['settings']['browser_title']; ?></strong></td>
      159                     <td align="left"><input name="doc_metatitle" type="text" size="35" class="textbox" value="<?php if(isset($results[0]['doc_metatitle'])) echo $results[0]['doc_metatitle']; ?>" /></td>
      160                   </tr>
      161                   <tr>
      162                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_desc'];?></strong></td>
      163                     <td align="left"><textarea name="doc_metadesc" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['doc_metadesc'])) echo $results[0]['doc_metadesc']; ?></textarea></td>
      164                   </tr>
      165                   <tr>
      166                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_keywords'];?></strong> <?php echo $lang['admin']['settings']['comma_separated'];?></td>
      167                     <td align="left"><textarea name="doc_metakeywords" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['doc_metakeywords'])) echo $results[0]['doc_metakeywords']; ?></textarea></td>
      168                   </tr>
      169 <?php if($config['sefcustomurl'] == 1) { ?>                              
      170                   <tr>
      171                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo 'Custom URL:';?></strong></td>
      172                     <td align="left">http://ccroot/<input name="doc_sefurl" type="text" size="20" class="textbox" value="<?php if(isset($results[0]['doc_sefurl'])) echo $results[0]['doc_sefurl']; ?>" />/i_xx.html</td>
      173                   </tr>
      174 <?php } ?>                                                               
      175                 </table>
      176                 </p>
      177 <?php } ?>
      178 <!-- <rf> end mod -->
      179  
133         <input type="hidden" value="<?php if(isset($_GET['edit'])) echo $_GET['edit']; ?>" name="docId" /> = 180         <input type="hidden" value="<?php if(isset($_GET['edit'])) echo $_GET['edit']; ?>" name="docId" />
134         <input name="submit" type="submit" id="submit" class="submit" <?php if(isset($results) && $results == TRUE){ ?>value="<?php echo $lang['admin']['docs']['update_doc'];?>"<?php } else { echo "value=\"".$lang['admin']['docs']['save_doc']."\""; } ?> /></td>   181         <input name="submit" type="submit" id="submit" class="submit" <?php if(isset($results) && $results == TRUE){ ?>value="<?php echo $lang['admin']['docs']['update_doc'];?>"<?php } else { echo "value=\"".$lang['admin']['docs']['save_doc']."\""; } ?> /></td>
135   </tr>   182   </tr>
136 </table>   183 </table>
137 </form>   184 </form>
138 <?php } else {   185 <?php } else {
   
File: admin\products\index.php  
76                         "),"",strip_tags($results[$i]['name'])); = 76                         "),"",strip_tags($results[$i]['name']));
77                         $name = str_replace("  ","",$name);   77                         $name = str_replace("  ","",$name);
78                         $desc = str_replace(array("&nbsp;","\t","\r","\n","\0","\x0B","   78                         $desc = str_replace(array("&nbsp;","\t","\r","\n","\0","\x0B","
79                         "),"",strip_tags($results[$i]['description']));   79                         "),"",strip_tags($results[$i]['description']));
80                         $desc = str_replace("  ","",$desc);   80                         $desc = str_replace("  ","",$desc);
81                           81                        
    <> 82 // SEO friendly mod
      83                         if($config['sef'] == 0) {
82                         $googleBaseContent .= $glob['storeURL']."/index.php?act=viewProd&productId=".$results[$i]['productId']."\t".$name."\t".$desc;   84                                 $googleBaseContent .= $glob['storeURL']."/index.php?act=viewProd&productId=".$results[$i]['productId']."\t".$name."\t".$desc;
      85                         } else {
      86                                 include_once("../../includes/sef_urls.inc.php");
      87                                 $googleBaseContent .= $glob['storeURL']. "/" . sef_get_base_url(). generateProductUrl($results[$i]['productId'])."\t".$name."\t".$desc;                
83                           88                         }
      89 // SEO friendly mod            
84                         if($results[$i]['image']){ = 90                         if($results[$i]['image']){
85                                 $googleBaseContent .= "\t".$glob['storeURL']."/images/uploads/".$results[$i]['image'];   91                                 $googleBaseContent .= "\t".$glob['storeURL']."/images/uploads/".$results[$i]['image'];
86                         } else {   92                         } else {
87                                 $googleBaseContent .= "\t".$glob['storeURL']."/skins/".$config['skinDir']."/styleImages/nophoto.gif";   93                                 $googleBaseContent .= "\t".$glob['storeURL']."/skins/".$config['skinDir']."/styleImages/nophoto.gif";
88                         }   94                         }
89     95  
 
176         $record["useStockLevel"] = $db->mySQLSafe($_POST['useStockLevel']); = 182         $record["useStockLevel"] = $db->mySQLSafe($_POST['useStockLevel']);
177         $record["digital"] = $db->mySQLSafe($_POST['digital']);   183         $record["digital"] = $db->mySQLSafe($_POST['digital']);
178         $record["digitalDir"] = $db->mySQLSafe($_POST['digitalDir']);   184         $record["digitalDir"] = $db->mySQLSafe($_POST['digitalDir']);
179         $record["prodWeight"] = $db->mySQLSafe($_POST['prodWeight']);   185         $record["prodWeight"] = $db->mySQLSafe($_POST['prodWeight']);
180         $record["taxType"] = $db->mySQLSafe($_POST['taxType']);   186         $record["taxType"] = $db->mySQLSafe($_POST['taxType']);
181         $record["showFeatured"] = $db->mySQLSafe($_POST['showFeatured']);   187         $record["showFeatured"] = $db->mySQLSafe($_POST['showFeatured']);
    -+ 188     /* <rf> search engine friendly url mod */
      189         if($config['seftags']) {
      190                 $record["prod_metatitle"] = $db->mySQLSafe($_POST['prod_metatitle']);
      191                 $record["prod_metadesc"] = $db->mySQLSafe($_POST['prod_metadesc']);
      192                 $record["prod_metakeywords"] = $db->mySQLSafe($_POST['prod_metakeywords']);
      193                 if($config['sefcustomurl'] == 1) $record["prod_sefurl"] = $db->mySQLSafe($_POST['prod_sefurl']);               
      194         }
      195     /* <rf> end mod */
182   = 196  
183         // if image is a JPG check thumbnail doesn't exist and if not make one   197         // if image is a JPG check thumbnail doesn't exist and if not make one
184         $imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_POST['imageName']));   198         $imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_POST['imageName']));
185         if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)){   199         if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)){
186                   200                
187                 if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$_POST['imageName'])){   201                 if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$_POST['imageName'])){
 
599         <select name="showFeatured" class="textbox"> = 613         <select name="showFeatured" class="textbox">
600         <option value="1" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes'];?></option>   614         <option value="1" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes'];?></option>
601         <option value="0" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no'];?></option>   615         <option value="0" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no'];?></option>
602       </select>   616       </select>
603         </td>   617         </td>
604   </tr>   618   </tr>
    -+ 619 <!-- <rf> search engine friendly mod -->
      620 <?php if($config['seftags']) { ?>
      621                 <tr><td colspan="2"><p>
      622                 <table width="100%"  border="0" cellspacing="0" cellpadding="4" class="mainTable">
      623                   <tr>
      624                     <td colspan="2" class="tdTitle"><strong>Search Engine Friendly URL Meta Data For Product</strong></td>
      625                   </tr>
      626                   <tr>
      627                     <td width="30%" class="tdText"><strong><?php echo $lang['admin']['settings']['browser_title']; ?></strong></td>
      628                     <td align="left"><input name="prod_metatitle" type="text" size="35" class="textbox" value="<?php if(isset($results[0]['prod_metatitle'])) echo $results[0]['prod_metatitle']; ?>" /></td>
      629                   </tr>
      630                   <tr>
      631                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_desc'];?></strong></td>
      632                     <td align="left"><textarea name="prod_metadesc" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['prod_metadesc'])) echo $results[0]['prod_metadesc']; ?></textarea></td>
      633                   </tr>
      634                   <tr>
      635                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['settings']['meta_keywords'];?></strong> <?php echo $lang['admin']['settings']['comma_separated'];?></td>
      636                     <td align="left"><textarea name="prod_metakeywords" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['prod_metakeywords'])) echo $results[0]['prod_metakeywords']; ?></textarea></td>
      637                   </tr>
      638 <?php if($config['sefcustomurl'] == 1) { ?>                              
      639                   <tr>
      640                     <td width="30%" align="left" valign="top" class="tdText"><strong><?php echo 'Custom URL:';?></strong></td>
      641                     <td align="left">http://ccroot/<input name="prod_sefurl" type="text" size="20" class="textbox" value="<?php if(isset($results[0]['prod_sefurl'])) echo $results[0]['prod_sefurl']; ?>" />/p_xx.html</td>
      642                   </tr>
      643 <?php } ?>                                                               
      644                 </table>
      645                 </p></td></tr>
      646 <?php } ?>
      647 <!-- <rf> end mod -->
605   <tr> = 648   <tr>
606     <td width="25%">&nbsp;</td>   649     <td width="25%">&nbsp;</td>
607     <td>   650     <td>
608         <input type="hidden" name="oldCatId" value="<?php if(isset($results[0]['cat_id'])) echo $results[0]['cat_id']; ?>" />   651         <input type="hidden" name="oldCatId" value="<?php if(isset($results[0]['cat_id'])) echo $results[0]['cat_id']; ?>" />
609         <input type="hidden" name="productId" value="<?php if(isset($results[0]['productId'])) echo $results[0]['productId']; ?>" />   652         <input type="hidden" name="productId" value="<?php if(isset($results[0]['productId'])) echo $results[0]['productId']; ?>" />
610         <input type="submit" name="Submit" class="submit" value="<?php if(isset($_GET["edit"]) && $_GET["edit"]>0){ echo $modeTxt; } else { echo $modeTxt;  } ?> <?php echo $lang['admin']['products']['product'];?>" /></td>   653         <input type="submit" name="Submit" class="submit" value="<?php if(isset($_GET["edit"]) && $_GET["edit"]>0){ echo $modeTxt; } else { echo $modeTxt;  } ?> <?php echo $lang['admin']['products']['product'];?>" /></td>
   
File: admin\settings\index.php  
512                 $oFCKeditor = new FCKeditor('config[offLineContent]'); = 512                 $oFCKeditor = new FCKeditor('config[offLineContent]');
513                 $oFCKeditor->BasePath = $GLOBALS['rootRel'].'admin/includes/rte/';   513                 $oFCKeditor->BasePath = $GLOBALS['rootRel'].'admin/includes/rte/';
514                 $oFCKeditor->Value = stripslashes($config['offLineContent']);   514                 $oFCKeditor->Value = stripslashes($config['offLineContent']);
515                 $oFCKeditor->Create();   515                 $oFCKeditor->Create();
516           ?>      </td>   516           ?>      </td>
517     </tr>   517     </tr>
518         <> 518  
      519 <!-- <rf> search engine friendly mod -->
      520 <?php
      521                 // if field not found and we are requested to install it then do so now
      522                 if(isset($_GET['sefmetainstall'])){
      523                         if($sefMetaFieldfound != 1 && $_GET['sefmetainstall'] == 1) {
      524                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_inventory` ADD `prod_metatitle` TEXT DEFAULT '' NOT NULL;");
      525                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_inventory` ADD `prod_metadesc` TEXT DEFAULT '' NOT NULL;");
      526                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_inventory` ADD `prod_metakeywords` TEXT DEFAULT '' NOT NULL;");
      527                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_inventory` ADD `prod_sefurl` TEXT DEFAULT '' NOT NULL;");
      528                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_category` ADD `cat_metatitle` TEXT DEFAULT '' NOT NULL;");
      529                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_category` ADD `cat_metadesc` TEXT DEFAULT '' NOT NULL;");
      530                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_category` ADD `cat_metakeywords` TEXT DEFAULT '' NOT NULL;");
      531                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_category` ADD `cat_sefurl` TEXT DEFAULT '' NOT NULL;");                  
      532                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_docs` ADD `doc_metatitle` TEXT DEFAULT '' NOT NULL;");
      533                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_docs` ADD `doc_metadesc` TEXT DEFAULT '' NOT NULL;");
      534                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_docs` ADD `doc_metakeywords` TEXT DEFAULT '' NOT NULL;");
      535                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_docs` ADD `doc_sefurl` TEXT DEFAULT '' NOT NULL;");
      536                         } else if($sefURLFieldfound != 1 && $_GET['sefmetainstall'] == 2){
      537                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_inventory` ADD `prod_sefurl` TEXT DEFAULT '' NOT NULL;");                
      538                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_category` ADD `cat_sefurl` TEXT DEFAULT '' NOT NULL;");                  
      539                                 $db->misc("ALTER TABLE `".$glob['dbprefix']."CubeCart_docs` ADD `doc_sefurl` TEXT DEFAULT '' NOT NULL;");                      
      540                         }                      
      541                 }
      542  
      543                 // check to see if the keyword fields are added to the tables, lets just test one table for one new field
      544                 $sefdb = new db();
      545                 $sefMetaFieldfound = 0;
      546                 $sefURLFieldfound = 0;
      547                 $Productfields = $db->select("DESCRIBE `".$glob['dbprefix']."CubeCart_inventory`");            
      548                 for($i=0; $i<count($Productfields); $i++) {
      549                         if(strcasecmp($Productfields[$i]['Field'], "prod_metatitle") == 0) {
      550                                 $sefMetaFieldfound = 1;
      551                         }
      552                         if(strcasecmp($Productfields[$i]['Field'], "prod_sefurl") == 0) {
      553                                 $sefURLFieldfound = 1; 
      554                         }                      
      555                 }
      556 ?>
      557         <tr>
      558           <td colspan="2" class="tdTitle"><?php echo "Search engine friendly URL"?></td>
      559     </tr>
      560         <tr>
      561           <td width="30%" class="tdText"><strong><?php echo "Use search engine friendly URL? (also turns on session killing for search engines)"?></strong></td>
      562           <td align="left">
      563           <select name="config[sef]" class="textbox">
      564         <option value="1" <?php if($config['sef']==1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes'];?></option>
      565         <option value="0" <?php if($config['sef']==0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no'];?></option>
      566       </select></td>
      567     </tr>
      568 <?php if($config['sef']) { ?>
      569         <tr>
      570           <td width="30%" class="tdText"><strong><?php echo "Specify server configuration. Different servers are configured differently and a certain setup might not work for you. If none of these work, please read the README.TXT for further info. (recommended if server allows it [Apache RewriteRule supported] otherwise [Apache directory 'lookback' and ForceType supported]). Note if you are NOT running apache or can't get any configuration to work then try [Use generated PHP pages]"?></strong></td>
      571           <td align="left">
      572           <select name="config[sefserverconfig]" class="textbox">
      573         <option value="3" <?php if($config['sefserverconfig']==3) echo "selected='selected'"; ?>><?php echo "Use generated PHP pages";?></option>
      574         <option value="2" <?php if($config['sefserverconfig']==2) echo "selected='selected'"; ?>><?php echo "Apache directory 'lookback' supported only";?></option>
      575         <option value="1" <?php if($config['sefserverconfig']==1) echo "selected='selected'"; ?>><?php echo "Apache directory 'lookback' and ForceType supported";?></option>
      576         <option value="0" <?php if($config['sefserverconfig']==0) echo "selected='selected'"; ?>><?php echo "Apache RewriteRule supported";?></option>
      577       </select></td>
      578     </tr>              
      579     <?php if($config['sefserverconfig']==3) { ?>
      580         <tr>
      581           <td width="30%" class="tdText"><strong><?php echo "To use the generated PHP pages configuration you will need to first generate the pages. If you add new docs/categories/products or modify any of their titles you MUST generate the PHP pages again to be in sync"?></strong></td>
      582           <td align="left" class="tdText">
      583                         <a href="sef_genpages.php">Click here</a> to generate the PHP pages. This can take a while, a message will be displayed when it is complete. Please make sure you have entered your FTP settings, see the README.TXT file for info. Note this will create directories and files of permission 755 in your cube cart folder.
      584         </td>
      585     </tr>
      586     <?php } ?>
      587 <?php if($sefURLFieldfound == 1) { ?>
      588         <tr>
      589           <td width="30%" class="tdText"><strong><?php echo "Activate custom URLs (Will add custom URL field to sitedocs, categories and products)"?></strong></td>
      590           <td align="left">
      591           <select name="config[sefcustomurl]" class="textbox">
      592         <option value="1" <?php if($config['sefcustomurl']==1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes'];?></option>
      593         <option value="0" <?php if($config['sefcustomurl']==0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no'];?></option>
      594       </select></td>
      595     </tr>
      596 <?php }        
      597   } ?>
      598 <?php
      599                 if($sefMetaFieldfound == 1) { ?>
      600         <tr>
      601           <td width="30%" class="tdText"><strong><?php echo "Specify behaviour of search engine friendly url meta tags (enabling this will add new fields to the admin pages of sitedocs, categories and products). Recommended setting [Combine with global meta tags]"?></strong></td>
      602           <td align="left">
      603           <select name="config[seftags]" class="textbox">
      604         <option value="3" <?php if($config['seftags']==3) echo "selected='selected'"; ?>><?php echo "Override global meta tags (description, keywords and title)";?></option>
      605         <option value="2" <?php if($config['seftags']==2) echo "selected='selected'"; ?>><?php echo "Override global meta tags (description and keywords only)";?></option>
      606         <option value="1" <?php if($config['seftags']==1) echo "selected='selected'"; ?>><?php echo "Combine with global meta tags";?></option>
      607         <option value="0" <?php if($config['seftags']==0) echo "selected='selected'"; ?>><?php echo "Disable feature";?></option>
      608       </select></td>
      609     </tr>
      610     <?php if($config['seftags']) { ?>
      611         <tr>
      612           <td width="30%" class="tdText"><strong><?php echo "Specify behaviour of titles for category and product names"?></strong></td>
      613           <td align="left">
      614           <select name="config[sefprodnamefirst]" class="textbox">
      615         <option value="1" <?php if($config['sefprodnamefirst']==1) echo "selected='selected'"; ?>><?php echo "product name->sub category->category";?></option>
      616         <option value="0" <?php if($config['sefprodnamefirst']==0) echo "selected='selected'"; ?>><?php echo "category->sub category->product name";?></option>
      617       </select></td>
      618     </tr>
      619     <?php } ?>
      620 <?php } else { ?>
      621         <tr>
      622           <td class="tdText" colspan ="2" bgcolor="#FF9999"><strong><?php echo "If you wish to use the search engine friendly URL meta tags OR the custom search engine friendly URLs then your database tables will need to be modified with new fields. Click <a href='index.php?sefmetainstall=1'>HERE</a> to install these new fields now. (Back up your database and run at your own risk)"?></strong></td>
      623     </tr>
      624 <?php }
      625           if($sefMetaFieldfound == 1 && $sefURLFieldfound != 1) { ?>
      626         <tr>
      627           <td class="tdText" colspan ="2" bgcolor="#FF9999"><strong><?php echo "If you wish to use the custom search engine friendly URLs then your database tables will need to be modified with new fields. Click <a href='index.php?sefmetainstall=2'>HERE</a> to install these new fields now. (Back up your database and run at your own risk)"?></strong></td>
      628     </tr>
      629 <?php } ?>     
      630 <!-- <rf> end mod -->
      631  
519         <tr> = 632         <tr>
520         <td width="30%" class="tdText">&nbsp;</td>   633         <td width="30%" class="tdText">&nbsp;</td>
521           <td align="left">         634           <td align="left">      
522           <input name="submit" type="submit" class="submit" id="submit" value="<?php echo $lang['admin']['settings']['update_settings'];?>" /></td>   635           <input name="submit" type="submit" class="submit" id="submit" value="<?php echo $lang['admin']['settings']['update_settings'];?>" /></td>
523         </tr>   636         </tr>
524 </table>   637 </table>
525 </form>   638 </form>
526 <?php include("../includes/footer.inc.php"); ?>   639 <?php include("../includes/footer.inc.php"); ?>
   
File: classes\xtpl.php  
525      * = 525      *
526      * @access public   526      * @access public
527      * @param string $bname Block name to echo out   527      * @param string $bname Block name to echo out
528      */   528      */
529         function out ($bname) {   529         function out ($bname) {
530     530  
531                 $out = $this->text($bname); <> 531                 /* <rf> search engine friendly mod */
532                 //       $length=strlen($out);   532                 global $glob, $config; 
533                 //header("Content-Length: ".$length); // TODO: Comment this back in later   533                 include_once($glob['rootDir']."/includes/sef_urls.inc.php");   
534     534        
535                 // JC 20/11/02 echo the template filename if in development as   535                 $copy = $this->text($bname);
536                 // html comment   536                 if(!detectSSL()) {
537                 // note 4.3.0 and ZE2 have new function debug_backtrace() that show a   537                         $copy = sef_rewrite_urls($copy);
538                 // function call list - it may be nice to dump that here too      
539                 //if (SYSTEM_TYPE == 'development') {      
540                 //    echo "<!-- Template: " . $this->_file_name_full_path . " -->\n";      
541                 //}   538                 }
542                 // moved to ::text() so parsing sub templates work      
543   = 539  
544                 echo $out; <> 540                 echo $copy;
      541                 /* <rf> end mod */
545         } = 542         }
546     543  
547         /**   544         /**
548      * prints the parsed text to a specified file   545      * prints the parsed text to a specified file
549      *   546      *
550      * @access public   547      * @access public
   
File: includes\boxes\session.inc.php  
29   = 29  
30 if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {   30 if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
31         echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";   31         echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
32         exit;   32         exit;
33 }   33 }
34     34  
    <> 35 /* <rf> search engine friendly mods */
      36 if(user_is_search_engine() == false || $config['sef'] == 0) {
      37  
35 $box_content = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/boxes/session.tpl"); = 38 $box_content = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/boxes/session.tpl");
36     39  
37 // build attributes   40 // build attributes
38 if($ccUserData[0]['customer_id']>0){   41 if($ccUserData[0]['customer_id']>0){
39     42  
40                 $box_content->assign("LANG_WELCOME_BACK",$lang['front']['boxes']['welcome_back']);   43                 $box_content->assign("LANG_WELCOME_BACK",$lang['front']['boxes']['welcome_back']);
 
52                 $box_content->parse("session.session_false"); = 55                 $box_content->parse("session.session_false");
53     56  
54 }   57 }
55     58  
56 $box_content->parse("session");   59 $box_content->parse("session");
57 $box_content = $box_content->text("session");   60 $box_content = $box_content->text("session");
    <> 61  
      62 } else {
      63         $box_content = null;
      64 }
      65 /* <rf> end mod */
58 ?> = 66 ?>
   
File: includes\boxes\shoppingCart.inc.php  
29   = 29  
30 if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {   30 if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
31         echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";   31         echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
32         exit;   32         exit;
33 }   33 }
34     34  
    <> 35 /* <rf> search engine friendly mods */
      36 if(user_is_search_engine() == false || $config['sef'] == 0) {
      37  
35 $box_content=new XTemplate("skins/".$config['skinDir']."/styleTemplates/boxes/shoppingCart.tpl"); = 38 $box_content=new XTemplate("skins/".$config['skinDir']."/styleTemplates/boxes/shoppingCart.tpl");
36     39  
37 $box_content->assign("LANG_SHOPPING_CART_TITLE",$lang['front']['boxes']['shopping_cart']);   40 $box_content->assign("LANG_SHOPPING_CART_TITLE",$lang['front']['boxes']['shopping_cart']);
38 $box_content->assign("VAL_SKIN",$config['skinDir']);   41 $box_content->assign("VAL_SKIN",$config['skinDir']);
39     42  
40 require_once("classes/cart.php");   43 require_once("classes/cart.php");
 
179         $box_content->assign("CART_STEP","cart"); = 182         $box_content->assign("CART_STEP","cart");
180 }   183 }
181     184  
182 $box_content->parse("shopping_cart");   185 $box_content->parse("shopping_cart");
183     186  
184 $box_content = $box_content->text("shopping_cart");   187 $box_content = $box_content->text("shopping_cart");
    <> 188  
      189 } else {
      190         $box_content = null;
      191 }
      192 /* <rf> end mod */
      193  
185 ?> = 194 ?>
   
File: includes\content\viewCat.inc.php  
182   = 182  
183 }   183 }
184     184  
185 $totalNoProducts = $db->numrows($productListQuery);   185 $totalNoProducts = $db->numrows($productListQuery);
186     186  
187 // get current category info   187 // get current category info
    <> 188         /* <rf> search engine friendly mod */
188         if(isset($_GET['catId']) && $_GET['catId']>0){   189         if(isset($_GET['catId'])){
189                 $currentCatQuery = "SELECT cat_name, cat_father_id, cat_id, cat_image FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_id = ".$db->mySQLSafe($_GET['catId']);   190  
      191                 if($config['seftags']) {
      192  
      193                         if($_GET['catId']>0) {
      194                                 $currentCatQuery = "SELECT cat_metatitle, cat_metadesc, cat_metakeywords, cat_name, cat_father_id, cat_id, cat_image FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_id = ".$db->mySQLSafe($_GET['catId']);
190                 $currentCat = $db->select($currentCatQuery);   195                                 $currentCat = $db->select($currentCatQuery);
191                 = 196                
192                 $resultForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' AND cat_master_id = ".$db->mySQLSafe($_GET['catId'])); <> 197                                 $resultForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' AND cat_master_id = ".$db->mySQLSafe($_GET['catId']));
193                   198                                        
194                 if($resultForeign == TRUE){   199                                 if($resultForeign == TRUE){
195                         = 200                        
196                         $currentCat[0]['cat_name'] = $resultForeign[0]['cat_name']; <> 201                                         $currentCat[0]['cat_name'] = $resultForeign[0]['cat_name'];
197                 = 202                
    <> 203                                 }
      204  
      205                                 $prevDirSymbol = $config['dirSymbol'];
      206                                 $config['dirSymbol'] = ' - ';
      207                                 $meta['siteTitle'] = getCatDir($currentCat[0]['cat_name'],$currentCat[0]['cat_father_id'], $currentCat[0]['cat_id'], FALSE, TRUE, $config['sefprodnamefirst'] ? FALSE : TRUE);
      208                                 $config['dirSymbol'] = $prevDirSymbol;
      209  
      210                                 $meta['metaDescription'] = strip_tags($config['metaDescription']);             
      211                                 $meta['sefSiteTitle'] = $currentCat[0]['cat_metatitle'];
      212                                 $meta['sefSiteDesc'] = $currentCat[0]['cat_metadesc'];
      213                                 $meta['sefSiteKeywords'] = $currentCat[0]['cat_metakeywords'];
      214                         } else if(strcmp($_GET['catId'], "saleItems") == 0) {
      215                                 $meta['siteTitle'] = $lang['front']['boxes']['sale_items'];
      216                                 $meta['metaDescription'] = strip_tags($config['metaDescription']);
      217                         }
      218  
      219                 } else if($_GET['catId']>0){
      220                     $currentCatQuery = "SELECT cat_name, cat_father_id, cat_id, cat_image FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_id = ".$db->mySQLSafe($_GET['catId']);
      221                     $currentCat = $db->select($currentCatQuery);
198                 }   222                
      223                     $resultForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' AND cat_master_id = ".$db->mySQLSafe($_GET['catId']));
199                 = 224                
    -+ 225                     if($resultForeign == TRUE){
      226                        
      227                             $currentCat[0]['cat_name'] = $resultForeign[0]['cat_name'];
200                 = 228                
    -+ 229                     }
      230                 }              
201         } = 231         }
    -+ 232         /* <rf> end mod */
202   = 233  
203                 if(!empty($currentCat[0]['cat_image'])) {   234                 if(!empty($currentCat[0]['cat_image'])) {
204                         $view_cat->assign("IMG_CURENT_CATEGORY","images/uploads/".$currentCat[0]['cat_image']);   235                         $view_cat->assign("IMG_CURENT_CATEGORY","images/uploads/".$currentCat[0]['cat_image']);
205                         $view_cat->assign("TXT_CURENT_CATEGORY",validHTML($currentCat[0]['cat_name']));   236                         $view_cat->assign("TXT_CURENT_CATEGORY",validHTML($currentCat[0]['cat_name']));
206                         $view_cat->parse("view_cat.cat_img");   237                         $view_cat->parse("view_cat.cat_img");
207                 }   238                 }
 
259                 } = 290                 }
260                 $salePrice = salePrice($productResults[$i]['price'], $productResults[$i]['sale_price']);   291                 $salePrice = salePrice($productResults[$i]['price'], $productResults[$i]['sale_price']);
261                   292                
262                 $view_cat->assign("TXT_SALE_PRICE", priceFormat($salePrice));   293                 $view_cat->assign("TXT_SALE_PRICE", priceFormat($salePrice));
263     294  
264                 if(isset($_GET['add']) && isset($_GET['quan'])){   295                 if(isset($_GET['add']) && isset($_GET['quan'])){
265                         <> 296 /* <rf> start seo mod */
266                         $view_cat->assign("CURRENT_URL",str_replace(array("&amp;add=".$_GET['add'],"&amp;quan=".$_GET['quan']),"",currentPage()));   297                         $view_cat->assign("CURRENT_URL",str_replace(array("&amp;add=".$_GET['add'],"&amp;quan=".$_GET['quan']),"",currentPage(TRUE)));
267                           298 /* <rf> end seo mod */
268                 } else { = 299                 } else {
269                 <> 300 /* <rf> start seo mod */
270                         $view_cat->assign("CURRENT_URL",currentPage());   301                         $view_cat->assign("CURRENT_URL",currentPage(TRUE));
271                           302 /* <rf> end seo mod */
272                 } = 303                 }
273     304  
274                 if($config['outofstockPurchase']==1){   305                 if($config['outofstockPurchase']==1){
275                           306                        
276                         $view_cat->assign("BTN_BUY",$lang['front']['viewCat']['buy']);   307                         $view_cat->assign("BTN_BUY",$lang['front']['viewCat']['buy']);
277                         $view_cat->assign("PRODUCT_ID",$productResults[$i]['productId']);   308                         $view_cat->assign("PRODUCT_ID",$productResults[$i]['productId']);
   
File: includes\content\viewDoc.inc.php  
35   = 35  
36 $_GET['docId'] = treatGet($_GET['docId']);   36 $_GET['docId'] = treatGet($_GET['docId']);
37 if($lang_folder !== $config['defaultLang']){   37 if($lang_folder !== $config['defaultLang']){
38     38  
39 $result = $db->select("SELECT doc_name, doc_content FROM ".$glob['dbprefix']."CubeCart_docs_lang WHERE doc_master_id = ".$db->mySQLSafe($_GET['docId'])." AND doc_lang=".$db->mySQLSafe($lang_folder));   39 $result = $db->select("SELECT doc_name, doc_content FROM ".$glob['dbprefix']."CubeCart_docs_lang WHERE doc_master_id = ".$db->mySQLSafe($_GET['docId'])." AND doc_lang=".$db->mySQLSafe($lang_folder));
40     40  
    -+ 41         /* <rf> search engine friendly mod */
      42         if($config['seftags']) {
      43                 // get metas for the docs
      44                 $sefresult = $db->select("SELECT doc_metatitle, doc_metadesc, doc_metakeywords FROM ".$glob['dbprefix']."CubeCart_docs WHERE doc_id = ".$db->mySQLSafe($_GET['docId']));
      45                 $result['sefSiteTitle'] = $sefresult['sefSiteTitle'];
      46                 $result['sefSiteDesc'] = $sefresult['sefSiteDesc'];
      47                 $result['sefSiteKeywords'] = $sefresult['sefSiteKeywords'];
      48         }
      49         /* <rf> end mod */
41 } = 50 }
42     51  
43 if(!isset($result) || $result==FALSE) {   52 if(!isset($result) || $result==FALSE) {
    <> 53 /* <rf> search engine friendly mod */
      54 if($config['seftags']) {
      55         $result = $db->select("SELECT doc_metatitle, doc_metadesc, doc_metakeywords, doc_name, doc_content FROM ".$glob['dbprefix']."CubeCart_docs WHERE doc_id = ".$db->mySQLSafe($_GET['docId']));
44     56 } else {
45 $result = $db->select("SELECT doc_name, doc_content FROM ".$glob['dbprefix']."CubeCart_docs WHERE doc_id = ".$db->mySQLSafe($_GET['docId']));   57         $result = $db->select("SELECT doc_name, doc_content FROM ".$glob['dbprefix']."CubeCart_docs WHERE doc_id = ".$db->mySQLSafe($_GET['docId']));
46     58 }
      59 /* <rf> end mod */
47 } = 60 }
48     61  
49 $view_doc=new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/viewDoc.tpl");   62 $view_doc=new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/viewDoc.tpl");
50     63  
51 if(isset($result) && $result == TRUE){   64 if(isset($result) && $result == TRUE){
52           65        
53         $view_doc->assign("DOC_NAME",validHTML($result[0]['doc_name']));   66         $view_doc->assign("DOC_NAME",validHTML($result[0]['doc_name']));
54         $view_doc->assign("DOC_CONTENT",(!get_magic_quotes_gpc ()) ? stripslashes($result[0]['doc_content']) : $result[0]['doc_content']);   67         $view_doc->assign("DOC_CONTENT",(!get_magic_quotes_gpc ()) ? stripslashes($result[0]['doc_content']) : $result[0]['doc_content']);
55         <> 68  
      69         /* <rf> search engine friendly mod */
      70         if($config['seftags']) {
      71                 $meta['siteTitle'] = $result[0]['doc_name'];           
      72                 $meta['metaDescription'] = substr(strip_tags($result[0]['doc_content']),0,35);
      73                 $meta['sefSiteTitle'] = $result[0]['doc_metatitle'];
      74                 $meta['sefSiteDesc'] = $result[0]['doc_metadesc'];
      75                 $meta['sefSiteKeywords'] = $result[0]['doc_metakeywords'];
      76         } else {
56         $meta['siteTitle'] = $config['siteTitle']." - ".$result[0]['doc_name'];   77                 $meta['siteTitle'] = $config['siteTitle']." - ".$result[0]['doc_name'];
57         $meta['metaDescription'] = substr(strip_tags($result[0]['doc_content']),0,35);   78                 $meta['metaDescription'] = substr(strip_tags($result[0]['doc_content']),0,35);
58     79         }
      80         /* <rf> end mod */     
59 } else { = 81 } else {
60           82        
61         $view_doc->assign("DOC_NAME",$lang['front']['viewDoc']['error']);   83         $view_doc->assign("DOC_NAME",$lang['front']['viewDoc']['error']);
62         $view_doc->assign("DOC_CONTENT",$lang['front']['viewDoc']['does_not_exist']);   84         $view_doc->assign("DOC_CONTENT",$lang['front']['viewDoc']['does_not_exist']);
63     85  
64 }   86 }
65     87  
66 $view_doc->parse("view_doc");   88 $view_doc->parse("view_doc");
67 $page_content = $view_doc->text("view_doc");   89 $page_content = $view_doc->text("view_doc");
68 ?>   90 ?>
   
File: includes\content\viewProd.inc.php  
32         exit; = 32         exit;
33 }   33 }
34     34  
35     35  
36 // query database   36 // query database
37 $_GET['productId'] = treatGet($_GET['productId']);   37 $_GET['productId'] = treatGet($_GET['productId']);
    <> 38 /* <rf> search engine friendly mod */
      39 if($config['seftags']) {
      40         $query = "SELECT prod_metatitle, prod_metadesc, prod_metakeywords, productId, productCode, quantity, name, description, image, noImages, price, popularity, sale_price, stock_level, useStockLevel, digital, digitalDir, cat_name, ".$glob['dbprefix']."CubeCart_inventory.cat_id, cat_father_id, cat_image, per_ship, item_ship, item_int_ship, per_int_ship, noProducts FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN ".$glob['dbprefix']."CubeCart_category ON ".$glob['dbprefix']."CubeCart_inventory.cat_id = ".$glob['dbprefix']."CubeCart_category.cat_id where productId = ".$db->mySQLSafe($_GET['productId']);
      41 } else {
38 $query = "SELECT productId, productCode, quantity, name, description, image, noImages, price, popularity, sale_price, stock_level, useStockLevel, digital, digitalDir, cat_name, ".$glob['dbprefix']."CubeCart_inventory.cat_id, cat_father_id, cat_image, per_ship, item_ship, item_int_ship, per_int_ship, noProducts FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN ".$glob['dbprefix']."CubeCart_category ON ".$glob['dbprefix']."CubeCart_inventory.cat_id = ".$glob['dbprefix']."CubeCart_category.cat_id where productId = ".$db->mySQLSafe($_GET['productId']);   42         $query = "SELECT productId, productCode, quantity, name, description, image, noImages, price, popularity, sale_price, stock_level, useStockLevel, digital, digitalDir, cat_name, ".$glob['dbprefix']."CubeCart_inventory.cat_id, cat_father_id, cat_image, per_ship, item_ship, item_int_ship, per_int_ship, noProducts FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN ".$glob['dbprefix']."CubeCart_category ON ".$glob['dbprefix']."CubeCart_inventory.cat_id = ".$glob['dbprefix']."CubeCart_category.cat_id where productId = ".$db->mySQLSafe($_GET['productId']);
      43 }
      44 /* <rf> end mod */
39   = 45  
40 $prodArray = $db->select($query);   46 $prodArray = $db->select($query);
41     47  
    <> 48 /* <rf> search engine friendly mod */
      49 if($config['seftags']) {
      50  
      51         // get the native language for the category name
      52         $resultForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' AND cat_master_id = ".$db->mySQLSafe($prodArray[0]['cat_id']));        
      53         if($resultForeign == TRUE){                    
      54                 $prodArray[0]['cat_name'] = $resultForeign[0]['cat_name'];             
      55         }
      56  
      57         // get alternate language title for this product
      58         $sefval = "";
      59         $sefLangProdTitle = $prodArray[0]['name'];
      60         if(($sefval = prodAltLang($prodArray[0]['productId'])) == TRUE){                       
      61                 // change the titles as they make more sense to the user if they are in their native languages
      62                 // however to the search engine they will always be in the default language regardless as they can't change languages
      63                 $sefLangProdTitle = $sefval['name'];   
      64                 // don't worry about description it will always be in the default language regardless as search
      65                 // engines can't change languages      
      66         }
      67  
      68         // create title and metas
      69         $prevDirSymbol = $config['dirSymbol'];
      70         $config['dirSymbol'] = ' - ';
      71         if($config['sefprodnamefirst']) {
      72                 $meta['siteTitle'] = $sefLangProdTitle.$config['dirSymbol'].getCatDir($prodArray[0]['cat_name'],$prodArray[0]['cat_father_id'], $prodArray[0]['cat_id'], FALSE, TRUE, FALSE);
      73         } else {
      74                 $meta['siteTitle'] = getCatDir($prodArray[0]['cat_name'],$prodArray[0]['cat_father_id'], $prodArray[0]['cat_id'], FALSE, TRUE).$config['dirSymbol'].$sefLangProdTitle;         
      75         }
      76         $config['dirSymbol'] = $prevDirSymbol;
      77         $meta['sefSiteTitle'] = $prodArray[0]['prod_metatitle'];
      78         $meta['sefSiteDesc'] = $prodArray[0]['prod_metadesc'];
      79         $meta['sefSiteKeywords'] = $prodArray[0]['prod_metakeywords'];
      80 } else {
42 $meta['siteTitle'] = $config['siteTitle']." - ".$prodArray[0]['name'];   81         $meta['siteTitle'] = $config['siteTitle']." - ".$prodArray[0]['name'];
      82 }
      83 /* <rf> end mod */
43 $meta['metaDescription'] = substr(strip_tags($prodArray[0]['description']),0,35); = 84 $meta['metaDescription'] = substr(strip_tags($prodArray[0]['description']),0,35);
44     85  
45 $view_prod = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/viewProd.tpl");   86 $view_prod = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/viewProd.tpl");
46     87  
47 if($prodArray == TRUE){   88 if($prodArray == TRUE){
48           89        
 
65         $view_prod->assign("LANG_PRODCODE",$lang['front']['viewProd']['product_code']); = 106         $view_prod->assign("LANG_PRODCODE",$lang['front']['viewProd']['product_code']);
66         $view_prod->assign("LANG_TELLFRIEND",$lang['front']['viewProd']['tellafriend']);   107         $view_prod->assign("LANG_TELLFRIEND",$lang['front']['viewProd']['tellafriend']);
67         $view_prod->assign("TXT_PRODTITLE",validHTML($prodArray[0]['name']));   108         $view_prod->assign("TXT_PRODTITLE",validHTML($prodArray[0]['name']));
68         $view_prod->assign("TXT_DESCRIPTION",$prodArray[0]['description']);   109         $view_prod->assign("TXT_DESCRIPTION",$prodArray[0]['description']);
69           110        
70         if(isset($_GET['add']) && isset($_GET['quan'])){   111         if(isset($_GET['add']) && isset($_GET['quan'])){
    <> 112 /* <rf> start seo mod */
71                 $view_prod->assign("CURRENT_URL",str_replace(array("&amp;add=".$_GET['add'],"&amp;quan=".$_GET['quan']),"",currentPage()));   113                 $view_prod->assign("CURRENT_URL",str_replace(array("&amp;add=".$_GET['add'],"&amp;quan=".$_GET['quan']),"",currentPage(TRUE)));
      114 /* <rf> end seo mod */
72         } else { = 115         } else {
    <> 116 /* <rf> start seo mod */
73                 $view_prod->assign("CURRENT_URL",currentPage());   117                 $view_prod->assign("CURRENT_URL",currentPage(TRUE));
      118 /* <rf> end seo mod */
74         } = 119         }
75     120  
76         if(salePrice($prodArray[0]['price'], $prodArray[0]['sale_price'])==FALSE){   121         if(salePrice($prodArray[0]['price'], $prodArray[0]['sale_price'])==FALSE){
77                 $view_prod->assign("TXT_PRICE",priceFormat($prodArray[0]['price']));   122                 $view_prod->assign("TXT_PRICE",priceFormat($prodArray[0]['price']));
78         } else {   123         } else {
79                 $view_prod->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($prodArray[0]['price'])."</span>");   124                 $view_prod->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($prodArray[0]['price'])."</span>");
   
File: includes\functions.inc.php  
93         = 93        
94 }   94 }
95     95  
96 //////////////////////////////////   96 //////////////////////////////////
97 // Get current page   97 // Get current page
98 ////////   98 ////////
    <> 99 /* <rf> start seo mod */
99 function currentPage(){   100 function currentPage($base=FALSE){
100           101 /* <rf> end seo mod */
101         global $glob,$config; = 102         global $glob,$config;
102           103        
103         $storeURL = str_replace("http://","",$glob['storeURL']);   104         $storeURL = str_replace("http://","",$glob['storeURL']);
104         $storeURL_SSL = str_replace("https://","",$config['storeURL_SSL']);   105         $storeURL_SSL = str_replace("https://","",$config['storeURL_SSL']);
    <> 106 /* <rf> start seo mod */
      107         if($base == TRUE) {
      108                 $_SERVER['PHP_SELF'] = 'index.php';
105           109         }
      110 /* <rf> end seo mod */
106         if($storeURL!==$storeURL_SSL && $config['ssl']==1){ = 111         if($storeURL!==$storeURL_SSL && $config['ssl']==1){
107           112        
108                 // for shared SSL full URL   113                 // for shared SSL full URL
109                 $currentPage = $GLOBALS['storeURL'].str_replace($GLOBALS['rootRel'],"/",treatGet($_SERVER['PHP_SELF']));   114                 $currentPage = $GLOBALS['storeURL'].str_replace($GLOBALS['rootRel'],"/",treatGet($_SERVER['PHP_SELF']));
110           115        
111         } else {   116         } else {
 
207         else = 212         else
208                 return round($rawSize, 1) . ' Bytes';   213                 return round($rawSize, 1) . ' Bytes';
209 }   214 }
210 //////////////////////////////////   215 //////////////////////////////////
211 // Get Category Directory   216 // Get Category Directory
212 ////////   217 ////////
213 function getCatDir($catName, $cat_father_id, $catId, $link=FALSE){ <> 218 /* <rf> search engine friendly url mod */
      219 function getCatDir($catName, $cat_father_id, $catId, $link=FALSE, $skipFirstSymbol=FALSE, $reverseSort=TRUE){
      220 /* <rf> end mod */
214         = 221        
215         global $sessId,$db,$config,$glob,$lang_folder;   222         global $sessId,$db,$config,$glob,$lang_folder;
216           223        
217         // get category array for cat dir   224         // get category array for cat dir
218         $query = "SELECT cat_id, cat_name, cat_father_id FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC";   225         $query = "SELECT cat_id, cat_name, cat_father_id FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC";
219         $catArray = $db->select($query);   226         $catArray = $db->select($query);
220           227        
221         // get category array in foreign innit   228         // get category array in foreign innit
222         $resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'");   229         $resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'");
223           230        
    <> 231         /* <rf> mod to make immediate category level a link also */
      232         if($link == TRUE){
      233                 /* <rf> search engine friendly mods */ 
      234                 if($config['sef'] == 0) {              
      235                         $dirArray[0] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catId."&amp;act=viewCat' class='txtLocation'>".$catName."</a>";
      236                 } else {                       
      237                         $dirArray[0] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?act=viewCat&amp;catId=".$catId."' class='txtLocation'>".$catName."</a>";                
      238                 }
      239                 /* <rf> end mod */
      240         } else {                       
224         $dirArray[0] = $config['dirSymbol'].$catName;   241                 $dirArray[0] = $config['dirSymbol'].$catName;  
      242         }
      243         /* <rf> end of mod to make immediate category level a link also */
225         = 244        
226         for ($i=0; $i<=count($catArray); $i++) {   245         for ($i=0; $i<=count($catArray); $i++) {
227                   246                
228                 if(is_array($resultsForeign)){   247                 if(is_array($resultsForeign)){
229     248  
230                         for ($k=0; $k<count($resultsForeign); $k++){   249                         for ($k=0; $k<count($resultsForeign); $k++){
 
239                 = 258                
240                 }   259                 }
241                   260                
242                 if(isset($catArray[$i]['cat_id']) && $catArray[$i]['cat_id']==$cat_father_id) {   261                 if(isset($catArray[$i]['cat_id']) && $catArray[$i]['cat_id']==$cat_father_id) {
243                           262                        
244                         if($link == TRUE){   263                         if($link == TRUE){
245                         <> 264 /* <rf> search engine friendly mods */ 
      265                                 if($config['sef'] == 0) {              
246                                 $dirArray[$i+1] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catArray[$i]['cat_id']."&amp;act=viewCat' class='txtLocation'>".$catArray[$i]['cat_name']."</a>";   266                                         $dirArray[$i+1] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catArray[$i]['cat_id']."&amp;act=viewCat' class='txtLocation'>".$catArray[$i]['cat_name']."</a>";
      267                         } else {                       
      268                                 $dirArray[$i+1] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?act=viewCat&amp;catId=".$catArray[$i]['cat_id']."' class='txtLocation'>".$catArray[$i]['cat_name']."</a>";                   
247                           269                         }
      270  
      271 /* <rf> end mod */
      272  
248                         } else { = 273                         } else {
249                           274                        
250                         $dirArray[$i+1]= $config['dirSymbol'].$catArray[$i]['cat_name'];   275                         $dirArray[$i+1]= $config['dirSymbol'].$catArray[$i]['cat_name'];
251                           276                        
252                         }   277                         }
253                           278                        
254                         $cat_father_id = $catArray[$i]['cat_father_id'];   279                         $cat_father_id = $catArray[$i]['cat_father_id'];
255                   280                
256                 }   281                 }
257           282        
258         }   283         }
259                 <> 284  
      285         /* <rf> search engine friendly url mod */              
      286         if($reverseSort) {
260         krsort($dirArray);   287                 krsort($dirArray);
      288         } else {
      289                 ksort($dirArray);
      290         }
      291         /* <rf> end mod */
      292  
261         reset($dirArray); = 293         reset($dirArray);
262           294        
263         $dir = "";   295         $dir = "";
264           296        
265         foreach($dirArray as $key => $value){   297         foreach($dirArray as $key => $value){
266                 $dir.= $value;   298                 $dir.= $value;
267         }   299         }
    <> 300  
      301     /* <rf> search engine friendly url mod */
      302         if($skipFirstSymbol) {
      303                 $dir = substr($dir, strlen($config['dirSymbol']));
      304         }
      305     /* <rf> end mod */
268   = 306  
269         return $dir;   307         return $dir;
270 }   308 }
271 //////////////////////////////////   309 //////////////////////////////////
272 // Change table data class alternately   310 // Change table data class alternately
273 ////////   311 ////////
   
File: includes\sessionStart.inc.php  
33 } else { = 33 } else {
34         $sessionName = "ccSID".md5($glob['rootRel']);   34         $sessionName = "ccSID".md5($glob['rootRel']);
35 }   35 }
36     36  
37 session_name($sessionName);   37 session_name($sessionName);
38 @ini_set("session.cookie_path",$sessionDomain);   38 @ini_set("session.cookie_path",$sessionDomain);
    <> 39 // session_start();  <rf> search engine friendly url mod
      40 search_friendly_session_start();
      41  
      42 /* <rf> search engine friendly url mod */
      43 function search_friendly_session_start() {
      44         global $config;
      45  
      46         if(user_is_search_engine() == false || $config['sef'] == 0) {
39 session_start(); = 47 session_start();
    <> 48         }
      49 }
      50  
      51 function user_is_search_engine() {
      52         global $glob;
      53  
      54         $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
      55         $spider_flag = false;
      56  
      57         if (($user_agent != '') && (strtolower($user_agent) != 'null') && (strlen(trim($user_agent)) > 0)) {
      58                 $spiders = file($glob['rootDir'].'/spiders.txt');
      59                 foreach ($spiders as $spider) {
      60                 if (($spider != '') && (strtolower($spider) != 'null') && (strlen(trim($spider)) > 0)) {
      61                         if (strpos($user_agent, trim($spider)) !== false) {
      62                                         $spider_flag = true;
      63                                         break;
      64                                 }
      65                 }
      66                 }
      67         }
      68  
      69         return $spider_flag;
      70 }
      71  
      72 /* <rf> end of mod */
      73  
40 ?> = 74 ?>
   
File: index.php  
51         $db = new db(); = 51         $db = new db();
52         include_once("includes/functions.inc.php");   52         include_once("includes/functions.inc.php");
53         $config = fetchDbConfig("config");   53         $config = fetchDbConfig("config");
54           54        
55         include_once("includes/sessionStart.inc.php");   55         include_once("includes/sessionStart.inc.php");
56           56        
    -+ 57         /* <rf> search engine friendly url mod */
      58         include_once("includes/sef_urls.inc.php");     
      59         $sefroot = sef_script_name();
      60         if($config['sef'] == 0 && preg_match('#'.$glob['rootRel'].$sefroot.'#i', $_SERVER['PHP_SELF'])) {
      61                 // if this script got called by the shop script and we aren't using sef urls then redirect to index.php
      62                 Header("Location: ".$glob['rootRel']."index.php");
      63         }
      64         /* <rf> end of mod */
      65        
57         include_once("includes/sslSwitch.inc.php"); = 66         include_once("includes/sslSwitch.inc.php");
58           67        
59         // get session data   68         // get session data
60         include_once("includes/session.inc.php");   69         include_once("includes/session.inc.php");
61           70        
62         // get exchange rates etc   71         // get exchange rates etc
 
156         = 165        
157         }   166         }
158         // END MAIN CONTENT   167         // END MAIN CONTENT
159           168        
160         // START META DATA   169         // START META DATA
161         if(isset($meta)){   170         if(isset($meta)){
162                 $body->assign("META_TITLE",htmlspecialchars($meta['siteTitle']).c()); <> 171                 /* <rf> search engine friendly url mod */
      172                 $body->assign("META_TITLE", sefMetaTitle());
163                 $body->assign("META_DESC",$meta['metaDescription']);   173                 $body->assign("META_DESC", sefMetaDesc());
164                 $body->assign("META_KEYWORDS",$config['metaKeyWords']);   174                 $body->assign("META_KEYWORDS", sefMetaKeywords());
      175                 /* <rf> end mod */
165         } else { = 176         } else {
166                 $body->assign("META_TITLE",htmlspecialchars(str_replace("&#39;","'",$config['siteTitle'])).c());   177                 $body->assign("META_TITLE",htmlspecialchars(str_replace("&#39;","'",$config['siteTitle'])).c());
167                 $body->assign("META_DESC",$config['metaDescription']);   178                 $body->assign("META_DESC",$config['metaDescription']);
168                 $body->assign("META_KEYWORDS",$config['metaKeyWords']);   179                 $body->assign("META_KEYWORDS",$config['metaKeyWords']);
169         }   180         }
170           181