Exemplo n.º 1
0
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once file_exists('maincore.php') ? 'maincore.php' : __DIR__ . "/../../maincore.php";
if (!db_exists(DB_FAQS)) {
    redirect(BASEDIR . "error.php?code=404");
}
require_once THEMES . "templates/header.php";
if (file_exists(INFUSIONS . "faq/locale/" . LOCALESET . "faq.php")) {
    include INFUSIONS . "faq/locale/" . LOCALESET . "faq.php";
} else {
    include INFUSIONS . "faq/locale/English/faq.php";
}
include "templates/faq.php";
add_to_title($locale['global_200'] . \PHPFusion\SiteLinks::get_current_SiteLinks("", "link_name"));
if (isset($_GET['cat_id']) && isnum($_GET['cat_id'])) {
    $result = dbquery("SELECT *\tFROM " . DB_FAQ_CATS . " " . (multilang_table("FQ") ? "WHERE faq_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " faq_cat_id='" . intval($_GET['cat_id']) . "'");
    if (dbrows($result) > 0) {
        $data = dbarray($result);
        add_to_title($locale['global_201'] . $data['faq_cat_name']);
        $data['faq_link'] = INFUSIONS . "faq/faq.php?cat_id=" . $data['faq_cat_id'];
        $info = $data;
        if (dbcount("(faq_id)", DB_FAQS, "faq_cat_id='" . intval($_GET['cat_id']) . "'")) {
            $result = dbquery("SELECT faq_id, faq_question, faq_answer from " . DB_FAQS . " WHERE faq_cat_id='" . intval($_GET['cat_id']) . "' ORDER BY faq_question");
            while ($data = dbarray($result)) {
                $info['items'][$data['faq_id']] = $data;
            }
        } else {
            $info['nofaq_items'] = $locale['411'];
        }
Exemplo n.º 2
0
                     }
                     if ($data['photo_allow_ratings']) {
                         $data += array("sum_rating" => $data['sum_rating'] > 0 ? $data['sum_rating'] : '0', "photo_ratings" => array('link' => $data['photo_link']['link'] . '#ratings', 'name' => $data['sum_rating'], 'word' => $data['sum_rating'] > 0 ? $data['sum_rating'] / $data['count_rating'] * 10 . "/10" : "0/10"));
                     }
                     $info['item'][] = $data;
                 }
             }
         }
         render_photo_album($info);
     } else {
         redirect(INFUSIONS . 'gallery/gallery.php');
     }
 } else {
     /* Main Index */
     add_to_title($locale['global_200'] . \PHPFusion\SiteLinks::get_current_SiteLinks("", "link_name"));
     add_breadcrumb(array('link' => INFUSIONS . 'gallery/gallery.php', 'title' => \PHPFusion\SiteLinks::get_current_SiteLinks("", "link_name")));
     $info['max_rows'] = dbcount("(album_id)", DB_PHOTO_ALBUMS, groupaccess('album_access'));
     $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $info['max_rows'] ? $_GET['rowstart'] : 0;
     if ($info['max_rows'] > 0) {
         $info['page_nav'] = $info['max_rows'] > $gallery_settings['gallery_pagination'] ? makepagenav($_GET['rowstart'], $gallery_settings['gallery_pagination'], $info['max_rows'], 3) : '';
         $result = dbquery("SELECT ta.album_id, ta.album_title, ta.album_description, ta.album_image, ta.album_thumb1, ta.album_thumb2, ta.album_datestamp,\n\t\t\ttu.user_id, tu.user_name, tu.user_status\n\t\t\tFROM " . DB_PHOTO_ALBUMS . " ta\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ta.album_user=tu.user_id\n\t\t\t" . (multilang_table("PG") ? "WHERE album_language='" . LANGUAGE . "' AND" : "WHERE") . "\n\t\t\t" . groupaccess('album_access') . " ORDER BY album_order\n\t\t\tLIMIT " . $_GET['rowstart'] . ", " . $gallery_settings['gallery_pagination']);
         while ($data = dbarray($result)) {
             $data['album_link'] = array("link" => INFUSIONS . "gallery/gallery.php?album_id=" . $data['album_id'], "name" => $data['album_title']);
             if (iADMIN && checkrights("PH")) {
                 global $aidlink;
                 $data['album_edit'] = array("link" => INFUSIONS . "gallery/gallery_admin.php" . $aidlink . "&amp;section=album_form&amp;action=edit&amp;cat_id=" . $data['album_id'], "name" => $locale['edit']);
                 $data['album_delete'] = array("link" => INFUSIONS . "gallery/gallery_admin.php" . $aidlink . "&amp;section=album_form&amp;action=delete&amp;cat_id=" . $data['album_id'], "name" => $locale['delete']);
             }
             $photo_directory = !SAFEMODE ? "album_" . $data['album_id'] : '';
             $data['image'] = '';
             if ($data['album_image']) {
Exemplo n.º 3
0
    redirect(BASEDIR . "error.php?code=404");
}
require_once THEMES . "templates/header.php";
require_once INCLUDES . "infusions_include.php";
if (file_exists(INFUSIONS . "downloads/locale/" . LOCALESET . "downloads.php")) {
    $locale += fusion_get_locale("", INFUSIONS . "downloads/locale/" . LOCALESET . "downloads.php");
} else {
    $locale += fusion_get_locale("", INFUSIONS . "downloads/locale/English/downloads.php");
}
include INFUSIONS . "downloads/templates/downloads.php";
require_once INFUSIONS . "downloads/classes/Functions.php";
$dl_settings = get_settings("downloads");
if (!isset($_GET['download_id']) && !isset($_GET['cat_id'])) {
    add_to_title($locale['global_200'] . \PHPFusion\SiteLinks::get_current_SiteLinks("", "link_name"));
}
add_breadcrumb(array('link' => INFUSIONS . 'downloads/downloads.php', 'title' => \PHPFusion\SiteLinks::get_current_SiteLinks("", "link_name")));
$result = NULL;
if (isset($_GET['file_id']) && isnum($_GET['file_id'])) {
    $res = 0;
    $data = dbarray(dbquery("SELECT download_url, download_file, download_cat, download_visibility FROM " . DB_DOWNLOADS . " WHERE download_id='" . intval($_GET['file_id']) . "'"));
    if (checkgroup($data['download_visibility'])) {
        $result = dbquery("UPDATE " . DB_DOWNLOADS . " SET download_count=download_count+1 WHERE download_id='" . intval($_GET['file_id']) . "'");
        if (!empty($data['download_file']) && file_exists(DOWNLOADS . 'files/' . $data['download_file'])) {
            $res = 1;
            require_once INCLUDES . "class.httpdownload.php";
            ob_end_clean();
            $object = new httpdownload();
            $object->set_byfile(DOWNLOADS . 'files/' . $data['download_file']);
            $object->use_resume = TRUE;
            $object->download();
            exit;
Exemplo n.º 4
0
 /**
  * Executes single news item information - $_GET['readmore']
  * @param $news_id
  */
 public function set_NewsItemInfo($news_id)
 {
     global $aidlink;
     $locale = fusion_get_locale('', NEWS_LOCALE);
     $settings = fusion_get_settings();
     set_title(SiteLinks::get_current_SiteLinks("", "link_name"));
     add_breadcrumb(array('link' => INFUSIONS . 'news/news.php', 'title' => SiteLinks::get_current_SiteLinks("", "link_name")));
     $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) ? $_GET['rowstart'] : 0;
     $result = dbquery(self::get_NewsQuery(array('condition' => 'news_id=' . intval($news_id))));
     if (dbrows($result) > 0) {
         include INCLUDES . "comments_include.php";
         include INCLUDES . "ratings_include.php";
         $data = dbarray($result);
         if ($data['news_keywords'] !== "") {
             set_meta("keywords", $data['news_keywords']);
         }
         if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
             $result2 = dbquery("UPDATE " . DB_NEWS . " SET news_reads=news_reads+1 WHERE news_id='" . $_GET['readmore'] . "'");
             $data['news_reads']++;
         }
         $news_subject = $data['news_subject'];
         $news_news = preg_split("/<!?--\\s*pagebreak\\s*-->/i", $data['news_breaks'] == "y" ? nl2br(parse_textarea($data['news_extended'] ? $data['news_extended'] : $data['news_news'])) : parse_textarea($data['news_extended'] ? $data['news_extended'] : $data['news_news']));
         $pagecount = count($news_news);
         $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $pagecount ? $_GET['rowstart'] : 0;
         $admin_actions = array();
         if (iADMIN && checkrights("N")) {
             $admin_actions = array("edit" => INFUSIONS . "news/news_admin.php" . $aidlink . "&amp;action=edit&amp;section=nform&amp;news_id=" . $data['news_id'], "delete" => INFUSIONS . "news/news_admin.php" . $aidlink . "&amp;action=delete&amp;section=nform&amp;news_id=" . $data['news_id']);
         }
         $news_info = $this->get_NewsData($data);
         /*
                         array(
                         "news_id" => $data['news_id'],
                         "user_id" => $data['user_id'],
                         "user_name" => $data['user_name'],
                         "user_status" => $data['user_status'],
                         "user_joined" => $data['user_joined'],
                         "user_level" => $data['user_level'],
                         "user_avatar" => $data['user_avatar'],
                         "news_datestamp" => $data['news_datestamp'],
                         "news_ialign" => $data['news_ialign'],
                         "cat_id" => $data['news_cat'],
                         "news_cat_name" => $data['news_cat_name'],
                         "news_cat_image_src" => !empty($data['news_cat_image']) && file_exists(IMAGES_NC.$data['news_cat_image']) ? IMAGES_NC.$data['news_cat_image'] : "",
                         "news_image_src" => !empty($data['news_image']) && file_exists(IMAGES_N.$data['news_image']) ? IMAGES_N.$data['news_image'] : "",
                         "cat_image" => $data['news_cat_image'],
                         "news_subject" => $data['news_subject'],
                         "news_descr" => $data['news_news'],
                         "news_cat_url" => INFUSIONS.'news/news.php?cat_id='.$data['news_cat'],
                         'news_url' => INFUSIONS.'news/news.php?readmore='.$data['news_id'],
                         'news_news' => $news_news[$_GET['rowstart']],
                         "news_ext" => "n",
                         "news_keywords" => $data['news_keywords'],
                         "news_reads" => $data['news_reads'],
                         "news_comments" => $data['count_comment'],
                         'news_sum_rating' => $data['sum_rating'] ? $data['sum_rating'] : 0,
                         'news_count_votes' => $data['count_votes'],
                         "news_allow_comments" => $data['news_allow_comments'],
                         'news_allow_ratings' => $data['news_allow_ratings'],
                         "news_sticky" => $data['news_sticky'],
                         "print_link" => BASEDIR."print.php?type=N&amp;item_id=".$data['news_id'],
                         'admin_actions' => $admin_actions,
                     ); */
         if (fusion_get_settings("create_og_tags")) {
             add_to_head("<meta property='og:title' content='" . $data['news_subject'] . "' />");
             add_to_head("<meta property='og:description' content='" . strip_tags($data['news_news']) . "' />");
             add_to_head("<meta property='og:site_name' content='" . fusion_get_settings('sitename') . "' />");
             add_to_head("<meta property='og:type' content='article' />");
             add_to_head("<meta property='og:url' content='" . $settings['siteurl'] . "infusions/news.php?readmore=" . $_GET['readmore'] . "' />");
             if ($data['news_image']) {
                 $og_image = IMAGES_N . $data['news_image'];
             } else {
                 $og_image = IMAGES_NC . $data['news_cat_image'];
             }
             $og_image = str_replace(BASEDIR, $settings['siteurl'], $og_image);
             add_to_head("<meta property='og:image' content='" . $og_image . "' />");
         }
         $_GET['cat_id'] = $data['news_cat_id'];
         set_title($news_subject . $locale['global_200'] . $locale['news_0004']);
         $news_cat_index = dbquery_tree(DB_NEWS_CATS, 'news_cat_id', 'news_cat_parent');
         $this->news_cat_breadcrumbs($news_cat_index);
         add_breadcrumb(array('link' => INFUSIONS . "news/news.php?readmore=" . $data['news_id'], 'title' => $data['news_subject']));
         $info['news_item'] = $news_info;
         $info['news_item']['page_count'] = $pagecount;
     } else {
         redirect(INFUSIONS . "news/news.php");
     }
     return $info;
 }