Location: PHPKode > projects > Tinbox > contentadmin/bpass1.php
<?php
//XML functions 1st pass - inserts "no image" for omitted <figs> 
function tag_open_scan1($parser, $name, $attrs)
        {
        global $parsedXMLdata, $tfi, $tfigs, $tgpj;
        switch($name)
                {
                case "fi":
                        $tfi++;
                        break;
                case "figs":
                        $tfigs++;
                        break;
                case "jpg":
                case "png":
                case "gif":
                        $tgpj++;
                        break;
                }
        $parsedXMLdata .= "<".$name.">";
        }

function tag_close_scan1($parser, $name)
        {
        global $parsedXMLdata, $tfi, $tfigs, $tgpj ,$imagedata;
        require(PPATH.CONTENT_ADMIN."figure/noimage.php");

        switch($name)
                {
                case "mod":
                        if (!$tfigs && $tfi) //if there are <fi> but no <figs> insert dummy 'no image' gif
                                {
                                $parsedXMLdata .= "<figs>";
                                for($i=1; $i<=$tfi; $i++)
                                        $parsedXMLdata .= $noimage;
                                $parsedXMLdata .= "</figs>";
                                }
                        $tfigs=0;
                        $tgpj=0;
                        $tfi=0;
                        break;
                case "figs":
                        if($tfi && $tgpj < $tfi )//if not enough images in <figs>
                                for($tgpj++; $tgpj<=$tfi; $tgpj++)
                                        $parsedXMLdata .= $noimage;                        break;
                }

        $parsedXMLdata .= "</".$name.">";
        }

function cdata_scan1($parser, $cdata)
        {
        global $parsedXMLdata;
        $parsedXMLdata .= htmlspecialchars($cdata);
        }

function default_scan1($parser, $data)     //DTD
        {
        global $parsedXMLdata;
        $parsedXMLdata .= $data;
        }
?>
Return current item: Tinbox