Re: Change heading numbering
If you are willing to modify your Tiki source code, you could add {startnum = 5} functionality to the numbered headings syntax. But, there is a risk that a future upgrade to Tiki would change the code so that you could not make the same modification to the code again.
Update: After more testing, I found the change did not work well when used on different levels (I don't know it this would be useful on other levels though). I also didn't care for the fact that it only worked if it was the first heading with the startnum. So, I made a change to the code that gets added.
Edit the file: lib/parser/parserlib.php
Before this line:
$line_lenght = strlen($line);
I know "length" is spelled incorrectly in the variable name, but that is how it is in the code. That variable also is not used anywhere else in the program.
Add these 2 lines:
preg_match('/{\s*startnum\s*=\s*(\d+)\s*}/',$line,$starthnum); $line=preg_replace('/{\s*startnum.*}/','',$line);
The first line looks for the {startnum=5} string and, if it is present, it puts the starting number specified into the variable $starthnum[1].
The second line removes the "{startnum=5}" text from the heading line.
Those lines must be inserted before the "line_lenght" variable is set, or the value of the "line_lenght" variable will be incorrect. Since it isn't used anywhere else, that may not be a problem, but why risk it.
Then add a third line of code before this line:$show_title_level[$hdrlevel] = preg_match('/^!+[\+\-]?#/', $line);
Make it:
if ($starthnum[1]) { $hdr_structure[$nb_hdrs][$hdrlevel-1] = $starthnum[1]; } $show_title_level[$hdrlevel] = preg_match('/^!+[\+\-]?#/', $line);
If a startnum was specified, that line sets the start number into the header number structure.
To use it, make your !# heading line like this:
!#{startnum=5}heading A
The {startnum=5} string can be used on any !# heading line, so you can change the number at any time.
Spaces can be used anywhere within the "{startnum=5}" string and the "{startnum=5}" can be anywhere in the heading line. The number will always be at the front of the heading. To have the number display somewhere else in the heading text ("!Proc/5 - Test Title") would require a much larger modification to the code. If you want to do that, then you should look into creating a plugin instead.
There isn't any error checking, but if you don't specify a valid number to start with, the "{startnum=?}" string should still be removed from the heading line, and the numbering will default to 1.
The lines of code where this change is made are the same in Tiki 8 thru Tiki 12 (and currently Tiki 13 and Tiki trunk)) Update: The code that creates the auto numbered headings was added in Tiki 2 and was originally in lib/tikilib.php. It was moved to lib/parser/parserlib.php in Tiki 8. The code has been essentially the same for a long time., so you might be able to make the same change to any future Tiki versions you upgrade to.
Tom