Edukira salto egin | Salto egin nabigazioara

Tresna pertsonalak

Eibarko peoria, San Blasa baino hobia
Hemen zaude: Hasiera / Blogak / Ingelesen hilerria / The English Cemetery

English-language version of Luistxo Fernandez's blog

Images embedded in Coreblog entries using entry editing form

Luistxo Fernandez 2005/04/27 10:15

Images in Coreblog entries using entry editing form: Original recipe by Brady Davis and Jeffrey Hicks (from Blogplot ), now reused by CodeSyntax for its new modified Coreblog version, and republished here for documentation purposes.

See how it this feature works in our demo, or in sites related to the Blogplot crew, the inventors of it: at Blogplot.com or at JRHicks.net. This was documented last year as well at the old Coreblog-en list, but indentation was not preserved in the archive's code, so we republish it now.

Begin Recipe

Tested with:

    COREBlog 0.53b    Photo 1.2.3 http://www.zope.org/Members/rbickers/Photo/    ImageMagick 5.5.7.11    Zope 2.6.2   * Python Version 2.1.3 

by CodeSyntax: We have tested it with COREBlog 1.1 and Zope 2.6.1b1

Recipe

1. Backup your stuff

2. In COREBLog product folder on fileystem in import modules sections of Entry.py add:

  from OFS.ObjectManager import ObjectManager 

3. Scroll down and change the class Entry definition to extend ObjectManager as follows:

  class Entry(ObjectBase, ObjectManager, Management.Tabs,Undo.UndoSupport): 

4. Scroll down and add this list item to the manage_options list:

  {'label':Images,'icon':'', 'action':manage_images, 'target': 'manage_main'}, 

5. Scroll down and add these statements near the other similar HTMLFile statements:

     security.declareProtected(ManageCOREBlog, manage_other)     manage_images = HTMLFile(dtml/manage_addImage,globals()) 

6. Scroll down and add the following methods and security statements inside the class body by CodeSyntax: BE CAREFUL WITH INDENTATION !! :

     security.declareProtected(AddCOREBlogEntries, manage_addImageScript)     def manage_addImageScript(self):         context = self         if context.REQUEST.has_key(pic1):             file = context.REQUEST['pic1']             name = context.ZopeTime().strftime(img_%b_%d_%Y_%M_%S)             context.manage_addProduct['Photo'].manage_addPhoto(name,name,file)             photo = getattr(context,name)

for property in [placement,border,display_size,zoom,'caption']: photo.manage_addProperty(property, context.REQUEST[property], string)

if context.REQUEST.has_key(deletebox): ids = context.REQUEST['deletebox'] context.manage_delObjects(ids) return ''

security.declareProtected(View, images_top) def images_top(self): """ images_top method """ photos = self.objectValues(Photo) results = '' for p in photos: placement = p.getProperty(placement) if placement.find(top)>=0: if placement.find(left)>=0: float = float: left; margin-right: 1em; margin-bottom: .5em; else: float = float: right; margin-left: 1em; margin-bottom: .5em; tag1 = p.tag(display=p.getProperty(display_size), alt=p.getProperty(caption), css_class=None, style=border: %s; %s) tag2 = tag1%(p.getProperty(border), float) zoom = p.getProperty(zoom) if zoom.find(no zoom) >= 0: tag3 = tag2 else: tag3 = '<a href="%s?display=%s">%s</a>'%(p.absolute_url(),zoom,tag2)

results = '%s%s'%(results, tag3) return results

security.declareProtected(View, images_bottom) def images_bottom(self): """ images bottom method """ photos = self.objectValues(Photo) results = '' for p in photos: placement = p.getProperty(placement) if placement.find(bottom)>=0: tag1 = p.tag(display=p.getProperty(display_size), alt=p.getProperty(caption), css_class=None, style=border: %s;) tag2 = tag1%(p.getProperty(border),) zoom = p.getProperty(zoom) if zoom.find(no zoom) >= 0: tag3 = tag2 else: tag3 = '<a href="%s?display=%s">%s</a>'%(p.absolute_url(),zoom,tag2)

results = '<div style="margin-top: 1em;">%s%s</div>'%(results, tag3) return results

security.declarePrivate(getId) def getId(self): return self.id

7. Save.

8. Create new file in Filesystem Products/COREBLog/dtml. Save the file as manageAddImage.dtml Copy and paste the source code found in the APPENDIX after step 11.

9. Restart Zope or Refresh the COREBlog product from the Zope Management Interface (ZMI)

10. From ZMI customize "entry_body" COREBlog skin. Insert dtml statements <dtml-var images_top> and <dtml-var images_bottom> around your body. Below I show a clip of code to show where I inserted my statements.

by CodeSyntax: this change is already made in the entry_body DTML Method in the ZEXP:

  <p>  <dtml-var images_top>  <dtml-if "format == 0">  <dtml-var body newline_to_br>  <dtml-elif "format == 1">

<dtml-var body fmt=structured-text> <dtml-elif "format == 2"> <dtml-var body> </dtml-if> <dtml-var images_bottom> </p>

11. You should be done. Enjoy.

APPENDIX

# manageAddImage.dtml :

   <dtml-var manage_page_header>   <dtml-var manage_tabs>

<dtml-var manage_addImageScript> <p>Add and manage images</p> <form action="manage_images" method="POST" enctype="multipart/form-data"> <table cellspacing="1" cellpadding="0" border="0"> <tr>

<td class="list-header" valign="top" align="left"> <div class="form-label">

Image </div> </td> <td valign="top" align="left">

<input type="file" name="pic1"> </td> </tr> <tr> <td class="list-header" valign="top" align="left"> <div class="form-label" style="white-space: nowrap;">

Placement in entry </div> </td> <td valign="top" align="left"> <select name="placement"> <option SELECTED value="top right"> top right <option value="top left"> top left <option value="bottom"> bottom </select>

</td> </tr>

<tr> <td class="list-header" valign="top" align="left"> <div class="form-label" style="white-space: nowrap;"> Display Size </div>

</td> <td valign="top" align="left"> <select name="display_size"> <option value="tiny"> tiny (65x65) <option value="thumbnail"> thumbnail (100x100) <option SELECTED value="xsmall"> xsmall (200x200) <option value="small"> small (300x300) </select>

</td> </tr>

<tr> <td class="list-header" valign="top" align="left"> <div class="form-label" style="white-space: nowrap;"> Zoom Size </div>

</td> <td valign="top" align="left"> <select name="zoom"> <option value="no zoom"> no zoom <option SELECTED value="small"> small (300x300) <option SELECTED value="medium"> medium (500x500) <option value="large"> large (800x800) <option value="original"> original </select>

</td> </tr>

<tr> <td class="list-header" valign="top" align="left"> <div class="form-label" style="white-space: nowrap;"> Border </div>

</td> <td valign="top" align="left"> <select name="border"> <option value="0px"> 0px (No Border) <option SELECTED value="1px solid black"> 1px solid black <option value="1px solid black"> 2px solid black </select>

</td> </tr>

<tr> <td class="list-header" valign="top" align="left"> <div class="form-label" style="white-space: nowrap;"> Caption </div>

</td> <td valign="top" align="left"> <input type="text" name="caption" size="40"> </td> </tr>

<tr>

<td> &nbsp; </td> <td> <input type="submit" name="AddImage" value="Add Image"> </td> </tr>

</table> </form> <dtml-let entry_id=id> <dtml-in "objectValues(Photo)"> <dtml-let photo=sequence-item> <dtml-if sequence-start>

<form action="manage_images" method="POST"> <table cellpadding="0" cellspacing="0" width="100%"> <tr class="list-header"> <td align="left">Del</td> <td class="list-item" align="left"><div class="list-item">Image</div></td>

<td class="list-item" align="left"><div class="list-item">Position</div></td> <td class="list-item" align="left"><div class="list-item">Display size</div></td> <td class="list-item" align="left"><div class="list-item">Zoom</div></td>

<td class="list-item" align="left"><div class="list-item">Border</div></td> <td class="list-item" align="left"><div class="list-item">Caption</div></td> </tr>

</dtml-if>

<tr class="<dtml-if sequence-even>row-hilite<dtml-else>row-normal</dtml-if>"> <td> <input type="checkbox" name="deletebox" value="<dtml-var title_or_id>">

</td> <td valign="top" align="left"> <a href="<dtml-var "photo.absolute_url()">"><dtml-var "photo.tag(display= tiny, alt=photo.getProperty(caption), css_class=None, style=margin: 2px;)"></a> </td> <td align="left"><dtml-var "photo.getProperty(placement)"></td>

<td align="left"><dtml-var "photo.getProperty(display_size)"></td> <td align="left"><dtml-var "photo.getProperty(zoom)"></td> <td align="left"><dtml-var "photo.getProperty(border)"></td> <td align="left"><dtml-var "photo.getProperty(caption)"></td>

</tr>

<dtml-if sequence-end> </form> </table> &nbsp;&nbsp;&nbsp;<input type="submit" name="Delete" value="Delete">

</form> </dtml-if> </dtml-let> </dtml-in> </dtml-let> <dtml-var manage_page_footer>

Here we are, the Basque bloggers

Luistxo Fernandez 2005/04/19 11:43

Here we are, out of the closet: the Basque Bloggers. We blog in Basque, that strange language, not yet at the Bloglines interface (unlike Klingon), spoken by juist 0.6 million people. It was election day around here last sunday, april the 17th, and we met at the first Basque Blogs & Beers at Elgeta, the Espaloia cafe in this town in the mountains, just 1000 people living there.

goitik.jpg

It's nice Espaloia. Wi-fi connections, macs for users to get online, those polyspam yellow armchairs designed for The Simpsons... That big screen, alternating images from our blogs, moblog posts by e-Gor Leturia and the election results in the local Basque TVs: there's a nice local tv there also, GoiTB, translatable like Hi-TV, for High Altitude, or something like that.


We were 21 bloggers. 18 of us at the official photo, and three extras in the other.

fli1.jpg

fli2.jpg

Go to Flickr to identify ourselves: name and surname, blog and URL. The main one and this for the extra trio It's cool that flash app at Flickr to mark square captions at pictures. If you don't like Flash, there's a plug-in for Firefox to view those. Check Lickr

As for me, there I am with my beloved Bloglines t-shirt, drinking a beer.

egor.jpg

Elgeta is cool. It's my father's birthplace. There, up in the mountains. We don't have Google Maps round here, but there's b5m and there you can see the location at different scales, from the 1:700000 map of Gipuzkoa, the Basque province where Elgeta is located (but the locals have a smooth Bizkaian dialect, not Gipuzkoan), to the ortophoto at 1:2000.

elgeta1.jpg

elgeta2.jpg

elgeta3.jpg

elgeta4.jpg

No that you have located and identified us, you can bomb us. Blogari euskaldunak gara, eta harro gaude.

Yes, I love Bloglines, and I would like it to be better

Luistxo Fernandez 2005/04/06 10:02

When Bloglines merged with Ask Jeeves, I read this post at the Jeeves bossblog. They offered 200 t-shirts; I wrote, and I got mine! It crossed the Atlantic, really, to reach the Basque Country. So, I already wear it at my office, just like Jeeves9000, Mark Fletcher himself and others do (see the video )

I hope the merger is for good. It's not the first time a search company buys something at Mark's shop. When eGroups became Yahoogroups, we could expect improvements. Yet, the experience hasn't shown that, and Mark himself has wrote about it.

Particularly, eGroups had a couple of odd features: awful search, and not very convincing i18n. Yahoo hasn't done anythong to improve searches in Yahoogroups, for reasons difficult to guess.

Now, the issue is that Bloglines itself has similar problems like those at eGroups at the time: i18n attempts haven't been very good (the Spanish interface is awful, for instance), and the searching capabalities of Bloglines are bad. Will Ask Jeeves improve the search part? They should. Regarding i18n, ummm, Ask Jeeves doesn't look focused on that... They should approach the issue with an open mind, and open practices. I would love to see that. Love to see Bloglines in Basque some day.

BTW, I am not the only one at my dotcom to wear trendy T-shirts. Here I am with the Pink Panther and Jatsu Argarate, software engineer at CodeSyntax, and bass guitar player at Kokein, a pop-rock group with a belly-dancing singer.

Happy birthday to me

Luistxo Fernandez 2005/03/31 10:02

The English Cemetery is one year old. The celebration was last week.

I am pretty happy with my trilingual experiment. My broken english has not been subject to harsh critic. But I have attracted too much trackback spam lately. I will probably surrender to that attack and eliminate trackbacks.

Last year when the Cemetery was created, there were perhaps about half a dozen basque personal blogs. Now they might be around 100. Last year, in March, this was the only Basque Coreblog. Now there are about 30, and mine is the ugliest (but I am particularly fond of the layout).

Happy birthday to me.

Sociolinguistics at the Long Tail

Luistxo Fernandez 2005/03/31 09:40

I wrote an article some days ago about The Long Tail and the blogosphere. I think it's the first introduction to the long tail concept or meme written in Basque...

It's been republished by a website dedicated to the Basque language. That led me to think again about the position of languages in relation to the Long Tail issue. Given that the Long Tail is an actual fact in the realm of blogs, I have a personal suspicion (and some hope): The sociolinguistics of blogs is different from the other sociolinguistic facts that happen at other media.

In mass media, a minority language has terrible disadvantages. But in the blogosphere's long tail, in that flat region consisting of a myriad blogs, each one with its own micro-audience, the average blog has the same potential, be it in English or in Basque. In the future, everyone will have 15 subscribers. I read somewhere that version of the famous Warhol phrase (cannot find the quote's origin now). That will be true for English bloggers as well as for Basque bloggers. An English blog has, obviously, opportunities to become much more read or subscribed that anything a Basque may conceive. But that's only for those that are located on the left side of the Long Tail curve. But the average blog, most blogs, are not there, but on the flat side, on the l-o-o-o-o-ong tail. There, they are undistinguishable from the average Basque blog.


The cost for personal media, blogs, is zero. No disadvantage there either. In mass media, that's radically different. Costs are much bigger, because market laws work powerfully against the income possibilities of the minority language media. And when media are born in a minority language, they can only cover a part of the interests of users. Only the dark side of the Long Tail (see image above) can be covered by Basque language TV or papers: For instance, in Sports, there is information about soccer or cycling in Basque media, but not a single line about chess. However, we just need an chess-fan with a blog to post things in Basque, and there it is, it will have its microaudience...

However, this optimistic viewpoint of mine is not proven by anything. Just a thought. Maybe studies will come.

Moreover, I think that what I say applies only to individual blogs. On the blogosphere level, the community or communal voice that creates new info, opinions or memes that expand from one blog to another, or from blogosphere into non-virtual society, there, it's different: the size of blogosphere in a given language has true importance, I guess. Not only by the numbers of bloggers than can unite to create a collective voice. Also because aggregation tools work much more smoothly in those languages, and contribute to expand ideas fastly in English than in Basque.

The most elegant Coreblog in the world

Luistxo Fernandez 2005/03/02 14:19

Not very humble from my part, but I will say it anyway: This is the most elegant Coreblog in the world, Faroa , the Lighthouse in Basque.


The merit in its conception goes to Mikel Larreategi (the coder) and Maite Rementeria (the designer), both Corebloggers, co-workers of mine at Codesyntax:

Those two follow a Movabe-Type-like template, based on the MT 2.6x template, and adapted for Coreblog based in a template published last year by Jeff Hicks. The new Faroa follows a newer template, MT 3.0. Besides that, this new blog has interesting features:

  • Editing and managing interfaces taken out of ZMI
  • Date is editable. You can change date & time of posting, whenever you want.
  • Image addition and management.
  • Comment and trackback control interfaces integrated into the general entry management view
  • A micro-CMS so the user can manage fixed content, upload files and
  • Template changes only through the CSS, but the CSS can be directly accessed and edited by the user.
  • All that is localised in Basque, using Localizer

I have planted an image with some of these features at this entry. There you have my the new /edit interface, you write that after the article-ID and the user can edit the content, view information about the feedback, upload and manage images...

These features of Faroa will be shared by a whole communuty of Coreblogs. New blogs will follow there, at Goiena.net. This site is a community-based local newssite. Goiena is a cooperative enterprise: it manages a magazine with a tabloid format (twice a week), two local radios, a local TV station, and several web projects, directly run, or for customers that hire Goiena to manage them. They have advertising and design spin-offs working in their network as well. They produce communication in Basque, but for customers, they are multilingual in their scope. They are based in the 10 or so towns around Mondragon, in the Basque province of Gipuzkoa.

Now Goiena is entering into community blogging: this is truly a multimedia local ortganization that can be an example for others working with minority languages. An example in the usage of software, as well: their web operations are based on Zope, nicely localised (we want to believe) by our company, CodeSyntax,

The author of Faroa is also a noticeable Basque journalist, and someone I can be proud of knowing personally: Joxe Aranzabal. I wrote about him in English briefly at my site recently

Basque tagging experience

Luistxo Fernandez 2005/02/10 17:57

Threads and discussion at delicious-discuss, the mailing list, about tagging styles and strategies.

Brian Del Vecchio talks about group tagging, people tagging things through del.icio.us to be read by an audience elsewhere... He mentions a Basque experiment we launched back in september.

Well, this is to comment that the Basque experiment is very much alive, and it's truly been a succesful initiative so far.

That experiment begun in september and it works smoothly. Today someone group-tagged Charles' and Camilla's wedding plans with sustaturako so it appears here at Sustatu.com's frontpage (last 3 links on the side menu under Jamaika) and here , the Jamaika page

Explained how it works here

As for tagging styles and strategies (the discussion at the list): Basque users tag things like anyone else, I suppose: some using many tags, others using personal keywords... some post specifically for that Sustatu.com experiment,

See http://del.icio.us/tag/sustaturako with some users even using del.icio.us only for that single purpose: make an annotation at Sustatu.com's collective section. Look at http://del.icio.us/Itzala

I suspect that this Itzala must be a del.icio.us user with another more public username (logged in Firefox, for instance) and then this alternate username just for the purpose of feeding Sustatu. The username is suspicious, also, meaning the Shadow in Basque...

What Basque users do really do different from most del.icio.us users is take some time typing personal titles and descriptions in Basque. We do take time describing what we find... Most people don't.

There's also been a surge in Basque usage of del.icio.us since this was used in Sustatu.com, and a core of highly interconnected Basque users has risen: interconnected, but not necessarily openly. My del.icio.us/rss/luistxo feed has 31 Bloglines subscribers, but I only know 6 of the public ones...

However, that has resulted in high repetition patterns among Basques. If some Basque has tagged X, you may expect others may probably do so. For instance, this Spanish page... 8 people has bookmarked it. 4 of them have commented it in Basque, and of the others, two are Basques that I know.

So, what does all this mean? Don't know for sure, but del.icio.us rocks, the collective usage of it is a very practical thing, and we only need 3 things: i18n, i18n, and l10n (the latter, leave it to us, make del.icio.us openly translatable and it will be in Basque, guaranteed).

We, in the meantime, keep working. Just launched a Basque newsfeed aggregator last week, Aurki.com , sort of Bloglines, Google News and Planet Planet all in one: a public aggregator and newsreader for 150 or so Basque RSS feeds of the net. We had a doubt: should we add RSS feeds of Basque del.icio.us users?

We finnally decided for a bunch of tag RSS feeds for a specific section Charles and Camila also present there, of course... sustaturako is the single Basque word more tagged...

The bunch of selected Basque tags is: journalism, For Sustatu, pictures, Basque (in English and/or French), blogs, Basque (in Basque) and books.

Stop political trials against Basque independentist movements

Luistxo Fernandez 2005/02/10 17:46

Now the truth, check regularly this site in English

araitz1.jpg araitz2.jpg

These pictures of Araitz Zubimendi handcuffed were taken by Bob Edme for Associated Press on Feb., 4, 2005 and published the following day by newspapers of the Spanish media groups Vocento and Prisa.

Permalinks and multiple feeds at Gmane

Luistxo Fernandez 2005/02/02 17:33

It's nice to see that the blog thing of Gmane advances... I have caught some testimonials over there like this one

Now finnally there is a permalink feature, and there are multiple feeds that point towards the blog interfaces... Here's the look of a permalinked message of mine. The feeds remain experimental so far, but can be found at the directory version of each group as in dir.gmane.org/gmane.discuss That's fine, and I find it quite logic. RSS-subscribers are probably more prone to bloglike interfaces than to the other one.

On the other hand I feel that there should be a way to switch between the two single-message interfaces, the classic and the blog-like:

  http://article.gmane.org/gmane.discuss/7459  http://permalink.gmane.org/gmane.discuss/7459 

as well as between the threaded interfaces. Looking at a thread at http://thread.gmane.org/gmane.discuss/6733 you change the interface in the pulldown menu, and you dont go to http://comments.gmane.org/gmane.discuss/6733 but to blog.gmane.org/gmane.discuss

Design competition

On the other hand, the design competition that Lars the Gmanemaster proposed seems to have attracted no designers at all.

I am not a designer. I cannot dare to offer a CSS proposal of my own... Here's my contribution, instead, the Gmane blog buttons: Gmane rocks! Gmane blogs!

 



Well. Not so difficult to achieve. I just used Luca's brilliant button maker ;-)

i18n

Now that RSS's and blogalization have advanced so far, I wish Gmane could return to the i18n steps taken last autumn. The Classic Interface begun beind adapted very nicely. I don't know if Lars' to-do list is very long, but it would be great to see Gmane advance in that direction too.

Deleting trackback spam

Luistxo Fernandez 2005/02/02 08:31

Our coreblogs at Eibar.org also hit by the great trackback spam assault of yesterday, Feb. 1, 2005. After the exchange of messages at Coreblog-en, the mailing list, we produced our own python script to be run in Zope (updated with a variable factor), create a script and on the parameter list put spammer=xxx,then the code as follows::

  for i in range(1, 300):     try:        ent = context.get_entry(i)        for com in ent.trackback_list():           if com.title.startswith (spammer):              ent.deleteTrackback(int(com.id))              print "deleted %s's comment" % com.title     except:         pass  print "Done."  return printed 

Being this site a community of coreblogs we placed that at the root like www.eibar.org/scriptPLACEDhere and our main blog's evil trackbacks were deleted (as far as you have less than 300 entries...), but it also worked with any blog placed below like www.eibar.org/blogak/teknosexua/scriptPLACEDhere?spammer=texas or www.eibar.org/blogak/sarasua/scriptPLACEDhere?spammer=cybersex or any other name variable that we may introduce depending on the spammer of the day.

scriptPLACEDhere is just a dummy name. We used another ID for the script.

Aurkezpena
LUISTXO FERNANDEZ

Luistxo works in CodeSyntax, tweets as @Luistxo and tries to manage the automated newssite Niagarank. This Cemetery is part of a distributed multilingual blog (?!). These are the Basque and Spanish versions:

Ingelesen hilerria

El cementerio de los ingleses

 

Subscribe to the Cemetery: RSS entries / RSS comments | By email.

My cultural consumption in English: 2012/13 | Television | Movies | Books

Creative Commons by-sa