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.
InstructionsPlease choose your correct version of CPG.
MODIFYING CPG 1.3.xFILE displayimage.php--ADD CODE BELOW THE FOLLOWING LINE
'{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',
--ADD FOLLOWING CODE
'{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
<td align="center" valign="middle" class="navmenu" witdh="100%">
{PIC_POS}
</td>
--ADD FOLLOWING CODE
<!-- 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
<!-- END report_file_button -->
--ADD FOLLOWING CODE
<!-- 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
'{REPORT_TITLE}' => $lang_img_nav_bar['report_title'],
'{LOCATION}' => $location,
--ADD THE FOLLOWING CODE
'{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:- This MOD ignores the lang file. The only english words are "Order Prints", I opted not to use the lang file to make the mod easier.
- While it would be nice to include this in the next version of CPG, a feature freeze is already in effect so this will have to wait for the next update.
- The order.gif is a pretty bad button. I am sorry graphics has never been my specialty.
- There is a possibility to do this with other sites, I just found shutterfly to be the easiest to include.
ExampleTo see an example of this in action:
http://www.krkeegan.com - Sorry I no longer run coppermine on my site.
FutureI welcome any future mods or additions to this MOD. i.e. Other sites, better button and so on. Post your work here.