Author Topic: message text in ecard truncated after ":"  (Read 5453 times)

0 Members and 1 Guest are viewing this topic.

Offline cm1

  • Pre-Newbie
  • Posts: 4
    • View Profile
message text in ecard truncated after ":"
« on: April 12, 2006, 11:28:11 PM »
I want to send my friends, which I have made registered users, an ecard.

In the message text I want to invite them to go to my site.

Therefore, in the message field of the ecard, I want to put in my site URL (e.g. www.xyz.nl/4images).

This is what I literally have typed:

ga naar: www.xyz.nl/4images

When I do that, the text on the actual ecard only shows the text up to "ga naar:"

After that only my name and email address are shown, the rest of the text, starting with my site URL is completely gone.

Can someone explain what I am doing wrong?

Using 4images 1.7.2

Thanks


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: message text in ecard truncated after ":"
« Reply #1 on: April 13, 2006, 12:56:55 AM »
Looks like a bug...:?

in postcards.php find:
Code: [Select]
      "message" => format_text(stripslashes($message)),Insert BELOW:
Code: [Select]
      "headline_hidden" => format_text(stripslashes($headline), 2),
      "message_hidden" => format_text(stripslashes($message), 2),

Then in templates/<your template>/postcard_preview.html template replace
Code: [Select]
    <input type="hidden" name="headline" value="{headline}" />
    <input type="hidden" name="message" value="{message}" />
 
with this
Code: [Select]
    <input type="hidden" name="headline" value="{headline_hidden}" />
    <input type="hidden" name="message" value="{message_hidden}" />
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cm1

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: message text in ecard truncated after ":"
« Reply #2 on: April 13, 2006, 09:49:00 AM »
Hey, V@no, thanks for the fast reply & help.

When I do what you suggest, at least something changes:

Now the message on the ecard is completely empty.....  except for my name and email

Important extra info: The described problem happens only AFTER I press the "send card" button. So, in preview mode, the ecard looks OK.
When I press send, the next screen shows the actual ecard and then the message text is missing.

Seems to have something to do with the "striptags" or "un_htmlspecialchars(trim(" commands? Does that mean I have to look at  the "if ($action == "sendcard")" part of postcard.php?


As you may have noticed, I'm not the best PHP or HTML specilaist (i used to speak assembler, cobol and pascal) but I'm learning again!
Should I buy a book again?  :lol:
« Last Edit: April 13, 2006, 10:00:14 AM by cm1 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: message text in ecard truncated after ":"
« Reply #3 on: April 13, 2006, 02:55:10 PM »
1) the problem is not in " : " but in quotes that 4images adds when creates the url you entered in the message as a link, which messes up the hidden field value. (you can try add one quote in the message or headline and see what happens)
2) in my tests, the preview did not look correct, atleast the part of the page just right above "edit/send" buttons had extra text that was not supposed to be there.
3) where I can see in action?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cm1

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: message text in ecard truncated after ":"
« Reply #4 on: April 13, 2006, 08:40:52 PM »
V@no, I sent you a PM

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: message text in ecard truncated after ":"
« Reply #5 on: April 14, 2006, 01:09:21 AM »
Ok, my first guess is you either didnt add the new lines in postcards.php or you added in the wrong place...make sure it looks like this:[qcode]  if (!$error) {
    $main_template = "postcard_preview";
    $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
    $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
    $site_template->register_vars(array(
      "image" => $image,
      "thumbnail" => $thumbnail,
      "image_name" => format_text($image_row['image_name']),
      "url_postcard" => $site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_id),
      "bg_color" => format_text(stripslashes($bg_color), 2),
      "border_color" => format_text(stripslashes($border_color), 2),
      "font_color" => format_text(stripslashes($font_color), 2),
      "font_face" => format_text(stripslashes($font_face), 2),
      "sender_name" => format_text(stripslashes($sender_name), 2),
      "sender_email" => format_text(stripslashes($sender_email), 2),
      "recipient_name" => format_text(stripslashes($recipient_name), 2),
      "recipient_email" => format_text(stripslashes($recipient_email), 2),
      "headline" => format_text(stripslashes($headline)),
      "message" => format_text(stripslashes($message)),
      "headline_hidden" => format_text(stripslashes($headline), 2),
      "message_hidden" => format_text(stripslashes($message), 2),

      "image_id" => $image_id,
      "lang_sender" => $lang['sender'],
      "lang_recipient" => $lang['recipient'],
      "lang_edit_postcard" => $lang['edit_postcard'],
      "lang_send_postcard" => $lang['send_postcard'],
      "back_url" => format_text($back_url)
    ));
  }
[/qcode]
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cm1

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: message text in ecard truncated after ":"
« Reply #6 on: April 16, 2006, 01:18:38 AM »
Thanks V@no!

Everything works fine now. I also exploited your mods and used a few. Never too old to learn & never grow up!