PonyGallery -> DatsoGallery Datso gallery 1.6** * LAST UPDATED 05.10.2008-21:34 MSK ***************************************************/ defined ( '_VALID_MOS' ) or defined ( '_JEXEC' ) or die ( 'Direct Access to this location is not allowed.' ); $tgver = "2.0.2.0011 Beta"; if (! defined ( 'DS' )) { define ( 'DS', DIRECTORY_SEPARATOR ); } $path = str_replace ( 'administrator' . DS, '', dirname ( __FILE__ ) ); //подключаем прослойку для 1.5 require_once ($path . DS . 'true.legacy.php'); require_once (TRUE_LEGACY . DS . 'connector.php'); JTConnector::connect ( TRUE_LEGACY ); require_once (TRUE_ADMIN . 'class.true.php'); require_once (TRUE_ADMIN . 'globals.true.php'); require_once (TRUE_ADMIN . 'images.true.php'); require_once (TRUE_ADMIN . 'admin.true.html.php'); require_once (TRUE_ADMIN . 'nav.php'); $option = JTInput::getParam ( $_REQUEST, 'option' ); $task = JTInput::getParam ( $_REQUEST, 'task' ); $act = JTInput::getParam ( $_REQUEST, 'act' ); //mosCommonHTML::loadOverlib(); JTLibConnect::overLibConnect (); switch ($act) { case "showcatg" : $task = "showcatg"; break; case "upload" : $task = "upload"; break; case "batchupload" : $task = "batchupload"; break; case "batchimport" : $task = "batchimport"; break; case "settings" : $task = "settings"; break; case "resetvotes" : $task = "resetvotes"; break; case "rebuild" : $task = "rebuild"; break; } switch ($task) { case "publish" : publishPicture ( $id, 1, $option ); break; case "unpublish" : publishPicture ( $id, 0, $option ); break; case 'movepic' : movePic ( $id ); break; case 'movepicres' : movePicResult ( $id ); break; case "new" : showUpload ( $option ); break; case "edit" : editPicture ( $option, $id [0] ); break; case "remove" : removePicture ( $id, $option ); break; case "save" : savePicture ( $option ); break; case "upload" : showUpload ( $option ); break; case "batchupload" : showBatchUpload ( $option ); break; case "batchimport" : showBatchImport ( $option ); break; case "resetvotes" : showVotes ( $option ); break; case "reset" : resetVotes ( $option ); break; case "rebuild" : showDGrebuild ( $option ); break; case "startdgrebuild" : startDGrebuild ( $option ); break; case 'uploadhandler' : require_once (TRUE_ADMIN . 'config.true.php'); /// $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; //// $imagetype = array (1 => 'GIF', 2 => 'JPG', 3 => 'PNG' ); $imginfo = getimagesize ( $org_screenshot ); if ($imginfo [0] = 0) { JTRedirect::_ ( TRUE_INDEX2.'&act=upload', _DG_FILENAME_BAD_UPLOAD ); exit (); } $imginfo [2] = $imagetype [$imginfo [2]]; if ($imginfo [2] != 'GIF' && $imginfo [2] != 'JPG' && $imginfo [2] != 'PNG') { JTRedirect::_ ( TRUE_INDEX2.'&act=upload', _DG_FILENAME_BAD ); exit (); } $org_screenshot_name = dgImgId ( $catid, $imginfo [2] ); if ($org_screenshot) if ($ad_orgresize) { if (strlen ( $org_screenshot_name ) > 0 and $org_screenshot_name != "none") { $img_info = getimagesize ( $org_screenshot ); if ($img_info [0] > $ad_orgwidth or $img_info [1] > $ad_orgheight) { dgImageCreate ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$org_screenshot_name", $ad_orgwidth, $ad_orgheight, $ad_thumbquality, "1" ); } else { copy ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$org_screenshot_name" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals.'/'.$catid.'/'.$org_screenshot_name, 0644); } } } if (! $ad_orgresize) { if (strlen ( $org_screenshot ) > 0 and $org_screenshot != "none") { copy ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$org_screenshot_name" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals.'/'.$catid.'/'.$org_screenshot_name, 0644); } } //средний эскиз if ($imginfo [0] > $ad_maxwidth or $imginfo [1] > $ad_maxheight) { dgImageCreate ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . "/$catid/$org_screenshot_name", $ad_maxwidth, $ad_maxheight, $ad_thumbquality, "1" ); } else { copy ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . "/$catid/$org_screenshot_name" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages.'/'.$catid.'/'.$org_screenshot_name, 0644); } //превьюшки if ($thumbcreation) dgImageCreate ( $org_screenshot, $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . "/$catid/$org_screenshot_name", $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_crsc ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . '/'.$catid.'/'.$org_screenshot_name, 0644); $db = & JTDB::getDBO (); $imgdate = mktime (); $db->setQuery ( "SELECT ordering FROM #__true WHERE catid=$catid ORDER BY ordering DESC LIMIT 1" ); $ordering1 = $db->loadResult (); $ordering = $ordering1 + 1; $db->setQuery ( "INSERT INTO #__true(id, catid, imgtitle, imgauthor, imgtext, imgdate, ordering, imgvotes, imgvotesum, published, imgfilename, imgthumbname, imgoriginalname, checked_out, owner, approved, field1, field2, field3, field4, field5, metadesc, metakey, tags) VALUES (NULL, '$catid', '$imgtitle', '$imgauthor', '$imgtext', '$imgdate', '$ordering', '0', '0', '1', '$org_screenshot_name', '$org_screenshot_name', '$org_screenshot_name', '0', '$my->id', 1, '$field1', '$field2', '$field3', '$field4', '$field5', '', '', '$tags')" ); if (! $db->query ()) { echo "\n"; exit (); } //пишем в счетчик $last_id = $db->insertid (); $db->setQuery ( "INSERT INTO #__true_count(id, imgid, count) VALUES (NULL, '$last_id', '0')" ); $db->query (); /// JTRedirect::_ ( TRUE_INDEX2.'&act=pictures' ); break; case "batchuploadhandler" : $temp_dir = 'media'; require_once (TRUE_ADMIN . "config.true.php"); /// $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; //// require_once ($mainframe->getCfg ( 'absolute_path' ) . "/administrator/includes/pcl/pclzip.lib.php"); //if ($zippack_type !== 'application/zip'){ //JTRedirect::_( "TRUE_INDEX2.'&act=pictures", "FILE IS NOT A ZIP PACKAGE" ); //} else { $zipfile = new PclZip ( $_FILES ['zippack'] ['tmp_name'] ); $ziplist = $zipfile->listContent (); $zipfile->extract ( $p_path = $mainframe->getCfg ( 'absolute_path' ) . '/' . $temp_dir ); for($i = 0; $i < sizeof ( $ziplist ); $i ++) { $origfilename = $ziplist [$i] ['filename']; $imagetype = array (1 => 'GIF', 2 => 'JPG', 3 => 'PNG' ); $imginfo = getimagesize ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename" ); if ($imginfo [0] = 0) { JTRedirect::_ ( TRUE_INDEX2.'&act=upload', _DG_FILENAME_BAD_UPLOAD ); exit (); } $imginfo [2] = $imagetype [$imginfo [2]]; $compacttitle = strtolower ( str_replace ( ' ', '', $gentitle ) ); $newfilename = dgImgId ( $catid, $imginfo [2] ); if ($ad_orgresize) { $img_info = getimagesize ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename" ); if ($img_info [0] > $ad_orgwidth || $img_info [1] > $origfilename) { dgImageCreate ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename", $ad_orgwidth, $ad_orgheight, $ad_thumbquality, "1" ); } else { copy ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . '/'.$catid.'/'.$newfilename, 0644); } } if (! $ad_orgresize) { copy ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . '/'.$catid.'/'.$newfilename, 0644); } dgImageCreate ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . "/$catid/$newfilename", $ad_maxwidth, $ad_maxheight, $ad_thumbquality, "1" ); dgImageCreate ( $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . "/$catid/$newfilename", $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_crsc ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . '/'.$catid.'/'.$newfilename, 0644); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . '/'.$catid.'/'.$newfilename, 0644); unlink ( $p_path = $mainframe->getCfg ( 'absolute_path' ) . "/$temp_dir/$origfilename" ); $db = & JTDB::getDBO (); $batchtime = mktime (); $db->setQuery ( "select ordering from #__true where catid=$catid order by ordering desc limit 1" ); $ordering1 = $db->loadResult (); $ordering = $ordering1 + 1; $db->setQuery ( "INSERT INTO #__true(id, catid, imgtitle, imgauthor, imgtext, imgdate, ordering, imgvotes, imgvotesum, published, imgfilename, imgthumbname, imgoriginalname, checked_out, owner, approved, field1, field2, field3, field4, field5, metadesc, metakey, tags) VALUES (NULL, '$catid', '$gentitle $i', '$photocred', '$gendesc', '$batchtime', '$ordering', '0', '0', '1', '$newfilename', '$newfilename', '$newfilename', '0', '$my->id', 1, '$field1', '$field2', '$field3', '$field4', '$field5', '', '', '$tags')" ); if (! $db->query ()) { echo "\n"; exit (); } //пишем в счетчик $last_id = $db->insertid (); $db->setQuery ( "INSERT INTO #__true_count(id, imgid, count) VALUES (NULL, '$last_id', '0')" ); $db->query (); } $picsadded = count ( $ziplist ); JTRedirect::_ ( TRUE_INDEX2.'&act=pictures', JText::_ ( 'TG_ADDED_IMAGES' ) . $picsadded ); //} break; case "batchimporthandler" : $dir = $mainframe->getCfg ( 'absolute_path' ) . '/media'; $filelist = array (); require_once (TRUE_ADMIN . "config.true.php"); /// $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; //// require_once ($mainframe->getCfg ( 'absolute_path' ) . "/administrator/includes/pcl/pclzip.lib.php"); if (class_exists ( "PclZip" )) { $directory_zip = opendir ( $dir ); while ( $file_name = readdir ( $directory_zip ) ) { $ext = strtolower ( substr ( $file_name, - 4 ) ); if ($ext == ".zip") { $archive = new PclZip ( $dir . "/$file_name" ); if (@$archive->extract ( PCLZIP_OPT_PATH, $dir ) == true) { unlink ( $dir . "/$file_name" ); } } } closedir ( $directory_zip ); } $compacttitle = strtolower ( str_replace ( ' ', '', $gentitle ) ); if ($directory_zip = opendir ( $dir )) { $i = 0; while ( $file = readdir ( $directory_zip ) ) { if ($file != "." && $file != ".." && (strcasecmp ( $file, "index.html" ) != 0)) { $i ++; $origfilename = $file; $imagetype = array (1 => 'GIF', 2 => 'JPG', 3 => 'PNG' ); $imginfo = getimagesize ( $dir . "/$origfilename" ); if ($imginfo [0] = 0) { JTRedirect::_ ( TRUE_INDEX2.'&act=upload', _DG_FILENAME_BAD_UPLOAD ); exit (); } $imginfo [2] = $imagetype [$imginfo [2]]; $newfilename = dgImgId ( $catid, $imginfo [2] ); if ($ad_orgresize) { $img_info = getimagesize ( $dir . "/$origfilename" ); if ($img_info [0] > $ad_orgwidth or $img_info [1] > $origfilename) { dgImageCreate ( $dir . "/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename", $ad_orgwidth, $ad_orgheight, $ad_thumbquality, "1" ); } else { copy ( $dir . "/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename" ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . '/'.$catid.'/'.$newfilename, 0644); } } if (! $ad_orgresize) { copy ( $dir . "/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . "/$catid/$newfilename" ); } dgImageCreate ( $dir . "/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . "/$catid/$newfilename", $ad_maxwidth, $ad_maxheight, $ad_thumbquality, "1" ); dgImageCreate ( $dir . "/$origfilename", $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . "/$catid/$newfilename", $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_crsc ); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . '/'.$catid.'/'.$newfilename, 0644); chmod($mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . '/'.$catid.'/'.$newfilename, 0644); unlink ( $dir . "/$origfilename" ); $db = & JTDB::getDBO (); $batchtime = mktime (); $db->setQuery ( "SELECT ordering FROM #__true WHERE catid=$catid ORDER BY ordering DESC LIMIT 1" ); $ordering1 = $db->loadResult (); $ordering = $ordering1 + 1; $db->setQuery ( "INSERT INTO #__true(id, catid, imgtitle, imgauthor, imgtext, imgdate, ordering, imgvotes, imgvotesum, published, imgfilename, imgthumbname, imgoriginalname, checked_out, owner, approved, field1, field2, field3, field4, field5, metadesc, metakey, tags) VALUES (NULL, '$catid', '$gentitle $i', '$photocred', '$gendesc', '$batchtime', '$ordering', '0', '0', '1', '$newfilename', '$newfilename', '$newfilename', '0', '$my->id', 1, '$field1', '$field2', '$field3', '$field4', '$field5', '', '', '$tags')" ); if (! $db->query ()) { echo "\n"; exit (); } //пишем в счетчик $last_id = $db->insertid (); $db->setQuery ( "INSERT INTO #__true_count(id, imgid, count) VALUES (NULL, '$last_id', '0')" ); $db->query (); } } } closedir ( $directory_zip ); JTRedirect::_ ( TRUE_INDEX2.'&act=pictures' ); break; case "settings" : showConfig ( $option ); break; case "savesettings" : saveConfig ( $option, $ad_path, $ad_protect, $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_showdetail, $ad_showrating, $ad_showcomment, $ad_comtitle, $ad_showpanel, $ad_userpannel, $ad_special, $ad_crsc, $ad_rating, $ad_lastadd, $ad_owners, $ad_lastcomment, $ad_search, $ad_showsend2friend, $ad_picincat, $ad_showwatermark, $ad_catsperpage, $ad_showdownload, $ad_downpub, $ad_perpage, $ad_sortby, $ad_toplist, $ad_js_effect, $ad_lightbox_fa, $ad_showinformer, $ad_periods, $ad_approve, $ad_pathway, $ad_powered, $ad_maxuserimage, $ad_maxfilesize, $ad_maxwidth, $ad_maxheight, $ad_category, $ad_imgstyle, $ad_ncsc, $ad_showimgtext, $ad_showfimgdate, $ad_showimgcounter, $ad_showfrating, $ad_showres, $ad_showfimgsize, $ad_showimgauthor, $ad_cp, $ad_lightbox, $ad_orgresize, $ad_orgwidth, $ad_orgheight, $ad_cat_desc, $ad_field1, $ad_field2, $ad_field3, $ad_field4, $ad_field5, $ad_mini_to_js, $ad_status1, $ad_status2, $ad_status3, $ad_status4, $ad_status5, $ad_cat_img_detail, $ad_carusel, $ad_bbhtml, $ad_toggle ); break; case "newcatg" : editCatg ( 0, $option ); break; case "editcatg" : editCatg ( $cid [0], $option, $catid ); break; case "showcatg" : viewCatg ( $option ); break; case "savecatg" : saveCatg ( $option, $task ); break; case "removecatg" : removeCatg ( $cid, $option ); break; case "publishcatg" : publishCatg ( $cid, 1, $option ); break; case "unpublishcatg" : publishCatg ( $cid, 0, $option ); break; case "approvepic" : approvePicture ( $id, 1, $option ); break; case "rejectpic" : approvePicture ( $id, 0, $option ); break; case "orderup" : orderPic ( $id [0], 1, $option ); break; case "orderdown" : orderPic ( $id [0], - 1, $option ); break; case "saveorder" : saveOrder ( $id ); break; case "cancelcatg" : cancelCatg ( $option ); break; case "orderupcatg" : orderCatg ( $cid [0], - 1, $option ); break; case "orderdowncatg" : orderCatg ( $cid [0], 1, $option ); break; case "cancel" : JTRedirect::_ ( 'index2.php?option='.$option ); break; default : showPictures ( $option ); break; } // Функция показа картинок function showPictures($option) { global $mainframe, $group; $db = & JTDB::getDBO (); $catid = $mainframe->getUserStateFromRequest ( "catid{$option}", 'catid', 0 ); $search = $mainframe->getUserStateFromRequest ( "search{$option}", 'search', '' ); $search = $db->getEscaped ( trim ( strtolower ( $search ) ) ); $sort = $mainframe->getUserStateFromRequest ( "sort{$option}", 'sort', 0 ); $sorder = $mainframe->getUserStateFromRequest ( "sorder{$option}", 'sorder', 0 ); $limit = $mainframe->getUserStateFromRequest ( 'viewlistlimit', 'limit', 10 ); $limitstart = $mainframe->getUserStateFromRequest ( "view{$option}limitstart", 'limitstart', 0 ); $where = array (); if ($catid > 0) { $where [] = "catid='$catid'"; } if ($sort == 1) { $where [] = "approved = 0"; } if ($sort == 2) { $where [] = "approved = 1"; } if ($sort == 3) { $where [] = "useruploaded = 1"; } if ($sort == 4) { $where [] = "useruploaded = 0"; } if ($sorder == 0) { $sortorder = "a.catid asc, a.ordering desc, imgdate desc, imgtitle asc"; } if ($sorder == 1) { $sortorder = "a.catid asc, a.ordering asc, imgdate desc, imgtitle asc"; } if ($search) { $where [] = "LOWER(imgtitle) LIKE '%$search%' OR lower(imgtext) LIKE '%$search%'"; $group = "GROUP BY id"; } $db->setQuery ( "SELECT count(*) FROM #__true AS a " . (count ( $where ) ? ' WHERE ' . implode ( ' AND ', $where ) : '') ); $total = $db->loadResult (); echo $db->getErrorMsg (); if ($limit > $total) { $limitstart = 0; } $where [] = 'a.catid = cc.cid'; $picincat = count ( $where ) ? ' where ' . implode ( ' and ', $where ) : ''; $db->setQuery ( "SELECT a.*, cc.name AS category, tc.count AS imgcounter, u.username AS owner FROM #__true AS a, #__true_count AS tc, #__true_catg AS cc, #__users AS u $picincat AND a.id = tc.imgid AND a.owner = u.id $group ORDER BY $sortorder limit $limitstart, $limit" ); $rows = $db->loadObjectList (); if ($db->getErrorNum ()) { echo $db->stderr (); return false; } $clist = ShowDropDownCategoryList ( $catid, 'catid', 'class="inputbox" size="1" onchange="document.adminForm.submit();"' ); $s_options [] = mosHTML::makeOption ( JText::_ ( 'TG_SHOW_ALL_PICT' ), 0 ); $s_options [] = mosHTML::makeOption ( "1", JText::_ ( 'TG_NOT_APPROVED' ) ); $s_options [] = mosHTML::makeOption ( "2", JText::_ ( 'TG_APPROVED' ) ); $s_options [] = mosHTML::makeOption ( "3", JText::_ ( 'TG_USER_UPLOAD_PIC' ) ); $s_options [] = mosHTML::makeOption ( "4", JText::_ ( 'TG_ADMIN_UPLOAD_PIC' ) ); $slist = mosHTML::selectList ( $s_options, 'sort', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $sort ); require_once ($mainframe->getCfg ( 'absolute_path' ) . "/administrator/includes/pageNavigation.php"); $pageNav = new mosPageNav ( $total, $limitstart, $limit ); HTML_true::showPictures ( $option, $rows, $clist, $slist, $search, $pageNav ); } // порядок картинок function orderPic($uid, $inc, $option) { $db = & JTDB::getDBO (); $db->setQuery ( "SELECT catid FROM #__true WHERE id=$uid" ); $piccatid = $db->loadResult (); $db->setQuery ( "SELECT ordering, id FROM #__true WHERE id=$uid" ); $result = $db->query (); $id1 = mysql_result ( $result, 0, 'id' ); $ordering1 = mysql_result ( $result, 0, 'ordering' ); if ($inc == 1) { $db->setQuery ( "SELECT ordering, id FROM #__true WHERE catid=$piccatid and ordering > $ordering1 ORDER BY ordering LIMIT 1" ); } else { $db->setQuery ( "SELECT ordering, id FROM #__true WHERE catid=$piccatid and ordering < $ordering1 ORDER BY ordering DESC LIMIT 1" ); } $result = $db->query (); $ordering2 = mysql_result ( $result, 0, 'ordering' ); $id2 = mysql_result ( $result, 0, 'id' ); $db->setQuery ( "UPDATE #__true SET ordering=$ordering1 WHERE id=$id2" ); $result = $db->query (); $db->setQuery ( "UPDATE #__true SET ordering=$ordering2 WHERE id=$id1" ); $result = $db->query (); JTRedirect::_ ( TRUE_INDEX2 ); } // Функция сохранения порядка картинок function saveOrder(&$cid) { $db = & JTDB::getDBO (); $total = count ( $cid ); $order = josGetArrayInts ( 'order' ); for($i = 0; $i < $total; $i ++) { $query = "UPDATE #__true SET ordering = " . ( int ) $order [$i] . " WHERE id = " . ( int ) $cid [$i]; $db->setQuery ( $query ); if (! $db->query ()) { echo "\n"; exit (); } $row = new mostrue ( $db ); $row->load ( $cid [$i] ); $row->updateOrder ( ' ' ); } JTRedirect::_ ( TRUE_INDEX2, JText::_ ( 'TG_ORDERING_OK' ) ); } //Функция удаления картинок function removePicture($cid, $option) { global $mainframe, $ad_path; require_once (TRUE_ADMIN . "config.true.php"); $db = & JTDB::getDBO (); if (! is_array ( $cid ) || count ( $cid ) < 1) { echo "\n"; exit (); } if (count ( $cid )) { for($i = 0; $i < count ( $cid ); $i ++) { $db->setQuery ( "SELECT id, imgfilename, imgthumbname, imgoriginalname, catid FROM #__true WHERE id = $cid[$i]" ); if ($db->query ()) { $rows = $db->loadObjectList (); $row = $rows [0]; $catid = $row->catid; $ad_paththumbs = $ad_path.'/thumbs/'; $ad_pathimages = $ad_path.'/pictures/'; $ad_pathoriginals = $ad_path.'/originals/'; if (removeFile ( $row->imgfilename, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages, $catid )) { if (removeFile ( $row->imgthumbname, $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs, $catid )) { if (! removeFile ( $row->imgoriginalname, $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals, $catid )) { } } else { //die(JText::_('TG_NOT_DELETE_THMB_IMAGE_FILE); } } else { //die(JText::_('TG_FFFFFFF); } } else { echo "\n"; } } $cids = implode ( ',', $cid ); $db->setQuery ( "DELETE from #__true where id IN ($cids)" ); if (! $db->query ()) { echo "\n"; } $db->setQuery ( "DELETE from #__true_count where imgid IN ($cids)" ); if (! $db->query ()) { echo "\n"; } } $txtmsg = 'good'; JTRedirect::_ ( "index2.php?option=$option", $ad_path ); } //Функция публикации картинок function publishPicture($cid = null, $publish = 1, $option) { $db = & JTDB::getDBO (); if (! is_array ( $cid ) || count ( $cid ) < 1) { $action = $publish ? 'publish' : 'unpublish'; echo "\n"; exit (); } $cids = implode ( ',', $cid ); $db->setQuery ( "UPDATE #__true SET published='$publish' WHERE id IN ($cids)" ); if (! $db->query ()) { echo "\n"; exit (); } JTRedirect::_ ( "index2.php?option=$option" ); } // Утверждение картинок function approvePicture($cid = null, $approve = 1, $option) { $db = & JTDB::getDBO (); if (! is_array ( $cid ) || count ( $cid ) < 1) { $action = $approve ? 'approve' : 'reject'; echo "\n"; exit (); } $cids = implode ( ',', $cid ); $db->setQuery ( "UPDATE #__true SET approved='$approve' WHERE id IN ($cids)" ); if (! $db->query ()) { echo "\n"; exit (); } JTRedirect::_ ( "index2.php?option=$option" ); } //Редактирование картинок function editPicture($option, $uid) { global $mainframe, $ad_thumbwidth, $ad_thumbheight, $ad_imgstyle, $ad_path; $db = & JTDB::getDBO (); $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; $abspath = $mainframe->getCfg( 'absolute_path' ); require_once (TRUE_ADMIN . "config.true.php"); $row = new mostrue ( $db ); $row->load ( $uid ); $clist = ShowDropDownCategoryListImg ( $row->catid, "catid", ' size="1"' ); $imgFiles = mosReadDirectory ( "$abspath.$ad_pathimages" ); $images = array (mosHTML::makeOption ( '', JText::_ ( 'TG_SELECT_MED_PIC' ) ) ); foreach ( $imgFiles as $file ) { if (eregi ( "jpeg|gif|jpg|png", $file )) { $images [] = mosHTML::makeOption ( $file ); } } $imagelist = mosHTML::selectList ( $images, 'imgfilename', "class=\"inputbox\" size=\"1\"" . " onchange=\"javascript:if (document.forms[0].imgfilename.options[selectedIndex].value!='') {document.imagelib3.src='..$ad_pathimages/' + document.forms[0].imgfilename.options[selectedIndex].value} else {document.imagelib3.src='../images/M_images/blank.png'}\"", 'value', 'text', $row->imgfilename ); $thuFiles = mosReadDirectory ( "$abspath.$ad_paththumbs" ); $thumbs = array (mosHTML::makeOption ( '', JText::_ ( 'TG_SELECT_THUMB_PIC' ) ) ); foreach ( $thuFiles as $tfile ) { if (eregi ( "jpeg|gif|jpg|png", $tfile )) { $thumbs [] = mosHTML::makeOption ( $tfile ); } } $thumblist = mosHTML::selectList ( $thumbs, 'imgthumbname', "class=\"inputbox\" size=\"1\"" . " onchange=\"javascript:if (document.forms[0].imgthumbname.options[selectedIndex].value!='') {document.imagelib2.src='..$ad_paththumbs/' + document.forms[0].imgthumbname.options[selectedIndex].value} else {document.imagelib2.src='../images/M_images/blank.png'}\"", 'value', 'text', $row->imgthumbname ); $orgFiles = mosReadDirectory ( "$abspath.$ad_pathoriginals" ); $originals = array (mosHTML::makeOption ( '', JText::_ ( 'TG_SELECT_ORG_PIC' ) ) ); foreach ( $orgFiles as $ofile ) { if (eregi ( "jpeg|gif|jpg|png", $ofile )) { $originals [] = mosHTML::makeOption ( $ofile ); } } $originallist = mosHTML::selectList ( $originals, 'imgoriginalname', "class=\"inputbox\" size=\"1\"" . " onchange=\"javascript:if (document.forms[0].imgoriginalname.options[selectedIndex].value!='') {document.imagelib.src='..$ad_pathoriginals/' + document.forms[0].imgoriginalname.options[selectedIndex].value} else {document.imagelib.src='../images/M_images/blank.png'}\"", 'value', 'text', $row->imgoriginalname ); if (! $uid) $row->published = 0; HTML_true::editPicture ( $option, $row, $clist, $originallist, $imagelist, $thumblist, $ad_pathoriginals, $ad_pathimages, $ad_paththumbs, $ad_path, $ad_thumbwidth, $ad_thumbheight, $ad_imgstyle ); } //Сохранение картинок function savePicture($option) { global $catid, $mainframe; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); $row = new mostrue ( $db ); if (! $row->bind ( $_POST )) { echo "\n"; exit (); } $row->imgdate = mktime (); $db->setQuery ( "SELECT ordering FROM #__true WHERE catid=$catid ORDER BY ordering DESC LIMIT 1" ); $ordering1 = $db->loadResult (); $row->ordering = $ordering1 + 1; if (! $row->store ()) { echo "\n"; exit (); } //перемещаем физически файлы $oldcatid = $_POST ['oldcatid']; $paththumbs = $ad_path.'/thumbs'; $pathimages = $ad_path.'/pictures'; $pathoriginals = $ad_path.'/originals'; $orgimg1 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$pathoriginals.'/' . $oldcatid . "/" . $row->imgthumbname; $newimg1 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$pathoriginals.'/' . $catid . "/" . $row->imgthumbname; $orgimg2 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$pathimages.'/' . $oldcatid . "/" . $row->imgthumbname; $newimg2 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$pathimages.'/' . $catid . "/" . $row->imgthumbname; $orgimg3 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$ad_paththumbs.'/' . $oldcatid . "/" . $row->imgthumbname; $newimg3 = $mainframe->getCfg ( 'absolute_path' ) . '/'.$ad_paththumbs.'/'. $catid."/" . $row->imgthumbname; rename ( $orgimg1, $newimg1 ); rename ( $orgimg2, $newimg2 ); rename ( $orgimg3, $newimg3 ); // $msg = 'good'; JTRedirect::_ ( 'index2.php?option=' . $option . '&mosmsg=' . $msg ); } //Функция показа нормальной загрузки function showUpload($option) { global $my, $mainframe; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); $clist = ShowDropDownCategoryList ( 0, 'catid', ' class="inputbox" size="1" style="width:228;"' ); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_NORMAL_UPLOAD_TITLE' ) . "
\n"; $imgauthor = $imgtext = $imgtitle = ''; global $mainframe; ?> "; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_UPLOAD_NEW_PIC' ) . "
\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "\n\n"; // if ($ad_field1) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field2) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field3) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field4) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field3) { echo "\n"; echo "\n"; } else {} // echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "
" . JText::_ ( 'TG_PICTURE' ) . ": " . mosToolTip ( JText::_ ( 'TG_MAX_FILESIZE_1' ) . ": " . ini_get ( 'upload_max_filesize' ) . "" . JText::_ ( 'TG_MAX_FILESIZE_2' ) ) . ""; echo "
" . JText::_ ( 'TG_TITLE' ) . ":\n"; echo "
" . JText::_ ( 'TG_CATEGORY' ) . ":\n"; echo $clist . '' . mosToolTip ( JText::_ ( 'TG_ALLOWED_CAT' ) ); echo "
" . JText::_ ( 'TG_FIELD1' ) . ":\n"; ?>
" . JText::_ ( 'TG_FIELD2' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD3' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD4' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD5' ) . ":\n"; echo "
" . JText::_ ( 'TG_DESCRIPTION' ) . ":\n " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_AUTHOR_OWNER' ) . ": " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_TAGS' ) . ":\n"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "
\n"; } // Показ пакетной загрузки function showBatchUpload($option) { global $mainframe; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); ?> \n"; echo "function BatchFormCheck(theForm) {\n"; echo "if (theForm.zippack.value == '') {\n"; echo "alert('" . JText::_ ( 'TG_ZIP_NOT_SELECTED' ) . "');\n"; echo "return false;\n"; echo "} else if (theForm.catid.value == '0') {\n"; echo "alert('" . JText::_ ( 'TG_ONE_ERR' ) . "');\n"; echo "return false;\n"; echo "} else if (theForm.gentitle.value == '') {\n"; echo "alert('" . JText::_ ( 'TG_TWO_ERR' ) . "');\n"; echo "return false;\n"; echo "} else {dgLoading();}}\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_BATCH_UPLOAD_TITLE' ) . "
\n"; echo '
'; echo ""; echo "\n"; echo "
" . JText::_ ( 'TG_UPLOAD_ZIP' ) . "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field2) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field3) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field4) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field5) { echo ""; echo "\n"; echo "\n"; } else {} // echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "
" . JText::_ ( 'TG_IMAGE_PACK_FIL' ) . "" . mosToolTip ( JText::_ ( 'TG_MAX_FILESIZE_1' ) . ": " . ini_get ( 'upload_max_filesize' ) . "" . JText::_ ( 'TG_MAX_FILESIZE_2' ) ); echo "
" . JText::_ ( 'TG_GENERIC_TITLE' ) . ": " . mosToolTip ( JText::_ ( 'TG_GENERIC_TITLE_BU_I' ) ) . "
" . JText::_ ( 'TG_CAT_PHOTO_ASS' ) . ":"; $catid = $mainframe->getUserStateFromRequest ( "catid{$option}", 'catid', 0 ); $categories [] = mosHTML::makeOption ( '0', JText::_ ( 'TG_SELECT_CAT' ) ); $db->setQuery ( "SELECT id AS value, title AS text FROM #__categories" . " WHERE section='com_true' ORDER BY ordering" ); $categories = array_merge ( $categories, $db->loadObjectList () ); $clist = mosHTML::selectList ( $categories, 'catid', 'class="inputbox" size="1" style="width:228;"', 'value', 'text', $catid ); $clist = ShowDropDownCategoryList ( 0, 'catid', ' class="inputbox" size="1" style="width:228;"' ); echo $clist . '' . mosToolTip ( JText::_ ( 'TG_ALLOWED_CAT' ) ); // if ($ad_field1) { echo "
" . JText::_ ( 'TG_FIELD1' ) . ":\n"; ?>
" . JText::_ ( 'TG_FIELD2' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD3' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD4' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD5' ) . ":\n"; echo "
" . JText::_ ( 'TG_GENERIC_DESC' ) . ": " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_AUTHOR' ) . ": " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_TAGS' ) . ":\n"; echo "
 "; echo "
"; echo "
"; } // Показ пакетного импорта function showBatchImport($option) { global $mainframe; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); echo "\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_INSTALL_BI' ) . "
\n"; echo "
" . JText::_ ( 'TG_IMPORT_ZIP' ) . "
\n"; echo "
"; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // if ($ad_field1) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field2) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field3) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field4) { echo ""; echo "\n"; echo "\n"; } else {} if ($ad_field5) { echo ""; echo "\n"; echo "\n"; } else {} // echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "
" . JText::_ ( 'TG_GENERIC_TITLE' ) . ": " . mosToolTip ( JText::_ ( 'TG_GENERIC_TITLE_BI_I' ) ) . "
" . JText::_ ( 'TG_CAT_PHOTO_ASS' ) . ":"; $catid = $mainframe->getUserStateFromRequest ( "catid{$option}", 'catid', 0 ); $categories [] = mosHTML::makeOption ( '0', JText::_ ( 'TG_SELECT_CAT' ) ); $db->setQuery ( "SELECT id AS value, title AS text FROM #__categories" . "\nWHERE section='com_true' ORDER BY ordering" ); $categories = array_merge ( $categories, $db->loadObjectList () ); $clist = mosHTML::selectList ( $categories, 'catid', 'class="inputbox" size="1" style="width:228;"', 'value', 'text', $catid ); $clist = ShowDropDownCategoryList ( 0, 'catid', ' class="inputbox" size="1" style="width:228;"' ); echo $clist . '' . mosToolTip ( JText::_ ( 'TG_ALLOWED_CAT' ) ) . "
" . JText::_ ( 'TG_FIELD1' ) . ":\n"; ?>
" . JText::_ ( 'TG_FIELD2' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD3' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD4' ) . ":\n"; echo "
" . JText::_ ( 'TG_FIELD5' ) . ":\n"; echo "
" . JText::_ ( 'TG_GENERIC_DESC' ) . ": " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_AUTHOR' ) . ": " . mosToolTip ( JText::_ ( 'TG_OPT' ) ) . "
" . JText::_ ( 'TG_TAGS' ) . ":\n"; echo "

"; } // Настройки function showConfig($option) { global $mainframe, $tgver; $tabs = new mosTabs(0); require (TRUE_ADMIN . "config.true.php"); $arr_ad_category = explode ( ",", $ad_category ); $clist = testCat ( $arr_ad_category, "ad_category[]", $extras = "multiple size=\"6\"", $levellimit = "4" ); echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_CONFIG_true' ) . "
\n"; $yesno [] = mosHTML::makeOption ( '0', JText::_ ( 'TG_NO' ) ); $yesno [] = mosHTML::makeOption ( '1', JText::_ ( 'TG_YES' ) ); if ($ad_protect) { dgProtect ( $ad_path."/originals" ); } else { dgUnprotect ( $ad_path."/originals" ); } if (file_exists ( $mainframe->getCfg ( 'absolute_path' ) . $ad_path."/originals" . "/.htaccess" )) { $img = ""; $img .= ""; } else { $img = ""; $img .= ""; } $tabs->startPane ( "settings" ); //Вкладка "Директории"JText::_('TG_CNF_HOST $tabs->startTab ( JText::_ ( 'TG_DIRS' ), "page2" ); echo "\n"; echo "\n"; echo "\n"; echo "'; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; /*echo "\n"; echo "\n"; echo "\n"; echo "\n";*/ echo "
" . JText::_ ( 'TG_DIRS2' ) . "
" . JText::_ ( 'TG_PARENT_CAT' ) . ":\n"; echo '" . mosToolTip ( JText::_ ( 'TG_PARENT_CAT' ) ) . " 
" . JText::_ ( 'TG_ORG_PIC_PATH' ) . ":". $mainframe->getCfg ( 'live_site' ).$ad_path."/originals\n"; writDir ( $ad_path."/originals" ); echo "" . mosToolTip ( JText::_ ( 'TG_ORG_PIC_PATH_I' ) ) . " 
" . JText::_ ( 'TG_MED_PIC_PATH' ) . ":".$mainframe->getCfg ( 'live_site' ).$ad_path."/pictures\n"; writDir ( $ad_path."/pictures" ); echo "" . mosToolTip ( JText::_ ( 'TG_MED_PIC_PATH_I' ) ) . " 
" . JText::_ ( 'TG_THUMB_PIC_PATH' ) . ":".$mainframe->getCfg ( 'live_site' ).$ad_path."/thumbs\n"; writDir ( $ad_path."/thumbs" ); echo "" . mosToolTip ( JText::_ ( 'TG_THUMB_PIC_PATH_I' ) ) . " 
" . JText::_ ( 'TG_PROTECT_ORIGINALS' ) . ":\n"; $yn_ad_protect = mosHTML::selectList ( $yesno, 'ad_protect', 'class=\"inputbox\"', 'value', 'text', $ad_protect ); echo $yn_ad_protect; echo "" . $img . "" . mosToolTip ( JText::_ ( 'TG_PROTECT_ORIGINALS_I' ) ) . "
\n"; $tabs->endTab (); //Вкладка "Обработка" $tabs->startTab ( JText::_ ( 'TG_PROCESSING' ), "page3" ); echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_PROCESSING2' ) . "
" . JText::_ ( 'TG_THUMBNAIL_CREATOR' ) . ":"; if (function_exists ( "gd_info" )) { $info = gd_info (); $version = $info ["GD Version"]; if (strpos ( $version, '2.' ) !== false) { $thumbcreator = 'gd2'; } else { $thumbcreator = 'gd1'; } } else { echo "" . JText::_ ( 'TG_GDIMAGE_NOT' ) . ""; } if ($thumbcreator) echo "GD Version: " . $version . "" . mosToolTip ( JText::_ ( 'TG_CHOOS_IMA_PEOCES_TH' ) ) . " 
" . JText::_ ( 'TG_ALLOW_ORGRESIZE' ) . ":\n"; $yn_ad_orgresize = mosHTML::selectList ( $yesno, 'ad_orgresize', 'class=\"inputbox\"', 'value', 'text', $ad_orgresize ); echo $yn_ad_orgresize; echo "" . mosToolTip ( JText::_ ( 'TG_ALLOW_ORGRESIZE_I' ) ) . "
" . JText::_ ( 'TG_ORGWIDTH' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_ORGWIDTH_I' ) ) . " 
" . JText::_ ( 'TG_ORGHIGHT' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_ORGHIGHT_I' ) ) . " 
" . JText::_ ( 'TG_MAX_WIDTH' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_MAX_WIDTH_IMAGE' ) ) . " 
" . JText::_ ( 'TG_MAX_HIGHT' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_MAX_HIGHT_IMAGE' ) ) . " 
" . JText::_ ( 'TG_THUMBNAIL_WIDTH' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_WIDTH_THUMBNAIL_CREAT' ) ) . " 
" . JText::_ ( 'TG_THUMBNAIL_HEIGHT' ) . ":\n"; echo " px" . mosToolTip ( JText::_ ( 'TG_HEIGHT_THUMBNAIL_CREAT' ) ) . " 
" . JText::_ ( 'TG_SKETCHING_METHOD' ) . ""; $crsc [] = mosHTML::makeOption ( '0', JText::_ ( 'TG_CROP_METHOD' ) ); $crsc [] = mosHTML::makeOption ( '1', JText::_ ( 'TG_SCALE_METHOD' ) ); $cs_ad_crsc = mosHTML::selectList ( $crsc, 'ad_crsc', 'class="inputbox"', 'value', 'text', $ad_crsc ); echo $cs_ad_crsc; echo "" . mosToolTip ( JText::_ ( 'TG_SKETCHING_METHOD_I' ) ) . "
" . JText::_ ( 'TG_THUMBNAIL_QUALIT' ) . ":\n"; echo " %" . mosToolTip ( JText::_ ( 'TG_THUMBNAIL_QUALIT_I' ) ) . " 
\n"; $tabs->endTab (); //Вкладка "Вид" $tabs->startTab ( JText::_ ( 'TG_VIEW' ), "page4" ); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //5 дополнительных полей описания изображения echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; ///////// echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //добавляем показ авторов echo "\n"; echo "\n"; echo "\n"; /// echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; ///Показывать ли описание категории в разделе мини эскизов echo "\n"; echo "\n"; echo "\n"; /// ///Показывать подробности изображения в списке мини эскизов echo "\n"; echo "\n"; echo "\n"; /// echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n
" . JText::_ ( 'TG_VIEW_DETAILS' ) . "
" . JText::_ ( 'TG_SHOW_DETAILS' ) . ""; $yn_ad_showdetail = mosHTML::selectList ( $yesno, 'ad_showdetail', 'class="inputbox"', 'value', 'text', $ad_showdetail ); echo $yn_ad_showdetail; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_DETAILS_I' ) ) . "
" . JText::_ ( 'TG_DESCRIPTION' ) . ":\n"; $yn_ad_showimgtext = mosHTML::selectList ( $yesno, 'ad_showimgtext', 'class=\"inputbox\"', 'value', 'text', $ad_showimgtext ); echo $yn_ad_showimgtext; echo "" . mosToolTip ( JText::_ ( 'TG_DESCRIPTION_I' ) ) . "
" . JText::_ ( 'TG_DATE_ADD' ) . ":\n"; $yn_ad_showfimgdate = mosHTML::selectList ( $yesno, 'ad_showfimgdate', 'class=\"inputbox\"', 'value', 'text', $ad_showfimgdate ); echo $yn_ad_showfimgdate; echo "" . mosToolTip ( JText::_ ( 'TG_DATE_ADD_I' ) ) . "
" . JText::_ ( 'TG_HITS' ) . ":\n"; $yn_ad_showimgcounter = mosHTML::selectList ( $yesno, 'ad_showimgcounter', 'class=\"inputbox\"', 'value', 'text', $ad_showimgcounter ); echo $yn_ad_showimgcounter; echo "" . mosToolTip ( JText::_ ( 'TG_HITS_I' ) ) . "
" . JText::_ ( 'TG_RATING' ) . ":\n"; $yn_ad_showfrating = mosHTML::selectList ( $yesno, 'ad_showfrating', 'class=\"inputbox\"', 'value', 'text', $ad_showfrating ); echo $yn_ad_showfrating; echo "" . mosToolTip ( JText::_ ( 'TG_RATING_I' ) ) . "
" . JText::_ ( 'TG_SIZE' ) . ":\n"; $yn_ad_showres = mosHTML::selectList ( $yesno, 'ad_showres', 'class=\"inputbox\"', 'value', 'text', $ad_showres ); echo $yn_ad_showres; echo "" . mosToolTip ( JText::_ ( 'TG_SIZE_I' ) ) . "
" . JText::_ ( 'TG_FILESIZE' ) . ":\n"; $yn_ad_showfimgsize = mosHTML::selectList ( $yesno, 'ad_showfimgsize', 'class=\"inputbox\"', 'value', 'text', $ad_showfimgsize ); echo $yn_ad_showfimgsize; echo "" . mosToolTip ( JText::_ ( 'TG_FILESIZE_I' ) ) . "
" . JText::_ ( 'TG_AUTHOR_OWNER' ) . ":\n"; $yn_ad_showimgauthor = mosHTML::selectList ( $yesno, 'ad_showimgauthor', 'class=\"inputbox\"', 'value', 'text', $ad_showimgauthor ); echo $yn_ad_showimgauthor; echo "" . mosToolTip ( JText::_ ( 'TG_AUTHOR_OWNER_I' ) ) . "
" . JText::_ ( 'TG_FIELD1' ) . ":\n"; $yn_ad_field1 = mosHTML::selectList ( $yesno, 'ad_field1', 'class=\"inputbox\"', 'value', 'text', $ad_field1 ); echo $yn_ad_field1; echo "" . mosToolTip ( JText::_ ( 'TG_FIELD1_1' ) ) . "
" . JText::_ ( 'TG_FIELD2' ) . ":\n"; $yn_ad_field2 = mosHTML::selectList ( $yesno, 'ad_field2', 'class=\"inputbox\"', 'value', 'text', $ad_field2 ); echo $yn_ad_field2; echo "" . mosToolTip ( JText::_ ( 'TG_FIELD1_2' ) ) . "
" . JText::_ ( 'TG_FIELD3' ) . ":\n"; $yn_ad_field3 = mosHTML::selectList ( $yesno, 'ad_field3', 'class=\"inputbox\"', 'value', 'text', $ad_field3 ); echo $yn_ad_field3; echo "" . mosToolTip ( JText::_ ( 'TG_FIELD1_3' ) ) . "
" . JText::_ ( 'TG_FIELD4' ) . ":\n"; $yn_ad_field4 = mosHTML::selectList ( $yesno, 'ad_field4', 'class=\"inputbox\"', 'value', 'text', $ad_field4 ); echo $yn_ad_field4; echo "" . mosToolTip ( JText::_ ( 'TG_FIELD1_4' ) ) . "
" . JText::_ ( 'TG_FIELD5' ) . ":\n"; $yn_ad_field5 = mosHTML::selectList ( $yesno, 'ad_field5', 'class=\"inputbox\"', 'value', 'text', $ad_field5 ); echo $yn_ad_field5; echo "" . mosToolTip ( JText::_ ( 'TG_FIELD1_5' ) ) . "
" . JText::_ ( 'TG_VIEW_NAV_PANEL' ) . "
" . JText::_ ( 'TG_SHOW_PANEL' ) . ""; $yn_ad_showpanel = mosHTML::selectList ( $yesno, 'ad_showpanel', 'class="inputbox"', 'value', 'text', $ad_showpanel ); echo $yn_ad_showpanel; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_PANEL_I' ) ) . "
" . JText::_ ( 'TG_SHOW_USERPANEL' ) . ""; $yn_ad_userpannel = mosHTML::selectList ( $yesno, 'ad_userpannel', 'class="inputbox"', 'value', 'text', $ad_userpannel ); echo $yn_ad_userpannel; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_USERPANEL_I' ) ) . "
" . JText::_ ( 'TG_SHOW_SPECIALPANEL' ) . ""; $yn_ad_special = mosHTML::selectList ( $yesno, 'ad_special', 'class="inputbox"', 'value', 'text', $ad_special ); echo $yn_ad_special; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_SPECIALPANEL_I' ) ) . "
" . JText::_ ( 'TG_SHOW_RATINGPANEL' ) . ""; $yn_ad_rating = mosHTML::selectList ( $yesno, 'ad_rating', 'class="inputbox"', 'value', 'text', $ad_rating ); echo $yn_ad_rating; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_RATINGPANEL_I' ) ) . "
" . JText::_ ( 'TG_SHOW_NEWPANEL' ) . ""; $yn_ad_lastadd = mosHTML::selectList ( $yesno, 'ad_lastadd', 'class="inputbox"', 'value', 'text', $ad_lastadd ); echo $yn_ad_lastadd; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_NEWPANEL_I' ) ) . "
" . JText::_ ( 'TG_SHOW_OWNERS' ) . ""; $yn_ad_owners = mosHTML::selectList ( $yesno, 'ad_owners', 'class="inputbox"', 'value', 'text', $ad_owners ); echo $yn_ad_owners; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_OWNERS_I' ) ) . "
" . JText::_ ( 'TG_SHOW_LASTCOMMENTPANEL' ) . ""; $yn_ad_lastcomment = mosHTML::selectList ( $yesno, 'ad_lastcomment', 'class="inputbox"', 'value', 'text', $ad_lastcomment ); echo $yn_ad_lastcomment; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_LASTCOMMENTPANEL_I' ) ) . "
" . JText::_ ( 'TG_VIEW_OPTIONAL' ) . "
" . JText::_ ( 'TG_SHOW_TITLE_COM' ) . ":"; $yn_ad_comtitle = mosHTML::selectList ( $yesno, 'ad_comtitle', 'class="inputbox"', 'value', 'text', $ad_comtitle ); echo $yn_ad_comtitle; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_TITLE_COM_I' ) ) . "
" . JText::_ ( 'TG_CAT_DESC' ) . ""; $yn_ad_cat_desc = mosHTML::selectList ( $yesno, 'ad_cat_desc', 'class="inputbox"', 'value', 'text', $ad_cat_desc ); echo $yn_ad_cat_desc; echo "" . mosToolTip ( JText::_ ( 'TG_CAT_DESC_I' ) ) . "
" . JText::_ ( 'TG_CAT_IMG_DETAILS' ) . ""; $yn_ad_cat_img_detail = mosHTML::selectList ( $yesno, 'ad_cat_img_detail', 'class="inputbox"', 'value', 'text', $ad_cat_img_detail ); echo $yn_ad_cat_img_detail; echo "" . mosToolTip ( JText::_ ( 'TG_CAT_IMG_DETAILS_I' ) ) . "
" . JText::_ ( 'TG_SHOW_POWERED' ) . ""; $yn_ad_powered = mosHTML::selectList ( $yesno, 'ad_powered', 'class="inputbox"', 'value', 'text', $ad_powered ); echo $yn_ad_powered; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_POWERED_I' ) ) . "
" . JText::_ ( 'TG_SHOW_PICINCAT' ) . ""; $yn_ad_picincat = mosHTML::selectList ( $yesno, 'ad_picincat', 'class="inputbox"', 'value', 'text', $ad_picincat ); echo $yn_ad_picincat; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_PICINCAT_I' ) ) . "
" . JText::_ ( 'TG_COLUMNS_IN_SUBCAT' ) . "\n"; echo "" . mosToolTip ( JText::_ ( 'TG_COLUMNS_IN_SUBCAT_I' ) ) . "
" . JText::_ ( 'TG_COLUMNS_IN_SUBCAT_TH' ) . "\n"; echo "" . mosToolTip ( JText::_ ( 'TG_COLUMNS_IN_SUBCAT_TH_I' ) ) . "
" . JText::_ ( 'TG_CATS_PERPAGE' ) . "\n"; echo "" . mosToolTip ( JText::_ ( 'TG_CATS_PERPAGE_I' ) ) . "
" . JText::_ ( 'TG_DISPLAY_PIC' ) . "\n"; echo "" . mosToolTip ( JText::_ ( 'TG_DISPLAY_PIC_I' ) ) . "
" . JText::_ ( 'TG_SORTBY' ) . ":"; $sortby [] = mosHTML::makeOption ( 'ASC', JText::_ ( 'TG_SORTBYASC' ) ); $sortby [] = mosHTML::makeOption ( 'DESC', JText::_ ( 'TG_SORTBYDESC' ) ); $sb_ad_sortby = mosHTML::selectList ( $sortby, 'ad_sortby', 'class="inputbox"', 'value', 'text', $ad_sortby ); echo $sb_ad_sortby; echo "" . mosToolTip ( JText::_ ( 'TG_SORTBY_I' ) ) . "
" . JText::_ ( 'TG_DISPLAY_TOP' ) . "\n"; echo "" . mosToolTip ( JText::_ ( 'TG_DISPLAY_TOP_I' ) ) . "
\n"; $tabs->endTab (); //Вкладка "Загрузка" $tabs->startTab ( JText::_ ( 'TG_UPBYUSER' ), "page5" ); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //5 статусов юзверей по кол-ву загруженных изображений echo "\n"; echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; //////////////////////// echo "
" . JText::_ ( 'TG_USER_UPLOAD_SETTING' ) . "
" . JText::_ ( 'TG_ADMIN_APPRO_NEEDED' ) . ":"; $yn_ad_approve = mosHTML::selectList ( $yesno, 'ad_approve', 'class="inputbox"', 'value', 'text', $ad_approve ); echo $yn_ad_approve; echo "" . mosToolTip ( JText::_ ( 'TG_USER_UPLOAD_NEDD_APPROVAL' ) ) . "
" . JText::_ ( 'TG_MAX_NR_IMAGES' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_MAX_ALLOWED_PICS' ) ) . "
" . JText::_ ( 'TG_MAX_SIZE_IMAGE' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_MAX_ALLOWED_FILESIZE' ) ) . "
" . JText::_ ( 'TG_ALLOWED_CAT' ) . ":" . $clist . "" . mosToolTip ( JText::_ ( 'TG_ALLOWED_CAT_I' ) ) . "
" . JText::_ ( 'TG_USER_STATUS' ) . "
" . JText::_ ( 'TG_STATUS1' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_STATUS_I' ) ) . "
" . JText::_ ( 'TG_STATUS2' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_STATUS_I' ) ) . "
" . JText::_ ( 'TG_STATUS3' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_STATUS_I' ) ) . "
" . JText::_ ( 'TG_STATUS4' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_STATUS_I' ) ) . "
" . JText::_ ( 'TG_STATUS5' ) . ":\n"; echo "" . mosToolTip ( JText::_ ( 'TG_STATUS_I' ) ) . "
"; $tabs->endTab (); //Вкладка "Рейтинг" $tabs->startTab ( JText::_ ( 'TG_RATE' ), "page6" ); echo "\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_RATE_SETTING' ) . "
" . JText::_ ( 'TG_ALLOW_RATING' ) . ":"; $yn_ad_showrating = mosHTML::selectList ( $yesno, 'ad_showrating', 'class="inputbox"', 'value', 'text', $ad_showrating ); echo $yn_ad_showrating; echo "" . mosToolTip ( JText::_ ( 'TG_ALLOW_RATING_I' ) ) . "
"; $tabs->endTab (); //Вкладка "Комментарии" - вырезана ибо нефиг //Вкладка "Опции" $tabs->startTab ( JText::_ ( 'TG_OPTION' ), "page7" ); echo "\n"; echo "\n"; echo "\n"; echo "\n"; /*добавляем выбор типа JS эффекта # thickbox == 1 # highslide == 2 */ echo "\n"; echo "\n"; echo "\n"; //// echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; /// Развертка из мини эскиза echo "\n"; echo "\n"; echo "\n"; //Карусель echo "\n"; echo "\n"; echo "\n"; //Сворачинание echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // Коды для форума и сайта echo "\n"; echo "\n"; echo "\n"; // echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_OPTION2' ) . "
" . JText::_ ( 'TG_ALLOW_COMM' ) . ":"; $yn_ad_showcomment = mosHTML::selectList ( $yesno, 'ad_showcomment', 'class="inputbox"', 'value', 'text', $ad_showcomment ); echo $yn_ad_showcomment; $comments = $mainframe->getCfg ( 'absolute_path' ) . '/components/com_jcomments/jcomments.php'; if (file_exists ( $comments )) { echo JText::_ ( 'TG_ALLOW_COMM_JC' ); } else { echo JText::_ ( 'TG_ALLOW_COMM_NO_JC' ); } echo "" . mosToolTip ( JText::_ ( 'TG_ALLOW_COMM_I' ) ) . "
" . JText::_ ( 'TG_JS_TYPE' ) . ":"; $js_effect [] = mosHTML::makeOption ( '1', JText::_ ( 'TG_JS_SL' ) ); $js_effect [] = mosHTML::makeOption ( '2', JText::_ ( 'TG_JS_HJ' ) ); $sb_ad_js_effect = mosHTML::selectList ( $js_effect, 'ad_js_effect', 'class="inputbox"', 'value', 'text', $ad_js_effect ); echo $sb_ad_js_effect; echo "" . mosToolTip ( JText::_ ( 'TG_JS_TYPE_I' ) ) . "
" . JText::_ ( 'TG_USE_LIGHTBOX' ) . ":"; $yn_ad_lightbox = mosHTML::selectList ( $yesno, 'ad_lightbox', 'class="inputbox"', 'value', 'text', $ad_lightbox ); echo $yn_ad_lightbox; echo "" . mosToolTip ( JText::_ ( 'TG_USE_LIGHTBOX_I' ) ) . "
" . JText::_ ( 'TG_LIGHTBOX_FOR_ALL' ) . ":"; $yn_ad_lightbox_fa = mosHTML::selectList ( $yesno, 'ad_lightbox_fa', 'class="inputbox"', 'value', 'text', $ad_lightbox_fa ); echo $yn_ad_lightbox_fa; echo "" . mosToolTip ( JText::_ ( 'TG_LIGHTBOX_FOR_ALL_I' ) ) . "
" . JText::_ ( 'TG_MINI_TO_JS' ) . ":"; $yn_mini_to_js = mosHTML::selectList ( $yesno, 'ad_mini_to_js', 'class="inputbox"', 'value', 'text', $ad_mini_to_js ); echo $yn_mini_to_js; echo "" . mosToolTip ( JText::_ ( 'TG_MINI_TO_JS_I' ) ) . "
" . JText::_ ( 'TG_CARUSEL' ) . ":"; $yn_ad_carusel = mosHTML::selectList ( $yesno, 'ad_carusel', 'class="inputbox"', 'value', 'text', $ad_carusel ); echo $yn_ad_carusel; echo "" . mosToolTip ( JText::_ ( 'TG_CARUSEL_I' ) ) . "
" . JText::_ ( 'TG_TOGGLE' ) . ":"; $yn_ad_toggle = mosHTML::selectList ( $yesno, 'ad_toggle', 'class="inputbox"', 'value', 'text', $ad_toggle ); echo $yn_ad_toggle; echo "" . mosToolTip ( JText::_ ( 'TG_TOGGLE_1' ) ) . "
" . JText::_ ( 'TG_USE_WATERMARK' ) . ""; $yn_ad_showwatermark = mosHTML::selectList ( $yesno, 'ad_showwatermark', 'class="inputbox"', 'value', 'text', $ad_showwatermark ); echo $yn_ad_showwatermark; echo "" . mosToolTip ( JText::_ ( 'TG_USE_WATERMARK_I' ) ) . "
" . JText::_ ( 'TG_SHOW_SEARCH' ) . ":"; $yn_ad_search = mosHTML::selectList ( $yesno, 'ad_search', 'class="inputbox"', 'value', 'text', $ad_search ); echo $yn_ad_search; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_SEARCH_I' ) ) . "
" . JText::_ ( 'TG_USE_PATHWAY' ) . ""; $yn_ad_pathway = mosHTML::selectList ( $yesno, 'ad_pathway', 'class="inputbox"', 'value', 'text', $ad_pathway ); echo $yn_ad_pathway; echo "" . mosToolTip ( JText::_ ( 'TG_USE_PATHWAY_I' ) ) . "
" . JText::_ ( 'TG_SHOW_SEND2FRIEND' ) . ""; $yn_ad_showsend2friend = mosHTML::selectList ( $yesno, 'ad_showsend2friend', 'class="inputbox"', 'value', 'text', $ad_showsend2friend ); echo $yn_ad_showsend2friend; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_SEND2FRIEND_I' ) ) . "
" . JText::_ ( 'TG_SHOW_INFORMER' ) . ":"; $yn_ad_showinformer = mosHTML::selectList ( $yesno, 'ad_showinformer', 'class="inputbox"', 'value', 'text', $ad_showinformer ); echo $yn_ad_showinformer; echo "" . mosToolTip ( JText::_ ( 'TG_SHOW_INFORMER_I' ) ) . "
" . JText::_ ( 'TG_BB_HTML' ) . ":"; $yn_ad_bbhtml = mosHTML::selectList ( $yesno, 'ad_bbhtml', 'class="inputbox"', 'value', 'text', $ad_bbhtml ); echo $yn_ad_bbhtml; echo "" . mosToolTip ( JText::_ ( 'TG_BB_HTML_I' ) ) . "
" . JText::_ ( 'TG_LIST_OF_PERIODS' ) . ":"; $periods [] = mosHTML::makeOption ( '1', JText::_ ( 'TG_PS_SECOND' ) ); $periods [] = mosHTML::makeOption ( '60', JText::_ ( 'TG_PS_MINUTE' ) ); $periods [] = mosHTML::makeOption ( '3600', JText::_ ( 'TG_PS_HOUR' ) ); $periods [] = mosHTML::makeOption ( '86400', JText::_ ( 'TG_PS_DAY' ) ); $periods [] = mosHTML::makeOption ( '604800', JText::_ ( 'TG_PS_WEEK' ) ); $periods [] = mosHTML::makeOption ( '2629744', JText::_ ( 'TG_PS_MONTH' ) ); $periods [] = mosHTML::makeOption ( '31556926', JText::_ ( 'TG_PS_YEAR' ) ); $ps_ad_periods = mosHTML::selectList ( $periods, 'ad_periods', 'class="inputbox"', 'value', 'text', $ad_periods ); echo $ps_ad_periods; echo "" . mosToolTip ( JText::_ ( 'TG_LIST_OF_PERIODS_I' ) ) . "
\n"; $tabs->endTab (); //Вкладка "Язык" $tabs->startTab ( JText::_ ( 'TG_LANG' ), "page8" ); echo showLanguage ( $option ); $tabs->endTab (); //Вкладка "Версия" $tabs->startTab ( JText::_ ( 'TG_VERSION' ), "page8" ); echo "\n"; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_VERSION_INFO1' ) . "
\n"; echo "\"\""; echo "

" . JText::_ ( 'TG_VERSION_INFO' ) . " " . $tgver . "

"; echo ""; echo "
"; $tabs->endTab (); //Вкладка "Настройки хостинга" $tabs->startTab ( JText::_ ( 'TG_CNF_HOST' ), "page1" ); echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_CNF_HOST' ) . "
\n"; echo '
' . JText::_ ( 'TG_PER_MEM' ) . ' = ' . ini_get ( 'memory_limit' ) . '
'; echo '
' . JText::_ ( 'TG_PER_MEM_OBJ' ) . '
'; echo '
' . JText::_ ( 'TG_PER_MSI' ) . ' = ' . ini_get ( 'upload_max_filesize' ) . '
'; echo '
' . JText::_ ( 'TG_PER_MSI_OBJ' ) . '
'; echo '
' . JText::_ ( 'TG_PER_MTI' ) . ' = ' . ini_get ( 'max_execution_time' ) . '
'; echo '
' . JText::_ ( 'TG_PER_MTI_OBJ' ) . '
'; if (ini_get ( 'max_execution_time' ) < 60) { echo '' . JText::_ ( 'TG_PER_MTI_UP' ) . '
'; } echo "
\n"; $tabs->endTab (); $tabs->endPane (); echo ""; echo "\n"; echo "
\n"; } // Функция созоанения натсроек function saveConfig($option, $ad_path, $ad_protect, $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_showdetail, $ad_showrating, $ad_showcomment, $ad_comtitle, $ad_showpanel, $ad_userpannel, $ad_special, $ad_crsc, $ad_rating, $ad_lastadd, $ad_owners, $ad_lastcomment, $ad_search, $ad_showsend2friend, $ad_picincat, $ad_showwatermark, $ad_catsperpage, $ad_showdownload, $ad_downpub, $ad_perpage, $ad_sortby, $ad_toplist, $ad_js_effect, $ad_lightbox_fa, $ad_showinformer, $ad_periods, $ad_approve, $ad_pathway, $ad_powered, $ad_maxuserimage, $ad_maxfilesize, $ad_maxwidth, $ad_maxheight, $ad_category, $ad_imgstyle, $ad_ncsc, $ad_showimgtext, $ad_showfimgdate, $ad_showimgcounter, $ad_showfrating, $ad_showres, $ad_showfimgsize, $ad_showimgauthor, $ad_cp, $ad_lightbox, $ad_orgresize, $ad_orgwidth, $ad_orgheight, $ad_cat_desc, $ad_field1, $ad_field2, $ad_field3, $ad_field4, $ad_field5, $ad_mini_to_js, $ad_status1, $ad_status2, $ad_status3, $ad_status4, $ad_status5, $ad_cat_img_detail, $ad_carusel, $ad_bbhtml, $ad_toggle) { global $tgver, $mainframe; $configfile = "components/com_true/config.true.php"; @chmod ( $configfile, 0766 ); $permission = is_writable ( $configfile ); if (! $permission) { $mosmsg = JText::_ ( 'TG_CONFIG_NO_WRITE' ); JTRedirect::_ ( "index2.php?option=$option&act=config", $mosmsg ); break; } $ad_category2 = implode ( ",", $ad_category ); //временный параметр для LANG $ad_lang = ''; $config = ""; if ($fp = fopen ( "$configfile", "w" )) { fputs ( $fp, $config, strlen ( $config ) ); fclose ( $fp ); } //пишем конфиг в базу $db = & JTDB::getDBO (); //переименовываем корневую директорию, если админ изменил название $db->setQuery ("SELECT ad_path FROM #__true_config "); $old_ad_path = $db->loadResult(); if ($old_ad_path != $ad_path) { rename($mainframe->getCfg('absolute_path').$old_ad_path, $mainframe->getCfg('absolute_path').$ad_path); } else {} $db->setQuery ( "UPDATE #__true_config SET ad_path = '$ad_path', ad_protect = '$ad_protect', ad_orgresize = '$ad_orgresize', ad_orgwidth = '$ad_orgwidth', ad_orgheight = '$ad_orgheight', ad_thumbwidth = '$ad_thumbwidth', ad_thumbheight = '$ad_thumbheight', ad_crsc = '$ad_crsc', ad_thumbquality = '$ad_thumbquality', ad_showdetail = '$ad_showdetail', ad_showrating = '$ad_showrating', ad_showcomment = '$ad_showcomment', ad_pathway = '$ad_pathway', ad_showpanel = '$ad_showpanel', ad_userpannel = '$ad_userpannel', ad_special = '$ad_special', ad_rating = '$ad_rating', ad_lastadd = '$ad_lastadd', ad_owners = '$ad_owners', ad_lastcomment = '$ad_lastcomment', ad_showinformer = '$ad_showinformer', ad_periods = '$ad_periods', ad_search = '$ad_search', ad_comtitle = '$ad_comtitle', ad_showsend2friend = '$ad_showsend2friend', ad_picincat = '$ad_picincat', ad_powered = '$ad_powered', ad_showwatermark = '$ad_showwatermark', ad_showdownload = '$ad_showdownload', ad_downpub = '$ad_downpub', ad_perpage = '$ad_perpage', ad_catsperpage = '$ad_catsperpage', ad_sortby = '$ad_sortby', ad_toplist = '$ad_toplist', ad_approve = '$ad_approve', ad_maxuserimage = '$ad_maxuserimage', ad_maxfilesize = '$ad_maxfilesize', ad_maxwidth = '$ad_maxwidth', ad_maxheight = '$ad_maxheight', ad_category = '$ad_category2', ad_imgstyle = '$ad_imgstyle', ad_ncsc = '$ad_ncsc', ad_showimgtext = '$ad_showimgtext', ad_showfimgdate = '$ad_showfimgdate', ad_showimgcounter = '$ad_showimgcounter', ad_showfrating = '$ad_showfrating', ad_showres = '$ad_showres', ad_showfimgsize = '$ad_showfimgsize', ad_showimgauthor = '$ad_showimgauthor', ad_cp = '$ad_cp', ad_lightbox = '$ad_lightbox', ad_lightbox_fa = '$ad_lightbox_fa', ad_js_effect = '$ad_js_effect', ad_cat_desc = '$ad_cat_desc', ad_field1 = '$ad_field1', ad_field2 = '$ad_field2', ad_field3 = '$ad_field3', ad_field4 = '$ad_field4', ad_field5 = '$ad_field5', ad_mini_to_js = '$ad_mini_to_js', ad_status1 = '$ad_status1', ad_status2 = '$ad_status2', ad_status3 = '$ad_status3', ad_status4 = '$ad_status4', ad_status5 = '$ad_status5', ad_cat_img_detail = '$ad_cat_img_detail', ad_carusel = '$ad_carusel', ad_bbhtml = '$ad_bbhtml', ad_toggle = '$ad_toggle' " ); $db->query (); JTRedirect::_ ( "index2.php?option=$option&task=settings", JText::_ ( 'TG_SETT_SAVED') ); } //Показ категорий function viewCatg($option) { global $mainframe; $db = & JTDB::getDBO (); // узнаем "стартовую" категорию для показа $catid = $mainframe->getUserStateFromRequest ( "rcid{$option}", 'rcid', 0 ); $limit = $mainframe->getUserStateFromRequest ( "viewlistlimit", 'limit', 10 ); $limitstart = $mainframe->getUserStateFromRequest ( "view{$option}limitstart", 'limitstart', 0 ); $search = $mainframe->getUserStateFromRequest ( "search{$option}", 'search', '' ); $search = $db->getEscaped ( trim ( strtolower ( $search ) ) ); $where = ""; if ($search) { $where = " WHERE a.name LIKE '%$search%' OR a.description LIKE '%$search%'"; } // прописываем ее в условие для отбора if ($catid > 0) $where ? $where .= "cid='$catid'" : $where = " WHERE cid=$catid"; $query = "SELECT count(*) FROM #__true_catg AS a $where "; $db->setQuery ( $query ); $total = $db->loadResult (); $lists ['cats'] = ShowDropDownCategoryList ( $catid, 'rcid', 'class="inputbox" size="1" onchange="document.adminForm.submit();"' ); require_once ($mainframe->getCfg ( 'absolute_path' ) . "/administrator/includes/pageNavigation.php"); $pageNav = new mosPageNav ( $total, $limitstart, $limit ); HTML_true::showCatOverview ( $option, $total, $catid, $lists, $pageNav, $search ); } //Редактирование категорий function editCatg($uid, $option) { global $my; $db = & JTDB::getDBO (); //$cat = $uid; $row = new mosCatgs ( $db ); $row->load ( $uid ); $orders = mosGetOrderingList ( "SELECT ordering AS value, name AS text FROM #__true_catg ORDER BY ordering DESC" ); $orderlist = mosHTML::selectList ( $orders, 'ordering', 'class="inputbox"', 'value', 'text', intval ( $row->ordering ) ); if ($uid == 0) { $row->menulink = 0; } $menulink = mosHTML::yesnoRadioList('menulink','class="inputbox"', $row->menulink); if ($uid == 0) { $row->published = 1; } $publist = mosHTML::yesnoRadioList ( 'published', 'class="inputbox"', $row->published ); $db->setQuery ( "SELECT id AS value, name AS text FROM #__groups ORDER BY id" ); $groups = $db->loadObjectList (); $glist = mosHTML::selectList ( $groups, 'access', 'class="inputbox"', 'value', 'text', intval ( $row->access ) ); //листинг типов меню $query = "SELECT params FROM #__modules WHERE module = 'mod_mainmenu'"; $db->setQuery( $query ); $menus = $db->loadObjectList(); $total = count( $menus ); $menuselect = array(); for( $i = 0; $i < $total; $i++ ) { $params = mosParseParams( $menus[$i]->params ); $menuselect[$i]->value = $params->menutype; $menuselect[$i]->text = $params->menutype; } // sort array of objects SortArrayObjects( $menuselect, 'text', 1 ); $mgroups = mosHTML::selectList( $menuselect, 'menuselecttype', 'class="inputbox" size="1" ', 'value', 'text', $row->menuselecttype ); //список родительских\дочерних категорий $Lists ["catgs"] = ShowDropDownCategoryList ( $row->parent, "parent", "dests" ); HTML_true::editCatg ( $row, $publist, $menulink, $option, $glist, $Lists, $mgroups, $orderlist ); } //Сохранений категорий function saveCatg($option, $task) { global $my, $mainframe; $db = & JTDB::getDBO (); $row = new mosCatgs ( $db ); if (! $row->bind ( $_POST )) { echo "\n"; exit (); } mosMakeHtmlSafe ( $row->name ); if ($row->parent == $row->cid) { JTRedirect::_ ( "index2.php?option=$option&task=showcatg", JText::_ ( 'TG_SUBCAT_SELECT_ERROR' ) ); } if (! $row->check ()) { echo "\n"; exit (); } if (! $row->store ()) { echo "\n"; exit (); } $row->checkin (); $row->updateOrder ( "" ); //создаем дополнительные подкаталоги с именем ID категории require_once (TRUE_ADMIN . "config.true.php"); $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; @mkdir ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_pathoriginals . '/' . $row->cid, 0755 ); if (! chmod ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_pathoriginals . '/' . $row->cid, 0755 ) ) { echo "\n"; exit (); } @mkdir ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_pathimages . '/' . $row->cid, 0755 ); if (! chmod ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_pathimages . '/' . $row->cid, 0755 ) ) { echo "\n"; exit (); } @mkdir ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_paththumbs . '/' . $row->cid, 0755 ); if (! chmod ( $mainframe->getCfg ( 'absolute_path' ) . '/' . $ad_paththumbs . '/' . $row->cid, 0755 )) { echo "\n"; exit (); } // $menu_link_item = 'index.php?option=com_true&func=viewcategory&catid='.$row->cid.''; $db->setQuery("SELECT link FROM #__menu WHERE link ='$menu_link_item'"); $current_menu_link = $db->loadResult(); if ($current_menu_link!=$menu_link_item && $row->menulink == '1') { $db->setQuery("INSERT INTO #__menu (id, menutype, name, link, type, published, parent, componentid, sublevel, ordering, checked_out, checked_out_time, pollid, browserNav, access, utaccess, params ) VALUES (NULL, '$row->menuselecttype', '$row->name', '$menu_link_item', 'components', '1', '0', '45', '0', '', '0', '0000-00-00 00:00:00', '0', '0', '0', '0', '' )"); $db->query (); } else if ($current_menu_link==$menu_link_item && $row->menulink == '0') { $db->setQuery("DELETE FROM #__menu WHERE link ='$menu_link_item'"); $db->query (); $db->setQuery("UPDATE #__true_catg SET menuselect = '' WHERE cid = '$row->cid'"); $db->query (); } else {} JTRedirect::_ ( "index2.php?option=$option&task=showcatg" ); } //Публикация категорий function publishCatg($cid = null, $publish = 1, $option) { global $my; $db = & JTDB::getDBO (); if (! is_array ( $cid ) || count ( $cid ) < 1) { $action = $publish ? 'publish' : 'unpublish'; echo "\n"; exit (); } $cids = implode ( ',', $cid ); $db->setQuery ( "UPDATE #__true_catg SET published='$publish' WHERE cid IN ($cids)" ); if (! $db->query ()) { echo "\n"; exit (); } if (count ( $cid ) == 1) { $row = new mosCatgs ( $db ); $row->checkin ( $cid [0] ); } JTRedirect::_ ( "index2.php?option=$option&task=showcatg" ); } //Удаление категорий function removeCatg($cid, $option) { global $mainframe; $db = & JTDB::getDBO (); if (count ( $cid )) { $cids = implode ( ',', $cid ); foreach ( $cid as $cc ) { $db->setQuery ( "DELETE FROM #__true_catg WHERE cid=$cc" ); $db->query (); echo $db->getErrorMsg (); //удаляем наш подкаталог require_once (TRUE_ADMIN . "config.true.php"); $ad_paththumbs = $ad_path.'/thumbs/'; $ad_pathimages = $ad_path.'/pictures/'; $ad_pathoriginals = $ad_path.'/originals/'; $rmcat1 = $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . $cc; $rmcat2 = $mainframe->getCfg ( 'absolute_path' ) . $ad_pathimages . $cc; $rmcat3 = $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . $cc; rmdir ( $rmcat1 ); rmdir ( $rmcat2 ); rmdir ( $rmcat3 ); } } JTRedirect::_ ( "index2.php?option=$option&task=showcatg", $error ); } //Отмена категорий (не ясно) function cancelCatg($option) { $db = & JTDB::getDBO (); $row = new mosCatgs ( $db ); $row->bind ( $_POST ); $row->checkin (); JTRedirect::_ ( TRUE_INDEX2 . '&task=showcatg' ); } //Путь к катеогрии (бред какой-то) // boston тут приложился function ShowCategoryPath($cat) { global $gid, $tgurl; $db = & JTDB::getDBO (); $cat = intval ( $cat ); if ($cat < 1) return; $parent = 100; while ( $parent ) { $db->setQuery ( "SELECT * FROM #__true_catg WHERE cid='$cat'" ); $row = $db->loadAssocList (); //print_r($row); $parent = $row [0] ['parent']; $name = $row [0] ['name']; if (empty ( $path )) { $path = $name; } else { $path = $name . ' » ' . $path; } $cat = $parent; } return $path . " "; } //Выпадающий список катеогрий function ShowDropDownCategoryList($cat, $cname = "cat", $extra = null, $flag = 0) { $db = & JTDB::getDBO (); //$cat = '10'; $category = ""; if ($flag == 1) $add_category = true; $query = "SELECT *, cid AS id FROM #__true_catg ORDER BY ordering"; $db->setQuery ( $query ); $items = $db->loadObjectList (); $children = array (); foreach ( $items as $v ) { $pt = $v->parent; $list = @$children [$pt] ? $children [$pt] : array (); array_push ( $list, $v ); $children [$pt] = $list; } $array = mosTreeRecurse ( 0, '', array (), $children ); $options [] = mosHTML::makeOption ( 0, JText::_ ( 'TG_SUBCAT_SELECT' ) ); foreach ( $array as $item ) { $options [] = mosHTML::makeOption ( $item->id, $item->treename ); } $category = mosHTML::selectList ( $options, $cname, 'class="inputbox"', 'value', 'text', $cat ); return $category; } //Порядок категорий function orderCatg($uid, $inc, $option) { $db = & JTDB::getDBO (); $fp = new mosCatgs ( $db ); $fp->load ( $uid ); $fp->move ( $inc ); JTRedirect::_ ( TRUE_INDEX2 . '&task=showcatg' ); } //Показ голосов function showVotes($option) { echo ""; echo "\n"; echo "
" . JText::_ ( 'TG_RESET_VOTES_TITLE' ) . "
"; echo "\n"; echo '

' . JText::_ ( 'TG_RESET_VOTES_DESCRIPTION' ) . '


     
'; } //Удаление голосов function resetVotes($option) { $db = & JTDB::getDBO (); $db->setQuery ( "DELETE FROM #__true_votes" ); if (! $db->query ()) { echo "\n"; } $db->setQuery ( "UPDATE #__true SET imgvotes='0', imgvotesum='0'" ); if (! $db->query ()) { echo "\n"; } JTRedirect::_ ( TRUE_INDEX2 . '&act=pictures', JText::_ ( 'TG_RESET_FINISHED' ) ); } //Тестовая категория function testCat($cat, $cname, $extras = "", $levellimit = "4") { $db = & JTDB::getDBO (); $db->setQuery ( "SELECT cid AS id, parent, name FROM #__true_catg ORDER BY ordering" ); $items = $db->loadObjectList (); $children = array (); foreach ( $items as $v ) { $pt = $v->parent; $list = @$children [$pt] ? $children [$pt] : array (); array_push ( $list, $v ); $children [$pt] = $list; } $list = catTreeRecurse ( 0, '', array (), $children ); $items = array (); $items [] = mosHTML::makeOption ( '', ' ' ); foreach ( $list as $item ) { $items [] = mosHTML::makeOption ( $item->id, $item->treename ); } asort ( $items ); $parlist = selectList2 ( $items, $cname, 'class="inputbox" ' . $extras, 'value', 'text', $cat ); return $parlist; } //Что-то с деревом категорий (рекурсия что ли?) function catTreeRecurse($id, $indent = "   ", $list, &$children, $maxlevel = 9999, $level = 0, $seperator = " » ") { if (@$children [$id] && $level <= $maxlevel) { foreach ( $children [$id] as $v ) { $id = $v->id; $txt = $v->name; $pt = $v->parent; $list [$id] = $v; $list [$id]->treename = "$indent$txt"; $list [$id]->children = count ( @$children [$id] ); $list = catTreeRecurse ( $id, "$indent$txt$seperator", $list, $children, $maxlevel, $level + 1 ); } } return $list; } //Показ пересоздания мини-эскизов function showDGrebuild($option) { global $mainframe; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); /// $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; //// $db->setQuery ( "SELECT catid, imgthumbname FROM #__true ORDER BY ordering LIMIT 1" ); $rows = $db->LoadObjectList (); $list = $rows[0]; echo $list->catid; $thumb = $list->imgthumbname; $imgprev = $mainframe->getCfg ( 'live_site' ) . $ad_paththumbs . '/' . $list->catid . '/' . $list->imgthumbname; echo "\n"; echo "\n"; echo "
" . JText::_ ( 'TG_THUMB_REBUILD_TITLE' ) . "
"; echo "\n"; echo ""; echo "\n"; echo "
" . JText::_ ( 'TG_THUMB_REBUILD_INFO' ) . "
"; echo "
"; echo "
\n"; echo "
" . JText::_ ( 'TG_THUMB_REBUILD_TITLE' ) . "\n"; echo JText::_ ( 'TG_THUMB_REBUILD_DESCRIPTION' ); echo "" . JText::_ ( 'TG_THUMBS_IS' ) . "  "; $clist = ShowDropDownCategoryList ( $list->catid, 'catid', 'class="inputbox" size="1"' ); echo is_writable ( $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . "/" . $list->catid . "/" . $thumb ) ? ' ' . JText::_ ( 'TG_WRITEABLE' ) . '

' . $clist . '' : ' ' . JText::_ ( 'TG_UNWRITEABLE' ) . '

'; echo ""; echo ""; echo "
"; } //Функция пересоздания мини-эскизов function startDGrebuild($option) { global $mainframe, $catid; $db = & JTDB::getDBO (); require_once (TRUE_ADMIN . "config.true.php"); /// $ad_paththumbs = $ad_path.'/thumbs'; $ad_pathimages = $ad_path.'/pictures'; $ad_pathoriginals = $ad_path.'/originals'; require_once (TRUE_ADMIN . "config.true.php"); require_once (TRUE_ADMIN . "images.true.php"); $orgls = $mainframe->getCfg ( 'absolute_path' ) . $ad_pathoriginals . '/' . $catid . '/'; $thmbs = $mainframe->getCfg ( 'absolute_path' ) . $ad_paththumbs . '/' . $catid . '/'; $db->setQuery ( "SELECT * FROM #__true WHERE catid=$catid" ); $pics = $db->loadObjectList (); if ($pics [0] != "") { foreach ( $pics as $pic ) { dgImageCreate ( $orgls . $pic->imgoriginalname, $thmbs . $pic->imgthumbname, $ad_thumbwidth, $ad_thumbheight, $ad_thumbquality, $ad_crsc ); } } JTRedirect::_ ( "index2.php?option=$option&act=rebuild", JText::_ ( 'TG_THUMB_REBUILD_END' ) ); } //Что-то выбирает, какой-то список function selectList2(&$arr, $tag_name, $tag_attribs, $key, $text, $selected) { reset ( $arr ); $html = "\n\n"; return $html; } //Получает то ли число ссылок то нумерованные списки (снова фигня) function GetNumberOfLinks($cat) { $db = & JTDB::getDBO (); $queue [] = intval ( $cat ); while ( list ( $key, $cat ) = each ( $queue ) ) { $db->setQuery ( "SELECT cid FROM #__true_catg WHERE parent=$cat AND published=1" ); $result = $db->query (); $total = mysql_num_rows ( $result ); $j = 0; while ( $j < $total ) { $val = mysql_fetch_row ( $result ); $queue [] = $val [0]; $j ++; } } reset ( $queue ); $query = "SELECT count(*) FROM #__true WHERE ( 0!=0"; while ( list ( $key, $cat ) = each ( $queue ) ) { $query .= " or catid = $cat"; } $query = $query . " ) AND published=1 AND approved = 1"; $db->setQuery ( $query ); $result = $db->query (); $val = mysql_fetch_row ( $result ); return $val [0]; } //Показ редактирования языкового файла function showLanguage($option) { global $language; $current_lang = $language->getLanguage (); if (file_exists ( TRUE_BASE . 'languages' . DS . $language->getLanguage () . '.ini' )) { $file = TRUE_BASE . 'languages' . DS . $language->getLanguage () . '.ini'; } else { $file = TRUE_BASE . 'languages' . DS . 'english.ini'; } echo showSource ( $file, $option ); } //Сохранений языкового файла function saveLanguage($option) { global $language; $file = JTInput::getParam ( $_POST, 'file', '' ); $filecontent = JTInput::getParam ( $_POST, 'filecontent', '', 4 ); if (! $filecontent) { JTRedirect::_ ( "index2.php?option=$option&act=settings", JText::_ ( 'TG_LANG_EMPTY' ) ); } if (file_exists ( TRUE_BASE . 'languages' . DS . $language->getLanguage () . '.ini' )) { $file = TRUE_BASE . 'languages' . DS . $language->getLanguage () . '.ini'; } else { $file = TRUE_BASE . 'languages' . DS . 'english.ini'; } $enable_write = JTInput::getParam ( $_POST, 'enable_write', 0 ); $oldperms = fileperms ( $file ); if ($enable_write) @chmod ( $file, $oldperms | 0222 ); clearstatcache (); if (is_writable ( $file ) == false) { JTRedirect::_ ( "index2.php?option=$option&act=settings", JText::_ ( 'TG_LANG_IS_NOT_WRITEABLE' ) ); } if ($fp = fopen ( $file, "w" )) { fputs ( $fp, stripslashes ( $filecontent ) ); fclose ( $fp ); if ($enable_write) { @chmod ( $file, $oldperms ); } else { if (mosGetParam ( $_POST, 'disable_write', 0 )) @chmod ( $file, $oldperms & 0755 ); } JTRedirect::_ ( "index2.php?option=$option&act=settings", JText::_ ( 'TG_LANG_SAVED' ) ); } else { if ($enable_write) @chmod ( $file, $oldperms ); JTRedirect::_ ( "index2.php?option=$option", JText::_ ( 'TG_LANG_IS_NOT_WRITEABLE' ) ); } } //Редактирование содержимого языка function showSource($file, $option) { global $language; $curent_lang = $language->getLanguage (); $f = fopen ( $file, "r" ); $content = fread ( $f, filesize ( $file ) ); $content = htmlspecialchars ( $content ); echo "
\n"; echo "\n"; /*echo "\n";*/ echo ""; echo "
"; echo JText::_ ( 'TG_LANG_FILE' ) . $curent_lang . ".ini " . JText::_ ( 'TG_LANG_IS' ) . " :"; echo is_writable ( $file ) ? ' ' . JText::_ ( 'TG_WRITEABLE' ) . '' : ' ' . JText::_ ( 'TG_UNWRITEABLE' ) . ''; echo "
"; /*if (mosIsChmodable ( $file )) { if (is_writable ( $file )) { echo "\n"; echo ""; } else { echo "\n"; echo ""; } }*/ echo "
\n"; echo "\n"; echo ""; echo "
\n"; } //Перемещение картинок function movePic($id) { global $mainframe; $db = & JTDB::getDBO (); $catid = $mainframe->getUserStateFromRequest ( "catid", 'catid', 0 ); $ids = implode ( ',', $id ); $db->setQuery ( "SELECT * FROM #__true WHERE id IN ( " . $ids . " ) ORDER BY id" ); $rows = $db->loadObjectList (); $options = array (mosHTML::makeOption ( '1', '_true_SELECT_CAT' ) ); $lists ['catgs'] = ShowDropDownCategoryList ( $catid, 'catid', 'class="inputbox" size="1" ' ); HTML_true::movePic ( $id, $lists, $rows ); } //Результат перемещения картинок function movePicResult($id) { global $movepic, $my, $mainframe, $ad_paththumbs; $db = & JTDB::getDBO (); if (! $movepic || $movepic == 0) { echo "\n"; exit (); } else { $pic = new mostrue ( $db ); $pic->dgMove ( $id, $movepic ); $ids = implode ( ',', $id ); $imgthumbname = implode ( ',', $imgthumbname1 ); $total = count ( $id ); $cat = new mosCatgs ( $db ); $cat->load ( $movepic ); $msg = $total . JText::_ ( 'TG_TOTAL_PICS_MOVED' ) . $cat->name; JTRedirect::_ ( TRUE_INDEX2 . '&task=pictures&mosmsg=' . $msg ); } } //Пишет директорию function writDir($folder, $relative = 1) { $writeable = ""; $unwriteable = ""; if ($relative) { echo is_writable ( "../$folder" ) ? $writeable : $unwriteable; } else { echo is_writable ( "$folder" ) ? $writeable : $unwriteable; } } //Установка защиты картинок через .htaccess function dgProtect($dirtoprotect) { global $mainframe; require_once (TRUE_ADMIN . "config.true.php"); $htaccess = "Order Deny,Allow\nDeny from All"; $wf = fopen ( $mainframe->getCfg ( 'absolute_path' ) . $dirtoprotect . "/.htaccess", "w+" ); if (! fwrite ( $wf, $htaccess )) ; fclose ( $wf ); } //Удаление защиты function dgUnprotect($dirtounprotect) { global $mainframe; require_once (TRUE_ADMIN . 'config.true.php'); if (file_exists ( $mainframe->getCfg ( 'absolute_path' ) . $dirtounprotect . "/.htaccess" )) { unlink ( $mainframe->getCfg ( 'absolute_path' ) . $dirtounprotect . "/.htaccess" ); } } ?>