Anchors in TOC not working

Sven
Joined: 23 Mar 2007

Anchors in TOC not working

Posted:10 Apr 2007 (09:02 UTC)
After my Serveradmin allowed mod_rewrite to work using the .htaccess files, the links in the TOCs still lead to the start page instead of to the target they should have.

As an example:
http://sven.cnc-community.de/bitweaver/blogs/view_post.php?post_id=43
An example link is (Atreides -> Einsatz1):
http://sven.cnc-community.de/bitweaver/#Einsatz1
but following the .htaccess it should read
http://sven.cnc-community.de/bitweaver/blogs/view_post.php?post_id=43#Einsatz1

Any help? thx in advance
Sven
Joined: 23 Mar 2007

Re: Anchors in TOC not working

Posted:10 Apr 2007 (20:41 UTC)
no one?

I mean... I want to get the site online in working environment and I don't even think that this is a bitweaver problem (...related, yes...)but it's more an issue we have with the apache or whatever config.

But I'd need some help in getting the problem solved - so what could lead to that problem solution?

Here's the phpinfo:
phpinfo on current directory/subdomain
If you need any more details, don't hesitate to ask for it....
xing
Joined: 07 Mar 2004

Re: Anchors in TOC not working

Posted:11 Apr 2007 (05:56 UTC)
looks like a bug in maketoc. i will try to fix this as soon as i can, which will probably be around the weekend.

if you are familiar with php, you can have a stab at it. the file responsible is:
liberty/plugins/data.maketoc.php

could you also let us know what version of bitweaver you are using?

x
Sven
Joined: 23 Mar 2007

Re: Anchors in TOC not working

Posted:11 Apr 2007 (08:56 UTC)
xing
Joined: 07 Mar 2004

Re: Anchors in TOC not working

Posted:12 Apr 2007 (06:06 UTC)
you could try using maketoc from the new version and see if that helps. the code has changed a lot and there's new options as well.
here is the source: http://bitweaver.cvs.sourceforge.net/bitweaver/_bit_liberty/plugins/data.maketoc.php?view=markup
Sven
Joined: 23 Mar 2007

Re: Anchors in TOC not working

Posted:12 Apr 2007 (12:38 UTC)
No change.... :(

Couldn't it be the .htaccess with its rewrite statements itself?
Sven
Joined: 23 Mar 2007

Re: Anchors in TOC not working

Posted:12 Apr 2007 (19:58 UTC)
Fixed it (I'm not too good at php so forgive me if this is outdated or bad style...)
data.maketoc.php, line 212, inserted below
code//EDITED+
if (substr($_SERVERPHP_SELF>'PHP_SELF',11,5)=='blogs') { //bitweaver/
if( $depth <= $maxdepth ) {
$loc = $_SERVERREQUEST_URI>'REQUEST_URI';
$pos = strrpos ($loc, '=');
$loc = substr($loc, $pos + 1);
$list .= ''.$output.'';
} else {
$list .= ''.$output.'';
}
}
//EDITED-
/code
works and should work for directory blogs only

What would be needed now (seems to be a bug):
If the file reads any item to be put on the TOC it doesn't recognize that the same entry is there already (example: we have a walkthrough for a game, each sections contains the primary and secondary objectives) it will only notice the first occurance (every anchor will lead to the first 'PrimaryObjectives' instead of the one it's belonging to.
Adding a counter and adding the number of occurances would do the trick...
Should look like this but I have no idea how to achieve:
$ids$k -> primaryobjectives_1 | $output
$ids$k -> primaryobjectives_2 | $output
  Page 1 of 1  1