Jump to content

iNoize

Members
  • Posts

    165
  • Joined

  • Last visited

Posts posted by iNoize

  1. On 6/11/2019 at 1:40 PM, horst said:

    Why do you not include type hidden fields into your forms where you add identifiers?

    
    $validFormIdentifier = ['aaaaaaaa', 'bbbbbbb', 'ccccccc'];
    $myIdentifiedForm = $sanitizer->text($input->post->hiddenidentifier);
    if(!in_array($myIdentifiedForm, $validFormIdentifier)) { 
    	// invalid formsubmission, do not process further
    }

     

    Thanks for the advice but i need to know wchich form of my 3 forms is sending currently 
    because form 1 has 5 values 
    form 2 has 8 values and form 3 20 values to send. 

    So i want to select what to send  it depends on the values 

  2. Hello, 

    i use 3 different forms on site now i will check from which form the data comes and send the vars. 
    e.g. I have a callback form, a contact form and an info form. 

    Now i use one page Tnak you for your mail and how to choose the right script ? 
    The forms have different number of values and i dont want to create 3 different Thank you pages. 

    <?php
    $empfang = "my@email.here";
    
    
    if(isset($input->post->submit)) {
    
    $aname       = $sanitizer->text($input->post->aktion_name);
    $fname       = $sanitizer->text($input->post->fullname);
    $subject     = $sanitizer->text($input->post->subject);
    $femail      = $sanitizer->text($input->post->email);
    $phone      = $sanitizer->text($input->post->phone);
    $message     = $sanitizer->text($input->post->message);
    
    
    $mail = wireMail();
    $mail->to($empfang)->from($femail); 
    $mail->subject('Anfrage von  '.$aname); 
    $mail->body('Mail Body');
    $mail->bodyHTML('<html><body><h1>von '.$fname.'</h1><br> Betreff: '.$subject.'<br> Mail'.$femail.'<br> Telefon'.$phone.'<br>Nachricht:'.$message.'</body></html>'); 
    $mail->send(); 
    }


     

     

  3. On 4/25/2019 at 4:00 PM, adrian said:

    I you sure the keywords are being generated by this module? As you can see, I removed all references to them: https://github.com/adrianbj/MarkupSEO/commit/d6d65af93127b88f63d328d61c55fa2544133342

    Are you definitely using that branch of my fork? I guess I should probably merge that branch into my master now.

    I had the old one also installed and the keywords were in the templates. Now it works great thanks 

    • Like 1
  4. Hello, 
    how can i change the "has_children_class" for an special id ? Ex 1074. 
    I have an page with automaticly created children. And in this ID 1074 it should not be generated the dropdown submenu (Bootstrap)

    This is actually my code 

     

    $nav = $modules->get("MarkupSimpleNavigation"); // load the module
    
    $nav->addHookAfter('getTagsString', null, 'customNavItems');
      
    function customNavItems(HookEvent $event){
         $item = $event->arguments('page');
        // first level items need additional attr
          if($item->numChildren(true) && count($item->parents) < 2 && $item->id != 1 && $item->id != 1074 ){
            $title = $item->get("title|name");
            $event->return = '<a href="#" class="dropdown-toggle" tabindex="0" data-toggle="dropdown"  aria-expanded="false" >' . $title . ' <span class="caret"></span></a>';
           }
    
    
        // submenus don't need class and data attribs
           if($item->numChildren(true) && count($item->parents) > 1 && $item->id != 1028 && $item->id != 1036 ){
            $event->return = '<a href="#">' . $item->get("title|name") . '</a>';
          }
    }
    
    $navMarkup = $nav->render(
        array(
        'parent_class' => 'parent',
        'current_class' => 'active',
        'has_children_class' => 'dropdown',
        'levels' => false,
        'levels_prefix' => 'level-',
        'max_levels' => 2,
        'firstlast' => false,
        'collapsed' => false,
        'show_root' => false,
        'selector' => '',
        'selector_field' => 'nav_selector',
        'outer_tpl' => '<ul class="nav navbar-nav">||</ul>',
        'inner_tpl' => '<ul class="dropdown-menu">||</ul>',
        'list_tpl' => '<li%s>||</li>',
        'list_field_class' => '',
        'item_tpl' => '<a href="{url}" >{title} </a>',
        'item_current_tpl' => '<a href="{url}">{title}</a>',
        'xtemplates' => '',
        'xitem_tpl' => '<a href="{url}" >{title}</a>',
        'xitem_current_tpl' => '<span>{title}</span>',
        'date_format' => 'd/m/Y',
        'code_formatting' => true,
        'debug' => true
            )
        );



     

  5. Hello, 

    i have 2 different domains for one page. 
    In one domain i can see the map markers in other it comes an error. 
     

    Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

    I have generated an standart Api key 
    dont understand why it doesnt works 

    the same key also works for me on localhost skyscrapers profile too 

     

  6. Hello, 
    for an Project i need help for an Script. 
    There is an XML File with all the Objects Data and Images for every object. 

    This is the Data Structure 
    http://prntscr.com/hvfo31


    One XML file and Pictures. 

    So every Time the new Data is Uploadet via ImmoTool there have to be maybe an batch or something or an button in the Sitebackend to check the new files. 

    If the Status is  NEW then create an Object 
    if the Status is CHANGE  then make some changes 
    If the Status is Delete then remove the Object in other Parent 

    There are Basic infos in XML like Description Rooms etc. 
    Also the latitude and attitude for the maps. 

    After succsessful changes the Folder schould be empty for the next upload. 

    I need only help to create and handle the sites with some data (PW API ). The output I will generate by myself. 


    I have some basic php code 

    Need somebody to fix it ready for me in PW. 

    Tnx 


     

  7. On 25.3.2015 at 8:49 PM, bramwolf said:

    SOLVED

    After extensive chat with One.com support I found out that outgoing e-mail from adreses other than the domains 

    will be blocked after about 20 e-mails. So when sending from a adres within the domain resulted in direct delivery..

    I want to cry... :( Is there anywhere I can get a refund for those 4 hours of my life?

    Thanks for your help though..

    Bram Wolf 

    So how to solve this now ? Change the from adress ?

    Have the same Problem. 
    But cant fix it ? 

    Can you make an example ? pls 

     

    Tnx 
     

  8. Hello, 
    maybe somebody hat this problem ? 
    I need to port 175 pages from Joomla to pw. 

    Maybe had someone this problem or has ported it with some ready modules ? I mean maybe i can export joomla as csv and also import it in pw with small code amnipulations ? 

    Oh very important is it let the url strukture the same  also rewrite names for the pages. 

    TNX 

  9. Hello, 

    i have a landingpage and need to reaname the images or save it to the filed images in the userpage 

    i have this script currently 

     

                       if(isset($input->post->submit)) {  
                  $lptitle     = $sanitizer->text($input->post->lptitle);  
                  $anrede    = $sanitizer->text($input->post->anrede);
                  $first_name       = $sanitizer->text($input->post->first_name);
                  $last_name       = $sanitizer->text($input->post->last_name);
                  $str       = $sanitizer->text($input->post->str);
                  $num      = $sanitizer->text($input->post->num);
                  $plz      = $sanitizer->text($input->post->plz);
                  $ort      = $sanitizer->text($input->post->ort);
                  $land      = $sanitizer->text($input->post->land);
                  $email      = $sanitizer->text($input->post->email1);
                  $fbname      = $sanitizer->text($input->post->fbname);
    
    
    
                            if ($page->id == '2328' ) {
    
             
             // Set a temporary upload location where the submitted files are stored during form processing
                  $upload_path = $config->paths->assets . "files/stickers/";
    
                  // New wire upload
    $file = new WireUpload('file'); // References the name of the field in the HTML form that uploads the photo
    $file->setMaxFiles(1);
    $file->setOverwrite(false);
    $file->setDestinationPath($upload_path);
    $file->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif'));
    
    // execute upload and check for errors
    $files = $file->execute();
    
    
    
    
    
               //   echo "Passt";
    
    
    
                            }
    
    
                  // $group     = $sanitizer->text($input->post->group2);
    
                  if ($sanitizer->text($input->post->group2) == "on") {
                  $group     =    "1";
                  }else{
                      $group     =   "0";
                  }
                  
    
    
                        $mail = \ProcessWire\wiremail();
    
                        $mail->to($email)->from("mymailhere@domain.com");
                        $mail->subject("Deine Anmeldung zur $page->title !");
    
    
       $mail->bodyHTML("Hey $first_name,<br>
    <br>
    deine Anmeldung zur <b style='color: #4fc3f7;'>$page->titleaktion</b> war erfolgreich.<br>
    $page->mailoben
    
    Deine Angaben:<br>
    $anrede $first_name $last_name<br>
    $str $num<br>
    $land - $plz $ort<br>
    $email<br>
    $fbname<br>
    <br>
    Wir wünschen dir auf jeden Fall schonmal viel Erfolg und erfrischende Grüße!<br>
    $page->mailunten
    Gerne kannst du auch deinen Freunden von unserer $page->titleaktion per Facebook, Twitter, Google+, WhatsApp oder E-Mail berichten:<br>");
    
                         $mail->send();
    
     $p = new Page(); // create new page object
     $p->template = 'fans'; // set template
       $p->parent = $page->id;
    
      $p->title = $first_name." ".$last_name."-".$page->numChildren; 
    
     $p->gender = $anrede; 
     $p->first_name = $first_name; 
     $p->last_name = $last_name; 
     $p->str = $str; 
     $p->num = $num; 
     $p->plz = $plz; 
     $p->ort = $ort; 
     $p->land = $land; 
     $p->email = $email; 
     $p->fbname = $fbname; 
     $p->letter = $group; 
    
    
     $p->save();
     $p->images = $upload_path . $files[0];
     $p->save();
     @unlink($upload_path . $files[0]);
    
    
       }

    How to save the Image to the Userpage  ? 

     

    Thanks 

     

     

     

  10. So there are happens strange things. 

    I have one core with different languages on pw 3+ e.g.  

    de.mydomain.com 
    en.mydomain.com 
    .....

    now i have taken the original code from ryan. Searching for one month for the error. 
    The only thing i had to do is to "disable automatic prepand of _init.php" in the template settings :) 

    awww maybe its a good advice for somebody. but peaople thanks for your help 

     

  11. Hello, 

    i need help i dont know what happen but i get this error

    Its an multipage installation with one core and many languages. 
    EN Version is ok but the DE version always error 500 also if i try to login to the backend.

    Exception: You do not have permission to execute this module - ProcessPageView (in /homepages/17/pathtosite/wire/core/Modules.php line 1225

    Errorlog: 

    2016-11-26 11:13:37    guest   http://de.mypage.com/?/  Error:     Exception: You do not have permission to execute this module - ProcessPageView (in /homepages/17/pathtosite/wire/core/Modules.php line 1225)
    2016-11-26 11:13:57    guest   http://de.mypage.com/?/  Error:     Exception: You do not have permission to execute this module - ProcessPageView (in /homepages/17/pathtosite/wire/core/Modules.php line 1225)  #0 /homepages/17/pathtosite/wire/core/Modules.php(1130): ProcessWire\Modules->getModule('ProcessPageView') #1 /homepages/17/pathtosite/index.php(53): ProcessWire\Modules->get('ProcessPageView') #2 {main}
    2016-11-26 11:14:34    guest   http://de.mypage.com/?/  Error:     Exception: You do not have permission to execute this module - ProcessPageView (in /homepages/17/pathtosite/wire/core/Modules.php line 1225)  #0 /homepages/17/pathtosite/wire/core/Modules.php(1130): ProcessWire\Modules->getModule('ProcessPageView') #1 /homepages/17/pathtosite/index.php(53): ProcessWire\Modules->get('ProcessPageView') #2 {main}
    2016-11-26 11:14:51    guest   http://de.mypage.com/?/  Error:     Exception: You do not have permission to execute this module - ProcessPageView (in /homepages/17/pathtosite/wire/core/Modules.php line 1225)
     

     

     

  12. Ok so i tried to fix it by myself now i have this warning. 

    Maybe for the info: Its a multisite installation with one core but different DB's and labguages. 
    This is currently my code in the  sitemap.xml  template. 

     

    <?php namespace ProcessWire;
    /**
     * ProcessWire Template to power a sitemap.xml 
     *
     * 1. Copy this file to /site/templates/sitemap-xml.php
     * 2. Add the new template from the admin.
     *    Under the "URLs" section, set it to NOT use trailing slashes.
     * 3. Create a new page at the root level, use your sitemap-xml template
     *    and name the page "sitemap.xml".
     *
     * Note: hidden pages (and their children) are excluded from the sitemap.
     * If you have hidden pages that you want to be included, you can do so 
     * by specifying the ID or path to them in an array sent to the
     * renderSiteMapXML() method at the bottom of this file. For instance:
     *
     * echo renderSiteMapXML(array('/hidden/page/', '/another/hidden/page/')); 
     * 
     *
     */
    
    function renderSitemapPage(Page $page) {
    
    	return 	"\n<url>" . 
    		"\n\t<loc>" . $page->httpUrl . "</loc>" . 
    		"\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>" . 
    		"\n</url>";	
    }
    
    function renderSitemapChildren(Page $page) { 
    
    	$out = '';
    	$newParents = new PageArray(); 
    	$children = $page->children; 
    	
    	foreach($children as $child) {
    		$out .= renderSitemapPage($child);
    		if($child->numChildren) $newParents->add($child); 
    			else $this->wire('pages')->uncache($child); 
    	}
    
    	foreach($newParents as $newParent) {
    		$out .= renderSitemapChildren($newParent); 
    		$this->wire('pages')->uncache($newParent); 
    	}
    
    	return $out; 
    }
    
    function renderSitemapXML(array $paths = array()) {
    
    	$out = 	'<?xml version="1.0" encoding="UTF-8"?>' . "\n" . 
    		'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
    
    	array_unshift($paths, '/'); // prepend homepage
    
    	foreach($paths as $path) {
    		$page = $this->wire('pages')->get($path); 
    		if(!$page->id) continue; 
    		$out .= renderSitemapPage($page);
    		if($page->numChildren) $out .= renderSitemapChildren($page);
    	}
    
    	$out .= "\n</urlset>";
    
    	return $out; 
    }
    
    
    if ($pages->get("1042")->sitemaps != " ") {
        $ausgabe =  renderSitemapXML(array(
            
      //  $ps = $pages->get("1042")->sitemaps;
      // foreach ($ps as $p) {
      // 	echo "$p->path";
      // }
       // 	'/hidden/page/'
    
    
        	));
    }else{
    	$ausgabe =  renderSitemapXML();
    }
    
    // echo renderSitemapXML();
    // Example: echo renderSitemapXML(array('/hidden/page/')); 
    
    
    
    header("Content-Type: text/xml");
    echo $ausgabe;

     

    Screenshot_2.jpg

  13. On 15.6.2016 at 11:24 AM, justb3a said:

    Ah, thanks for your hint. There was a missing opening `<?php` tag. I corrected the example above as well as the Github readme.

    Hello, i get alway NULL or Array(0) dont really work ? 

    have you tried your code ? maybe is something wrong in the access token  ? 

     

×
×
  • Create New...