Jump to content

GregL83

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

GregL83's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm trying to access 'this' from a jquery plugin method that has been called as a result of an event. 'this' becomes the element/object that fired the event instead of the original 'this' object that the plugin was applied on. The reason is because my init function stores data using the jquery.data() method and I want to nicely retrieve some of that data from inside the event method as a standard OOP language would allow. (function( $ ){ var methods = { init : function( options ) { return this.each(function(){ $("#example").bind('click.name', methods.doSomething); }); }, destroy : function( ) { return this.each(function(){ $(window).unbind('.tooltip'); }) }, doSomething : function( ) { // I WANT TO ACCESS 'THIS' HERE HOWEVER, 'THIS' NOW REFERS TO THE ELEMENT/OBJECT FROM THE ONCLICK EVENT (#example) // BEFORE THIS WOULD REFERENCE THE ENTIRE OBJECT WHERE THE .data() FUNCTION COULD BE USED // ITS MY UNDERSTANDING YOU CAN DO THIS WITHOUT PASSING THE OBJECT... HOW??? // THANKS }, }; $.fn.tooltip = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' ); } }; })( jQuery ); Thanks in advance!
  2. lastkarrde, I was thinking along the same lines of what you've suggested. I think its a great start and would work. BUT i'm wondering if anyone has already done something similar, because sometimes you can't always see problems or efficiency issues until the system is already coded. I'll do some more research and see what solutions i can come up with. Otherwise, if anyone has done any kind of algorithms for ad relevance, your advice would be greatly appreciated.
  3. I was pondering the idea of collecting the browsing history of users on my site. Which articles they read. What they search for. Where they have come from. I wanted to start displaying relevant articles on my index page or suggested articles based on their browsing history. I really have no solid idea on how to implement this tech. The main concept would be: 1) Collect data about the user 2) Use user data to relate to relevant content 3) Display relevant content to the user when they login Have any of you done this for an ad firm?
  4. That didn't take me long... $data = array( 'number' => new Zend_Db_Expr('number + 1') ); http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.write.insert
  5. Hey, I'm trying to run a update using the db adapter object in zend framwork. I want to have simple math in the sql statement using the update function. Is this possible? i.e. $data = array( 'number' => 'number + 1' ); $where = array( 'id = ?' => 1 ); $db->update('sampleTable', $data, $where); Thanks in advance!
  6. Yea. I'll probably never use it. As for encryption. It depends on the case. It you are converting an old database, then ignace is correct with using the MD5 encryption method with salt. The reason is that you can create a script to automatically update the passwords that already exist. The possibility of the salted password existing in a rainbow table is small. For new databases, no passwords stored already, try using SHA-256. It is considered one of the most secured methods of encryption. You can find plenty of material on implementing it within php...
  7. It seems everytime I write a question here I solve the answer like 10 minutes later :x Basically, I used this resource to find the correct verison fo xdebug: http://blog.thecodingmachine.com/content/setting-xdebug-debugging-environment-php-wamp-eclipse-pdt Then I made sure all my xdebug settings were correct in the php.ini file http://xdebug.org/docs/all_settings Lastly, I made sure that everything matched up in phpinfo
  8. Hey, As in the title I have Win7, Wamp 2.0 (PHP 5.3 & Apache 2.2). I downloaded many different versions of xdebug and cannot get any of them to work. I made sure I downloaded the version of XDebug that supports PHP 5.3. Also, I tried the 32 bit and 64 bit versions. I am running a 64 bit machine. My installation instructiong are: 1) I renamed the php_xdebug_versionInfo.dll to php_debug.dll 2) Placed the dll in the ext directory for the Wamp php installation 3) Update the php.ini file for Wamp with the following: extension=php_xdebug.dll zend_extension_ts="c:/wamp/bin/php/php5.3.0/ext/php_xdebug.dll" xdebug.profiler_output_dir="c:/wamp/tmp/xdebug" I have not been successful in getting xdebug to write a cache file. I have tried many variations of settings I have found in getting wamp to install with xdebug with no help... I can't find an error or anything. It just doesn't run??? PLease help!
  9. I have found resources in regards to this question... for anyone troubled with the same issue... 1) First research binary code and learn how binary code is constructed... specefically to numerical values. 2) The php bitwise operators are used to manipulate binary code in regards to certain tasks. To understand why search application for bitwise operators. For the most part, i don't see why it is important to know this. It may come in usefull someday... :/
  10. So I have coded php for about 5-6 yrs and have never really needed to use binary conversions and the bitwise operator like >> or << . I took a php class in college but that basically consisted of the students trying to learn php on their own... So i have never had any exposure to that portion of php coding. I have to take an exam on PHP with a bunch of questions that DO NOT show how good of a coder you are. There are a bunch of questions on bitwise operators and binary conversions... Am I missing something??? Whats the point of converting a string to binary or knowing how to do this in your head? Any help?
  11. i'm under the impression that zend should automatically register the default adapter declared in my config.ini/application.ini file... i have been able to get an adapter obj other ways, but I want to know why I can't do it the way described in the zend tutorial. this seems to be the standard way but i cant get it to work.... does it matter that the db wasn't created in the cmd line???
  12. I tried both. I am able to do Cagecrawler's method; however, i want to be able to get the db object from the config.ini params...
  13. DUH! Simply use the form object to retrieve the values instead of the request object. $form->getValues();
  14. Hello, I was under the impression that zend form filters would not only filter the input for validation but also the returned values. When I call $request->getPost() to get the params they are not filtered but when the form returns an error and re-displays the input values in the form they are filtered. I'm trying to do a simple test. Basically, StringToLower on a simple input txt field. Question: How do I get the input values filtered for database insertion? Thanks in advance!
×
×
  • 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.