ballhogjoni
Members-
Posts
1,026 -
Joined
-
Last visited
Everything posted by ballhogjoni
-
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?
-
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.
-
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?
-
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
-
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"
-
Call to undefined method __PHP_Incomplete_Class::__set_state()
ballhogjoni replied to ballhogjoni's topic in PHP Coding Help
bump -
Call to undefined method __PHP_Incomplete_Class::__set_state()
ballhogjoni replied to ballhogjoni's topic in PHP Coding Help
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'; } -
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
-
php unserialize adding brackets around array keys?
ballhogjoni replied to ballhogjoni's topic in PHP Coding Help
ok great. I just used var_dump the variable in a textarea to the browser and that seemed to work. -
php unserialize adding brackets around array keys?
ballhogjoni replied to ballhogjoni's topic in PHP Coding Help
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. -
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?
-
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
-
where mysql slow queries is finding the queries? Basically I need to find the offending code that produced/ran the query.
-
Wordpress guru? I need to know where this sql is located.
ballhogjoni replied to ballhogjoni's topic in Applications
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. -
Wordpress guru? I need to know where this sql is located.
ballhogjoni posted a topic in Applications
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; -
Check if a request is from curl or an actual user?
ballhogjoni replied to ballhogjoni's topic in PHP Coding Help
trying to return an auth token to the client via an ajax request. with curl you can fake out an ajax request, right? -
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.
-
figured it out. This is what I needed. /http:\/\/(.*?)\/.*?(?:[&?]p|q|qt)=([^&=]{2,}?)(?:&|$)/
-
also you took out all the matches i need