forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Selling pictures => Topic started by: krkeegan on April 17, 2005, 01:06:01 am

Title: Print Photos Through Shutterfly Simple Mod
Post by: krkeegan on April 17, 2005, 01:06:01 am
Sorry I am only allowed to post in this board, any please move to Mod board.

Description:
This will add a button to the left of the Report and ECard button in the nav bar. Clicking this button will take you to shutterfly and add the photo to your shopping cart. You can then return to your photos and continue to add more.

Instructions
Please choose your correct version of CPG.

MODIFYING CPG 1.3.x

FILE displayimage.php

--ADD CODE BELOW THE FOLLOWING LINE
Code: [Select]
'{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',
--ADD FOLLOWING CODE
Code: [Select]
'{WIDTH}' => $CURRENT_PIC_DATA['pwidth'], //Shutterfly Mod
'{HEIGHT}' => $CURRENT_PIC_DATA['pheight'], //Shutterfly Mod
'{IMG}' => $CONFIG['ecards_more_pic_target'] . $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'], //Shutterfly Mod
'{THUMB}' => $CONFIG['ecards_more_pic_target'] . $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CONFIG['thumb_pfx'] . $CURRENT_PIC_DATA['filename'], //Shutterfly Mod
'{URL}' => $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]", //Shutterfly Mod

FILE theme.php  //You will need to modify all themes that you use.

--ADD CODE BELOW THE FOLLOWING LINE
Code: [Select]
<td align="center" valign="middle" class="navmenu" witdh="100%">
      {PIC_POS}
</td>

--ADD FOLLOWING CODE
Code: [Select]
<!-- Shutterfly Mod -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                        <a href="#" onclick="order.submit()" class="navmenu_pic" title="Order Prints"><img src="images/order.gif" border="0" align="middle" alt="Order Prints" /></a>
                </td>
<!-- /Shutterfly Mod -->

--UPLOAD order.gif  //attached to this post
UPLOAD to root/images folder

If there are any problems let me know I am using the devel version so I couldn't test this but it should be fine. Don't forget to modify the correct theme.php file.

MODIFYING CPG 1.4.x  // This is a much easier mod than 1.3

FILE themes.inc.php 

--ADD CODE BELOW THE FOLLOWING LINE
Code: [Select]
<!-- END report_file_button -->
--ADD FOLLOWING CODE
Code: [Select]
<!-- Shutterfly Mod -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                        <a href="#" onclick="order.submit()" class="navmenu_pic" title="Order Prints"><img src="{LOCATION}images/order.gif" border="0" align="middle" alt="Order Prints" /></a>
                </td>
<!-- /Shutterfly Mod -->

--ADD CODE BELOW FOLLOWING LINE  //Make sure you are in the theme_html_img_nav_menu() function
Code: [Select]
'{REPORT_TITLE}' => $lang_img_nav_bar['report_title'],
'{LOCATION}' => $location,

--ADD THE FOLLOWING CODE
Code: [Select]
'{WIDTH}' => $CURRENT_PIC_DATA['pwidth'], //Shutterfly Mod
'{HEIGHT}' => $CURRENT_PIC_DATA['pheight'], //Shutterfly Mod
'{IMG}' => $CONFIG['ecards_more_pic_target'] . $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'], //Shutterfly Mod
'{THUMB}' => $CONFIG['ecards_more_pic_target'] . $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CONFIG['thumb_pfx'] . $CURRENT_PIC_DATA['filename'], //Shutterfly Mod
'{URL}' => $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]", //Shutterfly Mod

NOTE: If your theme sets the $template_img_navbar variable you will need to add the first section of code in the theme.php file for that theme.
NOTE: If your theme sets the theme_html_img_nav_menu() function you will need to add the second section of code in the theme.php file for that theme.

--UPLOAD order.gif  //attached to this post
UPLOAD to root/images folder

NOTE: If your theme defines custom nav buttons you will need to upload the order.gif to the theme/image folder as well.


CAVEATS TO BOTH VERSIONS:


Example
To see an example of this in action:
http://www.krkeegan.com (http://www.krkeegan.com) - Sorry I no longer run coppermine on my site.

Future
I welcome any future mods or additions to this MOD. i.e. Other sites, better button and so on. Post your work here.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: trued on May 25, 2005, 04:42:16 am
hello, i am using a hacked version of cpg. One that is integrated with pmachine. It is version  (v1.1.0) . Im wondering if I can install this hack to print the photos to shutterfly. The hack i am using is the pmachine/cpg port.  I just want to make sure that the code im modifying exists in my version.
this sounds like a great mod!
thanks for the help
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Joachim Müller on May 25, 2005, 07:55:27 am
no, you can't. This mod was made for cpg1.3.x and cpg1.4.x, not for cpg1.0 to cpg1.2.x
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: trued on May 26, 2005, 04:43:49 am
thanks for the reply, is it possible to edit it for 1.1?
I know its an old version but its a great mod as well . the only reason i ask for this version edit is because I use the cpg port for pmachine and i dont see a way to upgrade to the lastest cpg for the port.

also , i was trying to create a new topic but I couldnt find the new topic button. trust me I looked. I am trying to ask a question about php includes. Please point me in the right direction. Is it shut off for the server move?

thanks!
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Tranz on May 26, 2005, 05:40:07 am
I guess you'd have to try for yourself, after backing up.

You can't create new threads in the mods/hacks board but you can post in the appropriate support boards.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: trued on May 26, 2005, 06:03:09 pm
i have gone to the appropriate board. support for 1.1 standalone oc cpg. I even went to the faq on how to post a topic but as you can see i posted this topic just fine so maybe im just blind .. lol.. anyway , i will try and thanx for the help.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Joachim Müller on May 27, 2005, 02:28:18 pm
http://forum.coppermine-gallery.net/index.php?topic=18304.0
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: 9re9 on May 31, 2005, 12:37:52 am
Great hack, thanks.

Here's a printer icon that's goes with the coppermine icon color scheme.
Title: So has anyone managed to do the same for Snapfish?
Post by: prim on June 20, 2005, 05:53:16 am
Just thought I'd ask. I was thinking of investigating it. Any idea? So far I havnt found a easy way to do it :(
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: tj on July 04, 2005, 04:14:45 am
This is very cool.
Upon inserting the code on the theme.php I get two rows of buttons  now (http://www.griffhome.com/photos/displayimage.php?album=topn&cat=0&pos=3).
I am wondering how to get the  navmenu back to just one row... I've played with it a bit but am not quite sure how...  ::)

Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT
                    <div align="center" class="navmenu">
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>

                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>

                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>

                        {PIC_POS}
<!-- Shutterfly Mod -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                        <a href="#" onclick="order.submit()" class="navmenu_pic" title="Order Prints"><img src="images/order.gif" width="16" height="16" border="0" align="absmiddle" alt="Order Prints" /></a>
                </td>
<!-- /Shutterfly Mod -->

                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>

                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>

                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
                     </div>
EOT;

Thanks for any tips on getting this aligned!

Tj
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: awilder on January 09, 2006, 05:27:13 am
krkeegan:  Thank you for a great mod! 

tj:  I also had a problems with the extra line in my links row--the order.gif icon had a linebreak above it, thus forcing it lower and making the whole row of icons taller.  This was only a problem in Firefox, not in IE.

My workaround was to move the entire Form between two of the table cells...not great HTML coding, for sure, but it did the trick and still works fine.

Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT
                    <div align="center" class="navmenu">
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>

                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>

                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>

                        {PIC_POS}
<!-- Shutterfly Mod -->
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                        <a href="#" onclick="order.submit()" class="navmenu_pic" title="Order Prints"><img src="images/order.gif" width="16" height="16" border="0" align="absmiddle" alt="Order Prints" /></a>
                </td>
<!-- /Shutterfly Mod -->

                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>

                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>

                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
                     </div>
EOT;
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: willstein on January 19, 2006, 02:47:58 am
Great Mod!

Anyway to get this to open in _blank?
When I try, it opens a new window - with the current content, and updates the old window with the new link.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Armstrong on January 22, 2006, 05:30:51 am
has anyone sucessfully completed this Mod in Kubrick for version 1.3.x? the first code add works for me, but i cannot find where to place the second half

FILE theme.php   //You will need to modify all themes that you use.

--ADD CODE BELOW THE FOLLOWING LINE
Code:


Code: [Select]
<td align="center" valign="middle" class="navmenu" witdh="100%">
      {PIC_POS}
</td>

I've attached my theme.php file...If someone could let me know where this goes i'd appreciate it!

Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Armstrong on January 28, 2006, 06:07:22 am
any ideas on this one? please...
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: willstein on January 31, 2006, 06:52:59 pm
has anyone sucessfully completed this Mod in Kubrick for version 1.3.x? the first code add works for me, but i cannot find where to place the second half

FILE theme.php   //You will need to modify all themes that you use.

--ADD CODE BELOW THE FOLLOWING LINE
Code:


Code: [Select]
<td align="center" valign="middle" class="navmenu" witdh="100%">
      {PIC_POS}
</td>

I've attached my theme.php file...If someone could let me know where this goes i'd appreciate it!





Mine works great, and I put it around line 515.

Here is 499 - 543 in my theme.php
Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>
<!-- Shutterfly Mod -->
                <td align="center" valign="middle" class="navmenu" width="48px">
                        <form name="order" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="POST">
                            <input type=hidden name=addim value="1">
                            <input type=hidden name=protocol value="SFP,100">
                            <input type=hidden name=pid value="C4PP">
                            <input type=hidden name=psid value="GALL">
                            <input type=hidden name=imnum value="1">
                            <input type=hidden name=imraw-1 value="{IMG}">
                            <input type=hidden name=imrawheight-1 value="{HEIGHT}">
                            <input type=hidden name=imrawwidth-1 value="{WIDTH}">
                            <input type=hidden name=imthumb-1 value="{THUMB}">
                            <input type=hidden name=returl value="{URL}">
                        </form>
                        <a href="#" onclick="order.submit()" class="navmenu" title="Order Prints"><img src="images/order.gif" border="0" align="middle" alt="Order Prints" /></a>
                </td>
<!-- /Shutterfly Mod -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
                </td>
        </tr>

EOT;
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: willstein on January 31, 2006, 07:13:57 pm
I am currently an affiliate of Shutterfly, does anybody know how to edit the link to hit the affiliate ID?

Thanks.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Granger on February 15, 2006, 06:25:20 pm
Thanks for posting this hack.  I somewhat of a novice with all of this so I have a question.  I have CPG 1.4 and have added the appropriate code to themes.inc.php.  I now have the icon to send photos to shutterfly.  When I send the photo to shuttery fly there is not a thumbnail visible.  When I clicked on properties for the broken image link in shutterfly, I noticed that the link for my thumbnail does not include www.  It just begins with http://   The links for all of my thumbnails begin with http://www.   Is there anyway I can fix this problem so that the link shutterfly receives for my thumbnails includes www.  Thanks
Jeremy
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: CatBrainiac on February 17, 2006, 07:46:11 pm
Great mod!  I've added it to our photo gallery, and opted to use text links instead of the mystery-meat icons.  Works wonderfully, and really like how it pops back to the gallery when you ask to select more. :)
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: iblazed on March 13, 2006, 05:27:40 am
Searched the forums but can't find the answer. Is it possible to put our shutterfly affiliate id in the shutterfly print mod? That way we get credit everytime someone prints pictures from our site on shutterfly. Thanks
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: cymrusteve on March 30, 2006, 08:25:24 pm
does anybody know how to edit the link to hit the affiliate ID?

any ideas how this can be done?

thanks,
steve
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: amann72 on October 10, 2006, 10:54:17 pm
Seems this post has been ignored: Can someone please tell us how to include an Affiliate ID?

Thanks.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Nibbler on October 10, 2006, 11:01:18 pm
The mod author has not visited the board since March, best thing to do is take a look through the code yourself.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: amann72 on October 10, 2006, 11:20:39 pm
I've no clue what to look at. I'm not a "coder".
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: Joachim Müller on October 11, 2006, 12:33:58 am
Then this mod is not meant for you.
Title: Re: Print Photos Through Shutterfly Simple Mod
Post by: bennettsweb on January 03, 2007, 02:56:36 am
GauGau - you really shouldn't be so quick to be disrespectful.  Seems like every thread I read ends with you acting like a child.  The problem amann is asking about is a very complex one that has nothing to do with the code and everything to do with linkshare not wanting to cough up for affiliate sales that go direct to the shopping cart via a form POST. 

This thread describes the problem, but I don't think there have been any changes in shutterfly's policy.

http://gallery.menalto.com/node/954 (http://gallery.menalto.com/node/954)

Best - Bennett