$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"cat_id" => $data['news_cat'],
"cat_name" => $data['news_cat_name'],
"cat_image" => $news_cat_image,
"news_subject" => $data['news_subject'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => $comments,
"news_allow_comments" => $data['news_allow_comments'],
"news_sticky" => $data['news_sticky']
);
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"cat_id" => $data['news_cat'],
"cat_name" => $data['news_cat_name'],
"cat_image" => $news_cat_image,
"news_subject" => $data['news_subject'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => $comments,
"news_allow_comments" => $data['news_allow_comments'],
"news_source_url" => $data['news_source_url'],
"news_source_title" => $data['news_source_title'],
"news_sticky" => $data['news_sticky']
);
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"cat_id" => $data['news_cat'],
"cat_name" => $data['news_cat_name'],
"cat_image" => $news_cat_image,
"news_subject" => $data['news_subject'],
"news_ext" => "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."' AND comment_hidden='0'"),
"news_allow_comments" => $data['news_allow_comments'],
"news_sticky" => $data['news_sticky']
);
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"cat_id" => $data['news_cat'],
"cat_name" => $data['news_cat_name'],
"cat_image" => $news_cat_image,
"news_subject" => $data['news_subject'],
"news_ext" => "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."' AND comment_hidden='0'"),
"news_allow_comments" => $data['news_allow_comments'],
"news_source_url" => $data['news_source_url'],
"news_source_title" => $data['news_source_title'],
"news_sticky" => $data['news_sticky']
);
$news_subject = stripinput($_POST['news_subject']);
$news_source_url = stripinput($_POST['news_source_url']);
$news_source_title = stripinput($_POST['news_source_title']);
UPDATE ".DB_NEWS." SET news_subject='$news_subject',
UPDATE ".DB_NEWS." SET news_subject='$news_subject', news_source_url='$news_source_url',
$result = dbquery("INSERT INTO ".DB_NEWS." (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_image, news_image_t1, news_image_t2, news_visibility, news_draft, news_sticky, news_reads, news_allow_comments, news_allow_ratings) VALUES ('$news_subject', '$news_cat', '$body', '$body2', '$news_breaks', '".$userdata['user_id']."', '".($news_start_date != 0 ? $news_start_date : time())."', '$news_start_date', '$news_end_date', '$news_image', '$news_image_t1', '$news_image_t2', '$news_visibility', '$news_draft', '$news_sticky', '0', '$news_comments', '$news_ratings')");
$result = dbquery("INSERT INTO ".DB_NEWS." (news_subject, news_source_url, news_source_title, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_image, news_image_t1, news_image_t2, news_visibility, news_draft, news_sticky, news_reads, news_allow_comments, news_allow_ratings) VALUES ('$news_subject', '$news_source_url', '$news_source_title', '$news_cat', '$body', '$body2', '$news_breaks', '".$userdata['user_id']."', '".($news_start_date != 0 ? $news_start_date : time())."', '$news_start_date', '$news_end_date', '$news_image', '$news_image_t1', '$news_image_t2', '$news_visibility', '$news_draft', '$news_sticky', '0', '$news_comments', '$news_ratings')");
$result = dbquery("SELECT news_subject, news_cat, news_news, news_extended, news_start, news_end, news_image, news_image_t1, news_image_t2, news_visibility, news_draft, news_sticky, news_breaks, news_allow_comments, news_allow_ratings FROM ".DB_NEWS." WHERE news_id='".(isset($_POST['news_id']) ? $_POST['news_id'] : $_GET['news_id'])."' LIMIT 1");
$result = dbquery("SELECT news_subject, news_source_url, news_source_title, news_cat, news_news, news_extended, news_start, news_end, news_image, news_image_t1, news_image_t2, news_visibility, news_draft, news_sticky, news_breaks, news_allow_comments, news_allow_ratings FROM ".DB_NEWS." WHERE news_id='".(isset($_POST['news_id']) ? $_POST['news_id'] : $_GET['news_id'])."' LIMIT 1");
$news_subject = $data['news_subject'];
$news_source_url = $data['news_source_url'];
$news_source_title = $data['news_source_title'];
$news_subject = "";
$news_source_url = "";
$news_source_title = "";
echo "<td width='80%' class='tbl'><input type='text' name='news_subject' value='".$news_subject."' class='textbox' style='width: 250px' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='100' class='tbl'>Source info:</td>\n";
echo "<td width='80%' class='tbl'>Source URL: <input type='text' name='news_source_url' value='".$news_source_url."' class='textbox' style='width: 250px' />
<br />Source title: <input type='text' name='news_source_title' value='".$news_source_title."' class='textbox' style='width: 250px' /></td>\n";
echo "</tr>\n<tr>\n";
/* News source */
if (!strstr($info['news_source_url'], "http://") && !strstr($info['news_source_url'], "https://")) {
$urlprefix = "http://";
} else {
$urlprefix = "";
}
if($info['news_source_url'] != "" && $info['news_source_title'] != ""){
echo " <strong>Source:</strong> <a href='".$urlprefix.$info['news_source_url']."' title='".$urlprefix.$info['news_source_url']."' target='_blank'>".$info['news_source_title']."</a>";
}
/* News source */
<?php
$result = dbquery("ALTER TABLE ".DB_NEWS." ADD news_source_url VARCHAR(250) NOT NULL DEFAULT '' AFTER news_allow_ratings");
$result = dbquery("ALTER TABLE ".DB_NEWS." ADD news_source_title VARCHAR(200) NOT NULL DEFAULT '' AFTER news_source_url");
?>
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
6 participants
Notifications
You are not receiving notifications from this thread.
Related Questions