Author Topic: email an den Bildeigentümer - email to image owner  (Read 14532 times)

0 Members and 1 Guest are viewing this topic.

Offline vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
email an den Bildeigentümer - email to image owner
« on: August 28, 2007, 07:39:13 PM »
Hallo,

ich weiss, dass ich lästig bin, aber ich stehe vor einem nächsten Problem (habe bereits mehrere Suchläufe im Forum hinter mir, und nichts gefunden).

Ich würde gerne ermöglichen, dass "registered members" eine mail (von mir aus auch über deren mail Programm (MS-Outlook, Outlook Express, usw.)) an den Bildeigentümer senden können.
Button - nur sichtbar, bzw. anklickbar für "registered users".
Irgendeine Idee

Danke für die Hilfe !!

Hello,

I know, I´m nuisance, but I have another problem (I´ve searched the forum a lot of times, but didn´t find anything).

I would like to make it possibile, registered users may send an email to the image owner (also via their standard mail program (MS-Outlook, Outlook Express, a.s.o.)).
Button - only visibile or clickable for registered users.
any idea ??

Thanks for your help !!


Mario
Mario Schweiger


Offline vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #1 on: August 28, 2007, 11:20:25 PM »
Hallo alle Ihr 4image Gurus,

nachdem ich nun ein wenig (=2 Std.) herumgebastelt habe, stehe ich nun wirklich an!
Mein Problem beginnt schon damit, das ich nicht die Herkunft der Variablen:
Code: [Select]
{lightbox_button}  {postcard_button}        {download_button}  {download_zip_button}finde, die in der home.html ausgegeben werden.
Ich habe mir 2 Buttons (PM on, PM off) gebastelt die hier eingefügt werden müßten. Dabei ist es aber nicht wichtig, diese vom ACP aus steuern zu können. Es genügt: user = member: on, user = guest: off.
Wer kann mir helfen?
Schon mal Danke im Voraus!

Hello all your 4image Gurus,
after tinkering around two hours I´m at the end.
My problem starts with, I don´t know the origin of the variables:
Code: [Select]
{lightbox_button}  {postcard_button}        {download_button}  {download_zip_button} within the home.html.
I´ve made two buttons (PM on, PM off) which should be included here. It´s not important to control these from the ACP. Only:  user = member: on, user = guest: off.
May somebody help me, please ?
Thanks in advance!


2) Da ich ja nicht weis, wie ich die buttons installieren, bzw. aktivieren kann, kann ich das "message Formular" auch leider nicht selber testen.
Ich hab´ es mit einem Formular Script gemacht, das ich auch für andere Formulare auf meiner Webseite verwende. Also bin ich mir sicher, dass, wenn es vollständig installiert ist, es auch funktioniert (mit all den zur Verfügung stehenden Features).
Aber wie bekomme ich die benötigten Variablen hinein?
Ich habe jetzt einmal die (mit Ausnahme von {user_email}) aus dem Script genommen, wie ich es für die
email bei posting eines Kommentares verwende (siehe Link unten. Wenn Ihr auf Abschicken drückt, bekommt Ihr eine Fehlermeldung. Die Formularvariablen sind derzeit noch nicht mit denen des Formulars korriliert!).

Funktioniert das ??

Auch hier schon einmal Danke im Voraus für die Hilfe!

2) So I don´t know how to install, activate the new buttons, I´m not able to test the "message form".
I´ve done it with a script, I use for all my forms within my website. So I´m shure, it will work after "full installation", including all the usefull features.
But how to get in the needed variables?
I´ve used now these (except {user_email}) from the script:
email, when a comment is posted to an image. (see link. If you click the submit button, you will see an error page at the time. No variables of the new form are correlated with the formmailer).

Also here, thousend thanks in advance!!


Test-Form

Thanks, thanks and thanks
Mario

Mario Schweiger


Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #2 on: August 28, 2007, 11:48:07 PM »
tip.

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

weiter unten sind die xxx_button's
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #3 on: August 29, 2007, 12:15:31 AM »
Quote
Hello,

I know, I´m nuisance, but I have another problem (I´ve searched the forum a lot of times, but didn´t find anything).

I would like to make it possibile, registered users may send an email to the image owner (also via their standard mail program (MS-Outlook, Outlook Express, a.s.o.)).
Button - only visibile or clickable for registered users.
any idea ??

Thanks for your help !!

There is email to image owner MOD when comment post:

http://www.4homepages.de/forum/index.php?topic=2705.0

Is ok ? Or need email image owner from member ?
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 vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #4 on: August 29, 2007, 10:11:42 AM »
@ thunderstrike
Yes, I would like to make it possible to send (members only) an email to the image owner (not, when a new comment is posted).

@ Nicky
Danke, ich hab´s gefunden, aber ich bekomme es nicht hin!

Ich habe jetzt in der functions.php (hoffentlich an richtiger Stelle) folgendes eingefügt:
I have inserted within the functions.php (I hope at the right place) the following:
Below "sendpostcard" and above "auth_imageview"


Code: [Select]
  if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {
    $postcard_button = "<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";
  }
  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>";
  }
 
     if ($user_info['user_level'] != GUEST) {
    $pm_button = "<img src=\"".get_gallery_image("pm_off.gif")."\" border=\"0\" alt=\"\" />";
  }
  else {
    $pm_button = "<a href=\"".$site_sess->url(ROOT_PATH."pm.html")"\"><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"\" /></a>";
  }

  if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {

nach "sendpostcard" und vor "auth_viewimage".
Ich bin mir bewusst, dass der angebene Pfad ((ROOT_PATH) nicht stimmt, aber  es funktioniert (deswegen?) nicht?
Ich bekomme aber auch keine Fehlermeldung!

In der details.html habe ich nun eingefügt:
Into the details.html I have written

Code: [Select]
    <br />{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}&nbsp;&nbsp;{pm_button}
  </div><br />

und die 2 Buttons (pm.gif und pm_off.gif) sind im richtigen Ordner (templates/4waters/images).
Aber ich bekomme sie nicht angezeigt!
and the two buttons (pm.gif and pm_off.gif) are in the correct directory (templates/4waters/images).
But I don´t see them.


Bitte helft mir!
Please help!
Mario
Mario Schweiger


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #5 on: August 29, 2007, 11:59:06 AM »
Quote
@ thunderstrike
Yes, I would like to make it possible to send (members only) an email to the image owner (not, when a new comment is posted).

You luck ...  8O

Last night ... I code upgrade for comments notify and add to user list in self-page ... can email image owner foreach from members page you selek from details. Is ok ?

http://www.4homepages.de/forum/index.php?topic=18522.0

Install all and see is same to what need.  8)
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 vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #6 on: August 29, 2007, 01:29:46 PM »
 :oops: I think, Í was not explaining good enough, what I want !  :oops:

@ thunderstrike
I´ve read your MOD, but I don´t think it is, what I´m looking for!

So here, very simple, from the beginning again:

In the details.html I would like to have an additional button for sending an email to the image owner.
This button (in example called PM) should be clickable only for members. So, for Guests, this button should be not there or a not working button, like the others beside! (I allready have made these 2 buttons, "on" and "off")


I´ve made this example with graphic program!

So, when members click this button, a new page should open.
With an email form, like this example:

http://vipersgarden.at/4images/test/PM.html

So, any member may write an email to the image owner, although his email-adress is hidden in his profile.
I have the following variables? within my function.php (from automatic comment responser):
{recipient_name} = image owner
{user_name} = user want to write email
{user_email} = I don´t know now picture owner or mailer

It seems to be quite easy to construct, but I don´t find the way. I´m to much beginner in PHP.

Thanks for help!
Mario
Mario Schweiger


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #7 on: August 29, 2007, 01:37:51 PM »
Ok so work in includes/functions.php file for show_image function ?

Quote
{user_email} = I don´t know now picture owner or mailer

It seems to be quite easy to construct, but I don´t find the way. I´m to much beginner in PHP.

Use: $image_row['user_email'] so with tag:

Code: [Select]
{recipient_name} => (isset($image_row['user_name'])) ? format_text(stripslashes($image_row['user_name']), 2),
{recipient_email} => (isset($image_row['user_email'])) ? stripslashes($image_row['user_email']) : "",
{user_name} => format_text(stripslashes($user_info['user_name']), 2),
{user_email} => stripslashes($user_info['user_email']),

;)
« Last Edit: August 29, 2007, 02:23:53 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 vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #8 on: August 29, 2007, 01:48:04 PM »
@ thunderstrike
I´ve worked within the "show_image_function" in the includes/functions.php

Code: [Select]
    if ($user_info['user_level'] != GUEST) {
    $pm_button = "<img src=\"".get_gallery_image("pm_off.gif")."\" border=\"0\" alt=\"\" />";
  }
  else {
    $pm_button = "<a href=\"".$site_sess->url(ROOT_PATH."/templates/4waters/pm.html")"\"><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"\" /></a>";
  }

and also included the variable "{pm_button}" into the details.php

But it doesn´t show me anything (the buttons are in correct directory !!!)
Mario Schweiger


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #9 on: August 29, 2007, 02:22:55 PM »
For no guest in reel array ...

Quote
"recipient_name" => (isset($image_row['user_name']) && $user_info['user_level'] >= USER) ? format_text(stripslashes($image_row['user_name']), 2),
"recipient_email" => (isset($image_row['user_email']) && $user_info['user_level'] >= USER) ? stripslashes($image_row['user_email']) : "",
"user_name" => ($user_info['user_level'] >= USER) ? format_text(stripslashes($user_info['user_name']), 2) : "",
"user_email" => ($user_info['user_level'] >= USER) ? stripslashes($user_info['user_email']) : "",

Quote
$pm_button = "<a href=\"".$site_sess->url(ROOT_PATH."/templates/4waters/pm.html")"\"><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"\" /></a>";

No ! no - like this:

Quote
$pm_button = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php")."\"><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"\" /></a>";
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 vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #10 on: August 29, 2007, 03:06:25 PM »
Sorry, thunderstrike, but it doesn´t work (only the first part now, making the buttons visible)!

So, please, for a beginner !

What I have done:

in the "show_image_function" within includes/function.php
I have added and uploaded:

Code: [Select]
     if ($user_info['user_level'] != GUEST) {
    $pm_button = "<img src=\"".get_gallery_image("pm_off.gif")."\" border=\"0\" alt=\"\" />";
  }
  else {
    $pm_button = "<a href=\"".$site_sess->url(ROOT_PATH."pm.php")."\"><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"\" /></a>";
  }

In the details.html I have added and uploaded:

Code: [Select]
    {if admin_links}<br />{admin_links}<br />{endif admin_links}
    <br />{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}&nbsp;&nbsp;{pm_button}
  </div><br />

The 2 buttons (pm.gif and pm_off.gif) I´ve uploaded to: templates/4waters/images (all the other buttons are in here).

Nothing else.
Should this be  enough?
I have no pm.php at the time!
Is this a must to show the buttons?
I also don´t see the "not highlighted" one, when I´m logged in as GUEST.

Thanks again!
Mario
Mario Schweiger


Offline vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #11 on: August 29, 2007, 05:12:15 PM »
Learning by doing !!

Part 1) I´ve got now!
Reading a lot of PHP codes in most files!

Additional to the addings I´ve done before,
I had to add also this in the include/functions.php:

Code: [Select]
"lightbox_button" => $lightbox_button,
    "postcard_button" => $postcard_button,
    "download_button" => $download_button,
    "download_zip_button" => $download_zip_button,
"pm_button" => $pm_button,
    "image_download_url" => $image_row['image_download_url'],
    "allow_download" => $allow_download,

Now I will start with the next!

Cheers
Mario

Mario Schweiger


Offline vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #12 on: August 29, 2007, 06:06:43 PM »
A good jump !

Maybe you will have another opinion, but I´m really happy to be so far!

I´ve written now a pm.php within the 4images main directory
und from there to the pm.html within my templates folder.

And it works!
But I have now a problem with these variables (given to me by thunderstrike this afternoon:

Code: [Select]
"recipient_name" => (isset($image_row['user_name']) && $user_info['user_level'] >= USER) ? format_text(stripslashes($image_row['user_name']), 2),
"recipient_email" => (isset($image_row['user_email']) && $user_info['user_level'] >= USER) ? stripslashes($image_row['user_email']) : "",
"user_name" => ($user_info['user_level'] >= USER) ? format_text(stripslashes($user_info['user_name']), 2) : "",
"user_email" => ($user_info['user_level'] >= USER) ? stripslashes($user_info['user_email']) : "",

Where I have to put it?

This is, how my form looks like - with variables:


... and this is the online version:


Watch!
The nickname is always the image owner of the random image. I´ve checked it 50 times!

Some help again please!
Thousend thanks in advance!

I know, I have to do some cosmetics after (with {lang_xxxx}, to have only the users language in), but this will be no problem!

Mario

Mario Schweiger


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #13 on: August 29, 2007, 06:09:26 PM »
Quote
Where I have to put it?

If details page, must add in show_image function in includes/functions.php file in $site_template->register_vars(array( code (is there - no create new - no need). ;)
Easy to see.
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 vipersgarden

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: email an den Bildeigentümer - email to image owner
« Reply #14 on: August 29, 2007, 06:30:57 PM »
Sorry, I´ve tried it, but get this error: Parse error, unexpected ´,´ in /home/xxxxxxxxx on line xxx !
Ive put the code just in the first line below $site_template

Code: [Select]
$site_template->register_vars(array(

    "image_id" => $image_row['image_id'],

Any idea ?

Thanks
Mario
Mario Schweiger