Jump to content


- - - - -

IP.Board 2.3: Collapsible forum rules


  • Please log in to reply
13 replies to this topic

#1 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 13 August 2008 - 01:44 AM

This is the support topic for the tutorial Collapsible forum rules.  Please post here if you have any questions or feedback.

#2 herbivore

herbivore

    Coder

  • Members
  • PipPipPipPipPip
  • 117 posts
  • Real Name:Vin
  • IPB Version:v2.3.x
Contributor

Posted 13 August 2008 - 02:32 AM

Thanks for the tut! It very useful. ;)

However it doesn't remember your preferences. =/ So you need to change the PHP code you add to this:

//-----------------------------------------
// Collapsible forum rules
// by m4rtin @ InvisionModding.com
//-----------------------------------------

$cids = ','.$this->my_getcookie('collapseprefs').',';

$rules['fo'] = 'show';
$rules['fc'] = 'none';

if ( strstr( $cids, ",rules_".$forum['id']."," ) ) {
	$rules['fo'] = 'none';
	$rules['fc'] = 'show';
}
				
$rules['f_id'] = $forum['id'];

Thanks again for the great tut. It works!

Edited by herbivore, 13 August 2008 - 02:35 AM.

Posted Image
Over 1500 2000 members and growing.
Modifying modifications. Look! Some Tutorials.

Get the FREE Downloads Script and help it grow.

#3 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 13 August 2008 - 02:37 AM

Just a lack of a comma there. Tutorial updated.

And using '. $var .' is so ugly :) "{$var}" is so much better looking ;)

#4 herbivore

herbivore

    Coder

  • Members
  • PipPipPipPipPip
  • 117 posts
  • Real Name:Vin
  • IPB Version:v2.3.x
Contributor

Posted 13 August 2008 - 02:38 AM

View Postm4rtin, on Aug 13 2008, 10:37 AM, said:

Just a lack of a comma there. Tutorial updated.

And using '. $var .' is so ugly :) "{$var}" is so much better looking ;)
I like ugly PHP! :)

Thanks for the update.
Posted Image
Over 1500 2000 members and growing.
Modifying modifications. Look! Some Tutorials.

Get the FREE Downloads Script and help it grow.

#5 Tom

Tom

    Posting God

  • IM Supporters
  • PipPipPipPipPipPipPipPipPip
  • 1,541 posts
  • IPB Version:v2.3.x

Posted 13 August 2008 - 11:21 AM

Great! Thank's m4rtin and herbivore.

#6 OuttaHere

OuttaHere

    Post-aholic

  • Members
  • PipPipPipPipPipPipPip
  • 504 posts
  • IPB Version:N/A

Posted 13 August 2008 - 12:08 PM

I get this ...


Parse error: syntax error, unexpected '(', expecting '}' in /home/.patachou/********/********.com/sources/ipsclass.php on line 3474



This is line 3474 ...


                $cids = ",{$this->my_getcookie( 'collapseprefs' )},";



When I take off the edit it works again.


Also, as I mentioned in my original thread, 'borderwrap' doesn't work in Forum Rules unless you only use text. If you add an image, or a table, etc., it stuffs up. I get over this by substituting 'borderwrap' with 'row1'.

That was why I re-wrote the template bit in the first place.

Edited by SergeantSkinner, 13 August 2008 - 12:24 PM.


#7 OuttaHere

OuttaHere

    Post-aholic

  • Members
  • PipPipPipPipPipPipPip
  • 504 posts
  • IPB Version:N/A

Posted 13 August 2008 - 12:23 PM

When I use the code in Post 2 it works.

#8 herbivore

herbivore

    Coder

  • Members
  • PipPipPipPipPip
  • 117 posts
  • Real Name:Vin
  • IPB Version:v2.3.x
Contributor

Posted 13 August 2008 - 12:28 PM

View PostSergeantSkinner, on Aug 13 2008, 08:23 PM, said:

When I use the code in Post 2 it works.
So the collapsible part is working... thats good. ;)

Do you still have trouble with the borderwarp thingy?

Could you give a screenie of what you mean? Or did you manage to get what you wanted?
Posted Image
Over 1500 2000 members and growing.
Modifying modifications. Look! Some Tutorials.

Get the FREE Downloads Script and help it grow.

#9 OuttaHere

OuttaHere

    Post-aholic

  • Members
  • PipPipPipPipPipPipPip
  • 504 posts
  • IPB Version:N/A

Posted 13 August 2008 - 12:52 PM

If you use 'borderwrap', and add an image, etc., you get the text in a box, (borderwrap), and the image underneath, with no border around the rules.

So I substitute class="borderwrap' with class='row1'

I then add image borders.

Posted Image

#10 herbivore

herbivore

    Coder

  • Members
  • PipPipPipPipPip
  • 117 posts
  • Real Name:Vin
  • IPB Version:v2.3.x
Contributor

Posted 13 August 2008 - 12:53 PM

Well I wonder why borderwrap does that...

Oh well, at least its working perfectly for you now, right?
Posted Image
Over 1500 2000 members and growing.
Modifying modifications. Look! Some Tutorials.

Get the FREE Downloads Script and help it grow.

#11 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 13 August 2008 - 02:44 PM

View PostSergeantSkinner, on Aug 13 2008, 02:08 PM, said:

I get this ...


Parse error: syntax error, unexpected '(', expecting '}' in /home/.patachou/********/********.com/sources/ipsclass.php on line 3474



This is line 3474 ...


                $cids = ",{$this->my_getcookie( 'collapseprefs' )},";



When I take off the edit it works again.


Also, as I mentioned in my original thread, 'borderwrap' doesn't work in Forum Rules unless you only use text. If you add an image, or a table, etc., it stuffs up. I get over this by substituting 'borderwrap' with 'row1'.

That was why I re-wrote the template bit in the first place.
I updeted the code. Should work fine now ;)

Doesn't the default template use borderwrap? In that case you should have that problem even with out making the changes.

#12 OuttaHere

OuttaHere

    Post-aholic

  • Members
  • PipPipPipPipPipPipPip
  • 504 posts
  • IPB Version:N/A

Posted 13 August 2008 - 02:52 PM

That's right, borderwrap has never worked, except for text only.

#13 FunInAustralia

FunInAustralia

    Member

  • Members
  • PipPipPip
  • 20 posts
  • Location:Brusbane, Australia
  • Real Name:Mark
  • IPB Version:v2.3.x

Posted 10 December 2008 - 10:25 AM

I have the following code for one of my custom skins:
<!-- Show FAQ/Forum Rules -->


<div class="catheadmid"><div class="catheadleft"><div class="catheadright"><div class="catheadtext">
<center>
{$rules['title']}
</center>
</div></div></div></div>

<div class="borderwrap8" style="clear: left;">
<div class="row6"><div class="row7">
{$rules['body']}>
</div></div></div>
<div class="catend">&nbsp;</div>
<div class="catfoot"><div class="catfoot_left"><div class="catfoot_right"></div></div></div>
<br /><br /><br /><br />


<!-- End FAQ/Forum Rules -->
Can you please tell me what changes I need to make for this as its already been edited, thankyou ;)

#14 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 10 December 2008 - 11:05 AM

Try this, but it may not look good at all. Hard to do these kinds of changes on a custom skin, especially when you can't physically see it.

<!-- Show FAQ/Forum Rules -->


<div style="display: {$rules['fc']};" id="fc_rules_{$rules['f_id']}">
	<div class="catheadmid">
		<div class="catheadleft">
			<div class="catheadright">
				<div class="catheadtext">
					<p class="expand"><a href="java script:togglecategory('rules_{$rules['f_id']}', 0);"><{E_PLUS}></a></p>
					<center>
						{$rules['title']}
					</center>
				</div>
			</div>
		</div>
	</div>
</div>

<div style="display: {$rules['fo']};" id="fo_rules_{$rules['f_id']}">
	<div class="catheadmid">
		<div class="catheadleft">
			<div class="catheadright">
				<div class="catheadtext">
					<p class="expand"><a href="java script:togglecategory('rules_{$rules['f_id']}', 1);"><{E_MINUS}></a></p>
					<center>
						{$rules['title']}
					</center>
				</div>
			</div>
		</div>
	</div>
	<div class="borderwrap8" style="clear: left;">
		<div class="row6">
			<div class="row7">
				{$rules['body']}>
			</div>
		</div>
	</div>
	<div class="catend">&nbsp;</div>
	<div class="catfoot"><div class="catfoot_left"><div class="catfoot_right"></div></div></div>
</div>


<br /><br /><br /><br />


<!-- End FAQ/Forum Rules -->





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users