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

i can't call q_list_item, don't know why.

tried:

 

require_once QA_INCLUDE_DIR.'qa-theme-base.php';

 

and

 

require_once QA_BASE_DIR.'qa-include/qa-theme-base.php';

 

the script is:

 

 

<?php
define('QA_BASE_DIR', './');
 
require_once QA_BASE_DIR.'qa-include/qa-base.php';
require_once QA_BASE_DIR.'qa-include/qa-app-users.php';
require_once QA_BASE_DIR.'qa-include/qa-db.php';
require_once QA_BASE_DIR.'qa-include/qa-theme-base.php';
 
qa_base_db_connect(null);
require_once QA_INCLUDE_DIR.'qa-db-selects.php';
$postid=163;
$post=qa_db_single_select(qa_db_full_post_selectspec(null,$postid));
echo $post['title'];
$answers = (int)$post['acount'];
echo $answers;
q_list_item($post);
 
?>
 
 
thanks.

1 Answer

+1 vote
by

Um... well, qa-theme-base.php is a class.  You need to create a member of that class, then call $myTheme->q_list_item($post);

You can do this with qa-app-format.php:

$myTheme = qa_load_theme_class($theme, $template, $content, $request);
$myTheme->q_list_item($post);

look at that file to see what you need to send it.

by
tried :
qa_load_theme_class(qa_opt('site_theme'), 'custom', qa_content_prepare(), 'anything');

but it loads the whole theme. i want only a specific question without the rest, what am i missing?
by
that's because qa-page.php doesn't just give you functions, it actually loads the page when you include it.  If you're just trying to get the q_list_item() output, an ajax call to your theme class would be much simpler.  Take a look at the ajax comment voting plugin to see how to do this.
...