Beispiel #1
0
 //Dateitypen
 $filetypes = array();
 $typeinfo = array();
 $data = $db->fetch("SELECT * FROM " . PRE . "_forum_filetypes ORDER BY ext ASC");
 if (count($data)) {
     foreach ($data as $res) {
         $filetypes[] = $res['ext'];
         $typeinfo[$res['ext']] = array($res['size'] * 1024, $res['icon']);
     }
 }
 //Anhänge auslesen
 $attachments = '';
 $data = $db->fetch("SELECT * FROM " . PRE . "_forum_attachments WHERE ( postid='" . $postinfo['postid'] . "' AND hash='" . addslashes($postinfo['hash']) . "' ) ORDER BY name ASC");
 if (count($data)) {
     require BASEDIR . 'lib/class.mediamanager.php';
     $mm = new mediamanager();
     foreach ($data as $res) {
         $ext = strtolower($mm->getext($res['name']));
         $attachments .= '<img src="' . $typeinfo[$ext][1] . '" alt="" style="vertical-align:middle;" /> ' . $res['name'] . ' (' . round($res['size'] / 1024) . ' KB)';
     }
 }
 //Präfixe
 $prefixdata = array();
 $prefixInfo = forum_prefixes($foruminfo['forumid']);
 foreach ($prefixInfo as $prefix) {
     $prefixdata[] = array('ID' => $prefix['prefixid'], 'TITLE' => compatible_hsc($prefix['title']), 'SELECTED' => $_POST['prefix'] == $prefix['prefixid']);
 }
 $apx->tmpl->assign('USERID', $postinfo['userid']);
 if ($postinfo['userid']) {
     $apx->tmpl->assign('USERNAME', replace($postinfo['username']));
 } else {
Beispiel #2
0
 function del()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             $res = $db->first("SELECT picture FROM " . PRE . "_calendar_events WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             $db->query("DELETE FROM " . PRE . "_calendar_events WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             //Kommentare löschen
             if ($apx->is_module('comments')) {
                 $db->query("DELETE FROM " . PRE . "_comments WHERE ( module='anzeigenmarkt' AND mid='" . $_REQUEST['id'] . "' )");
             }
             //Bilder löschen
             require_once BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             $picture = $res['picture'];
             $poppic = str_replace('-thumb.', '.', $picture);
             if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) {
                 $mm->deletefile($picture);
             }
             if ($poppic && file_exists(BASEDIR . getpath('uploads') . $poppic)) {
                 $mm->deletefile($poppic);
             }
             //Tags löschen
             $db->query("DELETE FROM " . PRE . "_calendar_tags WHERE id='" . $_REQUEST['id'] . "'");
             logit('CALENDAR_DEL', 'ID #' . $_REQUEST['id']);
             printJSRedirect(get_index('calendar.show'));
         }
     } else {
         list($title) = $db->first("SELECT title FROM " . PRE . "_calendar_events WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title))));
         tmessageOverlay('deltitle', array('ID' => $_REQUEST['id']), '/');
     }
 }
Beispiel #3
0
    $mm = new mediamanager();
    $mm->createdir('temp');
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
            $mysql = "\n\t\t\t\tCREATE TABLE `apx_capcha` (\n\t\t\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t\t\t  `code` int(5) unsigned NOT NULL default '0',\n\t\t\t\t  `hash` tinytext NOT NULL,\n\t\t\t\t  `time` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  PRIMARY KEY  (`id`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('main', 'textboxwidth', 'int', '', '', '0', '650');\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
        case 101:
            //zu 1.0.2
            //Temp-DIR
            require_once BASEDIR . 'lib/class.mediamanager.php';
            $mm = new mediamanager();
            $mm->createdir('temp');
        case 102:
            //Zu 1.0.3
            $mysql = "\n\t\t\t\tALTER TABLE `apx_capcha` RENAME `apx_captcha` ;\n\t\t\t\tDELETE FROM `apx_config` WHERE varname='capcha';\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
        case 103:
            //Zu 1.0.4
            $mysql = "\n\t\t\t\tCREATE TABLE `apx_cron` (\n\t\t\t\t  `funcname` varchar(50) NOT NULL default '',\n\t\t\t\t  `module` varchar(50) NOT NULL default '',\n\t\t\t\t  `period` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  `lastexec` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  `hash` tinytext NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`funcname`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tALTER TABLE `apx_sections` ADD `lang` VARCHAR( 20 ) NOT NULL AFTER `theme`;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('main', 'tellcaptcha', 'switch', '', '1', '0', '1700');\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
Beispiel #4
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_links` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `catid` int(11) unsigned NOT NULL default '0',\n\t\t  `userid` int(11) unsigned NOT NULL default '0',\n\t\t  `send_username` tinytext NOT NULL,\n\t\t  `send_email` tinytext NOT NULL,\n\t\t  `send_ip` tinytext NOT NULL,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `url` text NOT NULL,\n\t\t  `linkpic` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `galid` int(11) unsigned NOT NULL default '0',\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `starttime` int(11) unsigned NOT NULL default '0',\n\t\t  `endtime` int(11) unsigned NOT NULL default '0',\n\t\t  `broken` int(11) unsigned NOT NULL default '0',\n\t\t  `top` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `allowrating` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `catid` (`catid`),\n\t\t  KEY `userid` (`userid`),\n\t\t  KEY `starttime` (`starttime`,`endtime`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_links_cat` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `icon` tinytext NOT NULL,\n\t\t  `open` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `parents` varchar(255) NOT NULL,\n\t\t  `children` text NOT NULL,\n\t\t  `ord` tinyint(3) NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `parents` (`parents`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_links_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('links', 'epp', 'int', '', '20', 'VIEW', 1249981968, 1000),\n\t\t('links', 'searchepp', 'string', '', '20', 'VIEW', 1249981881, 2000),\n\t\t('links', 'catonly', 'switch', '', '1', 'VIEW', 1249981968, 3000),\n\t\t('links', 'sortby', 'select', 'a:2:{i:1;s:7:\"{TITLE}\";i:2;s:6:\"{DATE}\";}', '1', 'VIEW', 1249981968, 4000),\n\t\t('links', 'new', 'int', '', '3', 'VIEW', 1249981968, 5000),\n\t\t\n\t\t('links', 'searchable', 'switch', '', '1', 'OPTIONS', 1249981968, 1000),\n\t\t('links', 'coms', 'switch', '', '1', 'OPTIONS', 1249981968, 2000),\n\t\t('links', 'ratings', 'switch', '', '1', 'OPTIONS', 1249981968, 3000),\n\t\t('links', 'captcha', 'switch', '', '1', 'OPTIONS', 1249981968, 4000),\n\t\t('links', 'spamprot', 'int', '', '1', 'OPTIONS', 1249981968, 5000),\n\t\t('links', 'mailonnew', 'string', '', '', 'OPTIONS', 1249981968, 6000),\n\t\t('links', 'mailonbroken', 'string', '', '', 'OPTIONS', 1249981968, 7000),\n\t\t\n\t\t('links', 'linkpic_width', 'int', '', '120', 'IMAGES', 1249981968, 1000),\n\t\t('links', 'linkpic_height', 'int', '', '120', 'IMAGES', 1249981968, 2000),\n\t\t('links', 'linkpic_popup', 'switch', '', '1', 'IMAGES', 1249981968, 3000),\n\t\t('links', 'linkpic_popup_width', 'int', '', '640', 'IMAGES', 1249981968, 4000),\n\t\t('links', 'linkpic_popup_height', 'int', '', '480', 'IMAGES', 1249981968, 5000),\n\t\t('links', 'linkpic_quality', 'switch', '', '1', 'IMAGES', 1249981968, 6000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Links-DIR
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('links');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_links`;\n\t\tDROP TABLE `apx_links_cat`;\n\t\tDROP TABLE `apx_links_tags`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //Zu 1.0.1
            $mysql = "\n\t\t\t\tINSERT INTO `apx_config` VALUES ('links', 'mailonnew', 'string', '', '', 0, 1800);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('links', 'captcha', 'switch', '', '0', 0, 1350);\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
Beispiel #5
0
 case 101:
     //zu 1.0.2
     $mysql = "\n\t\t\t\tINSERT INTO `apx_config` ( `module` , `varname` , `type` , `addnl` , `value` , `lastchange` , `ord` ) VALUES ('articles', 'searchable', 'switch', '', '1', '0', '50');\n\t\t\t\tALTER TABLE `apx_articles` ADD `searchable` TINYINT( 1 ) UNSIGNED NOT NULL AFTER `sticky` ;\n\t\t\t\tALTER TABLE `apx_articles` ADD `keywords` TINYTEXT NOT NULL AFTER `teaser` ;\n\t\t\t\tUPDATE `apx_articles` SET searchable='1';\n\t\t\t";
     $queries = split_sql($mysql);
     foreach ($queries as $query) {
         $db->query($query);
     }
 case 102:
     //zu 1.1.0
     $mysql = "\n\t\t\t\tCREATE TABLE `apx_articles_previews` (\n\t\t\t\t  `artid` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  `custom1` tinytext NOT NULL,\n\t\t\t\t  `custom2` tinytext NOT NULL,\n\t\t\t\t  `custom3` tinytext NOT NULL,\n\t\t\t\t  `custom4` tinytext NOT NULL,\n\t\t\t\t  `custom5` tinytext NOT NULL,\n\t\t\t\t  `custom6` tinytext NOT NULL,\n\t\t\t\t  `custom7` tinytext NOT NULL,\n\t\t\t\t  `custom8` tinytext NOT NULL,\n\t\t\t\t  `custom9` tinytext NOT NULL,\n\t\t\t\t  `custom10` tinytext NOT NULL,\n\t\t\t\t  `impression` tinytext NOT NULL,\n\t\t\t\t  `conclusion` text NOT NULL\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_articles_reviews` (\n\t\t\t\t  `artid` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  `custom1` tinytext NOT NULL,\n\t\t\t\t  `custom2` tinytext NOT NULL,\n\t\t\t\t  `custom3` tinytext NOT NULL,\n\t\t\t\t  `custom4` tinytext NOT NULL,\n\t\t\t\t  `custom5` tinytext NOT NULL,\n\t\t\t\t  `custom6` tinytext NOT NULL,\n\t\t\t\t  `custom7` tinytext NOT NULL,\n\t\t\t\t  `custom8` tinytext NOT NULL,\n\t\t\t\t  `custom9` tinytext NOT NULL,\n\t\t\t\t  `custom10` tinytext NOT NULL,\n\t\t\t\t  `rate1` tinytext NOT NULL,\n\t\t\t\t  `rate2` tinytext NOT NULL,\n\t\t\t\t  `rate3` tinytext NOT NULL,\n\t\t\t\t  `rate4` tinytext NOT NULL,\n\t\t\t\t  `rate5` tinytext NOT NULL,\n\t\t\t\t  `rate6` tinytext NOT NULL,\n\t\t\t\t  `rate7` tinytext NOT NULL,\n\t\t\t\t  `rate8` tinytext NOT NULL,\n\t\t\t\t  `rate9` tinytext NOT NULL,\n\t\t\t\t  `rate10` tinytext NOT NULL,\n\t\t\t\t  `final_rate` tinytext NOT NULL,\n\t\t\t\t  `positive` text NOT NULL,\n\t\t\t\t  `negative` text NOT NULL,\n\t\t\t\t  `conclusion` text NOT NULL,\n\t\t\t\t  `award` tinytext NOT NULL\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tALTER TABLE `apx_articles` ADD `links` TEXT NOT NULL AFTER `galid` ;\n\t\t\t\tALTER TABLE `apx_articles` ADD `type` ENUM( 'normal', 'preview', 'review' ) NOT NULL AFTER `id` ;\n\t\t\t\tALTER TABLE `apx_articles` ADD `pictures` TEXT NOT NULL AFTER `links` ;\n\t\t\t\tALTER TABLE `apx_articles` ADD `pictures_nextid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `pictures` ;\n\t\t\t\t\n\t\t\t\tUPDATE `apx_config` SET ord = ord +700 WHERE module = 'articles' AND ord >800;\n\t\t\t\tUPDATE `apx_config` SET ord = ord +400 WHERE module = 'articles' AND ord >1600;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'picwidth', 'int', '', '640', 1141134229, 900);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'picheight', 'int', '', '480', 1141134229, 1000);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'watermark', 'string', '', '', 1141134229, 1100);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'watermark_transp', 'int', '', '50', 1141134229, 1200);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'watermark_position', 'select', 'a:9:{i:1;s:18:\"{POSTOP} {POSLEFT}\";i:2;s:20:\"{POSTOP} {POSCENTER}\";i:3;s:19:\"{POSTOP} {POSRIGHT}\";i:4;s:21:\"{POSMIDDLE} {POSLEFT}\";i:5;s:23:\"{POSMIDDLE} {POSCENTER}\";i:6;s:22:\"{POSMIDDLE} {POSRIGHT}\";i:7;s:21:\"{POSBOTTOM} {POSLEFT}\";i:8;s:23:\"{POSBOTTOM} {POSCENTER}\";i:9;s:22:\"{POSBOTTOM} {POSRIGHT}\";}', '9', 1141134229, 1300);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'thumbwidth', 'int', '', '120', 1141134229, 1400);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'thumbheight', 'int', '', '90', 1141134229, 1500);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'popup_addwidth', 'int', '', '60', 1143727472, 1520);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'popup_addheight', 'int', '', '150', 1143727472, 1540);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'popup_resizeable', 'switch', '', '1', 1143727472, 1560);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'custom_preview', 'array', '', 'a:0:{}', '0', '1700');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'custom_review', 'array', '', 'a:0:{}', '0', '1800');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'ratefields', 'array', '', 'a:0:{}', '0', '1900');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'awards', 'array', '', 'a:0:{}', '0', '2000');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'reviews_conclusionpage', 'switch', '', '1', '0', '2025');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'previews_conclusionpage', 'switch', '', '1', '0', '2025');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'normalonly', 'switch', '', '1', '0', '2050');\n\t\t\t";
     $queries = split_sql($mysql);
     foreach ($queries as $query) {
         $db->query($query);
     }
     require_once BASEDIR . 'lib/class.mediamanager.php';
     $mm = new mediamanager();
     $mm->createdir('gallery', 'articles');
 case 110:
     //zu 1.1.1
     $mysql = "\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'searchepp', 'int', '', '10', '0', '2800');\n\t\t\t";
     $queries = split_sql($mysql);
     foreach ($queries as $query) {
         $db->query($query);
     }
 case 111:
     //zu 1.1.2
     $mysql = "\n\t\t\t\tINSERT INTO `apx_config` VALUES ('articles', 'archiveentrysort', 'select', 'a:2:{i:1;s:10:\"{NEWFIRST}\";i:2;s:10:\"{OLDFIRST}\";}', '1', 1144936997, 2750);\n\t\t\t";
     $queries = split_sql($mysql);
     foreach ($queries as $query) {
         $db->query($query);
     }
Beispiel #6
0
     foreach ($queries as $query) {
         $db->query($query);
     }
     //Locations einfügen
     /*require_once(BASEDIR.'lib/class.linereader.php');
     		$locReader = new LineReader(BASEDIR.getmodulepath('user').'locations.sql', ";\n");
     		$command = '';
     		while ( ($line = $locReader->getNext())!==false ) {
     			if ( $line ) {
     				$line=str_replace('`apx_','`'.PRE.'_',$line);
     				$db->query($line);
     			}
     		}*/
     //User-Gallery-DIR
     require_once BASEDIR . 'lib/class.mediamanager.php';
     $mm = new mediamanager();
     $mm->createdir('gallery', 'user');
 case 110:
     //zu 1.1.1
     $mysql = "\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'visitorself', 'switch', '', '', '0', '1450');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'gallery_maxpics', 'int', '', '', '0', '4550');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'friendsepp', 'int', '', '20', '0', '4800');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'reportmail', 'string', '', '', '0', '5500');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'onlinerecord', 'int', 'BLOCK', '', '0', '0');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('user', 'onlinerecord_time', 'int', 'BLOCK', '', '0', '0');\n\t\t\t\tALTER TABLE `apx_user` ADD `locid` INT( 11 ) UNSIGNED NOT NULL AFTER `country` ;\n\t\t\t\tALTER TABLE `apx_user` ADD `pub_usegb` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `pub_showbuddies` ;\n\t\t\t\tALTER TABLE `apx_user_online` CHANGE `ip` `ip` VARCHAR( 15 ) NOT NULL  ;\n\t\t\t\tALTER TABLE `apx_user_online` ADD INDEX ( `time` ) ;\n\t\t\t\tDROP TABLE IF EXISTS `apx_user_locations`;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_user_friends` (\n\t\t\t\t  `userid` int(11) unsigned NOT NULL,\n\t\t\t\t  `friendid` int(11) unsigned NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`userid`,`friendid`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_user_ignore` (\n\t\t\t\t  `userid` int(11) unsigned NOT NULL,\n\t\t\t\t  `ignored` int(11) unsigned NOT NULL,\n\t\t\t\t  `reason` tinytext NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`userid`,`ignored`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_user_visits` (\n\t\t\t\t  `object` varchar(20) NOT NULL,\n\t\t\t\t  `id` int(11) unsigned NOT NULL,\n\t\t\t\t  `userid` int(11) unsigned NOT NULL,\n\t\t\t\t  `time` int(11) unsigned NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`object`,`id`,`userid`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_user_locations` (\n\t\t\t\t  `id` int(11) NOT NULL,\n\t\t\t\t  `name` varchar(250) default NULL,\n\t\t\t\t  `b` float default NULL,\n\t\t\t\t  `l` float default NULL,\n\t\t\t\t  PRIMARY KEY  (`id`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_user_locations_plz` (\n\t\t\t\t  `locid` int(11) unsigned NOT NULL,\n\t\t\t\t  `plz` varchar(5) NOT NULL,\n\t\t\t\t  `stamp` varchar(8) NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`locid`,`plz`),\n\t\t\t\t  KEY `stamp` (`stamp`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t";
     $queries = split_sql($mysql);
     foreach ($queries as $query) {
         $db->query($query);
     }
     //Locations einfügen
     /*require_once(BASEDIR.'lib/class.linereader.php');
     		$locReader = new LineReader(BASEDIR.getmodulepath('user').'locations.sql', ";\n");
     		$command = '';
     		while ( ($line = $locReader->getNext())!==false ) {
     			if ( $line ) {
     				$line=str_replace('`apx_','`'.PRE.'_',$line);
Beispiel #7
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_affiliates` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `image` tinytext NOT NULL,\n\t\t  `link` tinytext NOT NULL,\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  `ord` smallint(4) unsigned NOT NULL default '0',\n\t\t  `active` tinyint(1) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `active` (`active`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('affiliates', 'orderby', 'select', 'a:4:{i:1;s:12:\"{ORDERADMIN}\";i:2;s:16:\"{ORDERHITS_DESC}\";i:3;s:15:\"{ORDERHITS_ASC}\";i:4;s:13:\"{ORDERRANDOM}\";}', '4', '', 1129897415, 1000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Ordner für Bilder
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('affiliates');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_affiliates`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //Zu 1.1.0
            //Indizes entfernen
            clearIndices(PRE . '_affiliates');
            //config Update
            updateConfig('affiliates', "\n\t\t\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t\t\t('affiliates', 'orderby', 'select', 'a:4:{i:1;s:12:\"{ORDERADMIN}\";i:2;s:16:\"{ORDERHITS_DESC}\";i:3;s:15:\"{ORDERHITS_ASC}\";i:4;s:13:\"{ORDERRANDOM}\";}', '4', '', 1129897415, 1000);\n\t\t\t");
Beispiel #8
0
    $foruminfo = forum_info($threadinfo['forumid']);
    if (!$foruminfo['forumid']) {
        message($apx->lang->get('MSG_FORUMNOTEXIST'));
    }
    if ($threadinfo['del'] && !($user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator'])))) {
        message($apx->lang->get('MSG_THREADNOTEXIST'));
    }
    if ($postinfo['del'] && !($user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator'])))) {
        message($apx->lang->get('MSG_POSTNOTEXIST'));
    }
    if (!forum_access_addattachment($foruminfo)) {
        tmessage('noright', array(), false, false);
    }
}
require BASEDIR . 'lib/class.mediamanager.php';
$mm = new mediamanager();
//Dateitypen
$typeinfo = array();
$data = $db->fetch("SELECT * FROM " . PRE . "_forum_filetypes ORDER BY ext ASC");
if (count($data)) {
    foreach ($data as $res) {
        $i++;
        $filedata[$i]['EXT'] = $res['ext'];
        $filedata[$i]['ICON'] = $res['icon'];
        $filedata[$i]['MAXSIZE'] = $res['size'];
        $typeinfo[$res['ext']] = array($res['size'] * 1024, $res['icon']);
    }
}
//Dateien hochladen
if ($_POST['send']) {
    for ($i = 1; $i <= 3; $i++) {
Beispiel #9
0
            foreach ($queries as $query) {
                $db->query($query);
            }
            //Tags erzeugen
            transformKeywords(PRE . '_downloads', PRE . '_downloads_tags');
        case 110:
            //zu 1.1.1
            $mysql = "\n\t\t\t\tALTER TABLE `apx_downloads` ADD `meta_description` TEXT NOT NULL AFTER `text` ;\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
        case 111:
            //zu 1.1.2
            $mysql = "\n\t\t\t\tINSERT INTO `apx_config` VALUES ('downloads', 'mirrorstats', 'switch', '', '1', 'OPTIONS', 1301669229, 4500);\n\t\t\t\tALTER TABLE `apx_downloads` ADD `format` TINYTEXT NOT NULL AFTER `filesize` ;\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
        case 111:
            //zu 1.1.2
            $mysql = "\n\t\t\t\tALTER TABLE `apx_downloads` ADD `teaserpic` TINYTEXT NOT NULL AFTER `text` ;\n\t\t\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t\t\t('downloads', 'teaserpic_width', 'int', '', '120', 'TEASERPIC', 1261490672, 1000),\n\t\t\t\t('downloads', 'teaserpic_height', 'int', '', '120', 'TEASERPIC', 1261490672, 2000),\n\t\t\t\t('downloads', 'teaserpic_popup', 'switch', '', '1', 'TEASERPIC', 1261490672, 3000),\n\t\t\t\t('downloads', 'teaserpic_popup_width', 'int', '', '640', 'TEASERPIC', 1261490672, 4000),\n\t\t\t\t('downloads', 'teaserpic_popup_height', 'int', '', '480', 'TEASERPIC', 1261490672, 5000),\n\t\t\t\t('downloads', 'teaserpic_quality', 'switch', '', '1', 'TEASERPIC', 1261490672, 6000);\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
            }
            require_once BASEDIR . 'lib/class.mediamanager.php';
            $mm = new mediamanager();
            @$mm->createdir('pics', 'downloads');
    }
}
Beispiel #10
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_products` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `prodid` int(11) unsigned NOT NULL,\n\t\t  `type` enum('normal','game','music','movie','book','software','hardware') NOT NULL default 'normal',\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `picture` tinytext NOT NULL,\n\t\t  `teaserpic` TINYTEXT NOT NULL,\n\t\t  `website` tinytext NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `regisseur` tinytext NOT NULL,\n\t\t  `actors` tinytext NOT NULL,\n\t\t  `manufacturer` int(11) unsigned NOT NULL default '0',\n\t\t  `publisher` int(11) unsigned NOT NULL default '0',\n\t\t  `genre` int(11) NOT NULL default '0',\n\t\t  `systems` tinytext NOT NULL,\n\t\t  `sk` enum('','all','none','6','12','16','18') NOT NULL default '',\n\t\t  `requirements` text NOT NULL,\n\t\t  `equipment` text NOT NULL,\n\t\t  `os` tinytext NOT NULL,\n\t\t  `languages` tinytext NOT NULL,\n\t\t  `license` enum('freeware','shareware','commercial') NOT NULL,\n\t\t  `version` tinytext NOT NULL,\n\t\t  `isbn` tinytext NOT NULL,\n\t\t  `media` tinytext NOT NULL,\n\t\t  `length` varchar(50) NOT NULL default '',\n\t\t  `custom1` tinytext NOT NULL,\n\t\t  `custom2` tinytext NOT NULL,\n\t\t  `custom3` tinytext NOT NULL,\n\t\t  `custom4` tinytext NOT NULL,\n\t\t  `custom5` tinytext NOT NULL,\n\t\t  `custom6` tinytext NOT NULL,\n\t\t  `custom7` tinytext NOT NULL,\n\t\t  `custom8` tinytext NOT NULL,\n\t\t  `custom9` tinytext NOT NULL,\n\t\t  `custom10` tinytext NOT NULL,\n\t\t  `buylink` tinytext NOT NULL,\n\t\t  `price` varchar(20) NOT NULL default '0',\n\t\t  `recprice` tinytext NOT NULL,\n\t\t  `guarantee` tinytext NOT NULL,\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `hits` int(11) unsigned NOT NULL,\n\t\t  `active` tinyint(1) unsigned NOT NULL,\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `allowrating` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `top` TINYINT(1) UNSIGNED NOT NULL,\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `type` (`type`),\n\t\t  KEY `active` (`active`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_products_coll` (\n\t\t\t`userid` INT( 10 ) UNSIGNED NOT NULL ,\n\t\t\t`prodid` INT( 10 ) UNSIGNED NOT NULL ,\n\t\t\tPRIMARY KEY ( `userid` , `prodid` )\n\t\t) ENGINE = MYISAM ;\n\t\t\n\t\tCREATE TABLE `apx_products_groups` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `grouptype` enum('medium','system','genre') NOT NULL default 'medium',\n\t\t  `type` enum('normal','game','music','movie','book','software','hardware') NOT NULL default 'game',\n\t\t  `title` tinytext NOT NULL,\n\t\t  `icon` tinytext NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `grouptype` (`grouptype`),\n\t\t  KEY `type` (`type`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_products_releases` (\n\t\t  `ord` int(11) unsigned NOT NULL auto_increment,\n\t\t  `prodid` int(11) unsigned NOT NULL default '0',\n\t\t  `system` int(11) unsigned NOT NULL default '0',\n\t\t  `data` text NOT NULL,\n\t\t  `stamp` int(8) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`ord`),\n\t\t  KEY `prodid` (`prodid`),\n\t\t  KEY `stamp` (`stamp`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_products_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_products_units` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `type` enum('company','person') NOT NULL default 'company',\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `fullname` tinytext NOT NULL,\n\t\t  `picture` tinytext NOT NULL,\n\t\t  `address` tinytext NOT NULL,\n\t\t  `email` tinytext NOT NULL,\n\t\t  `phone` tinytext NOT NULL,\n\t\t  `website` tinytext NOT NULL,\n\t\t  `founder` tinytext NOT NULL,\n\t\t  `founding_year` tinytext NOT NULL,\n\t\t  `founding_country` tinytext NOT NULL,\n\t\t  `legalform` tinytext NOT NULL,\n\t\t  `headquaters` tinytext NOT NULL,\n\t\t  `executive` tinytext NOT NULL,\n\t\t  `employees` tinytext NOT NULL,\n\t\t  `turnover` tinytext NOT NULL,\n\t\t  `sector` tinytext NOT NULL,\n\t\t  `products` tinytext NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `type` (`type`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('products', 'epp', 'int', '', '20', 'VIEW', 1220200389, 1000),\n\t\t('products', 'manu_epp', 'int', '', '20', 'VIEW', 1220200389, 2000),\n\t\t('products', 'manu_searchepp', 'int', '', '20', 'VIEW', '0', '2500'),\n\t\t('products', 'manuprod_epp', 'int', '', '20', 'VIEW', 1220200389, 3000),\n\t\t('products', 'relepp', 'int', '', '20', 'VIEW', 1220200389, 4000),\n\t\t('products', 'searchepp', 'int', '', '20', 'VIEW', 1220200389, 4500),\n\t\t('products', 'sortby', 'select', 'a:2:{i:1;s:7:\"{TITLE}\";i:0;s:9:\"{RELEASE}\";}', '1', 'VIEW', 1220200389, 5000),\n\t\t\n\t\t('products', 'searchable', 'switch', '', '1', 'OPTIONS', 1220200389, 1000),\n\t\t('products', 'coms', 'switch', '', '1', 'OPTIONS', 1220200390, 2000),\n\t\t('products', 'ratings', 'switch', '', '1', 'OPTIONS', 1220200390, 3000),\n\t\t('products', 'filtermanu', 'switch', '', '1', 'OPTIONS', 1220200390, 4000),\n\t\t('products', 'collection', 'switch', '', '1', 'OPTIONS', '0', '5000'),\n\t\t\n\t\t('products', 'custom_normal', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 1000),\n\t\t('products', 'custom_game', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 2000),\n\t\t('products', 'custom_software', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 3000),\n\t\t('products', 'custom_hardware', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 4000),\n\t\t('products', 'custom_music', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 5000),\n\t\t('products', 'custom_movie', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 6000),\n\t\t('products', 'custom_book', 'array', '', 'a:0:{}', 'CUSTOM', 1220200390, 7000),\n\t\t\n\t\t('products', 'pic_width', 'int', '', '120', 'IMAGES', 1220200390, 1000),\n\t\t('products', 'pic_height', 'int', '', '120', 'IMAGES', 1220200390, 2000),\n\t\t('products', 'pic_popup', 'switch', '', '1', 'IMAGES', 1220200390, 3000),\n\t\t('products', 'pic_popup_width', 'int', '', '640', 'IMAGES', 1220200390, 4000),\n\t\t('products', 'pic_popup_height', 'int', '', '480', 'IMAGES', 1220200390, 5000),\n\t\t('products', 'pic_quality', 'switch', '', '1', 'IMAGES', 1220200390, 6000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Products-DIR
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('products');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_products`;\n\t\tDROP TABLE `apx_products_groups`;\n\t\tDROP TABLE `apx_products_releases`;\n\t\tDROP TABLE `apx_products_tags`;\n\t\tDROP TABLE `apx_products_units`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
            $mysql = "\n\t\t\t\tALTER TABLE `apx_products` ADD `custom1` TINYTEXT NOT NULL AFTER `length` ,ADD `custom2` TINYTEXT NOT NULL AFTER `custom1` ,ADD `custom3` TINYTEXT NOT NULL AFTER `custom2` ,ADD `custom4` TINYTEXT NOT NULL AFTER `custom3` ,ADD `custom5` TINYTEXT NOT NULL AFTER `custom4` ,ADD `custom6` TINYTEXT NOT NULL AFTER `custom5` ,ADD `custom7` TINYTEXT NOT NULL AFTER `custom6` ,ADD `custom8` TINYTEXT NOT NULL AFTER `custom7` ,ADD `custom9` TINYTEXT NOT NULL AFTER `custom8` ,ADD `custom10` TINYTEXT NOT NULL AFTER `custom9` ;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('products', 'custom_normal', 'array', '', 'a:0:{}', '0', '820');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('products', 'custom_game', 'array', '', 'a:0:{}', '0', '830');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('products', 'custom_music', 'array', '', 'a:0:{}', '0', '840');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('products', 'custom_movie', 'array', '', 'a:0:{}', '0', '850');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('products', 'custom_book', 'array', '', 'a:0:{}', '0', '860');\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
Beispiel #11
0
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION!              |
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_videos` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `prodid` int(11) unsigned NOT NULL default '0',\n\t\t  `catid` int(11) unsigned NOT NULL default '0',\n\t\t  `userid` int(11) unsigned NOT NULL default '0',\n\t\t  `file` text NOT NULL,\n\t\t  `filesize` BIGINT UNSIGNED NOT NULL,\n\t\t  `flvfile` tinytext NOT NULL,\n\t\t  `status` enum('new','converting','failed','finished') NOT NULL default 'finished',\n\t\t  `source` varchar(30) NOT NULL,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `teaserpic` tinytext NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `starttime` int(11) unsigned NOT NULL default '0',\n\t\t  `endtime` int(11) unsigned NOT NULL default '0',\n\t\t  `broken` int(11) unsigned NOT NULL default '0',\n\t\t  `password` tinytext NOT NULL,\n\t\t  `limit` int(10) unsigned NOT NULL default '0',\n\t\t  `top` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `regonly` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `allowrating` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  `downloads` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `catid` (`catid`),\n\t\t  KEY `userid` (`userid`),\n\t\t  KEY `starttime` (`starttime`,`endtime`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_videos_cat` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `icon` tinytext NOT NULL,\n\t\t  `open` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `forgroup` tinytext NOT NULL,\n\t\t  `parents` varchar(255) NOT NULL,\n\t\t  `children` text NOT NULL,\n\t\t  `ord` tinyint(3) NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `parents` (`parents`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_videos_screens` (\n\t\t  `pictureid` int(11) unsigned NOT NULL auto_increment,\n\t\t  `videoid` int(11) unsigned NOT NULL,\n\t\t  `thumbnail` tinytext NOT NULL,\n\t\t  `picture` tinytext NOT NULL,\n\t\t  PRIMARY KEY  (`pictureid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_videos_stats` (\n\t\t  `daystamp` int(8) unsigned NOT NULL default '0',\n\t\t  `time` int(11) unsigned NOT NULL default '0',\n\t\t  `dlid` int(11) unsigned NOT NULL default '0',\n\t\t  `bytes` bigint(20) unsigned NOT NULL default '0',\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`daystamp`,`dlid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_videos_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('videos', 'ffmpeg', 'string', 'BLOCK', '', '', 0, 0),\n\t\t('videos', 'flvtool2', 'string', 'BLOCK', '', '', 0, 0),\n\t\t('videos', 'mencoder', 'string', 'BLOCK', '', '', 0, 0),\n\t\t\n\t\t('videos', 'flvwidth', 'int', '', '400', 'CONVERTER', 1261490672, 1000),\n\t\t('videos', 'flvheight', 'int', '', '300', 'CONVERTER', 1261490672, 2000),\n\t\t('videos', 'vbitrate', 'int', '', '1200', 'CONVERTER', 1261490672, 3000),\n\t\t('videos', 'abitrate', 'int', '', '128', 'CONVERTER', 1261490672, 4000),\n\t\t\n\t\t('videos', 'searchable', 'switch', '', '1', 'OPTIONS', 1261490672, 1000),\n\t\t('videos', 'regonly', 'switch', '', '0', 'OPTIONS', 1261490672, 2000),\n\t\t('videos', 'maxtraffic', 'float', '', '0', 'OPTIONS', 1261490672, 3000),\n\t\t('videos', 'exttraffic', 'switch', '', '1', 'OPTIONS', 1251291273, 3500),\n\t\t('videos', 'coms', 'switch', '', '1', 'OPTIONS', 1261490672, 4000),\n\t\t('videos', 'ratings', 'switch', '', '1', 'OPTIONS', 1261490672, 5000),\n\t\t('videos', 'mailonbroken', 'string', '', '', 'OPTIONS', 1261490672, 6000),\n\t\t\n\t\t('videos', 'addpics', 'int', '', '5', 'SCREENSHOTS', 1261490672, 1000),\n\t\t('videos', 'picwidth', 'int', '', '640', 'SCREENSHOTS', 1261490672, 2000),\n\t\t('videos', 'picheight', 'int', '', '480', 'SCREENSHOTS', 1261490672, 3000),\n\t\t('videos', 'watermark', 'string', '', '', 'SCREENSHOTS', 1261490672, 4000),\n\t\t('videos', 'watermark_transp', 'int', '', '50', 'SCREENSHOTS', 1261490672, 5000),\n\t\t('videos', 'watermark_position', 'select', 'a:9:{i:1;s:18:\"{POSTOP} {POSLEFT}\";i:2;s:20:\"{POSTOP} {POSCENTER}\";i:3;s:19:\"{POSTOP} {POSRIGHT}\";i:4;s:21:\"{POSMIDDLE} {POSLEFT}\";i:5;s:23:\"{POSMIDDLE} {POSCENTER}\";i:6;s:22:\"{POSMIDDLE} {POSRIGHT}\";i:7;s:21:\"{POSBOTTOM} {POSLEFT}\";i:8;s:23:\"{POSBOTTOM} {POSCENTER}\";i:9;s:22:\"{POSBOTTOM} {POSRIGHT}\";}', '9', 'SCREENSHOTS', 1261490672, 6000),\n\t\t('videos', 'thumbwidth', 'int', '', '120', 'SCREENSHOTS', 1261490672, 7000),\n\t\t('videos', 'thumbheight', 'int', '', '90', 'SCREENSHOTS', 1261490672, 8000),\n\t\t('videos', 'quality_resize', 'switch', '', '1', 'SCREENSHOTS', 1261490672, 9000),\n\t\t\n\t\t('videos', 'teaserpic_width', 'int', '', '120', 'TEASERPIC', 1261490672, 1000),\n\t\t('videos', 'teaserpic_height', 'int', '', '120', 'TEASERPIC', 1261490672, 2000),\n\t\t('videos', 'teaserpic_popup', 'switch', '', '1', 'TEASERPIC', 1261490672, 3000),\n\t\t('videos', 'teaserpic_popup_width', 'int', '', '640', 'TEASERPIC', 1261490672, 4000),\n\t\t('videos', 'teaserpic_popup_height', 'int', '', '480', 'TEASERPIC', 1261490672, 5000),\n\t\t('videos', 'teaserpic_quality', 'switch', '', '1', 'TEASERPIC', 1261490672, 6000),\n\t\t\n\t\t('videos', 'epp', 'int', '', '20', 'VIEW', 1261490672, 1000),\n\t\t('videos', 'searchepp', 'string', '', '20', 'VIEW', 1261490672, 2000),\n\t\t('videos', 'catonly', 'switch', '', '1', 'VIEW', 1261490672, 3000),\n\t\t('videos', 'sortby', 'select', 'a:2:{i:1;s:7:\"{TITLE}\";i:2;s:6:\"{DATE}\";}', '1', 'VIEW', 1261490672, 4000),\n\t\t('videos', 'new', 'int', '', '3', 'VIEW', 1261490672, 5000),\n\t\t('videos', 'embed_width', 'int', '', '320', 'VIEW', '0', '6000'),\n\t\t('videos', 'embed_height', 'int', '', '240', 'VIEW', '0', '7000');\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('videos');
    $mm->createdir('flv', 'videos');
    $mm->createdir('logs', 'videos');
    $mm->createdir('pics', 'videos');
    $mm->createdir('screens', 'videos');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_videos`;\n\t\tDROP TABLE `apx_videos_cat`;\n\t\tDROP TABLE `apx_videos_screens`;\n\t\tDROP TABLE `apx_videos_stats`;\n\t\tDROP TABLE `apx_videos_tags`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
Beispiel #12
0
     $apx->tmpl->assign('PASSWORD', compatible_hsc($_POST['password']));
     $apx->tmpl->assign('ALLOWCOMS', intval($_POST['allowcoms']));
     $apx->tmpl->parse('mygallery_addedit');
     require 'lib/_end.php';
 } elseif ($_REQUEST['do'] == 'del') {
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send']) {
         $db->query("DELETE FROM " . PRE . "_user_gallery WHERE id='" . $_REQUEST['id'] . "' AND owner='" . $user->info['userid'] . "' LIMIT 1");
         if ($db->affected_rows()) {
             $data = $db->fetch("SELECT picture,thumbnail FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['id'] . "'");
             $db->query("DELETE FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['id'] . "'");
             require_once BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             if (count($data)) {
                 foreach ($data as $res) {
                     $picture = $res['picture'];
                     $thumbnail = $res['thumbnail'];
                     if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) {
                         $mm->deletefile($picture);
                     }
                     if ($thumbnail && file_exists(BASEDIR . getpath('uploads') . $thumbnail)) {
                         $mm->deletefile($thumbnail);
                     }
                 }
             }
             $mm->deletedir('user/gallery-' . $_REQUEST['id']);
         }
         message($apx->lang->get('MSG_DEL_OK'), mklink('user.php?action=mygallery', 'user,mygallery.html'));
Beispiel #13
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_calendar_cat` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `icon` tinytext NOT NULL,\n\t\t  `parents` varchar(255) NOT NULL,\n\t\t  `children` text NOT NULL,\n\t\t  `ord` tinyint(3) NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `parents` (`parents`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_calendar_events` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `catid` int(11) unsigned NOT NULL default '0',\n\t\t  `userid` int(11) unsigned NOT NULL default '0',\n\t\t  `send_username` tinytext NOT NULL,\n\t\t  `send_email` tinytext NOT NULL,\n\t\t  `send_ip` tinytext NOT NULL,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `location` tinytext NOT NULL,\n\t\t  `location_link` tinytext NOT NULL,\n\t\t  `picture` tinytext NOT NULL,\n\t\t  `priority` enum('1','2','3') NOT NULL default '2',\n\t\t  `galid` int(11) unsigned NOT NULL default '0',\n\t\t  `links` text NOT NULL,\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `startday` int(8) NOT NULL default '0',\n\t\t  `starttime` smallint(4) NOT NULL default '-1',\n\t\t  `endday` int(8) NOT NULL default '0',\n\t\t  `endtime` smallint(4) NOT NULL default '-1',\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allownote` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `private` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  `active` INT( 11 ) UNSIGNED NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `catid` (`catid`),\n\t\t  KEY `userid` (`userid`),\n\t\t  KEY `active` (`active`),\n\t\t  KEY `startday` (`startday`,`endday`,`starttime`,`endtime`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_calendar_parts` (\n\t\t  `eventid` int(11) unsigned NOT NULL default '0',\n\t\t  `userid` int(11) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`eventid`,`userid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tCREATE TABLE `apx_calendar_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('calendar', 'eventdays', 'int', '', '7', 'VIEW', 1219685244, 1000),\n\t\t('calendar', 'searchepp', 'int', '', '20', 'VIEW', 1219685244, 2000),\n\t\t('calendar', 'sortby', 'select', 'a:2:{i:1;s:13:\"{SORTBY_TIME}\";i:2;s:14:\"{SORTBY_TITLE}\";}', '1', 'VIEW', 1219685244, 3000),\n\t\t('calendar', 'start', 'select', 'a:3:{s:3:\"day\";s:11:\"{START_DAY}\";s:4:\"week\";s:12:\"{START_WEEK}\";s:5:\"month\";s:13:\"{START_MONTH}\";}', 'month', 'VIEW', '0', '4000'),\n\t\t\n\t\t('calendar', 'searchable', 'switch', '', '1', 'OPTIONS', 1219685244, 1000),\n\t\t('calendar', 'subcats', 'switch', '', '1', 'OPTIONS', 1219685244, 2000),\n\t\t('calendar', 'userevents', 'switch', '', '1', 'OPTIONS', 1219685244, 3000),\n\t\t('calendar', 'captcha', 'switch', '', '1', 'OPTIONS', 1219685244, 4000),\n\t\t('calendar', 'mailonnew', 'string', '', '', 'OPTIONS', 1219685244, 5000),\n\t\t('calendar', 'coms', 'switch', '', '1', 'OPTIONS', 1219685244, 6000),\n\t\t('calendar', 'note', 'switch', '', '1', 'OPTIONS', 1219685244, 7000),\n\t\t\n\t\t('calendar', 'pic_width', 'int', '', '120', 'IMAGES', 1219685244, 1000),\n\t\t('calendar', 'pic_height', 'int', '', '120', 'IMAGES', 1219685244, 2000),\n\t\t('calendar', 'pic_popup', 'switch', '', '1', 'IMAGES', 1219685244, 3000),\n\t\t('calendar', 'pic_popup_width', 'int', '', '640', 'IMAGES', 1219685244, 4000),\n\t\t('calendar', 'pic_popup_height', 'int', '', '480', 'IMAGES', 1219685244, 5000),\n\t\t('calendar', 'pic_quality', 'switch', '', '1', 'IMAGES', 1219685244, 6000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Bilder-Ordner
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('calendar');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_calendar_cat`;\n\t\tDROP TABLE `apx_calendar_events`;\n\t\tDROP TABLE `apx_calendar_parts`;\n\t\tDROP TABLE `apx_calendar_tags`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
            $mysql = "\n\t\t\t\tALTER TABLE `apx_calendar_events` ADD `location` TINYTEXT NOT NULL AFTER `text` ;\n\t\t\t\tALTER TABLE `apx_calendar_events` ADD `send_username` TINYTEXT NOT NULL AFTER `userid` , ADD `send_email` TINYTEXT NOT NULL AFTER `send_username` , ADD `send_ip` TINYTEXT NOT NULL AFTER `send_email` ;\n\t\t\t\tALTER TABLE `apx_calendar_events` ADD `secid` TINYTEXT NOT NULL AFTER `id` ;\n\t\t\t\tUPDATE `apx_calendar_events` SET secid = 'all';\n\t\t\t\tALTER TABLE `apx_calendar_cat` ADD `root_id` INT( 11 ) UNSIGNED NOT NULL AFTER `id` ;\n\t\t\t\tALTER TABLE `apx_calendar_cat` ADD `lft` INT( 11 ) UNSIGNED NOT NULL , ADD `rgt` INT( 11 ) UNSIGNED NOT NULL ;\n\t\t\t\tUPDATE `apx_calendar_cat` SET root_id = id;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('calendar', 'subcats', 'switch', '', '1', 1176245712, 50);\n\t\t\t\tINSERT INTO `apx_config` VALUES ('calendar', 'sortby', 'select', 'a:2:{i:1;s:13:\"{SORTBY_TIME}\";i:2;s:14:\"{SORTBY_TITLE}\";}', '1', '0', '250');\n\t\t\t\tINSERT INTO `apx_config` VALUES ('calendar', 'captcha', 'switch', '', '1', '0', '1050');\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
Beispiel #14
0
if ($threadinfo['del'] && !($user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator'])))) {
    message($apx->lang->get('MSG_THREADNOTEXIST'));
}
if ($postinfo['del'] && !($user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator'])))) {
    message($apx->lang->get('MSG_POSTNOTEXIST'));
}
if (!forum_access_read($foruminfo)) {
    tmessage('noright', array(), false, false);
}
check_forum_password($foruminfo);
//Lastvisit für dieses Thema bestimmen
$lastvisit = max(array($user->info['forum_lastonline'], thread_readtime($threadinfo['threadid']), forum_readtime($foruminfo['forumid'])));
///////////////////////////////////////////////////////////////////////////////////////// BEITRAG
$res = $postinfo;
require_once BASEDIR . 'lib/class.mediamanager.php';
$mm = new mediamanager();
//Userinfo auslesen
if ($res['userid']) {
    $userdat = $db->first("SELECT a.userid,a.groupid,a.reg_time,a.forum_posts,a.avatar,a.avatar_title,a.signature,a.homepage,a.city,a.icq,a.aim,a.yim,a.msn,a.skype,a.forum_lastactive,a.pub_invisible,a.custom1,a.custom2,a.custom3,a.custom4,a.custom5,a.custom6,a.custom7,a.custom8,a.custom9,a.custom10,b.gtype FROM " . PRE . "_user AS a LEFT JOIN " . PRE . "_user_groups AS b USING(groupid) WHERE a.userid='" . $res['userid'] . "' LIMIT 1");
} else {
    $userdat = array();
}
$mods = $foruminfo['moderator'];
//Text
$text = forum_replace($postinfo['text'], $postinfo['allowcodes'], $postinfo['allowsmilies']);
//Benutzerkennzeichen
$siganture = $avatar = $avatar_title = '';
if ($postinfo['userid']) {
    if ($postinfo['allowsig']) {
        $signature = $user->mksig($userdat);
    }
Beispiel #15
0
         continue;
     }
     //Bei required-Feldern Namen kürzen
     if (substr($key, -9) == '_required') {
         $key = substr($key, 0, strlen($key) - 9);
     }
     $addnl .= $key . ': ' . $value . "\r\n";
 }
 //Text erstellen
 $text = str_replace("\r", '', $_POST['text']);
 $text = str_replace("\n", "\r\n", $text);
 $text = $text . iif($addnl, "\r\n\r\n" . $addnl);
 //Mediamanger initialisieren
 $attachments = array();
 require BASEDIR . 'lib/class.mediamanager.php';
 $mm = new mediamanager();
 $temphash = md5(microtime());
 //Dateien hochladen
 for ($i = 1; $i <= 5; $i++) {
     $fileinfo = $_FILES['attach' . $i];
     if (!$fileinfo['tmp_name']) {
         continue;
     }
     if (!is_uploaded_file($fileinfo['tmp_name'])) {
         continue;
     }
     $tempname = 'contact_' . $temphash . '_' . $fileinfo['name'] . '.tmp';
     $mm->uploadfile($fileinfo, 'temp', $tempname);
     $attachments[] = array('filename' => $fileinfo['name'], 'source' => $tempname, 'type' => $fileinfo['type']);
 }
 //Normale eMail senden
Beispiel #16
0
 function udel()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             //Bild löschen
             list($picture) = $db->first("SELECT picture FROM " . PRE . "_products_units WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             require_once BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             $poppic = str_replace('-thumb.', '.', $picture);
             if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) {
                 $mm->deletefile($picture);
             }
             if ($poppic && file_exists(BASEDIR . getpath('uploads') . $poppic)) {
                 $mm->deletefile($poppic);
             }
             //DB-Eintrag löschen
             $db->query("DELETE FROM " . PRE . "_products_units WHERE id='" . $_REQUEST['id'] . "'");
             logit('PRODUCTS_UNITS_DEL', 'ID #' . $_REQUEST['id']);
             printJSRedirect(get_index('products.ushow'));
         }
     } else {
         list($title) = $db->first("SELECT title FROM " . PRE . "_products_units WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title))));
         tmessageOverlay('deltitle', array('ID' => $_REQUEST['id']), '/');
     }
 }
Beispiel #17
0
 function pictures()
 {
     global $set, $db, $apx;
     //Notwendig weil 1.7.0 beim Kopieren ein Bild mit ID 0 erzeugt hatte :/
     if (isset($_REQUEST['delpic'])) {
         $_REQUEST['delpic'] = (int) $_REQUEST['delpic'];
     } else {
         $_REQUEST['delpic'] = null;
     }
     //Bilder auslesen
     list($pictures, $nextid) = $db->first("SELECT pictures,pictures_nextid FROM " . PRE . "_articles WHERE id='" . $_REQUEST['id'] . "'");
     $pictures = unserialize($pictures);
     if (!is_array($pictures)) {
         $pictures = array();
     }
     //Bild löschen
     if (isset($_REQUEST['delpic']) && isset($pictures[$_REQUEST['delpic']])) {
         if ($_POST['delpic']) {
             if (!checkToken()) {
                 printInvalidToken();
             } else {
                 $picinfo = $pictures[$_REQUEST['delpic']];
                 require BASEDIR . 'lib/class.mediamanager.php';
                 $mm = new mediamanager();
                 if ($picinfo['thumbnail'] && file_exists(BASEDIR . getpath('uploads') . $picinfo['thumbnail'])) {
                     $mm->deletefile($picinfo['thumbnail']);
                 }
                 if ($picinfo['picture'] && file_exists(BASEDIR . getpath('uploads') . $picinfo['picture'])) {
                     $mm->deletefile($picinfo['picture']);
                 }
                 unset($pictures[$_REQUEST['delpic']]);
                 $db->query("UPDATE " . PRE . "_articles SET pictures='" . addslashes(serialize($pictures)) . "' WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
                 printJSRedirect('action.php?action=' . $_REQUEST['action'] . '&id=' . $_REQUEST['id'] . '&pubnow=' . $_REQUEST['pubnow'] . '&pageid=pics');
             }
         } else {
             tmessageOverlay('picdel', array('ID' => $_REQUEST['id'], 'DELPIC' => $_REQUEST['delpic']));
         }
     } elseif ($_POST['send']) {
         require BASEDIR . 'lib/class.mediamanager.php';
         $mm = new mediamanager();
         require_once BASEDIR . 'lib/class.image.php';
         $img = new image();
         //Bilder abarbeiten
         for ($i = 1; $i <= 5; $i++) {
             if (!$_FILES['upload' . $i]['tmp_name']) {
                 continue;
             }
             $ext = strtolower($mm->getext($_FILES['upload' . $i]['name']));
             if ($ext == 'gif') {
                 $ext = 'jpg';
             }
             $newname = 'pic' . '-' . $_POST['id'] . '-' . $nextid . '.' . $ext;
             $newfile = 'articles/gallery/' . $newname;
             $thumbname = 'pic' . '-' . $_POST['id'] . '-' . $nextid . '-thumb.' . $ext;
             $thumbfile = 'articles/gallery/' . $thumbname;
             //Erfolgreichen Upload prüfen
             if (!$mm->uploadfile($_FILES['upload' . $i], 'articles/gallery', $newname)) {
                 continue;
             }
             //Bild einlesen
             list($picture, $picturetype) = $img->getimage($newfile);
             //////// THUMBNAIL
             $thumbnail = $img->resize($picture, $set['articles']['thumbwidth'], $set['articles']['thumbheight'], $set['articles']['artpic_quality']);
             $img->saveimage($thumbnail, $picturetype, $thumbfile);
             //////// BILD
             //Bild skalieren
             if ($picture !== false && !$_POST['noresize' . $i] && $set['articles']['picwidth'] && $set['articles']['picheight']) {
                 $scaled = $img->resize($picture, $set['articles']['picwidth'], $set['articles']['picheight'], $set['articles']['artpic_quality'], 0);
                 if ($scaled != $picture) {
                     imagedestroy($picture);
                 }
                 $picture = $scaled;
             }
             //Wasserzeichen einfügen
             if ($picture !== false && $set['articles']['watermark'] && $_POST['watermark' . $i]) {
                 $watermarked = $img->watermark($picture, $set['articles']['watermark'], $set['articles']['watermark_position'], $set['articles']['watermark_transp']);
                 if ($watermarked != $picture) {
                     imagedestroy($picture);
                 }
                 $picture = $watermarked;
             }
             //Bild erstellen
             $img->saveimage($picture, $picturetype, $newfile);
             //Cleanup
             imagedestroy($picture);
             imagedestroy($thumbnail);
             unset($picture, $thumbnail);
             $pictures[$nextid] = array('picture' => $newfile, 'thumbnail' => $thumbfile);
             ++$nextid;
         }
         //Bilder eintragen
         $db->query("UPDATE " . PRE . "_articles SET pictures='" . addslashes(serialize($pictures)) . "',pictures_nextid='" . intval($nextid) . "' WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         //Artikel beenden
         if ($_POST['submit_finish']) {
             $this->finish_article();
             return;
         } else {
             printJSRedirect('action.php?action=' . $_REQUEST['action'] . '&id=' . $_REQUEST['id'] . '&pubnow=' . $_REQUEST['pubnow'] . '&pageid=pics');
         }
     } else {
         echo '<h2>' . $apx->lang->get(iif($this->type == 'normal', 'ARTICLE', strtoupper($this->type))) . ': ' . $this->title . '</h2>';
         //Bilderserie auflisten
         foreach ($pictures as $id => $res) {
             ++$i;
             $picdata[$i]['ID'] = $id;
             $picdata[$i]['IMAGE'] = HTTPDIR . getpath('uploads') . $res['thumbnail'];
             $picdata[$i]['LINK'] = HTTPDIR . getpath('uploads') . $res['picture'];
             $picdata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', $_REQUEST['action'], 'id=' . $_REQUEST['id'] . '&pageid=pics&delpic=' . $id . '&pubnow=' . $_REQUEST['pubnow'], $apx->lang->get('CORE_DEL'));
         }
         $apx->tmpl->assign('SET_WATERMARK', iif($set['articles']['watermark'], 1, 0));
         $apx->tmpl->assign('SET_NORESIZE', iif($set['articles']['picwidth'] && $set['articles']['picheight'], 1, 0));
         $apx->tmpl->assign('PIC', $picdata);
         $apx->tmpl->assign('PUBNOW', (int) $_REQUEST['pubnow']);
         $apx->tmpl->assign('ID', $_REQUEST['id']);
         $apx->tmpl->assign('ACTION', iif($_REQUEST['action'] == 'articles.add', 'add', 'edit'));
         $apx->tmpl->parse('pictures');
     }
 }
Beispiel #18
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE IF NOT EXISTS `apx_teaser` (\n\t\t  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `image` tinytext NOT NULL,\n\t\t  `link` tinytext NOT NULL,\n\t\t  `group` tinyint(2) unsigned NOT NULL DEFAULT '1',\n\t\t  `hits` int(11) unsigned NOT NULL DEFAULT '0',\n\t\t  `ord` smallint(4) unsigned NOT NULL DEFAULT '0',\n\t\t  `addtime` int(10) unsigned NOT NULL,\n\t\t  `starttime` int(10) NOT NULL,\n\t\t  `endtime` int(10) NOT NULL,\n\t\t  PRIMARY KEY (`id`),\n\t\t  KEY `addtime` (`addtime`),\n\t\t  KEY `starttime` (`starttime`,`endtime`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('teaser', 'orderby', 'select', 'a:3:{i:1;s:12:\"{ORDERADMIN}\";i:2;s:10:\"{ORDERPUB}\";i:3;s:13:\"{ORDERRANDOM}\";}', '2', '', 1129897415, 1000),\n\t\t('teaser', 'groups', 'array', 'BLOCK', 'a:0:{}', '', 0, 0);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Ordner für Bilder
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('teaser');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_teaser`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //Zu 1.1.0
            /*
            $mysql="
            	
            ";
Beispiel #19
0
function misc_mailform()
{
    global $set, $db, $apx, $user;
    if ($_SERVER['REQUEST_METHOD'] != 'POST') {
        return;
    }
    if (!isset($set['formmailer']['sendto'][$_POST['sendto']])) {
        die('sendto is not a valid mail-ID!');
    }
    $apx->lang->drop('sendform', 'formmailer');
    //Zusätzliche Felder prüfen ob ausgefüllt
    $addnl_failed = false;
    foreach ($_POST as $key => $value) {
        if (in_array($key, array('subject', 'sendto', 'copytome'))) {
            continue;
        }
        if (substr($key, -9) != '_required') {
            continue;
        }
        if (!$value) {
            $addnl_failed = true;
        }
    }
    //Absenden
    if ($addnl_failed) {
        message('back');
    } else {
        //Text erstellen
        $text = '';
        foreach ($_POST as $key => $value) {
            if (in_array($key, array('subject', 'sendto', 'copytome'))) {
                continue;
            }
            //Bei required-Feldern Namen kürzen
            if (substr($key, -9) == '_required') {
                $key = substr($key, 0, strlen($key) - 9);
            }
            $text .= $key . ': ' . $value . "\n";
        }
        //Betreff
        if ($_POST['subject']) {
            $subject = $_POST['subject'];
        } else {
            $subject = 'apexx Formmailer';
        }
        //Mediamanger initialisieren
        $attachments = array();
        require BASEDIR . 'lib/class.mediamanager.php';
        $mm = new mediamanager();
        $temphash = md5(microtime());
        //Dateien hochladen
        if (is_array($_FILES) && count($_FILES)) {
            foreach ($_FILES as $fileinfo) {
                if (!$fileinfo['tmp_name']) {
                    continue;
                }
                if (!is_uploaded_file($fileinfo['tmp_name'])) {
                    continue;
                }
                $tempname = 'contact_' . $temphash . '_' . $fileinfo['name'] . '.tmp';
                $mm->uploadfile($fileinfo, 'temp', $tempname);
                $attachments[] = array('filename' => $fileinfo['name'], 'source' => $tempname, 'type' => $fileinfo['type']);
            }
        }
        //Normale eMail senden
        if (!count($attachments)) {
            if ($set['main']['mailbotname']) {
                $from = 'From:' . $set['main']['mailbotname'] . '<' . $set['main']['mailbot'] . '>';
            } else {
                $from = 'From:' . $set['main']['mailbot'];
            }
            $sendtomail = $set['formmailer']['sendto'][$_POST['sendto']];
            mail($sendtomail, $subject, $text, $from);
        } else {
            $boundary = md5(uniqid(time()));
            if ($set['main']['mailbotname']) {
                $from = 'From:' . $set['main']['mailbotname'] . '<' . $set['main']['mailbot'] . '>';
            } else {
                $from = 'From:' . $set['main']['mailbot'];
            }
            $header = "MIME-Version: 1.0\n";
            $header .= $from . "\n";
            $header .= "Content-Type: multipart/mixed; boundary=\"" . $boundary . "\"\n";
            $body = "--" . $boundary . "\n";
            $body .= "Content-Type: text/plain\n";
            $body .= "Content-Transfer-Encoding: 7bit\n\n";
            $body .= $text . "\n\n";
            //Dateianhänge codieren
            $filedata = '';
            foreach ($attachments as $source) {
                $sourcepath = BASEDIR . getpath('uploads') . 'temp/' . $source['source'];
                $filedata = fread(fopen($sourcepath, 'r'), filesize($sourcepath));
                $body .= "--" . $boundary . "\n";
                $body .= "Content-Type: " . $source['type'] . "; name=\"" . $source['filename'] . "\"\n";
                $body .= "Content-Transfer-Encoding: base64\n";
                $body .= "Content-Disposition: attachment; filename=\"" . $source['filename'] . "\"\n\n";
                $body .= chunk_split(base64_encode($filedata));
                $body .= "\n";
            }
            $body .= "--{$boundary}--\n";
            //eMail abschicken
            $sendtomail = $set['formmailer']['sendto'][$_POST['sendto']];
            mail($sendtomail, $_POST['subject'], $body, $header);
            //Anhänge vom Server löschen
            foreach ($attachments as $tempfile) {
                $mm->deletefile('temp/' . $tempfile['source']);
            }
        }
        message($apx->lang->get('MSG_OK'), mklink('index.php', 'index.html'));
    }
}
Beispiel #20
0
 $threadIds = get_ids($data, 'threadid');
 if ($threadIds) {
     $db->query("UPDATE " . PRE . "_forum_posts SET del=0 WHERE threadid IN (" . implode(',', $threadIds) . ")");
 }
 $mysql = "\n\t\t\t\tALTER TABLE `apx_forums` ADD `stylesheet` TINYTEXT NOT NULL AFTER `inherit` ;\n\t\t\t\tALTER TABLE `apx_forum_threads` ADD `prefix` INT( 11 ) UNSIGNED NOT NULL AFTER `forumid` ;\n\t\t\t\tALTER TABLE `apx_forum_attachments` ADD `thumbnail` TINYTEXT NOT NULL AFTER `file` ; \n\t\t\t\tALTER TABLE `apx_forums` ADD `lastpost` INT( 11 ) UNSIGNED NOT NULL AFTER `children` ;\n\t\t\t\tALTER TABLE `apx_forums` ADD `lastthread` INT( 11 ) UNSIGNED NOT NULL AFTER `lastposttime` , ADD `lastthread_title` TINYTEXT NOT NULL AFTER `lastthread`, ADD `lastthread_icon` INT( 11 ) NOT NULL DEFAULT '-1' AFTER `lastthread_title` , ADD `lastthread_prefix` INT( 11 ) UNSIGNED NOT NULL AFTER `lastthread_icon` ;\n\t\t\t\t\n\t\t\t\tINSERT INTO `apx_cron` VALUES ('clean', 'forum', '86400', '1268002800', '');\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_activity` (\n\t\t\t\t  `userid` int(11) unsigned NOT NULL,\n\t\t\t\t  `ip` int(11) unsigned NOT NULL,\n\t\t\t\t  `type` enum('forum','thread') NOT NULL,\n\t\t\t\t  `id` int(11) unsigned NOT NULL,\n\t\t\t\t  `time` int(11) unsigned NOT NULL,\n\t\t\t\t  `invisible` tinyint(1) unsigned NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`userid`,`ip`,`type`,`id`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_anndisplay` (\n\t\t\t\t  `id` int(11) unsigned NOT NULL,\n\t\t\t\t  `forumid` int(11) unsigned NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`id`,`forumid`)\n\t\t\t\t) ENGINE=MyISAM;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_announcements` (\n\t\t\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t\t\t  `userid` int(11) unsigned NOT NULL,\n\t\t\t\t  `title` varchar(255) NOT NULL default '',\n\t\t\t\t  `text` text NOT NULL,\n\t\t\t\t  `addtime` int(11) unsigned NOT NULL,\n\t\t\t\t  `starttime` int(11) unsigned NOT NULL,\n\t\t\t\t  `endtime` int(11) unsigned NOT NULL,\n\t\t\t\t  `views` int(11) unsigned NOT NULL default '0',\n\t\t\t\t  PRIMARY KEY  (`id`),\n\t\t\t\t  KEY `starttime` (`starttime`,`endtime`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t\t\n\t\t\t\tCREATE TABLE `apx_forum_prefixes` (\n\t\t\t\t  `prefixid` int(11) unsigned NOT NULL auto_increment,\n\t\t\t\t  `forumid` int(11) unsigned NOT NULL,\n\t\t\t\t  `title` tinytext NOT NULL,\n\t\t\t\t  `code` tinytext NOT NULL,\n\t\t\t\t  PRIMARY KEY  (`prefixid`)\n\t\t\t\t) ENGINE=MyISAM ;\n\t\t\t";
 $queries = split_sql($mysql);
 foreach ($queries as $query) {
     $db->query($query);
 }
 //Anhänge aktualisieren
 $attachments = '';
 $data = $db->fetch("\n\t\t\t\tSELECT id, file FROM\n\t\t\t\t" . PRE . "_forum_attachments\n\t\t\t");
 if (count($data)) {
     require BASEDIR . 'lib/class.mediamanager.php';
     require BASEDIR . 'lib/class.image.php';
     $mm = new mediamanager();
     $img = new image();
     foreach ($data as $res) {
         $ext = strtolower($mm->getext($res['file']));
         if (in_array($ext, array('gif', 'jpg', 'jpe', 'jpeg', 'png'))) {
             $fileid = substr($res['file'], 0, -1 * (strlen($ext) - 1));
             $thumbnailPath = $fileid . '_thumb.' . $ext;
             list($picture, $picturetype) = $img->getimage($res['file']);
             //////// THUMBNAIL
             $thumbnail = $img->resize($picture, 120, 90, true);
             $img->saveimage($thumbnail, $picturetype, $thumbnailPath);
             //Cleanup
             imagedestroy($picture);
             imagedestroy($thumbnail);
             unset($picture, $thumbnail);
             //Update SQL
Beispiel #21
0
     $captchafailed = $captcha->check();
 }
 if ($captchafailed) {
     message($apx->lang->get('MSG_WRONGCODE'), 'javascript:history.back()');
 } elseif (!$_POST['send_username'] && !$user->info['userid'] || !$_POST['catid'] || !$_POST['title'] || !$_POST['text'] || !$_FILES['file']['tmp_name']) {
     message('back');
 } elseif ($spam + $set['downloads']['spamprot'] * 60 > time()) {
     message($apx->lang->get('MSG_BLOCKSPAM', array('SEC' => $spam + $set['downloads']['spamprot'] * 60 - time())), 'back');
 } else {
     $ext = substr(strrchr($_FILES['file']['name'], '.'), 1);
     list($special) = $db->first("SELECT special FROM " . PRE . "_mediarules WHERE extension='" . strtoupper($ext) . "' LIMIT 1");
     if ($special == 'block') {
         message($apx->lang->get('MSG_NOTALLOWED'), 'back');
     }
     require BASEDIR . 'lib/class.mediamanager.php';
     $mm = new mediamanager();
     $stamp = md5(microtime());
     $mm->uploadfile($_FILES['file'], 'downloads/uploads', $stamp . '-' . $_FILES['file']['name']);
     if ($user->info['userid']) {
         $_POST['userid'] = $user->info['userid'];
         $_POST['send_username'] = $_POST['send_email'] = '';
     } else {
         $_POST['userid'] = 0;
     }
     $_POST['file'] = $_FILES['file']['name'];
     $_POST['tempfile'] = 'downloads/uploads/' . $stamp . '-' . $_FILES['file']['name'];
     $_POST['addtime'] = time();
     $_POST['send_ip'] = get_remoteaddr();
     $_POST['local'] = 1;
     $_POST['secid'] = 'all';
     $_POST['text'] = strtr(strip_tags($_POST['text']), array("\r\n" => "<br />\r\n", "\n" => "<br />\n"));
Beispiel #22
0
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION!              |
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_gallery` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `prodid` int(11) unsigned NOT NULL default '0',\n\t\t  `title` tinytext NOT NULL,\n\t\t  `description` text NOT NULL,\n\t\t  `meta_description` text NOT NULL,\n\t\t  `password` tinytext NOT NULL,\n\t\t  `preview` tinytext NOT NULL,\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `starttime` int(11) unsigned NOT NULL default '0',\n\t\t  `endtime` int(11) unsigned NOT NULL default '0',\n\t\t  `lastupdate` INT( 10 ) UNSIGNED NOT NULL,\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL,\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `parents` varchar(255) NOT NULL,\n\t\t  `children` text NOT NULL,\n\t\t  `ord` tinyint(3) NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `parents` (`parents`),\n\t\t  KEY `starttime` (`starttime`,`endtime`,`parents`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_gallery_pics` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `galid` int(11) unsigned NOT NULL default '0',\n\t\t  `thumbnail` tinytext NOT NULL,\n\t\t  `picture` tinytext NOT NULL,\n\t\t  `caption` tinytext NOT NULL,\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `allowrating` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `active` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `potw` tinyint(1) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `galid` (`galid`,`active`),\n\t\t  KEY `active` (`active`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_gallery_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('gallery', 'potw_time', 'int', 'BLOCK', '1249981414', '', 0, 0),\n\t\t\n\t\t('gallery', 'listepp', 'int', '', '5', 'VIEW', 1249816805, 1000),\n\t\t('gallery', 'galepp', 'int', '', '16', 'VIEW', 1249816805, 2000),\n\t\t('gallery', 'ordergal', 'select', 'a:3:{i:1;s:11:\"{ORDERTIME}\";i:2;s:12:\"{ORDERTITLE}\";i:3;s:12:\"{ORDERADMIN}\";}', '1', 'VIEW', 1249816805, 3000),\n\t\t('gallery', 'orderpics', 'select', 'a:2:{i:1;s:10:\"{NEWFIRST}\";i:2;s:10:\"{OLDFIRST}\";}', '1', 'VIEW', 1249816805, 4000),\n\t\t('gallery', 'new', 'int', '', '3', 'VIEW', 1249816805, 5000),\n\t\t\n\t\t('gallery', 'searchable', 'switch', '', '1', 'OPTIONS', 1249816805, 1000),\n\t\t('gallery', 'subgals', 'switch', '', '1', 'OPTIONS', 1249816805, 2000),\n\t\t('gallery', 'coms', 'switch', '', '1', 'OPTIONS', 1249816805, 3000),\n\t\t('gallery', 'galcoms', 'switch', '', '1', 'OPTIONS', 1249816805, 3000),\n\t\t('gallery', 'ratings', 'switch', '', '1', 'OPTIONS', 1249816805, 4000),\n\t\t('gallery', 'potw_auto', 'switch', '', '0', 'OPTIONS', 1249816805, 5000),\n\t\t\n\t\t('gallery', 'addpics', 'int', '', '10', 'IMAGES', 1249816805, 1000),\n\t\t('gallery', 'picwidth', 'int', '', '640', 'IMAGES', 1249816805, 2000),\n\t\t('gallery', 'picheight', 'int', '', '480', 'IMAGES', 1249816805, 3000),\n\t\t('gallery', 'watermark', 'string', '', '', 'IMAGES', 1249816805, 4000),\n\t\t('gallery', 'watermark_transp', 'int', '', '50', 'IMAGES', 1249816805, 5000),\n\t\t('gallery', 'watermark_position', 'select', 'a:9:{i:1;s:18:\"{POSTOP} {POSLEFT}\";i:2;s:20:\"{POSTOP} {POSCENTER}\";i:3;s:19:\"{POSTOP} {POSRIGHT}\";i:4;s:21:\"{POSMIDDLE} {POSLEFT}\";i:5;s:23:\"{POSMIDDLE} {POSCENTER}\";i:6;s:22:\"{POSMIDDLE} {POSRIGHT}\";i:7;s:21:\"{POSBOTTOM} {POSLEFT}\";i:8;s:23:\"{POSBOTTOM} {POSCENTER}\";i:9;s:22:\"{POSBOTTOM} {POSRIGHT}\";}', '9', 'IMAGES', 1249816805, 6000),\n\t\t('gallery', 'thumbwidth', 'int', '', '120', 'IMAGES', 1249816805, 7000),\n\t\t('gallery', 'thumbheight', 'int', '', '90', 'IMAGES', 1249816805, 8000),\n\t\t('gallery', 'quality_resize', 'switch', '', '1', 'IMAGES', 1249816805, 9000),\n\t\t('gallery', 'popup', 'switch', '', '1', 'IMAGES', 1249816805, 10000),\n\t\t('gallery', 'popup_addwidth', 'int', '', '60', 'IMAGES', 1249816805, 12000),\n\t\t('gallery', 'popup_addheight', 'int', '', '150', 'IMAGES', 1249816805, 13000),\n\t\t('gallery', 'popup_resizeable', 'switch', '', '1', 'IMAGES', 1249816805, 14000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('gallery');
    $mm->createdir('uploads', 'gallery');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_gallery`;\n\t\tDROP TABLE `apx_gallery_pics`;\n\t\tDROP TABLE `apx_gallery_tags`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
            $mysql = "\n\t\t\t\tALTER TABLE `apx_gallery` ADD `endtime` INT( 11 ) UNSIGNED NOT NULL AFTER `starttime`;\n\t\t\t\tUPDATE `apx_gallery` SET endtime='3000000000' WHERE starttime!='0';\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
Beispiel #23
0
 function del()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             $res = $db->first("SELECT newspic FROM " . PRE . "_news WHERE ( id='" . $_REQUEST['id'] . "' " . iif(!$apx->user->has_spright('news.del'), " AND userid='" . $apx->user->info['userid'] . "'") . " ) LIMIT 1");
             $db->query("DELETE FROM " . PRE . "_news WHERE ( id='" . $_REQUEST['id'] . "' " . iif(!$apx->user->has_spright('news.del'), " AND userid='" . $apx->user->info['userid'] . "'") . " ) LIMIT 1");
             if (!$db->affected_rows()) {
                 die('access denied!');
             }
             //Kommentare + Bewertungen löschen (nur wenn ein Eintrag gelöscht wurde -> User hat Recht dazu!)
             if ($apx->is_module('comments')) {
                 $db->query("DELETE FROM " . PRE . "_comments WHERE ( module='news' AND mid='" . $_REQUEST['id'] . "' )");
             }
             if ($apx->is_module('ratings')) {
                 $db->query("DELETE FROM " . PRE . "_ratings WHERE ( module='news' AND mid='" . $_REQUEST['id'] . "' )");
             }
             //Bilder löschen
             require_once BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             $picture = $res['newspic'];
             $poppic = str_replace('-thumb.', '.', $newspic);
             if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) {
                 $mm->deletefile($picture);
             }
             if ($poppic && file_exists(BASEDIR . getpath('uploads') . $poppic)) {
                 $mm->deletefile($poppic);
             }
             //Tags löschen
             $db->query("DELETE FROM " . PRE . "_news_tags WHERE id='" . $_REQUEST['id'] . "'");
             logit('NEWS_DEL', 'ID #' . $_REQUEST['id']);
             printJSRedirect(get_index('news.show'));
         }
     } else {
         list($title, $subtitle) = $db->first("SELECT title, subtitle FROM " . PRE . "_news WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title . ($subtitle ? ' - ' . $subtitle : '')))));
         tmessageOverlay('deltitle', array('ID' => $_REQUEST['id']), '/');
     }
 }
Beispiel #24
0
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
//Installieren
if (SETUPMODE == 'install') {
    $mysql = "\n\t\tCREATE TABLE `apx_news` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `secid` tinytext NOT NULL,\n\t\t  `prodid` int(11) unsigned NOT NULL default '0',\n\t\t  `catid` int(11) unsigned NOT NULL default '0',\n\t\t  `userid` int(11) unsigned NOT NULL default '0',\n\t\t  `send_username` tinytext NOT NULL,\n\t\t  `send_email` tinytext NOT NULL,\n\t\t  `send_ip` tinytext NOT NULL,\n\t\t  `newspic` tinytext NOT NULL,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `subtitle` tinytext NOT NULL,\n\t\t  `teaser` text NOT NULL,\n\t\t  `text` mediumtext NOT NULL,\n\t\t  `galid` int(11) unsigned NOT NULL default '0',\n\t\t  `meta_description` text NOT NULL,\n\t\t  `links` text NOT NULL,\n\t\t  `addtime` int(11) unsigned NOT NULL default '0',\n\t\t  `starttime` int(11) unsigned NOT NULL default '0',\n\t\t  `endtime` int(11) unsigned NOT NULL default '0',\n\t\t  `top` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `sticky` int(11) unsigned NOT NULL default '0',\n\t\t  `searchable` tinyint(1) unsigned NOT NULL default '0',\n\t\t  `allowcoms` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `allowrating` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `restricted` tinyint(1) unsigned NOT NULL,\n\t\t  `hits` int(11) unsigned NOT NULL default '0',\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `catid` (`catid`),\n\t\t  KEY `userid` (`userid`),\n\t\t  KEY `starttime` (`starttime`,`endtime`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_news_cat` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `icon` tinytext NOT NULL,\n\t\t  `open` tinyint(1) unsigned NOT NULL default '1',\n\t\t  `forgroup` tinytext NOT NULL,\n\t\t  `parents` varchar(255) NOT NULL,\n\t\t  `children` text NOT NULL,\n\t\t  `ord` tinyint(3) NOT NULL,\n\t\t  PRIMARY KEY  (`id`),\n\t\t  KEY `parents` (`parents`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_news_sources` (\n\t\t  `id` int(11) unsigned NOT NULL auto_increment,\n\t\t  `title` tinytext NOT NULL,\n\t\t  `link` tinytext NOT NULL,\n\t\t  PRIMARY KEY  (`id`)\n\t\t) ENGINE=MyISAM ;\n\t\t\n\t\tCREATE TABLE `apx_news_tags` (\n\t\t  `id` int(11) unsigned NOT NULL,\n\t\t  `tagid` int(11) unsigned NOT NULL,\n\t\t  PRIMARY KEY  (`id`,`tagid`)\n\t\t) ENGINE=MyISAM;\n\t\t\n\t\tINSERT INTO `apx_config` (`module`, `varname`, `type`, `addnl`, `value`, `tab`, `lastchange`, `ord`) VALUES\n\t\t('news', 'epp', 'int', '', '5', 'VIEW', 1249584889, 1000),\n\t\t('news', 'archiveepp', 'int', '', '5', 'VIEW', 1249584889, 2000),\n\t\t('news', 'archiveall', 'switch', '', '0', 'VIEW', 1249584889, 3000),\n\t\t('news', 'searchepp', 'int', '', '10', 'VIEW', 1249584889, 4000),\n\t\t('news', 'archivesort', 'select', 'a:2:{i:1;s:10:\"{NEWFIRST}\";i:2;s:10:\"{OLDFIRST}\";}', '2', 'VIEW', 1249584889, 5000),\n\t\t('news', 'archiveentrysort', 'select', 'a:2:{i:1;s:10:\"{NEWFIRST}\";i:2;s:10:\"{OLDFIRST}\";}', '1', 'VIEW', 1249584889, 6000),\n\t\t\n\t\t('news', 'searchable', 'switch', '', '1', 'OPTIONS', 1249584889, 1000),\n\t\t('news', 'subcats', 'switch', '', '1', 'OPTIONS', 1249584889, 2000),\n\t\t('news', 'teaser', 'switch', '', '1', 'OPTIONS', 1249584889, 3000),\n\t\t('news', 'coms', 'switch', '', '1', 'OPTIONS', 1249584889, 4000),\n\t\t('news', 'ratings', 'switch', '', '1', 'OPTIONS', 1249584889, 5000),\n\t\t('news', 'archcoms', 'switch', '', '1', 'OPTIONS', 1249584889, 6000),\n\t\t('news', 'archratings', 'switch', '', '1', 'OPTIONS', 1249584889, 7000),\n\t\t('news', 'captcha', 'switch', '', '1', 'OPTIONS', 1249584889, 8000),\n\t\t('news', 'spamprot', 'int', '', '1', 'OPTIONS', 1249584889, 9000),\n\t\t('news', 'mailonnew', 'string', '', '', 'OPTIONS', 1249584889, 10000),\n\t\t\n\t\t('news', 'newspic_width', 'int', '', '120', 'IMAGES', 1249584889, 1000),\n\t\t('news', 'newspic_height', 'int', '', '120', 'IMAGES', 1249584889, 2000),\n\t\t('news', 'newspic_popup', 'switch', '', '1', 'IMAGES', 1249584889, 3000),\n\t\t('news', 'newspic_popup_width', 'int', '', '640', 'IMAGES', 1249584889, 4000),\n\t\t('news', 'newspic_popup_height', 'int', '', '480', 'IMAGES', 1249584889, 5000),\n\t\t('news', 'newspic_quality', 'switch', '', '1', 'IMAGES', 1249584889, 6000);\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
    //Newsbilder-Ordner
    require_once BASEDIR . 'lib/class.mediamanager.php';
    $mm = new mediamanager();
    $mm->createdir('news');
} elseif (SETUPMODE == 'uninstall') {
    $mysql = "\n\t\tDROP TABLE `apx_news`;\n\t\tDROP TABLE `apx_news_cat`;\n\t\tDROP TABLE `apx_news_tags`;\n\t\tDROP TABLE `apx_news_sources`;\n\t";
    $queries = split_sql($mysql);
    foreach ($queries as $query) {
        $db->query($query);
    }
} elseif (SETUPMODE == 'update') {
    switch ($installed_version) {
        case 100:
            //zu 1.0.1
            $mysql = "\n\t\t\t\tALTER TABLE `apx_news` ADD `galid` INT( 11 ) UNSIGNED NOT NULL AFTER `text` ;\n\t\t\t\tINSERT INTO `apx_config` VALUES ('news', 'subcats', 'switch', '', '1', '0', '150');\n\t\t\t";
            $queries = split_sql($mysql);
            foreach ($queries as $query) {
                $db->query($query);
Beispiel #25
0
        list($precount) = $db->first("SELECT count(postid) FROM " . PRE . "_forum_posts WHERE ( threadid='" . $threadinfo['threadid'] . "' AND time<='" . $postinfo['time'] . "' )");
        $page = ceil($precount / $user->info['forum_ppp']);
        $link = str_replace('&amp;', '&', mkrellink('thread.php?id=' . $threadinfo['threadid'] . '&p=' . $page . '#p' . $postinfo['postid'], 'thread,' . $threadinfo['threadid'] . ',' . $page . urlformat($threadinfo['title']) . '.html#p' . $postinfo['postid']));
        header("HTTP/1.1 301 Moved Permanently");
        header('Location: ' . $link);
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////////////////////// TPP SETZEN
if (intval($_POST['ppp']) && $user->info['userid']) {
    $db->query("UPDATE " . PRE . "_user SET forum_ppp='" . intval($_POST['ppp']) . "' WHERE userid='" . $user->info['userid'] . "' LIMIT 1");
    $user->info['forum_ppp'] = intval($_POST['ppp']);
}
///////////////////////////////////////////////////////////////////////////////////////// THEMA ANZEIGEN
require_once BASEDIR . 'lib/class.mediamanager.php';
$mm = new mediamanager();
//Views eins hochzählen
$db->query("UPDATE " . PRE . "_forum_threads SET views=views+1 WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1");
//Seitenzahlen
list($count) = $db->first("SELECT count(postid) FROM " . PRE . "_forum_posts WHERE ( threadid='" . $threadinfo['threadid'] . "' )");
pages(mkrellink('thread.php?id=' . $threadinfo['threadid'] . iif($_REQUEST['highlight'], '&amp;highlight=' . urlencode($_REQUEST['highlight'])), 'thread,' . $threadinfo['threadid'] . ',{P}' . urlformat($threadinfo['title']) . '.html' . iif($_REQUEST['highlight'], '?highlight=' . urlencode($_REQUEST['highlight']))), $count, $user->info['forum_ppp']);
//Thema als gelesen markieren (=auf der letzten Seite gewesen und es gibt neue Beiträge)
if ($_REQUEST['p'] == ceil($count / $user->info['forum_ppp']) && $threadinfo['lastposttime'] > $lastvisit) {
    thread_isread($threadinfo['threadid']);
}
//Beiträge auslesen
$data = $db->fetch("SELECT * FROM " . PRE . "_forum_posts WHERE ( threadid='" . $threadinfo['threadid'] . "' ) ORDER BY time ASC " . getlimit($user->info['forum_ppp']));
//Anhänge auslesen
$postids = get_ids($data, 'postid');
$attinfo = array();
$attimage = array();
Beispiel #26
0
 function gallery_pics_del()
 {
     global $set, $apx, $db, $html;
     $_REQUEST['userid'] = (int) $_REQUEST['userid'];
     $_REQUEST['galid'] = (int) $_REQUEST['galid'];
     if (!$_REQUEST['galid']) {
         die('missing GALID!');
     }
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send']) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             list($galid) = $db->first("SELECT id FROM " . PRE . "_user_gallery WHERE id='" . $_REQUEST['galid'] . "' LIMIT 1");
             if (!$galid) {
                 die('access denied!');
             }
             list($picture, $thumbnail) = $db->first("SELECT picture,thumbnail FROM " . PRE . "_user_pictures WHERE id='" . $_REQUEST['id'] . "' AND galid='" . $_REQUEST['galid'] . "' LIMIT 1");
             require_once BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             if ($picture && file_exists(BASEDIR . getpath('uploads') . $picture)) {
                 $mm->deletefile($picture);
             }
             if ($thumbnail && file_exists(BASEDIR . getpath('uploads') . $thumbnail)) {
                 $mm->deletefile($thumbnail);
             }
             $db->query("DELETE FROM " . PRE . "_user_pictures WHERE id='" . $_REQUEST['id'] . "' AND galid='" . $_REQUEST['galid'] . "' LIMIT 1");
             logit('USER_GALLERYPIC_DEL', 'ID #' . $_REQUEST['id']);
             printJSReload();
         }
     } else {
         $input = array('ID' => $_REQUEST['id'], 'GALID' => $_REQUEST['galid'], 'USERID' => $_REQUEST['userid']);
         tmessageOverlay('gallerypicdel', $input);
     }
 }
Beispiel #27
0
 function del()
 {
     global $set, $db, $apx;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             infoInvalidToken();
         } else {
             list($image) = $db->first("SELECT image FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             require BASEDIR . 'lib/class.mediamanager.php';
             $mm = new mediamanager();
             $mm->deletefile($image);
             $db->query("DELETE FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
             logit('AFFILIATES_DEL', 'ID #' . $_REQUEST['id']);
             printJSRedirect(get_index('affiliates.show'));
         }
     } else {
         list($title) = $db->first("SELECT title FROM " . PRE . "_affiliates WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
         $apx->tmpl->assign('MESSAGE', $apx->lang->get('MSG_TEXT', array('TITLE' => compatible_hsc($title))));
         tmessageOverlay('del', array('ID' => $_REQUEST['id']));
     }
 }
Beispiel #28
0
                $info = getimagesize(BASEDIR . getpath('uploads') . 'user/' . $newfile);
                if ($info[0] > $set['user']['avatar_maxdim'] || $info[1] > $set['user']['avatar_maxdim'] || $info[0] == 0 || $info[1] == 0) {
                    $mm->deletefile('user/' . $newfile);
                    message($apx->lang->get('MSG_MAXDIM'), 'javascript:history.back()');
                    require 'lib/_end.php';
                }
                $db->query("UPDATE " . PRE . "_user SET avatar='" . addslashes($newfile) . "',avatar_title='" . addslashes($_POST['avatar_title']) . "' WHERE userid='" . $user->info['userid'] . "' LIMIT 1");
                if ($user->info['avatar']) {
                    $mm->deletefile('user/' . $user->info['avatar']);
                }
                message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html'));
            }
        }
    } elseif ($_POST['delav']) {
        require BASEDIR . 'lib/class.mediamanager.php';
        $mm = new mediamanager();
        $mm->deletefile('user/' . $user->info['avatar']);
        $db->query("UPDATE " . PRE . "_user SET avatar='',avatar_title='' WHERE userid='" . $user->info['userid'] . "' LIMIT 1");
        message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html'));
    } else {
        $db->query("UPDATE " . PRE . "_user SET avatar_title='" . addslashes($_POST['avatar_title']) . "' WHERE userid='" . $user->info['userid'] . "' LIMIT 1");
        message($apx->lang->get('MSG_OK'), mklink('user.php?action=avatar', 'user,avatar.html'));
    }
} else {
    if ($user->info['avatar']) {
        $apx->tmpl->assign('CURRENT_AVATAR', $user->mkavatar($user->info));
        $apx->tmpl->assign('CURRENT_TITLE', $user->mkavtitle($user->info));
    }
    $apx->tmpl->assign('MAX_DIMENSIONS', $set['user']['avatar_maxdim']);
    $apx->tmpl->assign('MAX_FILESIZE', user_getsize($set['user']['avatar_maxsize'], 0));
    $postto = mklink('user.php?action=avatar', 'user,avatar.html');
Beispiel #29
0
 function pdel()
 {
     global $set, $db, $apx;
     //Mehrere
     if (is_array($_REQUEST['multiid'])) {
         if (!checkToken()) {
             printInvalidToken();
         } else {
             $cache = array_map('intval', $_REQUEST['multiid']);
             if (!count($cache)) {
                 header("HTTP/1.1 301 Moved Permanently");
                 header('Location: ' . get_index('gallery.pshow'));
                 return;
             }
             if (count($cache)) {
                 $data = $db->fetch("SELECT galid,thumbnail,picture FROM " . PRE . "_gallery_pics WHERE ( id IN ( " . implode(',', $cache) . ") )");
                 $db->query("DELETE FROM " . PRE . "_gallery_pics WHERE ( id IN ( " . implode(',', $cache) . ") )");
                 require BASEDIR . 'lib/class.mediamanager.php';
                 $mm = new mediamanager();
                 $galid = null;
                 //Bilder löschen
                 if (count($data)) {
                     foreach ($data as $res) {
                         $galid = $res['galid'];
                         $mm->deletefile($res['thumbnail']);
                         $mm->deletefile($res['picture']);
                     }
                 }
                 //Kommentare und Bewertungen löschen
                 if ($apx->is_module('comments')) {
                     $db->query("DELETE FROM " . PRE . "_comments WHERE ( module='gallery' AND mid IN ( " . implode(',', $cache) . " ) )");
                 }
                 if ($apx->is_module('ratings')) {
                     $db->query("DELETE FROM " . PRE . "_ratings WHERE ( module='gallery' AND mid IN ( " . implode(',', $cache) . " ) )");
                 }
                 foreach ($cache as $id) {
                     logit('GALLERY_PDEL', 'ID #' . $id);
                 }
                 //Galerie-Updatetime
                 if ($galid) {
                     $this->setGalleryUpdatetime($galid);
                 }
             }
             header("HTTP/1.1 301 Moved Permanently");
             header('Location: ' . get_index('gallery.pshow'));
         }
     } else {
         $_REQUEST['id'] = (int) $_REQUEST['id'];
         $_REQUEST['gid'] = (int) $_REQUEST['gid'];
         if (!$_REQUEST['id']) {
             die('missing ID!');
         }
         if (!$_REQUEST['gid']) {
             die('missing gallery ID!');
         }
         if ($_POST['send'] == 1) {
             if (!checkToken()) {
                 printInvalidToken();
             } else {
                 $res = $db->first("SELECT galid,thumbnail,picture FROM " . PRE . "_gallery_pics WHERE ( id='" . $_REQUEST['id'] . "' AND galid='" . $_REQUEST['gid'] . "' ) LIMIT 1");
                 $db->query("DELETE FROM " . PRE . "_gallery_pics WHERE ( id='" . $_REQUEST['id'] . "' AND galid='" . $_REQUEST['gid'] . "' ) LIMIT 1");
                 //Nur löschen, wenn der Muttereintrag wirklich gelöscht wurde!
                 if ($db->affected_rows()) {
                     //Bilder löschen
                     require BASEDIR . 'lib/class.mediamanager.php';
                     $mm = new mediamanager();
                     $mm->deletefile($res['thumbnail']);
                     $mm->deletefile($res['picture']);
                     //Kommentare und Bewertungen löschen
                     if ($apx->is_module('comments')) {
                         $db->query("DELETE FROM " . PRE . "_comments WHERE ( module='gallery' AND mid='" . $_REQUEST['id'] . "' )");
                     }
                     if ($apx->is_module('ratings')) {
                         $db->query("DELETE FROM " . PRE . "_ratings WHERE ( module='gallery' AND mid='" . $_REQUEST['id'] . "' )");
                     }
                     //Preview-Bild-Zuweisung löschen (falls vorhanden)
                     $db->query("UPDATE " . PRE . "_gallery SET preview='' WHERE preview='" . addslashes($res['thumbnail']) . "'");
                     //Galerie-Updatetime
                     $this->setGalleryUpdatetime($_REQUEST['gid']);
                 }
                 logit('GALLERY_PDEL', 'ID #' . $_REQUEST['id']);
                 printJSRedirect(get_index('gallery.pshow'));
             }
         } else {
             $input['ID'] = $_REQUEST['id'];
             $input['GID'] = $_REQUEST['gid'];
             tmessageOverlay('pdel', $input);
         }
     }
 }