UBB.Dev
Posted By: JoshPet [6.2] Board Rules 1.2 - 02/11/2003 9:02 AM
Mod Name: Board Rules 1.2
  1.1 is bugfixes and better support for tablewrappers
  1.2 adds a Template (thanks Omegatron) and fixes issues on certain servers. Also gives instructions so that the Who's Online page will show "Viewing the Rules".

Description: This produces a standard threads page to disply your Board Rules. Instructions are included to add the "Rules" link to your footer.

Author: JoshPet & Omegatron
        For discussion and bug reports go to www.ubbdev.com

Credits: Dalantech for table wrapper fixes and Omegatron for bug fixes.

Date: 2/11/03

Working Under: 6.2

Files Modified: ubbt_footer.tmpl, languages/english/generic.php

New Files: showrules.php

Database Modifications: None

Notes: Edit the rules from the Admin menu. You may wish to use simple HTML like <br /> for linebreaks, so that your rules appear best.


Attached File
68343-BoardRules1.2.zip  (81 downloads)
Posted By: jluerken Re: [6.2] Board Rules 1.0 - 02/11/2003 12:21 PM
Hi Josh,

I tried to include it but got the following error usind the Board Rules link:
Parse error: parse error in /abspath/ubbthreads/showrules.php on line 71

Any idea?
Posted By: dimopoulos Re: [6.2] Board Rules 1.0 - 02/11/2003 11:48 PM
Nice one Josh.

It worked like a charm. I think that Rick has to consider this as a permanent feature in the next release.
Posted By: Dalantech Re: [6.2] Board Rules 1.0 - 02/12/2003 12:54 AM
It looks good on my site
Posted By: AKD96 Re: [6.2] Board Rules 1.0 - 02/12/2003 2:21 AM
I just installed it. Easy hack, and really handy so users can be reminded of how to behave.
Posted By: omegatron Re: [6.2] Board Rules 1.0 - 02/12/2003 3:37 AM
[]Hi Josh,

I tried to include it but got the following error usind the Board Rules link:
Parse error: parse error in /abspath/ubbthreads/showrules.php on line 71

Any idea?
[/]

I get the same thing. The reason being is showrules.php has the ending ?> missing in the distribution file. However seems there are more errors than that
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 4:24 AM
OK -
Updated the zip to version 1.1

I don't know what happened... but it appears I someone had the wrong version of the showrules.php that I was using.

I think I need sleep. Somehow I had an old version on my HD and the working version on measurection.

Thanks to Dalantech for some tablewrapper tweaks and Omegatron for bugfixes.

This should work this time.

Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 4:37 AM
OK - wait.

For some reason this still doesn't work right on some boards.

I'm not sure why... it seems to poop on the part where it reads the "rules" file.

I took this bit from the newuser script, so I'm not sure what might be wrong with it.
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 4:47 AM
He he.. nevermind.

I reuploaded the file on the server it wasn't working on and now it works.



Let me know if there are any more issues.
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 5:00 AM
OK - this doesn't seem to like some servers.

Could one of the Dave's or someone really PHP saavy take a look at this for me?

The latest version seems to choke on line 64 I think...

I took this code from the newuser.php but I don't fully understand it.

Although it works fine for some.

<shrug>
Posted By: omegatron Re: [6.2] Board Rules 1.0 - 02/12/2003 5:04 AM
Okay I am one of the guys whose server it chokes on LOL Anyway here is the templated version I did up that seems to work fine for me.

Edit: Worked Omegatron's template into the final version... attached to the main post.
Thanks.
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 5:16 AM
If anyone has trouble with mine.. please see if Omegatron's fixes it. It should be templated anyway.

As soon as we see that it works for everyone... I'll update the main post with Omegatron's templates... as that's the right way to do it.

Good work Omegatron!

Thank you!
Posted By: smilesforu Re: [6.2] Board Rules 1.0 - 02/12/2003 5:19 AM
Josh It looks like its calling for boardrules.php mine is called showrules.php ? Did you use a different name?

Anyway going to try chucks now..
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 5:22 AM
boardrules.php is the file in the includes directory where the rules are stored. It's basically a text file, editable from the admin section.

That shouldn't be the issue. But I'm puzzled. Maybe Omegatron fixed it. <hope hope hope>
Posted By: smilesforu Re: [6.2] Board Rules 1.0 - 02/12/2003 5:37 AM
yes his works like a charm ... good work guys, THANKS
Posted By: jluerken Re: [6.2] Board Rules 1.0 - 02/12/2003 10:20 AM
I updated to version 1.1 and still getting an error

Parse error: parse error in /abspath/ubbthreads/showrules.php on line 65

line 63> $boardrules .= <<<EOF
line 64> </td>
line 64> </tr>

The old parser error I got was also near
$boardrules .= <<<EOF

You can see a demo here ;D
http://www.clanforums.com/ubbthreads/showrules.php?Cat=
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 10:23 AM
Do me a favor... try omegatron's version here and let me know if that fixes it.

If it does, I'll update the main zip.

His additions are better... and more standardized as it adds a template.
Posted By: jluerken Re: [6.2] Board Rules 1.0 - 02/12/2003 10:49 AM
omegatron's solution is working fine for me
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 02/12/2003 10:51 AM
Great!

Three cheers for omegatron!
Posted By: JoshPet Re: [6.2] Board Rules 1.2 - 02/12/2003 11:21 AM
Updated the main post to Included Omegatron's template, plus support for the who's online page.

Thanks.
Posted By: AKD96 Re: [6.2] Board Rules 1.2 - 02/12/2003 7:42 PM
I've updated it on my board and it's still working great. Thanks again Josh!
Posted By: jluerken Re: [6.2] Board Rules 1.2 - 02/16/2003 5:01 AM
The template has a small failure, its looking strange if you're board has different width and cellspacing/cellpadding values.

To correct this take this template:

----
<?
echo <<<template
$tbopen

<tr>
<td class="tdheader">
Board Rules
</td>
</tr>
$tbclose

$tbopen
<tr>
<td class="lighttable">
template;
$rules = @file("{$config['path']}/includes/boardrules.php");
if (!is_array($rules)) {
$rules = @file("{config['phpurl']}/includes/boardrules.php");
}
if ($rules) {
while(list($linenum,$line) = each($rules)) {
$boardrules .= $line;
}
}
echo $boardrules;
echo <<<template
</td>
</tr>
$tbclose

<br /><br />
template;
?>


------
Don't know why the original was looking so strange but after comparing it with the viewprivacy.tmpl the above lines came out and are working...

To see the difference I have an example for you:
WRONG (The contact us form has not the right size. Within this example its only a few pixels but this may depend on your theme settings)

RIGHT (The Boardrules have the correct width everytime, no matter what you put in your settings it will fit)

Check it out, I will fix this in the Examples within the next days
Posted By: ehm Re: [6.2] Board Rules 1.2 - 02/16/2003 7:17 AM
Thank you Josh
Works great
Posted By: JoshPet Re: [6.2] Board Rules 1.0 - 08/02/2003 10:16 PM
This works under 6.3 as well - I reposted in our main modification forum here.
© UBB.Developers