Author Topic: css on the description field (details.html)  (Read 4990 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
css on the description field (details.html)
« on: March 08, 2006, 04:09:44 AM »
Hi everyone
Im trying to put css on the description field
Quote
<style> Body{background-color:FFFFFF;background-image:url(http://s1.simpload.com/1025435e4ee69e4d0.gif);}</style>
when i upload the image i just put that code on the description field and is insert on the database correctly cuz i change
this on the member.php file
Quote
  $image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description']));
for this
Quote
  $image_description = $HTTP_POST_VARS['image_description'];
but when i go to the gallery and i go to see a image the code show up different
there is some line of code that is replacing the http://s1.simpload.com/1025435e4ee69e4d0.gif for a link
so i would see this
Quote
<style> Body{background-color:FFFFFF;background-image:url(<a href="http://s1.simpload.com/1025435e4ee69e4d0.gif" target="_blank">http://s1.simpload.com/1025435e4ee69e4d0.gif</a>);}</style>
so the css will not work
how can i change that?
thanks

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: css on the description field (details.html)
« Reply #1 on: March 08, 2006, 04:26:06 AM »
ok think i found the problem
on funtions.php

Quote
function replace_url($text) {
  $text = " ".$text." ";
  $url_search_array = array(
    "#([^]_a-z0-9-=\"'\/])([a-z]+?)://([^, \(\)<>\n\r]+)#si",
    "#([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \(\)<>\n\r]*)?)#si"
  );

  $url_replace_array = array(
    "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>",
    "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"
  );
  $text = preg_replace($url_search_array, $url_replace_array, $text);

  if (strpos($text, "@")) {
    $text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
  }
  return $text;
}

how can change that so that funtion is not applied to the description field?

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: css on the description field (details.html)
« Reply #2 on: March 08, 2006, 06:10:59 AM »
* V@no has no idea what are you trying to do and the code you showed in first message does not make any sence...
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 ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: css on the description field (details.html)
« Reply #3 on: March 08, 2006, 11:22:22 PM »
i think is pretty clear but i got it thanks :)
all the funtions that i had to modify where at funtions.php
all that i wanted is that the description field was not to be treated as an html code just plain text so i could show it to the users
its working now
=)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: css on the description field (details.html)
« Reply #4 on: March 08, 2006, 11:36:58 PM »
The problem that i had was this
User View:                                                                                            Html Editor view: