View next topic
View previous topic
Post new topic   Reply to topic
Author Message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Wed May 28, 2008 4:20 am
Reply with quote

Im trying to edit some blocks that are written in HTML. Once ive made the changes, the HTML code dissapears from the block and the content too.

Any ideas?

Oh im using PHP Nuke 8.1
 
View user's profile Send private message
Guardian




Joined: Dec 09, 2006
Posts: 249

PostPosted: Wed May 28, 2008 6:19 am
Reply with quote

*nuke block files use the variable $content which you must use to output anything. *nuke looks for anything assigned to $content and will output it automatically.
As an example
Code:

$content = 'example html <strong>bold</strong>';


If you want to output multiple lines of code you must use a 'stop' in subsequent line so it knows to join the together like this;
Code:

$content = 'this is the first line';
$content .='the next line';

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Wed May 28, 2008 7:47 am
Reply with quote

Sorry for being a little thick.

Does this mean that I write the code into the block within Nuke or do I edit the block with say Dreamweaver and add the code like this.
Ive tried to add the code within nuke using the block editor and the HTML function but the $content appears in the block too.

I must admit I preferred the old way of writing blocks with HTML it was much easier.

lol
 
View user's profile Send private message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Wed May 28, 2008 8:01 am
Reply with quote

Using the HTML editor in the nuke blocks module, I can add simple HHTML.
Ive just tried to add an image using :

$content = <img src="image.gif" /> ;

The simple code remained but the image vanished? I tried with and without the $content command line.
 
View user's profile Send private message
Guardian




Joined: Dec 09, 2006
Posts: 249

PostPosted: Wed May 28, 2008 9:11 am
Reply with quote

Looks like whatever html tag you were using is not permitted in the allowed html array (it is set in config.php or mainfile.php).
Your code above is missing quotation marks but I do not know if that was intentional or whether it got stripped.
Code:
$content="<img src="image.gif" />";

_________________
Code Authors Nuke Reviews 
View user's profile Send private message
warren-the-ape




Joined: May 18, 2008
Posts: 12

PostPosted: Thu May 29, 2008 2:29 am
Reply with quote

godfather wrote:
Using the HTML editor in the nuke blocks module, I can add simple HHTML.
Ive just tried to add an image using :

$content = <img src="image.gif" /> ;

The simple code remained but the image vanished? I tried with and without the $content command line.


I think you're mixing 2 things up here.

You can just use the Block editor within the administration to add simple html (like Guardian said; the allowed html tags within your config.php).
'$content =' is not needed there since that part is PHP and not HTML.

I thought that the <img> tag wasn't standard enabled in the editor, so open up your config.php and add the <img> tag in a similar way the others are listed (see the array at the bottom of config.php).


Use $content = '<img src="image.gif" />'; when you open the source code of the block within your FTP program.
 
View user's profile Send private message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Thu May 29, 2008 3:36 am
Reply with quote

Code:
/* If you want to use the IMG tag in your HTML code, to include images in News for example you must use the following line and comment out the old $AllowableHTML */
/*$AllowableHTML =


Found it, it is in the config,php file.

Cheers again lads, ill let you know if this works now.

Oh I removed the /*
 
View user's profile Send private message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Thu May 29, 2008 3:48 am
Reply with quote

Code:
/* If you want to use the IMG tag in your HTML code, to include images in News for example you must use the following line and comment out the old $AllowableHTML */
/*$AllowableHTML = array("img"=>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); */
/* or just include "img"=>2 in the $AllowableHTML array bellow. This feature isn't included by default due to possible security issues */
$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);



Just not happening.

There sem to be two options in the config file to allow IMG tags.

One is to comment out the old one and enable the other, tried this, the site crashes.

The other is to include the command, "img"=>2 in , ive tried both and the same result site bombs, and hangs on a white screen.

Any ideas?
 
View user's profile Send private message
godfather




Joined: May 27, 2008
Posts: 25

PostPosted: Thu May 29, 2008 3:56 am
Reply with quote

Sorted me being thick again.

I was only changing the /* and not the */ at the end.

Obviously this is a command line that is ignored if its between these two symbols.

Hope this helps someone else in the future. Lesson learned the hard way. Very Happy
 
View user's profile Send private message
warren-the-ape




Joined: May 18, 2008
Posts: 12

PostPosted: Thu May 29, 2008 4:07 am
Reply with quote

godfather wrote:
Obviously this is a command line that is ignored if its between these two symbols.


Yep its pretty basic stuff Wink

<!-- code --> to comment out in html
/* code */ to comment out in php
//code to comment out in javascript or actionscript


btw, i dont understand why the <img> -tag would be a security risk, or are you still using 8.1?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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 cannot attach files in this forum
You cannot download files in this forum


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