XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
emotions.php
Go to the documentation of this file.
1 <?php
2 // $Id: emotions.php 902 2012-01-03 07:09:16Z i.bitcero $
3 // --------------------------------------------------------------
4 // Red México Common Utilities
5 // A framework for Red México Modules
6 // Author: Eduardo Cortés <i.bitcero@gmail.com>
7 // Email: i.bitcero@gmail.com
8 // License: GPL 2.0
9 // --------------------------------------------------------------
10 
14 include XOOPS_ROOT_PATH."/include/common.php";
15 include_once RMCPATH.'/loader.php';
16 XoopsLogger::getInstance()->activated = false;
17 XoopsLogger::getInstance()->renderingEnabled = false;
18 
19 load_mod_locale('rmcommon','emots-');
20 
21 $db = XoopsDatabaseFactory::getDatabaseConnection();
22 $result = $db->query("SELECT * FROM ".$db->prefix("smiles")." ORDER BY id");
23 while ($row = $db->fetchArray($result)){
24  $emotions[] = array(
25  'id'=>$row['id'],
26  'file'=>XOOPS_UPLOAD_URL.'/'.$row['smile_url'],
27  'desc'=>$row['emotion'],
28  'code'=>$row['code']
29  );
30 }
31 
32 // Load new icons from plugins
33 RMEvents::get()->run_event('rmcommon.load_emotions',$emotions,'exmcode');
34 
35 ?>
36 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
37 <html>
38 <head>
39 <meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT">
40 <meta http-equiv="Pragma" content="no-cache">
41 <meta http-equiv="Cache-Control" content="no-cache">
42 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
43 <script type="text/javascript" src="editor-popups.js"></script>
44 <script type="text/javascript" src="<?php echo RMCURL; ?>/include/js/jquery.min.js"></script>
45 <link rel="stylesheet" type="text/css" href="<?php echo $eurl; ?>/plugins/emotions/css/emotions.css" />
46 <script type="text/javascript">
47  $(document).ready(function(){
48  $("img").click(function(){
49  exmPopup.insertText($(this).attr("alt"));
50  exmPopup.closePopup();
51  });
52  });
53 </script>
54 </head>
55 <body>
56 <table width="100%" cellpadding="2" cellspacing="0">
57 <tr align="center">
58 <?php $i = 0; ?>
59 <?php foreach($emotions as $icon): ?>
60 <?php if($i>=6): ?>
61  </tr><tr>
62 <?php
63  $i=0;
64  endif; ?>
65 <td><img src="<?php echo $icon['file']; ?>" title="<?php echo $icon['desc']; ?>" alt="<?php echo $icon['code']; ?>" /><br /><?php echo $icon['code']; ?></td>
66 <?php
67  $i++;
69 </tr>
70 </table>
71 </body>
72 </html>