Author Topic: Html in description  (Read 27108 times)

0 Members and 1 Guest are viewing this topic.

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #15 on: February 11, 2006, 05:45:35 PM »
@Vano: I had
Code: [Select]
  $description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 0) : REPLACE_EMPTY;I changed it to 1 but nothing happens
the other code was similar and yes I have only this twi lines

@artpics: The html in comments work the whole time but I need it in the description (or I need a way to show the comments below the thumbnails in categories...)

I just wonder cause it's said in the apc that html in description is allowed. Why it's so difficult ?

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: Html in description
« Reply #16 on: February 11, 2006, 05:50:52 PM »
@Lunique:
"simular", then perhaps that is the problem...
Please show the two lines you have now.

@artpics:
1) the problem is not in "proper" HTML but in 4images code, which for some reason prevent using HTML on the page...
2) some browsers could "choke" if found more then one set of <html><head> and <body> tags on the same page, and your example does exactly that.

@everyone:
Allowing anyone adding HTML on your site is a great security risk! NEVER EVER ALLOW ANYONE, WHO YOU DON'T KNOW, ADD HTML ON YOUR SITE!
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 artpics

  • Full Member
  • ***
  • Posts: 173
    • View Profile
    • my site
Re: Html in description
« Reply #17 on: February 11, 2006, 05:53:03 PM »
Quote
@artpics: The html in comments work the whole time but I need it in the description

the html i posted does work in description on my site ,view the picture, click the admin link edit below the picture, paste the html i provided it should work , click save

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #18 on: February 11, 2006, 05:55:43 PM »
Quote
@artpics: The html in comments work the whole time but I need it in the description

the html i posted does work in description on my site ,view the picture, click the admin link edit below the picture, paste the html i provided it should work , click save

it don't work I have also tested that: http://music.onmygrave.de/barbyhistory/gallery/details.php?image_id=5
I'm sure it work on your site but it don't on mine

Offline artpics

  • Full Member
  • ***
  • Posts: 173
    • View Profile
    • my site
Re: Html in description
« Reply #19 on: February 11, 2006, 05:57:01 PM »
@Vano
Quote
@artpics:
1) the problem is not in "proper" HTML but in 4images code, which for some reason prevent using HTML on the page...
2) some browsers could "choke" if found more then one set of <html><head> and <body> tags on the same page, and your example does exactly that.

@everyone:
Allowing anyone adding HTML on your site is a great security risk! NEVER EVER ALLOW ANYONE, WHO YOU DON'T KNOW, ADD HTML ON YOUR SITE!

1.okay thanks
2. thanks, this code was made with a new page, fresh form Adobe golive CS2, why would it write such code ?
if browsers can choke on it.

3. for everyone,
http://www.4homepages.de/forum/index.php?topic=11498.0



thanks
RT
« Last Edit: February 11, 2006, 06:07:06 PM by artpics »

Offline Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #20 on: February 11, 2006, 05:57:38 PM »
@Lunique:
"simular", then perhaps that is the problem...
Please show the two lines you have now.

I mean it was similar then the codes you've showed and I have only this two lines and the only thing that was different was that there was a 0 instead of 1 in the first code..
Sorry I have some problems with english, it's not my mothertongue...

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: Html in description
« Reply #21 on: February 11, 2006, 06:02:00 PM »
Ok, but are you 100% sure that you uploaded the corrected file to the server?

Anyways, above this line
Code: [Select]
$description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;Insert:
Code: [Select]
echo "Original:<br>".$image_row['image_description']."<br><br>";And below that line insert:
Code: [Select]
echo "Formated:<br>".$image_row['image_description']."<br>----------------------------<br>";See if it show HTML in original description. If it does, then its possible HTML code is being altered before saved in the database....
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 Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #22 on: February 11, 2006, 06:05:31 PM »
I've tried it ;) http://music.onmygrave.de/barbyhistory/gallery/details.php?image_id=4

was this the effect that should be ?  :?
Or maybe I have a mistake in my template?

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: Html in description
« Reply #23 on: February 11, 2006, 06:22:12 PM »
Did you inserted second line below
Code: [Select]
$description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;?
because this is become very strange...
I think it would save some time if you zip your functions.php and attach it to your next reply ;)
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 Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #24 on: February 11, 2006, 06:29:54 PM »
I'm sorry now it works!
Your Idea about the two lines in functions php was right it was because of the 0 instead of 1!
As I re-opened it to look if I've pasted the code on the right place I see that it was still 0
somehow I hadn't saved it right on my first try or I don't know why...

So thank you very much now everything works as it should!

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: Html in description
« Reply #25 on: February 11, 2006, 06:32:34 PM »
A little tip based on my warning above:
I'd suggest you enable HTML only for the image administrator added (unless ofcourse you dont allow anyone else upload images).
by replacing that line with:
Code: [Select]
$description = (!empty($image_row['image_description']) && $image_row['user_level'] == ADMIN) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;
And then in details.php replace
Code: [Select]
$sql = "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".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
with:
Code: [Select]
$sql = "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".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_level")."
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 Lunique

  • Full Member
  • ***
  • Posts: 109
  • V 1.7.7
    • View Profile
Re: Html in description
« Reply #26 on: February 11, 2006, 06:35:55 PM »
Thanks for the tip but noone else instead of me will upload images or post a comment in the future at this gallery ;)