Hi there!
On my shared Serendipity installation, one blog is often posting links to picasa webalbums. They have huuuuge amounts of pictures, so hosting them myself seems not the best option. Additionally - by the original website design, not by my fault - the blog runs in a frame, and by default external links are opened in the same frame.
Recently picasa established a "security policy" that disallows their site from being shown in a frame (currently only working in IE8 and the newest FF). I asked in their forums, and the answers have been "we won't change that, you have to live with it" and "you can use the API for thst".
If I would be the one writing the blog entries, I would be fine with getting the API to work and using that. Sadly, the person who is writing the articles has not the slightest idea about what he is doing, so I definitely don't want to go that route.
Long story, one question: Is there a way to tweak serendipity, so that links to picasa.google.com open in target="_blank", while all other links stay untouched? I am a programmer, so I could modify code if necessary. But I am neither a php specialist nor do I have an idea how and where this could be achieved...
Links to Picasa open in new window
Re: Links to Picasa open in new window
Hi
you could use the regexp-plugin to format the links accordingly.
But wouldn't it be easier, in the long run, to get rid of the frame?
sincerely
you could use the regexp-plugin to format the links accordingly.
But wouldn't it be easier, in the long run, to get rid of the frame?
sincerely
Re: Links to Picasa open in new window
I'll have a look into that, thanks.onli wrote:you could use the regexp-plugin to format the links accordingly.
Most likely yes. I plan on removing the frames alltogether, but that will need some talk to be done. And I prefer the links not displaying error messages for months...onli wrote:But wouldn't it be easier, in the long run, to get rid of the frame?
sincerely
Re: Links to Picasa open in new window
Looks like that can do the trick quite easily. If I can get it to work, that is.
Currently the plugin is installed, visible in the interface, configured to run on everything. But the markup() function of the plugin is not called, or the results ignored. I tried to hardcode a $messagetext = preg_replace(/a/, b, $messagetext); into the plugin, but my entries stay as they are. Well, I guess I will have to do some further debugging
Currently the plugin is installed, visible in the interface, configured to run on everything. But the markup() function of the plugin is not called, or the results ignored. I tried to hardcode a $messagetext = preg_replace(/a/, b, $messagetext); into the plugin, but my entries stay as they are. Well, I guess I will have to do some further debugging
Re: Links to Picasa open in new window
I didn't test the plugin, but those issues are usually related to the cache. Uninstalling another markup-plugin, which purges the cache, usually helps - or testing in a new article.
Re: Links to Picasa open in new window
Helped, but in a different way than I thought it would.
I removed and readded another markup plugin as suggested. After that, the regexp plugin was gone from the list, too. Going back with my opera revealed it was in the list before, and I didn't accidently remove it. Readded the regexp plugin, and now it is working.
If someone is interested (even though this regexp is rather trivial)
Danke für die Idee und die anschließende Hilfe, onli!
I removed and readded another markup plugin as suggested. After that, the regexp plugin was gone from the list, too. Going back with my opera revealed it was in the list before, and I didn't accidently remove it. Readded the regexp plugin, and now it is working.
If someone is interested (even though this regexp is rather trivial)
Code: Select all
$regexpArray = array(
'SearchArray' =>array('/href="(http\:\/\/picasaweb\.google\.com\/[^"]+)"/i'),
'ReplaceArray'=>array('href="\1" target="_blank" ')
);Re: Links to Picasa open in new window
Happy it worked 
Gern geschehen.
Gruß
Gern geschehen.
Gruß