|
@@ 105-107 (lines=3) @@
|
| 102 |
|
public function saveAttachment() |
| 103 |
|
{ |
| 104 |
|
$attachment_save = ''; |
| 105 |
|
if (is_array($this->attachment_array) && count($this->attachment_array) > 0) { |
| 106 |
|
$attachment_save = base64_encode(serialize($this->attachment_array)); |
| 107 |
|
} |
| 108 |
|
$this->setVar('attachment', $attachment_save); |
| 109 |
|
$sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
| 110 |
|
if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
|
@@ 148-150 (lines=3) @@
|
| 145 |
|
$this->attachment_array[$key] = $attach; |
| 146 |
|
} |
| 147 |
|
$attachment_save = ''; |
| 148 |
|
if (is_array($this->attachment_array) && count($this->attachment_array) > 0) { |
| 149 |
|
$attachment_save = base64_encode(serialize($this->attachment_array)); |
| 150 |
|
} |
| 151 |
|
$this->setVar('attachment', $attachment_save); |
| 152 |
|
|
| 153 |
|
return true; |