Welcome to Geeklog Monday, February 24 2020 @ 03:20 am EST

Geeklog Forums

Inline blocks working in static pages


Status: offline

Euan

Forum User
Full Member
Registered: 22/04/02
Posts: 292
[edit - I put this in the wrong place. Can someone move it please? Cheers, Euan.]

I'm not done quite yet, but it's working in principle: inline blocks in static pages.

[[IB function align]] is searched and replaced with a formatted block. Should perhaps also add a title, or perhaps actually leave building the entire block to the function? I'll post it here when it's done. It works with the version of staticpages in CVS, so you won't be able to use it until 1.3.10 is released anyway.

PHP Formatted Code

        } else if ($sp_php == 2) {
            ob_start ();
            eval ($sp_content);
            $retval .= ob_get_contents ();
            ob_end_clean ();
        } else {
            if (preg_match_all("/[[IB ([0-9a-zA-Z-_]+) ([0-9a-zA-Z-_]+)]]/", $sp_content, $matches)) {
                $i = 0;
                while ($i < count($matches)-1) {
                    $block = inline_block($matches[1][$i],$matches[2][$i]);
                    $sp_content = str_replace($matches[0][$i], $block, $sp_content);
                    $i++;
                }
            }
            $retval .= $sp_content;
        }


 


You'll need a function inline_block to handle the formatting too.

See it here.

Cheers,

Euan.
-- Heather Engineering -- No job too small
 Quote

All times are EST. The time is now 03:20 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content