+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 30 of 30

Thread: Link to your own pages to show your content in the content area of Squirrelcart

  1. #16
    Client
    Join Date
    Sep 2008
    Posts
    79
    Squirrelcart version
    not specified!
    What if your page has a (-) mark, like privacy-policy.php?

  2. #17
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Change this:
    PHP Code:
    // make sure $page is a word only
    if (preg_match('/^\w+$/',$_GET['page'])) {
        
    // include page only if it exists
        
    if (file_exists("$_GET[page].php")) include "$_GET[page].php";

    to:

    PHP Code:
    // make sure $page is a word only
    if (preg_match('/^[\w-]+$/',$_GET['page'])) {
        
    // include page only if it exists
        
    if (file_exists("$_GET[page].php")) include "$_GET[page].php";

    I'll update the original post with that info.

  3. #18
    Client
    Join Date
    Sep 2008
    Posts
    79
    Squirrelcart version
    not specified!
    Thanks Jamie, works perfect.

  4. #19
    Client
    Join Date
    Nov 2008
    Posts
    9
    Squirrelcart version
    not specified!
    I followed the steps here, but I'm getting a 404 error in the page... although it does display the content.

    You can see it here: http://squirrelcart.buylube.com/contactus.php

    Here's what in contactus.php

    Code:
    <?php
    if (!$_GET['page']) {
        $_GET['page']    = "contactus";
        $Title            = "Contact Us";
        $Keywords        = "";
        $Description    = '';
        include "index.php";
        return;
    }
    ?> 
    
    <p><b><font face="Arial, Helvetica, sans-serif" size="3">Via Email:</font></b></p>
    
    <p><font face="Arial, Helvetica, sans-serif" size="2">
    For information about products, and other sales related questions: <b>sales@buylube.com</b><br>
    For existing orders: <b>orders@buylube.com</b></p>
    
    <p><b><font face="Arial, Helvetica, sans-serif" size="3"> Via Mail:</font></b></p>
    
    <p><font face="Arial, Helvetica, sans-serif" size="2">
    The LBGroup, LLC<br>
    PO Box 556<br>
    Chelmsford MA 01824</p>
    Here's what's in index.php (renamed store.php)

    Code:
    <?php include 'squirrelcart/pre_storefront.php' ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    	<meta name="title" content="<?php print $Title ?>">
    	<meta name="keywords" content="<?php print $Keywords ?>">
    	<meta name="description" content="<?php print $Description ?>">
    	<title><?php print $Title ?></title>
    	<?php stylesheet("store.css") ?>
    	<?php include $cart_isp_root.'/storefront_head.php' ?>
    </head>
    
    <body>
    
    <table width="95%" border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
    	<td class="logo_header">
    		<img src="<?php print $SC['dyn_root']."/".$SC['image_folder'] ?>/topbar_01.jpg" alt="BuyLube">
    	</td>
    	<td class="logo_header"><div align="right"><font size="1" face="Arial, Helvetica, sans-serif">have fun, play safe.</td>
    </tr>
    </table>
    <div align="center">
    	<table width="770" border="0">
                            
    		<tr>
    			<td valign="top" style="padding-top: 3px;">
    				<?php
    					// Left Navigation section
    					show_nav("Left Navigation");
    				?>
    			</td>
    			<td width="100%" valign="top">
    				<?php
    					if ($SC['show_home_page']) {
    						include "home.php";
    					} else {
    				?>
    	 			<table width="100%" border="0">
    					<tr>
    						<td style="padding-bottom: 3; padding-top: 0">
    							<?php include "$cart_isp_root/crumb_navigation.php" ?>
    						</td>
    					</tr>
    					<tr>
    						<td class="content">
    							<?php
    								// Cart Content section
    								include "$cart_isp_root/cart_content.php" ;
    								// make sure $page is a word only
    								 if (preg_match('/^[\w-]+$/',$_GET['page'])) {
    								     // include page only if it exists
    								     if (file_exists("$_GET[page].php")) include "$_GET[page].php";
    								 }  
    							?>
    						</td>
    					</tr>
    				</table>
    				<?php } ?>
    				<br />
    			</td>
    			<td valign="top" style="padding-top: 3;">
    				<?php
    					// Right Navigation section
    					show_nav("Right Navigation");
    				?>
    			</td>
    		</tr>
    	</table>
    </div>
    
    <table border="0" width="95%" cellspacing="0" cellpadding="3" align="center">
      <tr class="footer">
    	<td align="center" class="footer">Copyright &copy; 2008 LBGroup, LLC.</td>
      </tr>
      <tr height="10" valign="middle" align="middle" class="footer">
    	<td><img src="<?php print $SC['dyn_root']."/".$SC['image_folder'] ?>/rainbow.gif"></td>
      </tr> 
      <tr height="8" class="footer">
    	<td><img src="<?php print $SC['dyn_root']."/".$SC['image_folder'] ?>/spacer.gif" alt="" width="4" height="1"></td>
      </tr>
      <tr height="15" class="footer">
    	<td align="center" class="footer"><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://internetsupervision.com" target="_blank" title="Web Server Monitoring - InternetSupervision.com">Web Server Monitoring by InternetSupervision.com</a></font></td> 
    	</tr>
    </table>
    
    <?php
    	// This is a link back to Squirrelcart.com. You can change the appearance of the link on the Visual Settings page in the control panel
    //	squirrelcart_link();
    
    	// This line must go directly before your closing body tag
    	include $SC['cart_isp_root'].'/post_storefront.php';
    ?>
    </body>
    </html>

  5. #20
    Client
    Join Date
    Sep 2008
    Posts
    79
    Squirrelcart version
    not specified!
    I'm not sure but it seems like when I set mine up I had to add something in the fields:
    Code:
        $Keywords        = "";
        $Description    = '';
    Try putting something in these and maybe make sure you use regular quotes in the $Description. You could try that.

  6. #21
    Client
    Join Date
    Nov 2008
    Posts
    9
    Squirrelcart version
    not specified!
    I updated as you suggested... same thing.

    PHP Code:
    <?php
    if (!$_GET['page']) {
        
    $_GET['page']    = "contactus";
        
    $Title            "Contact Us";
        
    $Keywords        "Contact Us";
        
    $Description    "Contact Us";
        include 
    "index.php";
        return;
    }
    ?>

  7. #22
    Client
    Join Date
    Sep 2008
    Posts
    79
    Squirrelcart version
    not specified!
    I'm not an expert by a Loooooong shot but here's what I would check and try:

    Make sure the beginning of the php code on the contact-us.php page is all the way to the top i.e. no space at all.

    try putting a dash in contactus like contact-us.

    Here's how I have mine:

    Code:
    <?php  if (!$_GET['page']) { $_GET['page'] = "contact-us"; $Title = "My Beloved Angels Conact Us Form & Information"; $Keywords = "contact us"; $Description = 'My Beloved Angels Conact Us Form & Information'; include "angels.php"; return; } ?>

    Mine has been put through a php compression software so its all on one line. I mean if your using Note pad it would be the first thing!

    Here's the code exactly like I have it in my store.php page:

    Code:
    <td class="content"><?php include "$cart_isp_root/cart_content.php" ; if (preg_match('/^[\w-]+$/',$_GET['page'])) { if (file_exists("$_GET[page].php")) include "$_GET[page].php";} ?></td>
    Then my Contact Us link looks like this:
    Code:
    <a href="<?=$SC['dyn_root']?>/contact-us.php">Contact Us</a>
    The contact-us.php page is right beside the store.php in the directory. Not in another folder.

    Maybe this helps.

  8. #23
    Client
    Join Date
    Nov 2008
    Posts
    9
    Squirrelcart version
    not specified!
    What is angels.php that you include in your contact-us.php file? Is that your renamed version of store.php? That's the only thing different I can see in your file vs. mine.

  9. #24
    Client
    Join Date
    Sep 2008
    Posts
    79
    Squirrelcart version
    not specified!
    yes

  10. #25
    Client
    Join Date
    Nov 2008
    Posts
    9
    Squirrelcart version
    not specified!
    turned out to be a bug, which Jamie fixed.

    Details here: http://www.ldev.com/forums/showthread.php?t=5471

  11. #26
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    FYI - This thread has been updated for version 3.x.

  12. #27
    Registered User idaryl's Avatar
    Join Date
    Jun 2008
    Location
    San Diego
    Posts
    71
    Squirrelcart version
    v3.2.1

    File in dir

    I was wondering what the syntax would be, if the file were in a dir of its own - that wat the root does not get to cluttered with extra php files

    ( $_GET[page].php )

    or would it be on the end of the string store.php?=( dir path )page somehow?

  13. #28
    Client
    Join Date
    Dec 2004
    Location
    Phoenix, AZ
    Posts
    337
    Squirrelcart version
    v3.3.2
    Sorry, hate to bring up OLD stuff...but I just moved my site (SC 2.6.3) to a new webserver that is running PHP 5.3.2. This functionality appears to be the only thing that has broken with the move. The rest of the site is working fine, up to and including completio f orders through credit card processing...but my static pages are all broken.

    I'm getting a 500 Internal Server Error

    If I take the following out of the top of the linked file below, it works fine (though it's not displayed in the store page, just by itself):

    Code:
    <?php 
    if (!$_GET['page']) { 
        $_GET['page']    = "documentation"; 
        $Title            = "Documentation"; 
        $Keywords        = "Documentation"; 
        $Description    = 'Documentation'; 
        include "store.php"; 
        return; 
    } 
    ?>
    http://www.itpdiesel.com/documentation.php

    EVERY single one of my static pages with this code at the top fails with the same 500 error...I'm at a loss...

    I ran into several deprecated functions with the upgrade to PHP 5.3+, could this have something to do with a function that has been altered or deprecated?

    BTW, yes, I know my version is old. I'm working on an upgrade to 3.x but since I can't just upgrade due to the significant changes to the style system...It's taking longer than expected. I just need to "bandaid" this functionality temporarily until I get moved to 3.x.

    Thanks!
    Last edited by ITPDiesel; April 4th, 2010 at 06:46 PM. Reason: Additional Information

  14. #29
    Client
    Join Date
    Dec 2004
    Location
    Phoenix, AZ
    Posts
    337
    Squirrelcart version
    v3.3.2
    No quick fix ideas???

  15. #30
    Client
    Join Date
    Dec 2004
    Location
    Phoenix, AZ
    Posts
    337
    Squirrelcart version
    v3.3.2
    OK, just found that the Rates and Services function from the control panel is also returning an error 500...since this is the only other thing I've found so far after this upgrade...thinking they are related. Please help!

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts