Jump to content

bwakad

Members
  • Posts

    450
  • Joined

  • Last visited

Everything posted by bwakad

  1. Updated both to POST. See first post in topic...
  2. How do I post it back by ajax/javascript? I thought it was doing this automatically....
  3. Just an update! As far as I know, I have managed to get all "profile fields" in PW. I devided two parts: login (username, email and pass) - profile (all fields that can describe a person, including image) ... and no, not the values "$#@head!" lol. Login: The login by email was made with help of Martijn (thanks). It is easier to remember for people. Registration in two parts: The registration creates user and profile page with same name. After that they get redirected to a page to provide personal info to activate profile page. Edit profile: Still need to do that. And I think I need a temp page for when people change their screen name (user and profile name). The form: I have set patterns in the back for required input validation. Will think about displaying error messages later. Right now working on dynamic selects which is really a pain in the %$#... but it's needed to come to a final city e.g. Country > Province > City. It would be strange to select country USA and finally as city Berlin.... Online user: although Adrian and Pete gave correct code, remarks on that topic made me realize one has to take into account closing the browser without logout. Therefore the approach will be to check a persons activity (found some topics on that). Browse: For this I use my old code, template will be profile-template, field will be on what people search. Later I add filters (foundation-css has some great options for that). Thumbs and carousels: I do not use foundation-css grid block for thumbs since - PW handles this well; foundation adjust the size which makes them to small and absolute position on top of images is not visual stable anymore. I now use in between queries to determine the container width and then use: card is the container, for the box inside. We float the card left and align box center. X = box width =120px, Y = X/2 for negative-margin, left 50% makes it center. #member-cards .card { width: 50%; border: 1px solid #eee; float: left; margin-bottom: 1em; } #member-cards .box { margin: 0px 0 0 -60px; left: 50%; }
  4. I am trying the below code to populate my values of second select, based on first select. But I don't know what I do wrong. -EDIT - I have used POST for both, and something happens... but the values do not get passed to "province". Just displays empty... // profile template, for registration purpose <form> <select id='country' name='country'> // first select <option value=''>Any</option> <?php foreach($pages->get("/personal-info/countries/")->children() as $country) { $selected = $country->name == $input->whitelist->country ? " selected='selected' " : ''; echo "<option$selected value='{$country->name}'>{$country->title}</option>"; } ?> </select> <select id='province' name='province'> <option value=''>Any</option> </select> </form> // profile template, for registration purpose - EDIT - updated /path/ // In bottom I use this code to request data for second select: <script type="text/javascript"> $(function() { $("#country").bind("change", function() { $.ajax({ type: "POST", url: "/getprovince/", data: "country="+$("#country").val(), success: function(html) { $("#province").html(html); } }); }); }); </script> // on page: /getprovince/ file, used to retrieve select values. here's the code for now: <?php $country = $_POST["country"]; foreach($pages->get("/personal-info/countries/{$country}/")->children() as $province) { $selected = $province->name == $input->whitelist->province ? " selected='selected' " : ''; echo "<option$selected value='{$province->name}'>{$province->title}</option>"; } ?>
  5. Have the same issue using the latest dev branch. I think something changed in the core... If I specify for my province select field also a template parent=page.country, template=mytemplate I end up with the name of the template as a value when nothing is selected in the first select. So no good! - edit - the field which depend on another field, in my case "province" depends on "country": in province visibility, and show this field only if... I use "country>0" This hides the province field, until I select a country. Then it just shows the corresponding values. It's a pitty this cannot be done on the front-end though...
  6. Just to be clear on this topic: I created 2 selects in front-end. Parents are hidden. With "hidden" child-pages (even if I specify the path) not display values. With "un-hidden" child-pages - meaning published - does display values. So I think for selects: the key element for not displaying in a menu is the parent state. the key element for not displaying in a select is the child state.
  7. Could not accomplish it. I am still curious why isLoggedin() only works for $user (is current user). Isn't there something as a session set when users login ?
  8. Oops, sorry I did not mention this. I use a simple foreach to display member profiles. $members = $pages->find("template=member-profile"); foreach($members as $page) { And inside this loop, I want to see who in that list is logged in. the $page->name equals $user->name... both use a different template to separate login from displaying. I thought the loggedin was dependent on the user ID. But I cannot figger out how to display online or not...
  9. I know on Windows it will be these two directories: in c / windows / system32 / drivers / etc / host file in c / xampp / apache / conf / extra / http-vhosts.conf in c / xampp / htdocs / your-folder-named-after-virtual-directory-name
  10. I have installed Session Handler Database, but that is more for the Admin side. I would like to loop through member pages (page name - is the same as - user name), but do not know how to accomplish a "isLoggedIn". I tried it like this: $whois = $pages->get("template=user,name={$page->name}"); // I receive correct id's with this so it works echo $whois->id; // the next gives error if($whois->id->isLoggedin()){ echo "yes";} // the next works but gives online for all... if($user->isLoggedin($whois->id)){ echo "yes";} Basically I do not know what to call for in the isLoggedin()... Does anyone know? Should be possible since it is PW !
  11. I do not use these classes anymore since the media queries not take into account fluid or in between sizes. but you should check your classes with: http://foundation.zurb.com/docs/components/visibility.html Could not find a class for ...-xxxx-down
  12. Oh okay, so in the options are just defaults as fallback. And in templates I can use different. Thanks!
  13. link from the PW docs "images" (there are 2 entries for images) ... http://processwire.com/api/fieldtypes/images/ A little further it says: You may specify any of the following for the $options array:of which cropping as direction is part of it.If I can set these in config, then I am bound by 1. Correct?
  14. was thinking about that too. But in the docs on pw it says these options can be placed in the config. That leaves me with only 1 option...
  15. Unfortunatly I did not find information of front-end image crop. But I did notice images can be manipulated for output using: $thumb = $page->image->size(200,200); echo "<img src='{$thumb->url}'/>"; It looks like a center -cropping, -clipping, or -resize (not sure). Since an uploaded image in landscape let me see the center part of the big image. My question: is there a function in pw, to be used in forms, that let users choose to display center, left or right ?
  16. On my new development I now use this tree structure: Parentpage - countries childpage hold "country"-name childpage of country-name hold province-name childpage of province-name hold city-name country field, 1st select, for country value = normal parent select > "countries" province field, 2nd select, for province name OF country selected value = custom selector > "parent=page.country' city field, 3rth select, for city name OF province selected value = custom selector > "parent=page.province'. Works great!
  17. I know ...some people will say this is css and off topic, but much more use foundation and this can help in building profiles. A nice technique to use in foundation profiles for front end auto crop images. Here I have used the data equalizer, but that is totally up to you. All you need to do is change the height for disfferent screen size queries: // template: <div class='small-4 columns image' data-equalizer-watch> <a class='th th-item' href='{$page->url}' style='background-image:url($thumb->url)'> <img class='transparent' src='{$thumb->url}'/> </a> </div> // CSS -> .th is the default markup of foundation for thumbs (border and hover) .transparent{ opacity: 0; } .th-item{ height: 11em; // example, change for convinience width: 100%; overflow: hidden; background-position: center; } - edit - although a nice trick, they say it's bad to do this by css...
  18. Took me a while, but it give me most of the time the results I need .... site:processwire.com/talk what-do-I-search-for-here guess we also need other search "plugins" because lately I see a lot of robots visiting the site. lol
  19. Pete, okay, I think I was looking for something more difficult then it was. I though the single and double quote would give me problems... Title value as 5'0" still valid Name value as 50 still valid I guess I will not run in trouble ... I never used translation, do you know if on translation for example in dutch, the title or name is translated?
  20. Well, my member card is almost ready... any suggestions are welcome. How would I go about making EN human height select field? example value 5'10" I need to have it as pages since I want to search by page name/title ...
  21. What is the difference between the hidden and unpublished? I know i can use either one to NOT display them in a menu. The hidden won't let them appear in lists and searches. But unpublished basically does the same thing for what I use these pages for.... I use a number of parent pages and it's children to create values for radio or selects. I add fields for this to a template. Then I simply display it's values. Which one of those two do I use, and only on the parent or on all children too? example: household - alone - with parents - with children
  22. I now, used the slick slider. There is only one issue with the slider: In the initialisation one has to say how many are visible. And space in between get's calculate automatically. This produces a strange layout in foundation. So inside the div for the slider I used a panel, and inside of that 2 columns. Looks pretty cool, and the slider just slide 2 columns at a time! But now I face another challenge and I think I have to start another topic for that ? (admin/mod can tell me) profile template hold fields such as location, interests. while this slider get it's values from the user template, image and username. How do I get fields related to eachother from 2 different templates? - edit - Just moved the image field to the member-profile template which is actually better. Then I just have to reference one template for displaying members. And user template only holds the information regarding register and login.
  23. I now use it for the thumbs to display.
  24. Got it. I get all the related stuff by only requesting template=user, and go for the image, but is there a chance someone could hack in one way or another and get to other fields in this template, since the template holds username, email, pass $mymembers = $pages->find("template=user"); foreach($mymembers as $member) { if($member->image) { $thumb = $member->image->size(100,100); echo "<li><img src='{$thumb->url}' /></a></li>"; } }
  25. Orbit will be discontinued. Use slick slider for future profiles. Very cool slider by the way!
×
×
  • Create New...