Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 8.0
Author Message
daltoniko
Regular
Regular



Joined: Dec 19, 2004
Posts: 61

PostPosted: Fri Dec 22, 2006 10:47 am Reply with quote

I use nuke8.0 patch (no sentinel).

I need to post some img in my news but some fxxx script block this posibility.

In my config.php i have
Code:
$AllowableHTML = array("img"=>2,"src"=>2, ...

The preview with is ok and i can see the image but when i post it the story is broken and i can't edit it too...
Some suggestion?

sorry for my eng. Wink
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Fri Dec 22, 2006 5:23 pm Reply with quote

see if this helps.. [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
daltoniko







PostPosted: Sat Dec 23, 2006 4:33 am Reply with quote

mm... it's a confused post...
I try here for some help and suggestions


without editor and
Code:
$AllowableHTML = array("img"=>2,"src"=>2, ...


not work


without editor and
Code:
$AllowableHTML = array("img"=>2, ...


work the img tag with attribute but if i put 'border' not work...

with the editor don't work in each case.
 
daltoniko







PostPosted: Sat Dec 23, 2006 10:54 am Reply with quote

found the problem.... border="0" don't work

need to be fix this. If i use border="1" it's ok.

the editor automatically add the border at 0 (if we leave border tag) and crash the news.
Smile
I think it's the same problem with all tag with attribute set to 0

help help Smile
 
daltoniko







PostPosted: Sat Dec 23, 2006 7:00 pm Reply with quote

help...
 
daltoniko







PostPosted: Sun Dec 24, 2006 10:09 am Reply with quote

...some news about it?
 
bukovski
New Member
New Member



Joined: Nov 15, 2006
Posts: 16

PostPosted: Sun Dec 24, 2006 9:29 pm Reply with quote

i need help with this problem to, i post image on news and i see it on prewiev then on front page its empty, also when i try to put in block html code its display picturre or baner but after i enter ok its again empty...

any help ?
 
View user's profile Send private message
daltoniko







PostPosted: Tue Dec 26, 2006 2:25 pm Reply with quote

if i use the original phpnuke 8.0 mainfile.php work correctly.

I think some bugs in the function check_html ($str, $strip="") {

for now i use the original function from mainfile.php (phpnuke 8.0 no patch)

wait some suggestion from the boss
Smile
 
bukovski







PostPosted: Tue Dec 26, 2006 4:03 pm Reply with quote

whell i use original and patched and still have same problem ( both place nuke is upgreded from 7.6 )

p.s. i try downgrade but i faild so i stop it ! script from forum for downgrade dosnt work whell 50% of my modules and blocks dosnt work Sad


so any help for 8.0 ?
 
daltoniko







PostPosted: Tue Dec 26, 2006 4:39 pm Reply with quote

this my mainfile.php (the function)
Code:
function check_html ($str, $strip="") {

   /* The core of this code has been lifted from phpslash */
   /* which is licenced under the GPL. */
   include("config.php");
   if ($strip == "nohtml")
   $AllowableHTML=array('');
   $str = stripslashes($str);
   $str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
   // Delete all spaces from html tags .
   $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="\\1">', $str);
   // Delete all attribs from Anchor, except an href, double quoted.
   $str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", '', $str);
   // Delete all img tags
   $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);
   // Delete javascript code from a href tags -- Zhen-Xjell @ http://nukecops.com
   $tmp = "";
   while (ereg("<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>",$str,$reg)) {
      $i = strpos($str,$reg[0]);
      $l = strlen($reg[0]);
      if ($reg[1][0] == "/") $tag = strtolower(substr($reg[1],1));
      else $tag = strtolower($reg[1]);
      if ($a = $AllowableHTML[$tag])
      if ($reg[1][0] == "/") $tag = "</$tag>";
      elseif (($a == 1) || ($reg[2] == "")) $tag = "<$tag>";
      else {
         # Place here the double quote fix function.
         $attrb_list=delQuotes($reg[2]);
         // A VER
         //$attrb_list = ereg_replace("&","&amp;",$attrb_list);
         $tag = "<$tag" . $attrb_list . ">";
      } # Attribs in tag allowed
      else $tag = "";
      $tmp .= substr($str,0,$i) . $tag;
      $str = substr($str,$i+$l);
   }
   $str = $tmp . $str;
   return $str;
   exit;
   /* Squash PHP tags unconditionally */
   $str = ereg_replace("<\?","",$str);
   return $str;
}


and my config.php (the allowed tags)

Code:
$AllowableHTML = array("img"=>2, "tr"=>1,"td"=>2,"table"=>2,"div"=>2,"p"=>2,"hr"=>1,"b"=>1,"i"=>1,"strike"=>1,"u"=>1,"div"=>2,"a"=>2,"em"=>1,"br"=>1,"strong"=>1,"blockquote"=>1,"tt"=>1,"li"=>1,"ol"=>1,"ul"=>1,"center"=>1);

 
bukovski







PostPosted: Tue Dec 26, 2006 5:05 pm Reply with quote

main

Code:
function check_html ($str, $strip="") {

   /* The core of this code has been lifted from phpslash */
   /* which is licenced under the GPL. */
   include("config.php");
   if ($strip == "nohtml")
   $AllowableHTML=array('');
   $str = stripslashes($str);
   $str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
   // Delete all spaces from html tags .
   $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="\\1">', $str);
   // Delete all attribs from Anchor, except an href, double quoted.
   $str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", '', $str);
   // Delete all img tags
   $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);
   // Delete javascript code from a href tags -- Zhen-Xjell @ http://nukecops.com
   $tmp = "";
   while (ereg("<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>",$str,$reg)) {
      $i = strpos($str,$reg[0]);
      $l = strlen($reg[0]);
      if ($reg[1][0] == "/") $tag = strtolower(substr($reg[1],1));
      else $tag = strtolower($reg[1]);
      if ($a = $AllowableHTML[$tag])
      if ($reg[1][0] == "/") $tag = "</$tag>";
      elseif (($a == 1) || ($reg[2] == "")) $tag = "<$tag>";
      else {
         # Place here the double quote fix function.
         $attrb_list=delQuotes($reg[2]);
         // A VER
         //$attrb_list = ereg_replace("&","&amp;",$attrb_list);
         $tag = "<$tag" . $attrb_list . ">";
      } # Attribs in tag allowed
      else $tag = "";
      $tmp .= substr($str,0,$i) . $tag;
      $str = substr($str,$i+$l);
   }
   $str = $tmp . $str;
   return $str;
   exit;
   /* Squash PHP tags unconditionally */
   $str = ereg_replace("<\?","",$str);
   return $str;
}

function filter_text($Message, $strip="") {
   global $EditedMessage;
   check_words($Message);
   $EditedMessage=check_html($EditedMessage, $strip);
   return ($EditedMessage);
}

function filter($what, $strip="", $save="", $type="") {
   if ($strip == "nohtml") {
      $what = check_html($what, $strip);
      $what = htmlentities(trim($what), ENT_QUOTES);
      // If the variable $what doesn't comes from a preview screen should be converted
      if ($type != "preview" AND $save != 1) {
         $what = html_entity_decode($what, ENT_QUOTES);
      }
   }
   if ($save == 1) {
      $what = check_words($what);
      $what = check_html($what, $strip);
      $what = addslashes($what);
   } else {
      $what = stripslashes(FixQuotes($what));
      $what = check_words($what);
      $what = check_html($what, $strip);
   }
   return($what);
}


cofig:

Code:
$AllowableHTML = array("b"=>1,"i"=>1,"strike"=>1,"div"=>2,"u"=>1,"a"=>2,"em"=>1,"br"=>1,"strong"=>1,"blockquote"=>1,"tt"=>1,"li"=>1,"ol"=>1,"ul"=>1);

/
 
daltoniko







PostPosted: Tue Dec 26, 2006 5:25 pm Reply with quote

you need to put img tag in allowable html var.. try to use my code.
 
bukovski







PostPosted: Tue Dec 26, 2006 5:37 pm Reply with quote

ok i will try
 
bukovski







PostPosted: Tue Dec 26, 2006 5:43 pm Reply with quote

BROOO ty now i can use img in news but still i miss pic from blocks Sad DONT isntall 8.0 its BIG pain!
 
bukovski







PostPosted: Tue Dec 26, 2006 5:50 pm Reply with quote

grr i cant use img in footer like :

Code:
<a href='http://host-tracker.com/website-uptime-statistics/226023/'><img alt='web site monitoring' width=88 height=31 border=0 src="http://ext.host-tracker.com/uptime-img/?s=31&amp;t=226023&amp;m=00.09&amp;p=Total" ></a><noscript><a href='http://host-tracker.com/'>uptime</a></noscript>


i see pic but when i klick ok and when relod pic isnt showing and all code was deleted in setings Sad

if you need SS i can post it for problem :

site is [ Only registered users can see links on this board! Get registered or login! ]
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Dec 26, 2006 8:51 pm Reply with quote

I can honestly say that very few of us moderators / admins even touch anything above 7.6 due to many different reasons, but mostly FB's garbage and security holes. Sorry that we have not been much help to you.

If you are just starting out with nuke, I'd given RavenNuke a chance.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
bukovski







PostPosted: Wed Dec 27, 2006 2:38 am Reply with quote

hell bro i know thet but maybe some of you can help us. I try to downgrade ! but its faild to many times i cant aford to lose my database ! its not a option. Yes i know its my problem, im one big stupid head but from now i will use 7.6 or some modede version like reven nuke... but for this site i cant Sad


Ty all for your time and keep working , bot forum and reven team you do a very nice job ppl
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Wed Dec 27, 2006 5:44 am Reply with quote

Remove the noscrip t from the footer - that's not in the allowed HTML, and you don't want to add it there. If you remove that, you should be able to save your footer.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 8.0

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©