Jump to content

Godfrey

Members
  • Posts

    63
  • Joined

  • Last visited

About Godfrey

  • Birthday 09/16/1993

Profile Information

  • Gender
    Male

Godfrey's Achievements

Full Member

Full Member (4/6)

7

Reputation

  1. Godfrey

    HallExchange

    Awesome, I totally want something like this for my campus, or any future campus. I had sort of the same idea, except more visual-location based. Built a prototype with plain HTML, CSS, JS, MySQL. What did you use in combination with Processwire to make this?
  2. That filter applied to the photos upon hover is intriguing! It makes the photos jump a little bit though. And under "Projects" one the top right photo is a different height than the rest. But love the classy and vintage style!
  3. Heh, I also often feel like I'm banging my head against a brick wall when I code. But I guess one day you do break through it. Side note: I actually haven't had any success with curly brackets either, until reading this post. I don't know why, just whenever I used them they never worked until trying it again now. So guess you're not the only one!
  4. Yes, thank you adrian! I chose to move it outside the templates file, and it worked as you said!
  5. I'm trying to setup a mailing form. In my form's action="" attribute, I'm trying to link to my mailing script. However, every time I hit submit, I keep getting redirected to mysite.com/site/templates/path_to_script.php and a blank page that says "Link appears to be broken". This is what I've tried: <form action="<?php echo $config->urls->templates?>mail.php" method="post"> <form action="<?php echo dirname(__FILE__);?>mail.php" method="post"> <form action="<?php echo dirname(__FILE__).'mail.php'?>" method="post"> And I keep getting similar results. Usually, the first method works when I try to include things such as my javascript or css files, but it's not working for this. What do I need to do?
  6. Hmm, I keep getting the error: "Call to a member function findRandomTimed(1) on a non-object" ... or "Unable to complete this request due to an error. Error has been logged." Why would something like this or similar not work? $sectionpages = $pages->find("template=section"); // returns a PageArray $randSection = $sectionpages->findRandomTimed(1); // findRandomTimed(1) returns 1 page. PageArray is a child class of WireArray right? $randFile = $randSection->files->findRandomTimed(1); // supposedly, the page of $randSection should have a field holding multiple files
  7. I'm trying to display a random file per day. Strangely, this works on my development server but not my live server. On my live server, I get random files but it's on every page refresh. So I'm thinking something's wrong with mktime(), and maybe in combination with getRandom(). This is the code I'm using: srand(mktime(0,0,0)); $sectionpages = $pages->find("template=section"); $randSection = $sectionpages->getRandom(); // get a random "section" page, each has many files $randFile = $randSection->files->getRandom(); // get a random file from that random "section" page. Would this be a problem with my live server, like with unix/linux timestamps? Or would this be a compatibility problem with getRandom, if that makes sense? I also tried using some code from here: http://processwire.com/talk/topic/2081-when-random-is-too-random/ But I couldn't quite translate the code from working with Pages to files. I'm running WAMP as my dev server, and my shared hosting uses LAMP :\ So I'm guessing there might be a problem there? How would you guys approach this? As always, many many many thanks for any help!!
  8. Hmm, well right now the main reason I wanted to achieve this was 1) so that the client could easily see and organize what files he had uploaded among the name of files, and 2) possibly pull the filename (to echo) instead of having to type in a title in the "description" sub-field or a newly created title field. But currently for both I'm just using the simple workarounds of having the files renamed in English (if possible) and typing the original filename in the description sub-field. So I guess right now for time-savings and simplicity sake it may be a bit overkill to go for that method. But if the need comes up I'll PM you or post again. Thanks Ryan!! I also guess it's good to have the original filename for SEO friendliness, though I'm not most concerned about that. Would this method you mentioned have the original filename show up in the file's URL? e.g.: mysite.com/path/to/filename_in_original_language.doc ?
  9. Yep, got 2.3.4 installed and right now it's a breeze!
  10. Quick question here: Is it possible to upload files (in a files field) with non-english filenames and still retain the original filename? I've tried to upload some files with Chinese file names (probably not the greatest idea), but after the upload completes the names simply turn into "1-20", or "doc.doc" etc. Would I have to download a language pack? (although one for Chinese doesn't exist yet)
  11. I'm not an expert, and probably others will have better ideas than me, but it seems like you could achieve much of this with URL redirection. You could simply have http://example-secondsite.com/processwire/ redirect to http://example-first...om/processwire/ . Then PW has a user system. You could set up different users and have them access specific things. (I've never used it myself but I'm pretty sure) This way, there's only one core, AND you can "share content". I'm not sure if this is the best way, but you could even have different page trees in PW dedicated to the different sites.
  12. Ah, I knew about the single quote method but didn't know about the double quotes. Yep, this helped! Indeed I got it to work after changed $language-title to $user->language->title. I know I missed something. Many thanks adrian.
  13. For me, it is because I have a hidden "about" section in my page. I have an about_title and about_description field, but to get to open this hidden "about" section, I have a button labeled "about"/"(about in chinese)". I don't want to have to create whole 'nother field just for "about_button". This is why I wanted to just use the label name for my field, which I already have translated. I searched and found this thread extremely helpful ^^ I am so glad that this thread popped up just as I encountered the same problem. You guys are awesome
  14. Going to dig this thread up again with another question: Would it be possible to reference fields via Fieldsets? (or something similar since I know right now they don't have much to do with the API) For example, in a template you could set up something like title about_fieldset_start title description about_fieldset_end contact_fieldset_start title description contact_fieldset_end Then reference the "title" for "about" by: $page->about_fieldset->title? I know that currently you can only place one "title" field per template, but it would be helpful if you could place multiple if there were different groups. Because if on a page there were many different disjointed sections (where you can't use repeaters) like "about", "contact", "feedback", etc... right now wouldn't you have to make title field for all of them? e.g. "about_title", "contact_title", "feedback_title"? Or is there a different method I'm missing?
  15. Hehe, actually thanks for asking this dragan. I just searched "processwire group fields together" and this was the top (and only related) result. I couldn't find a nice official writeup/documentation on the main site, but luckily this thread showed up and diogo provided that link.
×
×
  • Create New...