Tag: php
anyutt82 announced the site http://www.edasovkusom.ru/. So it can be considered launched. I'm not into cooking, so I can't judge its content, but I worked on its software side and want to write about that. Before this I hadn't made such complex sites on Joomla, though initially nothing foretold trouble, except for the fact that the whole functionality and design was begging to be done on WordPress, but the client's categorical requirement was Joomla! The outwardly simple little site was handed over to a new programmer, and I went off on vacation to finish up the three online stores hanging on me.
Remotely I helped with building the site all week, but in the end the boss handed the development over to me entirely, since the deadline was running out and the project had to be finished urgently. The functionality turned out to be unusual, it was the first time we were making something like a blog on Joomla. I had to use the Tag component for adding tags to recipes and the MultiCategories component, which replaces the standard Content component, since a single recipe has to be in several categories. To display a thumbnail image in the intro text the JA News module was used.
All in all, I enjoyed the work on the project and it stuck with me. I see in the office it got the others pretty fed up, and some even cringe at it. But I like that kind of thing, I like it when the client knows specifically what they want, even if the requirements are a bit unusual and strict. That's better than when you have to come up with part of the site's functionality on the fly during the build, and then rewrite it on top of that when, after showing it to the client, it turns out they want to redo part of it.
I set up a library on my site using the BookLibrary component. Yes, the quality of the component leaves much to be desired, since it was originally written for Joomla! 1.0, doesn't use MVC, and everything in the code is jumbled together. But I couldn't find anything better for building a library for Joomla! Plus, thanks to its simplicity, some bits of the code can be tweaked to get proper display and operation. It would also be nice to attach SEF links to it, but after JoomGallery's SEF links that shouldn't be a problem, if only the will were there. If I end up doing it for someone, maybe I'll get around to little details like that — not for nothing did I work on an electronic library for my thesis in my 4th year, only it was in ASP.NET.
I did this not only to explore the component's capabilities, but also to organize my home library. I added only the books I bought myself. Two bookcases of my parents' books, my childhood books, and textbooks would be too much to add to such a catalog. It's a pity that the chance to buy literature for myself came only after I got a computer, by which point I'd almost stopped reading books... The desire is there, but I can't manage to read. The last work of fiction was "When the Mountains Fall (The Eternal Bride)" by Chinghiz Aitmatov, which I read over the course of the winter on a smartphone that I've since lost. I can't recall the work of fiction or non-technical book before that.
Today I added four more books to the library, three of them needed for professional work, and one finally about lions — a book by Craig Packer that more than one article about these big cats references. Here's the link to my library with books about lions and a few technical ones on development.
Since the rss2lj service by
david_m got blocked, I decided to figure out how to wire up sending entries to a blog from the site itself via PHP. I immediately found a simple class using XML-RPC, by
andreynikishaev. Only the script package itself had no way to send a post to a community and, as it turned out later, there was no way to disable autoformatting of the sent post.
I had to keep searching. I found how to specify the community in the usejournal variable in the LiveJournal API documentation, and there's also a link there about adding metadata to the post in the props variable, which includes disabling autoformatting via the opt_preformatted parameter. Only the class I downloaded didn't allow for passing nested parameters, as I understood it, so I had to rework it a bit, including the class for working with XML-RPC in the main script as well, although I could have downloaded a more advanced solution or written my own, but I didn't want to spend the extra time.
I spent about 4 hours on the whole thing, but most of the time went into adding news formatting for LiveJournal and the check for which news items had already been published. I apologize to those who, before lunch, had a bunch of duplicate news items crawling into their feed from
bigcats_ru. But now the entries get sent semi-automatically from the phpBB forum to LiveJournal, and if you set up cron, then automatically. Too bad there's just no time to search for and post news about big cats.
Finished my first site on Drupal 6: http://kddf.in.ua
Of course, there's still the move to do, fixing up the layout of the inner pages, adding the missing interface translations and optimizing for search engines, but the main part is done. I haven't figured the system out completely yet, I realize I didn't implement everything nicely and correctly. I didn't figure out how to make my own styles for Views or how to properly theme the existing ones, how to properly theme each menu of the site and specify paths to the theme files inside functions and templates. And other little things aren't implemented well either, I think it's fine for the first time, and I've already spent more than a full day of actual working time creating the site and moving the layout, with most of the time going into searching and learning how to implement and configure some things.
On the Joomla! sites I build, I use the JoomGallery component — even though it's not MVC, it's quite feature-rich, easy to configure, and works well. Until recently, I couldn't get SEF URLs working for the gallery.
Because of this, I used the gallery on sites without pretty links, and there was no need to optimize the gallery anyway — the main emphasis was always placed on the texts. During the week I found some free time and was in the mood to figure out router.php. In the end, I changed the logic for finding the matching category in the address a bit: I made it read from the database the whole list of category or photo names that match, then transliterated each name and compared it to the one I needed, and that way I could determine the right category or photo IDs. For this I wrote an additional function and added it after the modified database queries — yes, such a script consumes a bit more resources and takes longer to run, but for Joomla that's not a problem, if you compare it with the voraciousness of the core and the rest of the stuff.
When I copied the resulting router.php to a multilingual site running JoomFish, another problem turned up. The database queries already returned translated category and photo names, so they couldn't be matched against the names from the links. But this was solved easily. Since JoomFish overrides the database-access methods, in the script itself I added arguments to the queries of these methods indicating that translation isn't needed, and in the end everything worked. It may not be pretty that on the English version of the site the paths contain Russian transliterated names, but it's unlikely this can be fixed easily, plus in the other components with paths it's the same way.
You can download the new router.php for JoomGallery via this link. The script's code isn't perfect, but it works.
You can see the results of its work here: http://mebelok.com.ua/gallery (the first site I tested it on; since the photo names repeat, I added the ID to the addresses, so the matching photos are looked up not by name); http://bizukov.org.ua/ru/photo (a multilingual site, the IDs aren't output to the photo addresses, so you can fully verify how it works).
I became the third coder to work on the 'Big Cats' news feed script of the BIGCATS.RU web project. I added an RSS feed of the latest forum news to it. Thanks to this, I fully automated the site's news mailing on Subscribe.ru and set up a feed of big cat news to the LiveJournal community
bigcats_ru via the bot
mbashiri using the rss2lj service.
In short, anyone who wants to read news about big and not-so-big wild cats in their friends feed can follow the community
bigcats_ru - News from the lives of big cats or tell those who might find it interesting.