24 if (!defined(
"XOOPS_ROOT_PATH")) { die(
"XOOPS root path not defined"); }
36 include_once XOOPS_ROOT_PATH.
"/modules/system/constants.php";
44 if (!empty(
$_GET[
'op'])) {
46 } elseif (!empty(
$_POST[
'op'])) {
53 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
57 include_once XOOPS_ROOT_PATH.
'/class/uploader.php';
59 $uploader->setPrefix(
'smil');
60 if ($uploader->fetchMedia(
$_POST[
'xoops_upload_file'][0])) {
61 if (!$uploader->upload()) {
62 $err = $uploader->getErrors();
64 $smile_url = $uploader->getSavedFileName();
65 $smile_code =
$myts->stripSlashesGPC(
$_POST[
'smile_code']);
66 $smile_desc =
$myts->stripSlashesGPC(
$_POST[
'smile_desc']);
67 $smile_display = intval(
$_POST[
'smile_display']) > 0 ? 1 : 0;
68 $newid =
$db->genId(
$db->prefix(
'smilies').
"_id_seq");
69 $sql = sprintf(
"INSERT INTO %s (id, code, smile_url, emotion, display) VALUES (%d, %s, %s, %s, %d)",
$db->prefix(
'smiles'), $newid,
$db->quoteString($smile_code),
$db->quoteString($smile_url),
$db->quoteString($smile_desc), $smile_display);
71 $err =
'Failed storing smiley data into the database';
75 $err = $uploader->getErrors();
93 echo
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
94 echo
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .
_LANGCODE .
'" lang="' .
_LANGCODE .
'">';
96 echo
'<meta http-equiv="content-type" content="text/html; charset=' .
_CHARSET .
'" />';
97 echo
'<meta http-equiv="content-language" content="' .
_LANGCODE .
'" />';
100 <title>{#xoopsemotions_dlg.title}</title>
101 <script type=
"text/javascript" src=
"../../tiny_mce_popup.js"></script>
102 <script type=
"text/javascript" src=
"../../utils/mctabs.js"></script>
103 <script type=
"text/javascript" src=
"../../utils/form_utils.js"></script>
104 <script type=
"text/javascript" src=
"../../utils/validate.js"></script>
105 <script type=
"text/javascript" src=
"js/xoopsemotions.js"></script>
106 <link href=
"<?php echo xoops_getcss($xoopsConfig['theme_set']); ?>" rel=
"stylesheet" type=
"text/css" />
107 <link href=
"css/xoopsemotions.css" rel=
"stylesheet" type=
"text/css" />
108 <base target=
"_self" />
114 echo
"<div class='xoopsEmotions'>";
115 echo
"<div>{#xoopsemotions_dlg.error_noemotions}</div>";
117 echo
"<div class='mceActionPanel floatright'>";
118 echo
"<input type='button' id='cancel' name='cancel' value='{#cancel}' onclick='tinyMCEPopup.close();' />";
127 <li
id=
"tab_emotionsbrowser" class=
"current"><span><a href=
"javascript:mcTabs.displayTab('tab_emotionsbrowser','emotionsbrowser_panel');" onmousedown=
"return false;">{#xoopsemotions_dlg.tab_emotionsbrowser}</a></span></li>
130 echo
'<li id="tab_emotionsadmin"><span><a href="javascript:mcTabs.displayTab(\'tab_emotionsadmin\',\'emotionsadmin_panel\');" onmousedown="return false;">{#xoopsemotions_dlg.tab_emotionsadmin}</a></span></li>';
136 <div
class=
"panel_wrapper">
137 <div
id=
"emotionsbrowser_panel" class=
"panel current" style=
"overflow:auto;">
139 if ( $smiles =
$_SESSION[
'XoopsEmotions'] ) {
141 echo
"<div class='xoopsEmotions'>";
142 $count = count($smiles);
144 for (
$i = 0;
$i < $count;
$i++) {
146 if ( $smiles[
$i][
'display'] ) {
147 echo
'<img class="xoopsEmotions" onclick="XoopsemotionsDialog.insert(this);" src="' .
XOOPS_UPLOAD_URL .
'/' . $smiles[
$i][
'smile_url'] .
'" alt="' .
$myts->htmlspecialchars($smiles[$i][
'emotion']) .
'" title="' .
$myts->htmlspecialchars($smiles[$i][
'emotion']) .
'" />';
150 echo
'<img class="xoopsEmotions" onclick="XoopsemotionsDialog.insert(this);" src="' .
XOOPS_UPLOAD_URL .
'/' . $smiles[
$i][
'smile_url'] .
'" alt="' .
$myts->htmlspecialchars($smiles[$i][
'emotion']) .
'" title="' .
$myts->htmlspecialchars($smiles[$i][
'emotion']) .
'" />';
154 echo
'<div class="xoopsEmotions">';
160 echo
"<div>{#xoopsemotions_dlg.error_noemotions}</div>";
163 <div
class=
"mceActionPanel floatright">
164 <input type=
"button" id=
"cancel" name=
"cancel" value=
"{#cancel}" onclick=
"tinyMCEPopup.close();" />
168 <div
id=
"emotionsadmin_panel" class=
"panel" style=
"overflow:auto;">
171 include_once XOOPS_ROOT_PATH.
'/class/xoopsformloader.php';
174 $smile_form->setExtra(
'enctype="multipart/form-data"');
180 $smile_tray->addElement($smile_select);
181 $smile_tray->addElement($smile_label);
182 $smile_form->addElement($smile_tray);
189 $smile_form->display();
192 <div
class=
"mceActionPanel floatright">
193 <input type=
"button" id=
"cancel" name=
"cancel" value=
"{#cancel}" onclick=
"tinyMCEPopup.close();" />