IncludeSite-Talk

Summary: Talk page for IncludeSite.
Maintainer:
Users: +2 (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Comments

PHP5.5 Compatibility Issue

M. Denning, 20170729: I made the changes concerning the php5.5 warning from mark-up (below my comments) in config.sys and re-ran ruleset with a skip-cache reload. It is still throwing the following compatibility error. Please, can this be addressed ASAP? Base site is battzion.org and WebMaster contact is at the bottom. Thanks!

includeSite directives  B>>>=  ! file: /cookbook/includeSite.php, line: 111, pat: /\(:includeSite\s+(http:[^<>"{}|\\^`()[\]']*?)\s*:\)/e
Update: I have updated line 111
FROMMarkup('includeSite', 'directives', "/\\(:includeSite\\s+(http:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')");
TOMarkup_e('includeSite', 'directives', "/\\(:includeSite\\s+(https?:[^$UrlExcludeChars]*?)\\s*:\\)/", "includeSite(\$m[1])");
TakeAway:This seems to have taken away the error generated in Rule Table.
AfterThought:However, I would still be more comfortable if I obtained positive word from the other developers that this was the only updated necessary.

Mark-Up PHP5.5 Warning

The script causes warnings under php5.5 because of the deprecated /e switch for the preg_replace() function. To fix this change

Markup('includeSite', 'directives', "/\\(:includeSite\\s+(http:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')");

to

Markup_e('includeSite', 'directives', "/\\(:includeSite\\s+(https?:[^$UrlExcludeChars]*?)\\s*:\\)/", "includeSite(\$m[1])");

This changes also allows you to include both, http and https sites with (:includeSite ... :), no need to use (:includeSecureSite ... :) as suggested by Chris.

- Kurt (2015-Nov-22)


I'm using this on an https site and I noticed that I cannot include https sites. I found (I'm no php programmer) that adding

Markup('includeSecureSite', 'directives', "/\\(:includeSecureSite\\s+(https:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')");

to the last line (before the ?>) allows me to include https sites with the markup (:includeSecureSite https://...:) . I hope this helps others and can be added to the official version (either as I've done it or more elegantly) some day.

-Chris (3/29/2012)


Is there a way to get rid of the 2cm whitespace above the included site? DirkBlaas

Yes, remove the two " $Output .= "\n\n<!--/ X-include -->\n\n";" lines from includeSite.php. -computerdude33

I found this to be a great way to incorporate dynamic content into our intranet however the regex used to parse the parameters seems to mangle urls with parameters. Is there a workaround or should I work on fixing this. --dddavis

Work on fixing this. fraz

How do I use the above supported (optional) fields? The recipe works great, but the default size is not really well-suited for my application, and I can't seem to change it. Thanks in advance! :-) --Henning February 03, 2006, at 10:52 AM

It works for me, for example: (:includeSite http://www.google.com height=600 border=0:) -Mushiro February 14, 2006, at 10:50 AM


I couldn't get percent directive work such as height=90%. It goes back to the default height when ever I use percent option. If the content is longer than the default height value, scroll bars appear (I added scroll=no option too). Has any one tested percent height ? Thanks -Ali Friday, June 02 2006

I use this cookbook and using % in the height line doesn't work for me either. I have found that height=400px works well for my tastes. Try using a pixel setting instead of a percent setting. - IanMacGregor Sunday, August 27, 2006


The problem of heigh percentage not working, has nothing to do with this script. It's an HTML problem. Height percentage only works when the containing block has a known height. Typically, it doesn't. If you place the iframe in a block with for example height=200px, then the percentage does work. So this will depend on the skin of your site... Anthony. 23.11.2007

Talk page for the IncludeSite recipe (users).