Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default array question...

    I need to create an array to allow for other meta information to load within other sections of my site.

    Right now I have this, but it only works for one page:

    PHP Code:
    <?php if ($_GET['main_page'] != 'mypage') { ?>
    I need to create an array so I can do this for multiple pages, and close it with a <?php } ?>

    Can someone please hook me up with the code for the array?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: array question...

    PHP Code:
    <?php 
      
    if (!in_array($_GET['main_page'], array('mypage''yourpage''yomammaspage'))) {
        
    // do something here
      
    }
    ?>
    Ref: http://www.php.net/in_array
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: array question...

    Why you gotta talk about my momma?

    j/k... Thanks for the hook up it works perfectly!

  4. #4
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: array question...

    Hi Dr. Byte,

    I tried looking, but I could not figure how to stop a function using the array?

    I would like to prohibit the Zen Cart canonical stuff from displaying if those above pages are loaded:

    Code:
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink; ?>" />
    Could you please help?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: array question...

    Quote Originally Posted by swamyg1 View Post
    I would like to prohibit the Zen Cart canonical stuff from displaying if those above pages are loaded
    Just wrap that "if" statement around whatever you want it to affect.

    But ... Um ... not sure I understand "why" you want to muck with the canonical stuff ... ?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: array question...

    It's because I have a wordpress blog that pulling in it's own meta info...

    But for the canonical it would always pull up the following for every page:
    <link rel="canonical" href="http://www.mywebsite.com/index.php?main_page=blog" />

    Wrapping the array around it worked for me, thank you!

 

 

Similar Threads

  1. Warning: array_merge() [function.array-merge]: Argument #1 is not an array
    By antieuclid in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 19 Jul 2010, 02:50 AM
  2. Replies: 19
    Last Post: 14 Dec 2009, 01:17 PM
  3. Replies: 1
    Last Post: 14 Mar 2008, 02:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR