[Re-Release 2.x] FAQ Edit v3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tubedogg
    Senior Member
    • Feb 2001
    • 13602

    [Re-Release 2.x] FAQ Edit v3

    I have made some modifications to the hack by Stasik, which is located here.
    New features:
    • Edit display order from the list of questions/groups
    • Got the display code into templates and out of misc.php
    • Removed some extra queries
    • Added support for vB Code and fixed support for smilies
    • Various small cosmetic/coding fixes
    The base hack is © 2001 by Stasik.
    Portions, including the installer, are © 2001 Kevin Schumacher.
    Portions of the installer were created by Bane.
    The hack and its' installer may not be redistributed, edited or not, without this copyright notice attached.

    For version: 2.0.3

    Files needed: faq_install.php, faq.php

    Files to edit: admin/index.php, root/misc.php

    Templates to edit: None.

    Instructions: Upload and run faq_install.php from your admin directory. Follow the on-screen directions.

    Upgrading from Stasik's hack: Upload and run faq_install.php from your admin directory and choose the option to upgrade from v2 of the hack.

    Upgrading from a previous version of *this* hack (e.g. from this thread): Upload and run faq_install.php from your admin directory and choose the option to upgrade from "v3, v31, or v32" of the hack.

    Please DO NOT contact me via PM, IM, email, or otherwise outside this thread about this hack.

    Thanks to Stasik for the great hack!
    Last edited by tubedogg; Mon 10 Sep '01, 4:13am.
  • floleb7
    Senior Member
    • Apr 2001
    • 455
    • 3.7.x

    #2
    problem in your faq_install


    step 4


    admin/index.php

    Find:

    >a href="bbcode.php?s=>?php echo $session[sessionhash]; ?>&action=modify"> Modify >/a<>br< >/td<>/tr<

    Just under that add:

    >!-- FAQ addon --<
    >tr<>td<
    >table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable"<
    >?php maketableheader("FAQs"); ?<
    >/table<
    >a href="faq.php?s=>?php echo $session[sessionhash]; ?<&action=modify"< Edit>/a< |
    >a href="faq.php?s=>?php echo $session[sessionhash]; ?<&action=addfaq"< Add>/a<
    >/td<>/tr<
    >!-- /FAQ addon --<

    Comment

    • tubedogg
      Senior Member
      • Feb 2001
      • 13602

      #3
      Fixed.

      I also added an upgrade path from v2 of the hack (Stasik's version).

      Comment

      • express
        Senior Member
        • Apr 2001
        • 1470
        • 3.6.x

        #4
        Couple of comments Tubedogg, first when upgrading my board from version 2, I had to comment out the parts in step2 and step21 about deleting the tables, it would not run until I did this.
        Second below for upgrades we have the bottom part of code installed not what you show. so you need to change that in your script. Lastly if it can be done we need to be able to use the vb code in this if possible. I have it upgraded and running after doing the above.

        Your instructions for Misc.php replacement

        PHP Code:
        if ($action=="faq") {
        $templatesused ""// Only one template used so load it when called
        include("./global.php");
        $page intval($page);
        if (!
        $page)
        $page '';
        eval(
        "dooutput(\"".gettemplate("faq$page")."\");");

        }
        [
        BThis is what is actually in a version 2 misc.php file so I replaced it all with what you said put in. [/B
        But we have this installed from Version 2 of the hack

        PHP Code:
        if ($action=="faq") {
          
        $templatesused ""// Only one template used so load it when called
         
        include("./global.php");
        if(isset(
        $page)){$sql "WHERE faqid='$page'";}
        $query "SELECT faqid,title FROM faq $sql ORDER BY showorder";
        $faqs=$DB_site->query($query);
        while (
        $faq=$DB_site->fetch_array($faqs)) {
        if (isset(
        $page)){$title " &gt; <a href=\"misc.php?s=$session[sessionhash]&action=faq&page=$faq[faqid]\">$faq[title]</a>";}
        $faqbody .= "<br> 
        <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#555576\"  width=\"100%\" align=\"center\"><tr><td>
        <table cellpadding=\"4\" cellspacing=\"1\" border=\"0\"  width=\"100%\">
        <tr id=\"cat\">
        <td bgcolor=\"#606096\"><a href=\"misc.php?s=
        $session[sessionhash]&action=faq&page=$faq[faqid]\"><normalfont color=\"#FFF788\"><b>$faq[title]</b></normalfont></a></td>
        </tr>
        <tr>
        <td bgcolor=\"#F1F1F1\"><normalfont>
        <ul>"
        ;
        $questions=$DB_site->query("SELECT entryid,title,faqid FROM faqentries WHERE faqid='$faq[faqid]' ORDER BY showorder");
        while (
        $question=$DB_site->fetch_array($questions)) {
        $faqbody .= "<li><a href=\"misc.php?s=$session[sessionhash]&action=faq&page=$question[faqid]#$question[entryid]\">$question[title]</a></li>\n";
        }
        $faqbody .= "    </ul>
        </normalfont></td>
        </tr>
        </table>
        </td></tr></table>"
        ;
        }
        if (isset(
        $page)) {
        $entries=$DB_site->query("SELECT entryid,title,text FROM faqentries WHERE faqid='$page' ORDER BY showorder");
        while(
        $entry=$DB_site->fetch_array($entries)){
        $faqbody .= "
        <br>
        <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#555576\"  width=\"100%\" align=\"center\"><tr><td>
        <table cellpadding=\"4\" cellspacing=\"1\" border=\"0\"  width=\"100%\">
        <tr>
        <td bgcolor=\"#606096\" id=\"cat\"><normalfont color=\"#FFF788\"><b><a name=\"
        $entry[entryid]\"></a>
        $entry[title]
        </b></normalfont></td>
        </tr>
        <tr>
        <td bgcolor=\"#F1F1F1\"><normalfont>
        $entry[text]
        </normalfont></td>
        </tr>
        </table>
        </td></tr></table>"
        ;
        }

        }
          eval(
        "dooutput(\"".gettemplate("faq")."\");");

        Last edited by express; Sun 9 Sep '01, 5:23pm.
        Real Web Host

        Comment

        • The_Sisko
          Senior Member
          • Jun 2000
          • 384

          #5
          Nice job (everyone of you)!!!

          I tested it on my lokal machine and will start translate it into german for my board tomorrow!!!

          Thanks alot
          The Sisko
          SciFi-Forum.de

          Comment

          • Ruth
            Senior Member
            • Apr 2001
            • 360

            #6
            this is a must-have hack,

            Thanks everyone !

            Comment

            • tubedogg
              Senior Member
              • Feb 2001
              • 13602

              #7
              Webhost: You should not have been running step 2 if you were upgrading. That will uninstall my version of the hack, not Stasik's.
              As for step 21 I believe there was an error in the SQL so I have changed that (and changed the step number to step==31).

              I have fixed the misc.php issue you mentioned and added a step specifically for upgrading (step==41).

              I also fixed a couple other minor issues.

              I will add support for vB code if possible later today.

              Comment

              • express
                Senior Member
                • Apr 2001
                • 1470
                • 3.6.x

                #8
                ok great the only reason I ran step 2 was on a test site to see if had a sql problem also, I finally like I said just commented out the delete stuff and step 21 ran fine except for the misc.php stuff. We appreicate you picking up on this and helping.
                One problem I ran into today just to let you know is the following.

                I was changing the title around on a question adding a link to it and put in one of these that I shouldn't -- "--
                I tried to go back and edit and it gave me just a blank page, so finally I went to database to edit it there because I knew what the problem was. Well in the database you can edit the answer but not the question so you may want to change this because I finally had to delete question/answer and do over, if we were capable of editing question in database we wouldn't have to do that.
                Real Web Host

                Comment

                • Matt*is*thick
                  Senior Member
                  • Mar 2001
                  • 130
                  • 3.0.7

                  #9
                  Is it me or is there no step 5? When I was running the install I had to manually change 5 to 6 so that I could reach the final step.

                  Comment

                  • tubedogg
                    Senior Member
                    • Feb 2001
                    • 13602

                    #10
                    webhost: I'm not really sure what you're saying. Could you explain it again?

                    Matt: I noticed that right before I uploaded the newest version. Sorry.

                    Comment

                    • express
                      Senior Member
                      • Apr 2001
                      • 1470
                      • 3.6.x

                      #11
                      I had a question that I wanted to edit, adding a link to the right of the question so I did but when I did that I put in " when I shouldn't have,I noticed it after I saved the question in the control panel faq section where you see questions you have installed, so I tried to edit it to take this out "
                      When I selected edit it took me to a blank page, so I said I will go into database and just modify that field for the question and take that out, The table for the questions will let you edit the answer but not the question, so I ended up deleting that question and answer and putting them in again. So there is a bug somewhere and also we need to be able to modify title/question field in database.
                      Real Web Host

                      Comment

                      • tubedogg
                        Senior Member
                        • Feb 2001
                        • 13602

                        #12
                        I'm still not sure what the problem is. I just tried adding and then editing a question with multiple " in it and it worked fine...?

                        Comment

                        • tubedogg
                          Senior Member
                          • Feb 2001
                          • 13602

                          #13
                          I've added support for vB Code if you want to use it. Select your option for each entry on the Add or Edit screen. All entries are set to use HTML for now, since the original entries put in your database when installing previous versions of this hack had HTML in them.

                          Updated zip file is in the first post. There are three upgrade paths, a new installation path, and an uninstallation path:
                          To Upgrade from Stasik's version of the hack, follow the link to upgrade from v2.
                          To Upgrade from a previous version of *my* hack, e.g. you got it from this thread, follow the link to upgrade from v3, v31, or v32 (it's all the same link).
                          To just see the file changes (if you are upgrading vB itself) follow the link for upgrading from a previous version of vB.

                          Comment

                          • floleb7
                            Senior Member
                            • Apr 2001
                            • 455
                            • 3.7.x

                            #14
                            Warning: Cannot add header information - headers already sent by (output started at f:\latriade\site\forum_test\upload\admin\adminfunctions.php:18) in f:\latriade\site\forum_test\upload\admin\faq.php on line 281


                            when i try to add a question

                            Comment

                            • tubedogg
                              Senior Member
                              • Feb 2001
                              • 13602

                              #15
                              Fixed. Download the zip and reupload faq.php. Don't run faq_install.php again.

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...