-
Posts
585 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Frank Vèssia
-
this is my query $find=wire('pages')->get(1485)->find("template=libro,title%=$titolo"); looks correct...
-
I'm trying to count the total page i have in one category but i get this error: FATAL ERROR: ALLOWED MEMORY SIZE OF 67108864 BYTES EXHAUSTED (TRIED TO ALLOCATE 80 BYTES) IN /HOME/LIBROLO/PUBLIC_HTML/WIRE/CORE/PAGES.PHP ON LINE 290 this is my code $total=$pages->get(1485)->find("template=libro"); echo $total->getTotal(); my total is almost 7000 pages. Till 4500 was fine, no error.
-
i'm creating some pages from an xml, sometimes i get this error: admin:/grab/:ProcessWire Error:Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/librolo/public_html/wire/core/Selectors.php line 135) #0 /home/librolo/public_html/wire/core/Selectors.php(160): Selectors->create('indagine', '', 'senza censure s...') #1 /home/librolo/public_html/wire/core/Selectors.php(63): Selectors->extractString('has_parent=1485...') #2 /home/librolo/public_html/wire/core/Pages.php(111): Selectors->__construct('has_parent=1485...') #3 [internal function]: Pages->___find('has_parent=1485...', Array) #4 /home/librolo/public_html/wire/core/Wire.php(267): call_user_func_array(Array, Array) #5 /home/librolo/public_html/wire/core/Wire.php(229): Wire->runHooks('find', Array) #6 /home/librolo/public_html/wire/core/Page.php(656): Wire->__call('find', Array) #7 /home/librolo/public_html/wire/core/Page.php(656): Pages->find('has_parent=1485...', Array) #8 /home/librolo/public_html/site/templates/grab.php(123): Page->find('template=libro,...') #9 /home/librolo/public_html/site/templates before saving the page i use always the sanitizer for every field.
-
you are right Ryan as always, thanks ;D
-
I run several pw website on this server so php config is right. My code is very simple... include('./amazon.class.php'); // make the request $keyw = $input->post->keywords; $xml = simplexml_load_file(awsRequest("Books", "{$keyw}", "Large", "ItemSearch", "1")); foreach($xml->Items->Item as $item){ $string = preg_replace("/\[[^\]]*\]/m","",$item->ItemAttributes->Title); $string = str_replace(".","",$string); $titolo = strtolower($sanitizer->text(trim($string = preg_replace("/\([^\)]+\)/","",$string)))); $categ=$sanitizer->text($item->BrowseNodes->BrowseNode[0]->Ancestors->BrowseNode->Name); $subcateg=$sanitizer->text($item->BrowseNodes->BrowseNode[0]->Name); $publisher=$item->ItemAttributes->Publisher; $isbn13=$item->ItemAttributes->EAN; $isbn10=$item->ItemAttributes->ISBN; $cover=$item->LargeImage->URL; $libro = new Page(); $libro->template = $templates->get("libro"); $libro->parent = $pages->get(1205); $libro->title = $titolo; $libro->name = $libro->title; $libro->autore = $sanitizer->textarea($lineautori); $libro->save(); $libro->cover->add($cover); $libro->save(); }
-
url_fopen is enabled...
-
i created a template that import all from an xml (external) generated by Amazon Apis. My image field is standard so it contains jpg, jpeg, gif and png...
-
It works, thanks
-
I have an array i want to save in a textarea field. How can i have one line per array value? I tried this code.. foreach ($autori as $autore){ $lineautori .= $autore.'\n'; } $libro->autore = $sanitizer->textarea($lineautori);
-
I'm trying to create a book database using Amazon AWS API. The problem is I cannot save covers images. PW returns Exception: Item added to Pageimages is not an allowed type (in /home/librolo/public_html/wire/core/Array.php line 145) #0 /home/librolo/public_html/wire/core/Pagefiles.php(141): WireArray->add(Object(SimpleXMLElement)) #1 /home/librolo/public_html/wire/core/Pageimages.php(39): Pagefiles->add(Object(SimpleXMLElement)) #2 /home/librolo/public_html/site/templates/grab.php(101): Pageimages->add(Object(SimpleXMLElement)) #3 /home/librolo/public_html/wire/core/TemplateFile.php(88): require('/home/librolo/p...') #4 [internal function]: TemplateFile->___render() #5 /home/librolo/public_html/wire/core/Wire.php(267): call_user_func_array(Array, Array) #6 /home/librolo/public_html/wire/core/Wire.php(229): Wire->runHooks('render', Array) #7 /home/librolo/public_html/wire/modules/PageRender.module(194): Wire->__call('render', Array) #8 /home/librolo/public_html/wire/modules/PageRender.module(194): TemplateFile->render() #9 [internal function]: PageRender->___renderPage(Object(HookEvent)) #10 /home/librolo/public_html/wir in /home/librolo/public_html/index.php on line 202 This error message was shown because the site is in DEBUG mode. image example http://ecx.images-amazon.com/images/I/316stS044TL.jpg
-
thanks i will try
-
I know $user->pass returns encrypted pass for this reason i need the code to create an encrypted pass for comparing...i don't think it's a simple md5 encryption
-
I'm creating a password change form with 3 fields, old_pass, new_pass and confirm_pass. What i need is the code for crypting a pass for comparing the old_pass with the pass stored in db.
-
that's what I was looking for ;D Thanks
-
really nice.
-
Just a little suggestion to add in the config file the string setlocale(LC_TIME, 'eng', 'en_EN'); this help to output the correct date info when needed using 'strftime' instead of 'date'
-
It works perfectly, thanks
-
I perform a form submission via jquery. This form create a page and than i display the results below the form. I can display all my fields (after $page->save()) but not the $page->created property. I need to refresh the page to see the correct date
-
Thank you so much. You are always fast ;D
-
Not, my site is running in root but i put this file outside because i tried (using jquery) to call it from inside some pw folders but i always get "file not found".
-
The correct path must be /site/assets/etc... but i have /process/site/assets/etc.. /process/ is the external folder where is my php file called by jquery.
-
Oh thanks, yes i tried to use $input but since i'm outside the PW root i need to use $wire->input and not $input, that's was my mistake. Thanks
-
i can surely use str_replace but it's not a nice solution, i will wait Ryan
-
I'm noticing a strange behavior of the image->url property. I call a php file from jquery that display an image and a message so i have to put my php file outside the /site/ dir, but when i call $image->url it returns /my-external-dir/site/assets/file/etc... <? require_once('../index.php'); $messages=$wire->pages->find("template=wallmessage,limit=20,sort=-created"); foreach ($messages as $message){ $username = $message->parent->parent->name; $profilephoto = $message->parent->parent->profilephoto->eq(0)->size(60,60); echo "<p><img src='http://{$_SERVER['HTTP_HOST']}{$profilephoto->url}' /><div><a href='/profilo/{$username}'>{$username}</a></div><div>{$message->wallmessage}</div></p>"; } ?>