We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    No problem. The simple things are often the most infuriating smiley

    Only other clue might be in the modx code you said is in the top of the page source. I wonder if the content is being pulled in dynamically from somewhere else.

    Also - the image path for the logo on that page returns a ’page not found’. Is that what you’re trying to fix?
      • 34486
      • 10 Posts
      Thanks lucas.

      I’m trying to fix the logo on the splash page which currently doesn’t display, if you look at the source it aims at an address on the company who developed the site’s server. Without going in to it, there is bad blood between my friend and the company so I just want to get the logo on the splash page by pointing it to the logo image in the images folder of the site.

      The code for the age verification piece is as so:

      // check age restriction
      if(!isset($_COOKIE['site_age_restriction'])){
        if($_SERVER['REQUEST_URI']=='/index.php?id=49' || $_SERVER['REQUEST_URI']=='/terms-and-conditions/' || $_SERVER['REQUEST_URI']=='/terms-and-conditions'){
          // allow the page - do nothing  
        }else{
          
        if($_SERVER['REQUEST_METHOD']=='POST'){
          if(is_numeric($_POST['day'])&&$_POST['day']<=31){
            if(is_numeric($_POST['month'])&&$_POST['month']<=12){
              if(is_numeric($_POST['year'])){
                $enteredDate = strtotime($_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day']);
                $eighteenyearsago = mktime(0, 0, 0, date("m"),   date("d"),   date("Y")-18);
                if($enteredDate < $eighteenyearsago){
                  $_COOKIE['site_age_restriction'] = 'passed';
                  setcookie('site_age_restriction','passed');
                  $modx->sendRedirect('/');
                }else{
                  $modx->sendRedirect('http://www.drinkaware.co.uk/about-us/information-for-under-18s');
                }    
              }
            }    
          }
          
        }
        // display form and homepage


        • 33968
        • 863 Posts
        Ouch... I did wonder what was going on with that image path...

        Well, no clues in that snippet I’m afraid.

        What happens if you duplicate ’index.html’, temporarily rename it to ’index_old.html’, and upload your own version saved as ’index.htm’ (without the ’l’). Kindof messy, but might be a way around any caching issues if that is what is causing the problem.

          • 33997
          • 150 Posts
          Where did you find that code for the age verification? It looks to me that it is a plug in and you should go into the manager and edit whichever page is ID 49. It seems page 49 will have everything you need.
            "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
            • 33968
            • 863 Posts
            I think page 49 is the T+C page. It’s allowing access to that so people can read the legal stuff, while requiring verification for all other pages on the site.
              • 34486
              • 10 Posts
              I tried your suggestion Lucas and still get the same issue. Page 49 is the T&C’s page and doesn’t have the code anywhere within it. The T&C’s also call the one template so I don’t think the splash is within it anywhere.

              I’m now thinking it must be part of modx in some way as I renamed index.php and index.html on the remote server to index_old and uploaded the index.htm file without any joy.

              When I look on the remote server the files I’ve renamed are staying the same, i.e. they are still _old et the splash page is staying the same. Therefore I think it must be pulling it from somewhere dynamically.

              Also I edited landing.css which is a separate stylesheet the splash page calls and edits to this don’t disply on the splash page so it must be a cached version somewhere but I’ve no idea where.

              Below is the full php that is in the index.php header.

              /**
               * Initialize Document Parsing
               * -----------------------------
               */
              
              // get start time
              $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
              
              // harden it
              require_once(dirname(__FILE__).'/manager/includes/protect.inc.php');
              
              // set some settings, and address some IE issues
              @ini_set('url_rewriter.tags', '');
              @ini_set('session.use_trans_sid', 0);
              @ini_set('session.use_only_cookies',1);
              session_cache_limiter('');
              header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
              header('Cache-Control: private, must-revalidate');
              ob_start();
              error_reporting(E_ALL & ~E_NOTICE);
              
              /**
               *	Filename: index.php
               *	Function: This file loads and executes the parser. *
               */
              
              define("IN_ETOMITE_PARSER", "true"); // provides compatibility with etomite 0.6 and maybe later versions
              define("IN_PARSER_MODE", "true");
              define("IN_MANAGER_MODE", "false");
              
              if (!defined('MODX_API_MODE')) {
                  define('MODX_API_MODE', false);
              }
              
              // initialize the variables prior to grabbing the config file
              $database_type = '';
              $database_server = '';
              $database_user = '';
              $database_password = '';
              $dbase = '';
              $table_prefix = '';
              $base_url = '';
              $base_path = '';
              
              // get the required includes
              if($database_user=="") {
              	$rt = @include_once(dirname(__FILE__).'/manager/includes/config.inc.php');
              	// Be sure config.inc.php is there and that it contains some important values
              	if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
              	echo "
              <style type=\"text/css\">
              *{margin:0;padding:0}
              body{margin:50px;background:#eee;}
              .install{padding:10px;border:5px solid #f22;background:#f99;margin:0 auto;font:120%/1em serif;text-align:center;}
              p{ margin:20px 0; }
              a{font-size:200%;color:#f22;text-decoration:underline;margin-top: 30px;padding: 5px;}
              </style>
              <div class=\"install\">
              <p>MODx is not currently installed or the configuration file cannot be found.</p>
              <p>Do you want to <a href=\"install/index.php\">install now</a>?</p>
              </div>";
              		exit;
              	}
              }
              
              // start session 
              startCMSSession();
              
              // initiate a new document parser
              include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
              $modx = new DocumentParser;
              $etomite = &$modx; // for backward compatibility
              
              
              // check age restriction
              if(!isset($_COOKIE['site_age_restriction'])){
                if($_SERVER['REQUEST_URI']=='/index.php?id=49' || $_SERVER['REQUEST_URI']=='/terms-and-conditions/' || $_SERVER['REQUEST_URI']=='/terms-and-conditions'){
                  // allow the page - do nothing  
                }else{
                  
                if($_SERVER['REQUEST_METHOD']=='POST'){
                  if(is_numeric($_POST['day'])&&$_POST['day']<=31){
                    if(is_numeric($_POST['month'])&&$_POST['month']<=12){
                      if(is_numeric($_POST['year'])){
                        $enteredDate = strtotime($_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day']);
                        $eighteenyearsago = mktime(0, 0, 0, date("m"),   date("d"),   date("Y")-18);
                        if($enteredDate < $eighteenyearsago){
                          $_COOKIE['site_age_restriction'] = 'passed';
                          setcookie('site_age_restriction','passed');
                          $modx->sendRedirect('/');
                        }else{
                          $modx->sendRedirect('http://www.drinkaware.co.uk/about-us/information-for-under-18s');
                        }    
                      }
                    }    
                  }
                  
                }
                // display form and homepage
                • 33997
                • 150 Posts
                RE: pg 49 - I’m seeing that now. Just goes to show its a bad idea to only glance!

                It looks like that code may have been hard-coded into the index.php file. While you are at it, can you paste the rest of the index.php, or attach it?
                  "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                  • 34486
                  • 10 Posts
                  This is all of index.php (index.html and index.htm are the same as well)

                  <?php
                  /*
                  *************************************************************************
                  	MODx Content Management System and PHP Application Framework 
                  	Managed and maintained by Raymond Irving, Ryan Thrash and the
                  	MODx community
                  *************************************************************************
                  	MODx is an opensource PHP/MySQL content management system and content
                  	management framework that is flexible, adaptable, supports XHTML/CSS
                  	layouts, and works with most web browsers, including Safari.
                  
                  	MODx is distributed under the GNU General Public License	
                  *************************************************************************
                  
                  	MODx CMS and Application Framework ("MODx")
                  	Copyright 2005 and forever thereafter by Raymond Irving & Ryan Thrash.
                  	All rights reserved.
                  
                  	This file and all related or dependant files distributed with this filie
                  	are considered as a whole to make up MODx.
                  
                  	MODx is free software; you can redistribute it and/or modify
                  	it under the terms of the GNU General Public License as published by
                  	the Free Software Foundation; either version 2 of the License, or
                  	(at your option) any later version.
                  
                  	MODx is distributed in the hope that it will be useful,
                  	but WITHOUT ANY WARRANTY; without even the implied warranty of
                  	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                  	GNU General Public License for more details.
                  
                  	You should have received a copy of the GNU General Public License
                  	along with MODx (located in "/assets/docs/"); if not, write to the Free Software
                  	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                  
                  	For more information on MODx please visit http://modxcms.com/
                  	
                  **************************************************************************
                      Originally based on Etomite by Alex Butter
                  **************************************************************************
                  */	
                  
                  /**
                   * Initialize Document Parsing
                   * -----------------------------
                   */
                  
                  // get start time
                  $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
                  
                  // harden it
                  require_once(dirname(__FILE__).'/manager/includes/protect.inc.php');
                  
                  // set some settings, and address some IE issues
                  @ini_set('url_rewriter.tags', '');
                  @ini_set('session.use_trans_sid', 0);
                  @ini_set('session.use_only_cookies',1);
                  session_cache_limiter('');
                  header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
                  header('Cache-Control: private, must-revalidate');
                  ob_start();
                  error_reporting(E_ALL & ~E_NOTICE);
                  
                  /**
                   *	Filename: index.php
                   *	Function: This file loads and executes the parser. *
                   */
                  
                  define("IN_ETOMITE_PARSER", "true"); // provides compatibility with etomite 0.6 and maybe later versions
                  define("IN_PARSER_MODE", "true");
                  define("IN_MANAGER_MODE", "false");
                  
                  if (!defined('MODX_API_MODE')) {
                      define('MODX_API_MODE', false);
                  }
                  
                  // initialize the variables prior to grabbing the config file
                  $database_type = '';
                  $database_server = '';
                  $database_user = '';
                  $database_password = '';
                  $dbase = '';
                  $table_prefix = '';
                  $base_url = '';
                  $base_path = '';
                  
                  // get the required includes
                  if($database_user=="") {
                  	$rt = @include_once(dirname(__FILE__).'/manager/includes/config.inc.php');
                  	// Be sure config.inc.php is there and that it contains some important values
                  	if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
                  	echo "
                  <style type=\"text/css\">
                  *{margin:0;padding:0}
                  body{margin:50px;background:#eee;}
                  .install{padding:10px;border:5px solid #f22;background:#f99;margin:0 auto;font:120%/1em serif;text-align:center;}
                  p{ margin:20px 0; }
                  a{font-size:200%;color:#f22;text-decoration:underline;margin-top: 30px;padding: 5px;}
                  </style>
                  <div class=\"install\">
                  <p>MODx is not currently installed or the configuration file cannot be found.</p>
                  <p>Do you want to <a href=\"install/index.php\">install now</a>?</p>
                  </div>";
                  		exit;
                  	}
                  }
                  
                  // start session 
                  startCMSSession();
                  
                  // initiate a new document parser
                  include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
                  $modx = new DocumentParser;
                  $etomite = &$modx; // for backward compatibility
                  
                  
                  // check age restriction
                  if(!isset($_COOKIE['site_age_restriction'])){
                    if($_SERVER['REQUEST_URI']=='/index.php?id=49' || $_SERVER['REQUEST_URI']=='/terms-and-conditions/' || $_SERVER['REQUEST_URI']=='/terms-and-conditions'){
                      // allow the page - do nothing  
                    }else{
                      
                    if($_SERVER['REQUEST_METHOD']=='POST'){
                      if(is_numeric($_POST['day'])&&$_POST['day']<=31){
                        if(is_numeric($_POST['month'])&&$_POST['month']<=12){
                          if(is_numeric($_POST['year'])){
                            $enteredDate = strtotime($_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day']);
                            $eighteenyearsago = mktime(0, 0, 0, date("m"),   date("d"),   date("Y")-18);
                            if($enteredDate < $eighteenyearsago){
                              $_COOKIE['site_age_restriction'] = 'passed';
                              setcookie('site_age_restriction','passed');
                              $modx->sendRedirect('/');
                            }else{
                              $modx->sendRedirect('http://www.drinkaware.co.uk/about-us/information-for-under-18s');
                            }    
                          }
                        }    
                      }
                      
                    }
                    // display form and homepage
                    ?>
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml">
                    <head>
                      <title>Shotcards</title>
                      <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
                      <link rel="stylesheet" href="/assets/templates/shotcards/landing.css" />
                      <script type="text/javascript">
                        function dateInput(el){
                          if(el){
                            el.value = '';
                          }
                        }
                      </script>
                    </head>
                    <body>
                    <div id="header">
                      <div id="headerContent">
                        <img src="http://www.shotcards.com/assets/templates/shotcards/logo.gif" alt=" " />
                      </div>
                    </div>
                    <div id="content">
                      <div id="contentInner">
                         
                        <form method="post" action="" name="shotcards-entry-form" id="shotcardsEntryForm">
                          <fieldset>
                            
                            <h1>You must be of legal purchase age to enter shotcards.com</h1>
                            <img class="holding-image" src="assets/templates/shotcards/holding-image.gif" alt="" />
                            <p>You must be 18 years of age to enter shotcards.com</p>
                            <h2>When were you born</h2>
                            <input name="day" type="text" id="day" value="DD" maxlength="2" onfocus="dateInput(this)" />
                            <input name="month" type="text" id="month" value="MM" maxlength="2" onfocus="dateInput(this)" />
                            <input name="year" type="text" id="year" value="YYYY" maxlength="4" onfocus="dateInput(this)" />  
                            <br /><br />
                            <input type="submit" class="submit" name="submit" id="submit" value="ENTER" />
                          </fieldset>          
                        </form>
                            
                        <div id="footerInner">
                          <p>By entering the website you agree to our terms and conditions<br/>18 years of age is the legal minimum to purchase alcohol, if you are from a none UK country then local restrictions apply</p>
                        </div>
                      </div>
                    </div>
                    <div id="footerOuter">
                      <div id="footer">
                          <div class="left">
                              <p>All copy and imagery © Copyright 2011 Shot Cards</p>
                              <p class="grey"><a href="http://www.thecreativestore.co.uk">Website design Wimbledon</a> by <a href="http://www.thecreativestore.co.uk">The Creative Store</a></p>
                  
                          </div>
                          <div class="right">
                              <img src="/assets/templates/shotcards/pregnant.gif" alt="Not advised during pregnancy" />
                              <img src="/assets/templates/shotcards/over18.gif" alt="Must be over 18" />
                              <a target="_blank" href="http://www.drinkaware.co.uk/">
                                <img src="/assets/templates/shotcards/drinkaware-logo.jpg" alt="Drink Aware" />
                              </a>
                              <p><a href="terms-and-conditions">Terms and Conditions</a></p>
                            </div>
                         <div class="clear"> </div>
                      </div>
                    </div>
                    </body>
                  </html>
                    
                    <?php
                      exit;
                    }
                    
                  }
                  
                  
                  // set some parser options
                  $modx->minParserPasses = 1; // min number of parser recursive loops or passes
                  $modx->maxParserPasses = 10; // max number of parser recursive loops or passes
                  $modx->dumpSQL = false;
                  $modx->dumpSnippets = false; // feed the parser the execution start time
                  $modx->tstart = $tstart;
                  
                  // Debugging mode:
                  $modx->stopOnNotice = false;
                  
                  // Don't show PHP errors to the public
                  if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
                      @ini_set("display_errors","0");
                  }
                  
                  // execute the parser if index.php was not included
                  if (!MODX_API_MODE) {
                      $modx->executeParser();
                  }
                  ?>
                    • 33997
                    • 150 Posts
                    Umm, that looks okay to me....but what do I know grin? Have you checked the URI for the logo in the index.html and the index.htm files?

                    Just a thought: are you sure you uploaded the files once you changed them? Sometimes it is the simple things we forget to do...(http://modxcms.com/forums/index.php/topic,63955.msg361886.html#msg361886) Upload the files again just to be sure...and make sure the files you are uploading are being uploaded to the right spot, and that they are over-writing the originals.

                    Also, I would get rid of the index.html and the index.htm files until you figure out what they do/if they do anything. This way you won’t be editing 3 pages at a time for every thing you want changed. Don’t delete them, just rename them on the remote server to something else as suggested before.
                      "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                      • 34486
                      • 10 Posts
                      Hi Goonz

                      The image is the same one called by the other pages so I know it’s correct but to be sure I have copied and pasted the URI from the page’s code into my browser and it brings up the logo.

                      Within dreamweaver when I put the file, I get an operation succeeded message and to be sure I deleted/renamed all variants of index on the remote server and then put index.php again to ensure it’s the correct version.

                      I’m really stumped by this now, I’ve used the find function in dreamweaver to search for all the variables within index.php and they only show up within index.php, there doesn’t seem to be any connection for that splash page to anything else.

                      My only other thought was it could be something to do with the .htaccess file (a longshot I know) so below is the code for that.

                      # For full documentation and other suggested options, please see
                      # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
                      # including for unexpected logouts in multi-server/cloud environments
                      
                      Options +FollowSymlinks
                      RewriteEngine On
                      RewriteBase /
                      
                      # Fix Apache internal dummy connections from breaking [(site_url)] cache
                      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
                      RewriteRule .* - [F,L]
                      
                      # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
                      #RewriteCond %{HTTP_HOST} .
                      #RewriteCond %{HTTP_HOST} !^example\.com [NC]
                      #RewriteRule (.*) http://example.com/$1 [R=301,L]
                      
                      # Exclude /assets and /manager directories from rewrite rules
                      RewriteRule ^(manager|assets) - [L]
                      
                      # For Friendly URLs
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^shotcards/([^/]+)/([^/]+)$ shotcards/&product=$2 [L,QSA]
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      
                      # Reduce server overhead by enabling output compression if supported.
                      #php_flag zlib.output_compression On
                      #php_value zlib.output_compression_level 5