Jump to content

GregL83

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Everything posted by GregL83

  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!
  15. I posted something earlier... I upgraded to Zend Framework 1.10. I haven't done a DB connection with Zend before. I am extremely frustrated with the setup. I have my application.ini file as follows: database.adapter = "PDO_MYSQL" database.params.host = "localhost" database.params.dbname = "test" database.params.username = "root" database.params.password = "" database.params.isDefaultTableAdapter = true And inside my index controller inside the index action i'm calling the following line to access the DB: $db = Zend_Db_Table_Abstract::getDefaultAdapter(); $db->fetchAll('SELECT * FROM test1'); Is my understanding that Zend will automatically setup the DB resource with my ini settings as is... But I keep recieving the error: Call to a member function fetchAll() on a non-object I have passed one forum where this exact method is being used. For the life of me I cannot seem to access the DB. And zend tutorials/guides/docs with all the different versions just plain suck. Here is where I found a resource: http://www.zfforums.com/zend-framework-components-13/databases-20/applicationi-ini-connect-db-2936.html
  16. Hello, I updated my verison of Zend framework to 1.10 today. All i did was copy the main library over and replace the old Zend folder. My existing appplications work well. I am trying to build a mysql db app and i'm having trouble connecting to the DB with zend. It was my understanding that all i need to do is add the configuration lines to the application.ini file... However, i keep getting the error: Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'Configuration array must have a key for 'dbname' that names the database instance' I can't seem to get this connected... the params in my application.ini are as follows: resources.db.adapter = "PDO_MYSQL" resources.db.host = "localhost" resources.db.dbname = "test" resources.db.username = "root" resources.db.password = "" resources.db.isDefaultTableAdapter = true
  17. HUH!!! I tried it again with the QSA flag and now it works...
  18. also, i've tried this without any success either: RewriteRule ^locate/([A-Za-z0-9,'-]+)/?$ locater2.php?ct=$1 [L,QSA]
  19. what you are trying to do is accomplished using a slug system. instead of using an internal numerical id query your database based on the cityname (with indexing). this is similar to someting that you would see from wordpress.
  20. Hey, I am using the mod rewrite module with apache. I have a slug system similar to wordpress. I am trying to write a rewrite rule with not much sucess. So far I have RewriteRule ^locate/([A-Za-z0-9,'-]+)\?s=(d)/?$ locater2.php?ct=$1&s=$2 [L] This isn't working and I can't figure out why... the url should look something like: locate/jamestown?s=d When I try the same rewrite rule without the get param, it works fine... i.e.: RewriteRule ^locate/([A-Za-z0-9,'-]+)/?$ locater2.php?ct=$1 [L] locate/jamestown Thanks in advance!!!
  21. hey all, we have update our index page and are interested in hearing your thoughts... http://www.YourScene.us Thanks.
  22. i added the group by method from JLI's query and now have the expected results thanks for the help guys
  23. Mchl, you are close. The problem now, is that i'm returning the same user twice if the last pictures were by that user...
  24. this doesn't work either... i'm trying to return only one row per user. so as in my query, i want to take the latest active picture for each user and only return a single user row for each user...
×
×
  • 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.