Button related to picture Button related to picture
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Button related to picture

Started by roovio, June 18, 2004, 09:34:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roovio

Can anybody help me in this.
I'd like to add button next to "Picture information" section. I have static html code for this button (in red color is what i'like to have taken fro each picture from database):

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="my@email.adress">
    <input type="hidden" name="item_name" value="file_number">
    <input type="hidden" name="amount" value="value_from_custo_field1">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="currency_code" value="USD">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but5.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">

Thanks for help
Rafal

roovio

Sorry:
<input type="hidden" name="business" value="my@email.adress">
alway will be the same

Joachim Müller

has been requested before, nobody has come with a hack so far afaik.

GauGau

roovio

#3
So far so good...
Hey there.
I don't know php but i did this:

in displayimage.php after code:

// Display picture information
function html_picinfo()
{

    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR, $FAVPICS;
    global $album, $lang_picinfo, $lang_display_image_php, $lang_byte_units;


i put:
    $email = "my@email.com";
    $pay_a = "https://www.paypal.com/xclick/business=";
    $pay_b = "&item_name=";
    $pay_c = "&amount=";
    $pay_d = "&no_note=1&currency_code=USD";
    $price = $CURRENT_PIC_DATA['user'.$i=1];


and after code:
    // Create the absolute URL for display in info
    $info['URL'] = '<a href=' . $CONFIG["ecards_more_pic_target"] . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . ' >' . $CONFIG["ecards_more_pic_target"] . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';


i put:

    // Create the PayPal link
    $info['Buy it Now'] = '<a href=' . $pay_a . $email . $pay_b . htmlspecialchars($CURRENT_PIC_DATA['filename']) . $pay_c . $price . $pay_d . ' >' . $pay_a . $email . $pay_b . htmlspecialchars($CURRENT_PIC_DATA['filename']) . $pay_c . $price . $pay_d . '</a>';


Maby it is not rofessional, but work.

Now. I want to show for user small button instead of whole link. Can somebody tell me how to do this???

Thank You
Rafal

Nibbler

<a href="address"><img src="url to pic" alt="text description" border="0"></a>

Joachim Müller

so you were able to code php out of nowhere, but you don't know the <img>-tag?

GauGau

roovio

Well. It was so hard for me to find out how php is working and i forgot about simple thing.  :-[

roovio

So i start to learn php... and i love it.

I changed a little code so now if You don't put price in Custom Filed 1 button don't appear also.

instead of
   // Create the PayPal link
   $info['Buy it Now'] = '<a href=' . $pay_a . $email . $pay_b . htmlspecialchars($CURRENT_PIC_DATA['filename']) . $pay_c . $price . $pay_d . ' >' . $pay_a . $email . $pay_b . htmlspecialchars($CURRENT_PIC_DATA['filename']) . $pay_c . $price . $pay_d . '</a>';


put
          if ($CURRENT_PIC_DATA['user' . $i=1] != "") {
               $info['Buy tihis picture'] = '<a href=' . $pay_a . $email . $pay_b . htmlspecialchars($CURRENT_PIC_DATA['filename']) . $pay_c . $price . $pay_d . ' ><img src="button_link" alt="Your_text" border="0"</a>';
           }