Пример #1
0
 if ($sub_act == "mod") {
     if (isset($delpic) && $delpic->getChecked()) {
         $filename = "";
         if (file_exists("main_pics/" . $content_picture)) {
             @unlink("main_pics/" . $content_picture);
         }
     }
 } else {
     $filename = "";
 }
 $pic = TRUE;
 //kep feltoltese
 if ($file->isUploadedFile()) {
     $filevalues = $file->getValue();
     $sdir = preg_replace('|/$|', '', 'main_pics') . '/';
     $filename = time() . preg_replace('|[^\\d\\w_\\.]|', '_', change_hunchar($filevalues['name']));
     //kep atmeretezese
     include_once 'includes/function.images.php';
     if (is_array($pic = img_resize($filevalues['tmp_name'], $sdir . $filename, 461, 272))) {
         @chmod($sdir . $filename, 0664);
         @unlink($filevalues['tmp_name']);
     }
     if (!$pic) {
         $form->setElementError('pic', $locale->get('news_error_picupload'));
     }
 }
 if ($pic) {
     if ($sub_act == "mod") {
         $query = "\n                    UPDATE iShark_Carousel\n                    SET title = '" . $title . "',\n                        text = '" . $desc . "',\n                        content_id = '" . $content_id . "',\n                        pic = '" . $filename . "'\n                    WHERE id = '" . $_REQUEST["id"] . "'\n                ";
         $mdb2->exec($query);
         if ($content_picture != "") {
Пример #2
0
 $form->addElement('hidden', 'sub_act', $sub_act);
 $form->addElement('hidden', 'parent', $parent);
 //checkbox kijeloles
 $form->addElement('checkbox', 'all', null, $locale->get('ftp_field_checkall'), 'onclick=doNow()');
 $form->addElement('submit', 'submit', $locale->get('ftp_form_submit_copy'), 'class="submit"');
 $dirlist = get_ftpdir($fdir);
 if ($form->validate()) {
     if (isset($_POST['fileChecked']) && is_array($_POST['fileChecked'])) {
         foreach ($_POST['fileChecked'] as $key => $value) {
             //$error = array();
             if (get_magic_quotes_gpc()) {
                 $file = stripslashes($value);
             } else {
                 $file = $value;
             }
             $filename = time() . preg_replace('|[^\\w\\d_\\.]|', '_', change_hunchar($file));
             if (!@copy($fdir . $file, $ddir . $filename)) {
                 //$error[] = $file;
                 //echo "Nem sikerult a kovetkezo file-t atmasolni: $file<br>";
             } else {
                 @chmod($ddir . $filename, 0664);
                 $name = $file;
                 $size = filesize($ddir . $filename);
                 $download_id = $mdb2->extended->getBeforeID('iShark_Downloads', 'download_id', TRUE, TRUE);
                 $query = "\n\t\t\t\t\t\tINSERT INTO iShark_Downloads \n\t\t\t\t\t\t(download_id, name, realname, size, type, parent, add_user_id, add_date, \n\t\t\t\t\t\tmod_user_id, mod_date, is_active) \n\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t({$download_id}, '" . $name . "', '" . $filename . "', '{$size}', 'F', '{$parent}', '" . $_SESSION['user_id'] . "', NOW(), \n\t\t\t\t\t\t'" . $_SESSION['user_id'] . "', NOW(), '1')\n\t\t\t\t\t";
                 $mdb2->exec($query);
                 @unlink($fdir . $file);
             }
         }
         $form->freeze();
         //loggolas
Пример #3
0
/**
 * menu - Visszaadja a menuspositions (menupos) id szerint 
 * a menupontokat almenuivel egyutt. 
 *
 * Amennyiben a $menupos parameter erteke 0, 
 * akkor a teljes menuszerkezetet kerdezi le.
 * Az $onlyactive paramterrel TRUE esetn 
 * csak az aktiv menupontok alszintjeit
 * olvassa be, FALSE eseten pedig azokat is, 
 * amelyek fo aga nem lett kivalasztva, magyarul 
 * a menupoziciohoz tartozo teljes fastrukturat.
 * $type vagy index vagy admin lehet, attol fuggeen, 
 * hogy melyik reszen szeretnenk a menut lekerdezni.
 * ha nem adunk meg semmit, akkor a teljes menut lekerdezi.
 *
 * @param int $menupos 
 * @param boolean $onlyactive 
 * @param int $parent 
 * @param int $level 
 * @param mixed $lang 
 * @param mixed $type
 * @param int $active - csak az aktiv menuk (1) vagy az inaktivak is (0)
 *
 * @access public
 *
 * @return void
 */
function menu($menupos, $onlyactive = TRUE, $parent = 0, $level = 1, $lang = NULL, $type = NULL, $active = 1)
{
    global $mdb2, $aktiv_menuk;
    //nyelvnel a lekerdezeshez szukseges mezo
    if ($lang == NULL) {
        $query_lang = " AND m.lang = '" . $_SESSION['site_lang'] . "'";
    } elseif ($lang == "all") {
        $query_lang = "";
    } else {
        $query_lang = " AND m.lang = '{$lang}'";
    }
    $query_pos = $menupos != '0' && $level == 1 ? "AND m.position_id='{$menupos}'" : "";
    if (isset($_SESSION['site_conttimer']) && $_SESSION['site_conttimer'] == '1') {
        $query_pos .= " AND (m.timer_start = '0000-00-00 00:00:00' OR (m.timer_start<NOW() AND m.timer_end>NOW()))";
    }
    //tipus meghatarozas
    $query_type = $type != NULL && ($type == "index" || $type == "admin") ? " AND m.type = '{$type}'" : "";
    //ativ meghatarozasa
    if ($active == 1) {
        $query_active = " AND m.is_active= 1 ";
    } else {
        $query_active = "";
    }
    $menuk = array();
    $i = 0;
    $query = "\n\t\tSELECT m.menu_id AS menu_id, m.menu_name AS menu_name, m.parent AS parent, mp.position_name AS posname, m.type AS mtype, \n\t\t\tm.lang AS mlang, m.is_active AS isact, m.is_protected AS mprot, m.position_id AS posid, mo.module_name AS moname, \n\t\t\tc.title AS ctitle, m.link AS mlink, cat.category_name AS catname, m.open_in_new_window AS mblank, m.menu_color \n\t\tFROM iShark_Menus_Positions mp, iShark_Menus m\n\t\tLEFT JOIN iShark_Modules mo ON mo.module_id = m.module_id \n\t\tLEFT JOIN iShark_Contents c ON c.content_id = m.content_id \n\t\tLEFT JOIN iShark_Category cat ON cat.category_id = m.category_id \n\t\tWHERE m.parent = '{$parent}' {$query_active} {$query_pos} AND mp.position_id = m.position_id\n\t\t\t" . $query_lang . " " . $query_type . "\n\t\tORDER BY m.position_id, m.sortorder\n\t";
    $result = $mdb2->query($query);
    while ($row = $result->fetchRow()) {
        // csoport ellenorzese, ha nem egyezik le sem fut a tobbi
        if (!empty($_SESSION['user_id'])) {
            $usid = $_SESSION['user_id'];
        } else {
            $usid = 0;
        }
        $azonos = 0;
        $query3 = "\n\t\t\tSELECT * \n\t\t\tFROM iShark_Menus_Groups \n\t\t\tWHERE menu_id = " . $row['menu_id'] . "\n\t\t";
        $result3 =& $mdb2->query($query3);
        if ($result3->numRows() > 0) {
            //lekerdezzuk az user csoportjait
            $query4 = "\n\t\t\t\tSELECT group_id \n\t\t\t\tFROM iShark_Groups_Users \n\t\t\t\tWHERE user_id = {$usid}\n\t\t\t";
            $result4 = $mdb2->query($query4);
            $azonos = 1;
            while ($row4 = $result4->fetchRow()) {
                $g_id = $row4['group_id'];
                //lekerdezzuk, hogy az adott csoporthoz tartozik-e engedely a menuhoz
                $query5 = "\n\t\t\t\t\tSELECT * \n\t\t\t\t\tFROM iShark_Menus_Groups \n\t\t\t\t\tWHERE menu_id = " . $row['menu_id'] . " AND group_id = {$g_id}\n\t\t\t\t";
                $result5 = $mdb2->query($query5);
                if ($result5->numRows() > 0 || $g_id == $_SESSION['site_sys_prefgroup']) {
                    $azonos = 0;
                }
            }
        }
        if ($azonos != 1) {
            $query2 = "\n    \t\t\tSELECT parent \n    \t\t\tFROM iShark_Menus \n    \t\t\tWHERE parent = '" . $row['menu_id'] . "'\n    \t\t";
            $result2 = $mdb2->query($query2);
            $aktiv = isset($aktiv_menuk[$row['menu_id']]);
            $almenuk = array();
            if ($aktiv || !$onlyactive) {
                $almenuk = menu($menupos, $onlyactive, $row['menu_id'], $level + 1, $lang, $type, $active);
            }
            if ($result2->numRows() > 0) {
                $menuk[$i]['is_sub'] = '1';
            }
            $hunnev = change_hunchar($row['menu_name']);
            //$hunnev = eregi_replace(" ", "", $hunnev);
            $menuk[$i]['menu_id'] = $row['menu_id'];
            $menuk[$i]['menu_name'] = $row['menu_name'];
            $menuk[$i]['menu_name_no'] = $hunnev;
            $menuk[$i]['level'] = $level;
            $menuk[$i]['posname'] = $row['posname'];
            $menuk[$i]['menu_color'] = $row['menu_color'];
            $menuk[$i]['parent'] = $row['parent'];
            $menuk[$i]['mtype'] = $row['mtype'];
            $menuk[$i]['mlang'] = $row['mlang'];
            $menuk[$i]['isact'] = $row['isact'];
            $menuk[$i]['mprot'] = $row['mprot'];
            $menuk[$i]['posid'] = $row['posid'];
            $menuk[$i]['moname'] = $row['moname'];
            $menuk[$i]['ctitle'] = $row['ctitle'];
            $menuk[$i]['mlink'] = $row['mlink'];
            $menuk[$i]['catname'] = $row['catname'];
            $menuk[$i]['mblank'] = $row['mblank'];
            if (!empty($almenuk)) {
                $menuk[$i]['element'] = $almenuk;
            }
            $i++;
        }
    }
    return $menuk;
}
Пример #4
0
     foreach ($category as $key => $id) {
         $query = "\n\t\t\t\t\t\t\tINSERT INTO iShark_Gallery_Category \n\t\t\t\t\t\t\t(gallery_id, category_id) \n\t\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t({$last_gallery_id}, {$id})\n\t\t\t\t\t\t";
         $mdb2->exec($query);
     }
 }
 if (!empty($tags)) {
     include_once $include_dir . '/function.tags.php';
     addTags($tags, 'gallery', $last_gallery_id);
 }
 //képek feltöltése
 $filename = "";
 $pic = TRUE;
 for ($i = 1; $i < $_REQUEST['pic_count']; $i++) {
     if (!empty($_FILES['file_' . $i]['tmp_name'])) {
         $gdir = preg_replace('|/$|', '', $_SESSION['site_galerydir']) . '/';
         $filename = time() . preg_replace('|[^\\d\\w_\\.]|', '_', change_hunchar($_FILES['file_' . $i]['name']));
         $tn_name = 'tn_' . $filename;
         if ($_FILES['file_' . $i]['type'] == 'video/x-msvideo' || $_FILES['file_' . $i]['type'] == 'video/mpeg' || $_FILES['file_' . $i]['type'] == 'video/x-ms-wmv') {
             move_uploaded_file($_FILES['file_' . $i]['tmp_name'], $gdir . $filename);
             @chmod($gdir . $filename, 0664);
             # @chmod($gdir.$tn_name,0664);
             // altalanos dolgok a videokrol + konvertalashoz
             $extension = "ffmpeg";
             $extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
             $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;
             // load extension
             if (!extension_loaded($extension)) {
                 dl($extension_soname);
             }
             // Set our source file
             $srcFile = $gdir . $filename;
Пример #5
0
/**
 * uj filenevet general a datum alapjan
 *
 * @param	string	file kiterjesztese
 * @param	string	a file eredeti neve
 *
 * @return	name	generalt filenev
 */
function create_filename($ext, $oldname)
{
    $date = mktime();
    $ext = strtolower($ext);
    $oldname = change_hunchar($oldname);
    $oldname = strtolower($oldname);
    $name = $date . "_" . $oldname . "." . $ext;
    return $name;
}