AnimeSuki Forums

Register Forum Rules FAQ Community Today's Posts Search

Go Back   AnimeSuki Forum > Support > Forum & Site Feedback

Notices

Reply
 
Thread Tools
Old 2010-01-09, 15:18   Link #21
DragoZERO
Spoilaphobic
 
 
Join Date: Jan 2009
Location: USA
Age: 37
You had some decent suggestions in the beginning but changing thread to topic is redundant. They are synonyms and both serve the same purpose. Neither one is more suited for an anime site than the other.

Oh, and why on earth would you not want spoiler tags to remain inside a quote? They are there for a reason and removing them is defeats their purpose all together.

You should make yourself your own forum some where and change everything on there. All of your topics are going to be locked right away and worst case, you are going to get yourself banned. So save yourself all the time and effort you've spent with these suggestions and stop.
__________________
DragoZERO is offline   Reply With Quote
Old 2010-01-09, 16:09   Link #22
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
You are quick to draw conclusions.

I'm not telling them to do it like that, I'm just pointing out they could do it like that. As far as I'm concern suggestions are still feedback more or less. And I could do what you say but this is more fun right now; I have strange way to amuse myself when somewhat bored. Concerning the thread thing, go ask your not so geeky friends what they think the word "thread" means and then ask them what they think a "topic" means, and the answer might surprise you.

With regard to the quote thing; people seem to trip over it each day someone posts a spoiler. To be exact there is this pesky spoiler policy thing, and it forbids quoting spoilers. Your average scenario is someone posts a spoiler in the sections of the forum where they are not allowed (which is around 80% of the forum that actually requires spoiler tag usage to being with) and next there are 2 or more posters that quote said troublemaker post and spell out the rules... thus propagating damage. Of course after a mod comes along and deletes all the posts including any that quoted and gives the "use report button" post (sometimes), but given this still happens all too often you can see where the idea to just prevent them from quoting comes in.

Anyway, why so serious? I'm not hurting anybody am I.
__________________
felix is offline   Reply With Quote
Old 2010-01-11, 21:37   Link #23
chikorita157
ひきこもりアイドル
*IT Support
 
 
Join Date: Feb 2009
Location: Pennsylvania , United States
Age: 34
Well, time to time, I use my iPhone 3GS to browse on the forums and also make some posts. Although it loads fine, it's quite difficult to make a post since the style isn't iPhone optimized and I need to scroll and zoom in to read whats on the page.

I think that vBulletin has some kind of plugin that detects a smart phone browser like Mobile Safari or Chrome on Android so it will view a more optimized page on the phone. As smartphones are getting more popular, it wouldn't hurt much to have a optimized site for these devices.
__________________
chikorita157 is offline   Reply With Quote
Old 2010-01-11, 22:11   Link #24
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
You are talking about TapaTalk? Its the only one I know of that has support range for: iPhone, Blackberry, Nokia, Android. Forum-wise there's phpbb and vbulletin. Support for vBulletin is from 3.7 to the latest 4.0 but I am not sure; its a sort of mirror I think and you will need a client or such to use it (as far as I understand; no hands on experience sorry).

Is this the one?
__________________
felix is offline   Reply With Quote
Old 2010-01-12, 12:41   Link #25
chikorita157
ひきこもりアイドル
*IT Support
 
 
Join Date: Feb 2009
Location: Pennsylvania , United States
Age: 34
That might be nice, but not what I'm looking for. Something simular to WPTouch Wordpress Theme that allows you to view a mobile version of the website in a web browser optimized for iPhone, Android, etc without using a third party application.
__________________
chikorita157 is offline   Reply With Quote
Old 2010-01-12, 12:58   Link #26
DragoZERO
Spoilaphobic
 
 
Join Date: Jan 2009
Location: USA
Age: 37
You need a new style, not a plug in.

For now, you could try the Archive. All of the replies are loaded in one page and you'll have to view the full version to reply though. I would suggest disabling all of the avatar and signatures and image loading on your device, it may help a little.
__________________
DragoZERO is offline   Reply With Quote
Old 2010-01-18, 19:40   Link #27
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1
  • For subforums, have it either instant rather then animated, as in
    Code:
    $("#subforumslist").toggle("slow");
    or if animated something more fancy:
    Code:
    $("#subforumslist").slideToggle(350);
    (these don't require the UI libraries)

    If you're comfortable with changing code, the best solution animation wise would be for open to be instant and close have the slide animation. This avoids any jerkiness and is overall pleasing as well as fast to navigate.
__________________
felix is offline   Reply With Quote
Old 2010-01-18, 20:43   Link #28
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+2
  • Add a little distinct sign (can be anything icon, different color etc) that appears on posts that are really really old; things like a month or more old (4 weeks is a lot). The concern being not for posters who necro-post (they can't be helped) but rather posters who come afterwards. Its kinda annoying when...

    1. people start quoting or replying to posts made, where current answers/context didn't exist (very easy when you do this in a relatively old thread; though our new organisation somewhat helps with that); particularly easy mistakes to make in episode threads when the series starts to die down.
    2. you see what appears to be a new thread (just because it never took off when it was first created) and start reading only to find after maybe a page or two you are reading posts from 3-4 years ago...
    3. scenario in point a) that happens in context of b)

  • More embedding options and more flexible embeds.

    The current youtube tag could be tweaked a little. I know its centered and works like it does (ie. covers the entire post) as a temporary hotfix to some small glitch that was happening when it was first introduced (years ago...); but I'm sure it could probably be fixed with some other method so we can say place them side by side and such.

    More embeds types of embeds wouldn't hurt either. Here are a few examples:

__________________
felix is offline   Reply With Quote
Old 2010-01-19, 21:48   Link #29
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1
  • After X amount of time the current banner fades into the next.

    See jQuery for easy implementation.
__________________
felix is offline   Reply With Quote
Old 2010-01-20, 00:42   Link #30
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+2
  • Code section (basically [code] tag) should fit to width. A lot of small scripts people write are just a little longer in width then the 600px (which I think) is set up now.

  • Code highlighting using javascript.

    [Howto] Create a [snippet=language] tag. This tag helps in properly defining the container for chili to highlight code. The code reciepies (as the plugin calls them) don't cover the video encoding stuff people write in Fansub Groups, but... you can make your own relatively easy. Here's a example one:
    Code:
    {
    	  _name: "avisynth"
    	, _case: false
    	, _main: {
    		com      : { 
    			  _match: /(?:#.*)/ 
    			, _style: "color: dimgray;"
    		}
    		, string : { 
    			  _match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ 
    			, _style: "color: gray;"
    		}
    		, keyword: { 
    			  _match: /\b(?:__END__|function|global|return|try|catch|last|true|false|yes|no|clip|int|flot|string|bool|val)\b/ 
    			, _style: "color: navy; font-weight: bold;"
    		}
    		, func1  : {
    			  _match: /\b(?:max|min|muldiv|floor|ceil|round|sin|cos|pi|exp|log|pow|sqrt|abs|sign|int|frac|float|rand|spline|lcase|ucase|strlen|revstr|leftstr|rightstr|midstr|findstr|chr|time|isbool|isclip|isfloat|isint|isstring|exist|defined|value|hexvalue|string|apply|eval|import|select|default|assert|nop|undefined|setmemorymax|setworkingdir|setplanarlegacyalignment|OPT_AllowFloatAudio|OPT_UseWaveExtensible|OPT_VDubPlanarHack|OPT_dwChannelMask|GetMTMode|SetMTMode|VersionNumber|VersionString)\b/ 
    			, _style: "color: navy; font-weight: bold;"
    		}
    		, func2  : {
    			  _match: /\b(?:AverageLuma|AverageChromaU|AverageChromaV|RGBDifference|LumaDifference|ChromaUDifference|ChromaVDifference|RGBDifferenceFromPrevious|YDifferenceFromPrevious|UDifferenceFromPrevious|VDifferenceFromPrevious|RGBDifferenceToNext|YDifferenceToNext|UDifferenceToNext|VDifferenceToNext|YPlaneMax|UPlaneMax|VPlaneMax|YPlaneMin|UPlaneMin|VPlaneMin|YPlaneMedian|UPlaneMedian|VPlaneMedian|YPlaneMinMaxDifference|UPlaneMinMaxDifference|VPlaneMinMaxDifference)\b/ 				  
    			, _style: "color: darkblue; font-weight: bold;"
    		}
    		// internal filters: http://avisynth.org/mediawiki/Internal_filters
    		, filters : {
    			  _match: /\b(?:AviSource|AviFileSource|OpenDMLSource|DirectShowSource|ImageReader|ImageSource|ImageWriter|Import|SegmentedAviSource|SegmentedDirectShowSource|WavSource|SoundOut|ColorYUV|ConvertBackToYUY2|ConvertToRGB|ConvertToRGB24|ConvertToRGB32|ConvertToYUY2|ConvertToY8|ConvertToYV411|ConvertToYV12|ConvertToYV16|ConvertToYV24|FixLuminance|GreyScale|Invert|Levels|Limiter|MergeARGB|MergeRGB|MergeChroma|MergeLuma|Merge|RGBAdjust|ShowAlpha|ShowRed|ShowGreen|ShowBlue|SwapUV|Tweak|UToY|VToY|UToY8|VToY8|YToUV|ColorKeyMask|Layer|Mask|MaskHS|Overlay|ResetMask|Subtract|AddBorders|Crop|CropBottom|FlipHorizontal|FlipVertical|Letterbox|HorizontalReduceBy2|VerticalReduceBy2|ReduceBy2|BicubicResize|BilinearResize|BlackmanResize|GaussResize|LanczosResize|Lanczos4Resize|PointResize|SincResize|Spline16Resize|Spline36Resize|Spline64Resize|TurnLeft|TurnRight|Turn180|Blur|Sharpen|GeneralConvolution|SpatialSoften|TemporalSoften|FixBrokenChromaUpsampling|AlignedSplice|UnalignedSplice|AssumeFPS|AssumeScaledFPS|ChangeFPS|ConvertFPS|DeleteFrame|Dissolve|DuplicateFrame|FadeIn0|FadeIn|FadeIn2|FadeOut0|FadeOut|FadeOut2|FadeIO0|FadeIO|FadeIO2|FreezeFrame|Interleave|Loop|Reverse|SelectEven|SelectOdd|SelectEvery|SelectRangeEvery|Trim|AssumeFrameBased|AssumeFieldBased|AssumeBFF|AssumeTFF|Bob|ComplementParity|DoubleWeave|PeculiarBlend|Pulldown|SeparateFields|SwapFields|Weave|Amplify|AmplifydB|AssumeSampleRate|AudioDub|AudioDubEx|ConvertAudioTo8bit|ConvertAudioTo16bit|ConvertAudioTo24bit|ConvertAudioTo32bit|ConvertAudioToFloat|ConvertToMono|DelayAudio|EnsureVBRMP3Sync|GetChannel|GetLeftChannel|GetRightChannel|KillAudio|KillVideo|MergeChannels|MixAudio|MonoToStereo|Normalize|ResampleAudio|SuperEQ|SSRC|TimeStretch|ConditionalFilter|FrameEvaluate|ScriptClip|ConditionalReader|WriteFile|WriteFileIf|WriteFileStart|WriteFileEnd|Animate|ApplyRange|TCPServer|TCPSource|BlankClip|Blackness|ColorBars|Compare|Histogram|Info|MessageClip|ShowFiveVersions|ShowFrameNumber|ShowSMPTE|ShowTime|StackHorizontal|StackVertical|Subtitle|Tone|Version)\b/
    			, _style: "color: teal; font-weight: bold;"
    		}
    		// external filters: http://avisynth.org/mediawiki/External_filters
    		, xfilters: {
    			  _match: /\b(?:BassAudio|DGAVCDecode|DGAVCDecNV|DGDecode|DGVC1DecNV|DirectShowSource2|DVInfo|DVTimeStampEx|FFmpegSource|HDVInfo|ImageSequence|Immaavs|IUF|MPASource|MPEGDecoder|MPEG2Dec|MPEG2Dec3|NicAudio|OmfSource|QTSource|R3DSource|RawSource|AAA|AntiAliasing|SangNom|SAA|SharpAAMCmod|TIsophote|BT709ToBT601|ChromaShift|ChromaShiftSP|ColorMatrix|FixChromaBleeding|ReInterpolate411|ReInterpolate420|MoveChroma|FixChromaticAberration|GradFun2DB|GradFunkMirror|GradFun2DBmod|DeBlock|Deblock_QED|FunkyDeBlock|MDeblock|SmoothD|FunkyDeBlock|BlindDeHalo|BlindDeHalo2|BlindDeHalo3|DeHalo_alpha|YAHR|BlindDeRing|HQDering|Area|BlendBob|DGBob|Decomb|GreedyHMA|IBob|KernelDeint|LeakKernelBob|LeakKernelDeint|MCBob|MVBob|Securebob|SecureDeint|SmoothDeinterlace|TDeint|TempGaussMC|TomsMoComp|Yadif|Yadifmod|TomsBob|c_deblend|Deblend|srestore|mrestore|RemoveBlend|Restore24|RestoreFPS|Unblend|FixBlendIVTC|Cdeint|UnDot|DeScratch|DeSpot|RemoveDirt|deVCR|DeFreq|FanFilter|AnimeIVTC|BruteIVTC|FDecimate|GreedyHMA|IT|MultiDecimate|ReMatch|SmartDecimate|Decomb|TIVTC|TPRIVTC|UnComb|IvtcBlend|FixVHSOversharp|GhostBuster|DeKafka|DeLogo|InpaintFunc|rm_logo|X-Logo|Antiflicker|EquLines|ReduceFlicker|BiFrost|Checkmate|Dedot|DFMDeRainbow|GuavaComb|LUTDeRainbow|mfRainbow|SmartSSIQ|SSIQ|TComb|DeRainbow|DePan|Stab|TBC|AdaptiveMedian|Atc|ColourizeSmooth|ConditionalTemporalMedian|DCTFun4b|DeNoise|DNR2|ExtendedBilateral|MedianBlur|PixieDustPP|SmartSmoother|SmootherHiQ|SSIQ|VariableBlur|_2DCleanYUY2|eDeen|Removegrain|TBilateral|VagueDenoiser|CNR2|Fluxsmooth|TemporalDegrain|MC_Spuds|MCTemporalDenoise|AutoYUY2|YV12toRGB24HQ|Dup|Dupped|DeDup|GetDups|AddGrain|AddNoise|Blockbuster|AviShader|ColorLooks|EffectsMany|GrainFactory3|PFR|ReverseFieldDominance|SalFPS3|convert60ito24p|AlterFPS|AutoLevels|ChannelMixer|ColourLike|ExpLabo|FlimsYlevels|GiCocu|HDRAGC|HistogramAdjust|SmoothLevels|TweakColor|Tweak3|Ylevels|Tint|SGradation|mfToon|Toon|vmToon|AutoCrop|HybridResize|NNEDI|Seamer|SplineResize|Zoom|ZoomBox|ResizeARC|LimitedSharpen|LSFmod|SSXSharpen|SubtitleEx|AssRender|SubAA|TextSub|SubtitleMulti|TransAll|DumpPixelValues|AvsTimer|Grid|AVInfo|Kronos|MonitorFilter|PixelInfo|ShowPixelValues|Testpatterns|Comptest|Immaavs|twriteavi|FreeFrame|LoadVFApiPlugin|Motion|MT|SeeSaw|TFM|TDecimate|MergeHints|FrameDiff|FieldDiff|ShowCombedTIVTC|RequestLinear)\b/
    			, _style: "color: darkred; text-decoration: underline; font-weight: bold;"
    		}
    	}
    }
    (its only a example; I did insert all the keywords and internal filters as specified in the documentation among keywords and other things)

    If you want to be really clever you could insert a "badexample" category there, and give it syntax coloring of say strike-though. Obviously the regex would match: deprecated or otherwise common mistakes.
__________________
felix is offline   Reply With Quote
Old 2010-01-20, 22:09   Link #31
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1 cloaked issue
  • The "Forum" column in Today's posts (and I suppose New Posts as well) is very far away from the Thread column. Its not too common (given the naming conventions used in the recent years) but still very annoying when you expect [for example] the anime series thread but the manga thread pops to the top instead (and vice versa; eg. Aki Sora have the exact same thread name). Now its not like the information isn't there but its so far to the left (currently in both vbulletin and animesuki style) its really hard to scan the page easily if you pay too much attention to it (I don't and I doubt anyone actually does; normally).

    In vB4.0 this is fixed (somewhat) by having it right under the name. Could use highlighting more but at least its easily scanned. I know you are going to change the style (since you have done so extensively in this one; and like everything 1-lined), please do not change that or alter it in a way that it becomes similar to the situation I just described [that we have now].
__________________
felix is offline   Reply With Quote
Old 2010-01-31, 00:09   Link #32
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1 safe-guard

Its been suggested (and rightfully so) the vb4 upgrade can be undesirable, so how about:
  • "Do a Beta Test (even though its just a upgrade) before forcing it in."

    Basically
    1. Load the forum copy on a clone read-only 3.8 version at something like http://forums.animesuki.com/test/ (load database or partial database backup into it)
    2. Upgrade it to vB4
    3. Make a forum announcement and ask for feedback (ie. problems, issues etc) people here might have with it; which might not be necessarily technical.
    4. Test lasts for a week, after which its declared passed or failed.
    5. If it passes all is good, if not repeat the process after 6 months or more depending on issues solved internally or if when vB rolls out a substantially modified version.
__________________
felix is offline   Reply With Quote
Old 2010-02-07, 02:33   Link #33
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1 spoiler tag suggestion
  • "Make spoiler tags less in-your-face obtrusive for people who don't care about them in the context."

    I do not understand why the entire rule system was overhauled for the one simple feature that can be automated easily to do our bidding, for one. Secondly, the spoiler tag is not used just by people who are paranoid of spoilers, I do not see why it hasn't been improved to be less of a pain to the rest of us. Actually, everybody since depending on context you may or may not give a damn about spoilers -- a person per person basis, on a series per series basis. And lastly, the spoiler tag has been over-used, it would make sense to add to its functionality so as to have it handle what people are using it for better. Right now its kinda stuck in the twilight zone: it doesn't do spoilers too well, it doesn't do image holder too well or general purpose holder for that matter either -- and the different uses just add to its problem.

    Anyway,

    Since you're using jQuery now I made a simple slighly improved version in the form of a jQuery Plugin. (everything that sounds like its a settings has been implemented as a setting) This little jQuery Spoiler Tag could be more complex but I kept it simple; well, easier to just read the code then explain it.... (since I already commented it to hell)

    • Spoiler vB TAG code:
      Code:
      <div class="spoiler" title="{option}">{param}</div>
      (not sure if its {content} or something else but you get the idea)

    • I made it smart enough to remember when you click a certain type of spoiler and want it open (both at a thread level and at global full forum level). How is this useful? well you only have to go into a thread and say "I want all spoilers labeled 'Ep3' to open and stay open" and they will (in the scope of the thread -- good for series forum). You can also set things like "nsfw" or so such to default open on a global domain so regardless of what image thread (or otherwise) you go to they will magically open for you. This however requires cookies; to avoid having to re-invent the wheel and since modularization works great I used another jquery plugin to handle the cookie business, you can find the unobstruficated code here: http://plugins.jquery.com/project/cookie

    • To create some variaty, since not all spoiler tags are spoiler tags (anymore) it will color code the tags based on their title, for a better visual cue. I also tinkered with a "Scan" option as a way to tell what's inside the spoiler tag with out opening it.

    • Plugin code,
      Code:
      /* 
       * SpoilMe[not] plugin.
       */
      jQuery.fn.spoilme = function (options) {
      	var context = this;  // much more clearer this way
      	
      	// our settings:
      	var conf = jQuery.extend({
      		keyPath: ".thread > .title",  // a DOM traversal to a unique id on the page; recomended value 
      												// is path to thread title
      		spoilerClass: ".spoiler",  // class used by spoiler tags (tags should also be divs, preferably)
      		textClose: "Close",  // text that appears when operation does Close
      		textOpen: "Open",  // text that appears when operation does Open
      		textScan: "Scan",  // text for scan, ie. displaying hints as to the contents, with out opening
      		classToggle: "spoilerToggle",  // class for toggle button-link
      		classScan: "spoilerScan",  // class for scan button-link
      		classLocal: "spoilerToggleLocal",  // class for local set/unset button-link
      		classGlobal: "spoilerToggleGlobal",  // class for global set/unset button-link
      		classInfo: "info",  // when scan is used the result is placed in a div "info" after the title
      		badWords: ["death", "died", "ends", "disapointing", "revives"],  // self explanatory
      		isBadImage: function (jqObj) { return true; },  // tests if image is potentially harmful, 
      																		// smilies for example are not harmful
      		actAsUnknownClass: "unknown",
      		actAsHolderKeys: ["hide", "nsfw", "container", "space", "more", "details"],
      		actAsHolderClass: "hide", 
      		actAsSpeculationKeys: ["speculation", "guess"],
      		actAsSpeculationClass: "speculation", 
      		actAsNormalSpoilerKeys: ["future", "events"],
      		actAsNormalSpoilerClass: "normal", 
      		actAsDangerousSpoilerKeys: ["big", "major", "danger", "character", "plot", "!!!"],
      		actAsDangerousSpoilerClass: "danger",
      		cookiePrefix: "",  // just in case you need it to avoid conflicts
      		animationTime: ""  // animation duration: "" (jQ default), 0 (no animation), 350 (miliseconds)
      		
         }, options);
      
      	// helper function: crc32 -- we need it to persist infinite lenght spoiler titles into cookies 
      	// its not perfect (with posible collision) but better then easily generated cookie length errors
      	var hash = function (str) {
      		// sub helper function
      		function Utf8Encode (string) {
      			string = string.replace(/\r\n/g,"\n");
      			var utftext = "";
      			for (var n = 0; n < string.length; n++) {
      				var c = string.charCodeAt(n);
      				if (c < 128) {
      					utftext += String.fromCharCode(c);
      				} else if((c > 127) && (c < 2048)) {
      					utftext += String.fromCharCode((c >> 6) | 192);
      					utftext += String.fromCharCode((c & 63) | 128);
      				} else {
      					utftext += String.fromCharCode((c >> 12) | 224);
      					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
      					utftext += String.fromCharCode((c & 63) | 128);
      				}
      			}
      			return utftext;
      		};
      		// yey for easy conversion from pseudocode :)
      		str = Utf8Encode(str);
      		var table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";
      		if (typeof(crc) == "undefined") { 
      			crc = 0; 
      		}
      		var x = 0;
      		var y = 0;
      		crc = crc ^ (-1);
      		for( var i = 0, iTop = str.length; i < iTop; i++ ) {
      			y = (crc ^ str.charCodeAt(i)) & 0xFF;
      			x = "0x" + table.substr(y * 9, 8);
      			crc = (crc >>> 8) ^ x;
      		}
      		return crc ^ (-1);
      	};
      	
      	// javascript 1.0 compatible toString function (we ignore sign for our convenience)
      	// for input hash("testtesttesttesttesttesttesttesttesttesttesttesttesttesttest") with radix 35 
      	// you get "e4eu9c"
      	var toAbsoluteRadix = function (N, radix) {
      		var HexN="", Q=Math.floor(Math.abs(N)), R;
      		for (;;) {
      			R=Q % radix;
      			HexN = "0123456789abcdefghijklmnopqrstuvwxyz".charAt(R)+HexN;
      			Q = (Q - R) / radix; 
      			if (Q == 0) break;
      		}
      		// note, we are ignoring sign of N, hence "absolute" in function name
      		return HexN;  
      	}
      	
      	var closeTag = function (tag) {
      		if (tag.children("small:first").children("a." + conf.classToggle).text() == conf.textOpen) {
      			toggleTag(tag);
      		}
      	}
      	var openTag = function (tag) {
      		if (tag.children("small:first").children("a." + conf.classToggle).text() == conf.textClose) {
      			toggleTag(tag);
      		}
      	}
      	var toggleTag = function (tag) {
      		tag.children("div:first").slideToggle(conf.animationTime);
      		var textButton = tag.children("small:first").children("a." + conf.classToggle);
      		textButton.text(textButton.text() == conf.textClose ? conf.textOpen : conf.textClose);
      	}
         
         // 1st, build us a key defining the context of the page -- we need it a tad later
         var key = $(conf.keyPath).text().toLowerCase().replace(/[^a-z ]/gi, "");  // this text form
         key = toAbsoluteRadix(hash(key), 35);  // text form too dangerous, so we hash it and compact it
      
      	// 2nd, we re-shape the html in the spoiler tag(s)
         var spoilers = context.find(conf.spoilerClass);
         for (var i = spoilers.length-1; i >= 0; i--) {  // traverse backwards
      		spoilers.eq(i).each( function () {
      			// we grab the spoiler title
      			var name = $(this).attr("title").toLowerCase().replace(/[^a-z0-9 ]/gi, "");
      			// add our snipet of code to make it look the part
      			$(this).html("<div>" + $(this).html() + "</div>");
      			$(this).prepend(
      				"<small>"
      				+ "<a class=\"" + conf.classToggle + "\" href=\"#\">" + conf.textClose + "</a> " 
      				+ "<a class=\"" + conf.classScan + "\" href=\"#\">" + conf.textScan + "</a> " 
      				+ "| " 
      				+ "Lacal: <a title=\"" + name + "\" class=\"" + conf.classLocal + "\" href=\"#\">" + conf.textClose + "</a> "
      				+ "Global: <a title=\"" + name + "\" class=\"" + conf.classGlobal + "\" href=\"#\">" + conf.textClose + "</a> "
      				+ "| <b>" + name + "</b> <span class=\"" + conf.classInfo + "\"></span>"
      				+ "</small>"
      			 );
      			$(this).children("div:first").hide();
      			// set the spoiler clasification
      			var nameKeys = name.toLowerCase().replace(/[\n\r]/gi, " ").split(" ");
      			var clasification = conf.actAsUnknownClass;
      			asholderLoop:
      			for (var i = 0, sizeN = nameKeys.length; i < sizeN; i++) {
      				if (nameKeys[i].length > 2) {
      					for (var j = 0, sizeH = conf.actAsHolderKeys.length; j < sizeH; j++) {
      						if (nameKeys[i] == conf.actAsHolderKeys[j]) {
      							clasification = conf.actAsHolderClass;
      							break asholderLoop;
      						}
      					}
      				}
      			}
      			asspeculationLoop:
      			for (var i = 0, sizeN = nameKeys.length; i < sizeN; i++) {
      				if (nameKeys[i].length > 2) {
      					for (var j = 0, sizeH = conf.actAsSpeculationKeys.length; j < sizeH; j++) {
      						if (nameKeys[i] == conf.actAsSpeculationKeys[j]) {
      							clasification = conf.actAsSpeculationClass;
      							break asspeculationLoop;
      						}
      					}
      				}
      			}
      			asnormalLoop:
      			for (var i = 0, sizeN = nameKeys.length; i < sizeN; i++) {
      				if (nameKeys[i].length > 2) {
      					for (var j = 0, sizeH = conf.actAsNormalSpoilerKeys.length; j < sizeH; j++) {
      						if (nameKeys[i] == conf.actAsNormalSpoilerKeys[j]) {
      							clasification = conf.actAsNormalSpoilerClass;
      							break asnormalLoop;
      						}
      					}
      				}
      			}
      			asdangerLoop:
      			for (var i = 0, sizeN = nameKeys.length; i < sizeN; i++) {
      				if (nameKeys[i].length > 2) {
      					for (var j = 0, sizeH = conf.actAsDangerousSpoilerKeys.length; j < sizeH; j++) {
      						if (nameKeys[i] == conf.actAsDangerousSpoilerKeys[j]) {
      							clasification = conf.actAsDangerousSpoilerClass;
      							break asdangerLoop;
      						}
      					}
      				}
      			}
      			$(this).addClass(clasification);  // spoiler is now ready to be marked with CSS
      			// ready to display it
      			$(this).css("display", "block");
      		});
      	}
      
      	// 3rd, add some event binding to make it all tic
      	context.find(conf.spoilerClass).each( function () {
      		// name of the spoiler tag; hashed and compacted in -- gives us the entry
      		// since its hashed we don't have to worry about people accidently breaking syntax
      		var id = $(this).children("small:first").children("b").text();  // this is the id of the tag
      		var name = toAbsoluteRadix(hash(id), 35);  // this is its cookie name
      	
      		// A) the basic Open/Close button -- which does what its suppose to
      		$(this).children("small:first").children("a." + conf.classToggle).click( function () {
      			// parent of anchor (small), then parent of small (spoilerClass)
      			toggleTag($(this).parent().parent());
      			event.preventDefault();
      		});
      		
      		// B) the local toggle -- toggle default behaviour of everything that shares the title, but 
      		// functions only on this page. Say your spoiler is titled "Ep3", setting local to Open will 
      		// auto-open all of em' specific to this thread (presuming thread title is the keyPath)
      		$(this).children("small:first").children("a." + conf.classLocal).click( function () {
      			if ($(this).text() == conf.textOpen) {
      				// local is set to open, so we need to close it up
      				$.cookie(conf.cookiePrefix + "local" + key + name, null);  // we first delete the entry
      				// and we reflect the new change; everything sets to close
      				context.find(conf.spoilerClass + " > small b").each( function () {
      					if (id == $(this).text()) {
      						// parent: small
      						$(this).parent().children("." + conf.classLocal).text(conf.textClose);
      						// parents: small, spoilerClass
      						closeTag($(this).parent().parent());
      					}
      				});
      			} else if ($(this).text() == conf.textClose) {
      				// local is set to close, so we need to open it up
      				$.cookie(conf.cookiePrefix + "local" + key + name, "open");  // we first create the entry
      				// and we reflect the new change; everything sets to open
      				context.find(conf.spoilerClass + " > small b").each( function () {
      					if (id == $(this).text()) {
      						// parent: small
      						$(this).parent().children("." + conf.classLocal).text(conf.textOpen);
      						// parents: small, spoilerClass
      						openTag($(this).parent().parent());
      					}
      				});
      			}
      			event.preventDefault();
      		});
      		
      		// C) the global toggle -- like local above (B) but functions at a site scope rather then 
      		// being limited by the keyPath scope. Useful for things like "nsfw" and varius per person
      		// specific tags for spoilers which should only need selecting once.
      		$(this).children("small:first").children("a." + conf.classGlobal).click( function () {
      			if ($(this).text() == conf.textOpen) {
      				// global is set to open, so we need to close it up
      				$.cookie(conf.cookiePrefix + "global" + name, null);  // we first delete the entry
      				// and we reflect the new change; everything sets to close
      				context.find(conf.spoilerClass + " > small b").each( function () {
      					if (id == $(this).text()) {
      						// parent: small
      						$(this).parent().children("." + conf.classGlobal).text(conf.textClose);
      						// parents: small, spoilerClass
      						closeTag($(this).parent().parent());
      					}
      				});
      			} else if ($(this).text() == conf.textClose) {
      				// local is set to close, so we need to open it up
      				$.cookie(conf.cookiePrefix + "global" + name, "open");  // we first create the entry
      				// and we reflect the new change; everything sets to open
      				context.find(conf.spoilerClass + " > small b").each( function () {
      					if (id == $(this).text()) {
      						// parent: small
      						$(this).parent().children("." + conf.classGlobal).text(conf.textOpen);
      						// parents: small, spoilerClass
      						openTag($(this).parent().parent());
      					}
      				});
      			}
      			event.preventDefault();
      		});
      		
      		// D) scan -- very simple function that interprets the spoiler for the user; things like 
      		// number of words or presence of certain key words such as "dies", "ends up" etc.
      		$(this).children("small:first").children("a." + conf.classScan).click( function () {
      			// get the contents, we'll just ignore any html in there and get it all.
      			var text = $(this).parent().parent().children("div:first").text();
      			// we probably have new lines or some other wird stuff... first fix that
      			var words = text.toLowerCase().replace(/[\n\r]/gi, " ").split(" ");
      			// now just count them, words are anything with more then 2 characters
      			var wordCount = 0;
      			var badWordCount = 0;
      			for (var i = 0, size = words.length; i < size; i++) {
      				if (words[i].length > 2) {
      					for (var j = 0, size_badies = conf.badWords.length; j < size_badies; j++) {
      						if (conf.badWords[j] == words[i]) {
      							// ouch!
      							badWordCount++;
      						}
      					}
      					wordCount++;
      				}
      			}
      			var imageCount = 0;
      			$(this).parent().parent().children("div:first").find("img").each(function () {
      				// some handling code here to determine if the image is not a smilie etc
      				if (conf.isBadImage($(this))) {
      					imageCount++;
      				}
      			});
      			$(this).parent().children(".info").text(
      				"[ " 
      				+ wordCount 
      				+ (wordCount != 1 ? "words" : "word")
      				+ " / " 
      				+ badWordCount + "bad / " 
      				+ imageCount 
      				+ (imageCount != 1 ? "images" : "image")
      				+ " ]"
      			);
      			event.preventDefault();
      		});
      		
      		// since we're traversing the nodes anyway might as well check our cookie database
      		// if either local or global is set to open we need it to be open
      		if ($.cookie(conf.cookiePrefix + "local" + key + name) == "open") {  // test if local is open
      			// local is set to open
      			$(this).children("small:first > a." + conf.classLocal).text(conf.textOpen);
      			openTag($(this));
      		} else if ($.cookie(conf.cookiePrefix + "global" + name) == "open") {  // test if global is open
      			$(this).children("small:first > a." + conf.classGlobal).text(conf.textOpen);
      			openTag($(this));
      		}
      	});
         
         return this;
      };
    • Test page code; since working directly in vBulletin is a pain...
      Code:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
      	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      	
      <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
      <head>
      	<title>Spoiler Template Test Page</title>
      	<style type="text/css">
      	h2 {
      		text-align: center;
      	}
      	.pseudo-post {
      		margin: 30px 60px 20px 250px;
      		padding: 10px;
      		border-top: 3px solid gray;
      		border-bottom: 1px solid black;
      	}
      
      	/*----TEMPLATE--STYLE--------*/
      
      	.spoiler {
      		display: block;
      		padding-left: 10px; /* margin better, but causes almost noticible animation artifcats */
      	}
      	
      	.spoiler.danger {
      		color: red;
      	}
      	
      	.spoiler.speculation {
      		color: green;
      	}
      	
      	.spoiler.normal {
      		color: darkred;
      	}
      	
      	</style>
      </head>
      <body>
      <h1>Test Page</h1>
      <!-- Test posts -->
      <div class="thread">
      	<h2 class="title">Test Thread</h2>
      	<div class="pseudo-post">
      		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean interdum feugiat nisl, fermentum sagittis felis placerat a. Aenean in nibh luctus urna vulputate mattis. Fusce ac erat massa. Curabitur condimentum nisi eu enim ultrices consequat. Etiam iaculis, libero a placerat fringilla, magna lectus faucibus nulla, quis placerat lorem justo eget tortor. Maecenas sit amet aliquet odio. Maecenas vel tortor vitae leo molestie ultrices. Fusce malesuada gravida posuere. Aenean eget eleifend dui. Morbi enim risus, lobortis et facilisis ac, laoreet fermentum lacus. Mauris laoreet, eros vitae sagittis dictum, ligula augue ullamcorper turpis, non accumsan purus dolor ac orci. Praesent nec risus velit, quis imperdiet mi. </p>
      		<div title="hide" class="spoiler">
      			<p>Morbi aliquet molestie libero, et tempus neque viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      			<div title="danger!!! future character plot and events!" class="spoiler">
      				<p>Morbi aliquet molestie libero, et tempus neque <img src="#" />viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      				<div title="subsubsomething" class="spoiler">
      					<p>Morbi aliquet molestie libero, et tempus neque viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      				</div>
      				<p>Ut iaculis mi semper lorem suscipit vitae ultricies eros facilisis. Nunc non orci sed diam lobortis ornare id nec mi. Nulla vel dui ipsum, congue tristique massa. Phasellus pellentesque metus non est posuere lobortis vel at nulla. Mauris eu nulla sem, vel iaculis leo. Praesent arcu purus, rhoncus ut volutpat in, faucibus vitae nulla. Nulla facilisi. Cras porta suscipit nunc ac lobortis. Donec at sagittis mi. Pellentesque vulputate sem iaculis purus malesuada congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vulputate quam et metus posuere mollis. Aliquam erat volutpat. Nullam non diam urna, in ornare lorem. Duis at blandit lectus. Nulla nec leo mauris, quis pellentesque enim. Suspendisse eget nulla ac nunc dignissim consequat. Morbi tincidunt euismod risus vitae fermentum.</p>
      			</div>
      		</div>
      		<p>Ut iaculis mi semper lorem suscipit vitae ultricies eros facilisis. Nunc non orci sed diam lobortis ornare id nec mi. Nulla vel dui ipsum, congue tristique massa. Phasellus pellentesque metus non est posuere lobortis vel at nulla. Mauris eu nulla sem, vel iaculis leo. Praesent arcu purus, rhoncus ut volutpat in, faucibus vitae nulla. Nulla facilisi. Cras porta suscipit nunc ac lobortis. Donec at sagittis mi. Pellentesque vulputate sem iaculis purus malesuada congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vulputate quam et metus posuere mollis. Aliquam erat volutpat. Nullam non diam urna, in ornare lorem. Duis at blandit lectus. Nulla nec leo mauris, quis pellentesque enim. Suspendisse eget nulla ac nunc dignissim consequat. Morbi tincidunt euismod risus vitae fermentum. </p>
      	</div>
      
      	<div class="pseudo-post">
      		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean interdum feugiat nisl, fermentum sagittis felis placerat a. Aenean in nibh luctus urna vulputate mattis. Fusce ac erat massa. Curabitur condimentum nisi eu enim ultrices consequat. Etiam iaculis, libero a placerat fringilla, magna lectus faucibus nulla, quis placerat lorem justo eget tortor. Maecenas sit amet aliquet odio. Maecenas vel tortor vitae leo molestie ultrices. Fusce malesuada gravida posuere. Aenean eget eleifend dui. Morbi enim risus, lobortis et facilisis ac, laoreet fermentum lacus. Mauris laoreet, eros vitae sagittis dictum, ligula augue ullamcorper turpis, non accumsan purus dolor ac orci. Praesent nec risus velit, quis imperdiet mi.</p>
      		<div title="Ep3" class="spoiler">
      			<p>Morbi aliquet molestie libero, et tempus neque viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      		</div>
      		<p>Ut iaculis mi semper lorem suscipit vitae ultricies eros facilisis. Nunc non orci sed diam lobortis ornare id nec mi. Nulla vel dui ipsum, congue tristique massa. Phasellus pellentesque metus non est posuere lobortis vel at nulla. Mauris eu nulla sem, vel iaculis leo. Praesent arcu purus, rhoncus ut volutpat in, faucibus vitae nulla. Nulla facilisi. Cras porta suscipit nunc ac lobortis. Donec at sagittis mi. Pellentesque vulputate sem iaculis purus malesuada congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vulputate quam et metus posuere mollis. Aliquam erat volutpat. Nullam non diam urna, in ornare lorem. Duis at blandit lectus. Nulla nec leo mauris, quis pellentesque enim. Suspendisse eget nulla ac nunc dignissim consequat. Morbi tincidunt euismod risus vitae fermentum.</p>
      	</div>
      	
      	<div class="pseudo-post">
      		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean interdum feugiat nisl, fermentum sagittis felis placerat a. Aenean in nibh luctus urna vulputate mattis. Fusce ac erat massa. Curabitur condimentum nisi eu enim ultrices consequat. Etiam iaculis, libero a placerat fringilla, magna lectus faucibus nulla, quis placerat lorem justo eget tortor. Maecenas sit amet aliquet odio. Maecenas vel tortor vitae leo molestie ultrices. Fusce malesuada gravida posuere. Aenean eget eleifend dui. Morbi enim risus, lobortis et facilisis ac, laoreet fermentum lacus. Mauris laoreet, eros vitae sagittis dictum, ligula augue ullamcorper turpis, non accumsan purus dolor ac orci. Praesent nec risus velit, quis imperdiet mi.</p>
      		<div title="Ep3" class="spoiler">
      			<p>Morbi aliquet molestie libero, et tempus neque viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      		</div>
      		<p>Ut iaculis mi semper lorem suscipit vitae ultricies eros facilisis. Nunc non orci sed diam lobortis ornare id nec mi. Nulla vel dui ipsum, congue tristique massa. Phasellus pellentesque metus non est posuere lobortis vel at nulla. Mauris eu nulla sem, vel iaculis leo. Praesent arcu purus, rhoncus ut volutpat in, faucibus vitae nulla. Nulla facilisi. Cras porta suscipit nunc ac lobortis. Donec at sagittis mi. Pellentesque vulputate sem iaculis purus malesuada congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vulputate quam et metus posuere mollis. Aliquam erat volutpat. Nullam non diam urna, in ornare lorem. Duis at blandit lectus. Nulla nec leo mauris, quis pellentesque enim. Suspendisse eget nulla ac nunc dignissim consequat. Morbi tincidunt euismod risus vitae fermentum.</p>
      	</div>
      	
      	<div class="pseudo-post">
      		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean interdum feugiat nisl, fermentum sagittis felis placerat a. Aenean in nibh luctus urna vulputate mattis. Fusce ac erat massa. Curabitur condimentum nisi eu enim ultrices consequat. Etiam iaculis, libero a placerat fringilla, magna lectus faucibus nulla, quis placerat lorem justo eget tortor. Maecenas sit amet aliquet odio. Maecenas vel tortor vitae leo molestie ultrices. Fusce malesuada gravida posuere. Aenean eget eleifend dui. Morbi enim risus, lobortis et facilisis ac, laoreet fermentum lacus. Mauris laoreet, eros vitae sagittis dictum, ligula augue ullamcorper turpis, non accumsan purus dolor ac orci. Praesent nec risus velit, quis imperdiet mi.</p>
      		<div title="speculation on XXX" class="spoiler">
      			<p>Morbi aliquet molestie libero, et tempus neque viverra eget. Vivamus hendrerit tempus luctus. In pharetra erat in tellus cursus in malesuada nunc aliquam. Fusce bibendum rhoncus nulla, non porttitor nisi tincidunt venenatis. Nunc eget elit orci, eget aliquet est. Pellentesque vitae vestibulum ante. In vehicula scelerisque ornare. Proin ullamcorper sollicitudin adipiscing. Donec sollicitudin suscipit arcu ultricies feugiat. Mauris laoreet consequat volutpat. In gravida consectetur viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin nisi enim, imperdiet ut euismod sit amet, pharetra in sapien. Aliquam adipiscing tincidunt lacus, at blandit est sollicitudin id. Nunc suscipit consectetur aliquet. Vivamus fermentum euismod dolor, in ultricies est tristique at. Sed ultrices aliquet vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse congue consequat pulvinar. Sed vestibulum massa in augue tincidunt suscipit.</p>
      		</div>
      		<p>Ut iaculis mi semper lorem suscipit vitae ultricies eros facilisis. Nunc non orci sed diam lobortis ornare id nec mi. Nulla vel dui ipsum, congue tristique massa. Phasellus pellentesque metus non est posuere lobortis vel at nulla. Mauris eu nulla sem, vel iaculis leo. Praesent arcu purus, rhoncus ut volutpat in, faucibus vitae nulla. Nulla facilisi. Cras porta suscipit nunc ac lobortis. Donec at sagittis mi. Pellentesque vulputate sem iaculis purus malesuada congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vulputate quam et metus posuere mollis. Aliquam erat volutpat. Nullam non diam urna, in ornare lorem. Duis at blandit lectus. Nulla nec leo mauris, quis pellentesque enim. Suspendisse eget nulla ac nunc dignissim consequat. Morbi tincidunt euismod risus vitae fermentum.</p>
      	</div>
      </div>
      <!-- End // Test posts -->
      	
      	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
      	<script src="jquery.cookie.js"></script>
      	<script src="jquery.spoilme.js"></script>
      	<script>
      		$(document).ready( function () {
      			$(document).spoilme();
      		});
      	</script>
      	
      </body>
      </html>
__________________

Last edited by felix; 2010-02-11 at 15:58. Reason: remebered the right name for it
felix is offline   Reply With Quote
Old 2010-02-08, 05:03   Link #34
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
+1
  • "Add informative description to series forums."

    Something like the vintage year or just the time period it aired or some other useful info.
    See forum manager for changing this...
__________________
felix is offline   Reply With Quote
Old 2010-02-15, 16:38   Link #35
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
Contents
* jQuery Plug-in Code
* Integarting with vBulletin 4.0.1


A little better code for the example on post #33 (the one before the above). Also included vBulleting 4.0.1 integration code.
Spoiler for changes:

Screenshots:
Spoiler for screeny1:
Spoiler for screeny2:
Spoiler for screeny3:
Spoiler for screeny4:


jQuery Plug-in Code
The following snippet are the default settings (you just overwrite them if you need something else). They will work fine as is on vBulletin 4.0.1
Code:
{
	key: 'h1',
	animation: {
		open: '350',
		fadein: 1000
	},
	theme: 'modern',
	use: {
		scan: true,
		local: true,
		global: true,
		colorCodes: true,
		css: true,
		animation: true
	},
	color: {
		normal: '#fdf8f0',
		holder: '#aaaabe',
		speculation: '#9b6',
		danger: '#e86',
		link: '#666'
	},
	text: {
		close: 'Close',
		open: 'Open',
		scan: 'Scan',
		localeYes: 'on',
		localeNo: 'off'
	},
	tag: {
		wrapper: 'spoilerWrapper',
		controls: 'spoilerControls',
		title: 'spoilerTitle',
		toggle: 'spoilerToggle',
		scan: 'spoilerScan',
		local: 'spoilerToggleLocal',
		global: 'spoilerToggleGlobal',
		info: 'spoilerInfo'
	},
	scan: {
		badWords: [/(death|died|ends|kill)/gi, /(lost|loose|defeat|win|won|victory|victorious)/gi]
	},
	type: {
		holder: {
			tag: 'holder',
			key: /(list|voice actor|seyu|wallpaper|image|hide|space|more|avatar|signature|nsfw|creation)/gi
		},
		speculation: {
			tag: 'speculation',
			key: /(speculation|synopsis|guess|theory|epi|ep|episode)/gi
		},
		danger: {
			tag: 'danger',
			key: /(spoiler|major|plot|future)/gi
		}
	},
	cookiePrefix: ''
};
To get for example the current look (for the most part).
Code:
$('.spoiler').spoilme({theme: 'legacy', use: {scan: false, local: false, global: false} });
There's no particular order to the settings as long as the structure is maintained its all good.

SpoilMe[Not] Plug-in code...
Code:
/**
 * spoilMe[not] -- jQuery plug-in
 *
 */

/**
 * Minimalistic spoiler tag implementation.
 *
 * @example $('.spoiler').spoilme();
 * @desc Create a spoiler tag on set element(s)
 * @example $('.spoiler').spoilme({use: {local: false, global: false, scan: false}});
 * @desc Create spoiler, but disable most options.
 */
(function ($) {
	
	$.fn.spoilme = function (options) {
		var spoilers = $(this);		
		var config = $.extend(true, $.fn.spoilme.defaults, options);

		// shorthand
		var button = $.fn.spoilme.button;
		
		// do we have cookie support?
		if (typeof $.cookie == 'undefined') {
			config.use.local = false;
			config.use.global = false;
		}
		
		var target = '.' + $.trim($(this).attr('class').replace(/ /, '.'));
		$.fn.spoilme.attachCSS(config, target);
		
		var key = $.fn.spoilme.pack($(config.key).text().toLowerCase().replace(/[^a-z ]/gi, ''));
		
		// cycle though all of the spoiler tags
		spoilers.each(function () {
			var context = $(this);
			
			/* style the tag */
			if (config.theme == 'modern') {
				$.fn.spoilme.styleModern(context, config);
			} else if (config.theme == 'legacy') {
				$.fn.spoilme.styleLegacy(context, config);
			} else if (typeof config.theme == 'function') {
				config.theme(context, config);
			} else {
				$.fn.spoilme.styleModern(context, config);
			}
			
			// name of the spoiler tag -- compressed -- gives us the entry; since its hashed we don't 
			// have to worry about people accidently breaking syntax
			var spoilerTitle = context.attr('title');
			var cookieName = $.fn.spoilme.cookieName(context);
			var shortName = $.fn.spoilme.shortName(context);
			
			// the basic Open/Close event
			$(this).children('.' + config.tag.controls).find('.' + config.tag.toggle).click(function (event) {
				$.fn.spoilme.toggleTag(context, config);
				event.preventDefault();
			});
			
			// interpret the spoiler for the user
			if (config.use.scan) {
				$(this).children('.' + config.tag.controls).find('.' + config.tag.scan).click(function (event) {
					// get the contents, we'll just ignore any html in there and get it all.
					var alt = context.find('.' + config.tag.wrapper + ':first')
					                 .clone();
					alt.find('.' + config.tag.controls)
					   .remove();
					var words = alt.text().toLowerCase()
					                      .replace(/[\n\r]/gi, ' ')
					                      .split(' ');
					var wordCount = 0;
					var badWordCount = 0;
					// words are anything with more then 2 characters
					for (var i = 0, size = words.length; i < size; ++i) {
						if ($.trim(words[i]).length > 2) {
							for (var j = 0, size_badies = config.scan.badWords.length; j < size_badies; j++) {
								if (words[i].match(config.scan.badWords[j])) {
									badWordCount++;
								}
							}
							wordCount++;
						}
					}
					var imageCount = 0;
					context.find('.' + config.tag.wrapper + ':first').find('img').each(function () {
						// we determine if the image is not a smilie, icon, thumbnail etc
						if ($.fn.spoilme.isBadImage($(this))) {
							imageCount++;
						}
					});
					
					var info = 'There ' + (wordCount != 1 ? 'are ' : 'is ') + wordCount 
						+ (wordCount != 1 ? ' words' : ' word') + ' out of which ' + badWordCount 
						+ ' potentially bad.' + (imageCount !== 0 ? ' There ' + (imageCount != 1 ? 'are ' : 'is ')
						+ 'also ' + imageCount + ' potential spoiler ' + (imageCount != 1 ? 'images.' : 'image.') : '');
						
					$.fn.spoilme.notify(context, info, config);
					
					event.preventDefault();
				});
			}
			
			if (config.use.local) {
				// toggle default behaviour of everything that shares the title (on this page)
				$(this).children('.' + config.tag.controls).find('.' + config.tag.local).click(function (event) {
					var cookieName = $.fn.spoilme.cookieName(context);
					var shortName = $.fn.spoilme.shortName(context);
					var buttonText = button($(this), config);
					
					if (buttonText == config.text.localeYes) {
						// local is set to open, so we need to close it up
						$.cookie(config.cookiePrefix + 'local' + key + cookieName, null);  // we first delete the entry
						// and we reflect the new change; everything sets to close
						spoilers.each(function () {
							if (shortName == $.fn.spoilme.shortName($(this))) {
								var localButton = $(this).children('.' + config.tag.controls).find('.' + config.tag.local);
								button(localButton, config, config.text.localeNo);
								$.fn.spoilme.closeTag($(this), config);
							}
						});
					} else if (buttonText == config.text.localeNo) {
						// local is set to close, so we need to open it up
						$.cookie(config.cookiePrefix + 'local' + key + cookieName, 'open');
						// we reflect the new change; everything sets to open
						spoilers.each(function () {
							if (shortName == $.fn.spoilme.shortName($(this))) {
								var localButton = $(this).children('.' + config.tag.controls).find('.' + config.tag.local);
								button(localButton, config, config.text.localeYes);
								$.fn.spoilme.openTag($(this), config);
							}
						});
					}
					event.preventDefault();
				});
			}
			
			if (config.use.global) {
				// toggle default behaviour of everything that shares the title (on this page)
				$(this).children('.' + config.tag.controls).find('.' + config.tag.global).click(function (event) {
					var cookieName = $.fn.spoilme.cookieName(context);
					var shortName = $.fn.spoilme.shortName(context);
					var buttonText = button($(this), config);
					
					if (buttonText == config.text.localeYes) {
						// local is set to open, so we need to close it up
						$.cookie(config.cookiePrefix + 'global' + cookieName, null);  // we first delete the entry
						// and we reflect the new change; everything sets to close
						spoilers.each(function () {
							if (shortName == $.fn.spoilme.shortName($(this))) {
								var globalButton = $(this).children('.' + config.tag.controls).find('.' + config.tag.global);
								button(globalButton, config, config.text.localeNo);
								$.fn.spoilme.closeTag($(this), config);
							}
						});
					} else if (buttonText == config.text.localeNo) {
						// local is set to close, so we need to open it up
						$.cookie(config.cookiePrefix + 'global' + cookieName, 'open');
						// we reflect the new change; everything sets to open
						spoilers.each(function () {
							if (shortName == $.fn.spoilme.shortName($(this))) {
								var globalButton = $(this).children('.' + config.tag.controls).find('.' + config.tag.global);
								button(globalButton, config, config.text.localeYes);
								$.fn.spoilme.openTag($(this), config);
							}
						});
					}
					event.preventDefault();
				});
			}
			
			// if either local or global is set to open we need it to be open
			if (config.use.local && $.cookie(config.cookiePrefix + 'local' + key + cookieName) == 'open') {
				var localButton = context.children('.' + config.tag.controls)
				                         .find('.' + config.tag.local);
				button(localButton, config, config.text.localeYes);
				$.fn.spoilme.openTag(context, config);
			} 
			if (config.use.global && $.cookie(config.cookiePrefix + 'global' + cookieName) == 'open') {
				var globalButton = context.children('.' + config.tag.controls)
				                          .find('.' + config.tag.global);
				button(globalButton, config, config.text.localeYes);
				$.fn.spoilme.openTag(context, config);
			}
		});

		return spoilers;
	};
	
	// sensible defaults
	$.fn.spoilme.defaults = {
		key: 'h1',
		animation: {
			open: '350',
			fadein: 1000
		},
		theme: 'modern',
		use: {
			scan: true,
			local: true,
			global: true,
			colorCodes: true,
			css: true,
			animation: true
		},
		color: {
			normal: '#fdf8f0',
			holder: '#aaaabe',
			speculation: '#9b6',
			danger: '#e86',
			link: '#666'
		},
		text: {
			close: 'Close',
			open: 'Open',
			scan: 'Scan',
			localeYes: 'on',
			localeNo: 'off'
		},
		tag: {
			wrapper: 'spoilerWrapper',
			controls: 'spoilerControls',
			title: 'spoilerTitle',
			toggle: 'spoilerToggle',
			scan: 'spoilerScan',
			local: 'spoilerToggleLocal',
			global: 'spoilerToggleGlobal',
			info: 'spoilerInfo'
		},
		scan: {
			badWords: [/(death|died|ends|kill)/gi, /(lost|loose|defeat|win|won|victory|victorious)/gi]
		},
		type: {
			holder: {
				tag: 'holder',
				key: /(list|voice actor|seyu|wallpaper|image|hide|space|more|avatar|signature|nsfw|creation)/gi
			},
			speculation: {
				tag: 'speculation',
				key: /(speculation|synopsis|guess|theory|epi|ep|episode)/gi
			},
			danger: {
				tag: 'danger',
				key: /(spoiler|major|plot|future)/gi
			}
		},
		cookiePrefix: ''
	};
	
	$.fn.spoilme.attachCSS = function (config, target) {
		var css = '';
		if (config.theme == 'legacy') {
			css = css + target + '.spoileme-theme-legacy{margin-top:1em;margin-left:1em;}'
			          + target + '.spoileme-theme-legacy .'+config.tag.wrapper+'2{background:#ede8e0;border:1px solid black;padding:6px;}'
			          + target + '.spoileme-theme-legacy input{width:45px;font-size:10px;margin:0;padding:0;}'
			          + target + '.spoileme-theme-legacy .'+config.tag.controls+'2{float:right;}' 
		} else if (config.theme == 'modern') {
			css = css + target + '.spoileme-theme-modern{border:1px dotted black;border-bottom:1px solid black;border-top:1px solid black;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px 8px;padding: 2px;margin-top:5px;}'
			          + target + '.spoileme-theme-modern .'+config.tag.controls+'{padding:2px 0px 4px 10px;margin:0;border:1px solid gray;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px 8px;background: '+config.color.normal+' url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAZCAYAAAAWuY87AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALRJREFUeNpMUTESwyAMk1z+/8aOXbo0hOZYXNkOTTgGUIQsKXy/nh/cViM4QQecsdFATMC0XTgDsAMiiFkMkl+dc4mUwIDrFChLdLgR5yNpmO2SLJKgZmRHnRHimhIASzc0jI/u8MtpMDQJa1KjcSuNlA4ftl3RmMY6ltWT0f8zi2HpwyXMyiIg+yhdAdirj9UYbZxZy6nCDbrfsgAqqLKsxo712ap1m3HJK6No9/tvwU+AAQCvokB8uRbEEQAAAABJRU5ErkJggg==") repeat-x top left;}'
			          + target + '.spoileme-theme-modern .'+config.tag.wrapper+'{padding:5px 5px 5px 20px;}'
			          + target + '.spoileme-theme-modern .'+config.tag.controls+' a{text-decoration:none;color:black;}'
			          + target + '.spoileme-theme-modern .'+config.tag.controls+' a:hover{color:'+config.color.link+';text-decoration:underline;}'
			          + target + '.spoileme-theme-modern .'+config.tag.wrapper+' img{max-width: 100%;}'
			          + target + '.spoileme-theme-modern .'+config.tag.controls+' a.'+config.tag.local+',.spoiler.spoileme-theme-modern .'+config.tag.controls+' a.'+config.tag.global+'{font-weight:bold;}'
			          + target + '.spoileme-theme-modern.'+config.type.holder.tag+' .'+config.tag.controls+'{background-color:'+config.color.holder+';}'
			          + target + '.spoileme-theme-modern.'+config.type.speculation.tag+' .'+config.tag.controls+'{background-color:'+config.color.speculation+';}'
			          + target + '.spoileme-theme-modern.'+config.type.danger.tag+' .'+config.tag.controls+'{background-color:'+config.color.danger+';}'
		}
		if (css != '') {
			$('head').prepend('<style type="text/css">'+css+'</style>');
		}
	};
	
	$.fn.spoilme.cookieName = function (tag) {
		return $.fn.spoilme.pack(
			$.fn.spoilme.shortName(tag)
		);
	};
	
	$.fn.spoilme.shortName = function (tag) {
		return $.trim(tag.attr('title').toLowerCase().replace(/\{.*\}/, ''));
	};
	
	// toggles spoiler tag on and off
	$.fn.spoilme.toggleTag = function (tag, config) {
		tag.find('.' + config.tag.wrapper + ':first').slideToggle(config.animation.open);
		var toggleButton = tag.children('.' + config.tag.controls).find('.' + config.tag.toggle);
		$.fn.spoilme.button(toggleButton, config, ($.fn.spoilme.button(toggleButton, config) == config.text.close ? config.text.open : config.text.close));	
	};
	
	// toggle spoiler tag off, or do nothing
	$.fn.spoilme.closeTag = function (tag, config) {
		var toggleButton = tag.children('.' + config.tag.controls).find('.' + config.tag.toggle);
		if ($.fn.spoilme.button(toggleButton, config) == config.text.close) {
			$.fn.spoilme.toggleTag(tag, config);
		}
	};
	
	// toggle spoiler tag on, or do nothing
	$.fn.spoilme.openTag = function (tag, config) {
		var toggleButton = tag.children('.' + config.tag.controls).find('.' + config.tag.toggle);
		if ($.fn.spoilme.button(toggleButton, config) == config.text.open) {
			$.fn.spoilme.toggleTag(tag, config);
		}
	};
	
	$.fn.spoilme.notify = function (tag, info, config) {
		alert(info);  // simplest implementation
	};
	
	$.fn.spoilme.styleLegacy = function (tag, config) {
		tag.hide();  // should be hidden anyway, but just in case
		// we grab the spoiler title
		var spoilerTitle = tag.attr('title').toLowerCase().replace(/(\{|\})/gi, '');		
		// formating
		tag.addClass('spoileme-theme-legacy');
		tag.wrapInner('<div class="' + config.tag.wrapper + '" />');
		tag.wrapInner('<div class="' + config.tag.wrapper + '2" />');
		
		tag.prepend(
			'<div class="'+config.tag.controls+'"><small class="'
			+ config.tag.controls + '2"> '
			+ (config.use.local ? 'Thread: <input class="'
			+ config.tag.local + '" type="button" value="' 
			+ config.text.localeNo + '" />' : '')
			+ (config.use.global ? ' Board <input class="'
			+ config.tag.global + '" type="button" value="' 
			+ config.text.localeNo + '" />' : '')
			+ '</small> <b>Spoiler</b> for <i class="'
			+ config.tag.title + '">'+spoilerTitle+'</i>: <input class="'
			+ config.tag.toggle + '" type="button" value="'
			+ config.text.open + '" />'
			+ (config.use.scan ? '<input class="'
			+ config.tag.scan + '" type="button" value="'
			+ config.text.scan + '" />' : '')
			+ '</div>'
		);
		
		$.fn.spoilme.colorCodes(tag, config, spoilerTitle);
		
		tag.find('.' + config.tag.wrapper + ':first').hide();
		if (config.use.animation) {
			tag.fadeOut(30).fadeIn(config.animation.fadein);
		} else {
			tag.show();
		}
	};
	
	$.fn.spoilme.styleModern = function (tag, config) {
		tag.hide();  // should be hidden anyway, but just in case
		// we grab the spoiler title
		var spoilerTitle = tag.attr('title').toLowerCase().replace(/[{}]/gi, '');
		// formating
		tag.addClass('spoileme-theme-modern');
		tag.wrapInner('<div class="' + config.tag.wrapper + '" />');
		tag.prepend(
			'<div class="'+config.tag.controls+'"><a class="'+config.tag.toggle+'" href="#">'
			+ config.text.open+'</a> <small>' 
			+ (config.use.scan ? '(<a class="'+config.tag.scan+'" href="#">?</a>) ' : '')
			+ (config.use.local ? 'Thread: <a href="#" class="'+config.tag.local+'">'+config.text.localeNo+'</a> ' : '')
			+ (config.use.local ? 'Board: <a href="#" class="'+config.tag.global+'">'+config.text.localeNo+'</a> ' : '')
			+ '</small> | <b class="'+config.tag.title+'">'+spoilerTitle+'</b></div>'
		);
		
		$.fn.spoilme.colorCodes(tag, config, spoilerTitle);
		
		tag.children('.' + config.tag.wrapper).hide();
		
		if (config.use.animation) {
			tag.fadeOut(30).fadeIn(config.animation.fadein);
		} else {
			tag.show();
		}
	};
	
	// tests if a image is potentially a spoiler image
	$.fn.spoilme.isBadImage = function (img) { 
		return true;  // default: pretend every image is bad
	};
	
	$.fn.spoilme.colorCodes = function (tag, config, spoilerTitle) {
		// color codes
		if (config.use.colorCodes) {
			var clasification = null;
			if (spoilerTitle.match(config.type.holder.key)) {
				clasification = config.type.holder.tag;
			}
			if (spoilerTitle.match(config.type.speculation.key)) {
				clasification = config.type.speculation.tag;
			}
			if (spoilerTitle.match(config.type.danger.key)) {
				clasification = config.type.danger.tag;
			}
			if (clasification !== null) {
				tag.addClass(clasification);
			}
		}
	};
	
	$.fn.spoilme.button = function (tag, config, value) {
		if (typeof value == 'undefined') {
			// we need to return something
			if (tag[0].tagName == 'INPUT') {
				return tag.attr('value');
			} else {  // we assume its a anchor or similar
				return tag.text();
			}
		} else {
			// we need to assign the value
			if (tag[0].tagName == 'INPUT') {
				tag.attr('value', value);
			} else {  // we assume its a anchor or similar
				return tag.text(value);
			}
		}
	};
	
	// compacts into a cookie safe format
	$.fn.spoilme.pack = function (str) {  // FVN hash
		hash = 2166136261;
		for (var i = 0, size = str.length; i < size; ++i) {
			hash = hash * 16777619;
			hash = hash ^ (str[i]-0);
		}
		return hash + '';
	};

    
}) (jQuery);
Cookie CRUD, Plug-in code... (if not present the plug-in will turn off the cookie dependent features)
Code:
/**
 * cookie -- jQuery plug-in
 *
 */

/**
 * Just your average Cookie CRUD in a small package.
 *
 * @example $.cookie('cookie name', 'value', { life: 7 });
 * @desc Create a cookie (life is in minutes).
 * @example $.cookie('cookie name', 'value');
 * @desc Shorthand for creating a cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie.
 */
(function ($) {

	$.cookie = function (name, value, options) {
		var context = this;  // easy access to target
		if (typeof value != 'undefined') {
			// create|update|destroy code path
			var config = $.extend({}, $.cookie.defaults, options);
			
			// destroy cookie?
			if (value === null) {
				config.life = -1;  // kill eet!
				value = '';
			}
			
			var life = '';
			if (typeof config.life != 'undefined') {
				if (typeof config.life == 'number' || config.life.toUTCString) {
					var date;
					if (typeof config.life == 'number') {  // we assume minutes are passed
						date = new Date();
						date.setTime(date.getTime() + (config.life * 60 * 1000));
					} else {  //its not a date (necesarly) but quacks like one
						date = config.life;
					}
					life = '; expires=' + date.toUTCString();
				}
			}
			
			document.cookie = (name + '=' + encodeURIComponent(value) + life);
		} else {
			// get cookie
			var theValue = null;
			if ((typeof document.cookie != 'undefined') && document.cookie != '') {
				var cookies = document.cookie.split(';');
				for (var i = 0, size = cookies.length; i < size; i++) {
					var cookie = $.trim(cookies[i]);
					// Does this cookie string begin with the name we want?
					if (cookie.substring(0, name.length + 1) == (name + '=')) {
						theValue = decodeURIComponent(cookie.substring(name.length + 1));
						break;
					}
				}
			}
			return theValue;
		}
		
		return context;
	};
	
	$.cookie.defaults = {
		life: 60 * 24 * 1000
	};	
    
}) (jQuery);
Integarting with vBulletin 4.0.1
First I'm gonna assume you have the execution code in some script called query.executor.js
Based on your current directory structure for banners jquery plug-ins would probably go in something like as.javascript\jquery.plugins (by your conventions) so I'm just gonna assume that's the case.

Step I. Using the BB Code manager create a new tag, call it spoiler (no option), use the following for the code:
Code:
<div title="no title" class="spoiler">{param}</div>
Step II. Repeat step one only this time enable option and use the following code:
Code:
<div title="{option}" class="spoiler">{param}</div>
Step III. Go into Plugins & Products > Plugin Manager. Click on [Add New Plugin] and follow the bellow:
product: vBulletin
Hook Location: parse_templates
Title: jQuery Plug-ins
Plugin PHP Code:
Code:
// we need a minor snippet of CSS
$css = '<!-- jQuery Plug-ins --><style type="text/css">.spoiler{display:none;}</style><!-- End // jQuery Plug-ins -->';

// we append it to the head of each page
$template_hook[headinclude_css] .= $css;

// the following is the list of thing we want to add
$jqueryJs = array (
	"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js",
	"as.javascript/jquery.plugins/jquery.cookie.js",
	"as.javascript/jquery.plugins/jquery.spoilme.js",
	"as.javascript/jquery.plugins/query.executor.js"
);

// we turn it all into html
$jqueryJs_html = '<!-- jQuery Plug-ins -->';
foreach ($jqueryJs as $plugin) {
	$jqueryJs_html .= '<script src="' . $plugin . '"></script>';
}
$jqueryJs_html .= '<!-- End // jQuery Plug-ins -->';

// we append it to the footer of each page right after vbulletin's
$template_hook['footer_javascript'] .= $jqueryJs_html;
(any other setting accept defaults)

Save. Enable. All Done.
__________________
felix is offline   Reply With Quote
Old 2010-02-16, 06:46   Link #36
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
vB 4.0.1
  • "Annoying delays"

    Step I. Create New User Group and promote users to said group
    1. Go to Usergroups > Add New Usergroup
    2. Set "Create Usergroup Based off of Usergroup:" to "Registered Users" or if you have modified it to whatever we are. Hit Go.
    3. Type in the name (lets say Old Timers) and leave everything as is. After the group is created write down (or remember) the group's ID. If its 9, as it should be on a clean usergroup manager, no worries; otherwise (assuming you have created other user groups previously) write the number down and modify the plug-in PHP code.
    4. Go to Usergroups > Promotions,
      • set Usergroup to "Registered Users",
      • set Reputation Level to something non negative,
      • set Days Registered to "1001" (= 2.7 years, just a example -- possibly something above a year),
      • set Posts "1000" (example, or more -- there are newbies who register and come back after years of absence)
      • set Promotion Strategy to "Posts and Reputation and Date",
      • set Promotion Type to "Primary Usergroup",
      • set Reputation Comparison Type "greater or equal to",
      • set Move User to Usergroup "Old Timers" (group created previously).

    Step II. Create a Plug-in to overwrite the AdminCP option when the user in question belongs to he Old Timers group (assuming ID:9, alter if necesary).
    • Product: vBulletin
    • Hook Location: fetch_foruminfo
    • Title: Old Timers [Usergroup] Tweeks
    • Plugin PHP Code:
      Code:
      // assumtion: ID for 'Old Timers' [usergroup] == '9' 
      if ($vbulletin->userinfo['usergroupid'] == '9') { 
          /** Message Posting and Editing Options > Minimum Time Between Posts */ 
          $vbulletin->options['floodchecktime'] = 5;  // seconds 
      }
__________________
felix is offline   Reply With Quote
Old 2010-02-16, 11:33   Link #37
Gin
Senior Member
*Artist
 
 
Join Date: Apr 2009
Location: In your mom's pants
I wouldn´t say no to more smilies.
__________________
I hate most of you.
Gin is offline   Reply With Quote
Old 2010-02-16, 15:50   Link #38
Haak
Me, An Intellectual
 
 
Join Date: Apr 2009
Location: UK
Age: 33
I'd like the option where we can choose to have the Animesuki banner fixed on one particular.
Haak is offline   Reply With Quote
Old 2010-06-07, 08:18   Link #39
felix
sleepyhead
*Author
 
 
Join Date: Dec 2005
Location: event horizon
Quote:
Originally Posted by Haak View Post
I'd like the option where we can choose to have the Animesuki banner fixed on one particular.
Same. Or no banner.

-

Sphinx Search for vB4 [vbulletin.com]
__________________
felix is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 21:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
We use Silk.