Lines Matching +defs:n +defs:y

18   echo "dokuwiki2mediawiki.php (c) 2010-2012 by Thorsten Staerk\n";
19 echo "This program converts dokuwiki syntax to mediawiki syntax.\n";
20 echo "The source file is given as an argument, the target file is the same plus the suffix \".mod\"\n";
21 echo "Usage: php dokuwiki2mediawiki <file>\n";
22 echo "Example: php dokuwiki2mediawiki start.txt\n";
121 $line=preg_replace("/\n/","",$line);
135 for ($n=0;$n<count($headers);$n=$n+1)
137 echo $headers[$n]; echo "|";
139 echo "\n";
140 for ($y=1;$y<count($cells)+1;$y=$y+1)
142 for ($x=0;$x<count($cells[$y]);$x=$x+1)
144 echo $cells[$y][$x]; echo "|";
146 echo "\n";
148 echo "***** END *****\n";
152 for ($y=1;$y<count($cells)+1;$y=$y+1)
153 for ($x=0;$x<count($cells[$y]);$x=$x+1)
154 $rowspancells[$y][$x]=1;
157 for ($y=1;$y<count($cells);$y=$y+1)
159 for ($x=0;$x<count($cells[$y]);$x=$x+1)
162 while (($y+$z<=count($cells)) && (preg_match("/ *::: */",$cells[$y+$z][$x])))
164 $rowspancells[$y][$x]+=1;
171 for ($y=1;$y<count($cells)+1;$y=$y+1)
172 for ($x=0;$x<count($cells[$y]);$x=$x+1)
173 if (preg_match("/ *::: */",$cells[$y][$x])) $rowspancells[$y][$x]=0;
176 for ($y=1;$y<count($cells)+1;$y=$y+1)
178 for ($x=0;$x<count($cells[$y]);$x=$x+1)
179 echo $rowspancells[$y][$x];
180 echo "\n";
184 $tablesource="{| class=\"wikitable sortable\" border=1\n";
188 for ($n=0;$n<count($headers);$n=$n+1)
190 $tablesource.=$headers[$n];
191 if ($n<count($headers)-1) $tablesource.="!!";
193 $tablesource.="\n|-\n";
195 for ($y=1;$y<count($cells)+1;$y=$y+1)
198 for ($x=0;$x<count($cells[$y]);$x=$x+1)
200 if ($rowspancells[$y][$x]>=1)
202 if ($rowspancells[$y][$x]>1) $tablesource.="rowspan=".$rowspancells[$y][$x]."|";
203 $tablesource.=$cells[$y][$x];
204 if ($x<count($cells[$y])-1) $tablesource.=" || ";
207 $tablesource.="\n|-\n";
209 $tablesource.="|}\n";
225 $line=preg_replace("/\n/","",$line);