Jump to content

tsdtsdtsd

Members
  • Posts

    70
  • Joined

  • Last visited

  • Days Won

    1

tsdtsdtsd last won the day on April 12 2015

tsdtsdtsd had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tsdtsdtsd's Achievements

Full Member

Full Member (4/6)

48

Reputation

  1. Thanks for all the answers guys. I changed the JS structure a bit to solve my problem. There are enough ways around this problem, but I still want to point out that I think that any kind of automation should be fail-safe as possible. A totally generic regex is not slightly fail-safe. It's not even code related, I could have "require(..." as a static text on a page. Don't get me wrong, I don't want to bash PW. As I said, I think there are enough ways to work around this problem. But an automation should be sane or at least point out it's obvious traps and disadvantages in the first place. Anyway, cheers for your help!
  2. Hi BitPoet, thanks for your answer. Sadly your solution is not an option for this site. Guess I will have to set proper namespaces by myself or find another workaround.
  3. Hi there, I recently updated to PW 3 and I'm using the AUTO-mode for the compiler. Everything worked like a charm, but now I'm getting a strange behavior which I would classify as a bug. I have the following in a template (which I'm including in the sites real template): <script> require(['hljs'], function(hljs) { hljs.initHighlighting(); }); </script> Plain old HTML+JS. Now, when I open up the site, the compiler made this: <script> require(\ProcessWire\wire('files')->compile(['hljs'],array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true)), function(hljs) { hljs.initHighlighting(); </script> Seems to me that the compiler touches something that it should not. I couldn't find anything related here... bare with me if this is something well known. Cheers
  4. Ahahaha this is great Thanks for Gor mate, awesome product!
  5. Hi guys, I'm learning Go since a few weeks and every now and then I stumble over some great tools for web development. This one I found yesterday is awesome if you work with large scale systems: https://github.com/buger/gor/ Under the hood it works with raw socket connections, like a sniffer, pcap or wireshark, but without using the well known libpcap. I guess the performance impact is the smallest possible. Take a look at the github page if you like, it has some very interesting features. Maybe a handy tool for some of you Cheers
  6. I have a similar problem, but I guess there isn't much to do here. The problem derives from MySQLs fulltext search. If you have root access, you can always change the letter minimum (http://stackoverflow.com/questions/1585611/mysql-full-text-search-for-words-with-three-or-less-letters) and rebuild indexes (be aware of performance impacts). SQL fulltext searches are very basic and imperfect. They are fine for most of us, but if you need a real reliable, tolerant/fuzzy site search you would need to implement something more professional. There are many products on this topic, like elasticsearch (awesome), Lucene or Solr, but they all need a server with root access. The topic is comprehensive. Easy to learn, hard to master. If you can't be bothered with that, there is still this Lucene implementation from Zend, which is just a buch of PHP files without a full blown server (http://framework.zend.com/manual/current/en/modules/zendsearch.lucene.searching.html), badly documented though. It's a nice start and you can learn the very basics of search engines/indexers with it. But, naturally to PHP, this solution will not be able to handle big amounts of data. Af few thousand documents in the index and the fun is over already.
  7. @SiNNuT Thanks for the feedback! The contrast thing is worth a look, I'll see what I can do. And nice catch on the typo
  8. I just relaunched a new version of the site. Jsut a graphical overhaul, still nothing extremely interesting to see, still only in German. But maybe I can get some feedback http://www.about-orkan.de
  9. This topic can be handled in a simple way like Tom suggests (or even simpler) or in a very complex way, like using machine learning algorithms and tools (e.g. https://prediction.io/ From a non-technical view, you want to recommend: - products that are similar (comparing attributes/specs of products) and/or - products based on behaviour of other visitors (user A looks at product X; previously user B, who also looked at product X bought a similar product Y, so recommend Y to A). Another simple way could be to reccomend based on visit statistics and categories: the users looks at a t-shirt -> recommend him the most viewed t-shirts.
  10. I had the same problem a few days ago when I tried to add 40 highres images in one go. On localhost. There were only like 3 images in the assets folder, rest didn't make it, except into the db. I mixed things up pretty bad, sorry. Had that installation still lying around and refreshed my memory: I had a problem with images, but not nearly close to this one (was about generating lots and lots of thumbnails).
  11. Hey tpr, you are absolutely right and tbh I didn't think of that option. The reason is maybe a little specific to my projects. Usualy I build my sites out of individual elements/widgets, which are placed on/called by the templates. These elements get rendered by a new TemplateFile object. I could pass the $bigList along to the $teaser to use your method too. Guess it made more sense for me to make the elements as autonomous as possible, with little to no dependencies. So they rather fetch information as they need it, instead of depending on the template. Thought that makes my code a little better readable and nicer to follow. And I have a reusable workflow Cheers
  12. Oh, and here is already a downer for you: Beware of thy cache! When using markup cache, this module is naturally not able to collect the pages from cached code. Subsequent selectors may include pages from cached content. Currently I'm storing some metainfo to the cache as an addition to evade the problem on personal projects. Not sure how this could be handled more globally.
  13. Hey there, this is a little helper I'm using on some sites, thougth mabe someone is interested. With this simple module you can easily add pages to a global blacklist and use it for filtering of subsequent selector queries. The idea is the following: Let's assume you have something like a blog. You have a simple list of articles in the main column of the page, showing the newest articles from every category. Also you have a small teaser on the right sidebar, showing the latest articles filed under a special category, like news. Now you possibly don't want that teaser to include articles, which are already in the big list in the main column. PageBlacklist is a small module, helping you to implement blacklisting on for such cases. Assuming the scenario on the top, your code could look something like this: // Retrieve the maincol list and add to blacklist $bigList = $pages->find('template=article, sort=-created'); $pageBlacklist->add($bigList); // Possibly you will output $bigList here // Retrieve the sidecol teaser, excluding blacklisted articles $teaser = $pages->find('template=article, parent=news, sort=-created, ' . $pageBlacklist); // Basically, this will alter the selector to something like: // 'template=article, parent=news, sort=-created, id!=1012,1031,1153' I would love to hear ideas to improve this helpfull little module. You can find PageBlacklist on GitHub: https://github.com/tsdtsdtsd/PageBlacklist
  14. Thanks horst. I'll just change it, but still, i'm puzzled and would love to know the cause. I couldn't reproduce this, neither on linux nor windows. Sometimes I just want to slap myself really hard... I did not get the error previously because I'm running PHP 5.6, where my code is allowed, but not in older versions. I'm already so used to 5.6 -.- Prior to 5.6, properties are not allowed to be expressions (in my case, the concat of constants and strings). Thanks guys & cheers
  15. Hi nfil, thanks for the report, but could you possibly give me more information? I couldn't reproduce your issue. There's really not much on line 40, I'm a little puzzled protected $_pathToTemplates = DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
×
×
  • Create New...