Jump to content

nghi

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by nghi

  1. Ah yay i kind of just wrote that example before I left home from work. I'm using 2.2. I guess i'll try to update to 2.4. There is an option on the image field checkbox to display thumbnail http://i.imgur.com/WNEcVpB.png When i have it check off it links to a broken resized image. if i have it uncheck it seems to work.
  2. the follow code works and downloads the image from the url. However, it doesn't generate the thumb nail in the back end. EG. $page = new page(); $page->template = 'basic'; $page->tittle = 'testing'; $page->save; $page->image = http://i.imgur.com/nFJzvUQ.jpg; $page->save; nFJzvUQ.200.00.jpg would not exist nFJzvUQ.jpg exist How do i genereate the thumbnail so it doesn't appear broken in the backend.
  3. Wao! thank you so much statestreet. You were the last piece to the puzzle. I just did a fresh install and read this entire thread. For those who are wondering Follow arjen Instructions here: https://processwire.com/talk/topic/1025-multisite/#entry20399 For dev or localhost you'll need to edit your host file for your second domain name so it points to the same directory EG. 127.0.0.1 madbox.com You may need to edit your virtual host when it goes live so it points to the right directory. Doesn't really matter for dev. <VirtualHost 127.0.0.1> ServerName sandbox.com ServerAlias madbox.com DocumentRoot "C:/wamp/sandbox.com" <Directory "C:/wamp/sandbox.com"> allow from all order allow,deny AllowOverride All </Directory> </VirtualHost> Then in the site/config.php you'll need to edit the httpHosts variable (last one) EG. $config->httpHosts = array('sandbox.com', 'www.sandbox.com','www.madbox.com','madbox.com');
  4. Oh figure it out =D! I added the permission in the installer and uninstaller function. Then on my client role I gave it the shop_orders permission. (You can also do it manually in the back end) public function install() { $permission = $this->permissions->get('shop_orders'); if (!$permission->id) { $p = new Permission(); $p->name = 'shop_orders'; $p->title = $this->_('view Order mangement'); $p->save(); } } public function uninstall() { $permission = $this->permissions->get('shop_orders'); if ($permission->id) { $permission->delete(); } } //Also needed to modified this line and added check_access $orders = $this->pages->find('template=sc-order,limit=20,sort=-created, check_access=0'); I didn't realize that you can set permission in modules in the getModuleInfo() public static function getModuleInfo() { return array( 'title' => 'Orders Management', 'summary' => 'Manage Shop orders', 'version' => 002, 'permanent' => false, 'singular' => true, 'permission' => 'shop_orders', <------- 'requires' => array( "ShoppingCart", "ShoppingCheckout" ) );}
  5. When I'm log in as the admin. I am able to see the Manage orders tabs at the top right. How would I give access to a guess user to view and edit orders? Super User http://imgur.com/PkDbfbi Client user http://imgur.com/QkOLzUH
  6. Ah I see thanks for the link Adrian, it's been 7 months since the last post. =( However, I did find a work around =D! I remove the dependency off my image field and created a fieldsettab and wrap it around my image field and added the dependency on my fieldsettab.
  7. I'm not sure if this is only me. One of my image field is using inputfield-dependencies and it doesn't seem to allow me to finish uploading an image file. Other image fields work just fine. PW Version 2.4.0 Tested Browser: chrome & firefox
  8. Not sure how to do this but I change the quality option for the size function but it doesn't seem to process it again when the page is load $image->size(500,0,array('quality'=>100))->url $image->size(500,0,array('quality'=>50))->url Also how would I regenerate all images on a site? I'm thinking about just using winhttrack to crawl through it unless there is some PW way to do it?
  9. Cakes are good for your health

  10. I have used 000webhost in the past when i was a poor student. There servers get attack very often mostly hosted wordpress. Random Downtime happens often and IP throttle if there system thinks your an attacker when you make too many request E.G Uploading files, working live. etc. Other then that it's pretty decent but it's not reliable if you need a site up and running all the time. *I was once hacked and their bot uploaded random stuff to the root it was not fun. =(
  11. Yes kind of, I can get the font awesome icons to appear but I only want icons to appear within certain conditions. So at first glance a user can tell if a page is being feature base on a date range.
  12. I was wondering how would I display an icon next to a template from the backend base on a field value? E.G date <= today Is it possible to just do it under the advance option? List of fields to display in the admin Page List
  13. Figure it out, Not sure if it's ideal... I commented out the session part of the following if statements but still keep the token to be check still. I also modified the time from an hour to a day. public function ___execute() { if($this->session->userResetStep >= 2 && $this->session->userResetID === (int) $this->input->get->user_id) { return $this->step3_processEmailClick(); protected function step3_processEmailClick() { if($result->num_rows && $id == $this->session->userResetID) { if($row['token'] && ($row['token'] === $token) && $row['name'] === $this->session->userResetName) { $query->bindValue(":ts", time()-3600, PDO::PARAM_INT);
  14. Currently, I'm trying to send automatic email with a forgot password link after a user is created. so that user can create their own password within 24 hours But I keep getting the error telling me the session isn't the same. What i got so far... public function addUser($event){ $u = new User(); $u->name = $new_user_name; $u->email = $email; $u->addRole("guest"); $u->addRole("client"); $u->save(); $pfp = wire("modules")->get("ProcessForgotPassword"); $user = wire("users")->get("name=$new_user_name"); $pfp->sendemail($user); } public function sendemail($user) { $this->step2_sendEmail($user);} The Module I'm looking at is ProcessforgotPassword and the function i think i should be looking at is step2_sendemail but I honestly do not know what to do at the moment. I tried commenting out the databinds but ya im drawing blanks. https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessForgotPassword.module
  15. I think i jump the gun on this question, It fixed itself after a few hours. So I think my router/isp may have been acting up during work hours. Not really sure what was going on but I have set the fingerprint to false not sure if it will help if the problem arises again.
  16. PW is logging me out after idling after a few seconds. Not sure why this is happening to me all of the sudden. Is there a setting somewhere to prevent this?
  17. How would I restrict the access of a field from being used depending on a user role? Can it be done with the selector field? http://i.imgur.com/bLjGM7U.png Or would i need to add a hook and check a user's role and disable it?
  18. In the MarkupGoogleMap.js you need to add the some code from the example you link @ https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple You also might want to display different data from a page and wil need to modify the MarkupGoogleMap.module foreach loop and add custom fields to your template page. I've created a 2 fields called map_location_name and phone_number //Edit the MarkupGoogleMap.module $out variable foreach($pageArray as $page) { $marker = $page->get($fieldName); if(!$marker instanceof MapMarker) continue; if(!$marker->lat) continue; $url = $options['markerLinkField'] ? $page->get($options['markerLinkField']) : ''; $title = $options['markerTitleField'] ? $page->get($options['markerTitleField']) : ''; $map_location_name = $page->map_location_name ? $page->map_location_name : ''; $phone_number = $page->phone_number ? $page->phone_number : ''; $out .= "$id.addMarker($marker->lat, $marker->lng, '$url', '$title', '','$map_location_name','$phone_number'); "; } if(this.hoverBox){ //right above this line add the code below in MarkupGoogleMap.js var contentString = '<div class=\"chapter-bubble\">' + '<div class=\"chapter-bubble-title\">' + title + '</div>' + '<div class=\"chapter-bubble-name\">' + map_name + '</div>' + '<div class=\"chapter-bubble-number\">' + map_number + "</div>" + '<div class=\"chapter-bubble-url\">' + '<a href=\"' + url + '\">Visit Chapter Site</a></div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(this.map,marker); }); this.addMarker = function(lat, lng, url, title, icon, map_name, map_number) { //you'll need to add addition arguments to this line as well.
  19. Figured it out. public function init() { $this->pages->addHookAfter('save', $this, 'generateRegionSubPages'); } public function generateRegionSubPages(HookEvent $event) { $page = $event->arguments[0]; if (!$page->isTrash && $page->template->name == 'portal') { $templates = array( array('name' => 'blog', 'title' => 'News'), array('name' => 'volunteers', 'title' => 'Volunteers'), array('name' => 'gallery', 'title' => 'Gallery'), array('name' => 'events', 'title' => 'Events'), array('name' => 'calendar', 'title' => 'Calendar') ); foreach($templates as $template) { if ($page->children('template=' . $template['name'])->count()==0) { $sub_page = new Page(); $sub_page->template = $template['name']; $sub_page->parent = $page; $sub_page->name = $template['title']; $sub_page->save(); } } } } What I need: To be able to auto generate a page from a form that will also create multiple child pages using different templates I'm not really sure how I can accomplish this or how to get started. Can someone give me some advice?
  20. I was wondering how could I accomplish this? I have modify the css to float the li to the left but the UI wouldn't let me drag from left to right. (I'm not able to drag from left to right) (original look)
  21. I have a category page call portal and I have child pages within that category. I would like to be able to access my child pages like this http://mywebsite.com/catering instead of this http://mywebsite.com/portal/catering but still keep my child pages within the portal category.
  22. How would I go about customizing urls? I'm trying remove the portal parent from my url E.G /portal/catering/decorator /portal/catering /portal/restaurants/north /portal/restaurants/south to /catering/decorator /catering /restaurants/north /restaurants/south
  23. Ah thanks for the tip. I was able to do this in the custom selector template=basic-page|gallery
  24. How do we select multiple templates for a Page field? (so that a user may be able to pick a Page from more then 1 specific template)
×
×
  • Create New...