• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior AAC] FAQ Script

Archez

'
Senator
Joined
Jun 26, 2008
Messages
6,589
Solutions
1
Reaction score
70
Location
Mexico
Add this to your config.php file.
PHP:
// Server FAQ, credits: Archez and elf.
$config['site']['faq'] = array(
'What if I see there are power abusers?' => 'You should always report these people.',
'What if someone is advertising in the server?' => 'You report that player to our gamemasters.'
); // 'question' => 'answer',

Create a new topic for this in your index.php file.
PHP:
 	case "faq";
  	        $topic = "F.A.Q.";
 	        $subtopic = "faq";
 	        include("faq.php");
	break;

Create a new file called faq.php in your WWW.
PHP:
<?php
$main_content .= '<script type="text/javascript"><!--
function show_hide(flip)
{
	var tmp = document.getElementById(flip);
	if(tmp)
		tmp.style.display = tmp.style.display == \'none\' ? \'\' : \'none\';
}
--></script>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
	<tr bgcolor=' . $config['site']['vdarkborder'] . '>
		<td>
			<b>' . $config['site']['worlds']['0'] . '\'s FAQ</b>
		</td>
</tr>';

$i = 0;
foreach($config['site']['faq'] as $q => $a)
{
	$i++;
	$main_content .= '
	<tr bgcolor="' . (is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . '">
		<td style="cursor: pointer;" onclick="show_hide(\'faq_' . $i . '\'); return false;">
			' . $q . '<div id="faq_' . $i . '" style="display: none;"> <b>' . $a . '</b></div>
		</td>
	</tr>';
}

$main_content .= '
</table>';
?>

Download: faq.php for dummies.

Enjoy. :peace:
 
Last edited:
Is this not basically exactly the same as your other script "Commands List" except changed to FAQ?
 
Thanks Archez!
BTW! here you go Winnerandy :p
ztgh2d.jpg



 
Is this not basically exactly the same as your other script "Commands List" except changed to FAQ?

ye ;p

I'll look for some Java tutorials, and I'll rewrite the scripts that must be rewritten.
 

noob, 3 lines of normal js.

Code:
<?php
$main_content .= '<script type="text/javascript"><!--
function show_hide(flip)
{
	var tmp = document.getElementById(flip);
	if(tmp)
		tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
--></script>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
	<tr bgcolor=' . $config['site']['vdarkborder'] . '>
		<td>
			<b>' . $config['site']['worlds']['0'] . '\'s FAQ</b>
		</td>
</tr>';

$i = 0;
foreach($config['site']['faq'] as $q => $a)
{
	$i++;
	$main_content .= '
	<tr bgcolor="' . (is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . '">
		<td style="cursor: pointer;" onclick="show_hide(\'faq_' . $i . '\'); return false;">
			' . $q . '<div id="faq_' . $i . '" style="display: none;"> <b>' . $a . '</b></div>
		</td>
	</tr>';
}

$main_content .= '
</table>';
?>
 
Last edited:
Changed first post, added new credits and script by elf.

UPDATE YOUR SCRIPT, if you want it to be cool.

By the way, thanks elf. ;)
 
Ive been having my ot for almost a month and practicly everything "i" did somone else did. whit other words; IM VERY SLOW, so speak so i can understand

Now to the question.

I dont get it! can you explain everything to me? What everything effects and how it effects it? And what do you meen with "put it in you www"?

Ty, Krilleboy

PS: dont get fooled by my age. Im not imuture.
 
It's cool I like it, but change this :p
PHP:
<b class="white">' . $config['site']['worlds']['0'] . '\'s FAQ</b>
 
noob, 3 lines of normal js.

Code:
<?php
$main_content .= '<script type="text/javascript"><!--
function show_hide(flip)
{
	var tmp = document.getElementById(flip);
	if(tmp)
		tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
--></script>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
	<tr bgcolor=' . $config['site']['vdarkborder'] . '>
		<td>
			<b>' . $config['site']['worlds']['0'] . '\'s FAQ</b>
		</td>
</tr>';

$i = 0;
foreach($config['site']['faq'] as $q => $a)
{
	$i++;
	$main_content .= '
	<tr bgcolor="' . (is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . '">
		<td style="cursor: pointer;" onclick="show_hide(\'faq_' . $i . '\'); return false;">
			' . $q . '<div id="faq_' . $i . '" style="display: none;"> <b>' . $a . '</b></div>
		</td>
	</tr>';
}

$main_content .= '
</table>';
?>
I meant, with effects slowly.
 
Ive been having my ot for almost a month and practicly everything "i" did somone else did. whit other words; IM VERY SLOW, so speak so i can understand

Now to the question.

I dont get it! can you explain everything to me? What everything effects and how it effects it? And what do you meen with "put it in you www"?

Ty, Krilleboy

PS: dont get fooled by my age. Im not imuture.

The www folder exists in Linux, but is called htdocs on Windows (if you are running xampp [?]), so just download the script and paste it in your htdocs, and follow the other steps.

It's cool I like it, but change this :p
PHP:
<b class="white">' . $config['site']['worlds']['0'] . '\'s FAQ</b>

Hehe, sorry. I don't have that class, as you can see.
 
The www folder exists in Linux, but is called htdocs on Windows (if you are running xampp [?]), so just download the script and paste it in your htdocs, and follow the other steps.



Hehe, sorry. I don't have that class, as you can see.

Ok, but how do i get it wisible on the website? Or does it go to the website?
 
Back
Top