????

Your IP : 216.73.216.174


Current Path : /home2/morganrand/www/store/admin/
Upload File :
Current File : /home2/morganrand/www/store/admin/sitemap.php

<?php
/*
  $Id: sitemap.php,v 4.3 2013/10/22
  Released under the GNU General Public License
*/

  require('includes/application_top.php');
	require(DIR_WS_FUNCTIONS. 'dynamic_sitemap.php');

  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

  if (tep_not_null($action)) {
    switch ($action) {
      case 'ex_file':
        if ($HTTP_POST_VARS['ex_type'] == 'all')
        	$ex_type = 1;
        	
        if ($HTTP_POST_VARS['ex_type'] == 'unreg')
        	$ex_type = 2;

      	$file = tep_db_prepare_input($HTTP_POST_VARS['file']);
				if (tep_not_null($file) && tep_not_null($ex_type))
							 tep_db_query('insert into ' . TABLE_SITEMAP_EXCLUDE . ' values(NULL,"' . tep_db_input($file) . '","' . (int)$ex_type . '",0)');

        tep_redirect(tep_href_link(FILENAME_SITEMAP));
        break;
      case 'ex_box':
        if ($HTTP_POST_VARS['ex_type'] == 'all')
        	$ex_type = 1;

        if ($HTTP_POST_VARS['ex_type'] == 'unreg')
        	$ex_type = 2;

      	$file = $HTTP_POST_VARS['box'];
				if (tep_not_null($file) && tep_not_null($ex_type))
							 tep_db_query('insert into ' . TABLE_SITEMAP_EXCLUDE . ' values(NULL,"' . tep_db_input($file) . '","' . (int)$ex_type . '",1)');

        tep_redirect(tep_href_link(FILENAME_SITEMAP));
        break;
      case 'include':
				if ($eID = tep_db_prepare_input($HTTP_GET_VARS['eID']))
							tep_db_query('delete from ' . TABLE_SITEMAP_EXCLUDE . ' where exclude_id="' . (int)$eID . '"');

        tep_redirect(tep_href_link(FILENAME_SITEMAP));
        break;
    }
  }
 
 require(DIR_WS_INCLUDES . 'template_top.php');
?>
        <!-- body_text //-->
          <table border="0" width="100%" cellspacing="0" cellpadding="2">
            <tr>
              <td width="100%">
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
                    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
                  </tr>
                  <tr>
                    <td class="main"><?php echo tep_draw_form('set_frequencies', FILENAME_CREATE_XML_SITEMAPS, 'selected_box=tools');
          $freq = array('always' => TEXT_ALWAYS,
                        'hourly' => TEXT_HOURLY,
                        'daily' => TEXT_DAILY,
                        'weekly' => TEXT_WEEKLY,
                        'monthly' => TEXT_MONTHLY,
                        'yearly' => TEXT_YEARLY,
                        'never' => TEXT_NEVER); ?>
                      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="headerBar">
                        <tr class="main">
                          <td width="50%" valign="top" class="infoBoxContent"><?php echo TEXT_CHOOSE_CATMFG_FREQ; ?></td>
                          <td width="50%" valign="top" class="infoBoxContent"><?php echo TEXT_CHOOSE_SALE_FREQ; ?></td>
                        </tr>
                        <tr class="main">
                          <td width="50%" class="infoBoxContent"><?php
            foreach ($freq as $name => $text)
              {echo tep_draw_radio_field('cmcf',$name,($name == 'weekly'));
              echo $text.'<br />';} ?></td>
                          <td width="50%" class="infoBoxContent"><?php
            foreach ($freq as $name => $text)
              {echo tep_draw_radio_field('scf',$name,($name == 'monthly'));
              echo $text.'<br />';} ?></td>
                        </tr>
                      </table>
                      <p><?php echo TEXT_SELECT_TIMEZONE; ?><br />
                        <select id="tz" name="tz" size="1">
                          <option value="au_cdt">ACDT - Australian Central Daylight Time (Australia)</option>
                          <option value="au_cst">ACST - Australian Central Standard Time (Australia)</option>
                          <option value="na_adt">ADT - Atlantic Daylight Time (North America)</option>
                          <option value="au_edt">AEDT - Australian Eastern Daylight Time (Australia)</option>
                          <option value="au_est">AEST - Australian Eastern Standard Time (Australia)</option>
                          <option value="na_akdt">AKDT - Alaska Daylight Time (North America)</option>
                          <option value="na_akst">AKST - Alaska Standard Time (North America)</option>
                          <option value="na_ast">AST - Atlantic Standard Time (North America)</option>
                          <option value="au_wdt">AWDT - Australian Western Daylight Time (Australia)</option>
                          <option value="au_wst">AWST - Australian Western Standard Time (Australia)</option>
                          <option value="eu_bst">BST - British Summer Time (Europe)</option>
                          <option value="na_cdt">CDT - Central Daylight Time (North America)</option>
                          <option value="eu_cest">CEDT - Central European Daylight Time (Europe)</option>
                          <option value="eu_cest">CEST - Central European Summer Time (Europe)</option>
                          <option value="eu_cet">CET - Central European Time (Europe)</option>
                          <option value="au_cst">CST - Central Standard Time (Australia)</option>
                          <option value="na_cst">CST - Central Standard Time (North America)</option>
                          <option value="au_cdt">CST - Central Summer(Daylight) Time (Australia)</option>
                          <option value="au_cxt">CXT - Christmas Island Time (Australia)</option>
                          <option value="na_edt">EDT - Eastern Daylight Time (North America)</option>
                          <option value="eu_eest">EEDT - Eastern European Daylight Time (Europe)</option>
                          <option value="eu_eest">EEST - Eastern European Summer Time (Europe)</option>
                          <option value="eu_eet">EET - Eastern European Time (Europe)</option>
                          <option value="au_est">EST - Eastern Standard Time (Australia)</option>
                          <option value="na_est">EST - Eastern Standard Time (North America)</option>
                          <option value="au_edt">EST - Eastern Summer(Daylight) Time (Australia)</option>
                          <option value="eu_gmt">GMT - Greenwich Mean Time (Europe)</option>
                          <option value="na_adt">HAA - Heure Avanc&#233;e de l'Atlantique (North America)</option>
                          <option value="na_cdt">HAC - Heure Avanc&#233;e du Centre (North America)</option>
                          <option value="na_hadt">HADT - Hawaii-Aleutian Daylight Time (North America)</option>
                          <option value="na_edt">HAE - Heure Avanc&#233;e de l'Est (North America)</option>
                          <option value="na_pdt">HAP - Heure Avanc&#233;e du Pacifique (North America)</option>
                          <option value="na_mdt">HAR - Heure Avanc&#233;e des Rocheuses (North America)</option>
                          <option value="na_hast">HAST - Hawaii-Aleutian Standard Time (North America)</option>
                          <option value="na_ndt">HAT - Heure Avanc&#233;e de Terre-Neuve (North America)</option>
                          <option value="na_akdt">HAY - Heure Avanc&#233;e du Yukon (North America)</option>
                          <option value="na_ast">HNA - Heure Normale de l'Atlantique (North America)</option>
                          <option value="na_cst">HNC - Heure Normale du Centre (North America)</option>
                          <option value="na_est">HNE - Heure Normale de l'Est (North America)</option>
                          <option value="na_pst">HNP - Heure Normale du Pacifique (North America)</option>
                          <option value="na_mst">HNR - Heure Normale des Rocheuses (North America)</option>
                          <option value="na_nst">HNT - Heure Normale de Terre-Neuve (North America)</option>
                          <option value="na_akst">HNY - Heure Normale du Yukon (North America)</option>
                          <option value="eu_ist">IST - Irish Summer Time (Europe)</option>
                          <option value="na_mdt">MDT - Mountain Daylight Time (North America)</option>
                          <option value="eu_cest">MESZ - Mitteleurop&#228;ische Sommerzeit (Europe)</option>
                          <option value="eu_cet">MEZ - Mitteleurop&#228;ische Zeit (Europe)</option>
                          <option value="na_mst">MST - Mountain Standard Time (North America)</option>
                          <option value="na_ndt">NDT - Newfoundland Daylight Time (North America)</option>
                          <option value="au_nft">NFT - Norfolk (Island) Time (Australia)</option>
                          <option value="na_nst">NST - Newfoundland Standard Time (North America)</option>
                          <option value="na_pdt">PDT - Pacific Daylight Time (North America)</option>
                          <option value="na_pst" selected>PST - Pacific Standard Time (North America)</option>
                          <option value="eu_gmt">UTC - Coordinated Universal Time (Europe)</option>
                          <option value="eu_west">WEDT - Western European Daylight Time (Europe)</option>
                          <option value="eu_west">WEST - Western European Summer Time (Europe)</option>
                          <option value="eu_wet">WET - Western European Time (Europe)</option>
                          <option value="au_wst">WST - Western Standard Time (Australia)</option>
                          <option value="au_wdt">WST - Western Summer(Daylight) Time (Australia)</option>
                        </select></p>
                      <p><?php echo tep_draw_button(IMAGE_UPDATE, 'pencil'); 
         echo TEXT_CREATE_XML .'</p></form><p>'.TEXT_CONTROL_XML; ?></p>
                    </td>
                    <td></td>
                  </tr>
                </table>
              </td>
            </tr>
            <?php

//get all files in catalog/

	 $excluded_query = tep_db_query('select exclude_file from '.TABLE_SITEMAP_EXCLUDE.' where exclude_type != 0 and is_box = 0');
	 $excluded_array = array();
	 $files = array();
	 if (tep_db_num_rows($excluded_query))
	  while($ex = tep_db_fetch_array($excluded_query))
   			$excluded_array[] = $ex['exclude_file'];

	 if ($handle = opendir(DIR_FS_CATALOG)){
     while ($file = readdir($handle)){
		   if(!is_dir($file) && (strtolower(substr($file, -4, 4)) === ".php")) { //only look at php files
				 if (!in_array($file, $excluded_array)){
				   $engFile = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/' . $file;
				   if (file_exists($engFile) && IsViewable(DIR_FS_CATALOG . $file)) {
				     $fp = GetDefinition($engFile, 'HEADING_TITLE');
		         if ($fp !== false)	{
				         $files[] = array('id' => $file,
																  'text' => str_replace(array('%s', "\'"), array('', "'"), ucfirst($fp)));
			       } else $files[] = array('id' => $file, 'text' => '? (' . $file . ')');
				   }
		     }
		   }
		 }
		 closedir($handle);

 } else echo ERROR_CANNOT_OPEN_CATALOG_DIR . DIR_FS_CATALOG . '<br />';
 
 
 //get all catalog boxes
 
	 $excluded_query = tep_db_query('select exclude_file from ' . TABLE_SITEMAP_EXCLUDE . ' where exclude_type != 0 and is_box = 1');
	 $excluded_array = array();

	 if (tep_db_num_rows($excluded_query))
	  while($ex = tep_db_fetch_array($excluded_query))
   		$excluded_array[] = $ex['exclude_file'];
  $pathLanguage = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/modules/boxes/';
  $boxes = array();
  if ($handle = opendir(DIR_FS_CATALOG . DIR_WS_MODULES . 'boxes/')) {
    while ($file = readdir($handle)) {
       if (strtolower(substr($file, -4, 4)) != ".php")
          continue;
			 elseif (in_array($file ,$excluded_array))
			    continue;

       $fp = file(DIR_FS_CATALOG . DIR_WS_MODULES . 'boxes/' . $file);
       $content_lines = array();
       $boxLanguage = file($pathLanguage . $file);
       $boxname = '';
       foreach ($fp as $line) {
         if (strpos($line, "infoBoxHeading") !== false) {
           $b = strpos($line, "MODULE_");
           $e = strpos($line, '.', $b);
           $defname = trim(substr($line, $b, $e - $b));
           $boxname = GetDefinition($boxLanguage, $defname);
           break;
         }
       }
       if (($boxname != '') && ($boxname !== false)) {
         $boxes[] = array('id' => $file, 'text' => $boxname);
       } else {
         $boxes[] = array('id' => $file, 'text' => $file);
       }

    }
    closedir($handle);

	}  else echo ERROR_CANNOT_OPEN_CATALOG_BOXES_DIR . DIR_FS_CATALOG.DIR_WS_MODULES . 'boxes/<br />';
?>
            <tr>
              <td>
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top">
                      <table border="0" cellspacing="0" cellpadding="2" width="100%">
                        <tr>
                          <td class="main" width="50%"><?php echo TITLE_CATALOG_FILES?></td>
                          <td class="main" width="50%"><?php echo TITLE_CATALOG_BOXES?></td>
                        </tr>
                        <tr>
                          <td class="main" width="50%" valign="top" align="left">
                            <?php echo tep_draw_form('ex_file', FILENAME_SITEMAP,'action=ex_file');?>
                            <table border="0" cellspacing="0" cellpadding="2">
                              <tr>
                                <td colspan="2" class="main"><?php echo tep_draw_pull_down_menu('file',$files);?></td>
                              </tr>
                              <tr>
                                <td class="main"><?php echo TEXT_EXCLUDE_FOR_ALL.tep_draw_radio_field('ex_type','all', true).'<br />'.TEXT_EXCLUDE_FOR_UNREG.tep_draw_radio_field('ex_type','unreg');?></td>
                                <td class="main" align="right"><?php echo tep_draw_button(IMAGE_EXCLUDE, 'close')?></td>
                              </tr>
                            </table>
                            </form>
                            <table border="1" cellspacing="0" cellpadding="2" width="95%" align="left">
                              <tr>
                                <td class="formAreaTitle"><?php echo TITLE_EXCLUDED_CATALOG_FILES?></td>
                              </tr>
                              <tr>
                                <td class="main"><?php
                                $exclude_query = tep_db_query('select exclude_id, exclude_file, exclude_type from ' . TABLE_SITEMAP_EXCLUDE . ' where is_box="0" and exclude_type!="0" order by exclude_type, exclude_file');
                                while($exclude = tep_db_fetch_array($exclude_query)){
                                  echo '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td class="main">'.$exclude['exclude_file'].'</td><td class="main" align="right">(' . ( $exclude['exclude_type'] == 1 ? TEXT_ALL : TEXT_UNREG ) . ')</td><td class="main" align="right" width="50"><a href="' . tep_href_link(FILENAME_SITEMAP, 'action=include&amp;eID=' . $exclude['exclude_id']) . '">' . TEXT_INCLUDE . '</a></td></tr></table>';
                                }
                                ?></td>
                              </tr>
                            </table>
                          </td>
                          <td class="main" width="50%" valign="top" align="left">
                            <?php echo tep_draw_form('ex_box', FILENAME_SITEMAP,'action=ex_box');?>
                            <table border="0" cellspacing="0" cellpadding="2">
                              <tr>
                                <td><?php echo tep_draw_pull_down_menu('box',$boxes);?></td>
                              </tr>
                              <tr>
                                <td class="main"><?php echo TEXT_EXCLUDE_FOR_ALL . tep_draw_radio_field('ex_type','all', true) . '<br />' . TEXT_EXCLUDE_FOR_UNREG . tep_draw_radio_field('ex_type','unreg');?></td>
                                <td class="main" align="right"><?php echo tep_draw_button(IMAGE_EXCLUDE, 'close')?></td>
                              </tr>
                            </table>
                            </form>
                            <table border="1" cellspacing="0" cellpadding="2" width="95%" align="left">
                              <tr>
                                <td class="formAreaTitle"><?php echo TITLE_EXCLUDED_CATALOG_BOXES?></td>
                              </tr>
                              <tr>
                                <td class="main"><?php
                                $exclude_query = tep_db_query('select exclude_id, exclude_file, exclude_type from '.TABLE_SITEMAP_EXCLUDE.' where is_box="1" and exclude_type!="0" order by exclude_type, exclude_file');
                                while($exclude = tep_db_fetch_array($exclude_query)){
                                  echo '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td class="main">' . $exclude['exclude_file'] . '</td><td class="main" align="right">(' . ( $exclude['exclude_type'] == 1 ? TEXT_ALL : TEXT_UNREG ) . ')</td><td class="main" align="right" width="50"><a href="' . tep_href_link(FILENAME_SITEMAP, 'action=include&amp;eID=' . $exclude['exclude_id']) . '">' . TEXT_INCLUDE . '</a></td></tr></table>';
                                }
                                ?></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>

<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>