21 if (!defined(
'XOOPS_ROOT_PATH')) {
24 $GLOBALS[
'xoopsLogger']->addDeprecated(
"'/class/xoopstory.php' is deprecated since XOOPS 2.5.4, please create your own class instead.");
25 include_once XOOPS_ROOT_PATH.
"/class/xoopstopic.php";
26 include_once XOOPS_ROOT_PATH.
"/kernel/user.php";
58 $this->topicstable =
"";
68 $this->
storyid = intval($value);
73 $this->
topicid = intval($value);
78 $this->
uid = intval($value);
83 $this->
title = $value;
103 $this->
expired = intval($value);
123 $this->
ihome = $value;
133 $this->
type = $value;
138 $this->approved = intval($value);
181 $newstoryid = $this->db->genId($this->table.
"_storyid_seq");
185 $sql = sprintf(
"INSERT INTO %s (storyid, uid, title, created, published, expired, hostname, nohtml, nosmiley, hometext, bodytext, counter, topicid, ihome, notifypub, story_type, topicdisplay, topicalign, comments) VALUES (%u, %u, '%s', %u, %u, %u, '%s', %u, %u, '%s', '%s', %u, %u, %u, %u, '%s', %u, '%s', %u)", $this->table, $newstoryid, $this->
uid,
$title,
$created,
$published,
$expired, $this->
hostname, $this->
nohtml, $this->
nosmiley,
$hometext,
$bodytext, 0, $this->
topicid, $this->
ihome, $this->
notifypub, $this->
type, $this->
topicdisplay, $this->
topicalign, $this->
comments);
187 if ($this->approved) {
188 $sql = sprintf(
"UPDATE %s SET title = '%s', published = %u, expired = %u, nohtml = %u, nosmiley = %u, hometext = '%s', bodytext = '%s', topicid = %u, ihome = %u, topicdisplay = %u, topicalign = '%s', comments = %u WHERE storyid = %u", $this->table,
$title, $this->
published,
$expired, $this->
nohtml, $this->
nosmiley,
$hometext,
$bodytext, $this->
topicid, $this->
ihome, $this->
topicdisplay, $this->
topicalign, $this->
comments, $this->
storyid);
190 $sql = sprintf(
"UPDATE %s SET title = '%s', expired = %u, nohtml = %u, nosmiley = %u, hometext = '%s', bodytext = '%s', topicid = %u, ihome = %u, topicdisplay = %u, topicalign = '%s', comments = %u WHERE storyid = %u", $this->table,
$title,
$expired, $this->
nohtml, $this->
nosmiley,
$hometext,
$bodytext, $this->
topicid, $this->
ihome, $this->
topicdisplay, $this->
topicalign, $this->
comments, $this->
storyid);
197 if (empty($newstoryid)) {
198 $newstoryid = $this->db->getInsertId();
207 $sql =
"SELECT * FROM ".$this->table.
" WHERE storyid=" .
$storyid .
"";
208 $array = $this->db->fetchArray($this->db->query(
$sql));
214 foreach ($array as $key => $value){
215 $this->$key = $value;
221 $sql = sprintf(
"DELETE FROM %s WHERE storyid = %u", $this->table, $this->
storyid);
230 $sql = sprintf(
"UPDATE %s SET counter = counter+1 WHERE storyid = %u", $this->table, $this->
storyid);
239 $sql = sprintf(
"UPDATE %s SET comments = %u WHERE storyid = %u", $this->table, $total, $this->
storyid);
309 $hometext = htmlspecialchars(
$myts->stripSlashesGPC($this->hometext), ENT_QUOTES);
338 $bodytext = htmlspecialchars(
$myts->stripSlashesGPC($this->bodytext), ENT_QUOTES);