Skip to content

Commit

Permalink
fixed some minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksiroKe committed Apr 8, 2020
1 parent 46ea34b commit 92b3585
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion blog-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function bp_db_post_create($type, $userid, $cookieid, $ip, $title, $content, $pe
{
qa_db_query_sub(
'INSERT INTO ^blog_posts (catid, type, userid, cookieid, createip, title, content, permalink, format, tags, notify, name, created) ' .
'VALUES (#, $, #, $, #, UNHEX($), $, $, $, $, $, $, NOW())',
'VALUES (#, $, #, UNHEX($), $, $, $, $, $, $, $, $, NOW())',
$catid, $type, $userid, $cookieid, bin2hex(@inet_pton($ip)), $title, $content, $permalink, $format, $tagstring, $notify, $name
);
return qa_db_last_insert_id();
Expand Down
12 changes: 7 additions & 5 deletions blog-format.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@ function bp_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt

if ($isarticle) {
if (isset($post['title'])) {
$fields['url'] = bp_p_request( $post['permalink'] );

if (isset($options['blockwordspreg']))
$post['title'] = qa_block_words_replace($post['title'], $options['blockwordspreg']);

Expand All @@ -397,11 +395,15 @@ function bp_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt
}
/*if (isset($post['score'])) // useful for setting match thresholds
$fields['title'].=' <small>('.$post['score'].')</small>';*/
}
} else $fields['title'] = 'Untitled Article';

$fields['url'] = bp_p_request( $post['permalink'] );

if (isset($post['summary'])) {
$fields['content'] = substr(strip_tags($post['summary']), 0, strlen(qa_opt('bp_content_max')) ? qa_opt('bp_content_max') : 50) . ' ...';

$limit = strlen(qa_opt('bp_content_max')) ? qa_opt('bp_content_max') : 100;
if (strlen($post['summary']) > $limit)
$fields['content'] = substr(strip_tags($post['summary']), 0, $limit). ' ...';
else $fields['content'] = substr(strip_tags($post['summary']), 0, $limit);
}

$fields['q_tags'] = array();
Expand Down
1 change: 0 additions & 1 deletion blog-layer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function bp_user_articles($handle, $userhtml)
if (!QA_FINAL_EXTERNAL_USERS && !is_array($useraccount)) // check the user exists
return include QA_INCLUDE_DIR . 'qa-page-not-found.php';


// Get information on user articles
$pagesize = qa_opt('page_size_qs');
$count = (int)@$userpoints['qposts'];
Expand Down
5 changes: 2 additions & 3 deletions blog-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public function qa_blog_write( $userid, $blog_cats )

// Check for permission error
$permiterror = qa_user_maximum_permit_error('bp_permit_post_p', QA_LIMIT_QUESTIONS);
//$permiterror = bp_user_maximum_permit_error('bp_permit_post_p', QA_LIMIT_BLOG_POSTS);
//function qa_default_option($name)

$qa_content = qa_content_prepare(false, array_keys(bp_cat_path($blog_cats, @$in['catid'])));

if ($permiterror) {
Expand Down Expand Up @@ -300,7 +299,7 @@ public function qa_blog_write( $userid, $blog_cats )
$permalink = gmdate( 'Y/m/d', time() ) . '/' . $slug;

$postid = bp_post_create($userid, qa_get_logged_in_handle(), $cookieid,
$in['title'], $in['content'], $permalink, $in['format'], $in['text'], isset($in['tags']) ? qa_tags_to_tagstring($in['tags']) : '',
$title, $in['content'], $permalink, $in['format'], $in['text'], isset($in['tags']) ? qa_tags_to_tagstring($in['tags']) : '',
$in['notify'], $in['email'], $in['catid'], $in['extra'], $in['queued'], $in['name']);
qa_redirect(bp_p_request( $permalink ));
}
Expand Down

0 comments on commit 92b3585

Please sign in to comment.