Matt, the second argument in print_r() function tells it to acutally return the string instead of a direct output.<br><br><div class="gmail_quote">On Sun, Aug 21, 2011 at 8:43 AM, Matt Murphy <span dir="ltr"><<a href="mailto:mattyhead@gmail.com">mattyhead@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Because print_r is a direct output function. You'd need some sort of<br>
buffering scheme to grab its output in chunks and assign it to a<br>
variable or put it in the database or whatever, once per usage.<br>
<div><div></div><div class="h5"><br>
On Sun, Aug 21, 2011 at 7:20 AM, Agon S. Buchholz <<a href="mailto:asb@kefk.org">asb@kefk.org</a>> wrote:<br>
> Progga wrote:<br>
><br>
>> Try calling "drupal_set_message(print_r(debug_backtrace(), TRUE))"<br>
>> from inside the drupal_set_title() function at "includes/path.inc,<br>
>> line 206".<br>
><br>
> Thanks for your patience, but I had no luck with this either.<br>
><br>
><br>
> function drupal_get_title() {<br>
> $title = drupal_set_title();<br>
> drupal_set_message(print_r(debug_backtrace(), TRUE))<br>
><br>
> // during a bootstrap, menu.inc is not included and thus we cannot<br>
> provide a title<br>
> if (!isset($title) && function_exists('menu_get_active_title')) {<br>
> $title = check_plain(menu_get_active_title());<br>
> }<br>
><br>
> return $title;<br>
> }<br>
><br>
> and<br>
><br>
> function drupal_get_title() {<br>
> $title = drupal_set_title();<br>
><br>
> // during a bootstrap, menu.inc is not included and thus we cannot<br>
> provide a title<br>
> if (!isset($title) && function_exists('menu_get_active_title')) {<br>
> $title = check_plain(menu_get_active_title());<br>
> }<br>
> drupal_set_message(print_r(debug_backtrace(), TRUE))<br>
> return $title;<br>
> }<br>
><br>
> result in:<br>
><br>
> Parse error: syntax error, unexpected T_IF in<br>
> /var/www/drupal/includes/path.inc on line 235<br>
><br>
> respctively<br>
><br>
> Parse error: syntax error, unexpected T_RETURN in<br>
> /var/www/drupal/includes/path.inc on line 239<br>
><br>
><br>
> (is this even "inside the function"?)<br>
><br>
><br>
> function drupal_set_title($title = NULL) {<br>
> drupal_set_message(print_r(debug_backtrace(), TRUE))<br>
> static $stored_title;<br>
><br>
> results in<br>
><br>
> Parse error: syntax error, unexpected T_STATIC in<br>
> /var/www/drupal/includes/path.inc on line 253<br>
><br>
><br>
> function drupal_get_title() {<br>
> $title =<br>
> drupal_set_title(drupal_set_message(print_r(debug_backtrace(), TRUE)));<br>
><br>
> // during a bootstrap, menu.inc is not included and thus we cannot<br>
> provide a title<br>
> if (!isset($title) && function_exists('menu_get_active_title')) {<br>
> $title = check_plain(menu_get_active_title());<br>
> }<br>
><br>
> results in lots of debug output all over the first page I', loading, and<br>
> then in<br>
><br>
> Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to<br>
> allocate 54190338 bytes) in /var/www/drupal/includes/theme.inc on line 1879<br>
><br>
> (current PHP memory limit: 200M)<br>
><br>
><br>
> Sorry, this is too much guesswork as I don't understand enough about PHP<br>
> syntax.<br>
><br>
> E.g. "inside the function"<br>
> drupal_set_title(check_plain($gallery->name)); probably means somewhere<br>
> inside the first (), or second (), either before, or after<br>
> "check_plain", or either before, or after "$gallery->name".<br>
><br>
> Greetings, -asb<br>
><br>
> _______________________________________________<br>
> themes mailing list<br>
> <a href="mailto:themes@drupal.org">themes@drupal.org</a><br>
> <a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><br>
><br>
_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Franz <br><br><a href="http://ciudaddelpico.com" target="_blank">http://ciudaddelpico.com</a><br><br>Sent from my laptop<br>