-
Posts
601 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Frank Vèssia
-
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>"; } ?>
-
really strange, posting the form without jquery give me the same situation...The DB is correct utf8_general_ci
-
there is nothing more than this code. I have a simple form with a textarea and on submit i create a page child of the user in this way user->wall->message. If a user doesn't have any message, first i create the main node, a wall page, parent of all messages. That's my form: <form method="post" action="" class="form-stacked" id="wallform"> <div class="clearfix"><label for="wall">Condividi i tuoi pensieri con tutti</label> <div class="input"> <textarea name="wall" id="wall" rows="2" cols="100" style="width:500px"></textarea> </div> </div> <input type="submit" value="Pubblica" class="btn primary" id="submit" /> </form> and this is the jquery handler (because i don't refresh the page on submit) $(document).ready(function(){ $("#wallform").validate({ debug: false, rules: { wall: "required" }, messages: { wall: "Scrivi qualcosa da condividere", }, submitHandler: function(form) { $.post('/process/addwall.php', $("#wallform").serialize(), function(data) { $("#walllist").fadeOut("slow").load('/process/walldisplay.php?call=external').fadeIn('slow'); $("#wall").val(''); }); } }); });
-
the entire code is: <? require_once('../index.php'); $wallmessage = new Page(); $wallmessage->template = $wire->templates->get("wallmessage"); $userid = $wire->user->id; $find=$wire->pages->get("$userid")->find("template=wall"); if (count($find)==0){ $w = new Page(); $w->template = $wire->templates->get("wall"); $w->parent = $wire->pages->get($userid); $w->title = "Bacheca"; $w->name = $w->title; $w->save(); } $wallmessage->parent = $wire->pages->get($userid)->child("id=1043"); $wallmessage->title = $wire->sanitizer->textarea(substr($_POST['wall'],0,20)).rand(0,1000); $wallmessage->message = $wire->sanitizer->textarea($_POST['wall']); $wallmessage->name = $wallmessage->title; $wallmessage->save(); ?>
-
I'm trying to save page via Api. I've added this code for managing a textarea. $wallmessage->message = $wire->sanitizer->textarea($_POST['wall']); If i write something with ' char the system add \ => \'. How can i save my text correctly?
-
i hope you will do Ryan ;D
-
Thanks so much
-
great !
-
I'm building a form builder based on the original inputfileds of PW. Now i'm at the point in which i have the same form in the admin and in the frontend, changing a field in the admin my form change in the same way, same for the post action. Now i want to add the automatic validation for every field and for making this i need to add a select near every inputfield in the admin for choose the right validator.
-
Thanks as always, yes i'm writing the markup for user management in frontend and i have a question about this: i'm testing the frontend user profile and right now i can easily manage "my profile" page as /profile (i created a blank page in the tree) showing all my fields and a form for edit my profile, now i also want to browsing other user profiles, not mine, but i need something in the url to get the user data like an id or the name like /username. How can i do that? Because if i write something like /profile/username PW gets 404 because the page doesn't exist in the tree...