Mam taki kodzik:
1. <?php
2. /*-------------------------------------------------------+
3. | PHP-Fusion Content Management System
4. | Copyright (C) 2002 - 2008 Nick Jones
5. | http://www.php-fusion.co.uk/
6. +--------------------------------------------------------+
7. | Filename: faq.php
8. | Author: Nick Jones (Digitanium)
9. +--------------------------------------------------------+
10. | This program is released as free software under the
11. | Affero GPL license. You can redistribute it and/or
12. | modify it under the terms of this license which you
13. | can read by viewing the included agpl.txt or online
14. | at http://www.gnu.org/licenses/agpl.html. Removal of this
15. | copyright header is strictly prohibited without
16. | written permission from the original author(s).
17. +--------------------------------------------------------*/
18. require_once "maincore.php";
19. require_once THEMES."templates/header.php";
20. include LOCALE.LOCALESET."faq.php";
21.
22. add_to_title($locale['global_203']);
23.
24. if (!isset($_GET['cat_id']) || !isnum($_GET['cat_id'])) {
25. opentable($locale['400']);
26. echo "<!--pre_faq_idx-->";
27. $result = dbquery("SELECT * FROM ".DB_FAQ_CATS." ORDER BY faq_cat_name");
28. $rows = dbrows($result);
29. if ($rows) {
30. $columns = 2; $counter = 0;
31. echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl'>\n<tr>\n";
32. while($data = dbarray($result)) {
33. if ($counter != 0 && ($counter % $columns == 0)) { echo "</tr>\n<tr>\n"; }
34. $num = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='".$data['faq_cat_id']."'");
35. echo "<td valign='top' class='faq_idx_cat_name'><!--faq_idx_cat_name--><a href='".FUSION_SELF."?cat_id=".$data['faq_cat_id']."'>".$data['faq_cat_name']."</a> <span class='small2'>($num)</span>\n";
36. if ($data['faq_cat_description']) { echo "<br />\n<span class='small'>".$data['faq_cat_description']."</span>"; }
37. echo "</td>\n";
38. $counter++;
39. }
40. echo "</tr>\n</table>\n";
41. } else {
42. echo "<div style='text-align:center'><br />\n".$locale['410']."<br /><br />\n</div>\n";
43. }
44. echo "<!--sub_faq_idx-->";
45. closetable();
46. } else {
47. if ($data = dbarray(dbquery("SELECT * FROM ".DB_FAQ_CATS." WHERE faq_cat_id='".$_GET['cat_id']."'"))) {
48. add_to_title($locale['global_201'].$data['faq_cat_name']);
49. opentable($locale['401'].": ".$data['faq_cat_name']);
50. echo "<!--pre_faq_cat-->";
51. $rows = dbcount("(faq_id)", DB_FAQS, "faq_cat_id='".$_GET['cat_id']."'");
52. if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
53. if ($rows != 0) {
54. $result = dbquery("SELECT * FROM ".DB_FAQS." WHERE faq_cat_id='".$_GET['cat_id']."' ORDER BY faq_id LIMIT ".$_GET['rowstart'].",15");
55. $numrows = dbrows($result);
56. $tbl = 2; $i = 0;
57. echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl'>\n<tr>\n";
58. while ($data = dbarray($result)) {
59. if ($i != 0 && ($i % $tbl == 0)) { echo "</tr>\n<tr>\n"; }
60. echo "<td valign='top' class='faq_idx_cat_name'><strong>".$data['faq_question']."</strong><br />\n".nl2br(stripslashes($data['faq_answer']));
61. echo ($i != $numrows ? "<br /><br />\n" : "\n");
62. echo "</td>";
63. $i++;
64. }
65. echo "</tr>\n</table>\n";
66. echo "<!--sub_faq_cat-->";
67. closetable();
68. if ($rows != 0) { echo "<div align='center' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 15, $rows, 3, FUSION_SELF."?cat_id=".$_GET['cat_id']."&")."\n</div>\n"; }
69. } else {
70. echo $locale['411']."\n";
71. echo "<!--sub_faq_cat-->";
72. closetable();
73. }
74. } else {
75. redirect(FUSION_SELF);
76. }
77. }
78.
79. require_once THEMES."templates/footer.php";
80. ?>
I tak standardowo się wyświetla w FAQ tak:
nazwa kategorii (x)np.
Pytania dotyczące Instalacji skryptów (12)
I teraz rzecz do której zmierzam.
Klikam sobie na nazwę kategorii otwiera mi się opentable i pojawiają mi się pytania i odpowiedzi.
I jak zrobić żeby nad pierwszym pytaniem pokazał się taki napis.
Liczba Pytań w kategorii: (x) w moim przykładzie to 12.
Jest szansa na zrobienie takiego czegoś bo ja już kombinuje i na razie nic z tego.
Proszę o odpowiedź:)
PW od moderatora:
- Przeniesienie tematu - Pieka 08.03 - 17:58
|