Jump to content

dreerr

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by dreerr

  1. My next project is to develop is an SMS (text message) auction tool. So users can send a text to a gateway number and the gateway is fowarding all texts to a callback URL on my server. I want to manage all of this data in PW, so all of the incoming messages should be saved in PW, the approximative usage will peak at about 3-4 texts per second. Each text has to be processed, so DB queries have to be made (article, current highest bid, confirmation texts, etc.) My questions: * Is it wise to use the PW API for this? As there are only pages in PW, I would have to create a lot of pages with my type 'message'. * Will this use a lot of memory on the server? Would I need an above average web hoster for this? * Is a different approach better using the API of PW? Or maybe something totally different but as simple as PW? Thanks, all the best, Julian.
  2. Thanks guys, bit to tired today, maybe forgot to save the file working fine here!
  3. Dear Community, Trying to do add some field values programmatically, it works fine like this: // field 'author' does not exist in template $page->author="{$page->author_first} {$page->author_last}"; echo $page->author; // prints "John Doe" due to my structure it would be nice to have this within a function with passing by reference, sadly it does not work like this: function renderAuthorInfo(&$page) { $page->author="{$page->author_first} {$page->author_last}"; } renderAuthorInfo($page); echo $page->author; // Not working What am I missing here? Or is it just not possible to do it like this with PHP objects? The code is only an example, I'm not actually trying to put first and last name together, but something more complex.
  4. I thought so that this might be because of dev-Branch, thanks for confirming it! Works now...
  5. I'm at the beginning of a new page and experience odd behavior of the Pagination. I activated the Pagination in the URLs tab and only used the Example #2 from http://processwire.com/api/modules/markup-pager-nav/ But when I try to get to access another page I get to page1 again, page2 is also removed from the URL again. Example here http://www.wp11196092.server-he.de/werke/auf-papier/ whole code of the template $o; $works = $pages->find("parent=$page, limit=8"); foreach ($works as $work) { $thumb=$work->image->size(250, 250); $o.="<li><a href='{$work->url}'> <figure> <img src='{$thumb->url}' alt='{$work->title}'> <figcaption>{$work->title}</figcaption> </figure> </a></li>"; } $o='<ul class="thumbs">'.$o.'</ul>'.$works->renderPager(); $out->addArticleWithNav($o,$page->siblings); Using 2.3.1
  6. Thank you very much for the heads up! Few hiccups, was not able to get it working, so I did a wrapper around the whole text with
  7. Hey Nico, Great module, will come in very handy with my latest project. I have a question if it is possible to do the following with the shortcodes: An Input like Lorem ipsum dolor sit amet, consectetur adipiscing elit. [footnote]I’m quoting here![/footnote] Morbi volutpat, enim in scelerisque tristique, tortor lectus tincidunt nisi, sit amet pellentesque sem nibh non enim. [footnote]Some other quote![/footnote] Etiam pharetra a metus ac aliquet. Sed posuere nibh eget lobortis pretium.[footnote]Here again![/footnote] Nunc commodo ut ante id placerat. to render an output outside the shortcodes lke this: Lorem ipsum dolor sit amet, consectetur adipiscing elit. (1) Morbi volutpat, enim in scelerisque tristique, tortor lectus tincidunt nisi, sit amet pellentesque sem nibh non enim.(2) Etiam pharetra a metus ac aliquet. Sed posuere nibh eget lobortis pretium.(3) Nunc commodo ut ante id placerat. (1) I’m quoting here! (2) Some other quote! (3) Here again!
  8. Had the same problem, upgrading to PHP 5.4 solved it.
  9. To both of you: Grüezi from Vienna @Soma: Yes this is of course a better approach to set a score and then sort by it. Already have it up and running, works like a charm @Wanze: I'm sorry I haven't tried your method, because I was unsure if it really counted only the related categories or all of them. Glad to be on ProcessWire, will make a T-Shirt
  10. Okay maybe this is a bit too complicated, but it could be my first attempt for a module: In this case I have videos with categories attached through a page field. Example: Video1: Categories: Nature, Flowers, Red Video2: Categories: Nature, Weather, Blue Video3: Categories: Nature, Stone, Red In the video Template I want to display related clips, sorted by most similar categories. If I see Video1 the similar videos should be: Video3, then Video2. My attempt would be to make multiple find() with a combination algorithm, abstracted like here: Array ( [0] => Array ( [0] => a [1] => b [2] => c [3] => d ) [1] => Array ( [0] => a [1] => b [2] => c ) [2] => Array ( [0] => a [1] => b [2] => d ) [3] => Array ( [0] => a [1] => c [2] => d ) [4] => Array ( [0] => b [1] => c [2] => d ) [5] => Array ( [0] => a [1] => b ) [6] => Array ( [0] => a [1] => c ) [7] => Array ( [0] => a [1] => d ) [8] => Array ( [0] => b [1] => c ) [9] => Array ( [0] => b [1] => d ) [10] => Array ( [0] => c [1] => d ) [11] => Array ( [0] => a ) [12] => Array ( [0] => b ) [13] => Array ( [0] => c ) [14] => Array ( [0] => d ) ) But I would have 14 queries with only 4 categories! There must be a better solution, I can't think of now, what am I missing?
  11. Page Link Abstractor Module, Ryan what didn't you think of? I think the best way for me would be the subdomains, also for client testing... Thanks for the answers!
  12. Yes I agree, a subdomain would be the best solution! I replaced it in the SQL query and it worked. Another question here: Does PW use Serialized PHP Arrays for content saving or is it save to play around with the MySQL directly?
  13. Dear PWers, I'm currently moving a site from my local installation http://domain.local/ to a server subdirectory http://domain.com/temppath/ While moving mostly everything went well. Except one issue, maybe you could help me here: Every Textarea with a picture added to it (through TinyMCE and the Select Image button) is inserted with a full path (of course) like this: <img src="/site/assets/files/1/file.jpg"> So the only option for the current content to correct would be to search and replace inside the MySQL db to change "/site/assets/..." to "/temppath/site/assets/..." Maybe there is a nicer way to do this? And when I'm moving to my final destination from http://domain.com/temppath/ to http://domain.com/ should I search&replace inside the MySQL again? Third option would be to redirect the site directory for the time the installation remains in temppath with RewriteEngine On Redirect /site/ /temppath/site/ but then what would be with the content created during the time period of the PW installation inside /temppath/? So I'm not sure what to do there. In my case it doesn't matter too much, because there are only a couple of sites created, but I'm interested in the best practice here! All the best, so long, Julian.
  14. Thanks a lot for your answers and sorry for the late reply!
  15. I'm quite new to PW, what a great platform, everything makes so much sense! First night I couldn't sleep, was so excited about it Small question here: I have a couple of templates, they all include the 'title' field, because it is set to 'Global' (and system as well) and it makes of course sense to have to everywhere. But in one template I'd like to hide it, which can be done with the visibility setting. But then it is of course empty! Is there a solution to populate this field with two other fields, for example having a person template, field and contents first name "John" last name "Doe" academic degree "Dr." and the title of a combination of those three values set to "Dr. John Doe"?
×
×
  • Create New...