$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Change id="respond" to the comments container|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Change id="respond" to the comments container

matteradmin8PV0评论

On the same page, I have 3 comment threads. Each comment has a meta that tells in which tread they have to be displayed in. At the end of each thread, I have a form to post a comment in this specific thread and it adds the right meta.

The problem is when I click the “Reply” link, it adds a form under the comment, but not the good form. It adds the first form that appears in the page, event if I reply a comment from the third thread. So the meta that is added with my new comment is not the good one…

To generate my 3 comment threads , I use the comment_form() function. This function generated a div with a lot of hmtl inside. This div has an id="respond". I need to change this id for each comment thread to be different. Right now, all 3 comment threads have the same "respond" id.

Than, thanks to the comment reply link() function, i'll be able to control which respond_id is taken by comment-reply.js...

So all I need is to change this "respond" id for each comment thread that is generated by the comment_form() function ! But how :( ???

Thanks !

Post a comment

comment list (0)

  1. No comments so far