Author Topic: Allow only image-owner to send ecards  (Read 12268 times)

0 Members and 1 Guest are viewing this topic.

Offline CCVBE

  • Newbie
  • *
  • Posts: 45
    • View Profile
Allow only image-owner to send ecards
« on: January 27, 2008, 07:03:01 PM »
How to do, that only the image-owner has in detail.html the button "ecard"?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Allow only image-owner to send ecards
« Reply #1 on: January 27, 2008, 07:04:37 PM »
4images version?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #2 on: January 27, 2008, 07:16:35 PM »
[edit] - for eCard. Sorry ...
« Last Edit: January 27, 2008, 07:30:12 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Allow only image-owner to send ecards
« Reply #3 on: January 27, 2008, 07:23:54 PM »
 8O
good code for anything but not for this request

Kurt

Offline CCVBE

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #4 on: January 27, 2008, 07:25:07 PM »
Version 1.7.4, but the code does'nt work...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #5 on: January 27, 2008, 07:33:36 PM »
8O
good code for anything but not for this request

Kurt

This is right ... I no read first post correct ... I edit post.

In includes/functions.php file,

find:

Code: [Select]
function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
  global $self_url,

add after (same line) :

Code: [Select]
$is_image_owner,

[Version A] - Is show off button for guest and member level.

find:

Code: [Select]
if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {

replace:

Code: [Select]
if (!check_permission("auth_sendpostcard", $image_row['cat_id']) || !$is_image_owner) {

[Version B] - Is no show button axcept for image owner.

In includes/functions.php file,

find:

Code: [Select]
else {
    $postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
  }

replace:

Code: [Select]
elseif (isset($is_image_owner) && $is_image_owner) {
    $postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
  }

[Version C] - Template IF and ENDIF tag

In includes/functions.php file,

find:

Code: [Select]
"image_hits" => $image_row['image_hits'],

add after:

Code: [Select]
"is_image_owner" => (isset($is_image_owner) && $is_image_owner) ? true : false,

In templates, use {if is_image_owner}...{endif is_image_owner} .
« Last Edit: January 27, 2008, 08:59:26 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Allow only image-owner to send ecards
« Reply #6 on: January 27, 2008, 07:35:16 PM »
perfect  :wink:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #7 on: January 27, 2008, 07:36:50 PM »
I edit post. Please try again.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #8 on: January 27, 2008, 07:49:38 PM »
perfect  :wink:

Very good. Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline CCVBE

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #9 on: January 27, 2008, 08:12:44 PM »
Hi, works fine! Thank you very much!
But I don't want to show the "postcard_off.gif" for guest and other members.
You I have deleted 2. codeversion, this worked so, but I have overwritten this version. ;-(
Can you post it again? ;-)
« Last Edit: January 27, 2008, 08:32:41 PM by CCVBE »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #10 on: January 27, 2008, 08:38:04 PM »
Can you post it again? ;-)

I post version A and B now. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #11 on: January 27, 2008, 08:59:43 PM »
I post version C now. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline CCVBE

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #12 on: January 27, 2008, 10:11:21 PM »
Great! With all possible options! Thanks a lot man! ;-)


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #13 on: January 27, 2008, 10:26:05 PM »
Very good. Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline CCVBE

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Allow only image-owner to send ecards
« Reply #14 on: January 29, 2008, 08:33:35 AM »
Version B, if you search for pictures:

Notice: Undefined variable: postcard_button in /homepages/xx/.........................../includes/functions.php on line 491