Spoiler Tag

Started by AzaToth, September 20, 2005, 11:37:42 PM

Previous topic - Next topic

AzaToth

Fixed a small bug, (a typo in a variable), not needed to upgrade, but you mig get some errors if using a custom theme

Elijah Bliss

Quote from: AzaToth on October 28, 2005, 04:57:11 AM
Quote from: Elijah Bliss on October 28, 2005, 02:39:50 AM
Quote from: AzaToth on October 26, 2005, 04:36:15 PM
Ok, a quick change, in 0.2.1, splitted the permissions so there are both for show spoilers and to post them.
Because of this you can have a group that can post spoilers, but can not show them (not my fault if you so have :)), but it's more logical that you have a group that can show spoilers but can't post new ones.

/Carl

also, if you want to prevent people from quoting spoilers:

Code (Find in Posts.php) Select

}
// Posting a reply without a quote?


Code (Add before) Select

    allowedTo('admin_forum') ? '' : $form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler]~'), '', $form_message);


already done tht I think, but admin_forum?

Administrators should be allowed to quote spoilers and other custom permission based tags.

AzaToth

Quote from: Elijah Bliss on October 28, 2005, 08:37:57 PM
Quote from: AzaToth on October 28, 2005, 04:57:11 AM
Quote from: Elijah Bliss on October 28, 2005, 02:39:50 AM
Quote from: AzaToth on October 26, 2005, 04:36:15 PM
Ok, a quick change, in 0.2.1, splitted the permissions so there are both for show spoilers and to post them.
Because of this you can have a group that can post spoilers, but can not show them (not my fault if you so have :)), but it's more logical that you have a group that can show spoilers but can't post new ones.

/Carl

also, if you want to prevent people from quoting spoilers:

Code (Find in Posts.php) Select

}
// Posting a reply without a quote?


Code (Add before) Select

    allowedTo('admin_forum') ? '' : $form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler]~'), '', $form_message);


already done tht I think, but admin_forum?

Administrators should be allowed to quote spoilers and other custom permission based tags.
The definition of allowedTo defines:
bool allowedTo(string permission, array boards = current)
- checks whether the user is allowed to do permission. (ie. post_new.)
- if boards is specified, checks those boards instead of the current
  one.
- always returns true if the user is an administrator.
- returns true if he or she can do it, false otherwise.

Or did you refere to some other admin?

Elijah Bliss

Quote from: AzaToth on October 28, 2005, 09:17:52 PM
Quote from: Elijah Bliss on October 28, 2005, 08:37:57 PM
Quote from: AzaToth on October 28, 2005, 04:57:11 AM
Quote from: Elijah Bliss on October 28, 2005, 02:39:50 AM
Quote from: AzaToth on October 26, 2005, 04:36:15 PM
Ok, a quick change, in 0.2.1, splitted the permissions so there are both for show spoilers and to post them.
Because of this you can have a group that can post spoilers, but can not show them (not my fault if you so have :)), but it's more logical that you have a group that can show spoilers but can't post new ones.

/Carl

also, if you want to prevent people from quoting spoilers:

Code (Find in Posts.php) Select

}
// Posting a reply without a quote?


Code (Add before) Select

    allowedTo('admin_forum') ? '' : $form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler]~'), '', $form_message);


already done tht I think, but admin_forum?

Administrators should be allowed to quote spoilers and other custom permission based tags.
The definition of allowedTo defines:
bool allowedTo(string permission, array boards = current)
- checks whether the user is allowed to do permission. (ie. post_new.)
- if boards is specified, checks those boards instead of the current
  one.
- always returns true if the user is an administrator.
- returns true if he or she can do it, false otherwise.

Or did you refere to some other admin?

Well my global moderators have forum administration permissions. You can always swap out allowedTo('admin_forum') to $user_info['is_admin']. 

AzaToth

Quote from: Elijah Bliss on October 28, 2005, 11:13:48 PM
Quote from: AzaToth on October 28, 2005, 09:17:52 PM
Quote from: Elijah Bliss on October 28, 2005, 08:37:57 PM
Quote from: AzaToth on October 28, 2005, 04:57:11 AM
Quote from: Elijah Bliss on October 28, 2005, 02:39:50 AM
Quote from: AzaToth on October 26, 2005, 04:36:15 PM
Ok, a quick change, in 0.2.1, splitted the permissions so there are both for show spoilers and to post them.
Because of this you can have a group that can post spoilers, but can not show them (not my fault if you so have :)), but it's more logical that you have a group that can show spoilers but can't post new ones.

/Carl

also, if you want to prevent people from quoting spoilers:

Code (Find in Posts.php) Select

}
// Posting a reply without a quote?


Code (Add before) Select

    allowedTo('admin_forum') ? '' : $form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler]~'), '', $form_message);


already done tht I think, but admin_forum?

Administrators should be allowed to quote spoilers and other custom permission based tags.
The definition of allowedTo defines:
bool allowedTo(string permission, array boards = current)
- checks whether the user is allowed to do permission. (ie. post_new.)
- if boards is specified, checks those boards instead of the current
  one.
- always returns true if the user is an administrator.
- returns true if he or she can do it, false otherwise.

Or did you refere to some other admin?

Well my global moderators have forum administration permissions. You can always swap out allowedTo('admin_forum') to $user_info['is_admin']. 
I thought doing this was enough:
if(!allowedTo('spoiler_show') || !allowedTo('spoiler_post'))
$form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler\]~'), '', $form_message);

Yamake

Eheheheh, nicely coded.  Now all you need is a [me] command to go with it! XD

Elijah Bliss

Quote from: AzaToth on October 29, 2005, 05:48:33 AM
Quote from: Elijah Bliss on October 28, 2005, 11:13:48 PM
Quote from: AzaToth on October 28, 2005, 09:17:52 PM
Quote from: Elijah Bliss on October 28, 2005, 08:37:57 PM
Quote from: AzaToth on October 28, 2005, 04:57:11 AM
Quote from: Elijah Bliss on October 28, 2005, 02:39:50 AM
Quote from: AzaToth on October 26, 2005, 04:36:15 PM
Ok, a quick change, in 0.2.1, splitted the permissions so there are both for show spoilers and to post them.
Because of this you can have a group that can post spoilers, but can not show them (not my fault if you so have :)), but it's more logical that you have a group that can show spoilers but can't post new ones.

/Carl

also, if you want to prevent people from quoting spoilers:

Code (Find in Posts.php) Select

}
// Posting a reply without a quote?


Code (Add before) Select

    allowedTo('admin_forum') ? '' : $form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler]~'), '', $form_message);


already done tht I think, but admin_forum?

Administrators should be allowed to quote spoilers and other custom permission based tags.
The definition of allowedTo defines:
bool allowedTo(string permission, array boards = current)
- checks whether the user is allowed to do permission. (ie. post_new.)
- if boards is specified, checks those boards instead of the current
  one.
- always returns true if the user is an administrator.
- returns true if he or she can do it, false otherwise.

Or did you refere to some other admin?

Well my global moderators have forum administration permissions. You can always swap out allowedTo('admin_forum') to $user_info['is_admin']. 
I thought doing this was enough:
if(!allowedTo('spoiler_show') || !allowedTo('spoiler_post'))
$form_message = preg_replace(array('~\n?\[spoiler.*?\].+?\[/spoiler\]\n?~is', '~^\n~', '~\[/spoiler\]~'), '', $form_message);


Now I remember why I used that conditional, I originally used it top the quoting of html from members who didn't have html permissions, which was everyone except global moderators.

xenovanis

I installed version 0.2.2 and got these errors in my log:

8: Undefined index: spoiler_tag_hover
File: .../testforum/Sources/Subs.php
Line: 910

8: Undefined index: spoiler_tag_click
File: .../testforum/Sources/Subs.php
Line: 901



Fix: In Subs.php

Code (find) Select

$txt['spoiler_tag_hover']


Code (replace) Select

$txt['spoiler_tag_hover_info']


Code (find) Select

$txt['spoiler_tag_click']


Code (replace) Select

$txt['spoiler_tag_click_info']


Nice mod, btw  ;)
"Insanity: doing the same thing over and over again and expecting different results."

AzaToth

Quote from: xenovanis on November 05, 2005, 06:05:09 AM
I installed version 0.2.2 and got these errors in my log:

8: Undefined index: spoiler_tag_hover
File: .../testforum/Sources/Subs.php
Line: 910

8: Undefined index: spoiler_tag_click
File: .../testforum/Sources/Subs.php
Line: 901



Fix: In Subs.php

Code (find) Select

$txt['spoiler_tag_hover']


Code (replace) Select

$txt['spoiler_tag_hover_info']


Code (find) Select

$txt['spoiler_tag_click']


Code (replace) Select

$txt['spoiler_tag_click_info']


Nice mod, btw  ;)

Strange, I thought I had fix that for 0.2.2 (found it in 0.2.1), must check it if I used right files....

xtremecruiser

#69
I just DL the latest one and also get

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

The Hoover is fine

I also do not have the classic theme ( many dont ) and it looks for it in the install.

AzaToth

Quote from: xtremecruiser on November 06, 2005, 12:05:54 PM
I just DL the latest one and also get

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

The Hoover is fine

I also do not have the classic theme ( many dont ) and it looks for it in the install.
Classic theme is installed by default, thats why I made it for it, but if you say is true that many remove the classic, I can easly add check for it.

xtremecruiser

Quote from: AzaToth on November 06, 2005, 03:23:17 PM
Quote from: xtremecruiser on November 06, 2005, 12:05:54 PM
I just DL the latest one and also get

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

The Hoover is fine

I also do not have the classic theme ( many dont ) and it looks for it in the install.
Classic theme is installed by default, thats why I made it for it, but if you say is true that many remove the classic, I can easly add check for it.

Is that why I get the
Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

errors ?  Or is there another fix ?

AzaToth

Quote from: xtremecruiser on November 06, 2005, 03:26:39 PM
Quote from: AzaToth on November 06, 2005, 03:23:17 PM
Quote from: xtremecruiser on November 06, 2005, 12:05:54 PM
I just DL the latest one and also get

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

The Hoover is fine

I also do not have the classic theme ( many dont ) and it looks for it in the install.
Classic theme is installed by default, thats why I made it for it, but if you say is true that many remove the classic, I can easly add check for it.

Is that why I get the
Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

errors ?  Or is there another fix ?
No, that I now fixed in 0.2.3, I forgot to add _info to a few indexes.

xtremecruiser

#73
Quote from: AzaToth on November 06, 2005, 03:29:25 PM
Quote from: xtremecruiser on November 06, 2005, 03:26:39 PM
Quote from: AzaToth on November 06, 2005, 03:23:17 PM
Quote from: xtremecruiser on November 06, 2005, 12:05:54 PM
I just DL the latest one and also get

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

The Hoover is fine

I also do not have the classic theme ( many dont ) and it looks for it in the install.
Classic theme is installed by default, thats why I made it for it, but if you say is true that many remove the classic, I can easly add check for it.

Is that why I get the
Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 892

Undefined index: spoiler_tag_click in /XXX/Sources/Subs.php on line 901

errors ?  Or is there another fix ?
No, that I now fixed in 0.2.3, I forgot to add _info to a few indexes.
Installed and works fine.
Thanks

xtremecruiser

#74
Hum, just installed on my main site and the spoiler only shows for the admins ?
RC1.1
No my default theme is a different one than normal one.

ERR set the permissions for each profile and they still can not see it  :'(

Gave every groups acess to it, even the guests. Only the admins can see it.

if a regular member tries to quote the post they get nothing instead of the

[spoiler]boo[/spoiler]
OMG I found the issue.
I have local permissions on some boards to keep the "lower" membergroup from posting in them >:(
Its gonna be a long afternoon redoing this :'(

AzaToth

Quote from: xtremecruiser on November 08, 2005, 10:45:04 AM
Hum, just installed on my main site and the spoiler only shows for the admins ?
RC1.1
No my default theme is a different one than normal one.

ERR set the permissions for each profile and they still can not see it  :'(

Gave every groups acess to it, even the guests. Only the admins can see it.

if a regular member tries to quote the post they get nothing instead of the

[spoiler]boo[/spoiler]
OMG I found the issue.
I have local permissions on some boards to keep the "lower" membergroup from posting in them >:(
Its gonna be a long afternoon redoing this :'(
hehe, hope you fix it :) the mod uses allowedTo() to check if the member (membergroup) is allowed to post OR show spoiler (not XOR), if this is somewhat confusing, please tell me so :)

xtremecruiser

Quote from: AzaToth on November 08, 2005, 01:16:13 PM
Quote from: xtremecruiser on November 08, 2005, 10:45:04 AM
Hum, just installed on my main site and the spoiler only shows for the admins ?
RC1.1
No my default theme is a different one than normal one.

ERR set the permissions for each profile and they still can not see it  :'(

Gave every groups access to it, even the guests. Only the admins can see it.

if a regular member tries to quote the post they get nothing instead of the

[spoiler]boo[/spoiler]
OMG I found the issue.
I have local permissions on some boards to keep the "lower" membergroup from posting in them >:(
Its gonna be a long afternoon redoing this :'(
hehe, hope you fix it :) the mod uses allowedTo() to check if the member (membergroup) is allowed to post OR show spoiler (not XOR), if this is somewhat confusing, please tell me so :)

I have it now, I just use local permissions on some boards so changing the members permissions does nothing to effect access, I have to do each one :-X

Ben_S

Thanks, one of the very few mods I have installed.
Liverpool FC Forum with 14 million+ posts.

Hawkes

Great mod!  I have it installed with 1.1 RC1 and the Helios Multi mod.  I had some editing to do, but all-in-all it works great.

One suggestion, ability to modify the colors of the spolier box.... both background and text without having to customize the .css sheet.

-Hawkes

Omar Bazavilvazo

Thanks...

AMAZING job... Just what I needed...

This is 1 of the 2 mods installed in my forum :)

Gracias!




Personal Signature:
HablaJapones
http://hablajapones.org
http://hablajapones.org/tutoriales.php


NO me manden PM para soporte o dudas
...Leo los foros como todos...

Advertisement: