4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: IcEcReaM on March 21, 2006, 10:36:38 PM

Title: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 21, 2006, 10:36:38 PM
[ Introduction ]
With this mod you are able, to set for each image a different price,
and when set, on the details site, there will be an small link to the paypal site.

[ Features ]
- Price can be set individually for each image different
- if no price is set, no link will be shown

Demo can be seen here: Demo Link (http://icecreamtest.ic.funpic.de/gallery/details.php?image_id=130)

[ Changed Files ]
lang/<your language>/main.php
details.php
includes/db_field_definitions.php
templates/details.html

[ New Files ]
templates/details_paypal.html
templatesdetails_paypal_cart.html


[ Installation ]
Download the rar archive.
unpack the files.
follow the installation note.

Download here: Download Link (http://icecreamtest.ic.funpic.de/gallery/details.php?image_id=131)
You can register your own account (no email verification is needed)
or login in with 4images/4images.


Step 1:
Open includes/db_field_definitions.php
add before ?>
Code: [Select]
$additional_image_fields['price'] = array($lang['image_price'], "text", 0);

Step 2:
open templates/details.html
search for
Code: [Select]
    <br />{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
  </div>
  <br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
and add below
Code: [Select]
{if price} {details_paypal} {endif price}
you can place this code everywhere you want in the details.html,
where the link should be displayed.


Step 3:
open details.php
search for:
Code: [Select]
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);
add below:
Code: [Select]
//-----------------------------------------------------
//--- Shop Mod Lite -----------------------------------
//-----------------------------------------------------

if (isset($image_row['price'])) {
        $site_template->register_vars(array(
            "email_business" => "mymail@here.com",  // enter your email adress/paypal account here
            "buyer_email" => ($user_info['user_email']) ? $user_info['user_email'] : '',
            "url_paypal" => "www.paypal.com",    // enter www.sandbox.paypal.com to test the sandbox function
        ));

  $details_paypal = $site_template->parse_template("details_paypal");
  $details_paypal .= $site_template->parse_template("details_paypal_cart");
  $site_template->register_vars("details_paypal",$details_paypal);
}


Step 4:
execute the installer.
and place all templates from the rar archive to your templates folder.

[ Notes ]
You have to edit from step 3 this line:
Code: [Select]
"email_business" => "mymail@here.com",  // enter your email adress/paypal account heredon't forget to set your email adress here.

If you want, that an other image should be displayed, just edit the template files.
In the template files (details_paypal.html/details_paypal_cart.html) edit the following lines:
Code: [Select]
             <input type="hidden" name="shipping" value="1.00">
             <input type="hidden" name="shipping2" value="0.50">
             <input type="hidden" name="handling" value="2.00">
here you can set additional costs for shipping and/or handling.

All values must be entered in following format with a dot "." as seperator for prices.
The price can be set in control panel by editing the images.

done.

Have Phun.

This is not really a shop mod, it's just to play around with it.


Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 22, 2006, 02:57:50 AM
Nice, this is exactly what I did Sunday night. I was going to post it sometime this week when I got time but you have beat me to it.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 22, 2006, 03:02:21 AM
Oh and one thing, your download link does not work.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 22, 2006, 09:39:25 AM
the download link works, but the site is sometimes a little bit slow or down,
then you have wait some minutes.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 23, 2006, 07:39:29 AM
that link takes me to microsoft
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: V@no on March 23, 2006, 02:59:29 PM
fixed
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 23, 2006, 10:12:15 PM
ok i got to the mods page, but now there is no where to click for the actual download
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 23, 2006, 11:38:23 PM
the download link takes you directly to the mod site & download.
If neccessary you must only login with your own account or the account login is described above.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 24, 2006, 03:18:08 AM
ah sorry i missed that part, thanks
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 24, 2006, 06:00:01 AM
Ok, so I tried installing yours on a old gallery site and it did not work. It told me some bad sql query run line crap. Any ideas? It seems like not very much code you know?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: up23 on March 25, 2006, 12:39:00 AM
Installed this mod with 1.7.2. I had to make some changes to get it to work. In the .php file, the new column added was named "price2" instead of "price". Also default value of 0.00 should be added. Fixed by installing as normal, and then using phpmyadmin. Changed the column name of price2 to price. Added default value = 0.00 by editing the structure of column from structure tab. Updated all price values with query: update `4images_images` set `price`=0.00 WHERE `image_active`=1. It might have been eaiser to update the query to alter table in the .php file.

This is probably not hard, but does anyone know how to return the user_email variable (like it was used in members.php) onto the details.php? I want to use {user_email} on the details template page as the paypal payment email. Please give the codes needed to be changed. Thanks.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 25, 2006, 08:26:50 AM
UP23 -

I see what you are saying. I think for this to maybe 'take off' with more people that you should go into detail with code exacmples for him to edit the first message on this board so people do not have to go hunting for the fixes and what not.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 25, 2006, 03:32:08 PM
Installed this mod with 1.7.2. I had to make some changes to get it to work. In the .php file, the new column added was named "price2" instead of "price". Also default value of 0.00 should be added. Fixed by installing as normal, and then using phpmyadmin. Changed the column name of price2 to price. Added default value = 0.00 by editing the structure of column from structure tab. Updated all price values with query: update `4images_images` set `price`=0.00 WHERE `image_active`=1. It might have been eaiser to update the query to alter table in the .php file.

Sorry, my fault, i updated the installer,
now the created column is price instead of price2.
And default value shouldn't be set, cause if you set per phpmyadmin an default price,
this paypal button does appear on every image, which should only appear if an price is set.

Quote
This is probably not hard, but does anyone know how to return the user_email variable (like it was used in members.php) onto the details.php? I want to use {user_email} on the details template page as the paypal payment email. Please give the codes needed to be changed. Thanks.

what do you mean?
You mean the email from the user who want to buy the image?
if yes, the users email is already been parsed (if set) in the {buyer_emall} tag

@sau4scr:
I thought you already have coded your own?
You spaming this thread with a lot of unnecessary posts & comments.

Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 25, 2006, 07:50:25 PM
I'm not spamming. Yes I do already have my own, its a little different from yours though because I have a base value set instead of a value from a database. I am more trying to help this post out for the use of others.
www.photographybyweston.com/gallery and you can see mine. It is a little more messy you could say though. I am not the greatest at PHP, I am really good with Coldfusion.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 25, 2006, 07:54:32 PM
ok, that getting to offtopic.

the reason why i said, you were spamming,
that mainly all of your posts above,
could be answered themself, if you had read my first post correctly.
cause everything where and how to download was described there.

and also to say, "it doesn't work for me" is not very helpful,
if you were not more specifc what kind of error messages you get,
or what exactly doesn't work.

Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 26, 2006, 11:05:00 PM
Ok, so I applied this to my site simply because I like the ability to give an image a different price.

Here is my one question,
{if price} {details_paypal} {endif price}

I want to make another line of that if no price then show this. So I did this...
{if no price} {details_paypal} {endif no price}

And it did not work, how do I do that so if there is no price then they can download the image?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 27, 2006, 12:22:47 AM
it depends of which 4images version you use.

if you use 1.71 and have installed the ifno mod which posted from vano,
you should use {ifno price} {details_paypal} {endifno price}

otherwise for 1.72
{ifnot price} {details_paypal} {endifnot price}
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sau4scr on March 27, 2006, 12:46:47 AM
Thank you! Much appreciated!
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: up23 on March 31, 2006, 01:53:37 PM
Quote
what do you mean?
You mean the email from the user who want to buy the image?
if yes, the users email is already been parsed (if set) in the {buyer_emall} tag
Thanks for the fix icecream. I got the problem solved. I wanted to send the money to the uploader of the image, so I had to get the uploader's email. I added
Code: [Select]
$owner_email = $image_row['user_email']; to details.php after the first sql query:
Code: [Select]
$image_row = $site_db->query_firstrow($sql); and added
Code: [Select]
"owner_email" => $owner_email, under the "Print Out" section. I used
Code: [Select]
{owner_email} on the details.html template file.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on March 31, 2006, 06:29:54 PM
ok, if you were more detailed in your first post,
then i could have give you a solution too.
i thought you mean the email adress of the user, who want to buy that picture.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: nika2000 on April 11, 2006, 11:18:54 PM
Hi!

Is there a possibility to set more than one price??

Greetings
Nika-2000
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: Grutho on April 15, 2006, 09:51:49 PM
Hi,
I implemented this nice MOD, but after the payment there is no recive to download for the bought Image. Is that right or did I anything wrong? If not, one witch way I can realised an automatic download for the bought Images?

Thanks in Advanced  :roll:
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on April 17, 2006, 12:44:40 AM
no, you didn't something wrong.
this mod is for paying only,
there are no option for download after buying.

an automatic download option would require some more improvements for this mod,
which i will not do...cause this mod isn't a "full" shop mod.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: edwin on April 17, 2006, 04:54:54 PM
panic, panic, panic

I tried to install your MOD and i'm getting the below DB error, mayby you can take a look before uninstal it
I did it exactly like you wrote and it gave me a notice that the db was update succesfully

If it not easy resolve the problem, can you tell me then how i can remove the I.price collum from the field list

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.price, c.cat_name, u.user_name, u.user_email FROM 4images_images i, 4images_categories c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_id = 165493 AND c.cat_id = i.cat_id
Unknown column 'i.price' in 'field list'

with regards

www.foto-janssen.nl (http://www.foto-janssen.nl)
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on April 17, 2006, 06:59:21 PM
try to run the installer again,
seems the required field price is missing.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: edwin on April 17, 2006, 07:03:09 PM
okay, tried this now i get

DB Error: Bad SQL Query: ALTER TABLE `4images_images` ADD `price2` VARCHAR( 12 ) NOT NULL
Duplicate column name 'price2'
an Error occured

i'm using 1.7.1, mayby this will help
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: Grutho on April 18, 2006, 04:33:20 PM
Dont worry...

change the database fild name from price2 to price.

And all must works fine!

Regards, Tom
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: IcEcReaM on April 21, 2006, 12:09:23 PM
could it be, that you already had installed an other mod,
who is using a field named price2?

i tested this mod with 1.71 (fresh install) and it worked.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: edwin on April 21, 2006, 02:11:20 PM
I don't think that possible, i havn't uninstalled it because customers don't have to see the problem and i havn't got time to try it again, i will let you know

regards

edwin
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: aymanati on May 12, 2006, 12:16:19 PM
Hi;
Nice mod ..

How can we make the price set by each user (who upload images) with image upload?
In other words, I have users who upload their photography, and i want them to be able to set price for each image they upload.
And to display a link to contact the user directly instead of the PayPal link.
This will make the users able to sell their images.

I've been thinking in this long time but no result ..
how can we do that?

Thanks
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: cookie on May 27, 2006, 12:32:13 PM
I know this might sound like a strange business model, but I would like to see if it is feasible to create a mod which will have a paypal donate (or buy) button when someone wants to see an e-card (electronic postcard).

They pay $0.50 or $1.00 to send the e-card.

To keep them from just downloading the image and emailing the image, we'd install the watermark MOD.  However, the postcard'ed image would not be watermarked.

Is this possible?  I noticed that icecream stated that this MOD is not a full shop solution. so even though a person pays, they do not get to instantly download the image.  For the solution that I'm talking about, they would pay, and then get to send the e-card immediately.

I apologize if I've posted this message in an inappropriate place.

I've been trying to get to icecream's website to look at the code for this mod for 2 or 3 days now and it seems to be down.  Perhaps you can attach the files in your original post.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: bigwave on September 13, 2006, 10:30:19 PM
Hi,

I'm getting this error after install--I'm using 1.7.3:

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, i.price, c.cat_name, u.user_name FROM (4images_images i, 4images_categories c) LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id = 31 AND c.cat_id = i.cat_id ORDER BY image_name ASC, image_id ASC LIMIT 0, 9
Unknown column 'i.price' in 'field list'

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cymaui01/public_html/boutique/includes/db_mysql.php on line 116

When I try and rerun the installer I get this error:

An unexpected error occured. Please try again later.
an Error occured


I'm all backed up--any comments before I uninstall?

Thanks
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: walkerweb1 on October 06, 2006, 06:46:56 PM
I too am getting the same error trying to use it on 1.7.3  Any help would be great.   I am somewhat new to this so forgive my ignorance, but I tried to point my browser to the paypal_install.php file in my templates folder, this is how you run the installer, correct?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: bigwave on October 06, 2006, 07:15:15 PM
the installer never got repaired as mention previously in the thread
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: walkerweb1 on October 06, 2006, 07:57:42 PM
Are there any other Paypal mods that you know of?

Thanks for the reply!
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: bigwave on October 06, 2006, 08:16:04 PM
you know you can stick paypal buttons in the description field but you need to use this:
http://www.4homepages.de/forum/index.php?topic=14433.msg77800#msg77800
from Mr. V@ano who is always a GREAT help, or the formatting will be terrible

The promise of merging 4images with paypal is an incredibly powerful idea--to bad it stops here--maybe the new google checkout would be more viable/doable—if there could be an inventory check the payment processor does all the heavy lifting, 4images would only be the structure and you could have a complete system less the science fiction stuff of the pay on download idea
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: walkerweb1 on October 06, 2006, 08:23:08 PM
Thank you so much for the help with this!!!! 
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: kowalski on August 15, 2007, 10:05:32 AM
To avoid the problem of the error

Unknown column 'i.price' in 'field list'


Use this version of paypal_install.php instead

Code: [Select]
<?php

define
('ROOT_PATH''./');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'global.php');




$sql_data = array(
   
"ALTER TABLE `".IMAGES_TABLE."` ADD `price` VARCHAR( 12 ) NOT NULL",
);

foreach (
$sql_data as $val){
if ($site_db->query($val)) {
 
  $log[$val] = "Succesfully updated Database";
}
else {
  $log[$val] = "<font color=\"red\">Error</font>";
  $error 1;
    }
}

if (!
$error) echo "Succesfully updated Database";
else echo 
"an Error occured";


?>


The only difference from the original file posted is this line:

   "ALTER TABLE `".IMAGES_TABLE."` ADD `price` VARCHAR( 12 ) NOT NULL",

On the original this was 'price2'
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: thunderstrike on August 15, 2007, 01:37:35 PM
Question: $log ... is happen ? See in foreach but no after ...
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: rinaldos on November 08, 2007, 12:28:49 PM
Hello @all

Where i have to put the code from details.php in, when i want to show the paypal button in user_login_form or somewhere els?

---

Hallo zusammen,
wo muss ich den Code aus der details.php reinsetzen, damit der PayPal Button auch im user_login_form oder sonstwo angezeigt wird.

Gruß
Ingo
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: albertpr9 on November 12, 2007, 10:40:14 AM
I installed the mod, with no errors...

Now where do you go to set the price for each image? Thanks!

-- Edit! --

Found it! : ) 

Thanks!
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: Melissa67 on February 26, 2008, 02:40:04 PM
Hi -

I have several different artists within the art gallery on my website. Is it possible that each member is able to have their own paypal account so that when a buyer clicks on their buy now button it will be paid to that individual? Is this possible?

Melissa
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: 5degrees on November 17, 2008, 08:06:05 AM
The download link for this MOD is broken.

Have tried over 3 days but consistently stating that the page is not available

Does anyone have the file or a location to link it from?

If someone has the file then I will happily supply hosting
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: V@no on November 17, 2008, 03:28:13 PM
You must register at the site, before you can download the files.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: 5degrees on November 20, 2008, 02:18:16 PM
Had registered but when taking link and putting direct into browser I was just getting - page not found.

Have downloaded now from link on first page of this thread - not asked to login.

File downloaded direct from host - all good, cheers!
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: partymunich.de on December 10, 2008, 06:20:18 PM
i installed everything as it was told, but when I set a price for a picture no paypal button appears.
i donno what the problem might be.

Please help! Thx a lot!
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: sanko86 on January 13, 2009, 03:55:50 PM
Thanks beavtiful mod.
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: harrypotter228 on February 16, 2009, 10:46:13 PM
 :cry: :cry: :cry: :cry:not install 1.7.6 plz help
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: CarstenM on April 23, 2009, 02:49:40 PM
bei dem Paypal teil haut der da automatisch einen Button rein??  wenn ich das uploade und wie ist das mit dem download?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: aldoy on January 12, 2010, 04:03:08 PM
Thank you so much for a great Mod, but after installing visitors are able to view the full image without payment.

I'm wondering what's the difference after payment for an image?
I think this MOD is about allowing download for paid images?

Or is it for Print Orders Payment and it has nothing to do with Download or High Resolution?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: GaYan on April 28, 2010, 03:00:07 PM
cant we integrate a shopping cart system to this ?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: Hoang on June 14, 2010, 08:35:02 AM
How to make this MOD have this features:

1. Set price for each files (MOD had)
2. If no price set for files, it will available as defaults (Registered users can download without paid)

EDITED: After installing and using, i know that this MOD can do all requested above.

THANKS
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: Hoang on June 22, 2010, 07:40:29 AM
Open <your lang>main.php

add this

Code: [Select]
$lang['image_price'] = "Price";
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: osnapicture on March 05, 2011, 12:43:09 PM
I'd like to change this MOD. Is it possible to display the image description only after a paypal payment has made?
Title: Re: [MOD] Paypal Mod (Shop Mod Lite)
Post by: relu on April 27, 2012, 02:39:02 AM
I find the place in my page for this MOD. Many Thanks!

My Demo:
On Detail image "Info"

http://www.pulsarmedia.eu/r_space_exploration_wallpapers_14_planet_with_rings_wallpaper_2560x1600_83988.html