vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   FAQ Edit v3 (https://vborg.vbsupport.ru/showthread.php?t=27733)

tubedogg 09-08-2001 10:00 PM

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! :)

floleb7 09-09-2001 05:34 AM

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 --<

tubedogg 09-09-2001 07:08 AM

Fixed.

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

webhost 09-09-2001 11:52 AM

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")."\");");



the_sisko 09-09-2001 05:52 PM

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

Ruth 09-09-2001 11:59 PM

this is a must-have hack,

Thanks everyone !

tubedogg 09-10-2001 12:41 AM

Webhost: You should not have been running step 2 if you were upgrading. :eek: 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.

webhost 09-10-2001 12:49 AM

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.

Matt*is*thick 09-10-2001 12:50 AM

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.

tubedogg 09-10-2001 01:35 AM

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. :(


All times are GMT. The time now is 03:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01287 seconds
  • Memory Usage 1,770KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete