You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 332 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Images not displaying in Stories for phpNuke 7.9 patched [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
DRob
Nuke Cadet
Nuke Cadet


Joined: Jan 13, 2006
Posts: 7


PostPosted: Fri Jan 20, 2006 3:07 pm Reply with quoteBack to top

I uploaded the patch for 7.9 today, and since then Images in stories are gone. Also the topic image is not displaying either. I've edited my config.php to have
$AllowableHTML = array("b"=>1,"img"=>2,
In it (I cut off the rest for this post because its pretty long). I've searched around on these forums a bit, and found that I may need to modify the mainfile.php in order to get this to work.. is that correct?

If it is, which lines in the mainfile.php should I be looking to edit or remove? I'm not too worried about there being a problem with submissions because only a couple people will be able to submit news on my site.

Thanks again for all the help. I'm hoping the patched 7.9 fixes some of the other problems I've had with mods & phpnuke Sad

Edit: Just read on http://nukecops.com/PHP-Nuke_allow-special-html-tags.html what I may need to modify. Made sure again that "img"=>2 was in the AllowableHTML section & commented out the 2 sections in the check_html section of mainfile.php Same problem though. I can edit the story, update it with the correct link, and in the editor window it displays the picture. When I click on "Save Changes" it seems to save successfully (any other text changes I make seem to save), but the pictures are missing (I did get the topic image back though). If I go back into the story to edit it, where I had <img src=http://mysite.com/images/picture.jpg> is now <img border="0" /> with no picture actually specified.

I must be missing something in the mainfile.php I'm guessing..Hm....will keep digging through it (and backing it up after each change). Any tips or advice on this would be greatly appreciated. Thanks!

DR
Find all posts by DRobView user's profileSend private message
XenoMorpH
Lieutenant
Lieutenant


Joined: Aug 24, 2003
Posts: 187

Location: Coevorden, Netherlands

PostPosted: Sat Jan 21, 2006 1:41 pm Reply with quoteBack to top

I am having the same problem. Added the img to the list also...even added the img tag in the database through phpmyadmin.
Only a red cross is showing...and not even an img path....

Can't quit figure out where to look....

_________________
http://www.tdi-hq.com
MSN- status: Image
Find all posts by XenoMorpHView user's profileSend private message
DRob
Nuke Cadet
Nuke Cadet


Joined: Jan 13, 2006
Posts: 7


PostPosted: Sat Jan 21, 2006 8:36 pm Reply with quoteBack to top

Yeah, it seems to be stripping the entire img src= for some reason. I definitely have the "img"=>2 in the AllowableHTML section. Also have tried the other suggestions I've found on the forums (the changes in the mainfile.php listed at the link in my initial post). I just can't figure out what it is I'm doing wrong or missing... Are there any other sections in the mainfile.php or config.php which I should edit or add to allow images to be posted in stories?

It has to be something with the 7.9 patch files..because it was working perfectly fine before that (but most likely pretty insecure I'm guessing). I'd be willing to give up a little security though for the ability for the people submitting stories to post images Sad There are only a couple people who can post stories on my site, and they are all trustworthy, so I'm not too worried about them putting something malicious in there..

DR
Find all posts by DRobView user's profileSend private message
MstSage
Nuke Cadet
Nuke Cadet


Joined: Nov 24, 2005
Posts: 9


PostPosted: Sun Jan 22, 2006 5:24 am Reply with quoteBack to top

Is there any ways to downgrade, because my themes don't work right now, Sad( i liked my right side stuff but only two themes work!

_________________
Image
Image
Find all posts by MstSageView user's profileSend private messageVisit poster's website
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1939

Location: Behind you

PostPosted: Sun Jan 22, 2006 9:00 am Reply with quoteBack to top

You don't have to downgrade as long as theme is trouble.
Simply change index = 1 to define(INDEX_FILE) directive.

_________________
Home of the Enterprise PHP-NUKE
Find all posts by XyberianView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Sun Jan 22, 2006 12:56 pm Reply with quoteBack to top

Using the latest Patched files? http://www.nukeresources.com

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
DRob
Nuke Cadet
Nuke Cadet


Joined: Jan 13, 2006
Posts: 7


PostPosted: Sun Jan 22, 2006 6:05 pm Reply with quoteBack to top

Evaders99 wrote:
Using the latest Patched files? http://www.nukeresources.com


Yes, the patch is what seemed to cause the problem. Since I used the 7.9 patch downloaded from www.nukeresources.com the Stories have not displayed any images. I do have the "img"=>2 in the AllowableHTML section. I have also tried the suggestions listed at http://nukecops.com/PHP-Nuke_allow-special-html-tags.html None of this has helped.

When go to modify a story, and try to add a <img src=http://www.mysite.com/images/whatever.jpg> I click Update, and it displays the picture in the little editor window, but when I save the changes, it still doesn't display the images. When I go back into the editor, it has stripped out the <img src=http://www.mysite.com/images/whatever.jpg> and replaced it with just <img border="0" />

This was all working fine before I used the patch for PHPNuke 7.9. Below is a copy of my config.php file (with some stuff edited out of course).

Code:
<?php

if (stristr(htmlentities($_SERVER['PHP_SELF']), "config.php")) {
   Header("Location: index.php");
   die();
}


$dbhost = "xxxx";
$dbuname = "xxxx";
$dbpass = "xxxx";
$dbname = "xxxx";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "xxxxx";
$gfx_chk = 6;
$subscription_url = "";
$admin_file = "admin";
$tipath = "images/topics/";
$nuke_editor = 1;
$display_errors = false;



$prefix = empty($user_prefix) ? $prefix : $user_prefix;
$reasons = array("As Is",
"Offtopic",
"Flamebait",
"Troll",
"Redundant",
"Insighful",
"Interesting",
"Informative",
"Funny",
"Overrated",
"Underrated");
$badreasons = 4;
$AllowableHTML = array(
"img"=>2,
"table"=>2,
"thead"=>2,
"tbody"=>2,
"th"=>2,
"tr"=>2,
"td"=>2,
"font"=>2,
"span"=>2,
"form"=>2,
"input"=>2,
"select"=>2,
"p"=>2,
"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);

$CensorList = array("edited this out");

$commercial_license = 0;

?>


I can't see anything that I've done wrong in this Sad For the AllowableHTML section its all on one line, but that really screwed up the formatting in this post, so I put each on its on line. Would it help to post the contents of my mainfile.php? Or would it help to only post certain sections? I'd really like to get pictures working again after the patch like they were working before I used the patch. Any ideas?

DR
Find all posts by DRobView user's profileSend private message
DRob
Nuke Cadet
Nuke Cadet


Joined: Jan 13, 2006
Posts: 7


PostPosted: Mon Jan 23, 2006 3:33 am Reply with quoteBack to top

Hm..I may have figured out what I did wrong Smile Xeno - Try this. Besides the section for
$AllowableHTML = array(
"img"=>2,
in your config.php file, in the main.php file look under the check_html function. In that section look for:
Code:

$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="\\1">', $str);
$str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", '', $str);
$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);


I had commented out the first two sections that begin with $str, but hadn't commented out the 3rd. After adding // to the 3rd section to comment it out, all of a sudden my images started working. Hope this helps you Smile And thanks again Evaders99 for trying to help me out Smile I'm such a clueless newbie when it comes to this stuff. I'm trying to learn though! The forums on php-downloads.com, here, and nukeresources.com have been a lot of help Smile

MstSage - Check out these couple topics. They helped me resolve the problem of the no right block appearing. The problem is in the theme.php file for the particular theme(s) you are trying to use which aren't displaying the right block. Anyway, tries these out:
http://nukecops.com/postlite46839-theme+php+right+block.html
http://nukecops.com/postlite48713-theme+php+right+block.html

I had the same problem with the no right block appearing after using the 7.9 patch. Changing the

if ($index == ) {

to this:

if (defined('INDEX_FILE')) {

in the theme.php file for the theme (or themes) you are trying to use fixed the problem for me. I hope it does for you too Smile


DR
Find all posts by DRobView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Mon Jan 23, 2006 5:09 am Reply with quoteBack to top

Hmm not entirely sure why that's happening. I don't see a difference from 7.9 and the Patched version. BUt if it works, good

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
MstSage
Nuke Cadet
Nuke Cadet


Joined: Nov 24, 2005
Posts: 9


PostPosted: Fri Jan 27, 2006 6:41 am Reply with quoteBack to top

It did thanks Very Happy, I also went back to PHP-Nuke 7.7 and it did it when I patched 3.1

to bad though I cant really do much since my Motherboard is fried, though I am getting a New one next week Very Happy

_________________
Image
Image
Find all posts by MstSageView user's profileSend private messageVisit poster's website
mtalley887
Sergeant
Sergeant


Joined: Dec 01, 2003
Posts: 149


PostPosted: Sat Jan 28, 2006 4:58 pm Reply with quoteBack to top

Drob's asessment on themes is correct and is a missing note that should have been placed in the readme file that came with phpnuke 7.9 to get the right blocks to display. The change is in theme.php file under themefooter function.

Since I work with the installation of the Spaw Editor I sometimes see problems that others don't. As an example while working with the 'message.php' file under admin/modules to display images you must place in the 'config.php' file under $AllowableHTML the "img"=>2 tag to see images. However, with popup images which the Spaw Editor uses there is the problem during save that 'check_html' which is called from the function 'filter' in 'mainfile' strips the coding needed to produce the popup images.

If you look at check_html function and look at the first part of it which looks like this:

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")
       global $AllowableHTML;
       if (!is_array($AllowableHTML)) $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]);


The coding if you follow it doesn't look right where it starts with ' if ($strip == "nohtml")'. This is stating that if a command string states 'nohtml' such as in this command line '$title = filter($title, "nohtml");' then the result would be to remove the HTML. But, if the command statement is '$title = filter($title, "");' then the statement ' if ($strip == "nohtml")' is false and shouldn't remove the HTML. But it looks to me that if the statement is false only the global $AllowableHTML will not be loaded because the "If statement" is going to be completed at the end of "global $AllowableHTML; " and after that it will continue on to remove the html when you don't want it to. It seems to me that we need to encase the first "If" condition by placing in the curly brackets "{ }" by rewriting the first line like this:

Code:
if ($strip == "nohtml") {


and then closing it off after this line:

Code:
$tmp = "";
}


This way if $strip == 'nohtml' then it will remove the html except for what is listed in the $AllowableHTML array. if $strip == "" then it will skip stripping html and go on. In my testing it, set up this way, then the popup script that is placed in messages and stories and so on do not get stripped out and everything seems to work fine. Does this seem reasonable?

The other change I made was with the calling of FixQuotes. First I went to the function filter and on the line where it shows this:
Code:
$what = stripslashes(FixQuotes($what));

I changed it to this:
Code:
$what = stripslashes(FixQuotes($what,$strip));

then I moved to the function FixQuotes and changed this:
Code:
function FixQuotes ($what = "")

to this:
Code:
function FixQuotes ($what = "",$strip="")

and then added this to the function:
Code:
if ($strip == "nohtml"){
   $what = str_replace("'","''",$what);
   }

this way it doesn't stop the functionality of it if the 'nohtml' is used.

The other thing that I've noticed is with the topic images not showing is different from what chatserv had stated in this forum http://www.nukefixes.com/ftopic-1779-days0-orderasc-45.html#8350 he stated that in 7.9 mainfile that the script for get topics looked like this:

Code:
function getTopics($s_sid) {
   global $topicid, $topicname, $topicimage, $topictext, $prefix, $db;
   $sid = intval($s_sid);
   $result = $db->sql_query("SELECT t.topicid, t.topicname, t.topicimage, t.topictext FROM ".$prefix."_stories s LEFT JOIN ".$prefix."_topics t ON t.topicid = s.topic WHERE s.sid = ".$sid);
   $row = $db->sql_fetchrow($result);
   $db->sql_freeresult($result);
   $topicid = intval($row['topicid']);
   $topicname = filter($row['topicname'], "nohtml");
   $topicimage = filter($row['topicimage'], "nohtml");
   $topictext = filter($row['topictext'], "nohtml");
}


I have downloaded and checked several times and downloaded again just before posting this from Nuke Resources the 7.9 patch and what is listed in mainfile for getTopics is this:

Code:
function getTopics($s_sid) {
   global $topicname, $topicimage, $topictext, $prefix, $db;
   $sid = intval($s_sid);
   $result = $db->sql_query("SELECT t.topicname, t.topicimage, t.topictext FROM ".$prefix."_stories s LEFT JOIN ".$prefix."_topics t ON t.topicid = s.topic WHERE s.sid = '".$sid."'");
   $row = $db->sql_fetchrow($result);
   $db->sql_freeresult($result);
   $topicname = filter($topicname, "nohtml");
   $topicimage = filter($topicimage, "nohtml");
   $topictext = filter($topictext, "nohtml");
}


First it is missing this line ' $topicid = intval($row['topicid']); ' and the last three lines are different. If I place the missing line in the code and then change the last three lines like chatserv thought was in 7.9 then the topic
images show.

So far the copy of my 7.9 seems to be working okay, and the spaw editor changes went smoother than it has in previous versions. But, I can't say if it will work for you without the editor or with your copy.


Michael
Kodetech.com


Last edited by mtalley887 on Sat Feb 04, 2006 6:23 pm; edited 2 times in total
Find all posts by mtalley887View user's profileSend private message
dead7iestweap0n
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2006
Posts: 2


PostPosted: Sat Jan 28, 2006 6:26 pm Reply with quoteBack to top

I am having a probelm like this, but I am trying to insert a paypal donate button. It uses the form tag, but I have done every thing that you have sugested, and it still deletes all of my code. I am really mad, and I am about ot switch to a better CMS, because PHP nuke is way to unorganized. Mad
Find all posts by dead7iestweap0nView user's profileSend private message
mtalley887
Sergeant
Sergeant


Joined: Dec 01, 2003
Posts: 149


PostPosted: Sun Jan 29, 2006 7:01 am Reply with quoteBack to top

Well let's put our heads together and see if we can get it to work. I'm interested in seeing what is taking place and why this is happening. If you want contact me at my site so as not to take up space here and if we figure it out we'll post back it here what we found.

Michael
kodetech.com
Find all posts by mtalley887View user's profileSend private message
Schmide
Nuke Soldier
Nuke Soldier


Joined: Jan 20, 2006
Posts: 11


PostPosted: Wed Feb 01, 2006 9:51 pm Reply with quoteBack to top

I was messing with it and it seems part of the problem was the global $AllowableHTML getting crushed when it was assigned the empty array. I also found a bunch of calls with NULL $str duh no need to process a NULL return. Sorry about my indentation style its the only way I can follow that deep a if else if else else if if... I also removed some unnecessary code that took out the img tags and anchors (done later anyways).

Code:

function check_html ($str, $strip="") {
   /* The core of this code has been lifted from phpslash */
   /* which is licenced under the GPL. Altered by Schmide
   to fix losing images problem in 7.9 */
      global $AllowableHTML;
   include("config.php");
    if(!$str)
        return NULL;
   $str = stripslashes($str);
   // Delete all spaces from html tags .
    $str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
   if ($strip == "nohtml")
    {
      // if you want to keep just anchor tags or other local combinations of allowables do the following
      // otherwise leave the NULL assignment.
      // $localAllowableHTMLArray=array("a"=>1);
      // $localAllowableHTML=&$localAllowableHTMLArray;
        $localAllowableHTML=NULL;
    } else {
        $localAllowableHTML=&$AllowableHTML;
      // Delete javascript code from a href tags -- Zhen-Xjell @ http://nukecops.com
      $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);
    }
   $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 = $localAllowableHTML[$tag])
        {
          if ($reg[1][0] == "/")
            {
                $tag = "</$tag>";
            } elseif (($a == 1) || (empty($reg[2])))
            {
                $tag = "<$tag>";
            } else {
             # Place here the double quote fix function.
             $attrb_list=delQuotes($reg[2]);
             // A VER
             $attrb_list = str_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 = str_replace("<?","",$str);
   return $str;
}


Old copy array code
Code:

   if ($strip == "nohtml")
    {
        $localAllowableHTML=array('');
    } else {
        $localAllowableHTML=$AllowableHTML;


Last edited by Schmide on Thu Feb 02, 2006 10:35 am; edited 3 times in total
Find all posts by SchmideView user's profileSend private message
mtalley887
Sergeant
Sergeant


Joined: Dec 01, 2003
Posts: 149


PostPosted: Wed Feb 01, 2006 10:34 pm Reply with quoteBack to top

Thanks Schmide.. there is another discussion on this at http://www.nukeresources.com/ftopict-3123.html you might want to look at.

Michael
kodetech.com
Find all posts by mtalley887View user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.060 Seconds - 383 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::