Ejemplo n.º 1
0
 public function __construct($panther_config, $panther_user, $lang_common, $lang_post, $db, $lang_profile)
 {
     // Load the smilies
     if (file_exists(FORUM_CACHE_DIR . 'cache_smilies.php')) {
         include FORUM_CACHE_DIR . 'cache_smilies.php';
     } else {
         if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
             require PANTHER_ROOT . 'include/cache.php';
         }
         generate_smilies_cache();
         require FORUM_CACHE_DIR . 'cache_smilies.php';
     }
     $this->smilies = $smilies;
     $this->user = $panther_user;
     $this->config = $panther_config;
     $this->lang_common = $lang_common;
     $this->lang_post = $lang_post;
     $this->lang_profile = $lang_profile;
     $this->db = $db;
 }
Ejemplo n.º 2
0
     confirm_referrer(PANTHER_ADMIN_DIR . '/smilies.php');
     $code = isset($_POST['smiley_code']) ? panther_trim($_POST['smiley_code']) : '';
     $image = isset($_POST['smiley_image']) ? panther_trim($_POST['smiley_image']) : '';
     if ($code == '') {
         message($lang_admin_smilies['Create Smiley Code None']);
     }
     if ($image == '') {
         message($lang_admin_smilies['Create Smiley Image None']);
     }
     $insert = array('image' => $image, 'code' => $code);
     // Add the smiley
     $db->insert('smilies', $insert);
     if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
         require PANTHER_ROOT . 'include/cache.php';
     }
     generate_smilies_cache();
     redirect(panther_link($panther_url['admin_smilies']), $lang_admin_smilies['Successful Creation']);
 } else {
     if (isset($_POST['add_image'])) {
         confirm_referrer(PANTHER_ADMIN_DIR . '/smilies.php');
         if (!isset($_FILES['req_file'])) {
             message($lang_admin_smilies['No file']);
         }
         $uploaded_file = $_FILES['req_file'];
         // Make sure the upload went smooth
         if (isset($uploaded_file['error'])) {
             switch ($uploaded_file['error']) {
                 case 1:
                     // UPLOAD_ERR_INI_SIZE
                 // UPLOAD_ERR_INI_SIZE
                 case 2: