Reference for Shabbat 59:7
כשבנה שלמה את בית המקדש ביקש להכניס ארון לבית קדשי הקדשים דבקו שערים זה בזה אמר שלמה עשרים וארבעה רננות ולא נענה פתח ואמר (תהלים כד, ז) שאו שערים ראשיכם והנשאו פתחי עולם ויבא מלך הכבוד רהטו בתריה למיבלעיה אמרו מי הוא זה מלך הכבוד אמר להו ה' עזוז וגבור חזר ואמר (תהלים כד, ט) שאו שערים ראשיכם ושאו פתחי עולם ויבא מלך הכבוד מי הוא זה מלך הכבוד ה' צבאות הוא מלך הכבוד סלה ולא נענה כיון שאמר (דברי הימים ב ו, מב) ה' אלהים אל תשב פני משיחך זכרה לחסדי דוד עבדך מיד נענה באותה שעה נהפכו פני כל שונאי דוד כשולי קדירה וידעו כל העם וכל ישראל שמחל לו הקב"ה על אותו עון ולא יפה אמר שלמה ושבח אני את המתים שכבר מתו
David prayed before the Holy One, blessed be He, 'Sovereign of the Universe! Forgive me for that sin!'<span class="x" onmousemove="('comment',' Sc. of Bathsheba. ');"><sup>13</sup></span> 'It is forgiven thee,' replied He. 'Shew me a token in my lifetime,' he entreated. 'In thy lifetime I will not make it known,' He answered, 'but I will make it known in the lifetime of thy son Solomon.' For when Solomon built the Temple, he desired to take the Ark into the Holy of Holies, whereupon the gates clave to each other. Solomon uttered twenty-four prayers,<span class="x" onmousemove="('comment',' Heb. [H] songs. In Solomon's prayer (I Kings VIII, 23-53) expressions of entreaty ([H] song; [H], prayer; and [H], supplication) occur twenty-four times. ');"><sup>14</sup></span>