Forum OpenACS Q&A: Blog questions

Collapse
Posted by Luis Garcia on

1. I would like to post a picture within my blog entry. I am giving an explanation and need to illustrate what I'm saying for it to be understandable. I tried adding the picture in a folder of the server somewhere and then adding an img HTML tag to it. It does not work and it says it is for security issues. Is there any other way? If not, I think this would be a nice thing to add for future versions.

2. How can I display only part of the entry in the main page of the my blog? Some of my entries are rather long and I would like to show only a few lines and then a link to the Permalink for the client to read the rest of it.

Thanks!

Collapse
2: Re: Blog questions (response to 1)
Posted by Brad Duell on
Hey Luis,

You can post an image from photo-album in your blog by doing the following (if photo-album is mounted at "/photos"):

<a href="/photos/photo?photo_id=PHOTO_ID" border=0><img src="/photos/images/THUMBNAIL_ID"></a>

You will, of course, need the proper permissions on the PHOTO_ID object for a user to view that photo.

Let me know of anything else.

Collapse
3: Re: Blog questions (response to 1)
Posted by Luis Garcia on
Cool, thanks!

Any ideas on showing only a few lines of the blog post in the main page?

Thanks again!

Collapse
4: Re: Blog questions (response to 1)
Posted by Luis Garcia on
Well, it actually did not let me post it. This is the warning I get:

"For security reasons we only accept the submission of HTML containing the following tags: B I P A LI OL UL EM BR TT STRONG BLOCKQUOTE CODE PRE FIRST_NAMES LAST_NAME EMAIL GROUP_NAME DL DT DD FONT. You have a IMG tag in there."

I had tried something similar this afternoon and gave me this same warning.

Thanks!

Collapse
5: Re: Blog questions (response to 1)
Posted by Brad Duell on
Luis,

You'll need to edit the "AllowedTag" parameter for your Kernel to allow anything you're trying to use.

You can get to that section by going to /admin, clicking on "Site Map" and scrolling down to click on "Kernel" under the "Services" section.

Let me know of anything else.

Collapse
6: Re: Blog questions (response to 1)
Posted by Luis Garcia on
Got it! Thanks again.
Collapse
7: Re: Blog questions (response to 1)
Posted by Ben Koot on
Only a few lines...

On the blog parameter section you will find a parameter "max_content_ length" That allows you, to limit the number of lines. (The function might be broken).

Collapse
8: Re: Blog questions (response to 1)
Posted by Orzenil Silva Junior on
Luis, Ben

about max_content_length parameter broken in lars-blogger see https://openacs.org/forums/message-view?message_id=246506

i submitted a patch at https://openacs.org/bugtracker/openacs/patch?patch_number=656 about this issue. could you apply it and test if it works for you?

Collapse
9: Re: Blog questions (response to 1)
Posted by Luis Garcia on
Hi Ben,

Yes, I had seen that parameter before and tried it. It did not work and that's when I decided to post the question. I will try this patch and see if it works.

Thanks!

Collapse
10: Re: Blog questions (response to 1)
Posted by Luis Garcia on
Hi Orzenil,

I was trying to apply your patch. Changed the line you mention in the file entry-chunk.tcl ONLY from:

if { ![exists_and_not_null max_content_length] } { ...

and substitute for:

if { ![template::util::is_true $max_content_length] } { ...

I did not see that in the other file so I did not do anything to it. I still I do not get it to work right. I guess I have to change something else in the other file as well. Let me know if I'm doing soemthing wrong.

Thanks!

Collapse
11: Re: Blog questions (response to 1)
Posted by Luis Garcia on
By "the other file" I meant blog.tcl file.

Thanks

Collapse
12: Re: Blog questions (response to 1)
Posted by Orzenil Silva Junior on
Luis,

It is very strange.. The patch was generated against lars-bloger in openacs-5-1-5 tag. You can see the file blog.tcl here

http://cvs.openacs.org/cvs/*checkout*/openacs-4/packages/lars-blogger/www/blog.tcl

and there is a line

if { ![exists_and_not_null max_content_length] }

that you must change to get max_content_length parameter working