News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

FAQ (Frequently Asked Questions) mod

Started by Suki, June 20, 2011, 08:19:18 PM

Previous topic - Next topic

Eclipse16V

Yes i have.
This error comes on guest visits.
I worked with:
SMF 2 in German

Shop:
SID Giessen

Suki

the error appears only for guest people?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ApplianceJunk

Quote from: Suki on December 23, 2011, 06:55:29 PM
Well, the hide is made with JavaScript by changing the div's display property to none but the entire body is still there and can be indexed by Google.

On my site I had see the few FAQs I have are all indexed by Google, if you enable the FAQ list then Google will index every FAQ's own page.

Our FAQ section was quickly indexed by google and tonight I notice Google added it to our sitelinks too. :)

Thanks again for this mod.

Suki

Cool :)

Im working in a new version that hopfully will reduce the number of queries
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Michael Pfaff

#206
Suki, this mod is pretty amazing. I like how you've set everything up and given such clear instructions.

One thing: what code would I need to modify to change the text color in the FAQ body and the sidebar menu to white text? The black doesn't look great on the colors of my forum.

Thanks so much for this mod!

Michael Pfaff

Quote from: Suki on January 16, 2012, 08:08:24 AM
Cool :)

Im working in a new version that hopfully will reduce the number of queries

Alternatively, if there's a way I can change the background color of each FAQ box to be grey instead of red?

PM me if you need to see my forum and I'll give you Tester login info.

Suki

All the css is set at Sources/Faq.php  file, look for a function name "headers"  or something, I renamed the function and forgot the old name.

On that funciton you can change the style.

Each Faq uses generic SMF styles.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Michael Pfaff

Quote from: Suki on January 19, 2012, 03:46:09 PM
All the css is set at Sources/Faq.php  file, look for a function name "headers"  or something, I renamed the function and forgot the old name.

On that funciton you can change the style.

Each Faq uses generic SMF styles.

Suki, I'm sorry.

I worked all afternoon on this and couldn't figure out how to find which style you used for the function. As you can see, I'm still clearly new to all this. When sub files start messing with the core template, things get wonky for me.

I got into the Sources/Faq.php file and found the header function you mentioned (I think...), but couldn't figure out what to modify to change the background colors.

So, I went into the CSS file to see if I could find any sort of "header" background color and couldn't find that either.

I'm lost.  :-\

Any direction you could give me would be very much appreciated.

Is there any way to modify the Sources/Faq.php to reference my board index or post style instead of the "header" style you mentioned so that the text is more legible?

Suki

#210
@Michael Pfaff  link to your site?   and tell me the specific part you want to change.


@everyone interested

Here's a beta for the new version, there is no new features, it's mainly just bug fixes and a re-write in OOP, I didn't have time to re-do the template so that part is pretty much the same.

This will hopefully reduce the number of queries this mod make.

Tested on 5.3.8, it will probably fail on a php4 server, I didn't have time to implement some checking and warnings.

To update just uninstall the old version and DO NOT check the "Remove all data associated with this modification. [Details]"   and install the new one, all your faqs and categories will not be deleted.Remove all data associated with this modification. [Details]
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Michael Pfaff

Quote from: Suki on January 19, 2012, 08:10:20 PM
@Michael Pfaff  link to your site?   and tell me the specific part you want to change.

Link: http://louisvillednd.com/forum/index.php

I've made the FAQ visible to guests, so you should be able to view it.

I want to change the text boxes that are dark red where it says "Coming Soon..." and also the Sidebar text boxes that have "Default" and "How do I roll up a starting character?".

If I can somehow get these colors to match the greyish brown color on my board index where each board is listed (Getting Started, Meetups, Gaming Discussion, etc.) that would be ideal.

I'm fine with the actual headers (where it says, "Categories", "FAQ list", etc.) remaining the lighter red color. Just need the content below more readable.

Think that's possible?

Suki

OK, open your Themes/default/faq.template.php file  and find:

<div class="faq_categories description">

replace with

<div class="faq_categories windowbg">


find

<div class="faq_list description">

and replace with

<div class="faq_list windowbg">
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Michael Pfaff

#213
Quote from: Suki on January 19, 2012, 08:47:24 PM
OK, open your Themes/default/faq.template.php file  and find:

<div class="faq_categories description">

replace with

<div class="faq_categories windowbg">


find

<div class="faq_list description">

and replace with

<div class="faq_list windowbg">

Yes! That worked. The sidebar is perfect now.

Now, is there a <div class="something"> that I can modify to make the each FAQ description on the page also have the windowbg image behind the text?

I noticed there are two <div class="faqs">. Should I add in windowbg after those?

On the site, it's where I have the "Coming Soon..." text.

Suki

The faq itself its a tricky one, the code that controls each faq is this one:



<span class="clear upperframe">
<span></span>
</span>
<div class="roundframe rfix">
<div class="innerframe">
<div class="content',$faq['id'],'" id="content',$faq['id'],'" ',$faqmod_display,'>
',$faq['body'],'
</div>
</div>
</div>
<span class="lowerframe">
<span></span>
</span><br />



Since SMF does some tricks to show rounded corners in every browser, a lot of span tags are needed, you can erase all those spans and just have this:

<div class="custom_class" id="content',$faq['id'],'" ',$faqmod_display,'>
                     ',$faq['body'],'
                  </div>


where custom_class  is the class you want each faq to have, could be windowgb or windowbg2 or some other custom made class.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

live627

Quoteit will probably fail on a php4 server
Yep. Just say that on the mod page once this gets there and you'll be fine. But you already know that :)

Michael Pfaff

Quote from: Suki on January 19, 2012, 09:19:24 PM
The faq itself its a tricky one, the code that controls each faq is this one:



<span class="clear upperframe">
<span></span>
</span>
<div class="roundframe rfix">
<div class="innerframe">
<div class="content',$faq['id'],'" id="content',$faq['id'],'" ',$faqmod_display,'>
',$faq['body'],'
</div>
</div>
</div>
<span class="lowerframe">
<span></span>
</span><br />



Since SMF does some tricks to show rounded corners in every browser, a lot of span tags are needed, you can erase all those spans and just have this:

<div class="custom_class" id="content',$faq['id'],'" ',$faqmod_display,'>
                     ',$faq['body'],'
                  </div>


where custom_class  is the class you want each faq to have, could be windowgb or windowbg2 or some other custom made class.

Wow, yeah. There was a lot in there to change and when I thought I had it right, I got an error. So, I just got the theme creator to help me change the text to white and now it is readable.

Thanks so much for your help, Suki!

Suki

So, new version, 1.2:

Change Log

-1.2
   Fixed a bug with the categories been reset when editing a faq.
   Re-write in OOP, the mod now performs less queries by using the cache system if available.
   Some code improved.


To update just uninstall the old version and install the new one, if you DO NOT check the "Remove all data associated with this modification. [Details]"  you won't lose all your existing Faqs.


Remember, this mod now needs php5 to work properly.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

WittyUsername

This mod would be highly useful to my forum, I recently downloaded it, but when I go to edit the FAQ or Category, I get this error:

Fatal error: Cannot call method self::FaqManage() or method does not exist in /home/a5023204/public_html/forums/Sources/Faq.php on line 341

My SMF version is 2.02

Perhaps it would be helpful if I took a screenshot of all my current mods I have installed.



My PHP version is:


I'm not a coder and have no idea what's even going on. But if I can get some help on this, it would be most appreciative.

Suki

Try this, open your /Sources/Faq.php and find;

call_user_func($subActions[$_REQUEST['sa']]);


and replace with:

$subActions[$_REQUEST['sa']]();
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: