HTML Tags & date next to (x views)

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
The_ReVenger
Posts: 5
Joined: Fri Oct 10, 2003 8:10 am
Contact:

HTML Tags & date next to (x views)

Post by The_ReVenger »

Hello,

I first want to give you some feedback, the product phpMyFAQ is great! I searched a long time for faq-product and didn't find any. Then I remembered I had a link to hotscripts.com in my favourites so I looked at hotscripts.com. This link was to it and now i'm using it. It's working very good (except the replacement of a category/rubric to above, it's also a pitty that you can't re-arrange the category/rubric down, only above).

Well now to come to my questions ... firstly, I want to be able to put 'tables' with 'tr' and 'td' in my faq, so I can add an image next to text or text next to text etc. I did the following in functions.php :

Code: Select all

function safeHTML($html) {
	$html = stripslashes($html);
	$html = strip_tags($html, "<b><i><u><a><table><tr><td><hr>");
	return $html;
	}
This isn't working, as you can see I also wanted to be able to use the Horizontal Line, but that wasn't working also. What am I doing wrong ?

Furthermore I want to put the add-date next to the (x views) line, that is under the FAQ-Title in a category/rubric. I want that the users can see for example (2 views) (added 10 october 2003) or something. Can you help me with that ?

And as you probably already read in my feedback, I find it rather hard to re-arrange category's/sub-category's. When I re-arranged them yesterday, some sub-category's became instantly category's and some category's became sub-category's (I had 3 category's -> Internet, Software and Hardware, i wanted them to be alfabetically ordered, but when i did, the software became a sub-category of hardware). So how could I change it in that way it will arrange the category's/sub-category's alfabetically OR that i can easaly re-arrange them ? I had to re-arrange everthing with the hands in PhpMYADMIN and after that I had to put all the questions again in the right (sub)category. So can you help me with that (maybe) hard discipription :P ?

Thanks in advance man !
Grtz, Roel V.
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

we're working on a new category module. Stay tuned! :)

If you want to use HTML, just deactive BB-Code in the configuration or comment out these line in the function safeHTML():

Code: Select all

//$html = strip_tags($html, "<b><i><u><a><table><tr><td><hr>");
Where do you want to add the date? Then I can give you hints how to make this possible...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
The_ReVenger
Posts: 5
Joined: Fri Oct 10, 2003 8:10 am
Contact:

Post by The_ReVenger »

Thanks for the top-support :). And uhmz, you know how long it's gonna take till that new category-module is ready :D ?

I wanted to add a screen but I can't trough a attachment, so here is the link :
Image

If that isn't working, or is working to slow, then just click here : *image*

Also the // i had to put before the code of <b><i> etc weren't working. When i putted them before the code-line and saved it and tested it, it still wasn't working when I typed this in a post (question) :
<table><tr><td width=50%>
TEST
</td><td width=50%>
LALALA
</td></tr></table>
So can you help me :P ?
Thanks in advance !
Grtz, The_ReVenger
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

we hope to finish the new category module this year.

For the date problem:

- Search for the function function printThemes($category) in the file functions.php

- edit the following line:

Code: Select all

$result = $db->query("SELECT ".$sqltblpre."faqdata.id, ".$sqltblpre."faqdata.lang, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.rubrik, ".$sqltblpre."faqvisits.visits FROM ".$sqltblpre."faqdata LEFT JOIN ".$sqltblpre."faqvisits ON ".$sqltblpre."faqdata.id = ".$sqltblpre."faqvisits.id AND ".$sqltblpre."faqvisits.lang = ".$sqltblpre."faqdata.lang WHERE ".$sqltblpre."faqdata.active = 'yes' AND ".$sqltblpre."faqdata.rubrik = '".$category."' ORDER BY ".$sqltblpre."faqdata.id LIMIT ".$first.", 10");
to this:

Code: Select all

$result = $db->query("SELECT ".$sqltblpre."faqdata.id, ".$sqltblpre."faqdata.lang, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.rubrik, ".$sqltblpre."faqdata.datum, ".$sqltblpre."faqvisits.visits FROM ".$sqltblpre."faqdata LEFT JOIN ".$sqltblpre."faqvisits ON ".$sqltblpre."faqdata.id = ".$sqltblpre."faqvisits.id AND ".$sqltblpre."faqvisits.lang = ".$sqltblpre."faqdata.lang WHERE ".$sqltblpre."faqdata.active = 'yes' AND ".$sqltblpre."faqdata.rubrik = '".$category."' ORDER BY ".$sqltblpre."faqdata.id LIMIT ".$first.", 10");
Then edit this line:

Code: Select all

$output .= "<li><a href=\"".$_SERVER["PHP_SELF"]."?".$sids."aktion=artikel&rubrik=".$row->rubrik."&id=".$row->id."&lang=".$row->lang."\">".stripslashes($row->thema)."</a> [".$row->lang."]<br><div class=\"little\">(".$visits." ".$msgViews.")</div></li>";
to this:

Code: Select all

$output .= "<li><a href=\"".$_SERVER["PHP_SELF"]."?".$sids."aktion=artikel&rubrik=".$row->rubrik."&id=".$row->id."&lang=".$row->lang."\">".stripslashes($row->thema)."</a> [".$row->lang."]<br><div class=\"little\">(".$visits." ".$msgViews.") ".makeDate($row->datum)."</div></li>";
For the HTML problem:

Did you deactived the BB-Code in the configuration?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
The_ReVenger
Posts: 5
Joined: Fri Oct 10, 2003 8:10 am
Contact:

Post by The_ReVenger »

Eh nope i didn't :P. But the problem is I still want to be able to use bb-code ;) haha. Is there a way that i can solve it another way :) ?

Thanks in advance for your very good support. I understand if you can't help me further with my last question :). Thanks again !
The_ReVenger
Posts: 5
Joined: Fri Oct 10, 2003 8:10 am
Contact:

Post by The_ReVenger »

Hello again,

I tried to turn of BB-Code, but when I do that i everywhere have [quote] etc ... and I don't want that :(. I want to be able to AND use tables AND use the bb-code. So, is there any working (:P) solution for this ?

Thanks in advance !
Grtz, The_ReVenger
The_ReVenger
Posts: 5
Joined: Fri Oct 10, 2003 8:10 am
Contact:

Post by The_ReVenger »

I understand you don't have that much time but can you plz try to help me ? Thanks in advance !
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

sorry for the late answer...

Edit the file functions.php and change this function

Code: Select all

function safeHTML($html) {
	$html = stripslashes($html);
	$html = strip_tags($html, "<b><i><u><a>");
	return $html;
	}
to this:

Code: Select all

function safeHTML($html) {
	$html = stripslashes($html);
	return $html;
	}
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply