Extra Info Page

Ask the community for help and support.
Post Reply
ce7
Posts: 26
Joined: Tue Apr 06, 2021 12:26 am
Has thanked: 21 times

Extra Info Page

Post by ce7 »

Hi there,
I have installed few addons (2.2/2.3/BS/CE/Phoenix) on 1087 version. So far tested no error till try to add extra info page from admin/tool.

I found I can modify the information links and content, however if I publish new page, it will not show up on front page, do I miss out something else I need to add in order to show on front page?


Because of this experience, I installed a CE addon call Extra Info Page. There are two issues with this addon,
1st
is the content will all automatically set to 1, however if you write old/new content it will still be update. When you click on edit button, it will become 1 for title or content. I am not sure where to modify this in order to make it retrieve the info from database properly.

2nd
with the new page that link external or popup, it will do the function as described, however if it is infopage, then when link to extra_info_pages.php?pages_id=1, it will say forbidden, and internal page will just link to index.

Can anyone there give advice of how to fix the problems?

Code: Select all

/*
  Extra Infopages reloaded v1.6 (c) @denzel 2020 
  for osC Phoenix CE v1.0.4.0 (c) @burt 2019

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002

  Released under the GNU General Public License
*/

  $useicons = true; // switch on/off FontAwesome-Icons in Pagetitle (true/false)
  
  require('includes/application_top.php');
  $action = (isset($_GET['action']) ? $_GET['action'] : '');
  $languages = tep_get_languages();

  if (tep_not_null($action)) {
    switch ($action) {
      case 'setflag':
        if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
		  tep_db_query("UPDATE pages0340 SET status = '" . $_GET['flag'] . "'  WHERE pages_id = '" . $_GET['bID'] . "'");
          $messageStack->add_session(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        } else {
          $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
        }
        tep_redirect(tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']));
        break;
      case 'copy_confirm':
        if (isset($_GET['bID'])) {
          $pages_id = tep_db_prepare_input($_GET['bID']);

            $page_query = tep_db_query("SELECT * FROM pages0340 WHERE pages_id = '" . (int)$pages_id . "'");
            $page = tep_db_fetch_array($page_query);

            tep_db_query("INSERT INTO pages0340 (sort_order, status, page_type) VALUES ('" . tep_db_input($page['sort_order']) . "', '0', '" . tep_db_input($page['page_type']) . "')");
            $dup_pages_id = tep_db_insert_id();

            $description_query = tep_db_query("SELECT * FROM pages_description0340 WHERE pages_id = '" . (int)$pages_id . "'");
            while ($description = tep_db_fetch_array($description_query)) {
              tep_db_query("INSERT INTO pages_description0340 (pages_id, pages_icon, language_id, pages_title, pages_html_text, linktarget, linktype) VALUES ('" . (int)$dup_pages_id . "', '". tep_db_input($description['pages_icon']) . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['pages_title']) . "', '" . tep_db_input($description['pages_html_text']) . "', '" . tep_db_input($description['linktarget']) . "', '" . tep_db_input($description['linktype']) . "')");
            }
            $pages_id = $dup_pages_id;

			$messageStack->add_session(SUCCESS_PAGE_COPIED, 'success');
        }
        tep_redirect(tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $pages_id));
        break;
      case 'insert':
      case 'update':
        if (isset($_POST['pages_id'])) $pages_id = tep_db_prepare_input($_POST['pages_id']);
        $sort_order = tep_db_prepare_input($_POST['sort_order']);
        $status = (tep_db_prepare_input($_POST['status']) == 'on' ? 1 : 0);
		$page_error = false;
		for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
			$title_field_name=$_POST['pages_title_'.$languages[$i]['id']];
			if (empty($title_field_name)) {
				$messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');
				$page_error = true;
			}
		}
        if ($page_error == false) {

			for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
				$pages_iconm=$_POST['pages_icon_'.$languages[$i]['id']];
				$pages_titlem=$_POST['pages_title_'.$languages[$i]['id']];
				$pages_html_textm=$_POST['pages_html_text_'.$languages[$i]['id']];
				$linktypem=$_POST['linktype_'.$languages[$i]['id']];
				$internallinkm=$_POST['internallink_'.$languages[$i]['id']];
				$externallinkm=$_POST['externallink_'.$languages[$i]['id']];
				$language_idm='language_id_'.$languages[$i]['id'];
				
				if ($linktypem == 2) $link_targetm = $internallinkm;
				if ($linktypem == 3) $link_targetm = $externallinkm;
				
				$sql_data_array_pages = array('sort_order' => $sort_order,
											  'status' => $status,
											  'page_type'   => $_POST['page_type']);
				$sql_data_array_pages_description = array('pages_title' => $pages_titlem,
														  'pages_icon' => $pages_iconm,
														  'pages_html_text' => stripslashes($pages_html_textm),
														  'linktype'   => $linktypem,
														  'linktarget' => $link_targetm);
				if ($action == 'insert') {
					$bID="";
					if ($i == 0)  {
						tep_db_perform('pages0340', $sql_data_array_pages);
						$pages_id = tep_db_insert_id();
					}
					$pageid_merge= array('pages_id' => $pages_id,
										 'language_id' => $languages[$i]['id']);
					$sql_data_array_pages_desc = array_merge($sql_data_array_pages_description, $pageid_merge);
					tep_db_perform('pages_description0340', $sql_data_array_pages_desc);
					$messageStack->add_session(SUCCESS_PAGE_INSERTED, 'success');
					
				} elseif ($action == 'update') {
					if ($i == 0)  {
						tep_db_perform('pages0340', $sql_data_array_pages, 'update', "pages_id = '" . (int)$pages_id . "'");
					}
					$selectexists=tep_db_query("SELECT COUNT(*) AS 'countrecords' FROM pages_description0340 WHERE pages_id='" . (int)$pages_id . "' and language_id='".$languages[$i]['id']."'");
					$recordexists = tep_db_fetch_array($selectexists);
					if($recordexists['countrecords'] >= 1 )  {
						tep_db_perform('pages_description0340', $sql_data_array_pages_description, 'update', "pages_id = '" . (int)$pages_id . "' and language_id='".$languages[$i]['id']."'");
					} else  {
						$pageid_merge= array('pages_id' => $pages_id,
											 'language_id' => $languages[$i]['id']);
						$sql_data_array_pages_desc = array_merge($sql_data_array_pages_description, $pageid_merge);
						tep_db_perform('pages_description0340', $sql_data_array_pages_desc);
					}
					$messageStack->add_session(SUCCESS_PAGE_UPDATED, 'success');
				}
			} //for

			tep_redirect(tep_href_link('extra_info_pages.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'bID=' . $pages_id));
        } else {
          $action = 'new';
        }
        break;
		
      case 'deleteconfirm':
        $pages_id = tep_db_prepare_input($_GET['bID']);

        tep_db_query("DELETE FROM pages0340 WHERE pages_id = '" . (int)$pages_id . "'");
        tep_db_query("DELETE FROM pages_description0340 WHERE pages_id = '" . (int)$pages_id . "'");

        $messageStack->add_session(SUCCESS_PAGE_REMOVED, 'success');

        tep_redirect(tep_href_link('extra_info_pages.php', 'page=' . $_GET['page']));
        break;
    } // switch
  }
require('includes/template_top.php');
echo '<h1 class="display-4 mb-2">' . HEADING_TITLE . '</h1>';

    $pagetype = array();
    $pagetype[] = array('id' => '1', 'text' => 'Footerbox 1');
    $pagetype[] = array('id' => '2', 'text' => 'Footerbox 2');
    $pagetype[] = array('id' => '3', 'text' => 'unused');
    $pagetype[] = array('id' => '4', 'text' => 'unused');
    $pagetype[] = array('id' => '5', 'text' => 'Sitebox 1');
    $pagetype[] = array('id' => '6', 'text' => 'Sitebox 2');
    $pagetype[] = array('id' => '7', 'text' => 'unused');
    $pagetype[] = array('id' => '8', 'text' => 'unused');
    $pagetype[] = array('id' => '9', 'text' => 'unused');
	
if ($action == 'new') {
    $form_action = 'insert';
    $parameters = array('pages_title' => '',
                        'pages_html_text' => '',
                        'sort_order' =>'',
                        'status' =>'');
    $bInfo = new objectInfo($parameters);

    if (isset($_GET['bID'])) {
      $form_action = 'update';
      $bID = tep_db_prepare_input($_GET['bID']);
      $page_query = tep_db_query("SELECT s.*, p.*
                                  FROM
                                    pages0340 s left join pages_description0340 p on s.pages_id=p.pages_id
                                  WHERE
                                    s.pages_id = '" . (int)$bID . "'");

		while($page = tep_db_fetch_array($page_query))  {
			$languageid=$page['language_id'];
			$page_type=$page['page_type'];
			$pageicon[$languageid]= $page['pages_icon'];
			$pagetitle[$languageid]= $page['pages_title'];
			$sortorder=$page['sort_order'];
			$status=$page['status'];
			$pages_html_text[$languageid]=$page['pages_html_text'];
			$linktype[$languageid]=$page['linktype'];
			if ($linktype[$languageid] == 2) $internallink[$languageid] = $page['linktarget'];
			if ($linktype[$languageid] == 3) $externallink[$languageid] = $page['linktarget'];
		}
    } elseif (tep_not_null($_POST)) {
      $bInfo->objectInfo($_POST);
    }

$bIDif="";
if(!empty($bID) && $bID != "")  {
	$bIDif='&bID='.$bID;
}

	echo tep_draw_form('new_page', 'extra_info_pages.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action.$bIDif, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('pages_id', $bID);

?>

<div id="productTabs">
  <ul id="productTabsMain">
    <li><?php echo '<a href="' . substr(tep_href_link('extra_info_pages.php', tep_get_all_get_params()), strlen(isset($base_url))) . '#section_data_content">' . SECTION_HEADING_DATA . '</a>'; ?></li>
    <li><?php echo '<a href="' . substr(tep_href_link('extra_info_pages.php', tep_get_all_get_params()), strlen(isset($base_url))) . '#section_general_content">' . SECTION_HEADING_GENERAL . '</a>'; ?></li>
  </ul>

  <div id="section_data_content" style="padding: 10px;">
      <div class="form-group row">
        <label for="Pagetype" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_TYPE; ?></label>
        <div class="col-sm-3">
          <?php echo tep_draw_pull_down_menu('page_type', $pagetype, isset($page_type), 'id="Pagetype" class="form-control"'); ?>
        </div>
      </div>
      <div class="form-group row">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_SORT_ORDER ?></label>
        <div class="col-sm-3">
          <?php echo tep_draw_input_field('sort_order', isset($sortorder), 'class="form-control"', false); ?>
        </div>
      </div>
      <div class="form-group row">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_STATUS ?></label>
        <div class="col-sm-3">
          <div class="custom-control custom-switch">
			<input type="checkbox" class="custom-control-input" id="Pagestatus" name="status" <?php echo ((isset($status) == 1) ? 'checked' : ''); ?>>
			<label for="Pagestatus" class="custom-control-label text-muted"><small> <?php echo TEXT_PAGES_STATUS_LABEL;?></small></label>
		  </div>
        </div>
      </div>
  </div>

  <div id="section_general_content" style="padding: 10px;">
    <div id="productLanguageTabs">
      <ul>
<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  echo '<li><a href="' . substr(tep_href_link('extra_info_pages.php', tep_get_all_get_params()), strlen(isset($base_url))) . '#section_general_content_' . $languages[$i]['directory'] . '">' . tep_image('../includes/languages/' . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] . '</a></li>';
}
?>
      </ul>
<?php 
 for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
      <div id="section_general_content_<?php echo $languages[$i]['directory']; ?>">
      <div class="form-group row">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_TITLE . '&nbsp;'; ?></label>
        <div class="col-sm-5">
          <div class="btn-group">
			<?php if ($useicons == true) { ?>
            <button type="button" class="btn btn-secondary iconpicker-component clear-icon">
			  <i class="<?php echo (isset($pageicon[$languages[$i]['id']])?$pageicon[$languages[$i]['id']]:'fab'); ?>"></i>
			</button>
            <button type="button" class="icp icp-dd btn btn-secondary dropdown-toggle" data-selected="fa-car" data-toggle="dropdown">
              <span class="caret"></span>
            </button>
			<?php } // FA-Icons on/off ?>
            <div class="dropdown-menu"></div>
			<?php echo tep_draw_hidden_field('pages_icon_'.$languages[$i]['id'], isset($pageicon[$languages[$i]['id']]), 'id="pages_icon_'.$languages[$i]['id'].'" class="icon"'); ?>
			<?php echo tep_draw_input_field('pages_title_'.$languages[$i]['id'], isset($pagetitle[$languages[$i]['id']]), 'class="form-control" id="Pagetitle_'.$languages[$i]['id'].'" required aria-required="true"'); ?>
		  </div>
		</div>
      </div>
      <div class="form-group row">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_INTEXT . '&nbsp;';?></label>
        <div class="col-sm-9">
			<div class="btn-group btn-group-toggle" data-toggle="buttons">
			  <label class="btn btn-secondary <?php echo (isset($linktype[$languages[$i]['id']])==0?'active':''); ?>" onClick="document.getElementById('textHTML_<?php echo $languages[$i]['id']; ?>').classList.remove('d-none'); document.getElementById('intLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none'); document.getElementById('extLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none');">
				<input type="radio" value="0" name="linktype_<?php echo $languages[$i]['id']; ?>" autocomplete="off" <?php echo (isset($linktype[$languages[$i]['id']])==0?'checked':''); ?>><?php echo TEXT_TARGET_INFOPAGE; ?>
			  </label>
			  <label class="btn btn-secondary <?php echo (isset($linktype[$languages[$i]['id']])==1?'active':''); ?>" onClick="document.getElementById('textHTML_<?php echo $languages[$i]['id']; ?>').classList.remove('d-none'); document.getElementById('intLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none'); document.getElementById('extLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none');">
				<input type="radio" value="1" name="linktype_<?php echo $languages[$i]['id']; ?>" autocomplete="off" <?php echo (isset($linktype[$languages[$i]['id']])==1?'checked':''); ?>><?php echo TEXT_TARGET_POPUP; ?>
			  </label>
			  <label class="btn btn-secondary <?php echo (isset($linktype[$languages[$i]['id']])==2?'active':''); ?>" onClick="document.getElementById('textHTML_<?php echo $languages[$i]['id']; ?>').classList.add('d-none'); document.getElementById('intLink_<?php echo $languages[$i]['id']; ?>').classList.remove('d-none'); document.getElementById('extLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none');">
				<input type="radio" value="2" name="linktype_<?php echo $languages[$i]['id']; ?>" autocomplete="off" <?php echo (isset($linktype[$languages[$i]['id']])==2?'checked':''); ?>><?php echo TEXT_TARGET_INTERNAL; ?>
			  </label>
			  <label class="btn btn-secondary <?php echo (isset($linktype[$languages[$i]['id']])==3?'active':''); ?>" onClick="document.getElementById('textHTML_<?php echo $languages[$i]['id']; ?>').classList.add('d-none'); document.getElementById('intLink_<?php echo $languages[$i]['id']; ?>').classList.add('d-none'); document.getElementById('extLink_<?php echo $languages[$i]['id']; ?>').classList.remove('d-none');">
				<input type="radio" value="3" name="linktype_<?php echo $languages[$i]['id']; ?>" autocomplete="off" <?php echo (isset($linktype[$languages[$i]['id']])==3?'checked':''); ?>><?php echo TEXT_TARGET_EXTERNAL; ?>
			  </label>
			</div>
        </div>
      </div>
      <div class="form-group row<?php echo ($linktype[$languages[$i]['id']]>1?' d-none':''); ?>" id="textHTML_<?php echo $languages[$i]['id']; ?>">
        <label for="TextHTML" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_HTML_TEXT . '&nbsp;'; ?></label>
        <div class="col-sm-9">
          <?php echo tep_draw_textarea_field('pages_html_text_'.$languages[$i]['id'], 'soft', '60', '15', isset($pages_html_text[$languages[$i]['id']]), 'class="form-control" id="TextHTML_'.$languages[$i]['id'].'"'); ?>
        </div>
      </div>
      <div class="form-group row<?php echo ($linktype[$languages[$i]['id']]==2?'':' d-none'); ?>" id="intLink_<?php echo $languages[$i]['id']; ?>">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_EXTERNAL_LINK . '&nbsp;'; ?></label>
        <div class="col-sm-4">
			<?php
			$file_extension = '.php';
			$files_array = array();
			$files_array[] = array('id' => 0, 'text' => 'Please Choose Filename');
			  if ($dir = @dir(DIR_FS_CATALOG)) {
				while ($file = $dir->read()) {
				  if (!is_dir(DIR_FS_CATALOG . $file)) {
					if (substr($file, strrpos($file, '.')) == $file_extension) {
					$files_array[] = array('id' => $file, 'text' => $file);
				  }
				}
			  }
			  $dir->close();
			}
			echo tep_draw_pull_down_menu('internallink_'.$languages[$i]['id'], $files_array, (tep_not_null($internallink[$languageid]) ? $internallink[$languageid] : ''), 'class="form-control"');
			?>
        </div>
      </div>
      <div class="form-group row<?php echo ($linktype[$languages[$i]['id']]==3?'':' d-none'); ?>" id="extLink_<?php echo $languages[$i]['id']; ?>">
        <label class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PAGES_EXTERNAL_LINK . '&nbsp;'; ?></label>
        <div class="col-sm-4">
          <?php echo tep_draw_input_field('externallink_'.$languages[$i]['id'], $externallink[$languages[$i]['id']], 'class="form-control"', false); ?>
        </div>
      </div>
	  <div class="secWarning text-center"><br>
		  <?php echo TEXT_PAGES_PAGE_NOTE; ?><br><br>
	  </div>
      </div>
<?php 
 }
?>
    </div>
  </div>
</div>
<input type="hidden" name="bID" value="<? echo $bID; ?>">
<div style="padding-top: 15px; text-align: right;">
  <?php echo tep_draw_bootstrap_button((isset($_GET['bID']) ? IMAGE_UPDATE : IMAGE_INSERT), 'fa fa-plus', null, 'primary') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fa fa-window-close', tep_href_link('extra_info_pages.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (!empty($bID) && $bID != "" ? 'bID=' . $bID : ''))); ?>
</div>
</form>
<script>
$(function() {
  $('#productTabs').tabs();
  $('#productLanguageTabs').tabs();
});
</script>
<?php
  } else {
	  
      $table_headers = array(TABLE_HEADING_PAGES,
                             TEXT_PAGES_TYPE,
                             TABLE_HEADING_SORT_ORDER,
                             TABLE_HEADING_STATUS);
?>
  <div class="row no-gutters">
    <div class="col">
      <div class="table-responsive">
        <table class="table table-striped table-hover">
          <thead class="thead-dark">
            <tr>
              <th><?php echo TABLE_HEADING_PAGES; ?></th>
              <th class="text-center"><?php echo TEXT_PAGES_TYPE; ?></th>
              <th class="text-center"><?php echo TABLE_HEADING_SORT_ORDER; ?></th>
              <th class="text-center"><?php echo TABLE_HEADING_STATUS; ?></th>
              <th class="text-right"><?php echo TABLE_HEADING_ACTION; ?></th>
            </tr>
          </thead>
          <tbody>
<?php
    $pages_query_raw = "select p.*, s.*
                        FROM
                           pages0340 p LEFT JOIN pages_description0340 s on p.pages_id = s.pages_id
                        WHERE
                           s.language_id='" . (int)$languages_id . "'
                        order by
                           p.page_type, p.sort_order, s.pages_title";

    $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $pages_query_raw, $pages_query_numrows);
    $pages_query = tep_db_query($pages_query_raw);
    while ($pages = tep_db_fetch_array($pages_query)) {

      if ((!isset($_GET['bID']) || (isset($_GET['bID']) && ($_GET['bID'] == $pages['pages_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
        $bInfo_array = array_merge($pages, (array) isset($info));
        $bInfo = new objectInfo($bInfo_array);
      }

      if (isset($bInfo) && is_object($bInfo) && ($pages['pages_id'] == $bInfo->pages_id)) {
        echo '<tr>' . "\n";
      } else {
        echo '<tr onclick="document.location.href=\'' . tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id']) . '\'">';
      }
?>

                    <td><?php echo $pages['pages_title']; ?></td>
                    <td class="text-center"><?php echo $pagetype[(int)$pages['page_type']-1]['text']; ?></td>
                    <td class="text-center"><?php echo $pages['sort_order']; ?></td>
                    <td class="text-center"> 
<?php
      if ($pages['status'] == '1') {
        echo tep_image('images/icon_status_green.gif', 'Active', 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=0') . '">' . tep_image('images/icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>';
      } else {
        echo '<a href="' . tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=1') . '">' . tep_image('images/icon_status_green_light.gif', 'Set Active', 10, 10) . '</a>&nbsp;&nbsp;' . tep_image('images/icon_status_red.gif', 'Inactive', 10, 10);
      }
?>
                    </td>
					<td class="text-right"><?php if ( (isset($bInfo) && is_object($bInfo)) && ($pages['pages_id'] == $bInfo->pages_id) ) { echo '<i class="fas fa-chevron-circle-right text-info"></i>'; } else { echo '<a href="' . tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id']) . '"><i class="fas fa-info-circle text-muted"></i></a>'; } ?></td>
              </tr>
<?php
    }
?>
          </tbody>
        </table>
      </div>

      <div class="row">
        <div class="col"><?php echo $pages_split->display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?></div>
        <div class="col text-right"><?php echo $pages_split->display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></div>
      </div>
      <div class="row mt-2">
        <div class="col text-right"><?php echo tep_draw_bootstrap_button(IMAGE_NEW_PAGE, 'fa-solid fa-page', tep_href_link('extra_info_pages.php', 'action=new')); ?></div>
      </div>
    </div>

<?php
  $heading = array();
  $contents = array();
  switch ($action) {
    case 'delete':
      $heading[] = array('text' => '<b>' . (tep_not_null($bInfo->pages_title) ? $bInfo->pages_title : '&nbsp;') . '</b>');

      $contents = array('form' => tep_draw_form('pages', 'extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br><b>' . $bInfo->pages_title . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash'
, null, 'primary') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fa fa-window-close', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id)));
    break;
    case 'copy_to':
      $heading[] = array('text' => '<b>' . (tep_not_null($bInfo->pages_title) ? $bInfo->pages_title : '&nbsp;') . '</b>');

      $contents = array('form' => tep_draw_form('copy_to', 'extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=copy_confirm'));
      $contents[] = array('text' => TEXT_INFO_COPY_INTRO);
      $contents[] = array('text' => '<br><b>' . $bInfo->pages_title . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_bootstrap_button(IMAGE_COPY, 'fas fa-copy', null, 'primary') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fa fa-window-close', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id)));
    break;
    default:
      if (is_object($bInfo)) {
        $heading[] = array('text' => '<b>' . $bInfo->pages_title . '</b>');

        if ($bInfo->linktype < 2) {
			$contents[] = array('align' => 'center', 'text' => tep_draw_bootstrap_button(IMAGE_VIEW, 'fa-solid fa-magnifying-glass', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id), 'secondary', array('params' => 'onclick="showPage(' . $pages['pages_id'] . ');" data-toggle="modal" data-target="#pageModal"' . isset($disabledview))) . tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=new')) . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash'
, tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=delete')) . tep_draw_bootstrap_button(IMAGE_COPY, 'fas fa-copy', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=copy_to')));
		} else if ($bInfo->linktype == 2) {
			$contents[] = array('align' => 'center', 'text' => tep_draw_bootstrap_button(IMAGE_FOLLOW_INT, 'fa-solid fa-link', tep_href_link('../' . $bInfo->linktarget), 'secondary', array('params' => 'target="_blank"')) . tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=new')) . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash'
, tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=delete')) . tep_draw_bootstrap_button(IMAGE_COPY, 'fas fa-copy', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=copy_to')));
		} else {
			$contents[] = array('align' => 'center', 'text' => tep_draw_bootstrap_button(IMAGE_FOLLOW_EXT, 'fa-solid fa-link', $bInfo->linktarget, 'secondary', array('params' => 'target="_blank"')) . tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=new')) . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash'
, tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=delete')) . tep_draw_bootstrap_button(IMAGE_COPY, 'fas fa-copy', tep_href_link('extra_info_pages.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=copy_to')));
		}
        $contents[] = array('text' => '<br />' . TEXT_PAGES_TYPE . ' ' . $bInfo->page_type);
        $contents[] = array('text' => TEXT_LINK_TYPE . ' ' . $bInfo->linktype);
        $contents[] = array('text' => tep_draw_hidden_field('html_title', $bInfo->pages_title, 'id="pages_title"'));
        $contents[] = array('text' => tep_draw_hidden_field('html_page', $bInfo->pages_html_text, 'id="html_page"'));
      }
      break;
  }

  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
    echo '<div class="col-12 col-sm-3">';
      $box = new box;
      echo $box->infoBox($heading, $contents);
    echo '</div>';
  }
?>

  </div>

<?php
  }

require('includes/footer.php'); 
?>
<!-- footer_eof //-->
<!-- Modal -->
<div class="modal fade" id="pageModal" tabindex="-1" role="dialog" aria-labelledby="pageModalTitle" aria-hidden="true">
  <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="pageTitle"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body" id="pageHTML">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
	function showPage(){
		document.getElementById('pageTitle').innerHTML = document.getElementById('pages_title').value;
		document.getElementById('pageHTML').innerHTML = document.getElementById('html_page').value;
	}
</script>
<?php if ($useicons == true) { ?>
<script src="../ext/iconpicker/js/fontawesome-iconpicker.js"></script>
<script>
  $(function () {
      $('.icp-dd').iconpicker({
		templates: {
			iconpickerItem: '<a role="button" href="javascript:;" class="iconpicker-item"><i></i></a>'
		}
	  });
    }).trigger('click');
    $('.icp').on('iconpickerSelected', function (e) {
	  var id = $(this).parents('div').find('.icon')[0].id;
      $('#'+ id ).val(e.iconpickerValue);
    });
	$('.clear-icon').on('click' , function (c) {
	  var id = $(this).parents('div').find('.icon')[0].id;
      $('#'+ id ).val("");
	  $(this).children().removeClass().addClass("fa fa-fw iconpicker-component");
	});
</script>
<?php
	} // FA-Icons on/off
	
  require('includes/template_bottom.php');
  require('includes/application_bottom.php');

Thanks!

Image
https://imgur.com/Tr42DSA

Tags:
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: Extra Info Page

Post by heatherbell »

ce7 wrote: Sun Apr 10, 2022 6:23 am I found I can modify the information links and content, however if I publish new page, it will not show up on front page, do I miss out something else I need to add in order to show on front page?
Presume, for example, you go Admin>Tools>Info Page - Add a New Page - enter details and save.
New page has been added and shows ID as 4.
Open /includes/languages/english/modules/content/footer/cm_footer_information_links.php
After

Code: Select all

    'contact_us.php' => 'Contact Us',
Add

Code: Select all

    'info.php?pages_id=4' => 'New Page',
Which then shows like
Screenshot 2022-04-10 075758.png
Click New Page link works as expected as seen on this demo https://psiwebsites.com/themes/psidemo/index.php
You do not have the required permissions to view the files attached to this post.
ce7
Posts: 26
Joined: Tue Apr 06, 2021 12:26 am
Has thanked: 21 times

Re: Extra Info Page

Post by ce7 »

heatherbell wrote: Sun Apr 10, 2022 7:00 am Which then shows like
Screenshot 2022-04-10 075758.png
Click New page works as expected as seen on this demo https://psiwebsites.com/themes/psidemo/index.php
Hi heatherbell,
Thank you so much! XO
It works great with your instruction!
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: Extra Info Page

Post by heatherbell »

ce7 wrote: Sun Apr 10, 2022 7:12 am It works great with your instruction!
Now added to User Guide
ce7
Posts: 26
Joined: Tue Apr 06, 2021 12:26 am
Has thanked: 21 times

Re: Extra Info Page

Post by ce7 »

Hi,
I am back to ask page again.
If this time I created an image gallery with cpanel apps has generate its own gallery database and url path, and I like to make a new link, title such as Gallery, and then it will link to eg->http://website.com/gallery/
how can create it with admin/info_page tool and also have this gallery link use target="_blank"?

Thanks!
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: Extra Info Page

Post by heatherbell »

ce7 wrote: Tue Apr 19, 2022 1:24 am If this time I created an image gallery with cpanel apps has generate its own gallery database and url path, and I like to make a new link, title such as Gallery, and then it will link to eg->http://website.com/gallery/
how can create it with admin/info_page tool and also have this gallery link use target="_blank"?
Info Page tool is for creating pages, it has nothing to do with creating links in this scenario.
For another link with target="_blank" you must edit https://github.com/CE-PhoenixCart/Phoen ... _links.php
It is best to open a copy of the file and edit that and save to the template you are using to prevent that file being overwritten in updates - read more https://github.com/CE-PhoenixCart/Phoen ... #templates
After Line 7, add

Code: Select all

  echo '<a class="nav-link pl-0" href="http://website.com/gallery/" target="_blank">Gallery</a>';
Post Reply