-
Posts
585 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Frank Vèssia
-
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...
-
mmm...i found the user template using the filter option...but. It's only one. I have two different user types in my websites, each with different fields, how can i create two different templates for users?
-
I'm in the process to create a new website for buying/selling books. Developing the user profile i noticed would be very useful having an inputfield text with multiple option. One of my field is called "Favorite books". Now this is a textarea and user has to write all the books one per line. This is not a fair solution, the best is having a single line text and after that a plus button that in jquery add another input text below and so on. i attached a simple shoot as example
-
It's possible to extend an inputfield without replacing the entire module? I want to add some functionalities to all the inputfields but i don't want to recreate all, i just want to create a single module that add this function to the existing fields.
-
Oh yeees. Thanks ;D
-
Ryan, i miss something or the new user system is not yet implemented in 2.1?
-
mmm...i'm trying to use this adminbar but when editing a page i get this error: Template '/home/processw/public_html/site/templates/' is not allowed If i edit the page via admin it works. :-\
-
looks really interesting... 8)
-
Multi-lingual sites with the Processwire CMS
Frank Vèssia replied to ryan's topic in Multi-Language Support
I like the /lang/ solution because i think we can positioning a website more easily on google in this way... multifields solution is too hard to do, it's like facebook or twitter or big websites do but i guess they don't care about positioning on google... If i want to use this method but using subdomain what i have to do? ex.: http://en.mysite.com/page http://fr.mysite.com/page -
thanks Drilonb
-
i have a dedicated server not hosting, i will try to ask to increase the limit, thanks.
-
i got this error code in one of my pw site. This website count an average of 4k unique visitors and the home page is very simple. I maybe made something wrong? It happends when i refresh the page, sometimes i get this error sometimes the page loads correctly. Warning: mysqli::mysqli() [mysqli.mysqli]: (08004/1040): Too many connections in /public_html/wire/core/ProcessWire.php on line 88 Warning: mysqli::set_charset() [mysqli.set-charset]: Couldn't fetch Database in /public_html/wire/core/ProcessWire.php on line 92 Warning: mysqli::query() [mysqli.query]: Couldn't fetch Database in /public_html/wire/core/Database.php on line 57 Warning: Database::query() [database.query]: Couldn't fetch Database in /public_html/wire/core/Database.php on line 72 Fatal error: Exception: SELECT id, class, flags FROM modules ORDER BY class (in /public_html/wire/core/Database.php line 72) #0 /public_html/wire/core/Modules.php(128): Database->query('SELECT id, clas...') #1 /public_html/wire/core/Modules.php(73): Modules->load('/home/hdps/doma...') #2 /public_html/wire/core/ProcessWire.php(95): Modules->__construct('/home/hdps/doma...', '/home/hdps/doma...') #3 /public_html/wire/core/ProcessWire.php(45): ProcessWire->load(Object(Config)) #4 /public_html/index.php(151): ProcessWire->__construct(Object(Config)) #5 {main} in /public_html/index.php on line 186 This error message was shown because the site is in DEBUG mode.
-
I would like to have a tool can export a template with all fields creating .pack file and reimport it in another pw website. It happends many time to me recreating all the stuff and this option can be very useful.
-
I modified a well done module (thanks to almonk) that shows up facebook like button to obtain a more complete set of social buttons that i always use for my sites. This module can shows facebook, twitter and google+ buttons. Example: <? $like = $modules->get('SocialBlock'); //$like->fbEnabled ='false'; to hidden a button (fbEnabled|twEnabled|gEnabled) $like->fbwidth = '110'; $like->fburl = 'http://www.yoursite.com/page/'; $like->twtext = $page->title; $like->twvia = 'yoursitename'; $like->twlang = 'italian'; $like->gsize = 'small'; echo $like->render(); ?> Module code: <?php class SocialBlock extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Social Networks buttons', 'version' => 006, 'summary' => 'Display Facebook/Twitter/Google+ buttons on your Processwire site.', 'href' => 'http://www.complementaryart.com', 'singular' => false, 'autoload' => false, ); } public function init() { $this->set('fbEnabled', 'true'); $this->set('fburl', ''); $this->set('fblayout', 'button_count'); $this->set('fbshowFaces', 'false'); $this->set('fbcolorscheme', 'light'); $this->set('fbwidth', '150'); $this->set('fbheight', '20'); $this->set('fbfont', 'Arial'); $this->set('twEnabled', 'true'); $this->set('twurl', ''); $this->set('twtext', ''); $this->set('twcount', 'horizontal'); $this->set('twvia', ''); $this->set('twlang', 'english'); $this->set('gEnabled', 'true'); $this->set('gsize', 'medium'); $this->set('gcount', 'true'); } public function ___render() { $social = ""; if ($this->fbEnabled){ if(!$this->fburl) $this->fburl = $page->url; // Build the iframe $social .= '<iframe src="http://www.facebook.com/plugins/like.php?href='.$this->fburl.'&layout='.$this->fblayout.'&show_faces='.$this->fbshowFaces.'&width='.$this->fbwidth.'&action=like&font='.$this->fbfont.'&colorscheme='.$this->fbcolorscheme.'&height='.$this->fbheight.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$this->fbwidth.'px; height:'.$this->fbheight.'px;" allowtransparency="true"></iframe>'; } if ($this->twEnabled){ if(!$this->twurl) $this->twurl = $page->url; $social .= '<a href="http://twitter.com/share" class="twitter-share-button" data-url="'.$this->twurl.'" data-text="'.$this->twtext.'" data-count="'.$this->twcount.'" data-via="'.$this->twvia.'" data-lang="'.$this->twlang.'">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>'; } if ($this->gEnabled){ $social .= '<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="'.$this->gsize.'" count="'.$this->gcount.'"></g:plusone>'; } return $social; } } SocialBlock.module
-
Sorry, was my fault...i was browsing the site in another tab so the admin session was still active and let me see the page.. ;D
-
I need to "unpublish" a page and its children, so i removed "guest" from roles but i still navigate the page. I dont want to delete it... any idea?