[2.0.19] Don't Spoil It!

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
10
67%
Very Good
2
13%
Good
2
13%
Fair
0
No votes
Poor
1
7%
 
Total votes: 15

darklordsatan
Registered User
Posts: 164
Joined: Sat Oct 15, 2005 3:04 am
Location: Cali - Colombia

Post by darklordsatan » Tue Feb 14, 2006 10:02 pm

dirTdogE wrote: oh! this is EXACTLY what i want!

but i get it cant find these lines in bbcode.php:

$EMBB_widths = array('') ;
$EMBB_values = array('') ;


I had the same problem when i tried to install another spoiler mod.. i dont understand why, i just uploaded the original bbcode.php and those lines just arent there

:?:

From the MOD itself
## IMPORTANT: you MUST first have already installed the Multi BBCode MOD
## available at http://www.phpbb.com/phpBB/viewtopic.php?t=145513

So, is it installed? :P
And if you have installed that mod already, then other bbcode mod(s), you should try a partial find (not the whole thing, just a part of the first line)
Like this for example

Code: Select all

$EMBB_widths = array('
niksa wrote: edit: oh! I just noticed... when I do a search for something and a post comes up with a spoiler tag, the contents show in the search post field. Is there any way to make it not shown in the search results (the contents)? I guess this happens because, apparently.. in search results, it doesn't show bbcodes. Hmm.. I'm going to see if I can find a mod that will fix this.. if I do, I'll post.. because it's silly to have the spoilers covered up everywhere & then visible in the search results. :(

Ok, lets think about it for a second.
The search function takes a criteria, performs a query, and returns a result set that matches the criteria.
The "best" possible way not to include spoilers in the search results, would be to modify the whole query set spread all over search.php, so that they exclude any single post where you find search keywords inside a spoiler tag.
This is
  • Unfair sometimes: Example; What if a post contains the word 'ocelot' in both the "normal" text and a spoiler tag? Then it shouldnt be included in the results as per the reasoning above.
  • Possibly slow: While Im supossing there is someway to do this by means of regular expressions (is there any other way?) in SQL, it's just not worthy IMHO, to add an extra load to each query just to remove the spoilers from the results.
So in the end, this is not a viable choice.
___________________________________________________________________________________

The "second best" one, would be to double check the search results set, following the exact reasoning exposed above, only that this time, applied to the result string themselves, and not the queries.
I didnt thought I could figure this one out, but I did, so here it is :P

OPEN search.php

FIND

Code: Select all

			$searchset[] = $row;

REPLACE WITH

Code: Select all

			$tmp_text = preg_replace("/\[spoiler:".$row['bbcode_uid']."\](.*?)$search(.*?)\[\/spoiler:".$row['bbcode_uid']."\]/s", '', $row['post_text'], 1);

			if(strcmp($row['post_text'], $tmp_text) == 0)
			{				
				$searchset[] = $row;
			}
			else
			{
				$total_match_count--;
			}
So in this case, if a keyword is contained inside a spoiler tag, that post wont be shown AT ALL in the search results. Notice the regular expression over there is not meant to be perfect, so I guess all the search gotchas apply. I.e, this is not perfect.
___________________________________________________________________________________

The final solution, is the "quick and dirty" that is actually the first one I came up with, but I guess the one above sends this straight to the garbage can.

OPEN search.php

FIND

Code: Select all

					$bbcode_uid = $searchset[$i]['bbcode_uid'];
AFTER, ADD

Code: Select all

					$message = preg_replace("/\[spoiler:$bbcode_uid\](.*?)\[\/spoiler:$bbcode_uid\]/s", '--THIS IS A SPOILER--', $message);
Or you can change the last code to

Code: Select all

					$message = preg_replace("/\[spoiler:$bbcode_uid\](.*?)\[\/spoiler:$bbcode_uid\]/s", '', $message);
In that case, the "--THIS IS A SPOILER--" messsage wont show up in the search results (but at some extenct it would be weird to have a search result that doesnt -apparently- match your criteria, when in the search by posts option is used)

Now, there is a second "quick and dirty" solution, and it is, to show the spoiler tag, just like its shown on the topic view. However, I dont really know how to do this ONLY for the spoiler bbcode, but for the whole bbcode set (aka, all bbcodes will be shown on the search result, e.g Hello is shown as Hello). So, Im not sure the phpbb team feel comfortable with this option, because I've only seen one mod do this, and its not an official one :wink:

Anyway, here it is

OPEN search.php

FIND

Code: Select all

					if ( $return_chars != -1 )
REPLACE WITH

Code: Select all

					if ( $return_chars == -1 )
So well, you tell me :)

DennyCrane
Registered User
Posts: 86
Joined: Mon Oct 17, 2005 3:47 am

Post by DennyCrane » Wed Feb 15, 2006 3:01 am

has anyone got this to work with the athena style? i got it working with subsilver and daj_glass, but i cant seem to get the overall_header file right.

it doesn't have "</style>, but i put the "stuff" in just above "<!-- BEGIN switch_enable_pm_popup -->" which is where it is in the other files

its under "/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("{T_TEMPLATE_PATH}/formIE.css");
-->" which is the same in the other files, save the "</style>"


it has this error:
Parse error: syntax error, unexpected $end in /home/dawg/public_html/includes/template.php(127) : eval()'d code on line 259

darklordsatan
Registered User
Posts: 164
Joined: Sat Oct 15, 2005 3:04 am
Location: Cali - Colombia

Post by darklordsatan » Fri Feb 17, 2006 7:17 pm

niksa wrote: Is there any way to add a background image in the bbcode.tpl part?
Something like: background-image: url(images/background.jpg); is what I would normally do, but it's not working. Should I try something else?

Weirdo. Perhaps you are not having in account one thing: templates are meant to be parsed on runtime (some "template variables" are replaced by new code and the like), so relative paths, are, to the phpBB root (e.g www.server.com/forum), not where the template file is located...

I made this test, and it should work flawlessly with subSilver, since Im using "default" images :D

Code: Select all

<!-- BEGIN spoiler_open -->
<div onClick="unveil_spoiler('{SPOILER_ID}')" style="background-image: url(templates/subSilver/images/cellpic2.jpg); padding: 5px; background-color: #DEE3E7; border: 2px #006699 solid; font-weight: bold; font-size: 10px;"><b>{L_SPOILER}</b></div>
<div style="background-image: url(images/smiles/icon_cool.gif); padding: 5px; background-color: #FAFCFE; border: 1px #000000 solid; display: none;" id="{SPOILER_ID}">
<!-- END spoiler_open -->
<!-- BEGIN spoiler_close -->
</div>
<!-- END spoiler_close -->
Cheers

new_to_phpbb
Registered User
Posts: 47
Joined: Sun Jan 01, 2006 8:55 am

good one

Post by new_to_phpbb » Mon Feb 20, 2006 12:02 pm

HI
darklordsatan

Cool man

I am looking BBcode like this. This is the best one in all.

Some suggestions

Is it possible to make this bbcode useable for only admin and moderators.

darklordsatan
Registered User
Posts: 164
Joined: Sat Oct 15, 2005 3:04 am
Location: Cali - Colombia

Re: good one

Post by darklordsatan » Thu Feb 23, 2006 3:55 pm

new_to_phpbb wrote: Some suggestions

Is it possible to make this bbcode useable for only admin and moderators.

It should be. Dont know if I can access the "permissions" structure from within the files I should make the check into, but I guess its possible.
Ill look into it.

new_to_phpbb
Registered User
Posts: 47
Joined: Sun Jan 01, 2006 8:55 am

Re: good one

Post by new_to_phpbb » Thu Feb 23, 2006 6:39 pm

darklordsatan wrote:
new_to_phpbb wrote: Some suggestions

Is it possible to make this bbcode useable for only admin and moderators.

It should be. Dont know if I can access the "permissions" structure from within the files I should make the check into, but I guess its possible.
Ill look into it.


One more suggestion how about turning this mod to accept terms

Like Placing 2 buttons below the hiden content, in that one Accept terms and another one Not Accept.
When the user click on Accept terms, then hidden content should display, else it should redirect to forum index.

Terms can place some where around the hidden content. Like this admins can make sure that all users should follow the terms of forum

zensuke
Registered User
Posts: 32
Joined: Fri Feb 10, 2006 8:10 pm

Post by zensuke » Tue Feb 28, 2006 7:42 am

the style of my template is in a archive.css (not overall_header)so i put the

Code: Select all

<!-- /* Start Don't Spoil It! Mod */ //-->
<script language="JavaScript">
<!--
function unveil_spoiler(id)
{
	element = document.getElementById(id);
	if (element.style.display == 'none')
	{
		element.style.display = '';
	}
	else
	{
		element.style.display = 'none';
	}
}
//-->
</script>
<!-- /* End Don't Spoil It! Mod */ //-->
there, and all appear ok.. i tried the tag and the blue box appear but oh hell, i cant open that :( in IE it told me a error about "unexpected thing"

DennyCrane
Registered User
Posts: 86
Joined: Mon Oct 17, 2005 3:47 am

Post by DennyCrane » Tue Mar 07, 2006 8:12 am

fyi the spoiler doesnt work in topic review

or is it just me :lol:

Mephistox
Registered User
Posts: 96
Joined: Sat Oct 29, 2005 3:12 am
Location: NY
Contact:

Post by Mephistox » Sat Apr 29, 2006 4:21 am

The thing isn't working for me.
It won't open when I click.

http://oftheshrub.org/forums/phpbb2/vie ... php?t=5691

Can anyone help me?

darklordsatan
Registered User
Posts: 164
Joined: Sat Oct 15, 2005 3:04 am
Location: Cali - Colombia

Post by darklordsatan » Sun Apr 30, 2006 2:49 pm

Mephistox wrote: The thing isn't working for me.
It won't open when I click.

http://oftheshrub.org/forums/phpbb2/vie ... php?t=5691

Can anyone help me?

Of course it wont open.
You havent added the required Javascript code

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

...
You're missing that part of the installation! I just downloaded the page you linked to my HD, added the javascript code, and voila.

RedWolves
Registered User
Posts: 7
Joined: Wed Feb 08, 2006 5:26 pm
Contact:

Post by RedWolves » Thu May 04, 2006 3:10 pm

In line 201 of the .mod

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
</style>
You need to change style to script. It's obvious to us that know what their do ing but to those who don't won't find style and might skip that step. It seems to have happened already in this thread.

Also it would be great if there could be a disclaimer in the first post about needing Multi BBCode MOD. Just a time saver to know that up front before downloading and trying to find the fist line in BBCode.php.

darklordsatan
Registered User
Posts: 164
Joined: Sat Oct 15, 2005 3:04 am
Location: Cali - Colombia

Post by darklordsatan » Thu May 04, 2006 5:02 pm

RedWolves wrote: In line 201 of the .mod

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
</style>
You need to change style to script. It's obvious to us that know what their do ing but to those who don't won't find style and might skip that step. It seems to have happened already in this thread.

Ill check it out.
RedWolves wrote: Also it would be great if there could be a disclaimer in the first post about needing Multi BBCode MOD. Just a time saver to know that up front before downloading and trying to find the fist line in BBCode.php.

The disclaimer is in the MOD script, so...
## IMPORTANT: you MUST first have already installed the Multi BBCode MOD
## available at http://www.phpbb.com/phpBB/viewtopic.php?t=145513

Rivo
Registered User
Posts: 6
Joined: Thu Jun 08, 2006 2:19 pm

Post by Rivo » Sat Jun 17, 2006 6:59 pm

Hi,
at first for me this is a great mod and it works fine on my forum, but i wanted to add spoiler tag to my quick replay and i've got some problems.

So i instal on my forum complete quick replay mod and don't spoil it mod.
I wanted add a spoiler tag but i dont now how to write a line like this:

Code: Select all

<td width="33%"><input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 50px" onclick="bbstyle(14)" /></td>
this is a line for 'Img' in quick_replay.tpl and i wanted do the same for spoiler but i dont now what is the 'name' , 'onclick' ? I guess that accesskey is 'd' and value = 'Spoiler'.

so could someone help me with this and do i have to change anything else beside quick_replay.tpl ?

Sandlapper
Registered User
Posts: 37
Joined: Sat May 20, 2006 4:37 pm
Location: Greenville, SC
Contact:

Post by Sandlapper » Sun Jun 18, 2006 3:30 am

dirTdogE wrote: oh! this is EXACTLY what i want!

but i get it cant find these lines in bbcode.php:

$EMBB_widths = array('') ;
$EMBB_values = array('') ;


I had the same problem when i tried to install another spoiler mod.. i dont understand why, i just uploaded the original bbcode.php and those lines just arent there

:?:

I got the same thing. :x

Stormwind
Registered User
Posts: 2
Joined: Fri Jan 28, 2005 2:55 pm

Post by Stormwind » Tue Jun 20, 2006 5:13 pm

Sandlapper,
## IMPORTANT: you MUST first have already installed the Multi BBCode MOD
## available at http://www.phpbb.com/phpBB/viewtopic.php?t=145513

Post Reply

Return to “[2.0.x] MOD Database Releases”