Jump to content

ballhogjoni

Members
  • Posts

    1,026
  • Joined

  • Last visited

Everything posted by ballhogjoni

  1. I have the following code: $user->attributes()["username"] $user->attributes() is an array of the users attributes. array('username' => 'value') when i run this code: $user->attributes()["username"] i get an error: Parse error: parse error in ... What am i doing wrong?
  2. I am using this example http://www.markisgood.com/blog/php/create-your-own-lightweight-php-mvc-framework I don't want to have to run this code $this->registry->template->show('methodView.php'); at the end of every action.
  3. So i am writing my own mvc framework just for my own knowledge. I can't figure out how to render the view automatically. Does anyone have any suggestions or ideas?
  4. ya I tried that but the phpinfo still reports that display_errors is Off
  5. display_errors Off Off display_startup_errors Off Off error_log no value no value error_reporting 22527 22527
  6. ok so the problem was these lines in php.ini file: ; Default Value: E_ALL & ~E_NOTICE ; Development Value: E_ALL | E_STRICT ; Production Value: E_ALL & ~E_DEPRECATED I was getting this error when I ran php -v in the terminal: PHP: parse error in /private/etc/php.ini on line 111 Just commented those out and it works now ... I wonder if I'm just not getting the date.timezone error because I commented out the error reporting stuff
  7. according to php_info the loaded conf file is /private/etc/php.ini and thats the one I changed.
  8. So I set the date.timezone in php.ini and restarted the server but I still get this warning: Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function This is what I set it to date.timezone = "America/New_York"
  9. Hey all, I would like to some how clean up an if statement to be a little cleaner. if(condition && condition && (condition && condition) || (condition && condition) || (condition && condition)) How can I do that?
  10. forgot to include my callback function ini_set('unserialize_callback_func', 'mycallback'); // set your callback_function function mycallback($classname) { // just include a file containing your classdefinition // you get $classname to figure out which classdefinition is required include_once '/plugins/digg-digg/include/dd-class.php'; }
  11. So i read the docs on this and it said to create a callback function and use ini_set to set the function. I am trying to serialize an array with the class inside the array $dd_normal_button = array ( 'dd_normal_button_display' => array ( 'dd_button_digg' => __PHP_Incomplete_Class::__set_state(array( '__PHP_Incomplete_Class_Name' => 'DD_Digg', 'buttonLayout' => array ( 'Wide' => 'DiggWide', 'Normal' => 'DiggMedium', 'Compact' => 'DiggCompact', 'Icon' => 'DiggIcon', ), ) ) ) ); So then I try serialize($dd_normal_button); and I get the error. Any ideas/suggestions. Thanks
  12. ok great. I just used var_dump the variable in a textarea to the browser and that seemed to work.
  13. ok...I am trying to copy the output from the browser, but it doesn't work because of the brackets plus the browser parses the strings without the quotes. How can I do this? Basically I want to serialize it after i've made my changes to the unserialized array.
  14. the code is simple but the output is wrong. $str = <<<EOF a:2:{s:7:"visible";a:7:{i:0;s:5:"email";i:1;s:5:"print";i:2;s:8:"facebook";i:3;s:4:"digg";i:4;s:11:"stumbleupon";i:5;s:7:"twitter";i:6;s:6:"reddit";}s:6:"hidden";a:0:{}} EOF; echo "<textarea rows='10' cols='90'>";print_r(unserialize($str));echo "</textarea>"; the ouput is Array ( [visible] => Array ( [0] => email [1] => print [2] => facebook [3] => digg [4] => stumbleupon [5] => twitter [6] => reddit ) [hidden] => Array ( ) ) This is wrong I need something like this: array ( 'visible' => array ( 0 => 'email', 1 => 'print', 2 => 'facebook', 3 => 'digg', 4 => 'stumbleupon', 5 => 'twitter', 6 => 'reddit', ), 'hidden' => array ( ), ) What am I doing wrong? How do I fix it?
  15. I have this url http://domain.com/category/parentcategory/storename/ and I want to change it to http://domain.com/stores/storename/ How can I do that? Thanks
  16. where mysql slow queries is finding the queries? Basically I need to find the offending code that produced/ran the query.
  17. yes this has been done. greped for portions of it. Found part of it in the redirection plugin...removed it but the query still shows up in the log.
  18. SELECT count(*) as c FROM wp_posts WHERE ID IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 18562) AND ID IN (SELECT post_id FROM wp_postmeta WHERE meta_key = '_menu_item_menu_item_parent' AND meta_value = '40138') ORDER BY menu_order;
  19. trying to return an auth token to the client via an ajax request. with curl you can fake out an ajax request, right?
  20. Can you see if a request (post/get) is from a curl request or an actual user? I am trying to defeat a little bit of fraud.
  21. figured it out. This is what I needed. /http:\/\/(.*?)\/.*?(?:[&?]p|q|qt)=([^&=]{2,}?)(?:&|$)/
  22. also you took out all the matches i need
×
×
  • 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.