News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Reveal tags

Started by Aaron10, July 22, 2009, 10:29:43 AM

Previous topic - Next topic

Aaron10

Anyone know if I can get reveal tags like this on my forum?

http://www.psu.com/forums/showpost.php?p=4297160&postcount=1

It kinda drops down when you click the little show button.

Thanks

Arantor

Do a search in the mod site for the Spoiler tag.

Aaron10

Does the spoiler tag work the same? I want it drop down, not where you highlight and it shows. Its mainly to keep topics clean like in the above

SAFAD

You Mean A Button When Click Show A Something ?
Its Spoiler FOr Sure
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Kays

Quote from: AaronSOLDIER on July 22, 2009, 11:45:10 AM
Does the spoiler tag work the same? I want it drop down, not where you highlight and it shows. Its mainly to keep topics clean like in the above

The one of spoiler tag mods has the option of "click to open" / "click to close" or it will open on mouseover. No "highlight this" crap.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Arantor


Aaron10

Well I've just downloaded all 3 versions and it says they're all incompatible with SMF 1.0.10 :(

SAFAD

Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Arantor

This is a known bug with the package parser being not suited to the change from 1.1.9 to 1.1.10 (because 9 > 1)

But you should be OK to add the mod manually - Manual Installation of Mods

Aaron10

Ok so I just opened it and theres no modname.xml or anything like that, theres a .kpf file?

Arantor

Go to the mod page, find your SMF version in the drop down and hit Parse - it'll give you the full instructions of what changes to make.

Aaron10

Ok I've installed it and its working but 2 things:

1. In the post reply page, the BBC or the image doesn't show (spoiler.gif) yet I uploaded the image to both the default themes BBC folder and my themes BBC folder.

2. If there a way to have the drop down spoiler but into a quote box? (Makes it easier for people to see what's in the spoiler because it doesn't have a box around it when I just to have the spoilers show as a button click)

Thanks

Arantor

1. Did you upload it to the theme's images folder?

2. There is if you're willing to manually edit one of the core SMF files.

Aaron10

1. Yes, but only in the BBC folder, should I upload it into the post folder on anywhere else?

2. If you know what the code is otherwise I wont risk it

Arantor

1. It needs to be in both the Themes/default/images/bbc and Themes/yourtheme/images/bbc folder and no others.

2. It's a mod to Subs.php but I'm trying to work out exactly what it is you're after. There are multiple display mods for this mod, under which one(s) should it change and precisely to what?

Aaron10

1. Well I've uploaded it to both folders and its ticked under BBC in admin CP so I dont know whats going on there. I have some english-utf8 files and the mod just says to edit the english.whatever.php so maybe I need to edit the codes in my english-utf8 files.

2. Basically if you look here:

http://www.psu.com/forums/showpost.php?p=4297160&postcount=1

The boxes just show as a quote box, so basically when a user clicks on the spoiler button and it drops down, I want whatevers in the spoiler tags to be in a quote box. (But obviously not saying 'Quote:' above it.

Arantor

And would you want that for all the styles of spoiler? Note that there are 3 distinct styles as it stands.

Aaron10

Yeah, thanks

Theres a dotted style, but I'd prefer if it was in a box like the quotes are :)

Arantor

So, if I understand you right you want to remove all three styles and have a single consistent style like the one you pointed out?

Aaron10


Arantor

In which case it's not so much a mod, more a rewrite of the mod. It'll take me longer to do that, but I'll see what I can do - no guarantees of time.

Aaron10

Well to be honest I'm only going to ever use 1 style and thats the third option (clickshow/hide) cant remember what its called but its not the hover one and its not the link one, its a button

Aaron10

BUMP

Arantor, if you're still doing it, just do it for 'buttononclickshowhide'

Aaron10


Arantor

I'm sorry, I really haven't had time today to look at this - probably not tomorrow either :(

Aaron10

Arantor - dont worry, not in too much of a hurry, what about the weekend?

PS. If I use it now (how it is) then update it using the new quote style, will all previous posts using the spoiler tag be updated with the new style?

Aaron10

Arantor, did you get time?

Aaron10


Arantor

#28
I'm sorry, I'd forgotten all about this. I'll look into it now for you.

EDIT: Here we go.

In Sources/Subs.php:
Code (search) Select

function get_spoiler($content, $topic = '') {
global $txt, $settings, $context, $modSettings;

// Optional topic if given
if($topic != '')
$topic = ': '.$topic;

// Backup if theme does not have included
$settings['spoiler_tag'] = isset($settings['spoiler_tag']) ? $settings['spoiler_tag'] : 0;
if($settings['spoiler_tag'] == 0) {
$settings['spoiler_tag'] = isset($modSettings['defaultSpoilerStyle']) ? $modSettings['defaultSpoilerStyle'] : 1;
}
$txt['spoiler_tag_text'] = isset($txt['spoiler_tag_text']) ? $txt['spoiler_tag_text'] : 'Spoiler';
$txt['spoiler_tag_hover_info'] = isset($txt['spoiler_tag_hover_info']) ? $txt['spoiler_tag_hover_info'] : '(hover to show)';
$txt['spoiler_tag_click_info'] = isset($txt['spoiler_tag_click_info']) ? $txt['spoiler_tag_click_info'] : '(click to show/hide)';

// Nothing to see here, move along.
if(!allowedTo('spoiler_show'))
return '';

/*
3: button
2: link
1: hover (default default)
*/
$retval = '';
switch($settings['spoiler_tag']) {
case 3:
$retval = (
'<div class="spoiler"><div class="spoilerheader">'.
'<input type="button" class="spoilerbutton" value="'.$txt['spoiler_tag_text'].$topic.'" '.
'onClick="n = this.parentNode.parentNode.lastChild;if(n.style.display == \'none\') {n.style.display = \'block\';} else {n.style.display = \'none\';} return false;"/> '.
$txt['spoiler_tag_click_info'].'</div><div class="spoilerbody" style="display: none">'.
$content.'</div></div>'
);
break;
case 2:
$retval = (
'<div class="spoiler"><div class="spoilerheader">'.
'<a href="javascript:void(0)" '.
'onClick="n = this.parentNode.parentNode.lastChild; if(n.style.display == \'none\') { n.style.display = \'block\'; } else { n.style.display = \'none\'; } return false;">'.$txt['spoiler_tag_text'].$topic.'</a> '.
$txt['spoiler_tag_click_info'].'</div><div class="spoilerbody" style="display: none">'.
$content.'</div></div>'
);
break;
case 1:
default:
$retval = (
'<fieldset class="spoiler" '.
'onMouseOver="this.lastChild.style.display = \'block\';" onMouseOut="this.lastChild.style.display=\'none\'">'.
'<legend><b>'.$txt['spoiler_tag_text'].$topic.'</b> <small>'.$txt['spoiler_tag_hover_info'].'</small>'.
'</legend><div class="spoilerbody" style="display: none">'.
$content.'</div></fieldset>'
);
}
return $retval;
};


Code (replace) Select

function get_spoiler($content, $topic = '') {
global $txt, $settings, $context, $modSettings;

// Optional topic if given
if($topic != '')
$topic = ': '.$topic;

// Backup if theme does not have included
$settings['spoiler_tag'] = isset($settings['spoiler_tag']) ? $settings['spoiler_tag'] : 0;
if($settings['spoiler_tag'] == 0) {
$settings['spoiler_tag'] = isset($modSettings['defaultSpoilerStyle']) ? $modSettings['defaultSpoilerStyle'] : 1;
}
$txt['spoiler_tag_text'] = isset($txt['spoiler_tag_text']) ? $txt['spoiler_tag_text'] : 'Spoiler';
$txt['spoiler_tag_hover_info'] = isset($txt['spoiler_tag_hover_info']) ? $txt['spoiler_tag_hover_info'] : '(hover to show)';
$txt['spoiler_tag_click_info'] = isset($txt['spoiler_tag_click_info']) ? $txt['spoiler_tag_click_info'] : '(click to show/hide)';

// Nothing to see here, move along.
if(!allowedTo('spoiler_show'))
return '';

$retval = (
'<div class="spoiler"><div class="spoilerheader">'.
'<input type="button" class="spoilerbutton" value="'.$txt['spoiler_tag_text'].$topic.'" '.
'onClick="n = this.parentNode.parentNode.lastChild;if(n.style.display == \'none\') {n.style.display = \'block\';} else {n.style.display = \'none\';} return false;"/> '.
$txt['spoiler_tag_click_info'].'</div><blockquote class="spoilerbody" style="display: none">'.
$content.'</blockquote></div>'
);
return $retval;
};


You may need to change the style of .spoilerbody in your theme's style sheet, but I'll need more information on that. Let me know how this works for you first.

Aaron10

Ok it couldnt find that code in my subs.php so I've attached it for you.

Arantor

I'll see if I can make all the changes for you but likely not going to be for a bit - in the interim I can confirm that if you look at that file and do a search on 'spoiler_tag' you'll find the first code block.

Aaron10

// Spoiler choosing function
function get_spoiler($content, $topic = '') {
global $txt, $settings, $context, $modSettings;

// Optional topic if given
if($topic != '')
$topic = ': '.$topic;


So basically I just slot it in there?

Arantor

That's the start of it, yeah.

Just take out the code you already have - as far as I indicated - and replace it with the other code.

Aaron10

Arantor - if you look here at post #27, its pushed to thr right slightly:

http://forums.finalfantasyvii.info/index.php/topic,14.20.html

So it just needs putting into a box like a quote. Also, if possible, like the link in the first post, underneath a spoiler is there a way to have a kind of line of the quote box underneath the spoiler button? (kinda hard to explain but see the link in the OP)

Arantor

Quote from: AaronSOLDIER on August 16, 2009, 05:05:05 PM
Arantor - if you look here at post #27, its pushed to thr right slightly:

http://forums.finalfantasyvii.info/index.php/topic,14.20.html

I can't see it on that site at all. I just see a blank space where I assume there is supposed to be a spoiler.

As for your other requirements, not without fairly substantial changes to the mod, I think.

Aaron10

Oh dear, I just logged out and can't see it either :S

Aaron10

bump

If this is a big job I'd be willing to pay a small price via Paypal

Arantor

I still can't see what you're using as a reference point that you'd like it to be changed to.

Please can you provide a screenshot of the other forum?

Aaron10

Spoiler closed:



Spoiler open:



Basically as close to that as possible with guests able to view them. Like I said if you want a price its ok.

Arantor

Argh, it's been sufficiently long since I last looked at the mod in question that I need to basically start over with re-learning it.

There are closer tags to what you're looking for than the mod you're actually using, btw that require less work to modify. Simply 'spoiler tag' seems to stick in my mind.

Aaron10

Ok I've found another one that seems to be closer to what I want:

http://custom.simplemachines.org/mods/index.php?mod=573

However I'm trying to get rid of the old one yet its still active on my forum. I've uninstalled it and uploaded and overwritten the files it used

[SiNaN]

So were you able to solve your issue AaronSOLDIER?
Former SMF Core Developer | My Mods | SimplePortal

Aaron10

No somehow the spoilers are still on the forum even when I post now but I uninstalled the mod and replaced all the files...

Aaron10

bump

The spoilers are still there even though I uninstalled

Aaron10


Aaron10


[SiNaN]

Can you attach the files you edited and a link to mod you are trying to uninstall?
Former SMF Core Developer | My Mods | SimplePortal

Aaron10

Sorry I have been away for awhile, heres the files that are edited by the program.

Also I'm using english UTF8 and UK english if you need those too. Link to mod:

http://custom.simplemachines.org/mods/index.php?mod=195

Aaron10


Aaron10


Aaron10


Advertisement: