[pmwiki-users] Page variables with markup in them...

The Editor editor at fast.st
Wed Sep 13 08:40:11 CDT 2006

Hi Pm, I just gave the first code string to make sure I had the right
value for GetLog.  And also that I was setting the page variable
{$log} set properly (for debugging).  Both values show up on the page
properly just as expected.  But when I try and set the page variable
to GetLog directly, (code example 2) the page variable suddenly goes
blank in the screen.

It did the same thing when I tried to set it to a value containing a
live url (ie, clickable).  The data value was there stored properly,
but it would not take it as a page variable, though all the other
values on the page showed properly.

I'm pretty sure the problem is not in my code, as all the other data
variables etc., works properly.  And the GetLog value at least looks
correct when I use return to debug it. Here is the GetLog function:

function GetLog($d,$id) {
	global $WorkDir, $data, $log;
	$entry = explode("[[#Log", $log);
	foreach ($entry as $e => $ee) {
		if (substr($ee, 0, 10) == $id) {
			$t = explode(": : ", $ee);
			return $t[1];

It's supposed to take the data storage page ($d), and the log entry
timestamp ($id) to select the right log entry, and then extract and
return the part between the ": :"s.  On the data page there are
usually multiple log entries, each with it's own timestamp id, and
custom edit link.

>>red bgcolor=yellow padding=10<<
: :
: :
(:if [ auth admin || authid Caveman ]

Thanks for any light you (or anyone) can shed on this.


On 9/13/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Tue, Sep 12, 2006 at 04:52:51PM -0400, The Editor wrote:
> > Here's a bit more info on this perplexing problem.  When I use the
> > following code, I get both "hi" and the return value I want.
> >
> >       case "log" :
> >               $FmtPV['$log'] = "hi";
> >               return GetLog($d,$_GET[id]);
> >               break;
> >
> > When I change it to
> >
> >       case "log" :
> >               $FmtPV['$log'] = GetLog($d,$_GET[id]);
> >               break;
> >
> > I get  a blank value for {$log}.  No other changes.  Really bizarre.
> The first one is doing a "return", the second one isn't.
> I don't know if that's the source of the problem (can't tell that
> without more context), but it is a significant difference between
> the two.
> Pm

More information about the pmwiki-users mailing list