Need help in this code

Post date: 2021-03-06 23:09:23
Views: 122

 https://github.com/NoahY/q2a-featured/blob/master/qa-featured-layer.php

<?php

class qa_html_theme_layer extends qa_html_theme_base {

var $featured_questions;

function doctype(){

$featured = qa_db_read_one_assoc( qa_db_query_sub('SELECT * FROM ^posts q INNER JOIN ^posttags t ON q.postid=t.postid INNER JOIN ^words w ON t.wordid=w.wordid WHERE q.type="Q" AND w.word=$ ORDER BY rand() LIMIT 1', "tag" ));

if($featured && (!$this->request || $this->request=='questions') && !qa_get('sort') && isset($this->content'q_list'])) {

$featured = explode(',',$featured);

foreach($this->content'q_list']'qs'] as $idx => $question) {

if(in_array($question'raw']'postid'],$featured)) {

unset($this->content'q_list']'qs']$idx]);

}

}

foreach($featured as $id) {

$userid = qa_get_logged_in_userid();

$selectspec=qa_db_posts_basic_selectspec($userid,true);

$selectspec'source'].=" JOIN (SELECT postid FROM ^posts WHERE postid=$) y ON ^posts.postid=y.postid";

$selectspec'arguments']] = $id;

$question = qa_db_select_with_pending($selectspec);

$usershtml=qa_userids_handles_html(qa_any_get_userids_handles($question));

$options=qa_post_html_defaults('Q');

$q_item = qa_any_to_q_html_fields($question$id], $userid, qa_cookie_get(), $usershtml, null, $options);

array_unshift($this->content'q_list']'qs'],$q_item);

}

$this->featured_questions = count($featured);

}

qa_html_theme_base::doctype();

}

// theme replacement functions

function q_list($q_list) {

if(isset($q_list'qs']))

foreach ($q_list'qs'] as $idx => $q_item)

if($idx < $this->featured_questions)

$q_list'qs']$idx]'classes'] = @$q_list'qs']$idx]'classes'].' qa-q-list-item-featured';

else

break;

qa_html_theme_base::q_list($q_list);

}

function head_custom() {

$this->output('<style>',qa_opt('featured_question_css'),'</style>');

qa_html_theme_base::head_custom();

}

}

Warning: in_array() expects parameter 2 to be array, null given in  (720) : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in  : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in  : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in  : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in: eval()'d code on line 14

Warning: Invalid argument supplied for foreach() in : eval()'d code on line 18

Warning: count(): Parameter must be an array or an object that implements Countable in  : eval()'d code on line 33 

Please click Here to read the full story.
 
Other Top and Latest Questions:
Musk calls proxy advisory firms 'corporate terrorists.' Why their power is growing in the stock market
What a cut in Reliance's Russian crude purchases would mean for India
Social Security Administration announces 2026 COLA benefit increase of 2.8% — what it means for you
Jim Cramer's top 10 things to watch in the stock market Friday
New York Attorney General Letitia James set to plead not guilty in mortgage fraud case
Family offices fear dollar depreciation, lower investment returns in wake of tariffs
Traders get their wish as inflation numbers give Fed greenlight to cut twice more this year
Why Jim Cramer thinks GE Aerospace and GE Vernova are poised for success
These 4 traits help successful people achieve their goals more often than most, Ivy League psychologist says: 'Stop writing in your journal'
Warren Buffett's Berkshire is lagging the S&P 500 by the largest gap so far this year