1
svenw
WF-Sections question: IMG-tag
  • 2004/1/5 15:15

  • svenw

  • Just popping in

  • Posts: 5

  • Since: 2003/12/4


Does anybody know how to disable the automatic insertion of 'http://<a server>/' into an IMG-tag when changing the view from HTML into WYSIWYG?

svenw



2
svenw
Re: WFSection & SPAW editor
  • 2004/1/5 15:04

  • svenw

  • Just popping in

  • Posts: 5

  • Since: 2003/12/4


Do you have any idea when this editor will be available in WFSection?

Thanks,
Sven



3
svenw
Re: WF-Sections enhancement - article.php
  • 2003/12/5 14:23

  • svenw

  • Just popping in

  • Posts: 5

  • Since: 2003/12/4


Aloha Aloha,
I am unsure what you want to achieve. Perhaps you can use the 'index page management' (move over the wf-sections menu and the option is visible (not in the main admin index of wf-sections!!)). At least you can disable the image.

Also from the template menu ('system admin - templates'), you can change the templates for wf-sections. Perhaps you can change wfsection_article.html and/or wfsection_htmlart.html. Use reply to tell me if this solves your problem.

Good luck!



4
svenw
WF-Setions enhancement - article.php
  • 2003/12/5 8:31

  • svenw

  • Just popping in

  • Posts: 5

  • Since: 2003/12/4


As you have possibly have seen, we are including HTML-files directly into WF-Sections. However, the code is not stripping the header and html-tags. I found that in the freecontent-module some simple, but effective functions are used to reduce the HTML-content to only the body part. This is what I included: in article.php at line

========= Start of the code ===============

# this is the original line:
#
# $articletag['maintext'] = fread($fp, filesize($maintextfile));
// NEW!
$htmlData = fread($fp, filesize($maintextfile));

$htmlData = str_replace("\r\n", " ", $htmlData);
$htmlData = str_replace("\n", " ", $htmlData);
$htmlData = preg_replace("/\s+/", " ", $htmlData);

if (preg_match('|<\s*head\s*>(.*)<\s*/\s*head\s*>.*?<\s*body\s?.*?>(.*)<\s*/\s*body\s*>|i',$htmlData, $match) !==0) {
$headPart = $match[1];
$bodyPart = $match[2];

preg_match_all('|<\s*link\s+.*?>|i', $headPart, $match);
$headPart_tmp = implode($match[0],' ');

preg_match_all('|<\s*script\s+.*?>\s*<\s*/\s*script\s*>|i', $headPart, $match);
$headPart = $headPart_tmp.implode($match[0],' ');

} else {
$headPart = '';
$bodyPart = '';
}
$articletag['maintext'] = $bodyPart;
// END OF NEW

========= End of the code ===============

Perhaps this can end up in the mainstream, but otherwise other people can include this themselves.

Have fun!



5
svenw
WF-Sections bug
  • 2003/12/5 7:51

  • svenw

  • Just popping in

  • Posts: 5

  • Since: 2003/12/4


(Note: I also posted this in WF-Sections announcement)

I think I have found a bug. We are heavily working with group permissions, but it seemed that checking permissions failed.

In the script 'article.php' at line 37 it currently read as:
if (checkAccess($article->groupid)) {
where it should read
if (checkAccess($article->$groupid)) {

By the way, this 'if'-statement could be enhanced using an 'else'-block:
else {
redirect_header( "javascript:history.go(-1)",2, _WFS_NOVIEWPERMISSION);
}
such that the user is redirected to the previous page, when access is denied.

CatzWolf, thanks for you code! Please check if this is a bug!?

Still going strong. We have some external source of HTML-content that is generated automatically. We are including it in WF-Sections. However, I could not leave the editor empty (there was check on emptiness of the editor block).

Line 121 now reads:
if (empty($HTTP_POST_VARS['maintext']) || $HTTP_POST_VARS['ishtml']) {
But should be:
if (empty($HTTP_POST_VARS['maintext']) && $HTTP_POST_VARS['ishtml']) {

Hopes this helps other people.




TopTop



Login

Who's Online

199 user(s) are online (130 user(s) are browsing Support Forums)


Members: 0


Guests: 199


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits