Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
589 views
in Q2A Core by

In my custom theme I am overriding function main() and checking if user is logged and the question age this way:

if(!qa_is_logged_in() && $this->template=='question' && (time() - $this->content['q_view']['raw']['created']) > 300) {
  ...
}

However, now I got a php error:

PHP Notice:  Undefined index:  q_view in qa-theme/custom/qa-theme.php on line 156

Can anybody help, and esp. tell me why we have no q_view here?

Thanks,
Kai

Q2A version: 1.5.4
by
For now I added a: && isset($this->content['q_view'])
by
are you adding within the method or in custom function? I am not sure either related or not but just to confirm..
by
!empty($this->content['q_view']) ?
http://www.php.net/manual/en/function.empty.php

other php case:
<?php error_reporting(E_ALL & ~E_NOTICE); ?>
php.ini case:
error_reporting = E_ALL & ~E_NOTICE
.htaccess case:
php_value error_reporting 30711

Please log in or register to answer this question.

...