- Moderated by:
- Support Team
-
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
Okay, so this is really bugging me. I am assigning to the template a variable who's value contains a lot of characters (57595 to be exact). Whenever I do this (or other long strings) nothing shows. If I shorten the string to lets say 25000 characters, it shows fine. Now there are a few things I know.....
1) It has nothing to do with the string itself. I can change it to 50000 "x"s and it still doesn't work. Likewise, if I just print the string itself (ie echo $str) it prints fine.
2) It has nothing to do with displaying it. If I remove the line in the template that displays it, it still doesn't work. If I comment out the assign line in the PHP, it works fine though, so I am assuming it has to do with assigning it.
Is this a problem others have had? Is there a limit to the length of the string to be assigned and is there anyway to fix it (other than splitting the text trying to be displayed into multiple variables to assign)? -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
AmmoDump
I would guess you are possibly exceeding your memory limit set your php.ini.
***Nothing more than a guess***
Unfortunately, that's not it. I tried increasing the memory to a really high amount and it still won't work.
From what I could gather in the pnRender/Smarty code, all 'assign' does is add the key/value to an array. I am able to add a string with 50000 'x's in an array I created without problems.
Thanks for trying though. :) -
- rank:
-
Professional
- registered:
- March 2003
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 901
http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign
Sometimes differ I found myself
eg
assign var=text value=$subtitle [no quotes]
is not the same as
assign var=text value="This is the subtitle of the title" [quotes]
It seems trivial, but sometimes it does the trick...
not to mention in some cases you need the backticks [or how are they called] ``
- Igor
--
Have a nice day
zikulapro.be is currently running
Zikula 1.0.2 -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
Quote
http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign
Sometimes differ I found myself
eg
assign var=text value=$subtitle
is not the same as
assign var=text value="This is the subtitle of the title"
It seems trivial, but sometimes it does the trick...
not to mention in some cases you need the backticks [or how are they called] ``
- Igor
Oops, that's my fault in explaining. I'm assigning it in the PHP script....
Code
The echo statement works correctly so it has nothing to do with the string or SQL. And whether or not I am actually displaying $des in the template does not matter. -
- rank:
-
Helper
- registered:
- January 2003
- Status:
- online
- Posts:
- 216
askmike1
I am assigning to the template a variable who's value contains a lot of characters (57595 to be exact). Whenever I do this (or other long strings) nothing shows. If I shorten the string to lets say 25000 characters, it shows fine.
I also remember some similar problems I had a few months ago.
Could you please try out 32700 as well as 32800 characters?
--
-
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
Okay, now my problem has apparently changed. I now get the error ONLY if I place textarea tags around long text. So ie.....
Code
blah blah blah
LONGTEXT HERE
blah blah blah
shows fine, but....
Code
doesn't work.
edited by: askmike1, Oct 15, 2007 - 09:30 AM -
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 09.11.08
- Posts:
- 13413
Have you looked at the page source to see if the text area tags are there? Row and column attributes on the text area?
--
Regards,
Simon
itbegins.co.uk - Zikula Consulting
Please read the Support Guide -
- rank:
-
Professional
- registered:
- November 2003
- Status:
- offline
- last visit:
- 06.11.08
- Posts:
- 1675
Just a thought, but have you tried displaying this through different browsers? Could it be a browser issue? I know IE sometimes doesn't like big pages in div tags.
--
Under Construction! -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
HammerHead
Have you looked at the page source to see if the text area tags are there? Row and column attributes on the text area?
The textarea tags are in the template code with row & column attributes (and it only breaks with those textarea tags). I can't look at the source though on the displayed page because.... well... nothing is displayed.
Topiatic
Just a thought, but have you tried displaying this through different browsers? Could it be a browser issue? I know IE sometimes doesn't like big pages in div tags.
Doesn't work with IE or Firefox. :( -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
Any other ideas? This problem only happens when I surround the text with textarea tags (I can display the text fine, I can place it into a hidden input field, I can do basically anything but putting textarea tags around it). Does pnRender, Smarty or PostNuke do something to textarea tags that would cause this problem? -
- rank:
-
Helper
- registered:
- February 2005
- Status:
- offline
- last visit:
- 14.11.08
- Posts:
- 284
I remember having a similar problem about a year ago (.762). I wrote a module that imports data from external databases into Pagesetter publications through a form. I did have the problem in IE and FF, but not in Opera. I eventually found a workaround. Please try Opera and see how that behaves?
Another thought: do you have 'trim white spaces' or 'shortURL' output filters enabled? If you have try switching them of. -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
Okay, so I am now 100% sure this isn't a Smarty problem (I've tried it with just Smarty and can easily display 100,000's of characters). So now I just have to figure out whether this is a pnRender problem or something another part of PostNuke is doing.
Now to add to the confusion, if I comment out the $GLOBALS['theme_engine']->themefooter(); line in footer.php, it will display fine (just not within in my theme). The code for themefooter() is....
Code
function themefooter()
{
// end output buffering and get module output
$maincontent = ob_get_contents();
ob_end_clean();
// add the module wrapper
if (!$this->system && (!isset($this->themeconfig['modulewrapper']) || $this->themeconfig['modulewrapper'])) {
$maincontent = '<div id="pn-maincontent" class="pn-module-'.DataUtil::formatForDisplay($this->module).'">'.$maincontent.'</div>';
}
// Assign the main content area to the template engine
$this->assign('maincontent', $maincontent);
// render the page using the correct template
$this->display($this->themeconfig['page'], $this->pageid);
}
(and yes, if I erasefrom my theme template, the page will display, of course with no actual module content)Code
<!--[$maincontent]-->
And no, trimwhitespaces & shorturls being disabled doesn't do anything (and it doesn't work with Opera, FF, IE or Safari). :(
And finally, to add to the confusion even more, if in my main theme template I change
toCode
<!--[$maincontent]-->, it will actually display everything (even when I have the textarea tags)..... of course, it will display the HTML code itself, not what the code is supposed to make.Code
<!--[$maincontent|escape]-->
edited by: askmike1, Oct 19, 2007 - 11:22 PM -
- rank:
-
Freshman
- registered:
- January 2006
- Status:
- offline
- last visit:
- 22.01.08
- Posts:
- 14
To simplify things a bit, here is a bit of code I saved as test.php....
Code
<?php
include('includes/pnAPI.php');
pnInit(PN_CORE_ALL & ~PN_CORE_AJAX);
Loader::includeOnce('header.php');
$pnRender = new pnRender("Movies");
$x = '';
for($i=0; $i<50000; $i++) $x .= 'x'; //create 50000 x's
$pnRender->assign('name', $x);
$pnRender->display('test.tpl');
//Loader::includeOnce('footer.php');
?>
test.tpl contains...
Code
<textarea>
<!--[$name]-->
</textarea>
Now as is, that code works fine and it displays the textbox with all the text (just not in my theme template).
If I uncomment the Loader::includeOnce('footer.php'); line, it displays nothing.
If I uncomment that line AND delete the textarea tags, it will display the entire text within my template. -
- rank:
-
Steering Committee
- registered:
- December 2002
- Status:
- offline
- last visit:
- 09.11.08
- Posts:
- 13413
Have you got a visual editor or JS quicktags enabled?
--
Regards,
Simon
itbegins.co.uk - Zikula Consulting
Please read the Support Guide
