Page 1 of 2 12 LastLast
Results 1 to 25 of 36
  1. #1
    Member
    Join Date
    January 2nd, 2008
    Posts
    72
    Example of a 100% Dynamic Site with Link Redirection and more
    We have had several people asking how to easily make a dynamic site without having to hand pick everything. I'm going to outline a very basic approach that could be taken.

    Note: You will need an enterprise account and a search enabled shop.

    I just saw Iron Man last night :-), so I'm going to go with a superhero themed shop.

    The final result will be a site with a home page, and four categories: Superman, Batman, Iron Man, Incredible Hulk

    All we need is two pages: index.php, category.php

    The index page will contain a static shop I have hand picked the products for, that also has search enabled. The categories will be dynamically generated based on keywords.

    First we will create the categories:
    PHP Code:
    <? $categories = array('Superman''Batman''Iron Man''Incredible Hulk'); ?>
    Now we will use the categories to create some navigation links. All this is doing is taking the categories and adding them as psps_search parameters onto links pointing to the category page.
    PHP Code:
    <h2>Categories:</h2>
    <? foreach ($categories as $category) { ?>
      <a href="/category.php?psps_search=<?= urlencode($category?>"><?= $category ?></a><br/>
    <? ?>
    The category.php will contain the same shop snippet. When the category.php page is loaded with the parameter psps_search, it automatically does a search and brings back the search results.

    And now this site has dynamic pages created from one shop targeting specific 'categories' of products based on keywords.

    Note: The search ONLY searches merchants that have been added to the shop in shopbuilder. You will have to handpick at least one product from every merchant you want in the search.

    -------------------------------------------------

    What next?

    1. Add in some url rewriting to get cleaner urls: /category/batman vs. /category/?psps_search=Batman

    2. Have the category labels different then the keywords passed in:
    Batman => ?psps_search=batman action figure

    3. Override the styles dynamically to give a slightly different look on each 'category' page.
    Last edited by JessieJ; May 8th, 2008 at 02:56 PM.

  2. #2
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    Disclaimer: The cinematic preferences expressed herein by PopShops developers do not necessarily reflect those of PopShops or its employees. (Except maybe Angel. And definitely Matt...he loves that stuff.)
    Jessie Jones
    Create your custom affiliate store with PopShops.
    General support: support [at] popshops.com | Merchant requests: merchants [at] popshops.com
    (Include your popshops login, your shop name, and the URL or merchant you have an issue with.)

  3. #3
    Member MattJ's Avatar
    Join Date
    February 29th, 2008
    Posts
    82
    Jessie is just bitter that "Archie" hasn't made it to the big screen (yet).

  4. #4
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,744
    Very Cool - Thanks Dan for sharing. This is certainly something I see as a benefit. I'll give it a try soon and see how it goes. Lets see that was categories then search parameters....

  5. #5
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Okay, I just upgraded to Enterprise yesterday. I'm eager to give this a try.

    Any chance you could put such a shop up somewhere as a working example or "demo" that those of us who are pretty "PHP/MySQL impaired" might have a look at?

    Thanks.
    Generate more fake news.

  6. #6
    ABW Ambassador beachcom's Avatar
    Join Date
    May 11th, 2006
    Location
    Myrtle Beach SC
    Posts
    723
    Thumbs up
    Thanks Dan..outstanding!!

  7. #7
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,350
    Wow!!!!
    Dan you're tips are amazing. This one is particularly cool. I'm searching now for the right merchant to try this with.

    Lily

  8. #8
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Geez, I feel like the dumb kid on the block. Can anyone show me a sample site or something created like this so I can get a clearer understanding of what we're talking about? Please?
    Generate more fake news.

  9. #9
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    Hey WriterGuy,
    I don't have anything ready to post at the moment but we are working on some that we can post soon.

    If anyone else gives this a try, would you please post your handywork?

    Jessie
    Jessie Jones
    Create your custom affiliate store with PopShops.
    General support: support [at] popshops.com | Merchant requests: merchants [at] popshops.com
    (Include your popshops login, your shop name, and the URL or merchant you have an issue with.)

  10. #10
    Member
    Join Date
    January 18th, 2005
    Posts
    155
    Soon, Jessie? Pretty Please Soon?

  11. #11
    Member
    Join Date
    January 2nd, 2008
    Posts
    72
    Ok, here is an example site: http://www.pickpacks.com

    Dynamic categories are to the right on the page.

    And here is the entire code for the site (You can ignore the css, that was just for overwriting some styles):

    PHP Code:
    <!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" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>PickPacks.com</title>
        <style type="text/css" media="screen">
      body { background: #000; }
      body #PopShop47229 .pspsPager{text-align:left;padding:10px;}
      body #PopShop47229 .pspsPager a,
      body #PopShop47229 .pspsPager span{color: #fff;font-weight:normal;text-decoration:none;padding:2px;border:none;}
      body #PopShop47229 .pspsPager .pspsCurrentPage{background-color:#286ea8;color:#fff;}
      body #PopShop47229 .pspsPager .pspsInactivePage{color:#fff;}
      body, body p {
        color: #959595;
        font-family: "Lucida Grande",Geneva,Arial,Verdana;
        font-size: 12px;
        line-height: 16px;
      }
        body #PopShop47229 { 
        background: #2f2f2f;
        padding: 21px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
      }
      body #PopShop47229 td.pspsCell a, a {
        color: #286ea8; 
        text-decoration:none;
      }
      body #PopShop47229 td.pspsCell img {
        background: #161616;
        padding: 14px;
        margin-left:7px;
        border-width:0;
        width: 125px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
      }
      body #PopShop47229 td.pspsCell .pspsText a {
        background: #161616; 
        display:block; 
        padding: 7px; 
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
      }
      body #PopShop47229 td.pspsCell a:hover, a:hover {
        color: #f3a201 
      }
      body #PopShop47229 td.pspsCell {
        background:#232323;
        border:none;
        color: #fff;
        font-size: 12px;
        padding: 14px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
      }
      body #PopShop47229 p.pspsText a {
        color: #f3a201;
        font-weight:bold;
      }
      body #PopShop47229 .pspsMain, body #PopShop47229 .pspsText { 
        margin: 0 auto; 
        width: 100%;
      }
      
      h1 { font-size: 24px; line-height: 32px; color:#f3a201;}
      .categories { width: 200px; position:absolute; margin-left: 700px;}
      .shop-canvas { margin-right: 200px; width: 675px; }
      
      </style>  
    </head>

    <body>
      <div class="head">
        <h1>PickPacks.com</h1>
      </div>
      <div class="categories">
        <?
          
    # START THE CATEGORIES
          # This is a basic example of what you can do to create dynamic 
          # categories in your site.  The following code simply defines 
          # several categories and then loops through them creating
          # links back to this page adding the category as a parameter.
        
    ?>
        <? $categories = array('Laptop Backpack''Mountaineering BackPack''Adidas Backpack''Kid Backpack''Plush Backpack''Picnic Backpack'); ?>
        <h2>Categories:</h2>
        <? foreach ($categories as $category) { ?>
        <a href="index.php?psps_search=<?= urlencode($category?>"><?= $category ?></a><br/>
        <? # /END OF THE CATEGORIES ?>
      </div>
      <div class="shop-canvas">
          <?php
          
    # This is the normal php snippet that you would get from 
          # the Pop It In tab.  You would just replace this with your snippet.
          
    if(!isset($_SERVER['REQUEST_URI'])) {
             
    $psps_base_url $_SERVER['PHP_SELF'];
             if (isset(
    $HTTP_SERVER_VARS['QUERY_STRING'])) { $psps_base_url .= $HTTP_SERVER_VARS['QUERY_STRING']; }
          } else {
             
    $psps_base_url $_SERVER['REQUEST_URI'];
          }

          
    $psps_parameters '';

          foreach (
    $_REQUEST as $key => $value) {
            if (
    strpos($key,"psps_") > -) {
              
    $psps_parameters .= '&'.$key.'='.urlencode($value);
              
    $psps_base_url str_replace('&'.$key.'='.urlencode($value), ""$psps_base_url);
              
    $psps_base_url str_replace($key.'='.urlencode($value), ""$psps_base_url);
            }
          }  

          
    $psps_parameters .= "&psps_show_search=true";
          
    $psps_parameters .= "&psps_show_navigation=true";
          
    $psps_parameters .= "&psps_show_products=true";

          
    $psps_url "?psps_base_url=".urlencode($psps_base_url);
          
    $psps_url="http://shops.popshops.com/shops/php/7yfnyoa5f41j04abid8ippjy1$psps_url$psps_parameters";

          
    # Include the shop
          
    if (function_exists('curl_init')) {
          
    $shop=curl_init();
          
    curl_setopt($shop,CURLOPT_URL,$psps_url);
          
    curl_exec($shop);
          
    curl_close($shop);
            } else {
              
    readfile($psps_url);
            }
          
    ?>
        </div>
    </body>
    </html>

  12. #12
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Outstanding, Dan. Thanks so much!
    Generate more fake news.

  13. #13
    Member
    Join Date
    January 18th, 2005
    Posts
    155
    Thank you !

  14. #14
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    FYI, this is a great example of how you can override styles and completely customize the look of your site.

    I have been having fun adding categories simply by adding keywords into the file.

    Code:
     <? $categories = array('Daypacks', 'Rolling Backpack', 'Laptop Backpack', 'Mountaineering BackPack', 'Adidas Backpack', 'Kid Backpack', 'Diaper Backpack', 'Plush Backpack', 'Picnic Backpack','Athletic Backpacks', 'Bazoongi Backpacks', 'Personalized Backpacks', 'Waterproof Backpacks', 'Womens Backpacks', 'Ogio Backpacks','Motorcycle Bags', 'Pink Backpacks', 'Blue Backpacks', 'Purple Backpacks', 'Orange Backpacks', 'Green Backpacks', 'Spiderman Backpacks'); ?>
    Jessie Jones
    Create your custom affiliate store with PopShops.
    General support: support [at] popshops.com | Merchant requests: merchants [at] popshops.com
    (Include your popshops login, your shop name, and the URL or merchant you have an issue with.)

  15. #15
    ABW Ambassador Caseyfern's Avatar
    Join Date
    May 18th, 2007
    Location
    Yes, sadly I'm in California
    Posts
    518
    I'm working on a Smarty PHP install of this, if anyone's interested. It seems to take a bit of a different tapdance. (I should qualify that comment: my dear friend and coder buddy is doing the work.. I'm just doing the cheerleading and hand-wringing.)

  16. #16
    ABW Ambassador Caseyfern's Avatar
    Join Date
    May 18th, 2007
    Location
    Yes, sadly I'm in California
    Posts
    518
    Actually, modifying that prior message... we have a functioning Smarty PHP install now. You can see it in the Apparel > Uniforms section of our shop. Setup is slightly different from a standard php setup as described above. If anyone wants the gory details, just holler.

    I'm not sure if I'm allowed to post a link to my shop or if that is a TOS violation. But you can find us via the PopShops main page link to Perfectly Shaped World.
    Last edited by Caseyfern; May 8th, 2008 at 06:05 PM. Reason: Clarifying the location of the Smarty build

  17. #17
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,350
    You're the Greatest Dan! Know what I'm playing with tomorrow!!!

    Caseyfern, thanks for the extra work. I'll be tracking down your smarty php install (whatever that means). I know I'll know by tomorrow night!

    This is the most helpful forum in ages. A real spirit of learning and community!

  18. #18
    ABW Ambassador Caseyfern's Avatar
    Join Date
    May 18th, 2007
    Location
    Yes, sadly I'm in California
    Posts
    518
    This is working out so well that I'm in the process of evaluating the entire PSW store to see where I can embed dynamic shops in place of dozens of standalone shops. It turns out that it's not all that different from a normal PHP install as shown above, but we had to do some strange tap-dancing to keep the breadcrumbs from imploding. However, once the setup was done, adding more dynamic shops and adding to existing dynamic shops is truly a no-brainer.

    I still cannot figure out why searching for 'organic' returns page after page of organizers. I'm sure I'm missing something obvious, though - any ideas?

  19. #19
    ABW Ambassador beachcom's Avatar
    Join Date
    May 11th, 2006
    Location
    Myrtle Beach SC
    Posts
    723
    I'm using the category.php page to list products. I want to get the page title listed dynamically for each category but can't find the right php command. I've tried all I know ie. <? echo $category ?> along with various combos, with and with quotes. Any ideas?

    Thanks,
    Joey

  20. #20
    Member
    Join Date
    January 18th, 2005
    Location
    Canada
    Posts
    91
    This is fabulous! Thanks so much.

    Is it fairly easy code to do the url rewrite in htaccess to more search-engine friendly urls? Messing around with my htaccess file is the one thing that scares me silly ...

  21. #21
    Member
    Join Date
    August 4th, 2007
    Posts
    108
    This is great for small subject sites, but my site is so big I have to have some kind of organization to categories.......would suggest those that want a huge site built like this to use some kind of open source sql database program to organize the categories.....

  22. #22
    ABW Ambassador Caseyfern's Avatar
    Join Date
    May 18th, 2007
    Location
    Yes, sadly I'm in California
    Posts
    518
    I'm finding that it organizes quite well into categories. I'm using 24 at this time, and will be expanding that when time permits.

  23. #23
    Newbie
    Join Date
    June 25th, 2008
    Posts
    1
    I've been trying very hard to get this to work in a wordpress environment...
    However, I believe the codes that you provided were not for wordpress users, could you kindly provide us a wordpress version of the php codes necessary for the dynamic site creation?

    Thanks a million

  24. #24
    ABW Ambassador ladidah's Avatar
    Join Date
    October 15th, 2007
    Location
    MA
    Posts
    1,888
    I like this feature and it works really well. thank you!

    One question, I have quite a few 'or' statements in my category array. e.g.

    <? $categories = array('Superman||Superwoman', 'Batman||Batwoman', 'Iron Man', 'Incredible Hulk'); ?>

    The links shows up like this:
    Superman||Superwoman
    Batman||Batwoman

    How do you change the '||' to let's say ' / ' ?

  25. #25
    Full Member kayecee's Avatar
    Join Date
    July 26th, 2007
    Posts
    394
    If I want to use this in a Wordpress site, would I just replace my categories.php in the template? Would this work?



    Code:
    <?php get_header(); ?>
    
    <? $categories = array('Superman', 'Batman', 'Iron Man', 'Incredible Hulk'); ?>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Content site - static or dynamic?
    By anabayan in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 6
    Last Post: September 3rd, 2008, 01:28 AM
  2. quotes requested - convert dynamic site to static html site
    By chrish in forum WebMerge (Fourthworld.com)
    Replies: 3
    Last Post: March 15th, 2004, 05:08 AM
  3. Dynamic Site Question..
    By auradefect in forum Search Engine Optimization
    Replies: 2
    Last Post: February 27th, 2003, 02:44 PM

Posting Permissions

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