Jump to content

RichardRotterdam

Members
  • Posts

    1,509
  • Joined

  • Last visited

Everything posted by RichardRotterdam

  1. I guess that would be a good example of when the serialize would come in handy so that's a good point. However if for example you want to change a user name, then simply sending the id and a new name would be enough instead of cramming a User object inside a session.
  2. Just curious but what is it that the script is suppose to do. Instantiating a PHP object and storing it in a session doesn't really seem right. Couldn't you simply instantiate a new object in your ajax script?
  3. The best way to see what best suits your needs is by simply trying these RTE/WYSIWYG editors out. There are tons of comparison charts out there, you could select a WYSIWYG editor on the criteria for what matters to you to most.
  4. I personally don't like smarty much because I think it's syntax doesn't make anything better. You may want to look at the following thread that discusses smarty http://www.phpfreaks.com/forums/index.php/topic,266164.0.html However I do like how Zend_Layout handles things as it concentrate on the html output of a certain controller by building a view. I think cakePHP handles this very similar as ZF does (not sure though). Readup on how the views are handled in the different MVC frameworks available as you might want to get rid of smarty entirely.
  5. The onload event is correct right now so your problem lies elsewhere. More details are required in order to find out what it exactly is that goes wrong. Here are a couple of details that might help finding out what it is. 1. What does your show_images() function look like? 2. What does your source look like when you check it in the browser (no php) 3. Do you have firebug or some other js debugging tool for your browser if so do you receive any javascript error and what is the error? 4. What does the URL look like you request using Ajax (try an alert or console.log in firebug)?
  6. That reminds me of a quote I read before: Sounds like fun I want to learn about it.
  7. If your fetching multiple records from a db you could create an unique id for div element something like: <?php for($i=0; $i<sizeof($records); $i++ ): ?> <a onMouseOver="ShowPopup('hoverpopup<?php echo $i; ?>');" onMouseOut="HidePopup('hoverpopup<?php echo $i; ?>');">link</a> <div id="hoverpopup<?php echo $i; ?>"> <!-- popup stuff --> </div> <?php endfor; ?>
  8. Actually remove that code it's a old bad habbit of mine that I used since mootools 1.0 Hmmm that probably is the way to go still you'd be having a couple of draggable object, I don't think you will gain performance. With "this" do you mean inside the Drag class and for what would you like to use it? Out of curiosity are you going to get these items from a database? I remember trying to create something similar a long time ago. The thing I got stuck with was connecting the Item Id's from the database to these draggables somehow. If so maybe you got an idea how to do this.
  9. try fetchAll instead of fetch to return an array $obj = $stmt->fetchAll();
  10. Let me clarify that with some code. In the following example I assign the options from the constructor to this.options instead of using this.setOptions() which is nearly the same var yourClass = new Class({ options:{ color: "#FFF" // start value for color }, initialize: function(options){ // assign options to this.options instead of the setOptions() method this.options = options; } } How ever in the above code you will lose the color value #FFF that's why setOptions is used instead. You also might want to check out what the manual says about setOptions http://www.mootools.net/docs/core/Class/Class.Extras#Options:setOptions What about passing an array with a single value inside it? I think that would solve it. Ofcource you could also write something in your constructor method which checks the data type passed var room = new Room({ items:[ new Item({ id:1, name:'banana' }) ] }); // or using new Array var room = new Room({ items:new Array( new Item({ id:1, name:'banana' }) ) }); I'd use a Item object over simple strings btw. Your Item objects will be drag-able so you probably want to build in some methods for the Item objects later on. That was a mistake it should have been commented only once. Hope it all made sense though
  11. If you're going to do this the mootools way have a look at a class template by one of the mootools developers http://davidwalsh.name/mootools-12-class-template I think the logic behind this would be to have a method for the Item objects that checks in what room it is once it is dropped inside a room. As find this topic kinda interesting I made a small start with your classes. // the room class var Room = new Class({ //implements //implements Implements: [Options], //options options: { id: '', name: '', items:[] }, //initialization initialize: function(options) { //set options this.setOptions(options); //set the option attributes as internal vars this.id = this.options.id; this.name = this.options.name; this.items = this.options.items; }, // place an item in the room setItem: function(item){ // put the item in the internal array this.items.push(item); }, // get an item by id getItem: function(id){ return this.items[id]; }, //get all items inside the room getItems: function() { return this.items; } }); // the item class var Item = new Class({ //implements Implements: [Options], //options options: { id: '', name: '' }, //initialization initialize: function(options) { //set options this.setOptions(options); //set the option attributes as internal vars this.id = this.options.id; this.name = this.options.name; }, }); // instantiate new room var room = new Room({ id:1, name:"darkroom" }); // instantiate new item var item1 = new Item({ id:1, name:'banana' }); // instantiate new item var item2 = new Item({ id:2, name:'katana' }); room.setItem(item1); room.setItem(item2); console.log(room.getItems());
  12. What does you ajax_showTooltip function look like?
  13. Direct url entry could be one of the options. Pretty much you can apply the same spam prevention techniques as non ajax forms.
  14. What I see on that page is a CAPTCHA
  15. The chance that you will receive spam is just as big with an Ajax form as it would be with a non Ajax form. Someone could easily find the location of the script that processes the Ajax form by looking at your HTML source. edit I'm sorry but I fail to see how setting a session on a onclick event will prevent spamming. I could easily write a script that sets that session and spam the hell out of you anyway.
  16. It looks like half baked PHP and XML is that really the XML you want to parse? And do you want to do this using Ajax?
  17. Wat you are requesting is probably possible, you're question is vague though. Why don't you make a start yourself so people can help you with that? The community members are not here to write code for you
  18. I think your table names are a bit confusing but maybe that's just my opinion This is what I think you mean. You want to know if you should use the following tables: - Oders (which you name order_header) - Products (which you name order_details) - Product_attributes (which you name item attributes If a product/item can have a x number and type of attributes I would create the 3rd table. Cramming a formated string in one table field which you can later translate into an array is just a bad database design (even though both OSCommerce and Virtuemart do this).
  19. For a simple div overlays google up "javascript modal box" and "javascript dialog box". Most javascript frameworks solve the crossbrowser issues so you might want to use one that's written for a js framework. Facebook seems more complicated with the js GUI interfaces though. You might want to look at extJs or Mocha for mootools.
  20. This is the first result I get using Google http://www.w3schools.com/PHP/php_db_odbc.asp Doesn't that one work?
  21. Java != JavaScript Is there any reason you're using Javascript? Why not simply do it all with PHP if I may ask? And what does your comment box look like in HTML?
  22. Is this one of the lines that produces the error? if (preg_match ('/^[A-Z \'.-]{2,20}$/i', $trimmed['conductivitybars'])) { Here you are probably requesting a value from the array where the index 'conductivitybars' doesn't exist. in code. you need to set the index before you can use it. for example this will not give a notice message: $trimmed = array(); $trimmed['conductivitybars'] = ""; echo $trimmed['conductivitybars']; this will give the notice message: $trimmed = array(); // without the 'conductivitybars' index set echo $trimmed['conductivitybars'];
  23. A shoppingcart that uses arrays instead of a database doesn't even exist.
  24. Did you mean this thread posted a few hours ago didn't receive any responses? http://www.phpfreaks.com/forums/index.php/topic,268254.0.html Hmmm
  25. If you look at the source for those really annoying div overly popups you'll often see a function nearly identical to what you have written. It does indeed work. However if you look at the uncompressed mootools or jQuery source you'll see a lot more magic going on for the selector method.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.