Several headings in different posts at the same thread Posted by Serg Kravchenko 11 Jun 2009 20:06 GMT-0000 posts: 3 ☆ What is the problem? Better to show than describe... So... This is the first "heading" in one post. Hide state.[+] Some text... This is the second "heading" in one post. Hide state.[+] Some text... Go to the next post...
Posted by Serg Kravchenko 11 Jun 2009 20:07 GMT-0000 posts: 3 ☆ Part two... This is the first "heading" in another post. Hide state too.[+] Some text... This is the second "heading" in another post. Hide state too.[+] Some text... And now, try to show all headings in both posts...
Posted by Serg Kravchenko 11 Jun 2009 20:09 GMT-0000 posts: 3 ☆ The problem is that each message parsed separately by code: tikilib.phpCopy to clipboardfunction parse_data_process_maketoc ... if ($divstate == '+' || $divstate == '-') { // OK. Must insert flipper after HEADER, and then open new div... $thisid = 'id' . ereg_replace('[^a-zA-z0-9]', '',urlencode($options['page'])) .$nb_hdrs; 1. Solution number one: Generate unique id for every heading: tikilib.phpCopy to clipboardfunction parse_data_process_maketoc ... if ($divstate == '+' || $divstate == '-') { // OK. Must insert flipper after HEADER, and then open new div... $thisid = 'id' . microtime() * 1000000; For the anchor to allow bookmarks or links we can add another hidden control with old-style id: tikilib.phpCopy to clipboard$thisid = "id" . ereg_replace('[^a-zA-z0-9]', '',urlencode($options['page'])) .$nb_hdrs; $aclose2 .= '< div id="' . $thisid . '">'; 2. Solution number two: Use specifics section. For example: tikilib.phpCopy to clipboardfunction parse_data_process_maketoc ... global $section, $comment_info; switch ($section) { case "forums": $id_prefix = str_replace('@','',$comment_info['message_id']); break; }; if (!isset($id_prefix)) $id_prefix = "id"; // OK. Must insert flipper after HEADER, and then open new div... $thisid = $id_prefix . ereg_replace('[^a-zA-z0-9]', '',urlencode($options['page'])) .$nb_hdrs; 3. Solution number three: Add to Tiki global identifier of any object. For example through the global counter or something like that. 4. Any other solutions???