Lightbox V2 and the flickr sidebar...

Posted by Steve Longdo Tue, 23 May 2006 06:57:00 GMT

So to grant the flickr sidebar access to the powers of the lightbox script is a fairly simple trick, in your theme's views/plugins/sidebars/flickr/content.rhtml file (you can make this path and the file if it is not present in your particular theme.)

<% if @flickr -%>
<h3><%= @flickr.title  %> (<%= link_to "flickr", @flickr.link %>)</h3>

<div id="flickr">
<% for pic in @flickr.choose(count.to_i) -%>
  <div class="flickr<%= format%>">

<%= case format
          when 'square':
            link_to image_tag(pic.square, :alt => pic.title),
              pic.image.gsub!(/_m/,''),
              { :rel => 'lightbox[flickr]',:alt => pic.title, :title => pic.title }
          when 'rectangle':
            link_to image_tag(pic.thumb, :alt => pic.title),
              pic.image.gsub!(/_m/,''),
              { :rel => 'lightbox[flickr]',:alt => pic.title, :title => pic.title }
          end

 %>
</div>
  <% end -%>
</div>
<% end -%>

When XML is binary you have a XMLHttpRequest problem... 1

Posted by Steve Longdo Wed, 19 Apr 2006 23:55:00 GMT

Lesson learned the hard way on this one. I have been working with the FCKEditor and getting a strange error specifically:
Error: this.DOMDocument has no properties
Source: /javascripts/fckeditor_gecko_2.js
Line: 22
After pounding my head into my laptop for awhile and putting some whitespace into that file I figured out that I was getting a null response from the XMLHttpRequest for the fckstyles.xml file.

I tried loading it directly from the browser and was promped to save the file to disk. Normally it would open in the browser. Why would it think the XML file is binary? The xml mime-type mapping was removed from the Typo lighttpd.conf file. File this one under "want to know how to keep an idiot busy for hours"... *sigh*
Make sure that your lighttpd.conf has a mapping for XML if you are doing anything with XML.
mimetype.assign = (  
  ...
  ".txt"        =>  "text/plain",
  ".xml"        =>  "text/xml"
)

Search nearly working... 1

Posted by Steve Longdo Thu, 13 Apr 2006 23:39:00 GMT

I nearly have the search working the way I want. The word count it generates is based on words only. HTML is stripped as is any content between <code> tags. I notice that the current live search in Typo looks at the html content when making a match. So if you see any articles coming back with an empty Snippet block("") it is because your search matched something in a generated URL and no actual words in the article.
I am working on the best way to handle this behaviour. Maybe just list the links that appear in the article or provide a count of them.
Also I will be making hyperlinks in the balloons functional. I created new graphics for the balloon to see if IE will correctly display the new GIF (I knew PNG support in IE was bad, but this was my first personal encounter), I will know in a little bit when I get to work and can check it out in IE...
By the way the concept for this method of displaying search results is all Dunstan Orchard. I've just been making it work within Typo.

UPDATE1: IE is now showing search results. I had to resort to JavaScript, because of IE's limited support for CSS *:hover. Still looking at hyperlinks...
UPDATE2: Hyperlinks are in place amd working. For tags and comments also the snippet of text is now a link to the article.
UPDATE3: Added search term highlighting like Google Cache. This uses some JavaScript from: http://www.nsftools.com/misc/SearchAndHighlight.htm
Read more...

Older posts: 1 2 3 4 5 ... 8