Ejemplo n.º 1
0
function glossar_highlight($text, $module = false, $ignore = false)
{
    global $apx, $db, $set;
    static $highlights;
    $ignore = (int) $ignore;
    if (!$set['glossar']['highlight'] || !$text) {
        return $text;
    }
    $apx->lang->drop('highlights', 'glossar');
    $classname_word = 'glossar_highlight';
    $classname_title = 'glossar_info_title';
    $classname_text = 'glossar_info_text';
    $classname_readmore = 'glossar_info_readmore';
    //Daten auslesen
    if (!isset($highlights)) {
        $highlights = array();
        $data = $db->fetch("SELECT id,title,spelling,text FROM " . PRE . "_glossar WHERE starttime!=0" . iif($ignore, " AND id!='" . $ignore . "'"));
        if (count($data)) {
            foreach ($data as $res) {
                $words = array();
                if ($res['spelling']) {
                    $words = explode(',', strtolower($res['spelling']));
                }
                $words[] = strtolower($res['title']);
                $words = array_unique(array_map('trim', $words));
                $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
                $content = '<div class="' . $classname_title . '"><a href="' . $link . '">' . $res['title'] . '</a></div><div class="' . $classname_text . '">' . shorttext($res['text'], 200) . '</div><div class="' . $classname_readmore . '"><a href="' . $link . '">' . $apx->lang->get('READMORE') . '</a></div>';
                $content = strtr(compatible_hsc($content), array("\n" => ' ', "\r" => '', '\'' => '\\\'', '\\' => '\\\\'));
                $highlights[] = array('words' => $words, 'content' => $content);
            }
        }
    }
    //Text nach Highlights durchsuchen
    $lowertext = strtolower($text);
    foreach ($highlights as $element) {
        $words = $element['words'];
        foreach ($words as $wkey => $word) {
            if (strpos($lowertext, strtolower($word)) === false) {
                unset($words[$wkey]);
            }
        }
        if (!count($words)) {
            continue;
        }
        $words = array_map('preg_quote', $words);
        $searchfor = implode('|', $words);
        $hover = 'Tip(\'' . $element['content'] . '\')';
        $text = preg_replace('#((<[^>]*)|($|[\\s<>,.:;_!-])(' . $searchfor . ')([\\s<>,.:;_!-]|$))#ie', '"\\2"=="\\1" ? glossar_stripslashes("\\1") : glossar_stripslashes("\\3")."<span class=\\"' . $classname_word . '\\" onmouseover=\\"' . strtr($hover, array('\\' => '\\\\')) . '\\">".glossar_stripslashes("\\4")."</span>".glossar_stripslashes("\\5")', $text);
        //$text=preg_replace('#((<[^>]*)|('.$searchfor.'))#ie', '"\2"=="\1" ? glossar_stripslashes("\1") : "<span class=\"'.$classname_word.'\" onmouseover=\"'.$hover.'\">".glossar_stripslashes("\3")."</span>"', $text);
    }
    return $text;
}
Ejemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($alias)
 {
     $aliasLang = 'alias' . getLangAlias(Lang::locale());
     $houseDetails = Houses::where($aliasLang, $alias)->first();
     list($apartments, $rooms, $houses, $countpersons) = $houseDetails->countUnitsInHouse($houseDetails->id);
     if ($houseDetails->destination->parent == 0) {
         $destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = "";
     } else {
         $destinationName = getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = getTranslate($houseDetails->destination->parent, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     $title = $houseDetails->name;
     $meta_title = $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
     if ($parentDestinationName != '') {
         $meta_title .= ' | ' . $parentDestinationName;
     }
     $meta_title .= ' | ' . $destinationName . ' | ' . $houseDetails->getHouseTitleName($houseDetails->jos_estateagent_house_title_id) . ' ' . $houseDetails->name;
     $meta_description = Lang::get('lang.MetaDescriptionPrivateURL');
     if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
         $meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
     } else {
         if (getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
             $meta_description .= getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
         } else {
             $meta_description .= getTranslate($houseDetails->town_id, 'jos_estateagent_town', 'description', Lang::locale())->value;
         }
     }
     $meta_description_all = strip_tags(shorttext($meta_description, 120));
     $description = getTranslate($houseDetails->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
     $houseImages = Houses::find($houseDetails->id)->HouseImages;
     if ($houseImages->isEmpty()) {
         $houseMainImage = "nophoto.jpg";
     } else {
         $houseMainImage = Houses::find($houseDetails->id)->HouseImages()->first()->fname;
     }
     $ownerTours = $houseDetails->owner->getOwnerTours($houseDetails->jos_users_id);
     $getCategoryLinks = Destinations::find($houseDetails->town_id)->DestinationCategoryLinks;
     $categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
     $getLinks = Destinations::find($houseDetails->town_id)->DestinationLinks->where('jos_estateagent_town_links_publish', 1);
     $titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
     $linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
     $labelColor = array('label-warning', 'label-info', 'label-danger', 'label-success');
     $allDestinationTours = $houseDetails->destination->allDestinationTours($houseDetails->town_id);
     $allUnits = Units::published()->where('jos_estateagent_object_id', $houseDetails->id)->with('unitPrice')->orderBy('redoslijed')->get();
     return view('accommodation.show-house', compact('houseDetails', 'houseMainImage', 'houseImages', 'parentDestinationName', 'destinationName', 'description', 'meta_title', 'meta_description_all', 'apartments', 'rooms', 'houses', 'countpersons', 'allUnits', 'ownerTours', 'getCategoryLinks', 'getLinks', 'titleLang', 'linkLang', 'categoryTitleLang', 'labelColor', 'allDestinationTours'));
 }
Ejemplo n.º 3
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function show($houseSlug, $id)
 {
     $unitDetails = Units::where('id', $id)->first();
     if ($unitDetails->house->destination->parent == 0) {
         $destinationName = getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = "";
     } else {
         $destinationName = getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = getTranslate($unitDetails->house->destination->parent, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     $title = $unitDetails->title;
     $meta_title = $unitDetails->house->getHouseTitleName($unitDetails->house->jos_estateagent_house_title_id) . ' ' . $unitDetails->house->name;
     if ($parentDestinationName != '') {
         $meta_title .= ' | ' . $parentDestinationName;
     }
     $meta_title .= ' | ' . $destinationName . ' | ' . $unitDetails->getUnitCategoryName($unitDetails->cat) . ' ' . $unitDetails->title;
     $meta_description = Lang::get('lang.MetaDescriptionPrivateURL');
     if (getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value != '') {
         $meta_description .= getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value;
     } else {
         if (getTranslate($unitDetails->house->id, 'jos_estateagent_house', 'description', Lang::locale())->value != '') {
             $meta_description .= getTranslate($unitDetails->house->id, 'jos_estateagent_house', 'description', Lang::locale())->value;
         } else {
             $meta_description .= getTranslate($unitDetails->house->town_id, 'jos_estateagent_town', 'description', Lang::locale())->value;
         }
     }
     $meta_description_all = strip_tags(shorttext($meta_description, 120));
     $description = getTranslate($unitDetails->id, 'jos_estateagent_unit', 'description', Lang::locale())->value;
     $isHotel = FALSE;
     if ($unitDetails->house->jos_estateagent_main_categories_id == Config::get('constants.MAIN_HOUSE_CATEGORIES.HOTEL')) {
         $isHotel = TRUE;
     } else {
         $isHotel = FALSE;
     }
     $add_services = array();
     array_push($add_services, array(0 => "fullboard", 1 => "fullboard_payment", 2 => "Fullboard", 3 => "fullboard_price", 4 => "PerService"));
     array_push($add_services, array(0 => "halfboard", 1 => "halfoard_payment", 2 => "Halfboard", 3 => "halfboard_price", 4 => "PerService"));
     array_push($add_services, array(0 => "bed_breakfast", 1 => "bed_breakfast_payment", 2 => "BedBreakfast", 3 => "bed_breakfast_price", 4 => "PerService"));
     array_push($add_services, array(0 => "dslinclude", 1 => "dsl_payment", 2 => "DSLInternet", 3 => "dslprice", 4 => "PerDay"));
     array_push($add_services, array(0 => "petsinclude", 1 => "pets_payment", 2 => "Pets", 3 => "petsprice", 4 => "PerDay"));
     array_push($add_services, array(0 => "parkinginclude", 1 => "park_payment", 2 => "ParkingPlace", 3 => "parkingprice", 4 => "PerDay"));
     array_push($add_services, array(0 => "airinclude", 1 => "aircondition_payment", 2 => "IconAirCondition", 3 => "airprice", 4 => "PerDay"));
     $negotiableCounterUnit = 0;
     $negotiableStringsUnit = array();
     $priceCounterUnit = 0;
     $priceStringsUnit = array();
     $pricesUnit = array();
     $pricesPerUnit = array();
     foreach ($add_services as $idList) {
         if ($unitDetails->{$idList}[0] == 2 && $unitDetails->{$idList}[1] == 1) {
             $negotiableCounterUnit++;
             $negotiableStringsUnit[] = Lang::get('lang.' . $idList[2]);
         } elseif ($unitDetails->{$idList}[0] == 2 && $unitDetails->{$idList}[1] == 0) {
             $priceCounterUnit++;
             $priceStringsUnit[] = Lang::get('lang.' . $idList[2]);
             $pricesUnit[] = $unitDetails->{$idList}[3];
             $pricesPerUnit[] = $idList[4];
         }
     }
     $add_services_house = array();
     array_push($add_services_house, array(0 => "cleaninginclude", 1 => "cleaning_negotiable", 2 => "FinalCleaning", 3 => "cleaningprice", 4 => "PerService"));
     array_push($add_services_house, array(0 => "towels", 1 => "towel_negotiable", 2 => "Towels", 3 => "towelsprice", 4 => "PerService"));
     array_push($add_services_house, array(0 => "berth", 1 => "berthprice_negotiable", 2 => "BerthUse", 3 => "berthprice", 4 => "PerDay"));
     array_push($add_services_house, array(0 => "boat", 1 => "boat_negotiable", 2 => "BoatUse", 3 => "boatprice", 4 => "PerDay"));
     $negotiableCounter = 0;
     $negotiableStrings = array();
     $priceCounter = 0;
     $priceStrings = array();
     $prices = array();
     $pricesPer = array();
     foreach ($add_services_house as $idList) {
         if ($unitDetails->house->{$idList}[0] == 2 && $unitDetails->house->{$idList}[1] == 1) {
             $negotiableCounter++;
             $negotiableStrings[] = Lang::get('lang.' . $idList[2]);
         } elseif ($unitDetails->house->{$idList}[0] == 2 && $unitDetails->house->{$idList}[1] == 0) {
             $priceCounter++;
             $priceStrings[] = Lang::get('lang.' . $idList[2]);
             $prices[] = $unitDetails->house->{$idList}[3];
             $pricesPer[] = $idList[4];
         }
     }
     $unitMainImage = $unitDetails->getMainUnitImage($unitDetails->id);
     $unitImages = Units::find($id)->UnitImages;
     return view('accommodation.show', compact('unitDetails', 'unitMainImage', 'unitImages', 'parentDestinationName', 'destinationName', 'description', 'meta_title', 'meta_description_all', 'isHotel', 'negotiableCounterUnit', 'negotiableStringsUnit', 'priceCounterUnit', 'priceStringsUnit', 'pricesUnit', 'pricesPerUnit', 'negotiableCounter', 'negotiableStrings', 'priceCounter', 'priceStrings', 'prices', 'pricesPer'));
     //
 }
Ejemplo n.º 4
0
 function add()
 {
     global $set, $db, $apx;
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             infoInvalidToken();
         } elseif (!$_POST['parent'] || !$_POST['question']) {
             infoNotComplete();
         } else {
             $insert = array('question' => $_POST['question'], 'answer' => $_POST['answer'], 'meta_description' => $_POST['meta_description'], 'searchable' => $_POST['searchable'], 'addtime' => time());
             //EINTRAG FREISCHALTEN
             if ($apx->user->has_right('faq.enable') && $_POST['pubnow']) {
                 //Prüfen, ob der Elternknoten deaktiviert ist => falls ja den Knoten deaktivieren
                 if ($_POST['parent'] == 'root') {
                     $insert['starttime'] = time();
                 } else {
                     list($parentEnabled) = $db->first("SELECT starttime FROM " . PRE . "_faq WHERE id='" . intval($_POST['parent']) . "' LIMIT 1");
                     if ($parentEnabled) {
                         $insert['starttime'] = time();
                     }
                 }
             }
             //WENN ROOT
             if ($_POST['parent'] == 'root') {
                 $nid = $this->cat->createNode(0, $insert);
                 logit('FAQ_ADD', 'ID #' . $nid);
             } else {
                 $nid = $this->cat->createNode(intval($_POST['parent']), $insert);
                 logit('FAQ_ADD', "ID #" . $nid);
             }
             //Inlinescreens
             mediamanager_setinline($this->cat->lastid);
             //Message ausgeben oder neuer Eintrag
             if ($_POST['submit_next']) {
                 printJSRedirect('action.php?action=faq.add&parent=' . $_REQUEST['parent']);
             } else {
                 printJSRedirect('action.php?action=faq.show');
             }
         }
     } else {
         $_POST['searchable'] = 1;
         $_POST['parent'] = $_GET['parent'];
         //Baum
         $catlist = '<option value="root" style="font-weight:bold;"' . iif($_POST['parent'] == 'root', ' selected="selected"') . '>' . $apx->lang->get('ROOT') . '</option><option value=""></option>';
         $data = $this->cat->getTree(array('question'));
         if (count($data)) {
             foreach ($data as $res) {
                 $catlist .= '<option value="' . $res['id'] . '"' . iif($_POST['parent'] == $res['id'], ' selected="selected"') . '>' . str_repeat('&nbsp;&nbsp;', $res['level'] - 1) . replace(shorttext($res['question'], 80)) . '</option>';
             }
         }
         $apx->tmpl->assign('CATLIST', $catlist);
         $apx->tmpl->assign('QUESTION', compatible_hsc($_POST['question']));
         $apx->tmpl->assign('ANSWER', compatible_hsc($_POST['answer']));
         $apx->tmpl->assign('META_DESCRIPTION', compatible_hsc($_POST['meta_description']));
         $apx->tmpl->assign('SEARCHABLE', (int) $_POST['searchable']);
         $apx->tmpl->assign('PUBNOW', (int) $_POST['pubnow']);
         $apx->tmpl->assign('ACTION', 'add');
         $apx->tmpl->parse('add_edit');
     }
 }
Ejemplo n.º 5
0
 public function show($tourSlug, $tour_code)
 {
     $tourDetails = Tours::where('tour_code', $tour_code)->first();
     $id = $tourDetails->TOUR_ID;
     list($category_ID, $tourCategory, $tourSubCategory) = $tourDetails->getTourCategory($tourDetails->TOUR_SUBCATEGORY);
     if ($tourDetails->town_id == $tourDetails->parent_town_id) {
         $destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = "";
     } else {
         $destinationName = getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
         $parentDestinationName = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     }
     $title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_title', Lang::locale())->value;
     $meta_title = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'meta_title', Lang::locale())->value;
     $meta_description1 = getTranslate($tourDetails->parent_town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->town_id, 'jos_estateagent_town', 'title', Lang::locale())->value;
     $meta_description1 .= ", " . Lang::get('lang.MetaTitleForDestinations');
     $meta_description1 .= ", " . getTranslate($category_ID, 'jos_estateagent_tour_category', 'tour_category_title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->TOUR_SUBCATEGORY, 'jos_estateagent_tour_subcategory', 'tour_subcategory_title', Lang::locale())->value;
     $meta_description1 .= ", " . getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
     $meta_description2 = "";
     if (getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value != '') {
         $strings2 = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
         $meta_description2 = strip_tags($strings2);
     }
     $meta_description = strip_tags(shorttext($meta_description1 . $meta_description2, 180));
     $meta_keywords = Lang::get('lang.MetaKeywords');
     $description = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_description', Lang::locale())->value;
     $profileDescription = getTranslate($tourDetails->TOUR_ID, 'jos_estateagent_tour', 'tour_profile_description', Lang::locale())->value;
     $prvi_datum = "";
     $drugi_datum = "";
     $event_time = "";
     $time = "";
     $event_time_end = "";
     if ($tourDetails->is_event == 1) {
         if ($tourDetails->tour_date != '0000-00-00') {
             $timestampEventDate = strtotime($tourDetails->tour_date);
             $prvi_datum = " " . date("d.m.Y", $timestampEventDate) . "  ";
             if ($tourDetails->tour_date_end == '0000-00-00') {
                 $drugi_datum = " ";
             } elseif ($tourDetails->tour_date_end != '0000-00-00') {
                 $timestampEventDate = strtotime($tourDetails->tour_date_end);
                 $drugi_datum = "-  " . date("d.m.Y", $timestampEventDate) . "  ";
             }
         }
         if ($tourDetails->tour_time != '00:00:00') {
             $event_time = date('H:i', strtotime($tourDetails->tour_time)) . " " . Lang::get('lang.EventHours') . " ";
             $time = Lang::get('lang.EventTime');
             if ($tourDetails->tour_time_end != '00:00:00') {
                 $event_time_end = " - " . date('H:i', strtotime($tourDetails->tour_time_end)) . " " . Lang::get('lang.EventHours');
             } else {
                 $event_time_end = ' ';
             }
         } else {
             $event_time = ' ';
             $time = "";
             $event_time_end = ' ';
         }
     }
     $duration_sintax = '';
     if ($tourDetails->tour_duration != "0" && $tourDetails->tour_duration_unit != "0") {
         if ($tourDetails->tour_duration == 1) {
             $duration_sintax = Lang::get('lang.Tour' . substr_replace($tourDetails->tour_duration_unit, "", -1));
         } elseif ($tourDetails->tour_duration > 1) {
             $duration_sintax = Lang::get('lang.Tour' . $tourDetails->tour_duration_unit);
         } else {
             $duration_sintax = '';
         }
     }
     $languageString = '';
     if ($tourDetails->croatian == '1') {
         $languageString .= Lang::get('lang.Croatian') . ', ';
     }
     if ($tourDetails->english == '1') {
         $languageString .= Lang::get('lang.English') . ', ';
     }
     if ($tourDetails->german == '1') {
         $languageString .= Lang::get('lang.German') . ', ';
     }
     if ($tourDetails->italian == '1') {
         $languageString .= Lang::get('lang.Italian') . ', ';
     }
     if ($tourDetails->french == '1') {
         $languageString .= Lang::get('lang.French') . ', ';
     }
     if ($tourDetails->slovenski == '1') {
         $languageString .= Lang::get('lang.Slovenian') . ', ';
     }
     if ($tourDetails->ruski == '1') {
         $languageString .= Lang::get('lang.Russian') . ', ';
     }
     if ($tourDetails->spanjolski == '1') {
         $languageString .= Lang::get('lang.Spanish') . ', ';
     }
     if ($tourDetails->portugalski == '1') {
         $languageString .= Lang::get('lang.Portuguese') . ', ';
     }
     if ($tourDetails->madjarski == '1') {
         $languageString .= Lang::get('lang.Hungarian') . ', ';
     }
     if ($tourDetails->ceski == '1') {
         $languageString .= Lang::get('lang.Czech') . ', ';
     }
     if ($tourDetails->poljski == '1') {
         $languageString .= Lang::get('lang.Polish') . ', ';
     }
     $languageString = substr($languageString, 0, -2);
     $getCategoryLinks = Tours::find($id)->TourCategoryLinks;
     $categoryTitleLang = "jos_estateagent_town_category_links_" . Lang::locale();
     $getLinks = Tours::find($id)->TourLinks->where('jos_estateagent_town_links_publish', 1);
     $titleLang = "jos_estateagent_town_links_title_" . Lang::locale();
     $linkLang = "jos_estateagent_town_links_url_" . Lang::locale();
     $tourMainImage = $tourDetails->getMainTourImage($tourDetails->TOUR_ID);
     $tourIcon = $tourDetails->getTourIcon($tourDetails->ICON_ID);
     $profileImage = $tourDetails->getTourProfileImage($tourDetails->tour_profile_image);
     $visitsCount = $tourDetails->getTourVisits($tourDetails->TOUR_ID);
     $tourImages = Tours::find($id)->TourImages;
     $tourCategories = TourCategories::where('tour_category_published', '=', 1)->orderBy('tour_category_order')->get();
     return view('tours.show', compact('tourDetails', 'title', 'meta_title', 'meta_description', 'meta_keywords', 'getLinks', 'titleLang', 'linkLang', 'getCategoryLinks', 'categoryTitleLang', 'destinationName', 'parentDestinationName', 'description', 'tourMainImage', 'tourCategory', 'tourSubCategory', 'tourIcon', 'profileImage', 'profileDescription', 'languageString', 'prvi_datum', 'drugi_datum', 'event_time', 'time', 'event_time_end', 'duration_sintax', 'visitsCount', 'tourImages', 'tourCategories'));
 }
Ejemplo n.º 6
0
 function show_print($data)
 {
     global $set, $db, $apx, $html;
     $col[] = array('', 1, 'align="center"');
     $col[] = array($apx->lang->get('COL_TITLE') . ' / ' . $apx->lang->get('COL_AUTHOR'), 35, 'class="title"');
     $col[] = array('COL_CATEGORY', 25, 'align="center"');
     $col[] = array('COL_ADDTIME', 20, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     $col[] = array('COL_DOWNLOADS', 10, 'align="center"');
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             //Status
             if ($res['status'] == 'new') {
                 $tabledata[$i]['COL1'] = '<img src="design/processing.gif" alt="' . $apx->lang->get('PROCESSING') . '" title="' . $apx->lang->get('PROCESSING') . '" />';
             } elseif ($res['status'] == 'converting') {
                 $tabledata[$i]['COL1'] = '<img src="design/processing.gif" alt="' . $apx->lang->get('PROCESSING') . '" title="' . $apx->lang->get('PROCESSING') . '" />';
             } elseif ($res['status'] == 'failed') {
                 $tabledata[$i]['COL1'] = '<img src="design/failed.gif" alt="' . $apx->lang->get('FAILED') . '" title="' . $apx->lang->get('FAILED') . '" />';
             } elseif (!$res['starttime']) {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['endtime'] < time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['starttime'] > time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             }
             $tmp = unserialize_section($res['secid']);
             $title = shorttext(strip_tags($res['title']), 40);
             $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
             $tabledata[$i]['ID'] = $res['id'];
             $tabledata[$i]['COL2'] .= '<a href="' . $link . '" target="_blank">' . $title . '</a>';
             $tabledata[$i]['COL3'] = replace($res['catname']);
             $tabledata[$i]['COL4'] = iif($res['starttime'], mkdate($res['starttime'], '<br />'), '&nbsp;');
             $tabledata[$i]['COL5'] = $res['hits'];
             $tabledata[$i]['COL6'] = $res['downloads'];
             $tabledata[$i]['COL2'] .= '<br /><small>' . $apx->lang->get('BY') . ' ' . replace($res['username']) . '</small>';
             if ($res['broken']) {
                 $tabledata[$i]['COL2'] = '<a href="action.php?action=videos.show&amp;what=' . $_REQUEST['what'] . '&amp;p=' . $_REQUEST['p'] . '&amp;item=' . $_REQUEST['item'] . '&amp;sortby=' . $_REQUEST['sortby'] . '&amp;title=' . $_REQUEST['title'] . '&amp;text=' . $_REQUEST['text'] . '&amp;catid=' . $_REQUEST['catid'] . '&amp;unbroken=' . $res['id'] . '"><img src="../' . getmodulepath('videos') . 'images/broken.gif" alt="' . $apx->lang->get('BROKEN') . ': ' . mkdate($res['broken']) . '" title="' . $apx->lang->get('BROKEN') . ': ' . mkdate($res['broken']) . '" align="right" /></a>' . $tabledata[$i]['COL2'];
             }
             //Optionen
             if ($apx->user->has_right('videos.edit') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('videos.edit'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'videos.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('videos.del') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('videos.del'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'videos.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('videos.enable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('videos.enable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'videos.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('videos.disable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('videos.disable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'videos.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             if ($apx->user->has_right('videos.pshow')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('pic.gif', 'videos.pshow', 'id=' . $res['id'], $apx->lang->get('PICS'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments') || $apx->is_module('ratings')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             }
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='videos' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['videos']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=videos&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             if ($apx->is_module('ratings')) {
                 list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='videos' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['videos']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=videos&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $multiactions = array();
     if ($apx->user->has_right('videos.del')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=videos.del', false);
     }
     if ($apx->user->has_right('videos.enable')) {
         $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=videos.enable', false);
     }
     if ($apx->user->has_right('videos.disable')) {
         $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=videos.disable', false);
     }
     $html->table($col, $multiactions);
 }
Ejemplo n.º 7
0
 function show_print($data)
 {
     global $set, $db, $apx, $html;
     $col[] = array('', 1, 'align="center"');
     $col[] = array($apx->lang->get('COL_TITLE') . ' / ' . $apx->lang->get('COL_USER'), 55, 'class="title"');
     $col[] = array('COL_CATEGORY', 20, 'align="center"');
     $col[] = array('COL_STARTEND', 15, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if ($res['active']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             $tmp = unserialize_section($res['secid']);
             $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . shorttext(strip_tags($res['title']), 40) . '</a>';
             if ($res['username']) {
                 $tabledata[$i]['COL2'] .= '<br /><small>' . $apx->lang->get('BY') . ' ' . replace($res['username']) . '</small>';
             } else {
                 $tabledata[$i]['COL2'] .= '<br /><small>' . $apx->lang->get('BY') . ' ' . $apx->lang->get('GUEST') . ': <i>' . replace($res['send_username']) . '</i></small>';
             }
             $col3 = apxdate($this->stamp2time($res['startday']));
             if ($res['endday'] != $res['startday']) {
                 $col3 .= '<br />' . apxdate($this->stamp2time($res['endday']));
             }
             $tabledata[$i]['COL3'] = replace($res['catname']);
             $tabledata[$i]['COL4'] = $col3;
             $tabledata[$i]['COL5'] = number_format($res['hits'], 0, '', '.');
             //Optionen
             if ($apx->user->has_right('calendar.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'calendar.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('calendar.copy') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('calendar.copy'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('copy.gif', 'calendar.copy', 'id=' . $res['id'], $apx->lang->get('COPY'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('calendar.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'calendar.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('calendar.enable') && !$res['active']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'calendar.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($apx->user->has_right('calendar.disable') && $res['active']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'calendar.disable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare
             if ($apx->is_module('comments')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='calendar' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['calendar']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=calendar&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
 }
Ejemplo n.º 8
0
 function gallery_pics()
 {
     global $set, $apx, $db, $html;
     $_REQUEST['userid'] = (int) $_REQUEST['userid'];
     $_REQUEST['galid'] = (int) $_REQUEST['galid'];
     if (!$_REQUEST['galid']) {
         die('missing GALID!');
     }
     //AKTIONEN
     if ($_REQUEST['do2'] == 'edit') {
         return $this->gallery_pics_edit();
     } elseif ($_REQUEST['do2'] == 'del') {
         return $this->gallery_pics_del();
     }
     $orderdef[0] = 'time';
     $orderdef['time'] = array('id', 'DESC', 'COL_ADDTIME');
     $orderdef['caption'] = array('caption', 'ASC', 'COL_CAPTION');
     $col[] = array('COL_THUMBNAIL', 20, 'align="center"');
     $col[] = array('COL_CAPTION', 80, '');
     list($id, $title) = $db->first("SELECT id,title FROM " . PRE . "_user_gallery WHERE id='" . $_REQUEST['galid'] . "' LIMIT 1");
     if (!$id) {
         return;
     }
     echo '<h2>' . $apx->lang->get('GALLERY') . ': ' . $title . '</h2>';
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['galid'] . "'");
     pages('action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid'] . '&amp;do=pics&amp;galid=' . $_REQUEST['galid'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     //Bilder auslesen
     $data = $db->fetch("SELECT * FROM " . PRE . "_user_pictures WHERE galid='" . $_REQUEST['galid'] . "' " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $caption = shorttext(strip_tags($res['caption']), 50);
             $tabledata[$i]['COL1'] = '<a href="../' . getpath('uploads') . $res['picture'] . '" target="_blank"><img src="../' . getpath('uploads') . $res['thumbnail'] . '" alt="thumbnail" /></a>';
             $tabledata[$i]['COL2'] = iif($caption, $caption, '&nbsp;');
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('edit.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $_REQUEST['galid'] . '&do2=edit&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'user.gallery', 'userid=' . $_REQUEST['userid'] . '&do=pics&galid=' . $_REQUEST['galid'] . '&do2=del&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=user.gallery&amp;userid=' . $_REQUEST['userid'] . '&amp;do=pics&amp;galid=' . $_REQUEST['galid']);
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 9
0
function main_shorttext($text, $length)
{
    $length = (int) $length;
    echo shorttext($text, $length);
}
Ejemplo n.º 10
0
 function show_print($data)
 {
     global $set, $db, $apx, $html;
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_CATEGORY', 22, 'align="center"');
     $col[] = array('COL_PUBDATE', 18, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if ($res['starttime']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . shorttext(strip_tags($res['title']), 40) . '</a>';
             $tabledata[$i]['COL3'] = replace($res['catname']);
             $tabledata[$i]['COL5'] = number_format($res['hits'], 0, '', '.');
             if ($res['starttime']) {
                 $tabledata[$i]['COL4'] = mkdate($res['starttime'], '<br />');
             } else {
                 $tabledata[$i]['COL4'] = '&nbsp;';
             }
             //Optionen
             if ($apx->user->has_right('glossar.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'glossar.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('glossar.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'glossar.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if (!$res['starttime'] && $apx->user->has_right('glossar.enable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'glossar.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('glossar.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'glossar.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments') || $apx->is_module('ratings')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             }
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='glossar' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['glossar']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=glossar&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             if ($apx->is_module('ratings')) {
                 list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='glossar' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['glossar']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=glossar&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
 }
Ejemplo n.º 11
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink_multi('comments.blockip');
     quicklink_multi('comments.blockcontent');
     quicklink_out();
     //Layer generieren
     if (!$this->mid) {
         $commodules = array();
         $layerdef = array();
         $data = $db->fetch("SELECT module FROM " . PRE . "_comments GROUP BY module ORDER BY module ASC");
         if (count($data)) {
             foreach ($data as $res) {
                 //if ( !$apx->is_module($res['module']) ) continue;
                 ++$mi;
                 if ($mi == 1 && !$this->module) {
                     $this->module = $res['module'];
                 }
                 $commodules[] = $res['module'];
             }
         }
         foreach ($apx->modules as $module => $trash) {
             if ($module == 'comments') {
                 continue;
             }
             if (!in_array($module, $commodules) && $_REQUEST['module'] != $module) {
                 continue;
             }
             $layerdef[] = array('MODULENAME_' . strtoupper($module), 'action.php?action=comments.show&amp;module=' . $module, $this->module == $module);
         }
         if (count($layerdef)) {
             $html->layer_header($layerdef);
         }
     }
     $orderdef[0] = 'time';
     $orderdef['name'] = array('username', 'ASC', 'COL_NAME');
     $orderdef['time'] = array('time', 'DESC', 'SORT_TIME');
     if ($this->coms->set['mod']) {
         $col[] = array('', 2, 'align="center"');
     }
     $col[] = array('COL_NAME', 33, 'class="title"');
     $col[] = array('COL_TEXT', 50, '');
     $col[] = array('COL_IP', 17, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='" . $this->module . "' " . iif($this->mid, "AND mid='" . $this->mid . "'") . " )");
     pages('action.php?action=comments.show&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,username,text,ip,active FROM " . PRE . "_comments WHERE ( module='" . $this->module . "' " . iif($this->mid, "AND mid='" . $this->mid . "'") . " ) " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $icol = 0;
             //Moderiert -> Icons
             if ($this->coms->set['mod']) {
                 if ($res['active']) {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
                 } else {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
                 }
             }
             $tabledata[$i]['COL' . ++$icol] = replace($res['username']);
             $tabledata[$i]['COL' . ++$icol] = shorttext($res['text'], 50);
             $tabledata[$i]['COL' . ++$icol] = $res['ip'] . iif($apx->user->has_right('comments.blockip'), ' <a href="action.php?action=comments.blockip&amp;setip=' . $res['ip'] . '"><img src="design/block.gif" alt="' . $apx->lang->get('BLOCK') . '" title="' . $apx->lang->get('BLOCK') . '" /></a>');
             $tabledata[$i]['ID'] = $res['id'];
             //Optionen
             if ($apx->user->has_right('comments.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'comments.edit', 'module=' . $this->module . '&mid=' . $this->mid . '&id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('comments.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'comments.del', 'module=' . $this->module . '&mid=' . $this->mid . '&id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Moderiert -> Enable/Disable
             if ($this->coms->set['mod']) {
                 if ($res['active'] && $apx->user->has_right("comments.disable")) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'comments.disable', 'module=' . $this->module . '&mid=' . $this->mid . '&id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
                 } elseif (!$res['active'] && $apx->user->has_right("comments.enable")) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'comments.enable', 'module=' . $this->module . '&mid=' . $this->mid . '&id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('comments.del')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=comments.del&module=' . $this->module . '&mid=' . $this->mid);
     }
     if ($this->coms->set['mod']) {
         if ($apx->user->has_right('comments.enable')) {
             $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=comments.enable&module=' . $this->module . '&mid=' . $this->mid);
         }
         if ($apx->user->has_right('comments.disable')) {
             $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=comments.disable&module=' . $this->module . '&mid=' . $this->mid);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=comments.show&amp;module=' . $this->module . '&amp;mid=' . $this->mid);
     //Layer-Footer ausgeben
     if (!$this->mid && count($layerdef)) {
         $html->layer_footer();
     }
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 12
0
 function page_index()
 {
     global $set, $db, $apx, $html;
     echo '<h2>' . $apx->lang->get(iif($this->type == 'normal', 'ARTICLE', strtoupper($this->type))) . ': ' . $this->title . '</h2>';
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_TITLE', 100, 'class="title"');
     //Seiten auflisten
     $data = $db->fetch("SELECT id,title FROM " . PRE . "_articles_pages WHERE artid='" . $_REQUEST['id'] . "' ORDER BY ord ASC");
     if (!($pmax = count($data))) {
         return;
     }
     foreach ($data as $res) {
         ++$i;
         if ($this->type == 'normal') {
             $link2file = 'articles';
         } else {
             $link2file = $this->type . 's';
         }
         $pagetitle = shorttext(strip_tags($res['title']), 50);
         $link = mklink($link2file . '.php?id=' . $_REQUEST['id'] . '&amp;page=' . $i, $link2file . ',id' . $_REQUEST['id'] . ',' . $i . urlformat($this->title) . '.html');
         $tabledata[$i]['COL1'] = $i . '.';
         $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $pagetitle . '</a>';
         //Optionen
         $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', $_REQUEST['action'], 'id=' . $_REQUEST['id'] . '&pageid=' . $res['id'] . '&pubnow=' . $_REQUEST['pubnow'], $apx->lang->get('CORE_EDIT'));
         $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', $_REQUEST['action'], 'id=' . $_REQUEST['id'] . '&pageid=' . $_REQUEST['pageid'] . '&del=' . $res['id'] . '&pubnow=' . $_REQUEST['pubnow'], $apx->lang->get('CORE_DEL'));
         $tabledata[$i]['OPTIONS'] .= '&nbsp;';
         if ($i != 1) {
             $tabledata[$i]['OPTIONS'] .= optionHTML('moveup.gif', $_REQUEST['action'], 'id=' . $_REQUEST['id'] . '&pageid=' . $_REQUEST['pageid'] . '&move=' . $res['id'] . '&direction=up&pubnow=' . $_REQUEST['pubnow'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('MOVEUP'));
         } else {
             $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />';
         }
         if ($i != $pmax) {
             $tabledata[$i]['OPTIONS'] .= optionHTML('movedown.gif', $_REQUEST['action'], 'id=' . $_REQUEST['id'] . '&pageid=' . $_REQUEST['pageid'] . '&move=' . $res['id'] . '&direction=down&pubnow=' . $_REQUEST['pubnow'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('MOVEDOWN'));
         } else {
             $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace_small.gif" alt="" style="vertical-align:middle;" />';
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     echo '<br />&nbsp;';
 }
Ejemplo n.º 13
0
 function add()
 {
     global $set, $db, $apx;
     $_REQUEST['nid'] = (int) $_REQUEST['nid'];
     if (!$_REQUEST['nid']) {
         die('missing nID!');
     }
     if ($_POST['send'] == 1) {
         if (!checkToken()) {
             infoInvalidToken();
         } elseif (!$_POST['parent'] || !$_POST['text'] || $_POST['display'] == 'link' && !$_POST['link'] || $_POST['display'] == 'code' && !$_POST['code'] || !$_POST['parent']) {
             infoNotComplete();
         } else {
             //Was soll gespeichert werden?
             if ($_POST['display'] == 'code') {
                 unset($_POST['link'], $_POST['link_popup']);
             } elseif ($_POST['display'] == 'link') {
                 unset($_POST['code']);
             } else {
                 unset($_POST['code'], $_POST['link'], $_POST['link_popup']);
             }
             //WENN ROOT
             if ($_POST['parent'] == 'root') {
                 $nid = $this->cat->createNode(0, array('nid' => $_POST['nid'], 'text' => $_POST['text'], 'link' => $_POST['link'], 'link_popup' => $_POST['link_popup'], 'code' => $_POST['code'], 'staticsub' => $_POST['staticsub']));
                 logit('NAVI_ADD', 'ID #' . $nid);
             } else {
                 $nid = $this->cat->createNode(intval($_POST['parent']), array('nid' => $_POST['nid'], 'text' => $_POST['text'], 'link' => $_POST['link'], 'link_popup' => $_POST['link_popup'], 'code' => $_POST['code'], 'staticsub' => $_POST['staticsub']));
                 logit('NAVI_ADD', "ID #" . $nid);
             }
             //Message ausgeben oder neuer Eintrag
             if ($_POST['submit_next']) {
                 printJSRedirect('action.php?action=navi.add&nid=' . $_REQUEST['nid'] . '&parent=' . $_REQUEST['parent'] . '&display=' . $_POST['display']);
             } else {
                 printJSRedirect(get_index('navi.show'));
             }
         }
     } else {
         $_POST['staticsub'] = 1;
         $_POST['display'] = 'link';
         if ($_GET['display']) {
             $_POST['display'] = $_GET['display'];
         }
         if ($_GET['parent']) {
             $_POST['parent'] = $_GET['parent'];
         }
         //Baum
         $catlist = '<option value="root" style="font-weight:bold;"' . iif($_POST['parent'] == 'root', ' selected="selected"') . '>' . $apx->lang->get('ROOT') . '</option>';
         $data = $this->cat->getTree(array('text'), null, "nid='" . $_REQUEST['nid'] . "'");
         if (count($data)) {
             $catlist .= '<option value=""></option>';
             foreach ($data as $res) {
                 $catlist .= '<option value="' . $res['id'] . '"' . iif($_POST['parent'] == $res['id'], ' selected="selected"') . '>' . str_repeat('&nbsp;&nbsp;', $res['level'] - 1) . replace(shorttext($res['text'], 50)) . '</option>';
             }
         }
         //Link oder Code
         if ($_POST['display'] == 'code') {
             $apx->tmpl->assign('CODE', compatible_hsc($_POST['code']));
         } elseif ($_POST['display'] == 'link') {
             $apx->tmpl->assign('LINK', compatible_hsc($_POST['link']));
             $apx->tmpl->assign('LINK_POPUP', (int) $_POST['link_popup']);
         }
         $apx->tmpl->assign('DISPLAY', $_POST['display']);
         $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text']));
         $apx->tmpl->assign('STATICSUB', (int) $_POST['staticsub']);
         $apx->tmpl->assign('CATLIST', $catlist);
         $apx->tmpl->assign('NID', $_REQUEST['nid']);
         $apx->tmpl->assign('ACTION', 'add');
         $apx->tmpl->parse('add_edit');
     }
 }
Ejemplo n.º 14
0
 function addnews()
 {
     global $set, $db, $apx;
     if (!$apx->is_module('news')) {
         die('module news is not active!');
     }
     //Zeitraum generieren
     if (!$_POST['period'] && !$_POST['finish'] && !$_POST['send']) {
         $_POST['day_count'] = (int) $_POST['day_count'];
         $_POST['week_count'] = (int) $_POST['week_count'];
         $_POST['month_count'] = (int) $_POST['month_count'];
         if ($_POST['type'] == 'day' && $_POST['day_count']) {
             $_POST['period'] = $_POST['day_count'] * 24 * 3600;
         } elseif ($_POST['type'] == 'week' && $_POST['week_count']) {
             $_POST['period'] = $_POST['week_count'] * 7 * 24 * 3600;
         } elseif ($_POST['type'] == 'month' && $_POST['month_count']) {
             $_POST['period'] = $_POST['month_count'] * 30 * 24 * 3600;
         }
     }
     //Newsletter erstellen
     if ($_POST['finish']) {
         if ($_POST['send'] == 1) {
             if (!checkToken()) {
                 infoInvalidToken();
             } elseif (!$_POST['subject'] || !$_POST['text']) {
                 infoNotComplete();
             } else {
                 $_POST['addtime'] = time();
                 $db->dinsert(PRE . '_newsletter', 'catid,subject,text,text_html,addtime');
                 $insertid = $db->insert_id();
                 logit('NEWSLETTER_ADDNEWS', $insertid);
                 printJSRedirect('action.php?action=newsletter.show');
             }
         } else {
             if (is_array($_POST['news']) && count($_POST['news'])) {
                 foreach ($_POST['news'] as $id => $trash) {
                     $id = (int) $id;
                     if (!$id) {
                         continue;
                     }
                     $ids[] = $id;
                 }
                 //Sonderzeichen-Symbole entfernen
                 $trans = get_html_translation_table(HTML_ENTITIES);
                 $trans = array_flip($trans);
                 $data = $db->fetch("SELECT id,secid,title,subtitle,teaser,text FROM " . PRE . "_news WHERE id IN (" . implode(',', $ids) . ")");
                 if (count($data)) {
                     foreach ($data as $res) {
                         ++$ii;
                         //Image-Codes entfernen
                         $res['teaser'] = preg_replace('#{IMAGE\\( *[0-9]+ *\\)}#s', '', $res['teaser']);
                         $res['text'] = preg_replace('#{IMAGE\\( *[0-9]+ *\\)}#s', '', $res['text']);
                         $tmp = unserialize_section($res['secid']);
                         $newslink = HTTP_HOST . mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
                         $text .= strip_tags($res['title']) . "\n" . iif($res['teaser'], strip_tags(strtr($res['teaser'], $trans)) . "\n") . strip_tags(strtr($res['text'], $trans)) . "\n\n\n";
                         $text_html .= iif($ii > 1, '<br><br><br>') . '<b><a href="' . $newslink . '">' . $res['title'] . '</a></b><br>' . iif($res['teaser'], $res['teaser'] . '<br>') . $res['text'];
                     }
                 }
             }
             $_POST['text'] = trim($text);
             $_POST['text_html'] = trim($text_html);
         }
         //Kategorien
         $catinfo = $set['newsletter']['categories'];
         asort($catinfo);
         foreach ($catinfo as $id => $name) {
             $catlist .= '<option value="' . $id . '"' . iif(intval($_POST['catid']) == $id, 'selected="selected"') . '>' . $name . '</option>';
         }
         $apx->tmpl->assign('ACTION', 'add');
         $apx->tmpl->assign('SUBJECT', compatible_hsc($_POST['subject']));
         $apx->tmpl->assign('CATLIST', $catlist);
         $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text']));
         $apx->tmpl->assign('TEXT_HTML', compatible_hsc($_POST['text_html']));
         $apx->tmpl->parse('add_edit');
     } elseif ($_POST['period']) {
         //Sektions-Liste
         if (!is_array($_POST['secid']) || $_POST['secid'][0] == 'all') {
             $_POST['secid'] = array('all');
         }
         //Filter nach Sektionen
         $secfilter = '';
         if ($_POST['secid'][0] != 'all') {
             foreach ($_POST['secid'] as $secid) {
                 $secfilter .= " secid LIKE '%|" . intval($secid) . "|%' OR ";
             }
             $secfilter = " AND ( " . $secfilter . " secid='all' )";
         }
         $_POST['period'] = (int) $_POST['period'];
         list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE starttime>='" . (time() - $_POST['period']) . "' " . $secfilter);
         $maxpage = ceil($count / 10);
         $_REQUEST['p'] = (int) $_REQUEST['p'];
         if ($_POST['previous']) {
             --$_REQUEST['p'];
         }
         if ($_POST['next']) {
             ++$_REQUEST['p'];
         }
         if (!$_REQUEST['p']) {
             $_REQUEST['p'] = 1;
         }
         if ($_REQUEST['p'] < 1 || $_REQUEST['p'] > $maxpage) {
             $_REQUEST['p'] = 1;
         }
         if (!is_array($_POST['news'])) {
             $_POST['news'] = array();
         }
         $data = $db->fetch("SELECT id,title,subtitle,teaser,text FROM " . PRE . "_news WHERE starttime>='" . (time() - $_POST['period']) . "' " . $secfilter . " LIMIT " . ($_REQUEST['p'] - 1) * 10 . ",10");
         if (count($data)) {
             foreach ($data as $res) {
                 ++$i;
                 $tabledata[$i]['ID'] = $res['id'];
                 $tabledata[$i]['TITLE'] = strip_tags($res['title']);
                 if ($res['teaser']) {
                     $tabledata[$i]['TEXT'] = shorttext(strip_tags($res['teaser']), 200);
                 } else {
                     $tabledata[$i]['TEXT'] = shorttext(strip_tags($res['text']), 200);
                 }
                 $tabledata[$i]['CHECKED'] = iif(in_array($res['id'], $_POST['news']), 1, 0);
                 unset($_POST['news'][$res['id']]);
             }
         }
         //Ausgewählte News
         foreach ($_POST['news'] as $id => $trash) {
             $checkednews .= '<input type="hidden" name="news[' . $id . ']" value="' . $id . '" />';
         }
         //Sektionen
         $seclist = array();
         foreach ($_POST['secid'] as $secid) {
             $seclist[] = array('SECID' => $secid);
         }
         $apx->tmpl->assign('SECTION', $seclist);
         $apx->tmpl->assign('NEWS', $tabledata);
         $apx->tmpl->assign('MAXPAGE', $maxpage);
         $apx->tmpl->assign('PERIOD', $_POST['period']);
         $apx->tmpl->assign('P', $_REQUEST['p']);
         $apx->tmpl->assign('CHECKEDNEWS', $checkednews);
         $apx->tmpl->parse('addnews_choose');
     } else {
         if (!$_POST['day_count']) {
             $_POST['day_count'] = 7;
         }
         if (!$_POST['week_count']) {
             $_POST['week_count'] = 2;
         }
         if (!$_POST['month_count']) {
             $_POST['month_count'] = 1;
         }
         if (!$_POST['type']) {
             $_POST['type'] = 'day';
         }
         $apx->tmpl->assign('SECID', array('all'));
         $apx->tmpl->assign('TYPE', $_POST['type']);
         $apx->tmpl->assign('DAY_COUNT', $_POST['day_count']);
         $apx->tmpl->assign('WEEK_COUNT', $_POST['week_count']);
         $apx->tmpl->assign('MONTH_COUNT', $_POST['month_count']);
         $apx->tmpl->parse('addnews_period');
     }
 }
Ejemplo n.º 15
0
 function show()
 {
     global $set, $db, $apx, $html;
     //Suche durchführen
     if ($_REQUEST['item'] && ($_REQUEST['title'] || $_REQUEST['text']) || $_REQUEST['secid'] || $_REQUEST['catid'] || $_REQUEST['userid']) {
         $where = '';
         $_REQUEST['secid'] = (int) $_REQUEST['secid'];
         $_REQUEST['catid'] = (int) $_REQUEST['catid'];
         $_REQUEST['userid'] = (int) $_REQUEST['userid'];
         //Suche wird ausgeführt...
         if ($_REQUEST['title']) {
             $sc[] = "title LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
         }
         if ($_REQUEST['text']) {
             $sc[] = "text LIKE '%" . addslashes_like($_REQUEST['item']) . "%'";
         }
         if (is_array($sc)) {
             $where .= ' AND ( ' . implode(' OR ', $sc) . ' )';
         }
         //Sektion
         if (!$apx->session->get('section') && $_REQUEST['secid']) {
             $where .= " AND ( secid LIKE '%|" . $_REQUEST['secid'] . "|%' OR secid='all' ) ";
         }
         //Kategorie
         if ($_REQUEST['catid']) {
             $where .= " AND catid='" . $_REQUEST['catid'] . "' ";
         }
         //Benutzer
         if ($_REQUEST['userid']) {
             $where .= " AND userid='" . $_REQUEST['userid'] . "' ";
         }
         $data = $db->fetch("SELECT id FROM " . PRE . "_content WHERE 1 " . $where);
         $ids = get_ids($data, 'id');
         $ids[] = -1;
         $searchid = saveSearchResult('admin_content', $ids, array('title' => $_REQUEST['title'], 'text' => $_REQUEST['text'], 'item' => $_REQUEST['item'], 'catid' => $_REQUEST['catid'], 'secid' => $_REQUEST['secid'], 'userid' => $_REQUEST['userid']));
         header("HTTP/1.1 301 Moved Permanently");
         header('Location: action.php?action=content.show&searchid=' . $searchid);
         return;
     }
     //Vorgaben
     $_REQUEST['title'] = 1;
     $_REQUEST['text'] = 1;
     quicklink('content.add');
     $orderdef[0] = 'time';
     $orderdef['title'] = array('a.title', 'ASC', 'COL_TITLE');
     $orderdef['user'] = array('b.username', 'ASC', 'COL_USER');
     $orderdef['time'] = array('a.time', 'DESC', 'COL_ADDTIME');
     $orderdef['lastchange'] = array('a.lastchange', 'DESC', 'COL_LASTCHANGE');
     $orderdef['hits'] = array('a.hits', 'DESC', 'COL_HITS');
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_USER', 20, 'align="center"');
     $col[] = array('COL_LASTCHANGE', 20, 'align="center"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     //Suchergebnis?
     $resultFilter = '';
     if ($_REQUEST['searchid']) {
         $searchRes = getSearchResult('admin_content', $_REQUEST['searchid']);
         if ($searchRes) {
             list($resultIds, $resultMeta) = $searchRes;
             $_REQUEST['item'] = $resultMeta['item'];
             $_REQUEST['title'] = $resultMeta['title'];
             $_REQUEST['text'] = $resultMeta['text'];
             $_REQUEST['catid'] = $resultMeta['catid'];
             $_REQUEST['secid'] = $resultMeta['secid'];
             $_REQUEST['userid'] = $resultMeta['userid'];
             $resultFilter = " AND a.id IN (" . implode(', ', $resultIds) . ")";
         } else {
             $_REQUEST['searchid'] = '';
         }
     }
     //Sektionen auflisten
     $seclist = '';
     if (is_array($apx->sections) && count($apx->sections)) {
         foreach ($apx->sections as $res) {
             $seclist .= '<option value="' . $res['id'] . '"' . iif($_REQUEST['secid'] == $res['id'], ' selected="selected"') . '>' . replace($res['title']) . '</option>';
         }
     }
     //Kategorien auflisten
     $catlist = '';
     $data = $set['content']['groups'];
     if (count($data)) {
         foreach ($data as $id => $title) {
             $catlist .= '<option value="' . $id . '"' . iif($_REQUEST['catid'] == $id, ' selected="selected"') . '>' . replace($title) . '</option>';
         }
     }
     //Benutzer auflisten
     $userlist = '';
     $data = $db->fetch("SELECT b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE a.userid!=0 GROUP BY userid ORDER BY username ASC");
     if (count($data)) {
         foreach ($data as $res) {
             $userlist .= '<option value="' . $res['userid'] . '"' . iif($_REQUEST['userid'] == $res['userid'], ' selected="selected"') . '>' . replace($res['username']) . '</option>';
         }
     }
     $apx->tmpl->assign('ITEM', compatible_hsc($_REQUEST['item']));
     $apx->tmpl->assign('STITLE', (int) $_REQUEST['title']);
     $apx->tmpl->assign('STEXT', (int) $_REQUEST['text']);
     $apx->tmpl->assign('SECLIST', $seclist);
     $apx->tmpl->assign('CATLIST', $catlist);
     $apx->tmpl->assign('USERLIST', $userlist);
     $apx->tmpl->assign('EXTENDED', $searchRes);
     $apx->tmpl->parse('search');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_content AS a WHERE 1 " . $resultFilter . section_filter());
     pages('action.php?action=content.show&amp;sortby=' . $_REQUEST['sortby'] . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']), $count);
     $data = $db->fetch("SELECT a.id,a.secid,a.title,a.lastchange,a.allowcoms,a.allowrating,a.active,a.hits,b.userid,b.username FROM " . PRE . "_content AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE 1 " . $resultFilter . section_filter(true, 'a.secid') . " " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if ($res['active']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             $title = $res['title'];
             $title = strip_tags($title);
             //$title=str_replace('=>','»',$title);
             $title = str_replace('->', '»', $title);
             $title = shorttext($title, 40);
             $title = replace($title);
             $temp = explode('->', $res['title']);
             $tmp = unserialize_section($res['secid']);
             $link = mklink('content.php?id=' . $res['id'], 'content,' . $res['id'] . urlformat(array_pop($temp)) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $title . '</a>';
             $tabledata[$i]['COL3'] = replace($res['username']);
             $tabledata[$i]['COL4'] = mkdate($res['lastchange'], '<br />');
             $tabledata[$i]['COL5'] = $res['hits'];
             //Optionen
             if ($apx->user->has_right('content.edit') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.edit'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'content.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('content.del') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.del'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'content.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
             if ($res['active'] && $apx->user->has_right('content.disable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.disable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'content.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } elseif (!$res['active'] && $apx->user->has_right('content.enable') && ($res['userid'] == $apx->user->info['userid'] || $apx->user->has_spright('content.enable'))) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'content.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments') || $apx->is_module('ratings')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             }
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='content' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['content']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=content&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             if ($apx->is_module('ratings')) {
                 list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='content' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['content']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=content&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=content.show' . iif($_REQUEST['searchid'], '&amp;searchid=' . $_REQUEST['searchid']));
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 16
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('poll.add');
     $orderdef[0] = 'addtime';
     $orderdef['question'] = array('question', 'ASC', 'COL_QUESTION');
     $orderdef['addtime'] = array('addtime', 'DESC', 'COL_ADDTIME');
     $orderdef['starttime'] = array('starttime', 'DESC', 'COL_STARTTIME');
     $orderdef['endtime'] = array('endtime', 'DESC', 'COL_ENDTIME');
     $col[] = array('', 1, 'align="center"');
     $col[] = array('COL_QUESTION', 60, 'class="title"');
     $col[] = array('COL_STARTTIME', 20, 'align="center"');
     $col[] = array('COL_ENDTIME', 20, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_poll");
     pages('action.php?action=poll.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,secid,question,addtime,starttime,endtime,days,allowcoms FROM " . PRE . "_poll " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             if (!$res['starttime']) {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['endtime'] < time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotcross.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             } elseif ($res['starttime'] > time()) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendotwait.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             }
             $tmp = unserialize_section($res['secid']);
             $question = shorttext(strip_tags($res['question']), 60);
             $link = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html', iif($set['main']['forcesection'], iif(unserialize_section($res['secid']) == array('all'), $apx->section_default, array_shift($tmp)), 0));
             $tabledata[$i]['COL2'] = '<a href="' . $link . '" target="_blank">' . $question . '</a>';
             if ($res['starttime']) {
                 $tabledata[$i]['COL3'] = mkdate($res['starttime'], '<br />');
             }
             if ($res['starttime']) {
                 $tabledata[$i]['COL4'] = mkdate($res['starttime'] + $res['days'] * 24 * 3600, '<br />');
             }
             //Optionen
             if ($apx->user->has_right('poll.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'poll.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('poll.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'poll.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ((!$res['starttime'] || $res['endtime'] < time()) && $apx->user->has_right('poll.enable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('enable.gif', 'poll.enable', 'id=' . $res['id'], $apx->lang->get('CORE_ENABLE'));
             } elseif ($res['starttime'] && $apx->user->has_right('poll.disable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('disable.gif', 'poll.disable', 'id=' . $res['id'], $apx->lang->get('CORE_DISABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare
             if ($apx->is_module('comments')) {
                 $tabledata[$i]['OPTIONS'] .= '&nbsp;';
                 list($comments) = $db->first("SELECT count(mid) FROM " . PRE . "_comments WHERE ( module='poll' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['poll']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=poll&mid=' . $res['id'], $apx->lang->get('COMMENTS'));
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=poll.show');
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 17
0
 function sshow()
 {
     global $set, $db, $apx, $html;
     quicklink('news.sadd');
     $col[] = array('COL_TITLE', 50, '');
     $col[] = array('COL_LINK', 50, '');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'SORT_TITLE');
     $data = $db->fetch("SELECT * FROM " . PRE . "_news_sources" . getorder($orderdef));
     $imax = count($data);
     if ($imax) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = replace($res['title']);
             $tabledata[$i]['COL2'] = '<a href="../misc.php?action=redirect&amp;url=' . urlencode($res['link']) . '" target="_blank">' . shorttext($res['link'], 40) . '</a>';
             //Optionen
             if ($apx->user->has_right('news.sedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'news.sedit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('news.sdel')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'news.sdel', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=news.sshow');
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 18
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink_multi('guestbook.blockip');
     quicklink_multi('guestbook.blockcontent');
     quicklink_out();
     $orderdef[0] = 'time';
     $orderdef['name'] = array('username', 'ASC', 'COL_NAME');
     $orderdef['time'] = array('time', 'DESC', 'SORT_TIME');
     if ($set['guestbook']['mod']) {
         $col[] = array('', 1, 'align="center"');
     }
     $col[] = array('COL_NAME', 30, 'class="title"');
     $col[] = array('COL_TEXT', 50, '');
     $col[] = array('COL_IP', 20, 'align="center"');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_guestbook");
     pages('action.php?action=guestbook.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,username,text,ip,active,com_text FROM " . PRE . "_guestbook " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $icol = 0;
             //Moderiert -> Icons
             if ($set['guestbook']['mod']) {
                 if ($res['active']) {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
                 } else {
                     $tabledata[$i]['COL' . ++$icol] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
                 }
             }
             $tabledata[$i]['COL' . ++$icol] = replace($res['username']);
             $tabledata[$i]['COL' . ++$icol] = shorttext($res['text'], 50);
             $tabledata[$i]['COL' . ++$icol] = $res['ip'] . iif($apx->user->has_right('guestbook.blockip'), ' <a href="action.php?action=guestbook.blockip&amp;setip=' . $res['ip'] . '"><img src="design/block.gif" alt="' . $apx->lang->get('BLOCK') . '" title="' . $apx->lang->get('BLOCK') . '" /></a>');
             $tabledata[$i]['ID'] = $res['id'];
             //Optionen
             if ($apx->user->has_right('guestbook.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'guestbook.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('guestbook.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'guestbook.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Moderiert -> Enable/Disable
             if ($set['guestbook']['mod']) {
                 if ($res['active'] && $apx->user->has_right('guestbook.disable')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'guestbook.disable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
                 } elseif (!$res['active'] && $apx->user->has_right('guestbook.enable')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'guestbook.enable', 'id=' . $res['id'] . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             $tabledata[$i]['OPTIONS'] .= '&nbsp;';
             if ($apx->user->has_right('guestbook.com')) {
                 $icon = 'comment_none.gif';
                 if ($res['com_text']) {
                     $icon = 'comment.gif';
                 }
                 $tabledata[$i]['OPTIONS'] .= optionHTML($icon, 'guestbook.com', 'id=' . $res['id'], $apx->lang->get('ADDCOM'));
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('guestbook.del')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=guestbook.del&module=' . $this->module . '&mid=' . $this->mid);
     }
     if ($set['guestbook']['mod']) {
         if ($apx->user->has_right('guestbook.enable')) {
             $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=guestbook.enable&module=' . $this->module . '&mid=' . $this->mid);
         }
         if ($apx->user->has_right('guestbook.disable')) {
             $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=guestbook.disable&module=' . $this->module . '&mid=' . $this->mid);
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=guestbook.show&amp;id=' . $_REQUEST['id']);
     save_index($_SERVER['REQUEST_URI']);
 }
Ejemplo n.º 19
0
 function pshow()
 {
     global $set, $db, $apx, $html;
     $_REQUEST['id'] = (int) $_REQUEST['id'];
     if (!$_REQUEST['id']) {
         die('missing ID!');
     }
     quicklink('gallery.padd', 'action.php', 'id=' . $_REQUEST['id']);
     $orderdef[0] = 'time';
     $orderdef['time'] = array('id', 'DESC', 'SORT_ADDTIME');
     $orderdef['caption'] = array('caption', 'ASC', 'COL_CAPTION');
     $orderdef['hits'] = array('hits', 'DESC', 'COL_HITS');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('&nbsp;', 1, '');
     $col[] = array('COL_THUMBNAIL', 20, 'align="center"');
     $col[] = array('COL_CAPTION', 70, 'class="title"');
     $col[] = array('COL_HITS', 10, 'align="center"');
     list($title) = $db->first("SELECT title FROM " . PRE . "_gallery WHERE ( id='" . $_REQUEST['id'] . "' ) LIMIT 1");
     echo '<h2>' . $apx->lang->get('GALLERY') . ': ' . $title . '</h2>';
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $_REQUEST['id'] . "')");
     pages('action.php?action=gallery.pshow&amp;id=' . $_REQUEST['id'] . '&amp;sortby=' . $_REQUEST['sortby'], $count);
     //Preview-Bild
     list($previewpic) = $db->first("SELECT preview FROM " . PRE . "_gallery WHERE ( id='" . $_REQUEST['id'] . "') LIMIT 1");
     $data = $db->fetch("SELECT * FROM " . PRE . "_gallery_pics WHERE galid='" . $_REQUEST['id'] . "' " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             //Aktiv-Anzeige
             if ($res['active']) {
                 $tabledata[$i]['COL1'] = '<img src="design/greendot.gif" alt="' . $apx->lang->get('CORE_ACTIVE') . '" title="' . $apx->lang->get('CORE_ACTIVE') . '" />';
             } else {
                 $tabledata[$i]['COL1'] = '<img src="design/reddot.gif" alt="' . $apx->lang->get('CORE_INACTIVE') . '" title="' . $apx->lang->get('CORE_INACTIVE') . '" />';
             }
             //Vorschau-Bild
             if ($previewpic == $res['thumbnail']) {
                 $tabledata[$i]['COL2'] = '<img src="design/previewicon.gif" alt="' . $apx->lang->get('IS_PREVIEW') . '" title="' . $apx->lang->get('IS_PREVIEW') . '" />';
             } else {
                 $tabledata[$i]['COL2'] = '&nbsp;';
             }
             //POTW
             if ($res['potw']) {
                 $tabledata[$i]['COL3'] = '<img src="design/default.gif" alt="' . $apx->lang->get('IS_POTW') . '" title="' . $apx->lang->get('IS_POTW') . '" />';
             } else {
                 $tabledata[$i]['COL3'] = '&nbsp;';
             }
             $caption = shorttext(strip_tags($res['caption']), 50);
             $tabledata[$i]['ID'] = $res['id'];
             $tabledata[$i]['COL4'] = '<a href="../' . getpath('uploads') . $res['picture'] . '" target="_blank"><img src="../' . getpath('uploads') . $res['thumbnail'] . '" alt="thumbnail" /></a>';
             $tabledata[$i]['COL5'] = iif($caption, $caption, '&nbsp;');
             $tabledata[$i]['COL6'] = number_format($res['hits'], 0, '', '.');
             //Optionen
             if ($apx->user->has_right('gallery.pedit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('edit.gif', 'gallery.pedit', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('CORE_EDIT'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('gallery.pmove')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('move.gif', 'gallery.pmove', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('MOVE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($apx->user->has_right('gallery.pdel')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'gallery.pdel', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('CORE_DEL'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['active'] && $apx->user->has_right('gallery.pdisable') && !$res['potw'] && !$res['preview']) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('disable.gif', 'gallery.pdisable', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']) . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_DISABLE'));
             } elseif (!$res['active'] && $apx->user->has_right('gallery.penable')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('enable.gif', 'gallery.penable', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']) . '&sectoken=' . $apx->session->get('sectoken'), $apx->lang->get('CORE_ENABLE'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             $tabledata[$i]['OPTIONS'] .= '<br />';
             if ($res['active'] && !$res['potw'] && $apx->user->has_right('gallery.potw')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('potw.gif', 'gallery.potw', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('POTW'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             if ($res['active'] && $previewpic != $res['thumbnail'] && $apx->user->has_right('gallery.preview')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('previewpic.gif', 'gallery.preview', 'id=' . $res['id'] . '&gid=' . intval($_REQUEST['id']), $apx->lang->get('PREVIEW'));
             } else {
                 $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
             }
             //Kommentare + Bewertungen
             if ($apx->is_module('comments')) {
                 list($comments) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='gallery' AND mid='" . $res['id'] . "' )");
                 if ($comments && ($apx->is_module('comments') && $set['gallery']['coms']) && $res['allowcoms'] && $apx->user->has_right('comments.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('comments.gif', 'comments.show', 'module=gallery&mid=' . $res['id'], $apx->lang->get('COMMENTS') . ' (' . $comments . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
             if ($apx->is_module('ratings')) {
                 list($ratings) = $db->first("SELECT count(id) FROM " . PRE . "_ratings WHERE ( module='gallery' AND mid='" . $res['id'] . "' )");
                 if ($ratings && ($apx->is_module('ratings') && $set['gallery']['ratings']) && $res['allowrating'] && $apx->user->has_right('ratings.show')) {
                     $tabledata[$i]['OPTIONS'] .= optionHTML('ratings.gif', 'ratings.show', 'module=gallery&mid=' . $res['id'], $apx->lang->get('RATINGS') . ' (' . $ratings . ')');
                 } else {
                     $tabledata[$i]['OPTIONS'] .= '<img src="design/ispace.gif" alt="" />';
                 }
             }
         }
     }
     $multiactions = array();
     if ($apx->user->has_right('gallery.pmove')) {
         $multiactions[] = array($apx->lang->get('MOVE'), 'action.php?action=gallery.pmove&gid=' . intval($_REQUEST['id']), true);
     }
     if ($apx->user->has_right('gallery.pdel')) {
         $multiactions[] = array($apx->lang->get('CORE_DEL'), 'action.php?action=gallery.pdel&gid=' . intval($_REQUEST['id']), false);
     }
     if ($apx->user->has_right('gallery.penable')) {
         $multiactions[] = array($apx->lang->get('CORE_ENABLE'), 'action.php?action=gallery.penable&gid=' . intval($_REQUEST['id']), false);
     }
     if ($apx->user->has_right('gallery.pdisable')) {
         $multiactions[] = array($apx->lang->get('CORE_DISABLE'), 'action.php?action=gallery.pdisable&gid=' . intval($_REQUEST['id']), false);
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col, $multiactions);
     orderstr($orderdef, 'action.php?action=gallery.pshow&amp;id=' . $_REQUEST['id']);
     save_index($_SERVER['REQUEST_URI']);
 }