public function action($gpc)
 {
     $this->_smarty->config_load('textes.de.conf', 'Image');
     $this->_img_textes = $this->_smarty->get_config_vars();
     $this->_gpc = $gpc;
     if (isset($gpc['GET']['img'])) {
         $this->_initImg($gpc['GET']['img']);
     } elseif (isset($gpc['GET']['thumb'])) {
         $this->_initThumb($gpc['GET']['thumb']);
     } else {
         $this->_initErrImg($this->_img_textes['no_param']);
     }
 }
 /**
  * Führt die einzelnen Methoden aus, abhängig vom Parameter
  *
  * @param array $gpc $_POST- und $_GET-Arrays
  * @global string dir_smilies Used for the dir where the smilies-gif are saved
  * @global int gbook_entries_per_page
  * @return boolean
  */
 public function action($gpc)
 {
     //Daten laden
     $this->_smarty->config_load('textes.de.conf', 'Gbook');
     $this->_configvars['Gbook'] = $this->_smarty->get_config_vars();
     $this->_smarty->config_load('textes.de.conf', 'Form_Error');
     $this->_configvars['Error'] = $this->_smarty->get_config_vars();
     $this->_gpc = $gpc;
     $this->_msbox = new MessageBoxes($this->_mysql, 'gbook', array('ID' => 'gbook_ID', 'ref_ID' => 'gbook_ref_ID', 'content' => 'gbook_content', 'name' => 'gbook_name', 'time' => 'gbook_time', 'email' => 'gbook_email', 'hp' => 'gbook_hp', 'title' => 'gbook_title'));
     $this->_smilie = new Smilies(SMILIES_DIR);
     if (isset($this->_gpc['GET']['action'])) {
         switch ($this->_gpc['GET']['action']) {
             case 'new':
                 $this->_add();
                 break;
             case 'comment':
                 $this->_comment();
                 break;
             case 'view':
                 $this->_view(GBOOK_ENTRIES_PER_PAGE);
                 break;
             case '':
                 $this->_view(GBOOK_ENTRIES_PER_PAGE);
                 break;
             default:
                 throw new CMSException(array('gbook' => 'invalid_option'), EXCEPTION_MODULE_CODE);
         }
     } else {
         $this->_view(GBOOK_ENTRIES_PER_PAGE);
     }
     return true;
 }
 /**
  * Liefert der Path der Kategorien aus von der angegebenen Kategorie bis zur Hauptseite.
  * Das zurückgelieferte Array sieht etwa folgendermassen aus:
  * array(0 => Hauptseite, 1 => Kategorie 1, 2 => Kategorie 1.1, 3 => ...)
  *
  * @param int $cat_ID KategorieID der untersten Kategorie
  * @param bool[optional] $inc_catID Gibt an, ob die Kategorie mit ID = $cat_ID auch in der Wurzel vorkommen soll
  * @param bool[optional] $inc_hs Gibt an, ob der Eintrag 'Hauptseite' auch in der Wurzel vorkommen soll
  * @return array $root_array Path der Kategorien.
  */
 private function _getRoot($cat_ID, $inc_catID = false, $inc_hs = true)
 {
     /* Wurzel auslesen */
     $tmp_arr = array();
     if ($inc_catID == false) {
         $this->_mysql->query("SELECT `ref_ID` FROM `gallery_categories` WHERE `ID` = '{$cat_ID}' LIMIT 1");
         $data = $this->_mysql->fetcharray('assoc');
         $tmp_ID = $data['ref_ID'];
     } else {
         $tmp_ID = $cat_ID;
     }
     for ($i = 0; $tmp_ID != 0; $i++) {
         $this->_mysql->query("SELECT `ID`,`ref_ID`,`name` FROM `gallery_categories` WHERE `ID` = '{$tmp_ID}' LIMIT 1");
         $tmp_arr[$i] = $this->_mysql->fetcharray('assoc');
         $tmp_ID = $tmp_arr[$i]['ref_ID'];
     }
     if ($inc_hs == true) {
         /*Hauptseite noch einfügen*/
         $this->_smarty->config_load('textes.de.conf', 'Gallery');
         $gallery_textes = $this->_smarty->get_config_vars();
         $tmp_arr[++$i] = array('ID' => '0', 'name' => $gallery_textes['mainsite']);
         return array_reverse($tmp_arr);
     } else {
         return null;
     }
 }
 /**
  * Fuehrt die einzelnen Methoden aus, abhaengig vom parameter
  *
  * @param array $parameters POST, GET und COOKIE-Variablen
  */
 public function action($gpc)
 {
     //Daten initialisieren
     $this->_gpc['POST'] = $gpc['POST'];
     $this->_gpc['GET'] = $gpc['GET'];
     /* Daten laden */
     $section_load = array('Editor', 'Editor-Entry', 'Editor-Error', 'Menu');
     foreach ($section_load as $section) {
         $this->_smarty->config_load('textes.de.conf', $section);
         $this->_config_textes["{$section}"] = $this->_smarty->get_config_vars();
     }
     $this->_nav_id = $this->_smarty->get_template_vars('local_link');
     if (key_exists('ref_ID', $this->_gpc['GET']) && is_numeric($this->_gpc['GET']['ref_ID'])) {
         $id = (int) $this->_gpc['GET']['ref_ID'];
     }
     //Je nach Get-Parameter die zugehörige Anweisung ausfuehren
     if (key_exists('action', $this->_gpc['GET'])) {
         switch ($this->_gpc['GET']['action']) {
             case 'new':
                 $this->_create();
                 break;
             case 'edit':
                 $this->_edit($id);
                 break;
             case 'del':
                 $this->_del($id);
                 break;
             default:
                 $this->_view();
         }
         return true;
     } else {
         $this->_view();
         return true;
     }
 }
 /**
  * Start des Moduls
  *
  * @param array $gpc
  */
 public function action($gpc)
 {
     $this->_gpc = $gpc;
     //Daten laden
     $this->_smarty->config_load('textes.de.conf', 'Mail');
     $this->_config_textes['Mail'] = $this->_smarty->get_config_vars();
     $this->_smarty->config_load('textes.de.conf', 'Form_Error');
     $this->_config_textes['Error'] = $this->_smarty->get_config_vars();
     if (key_exists('hash', $gpc['GET']) && is_string($gpc['GET']['hash'])) {
         $this->_truemail_send($gpc['GET']['hash']);
     } elseif (key_exists('nav_id', $gpc['GET']) && is_numeric($gpc['GET']['nav_id'])) {
         $this->_checkmail_send($gpc['GET']['nav_id']);
     } else {
         throw new CMSException(array('mail' => 'invalid_param'), EXCEPTION_MODULE_CODE);
     }
 }
 /**
  * Fuehrt die einzelnen Methoden aus, abhaengig vom parameter
  *
  * @param array $parameters POST, GET und COOKIE-Variablen
  */
 public function action($gpc)
 {
     //Daten laden
     $this->_smarty->config_load('textes.de.conf', 'News');
     $this->_config_textes['News'] = $this->_smarty->get_config_vars();
     $this->_smarty->config_load('textes.de.conf', 'Form_Error');
     $this->_config_textes['Error'] = $this->_smarty->get_config_vars();
     $this->_gpc = $gpc;
     $this->_nav_id = $this->_smarty->get_template_vars('local_link');
     $this->_msbox = new Messageboxes($this->_mysql, 'news', array('ID' => 'news_ID', 'ref_ID' => 'news_ref_ID', 'content' => 'news_content', 'name' => 'news_name', 'time' => 'news_time', 'email' => 'news_email', 'hp' => 'news_hp', 'title' => 'news_title'));
     $this->_smilie = new Smilies(SMILIES_DIR);
     if ($this->_getStatus() == 'off') {
         $this->_smarty->assign('info', $this->_config_textes['News']['modul_deactivated']);
     }
     //Je nach Get-Parameter die zugehörige Anweisung ausfuehren
     if (key_exists('action', $this->_gpc['GET'])) {
         switch ($this->_gpc['GET']['action']) {
             case 'new':
                 $this->_add();
                 return true;
             case 'comment':
                 $this->_comment();
                 return true;
             case 'edit':
                 $this->_edit();
                 return true;
             case 'del':
                 $this->_del();
                 return true;
             case 'view':
                 $this->_view(15);
                 return true;
             case '':
                 $this->_view(15);
                 return true;
             default:
                 //Falsche Angaben enden im Fehler
                 throw new CMSException(array('news' => 'invalid_url'), EXCEPTION_MODULE_CODE);
         }
     } else {
         //Keine Angabe -> Ausgabe der News
         $this->_view(15);
         return true;
     }
 }
 /**
  * Führt die einzelnen Methoden aus, abhängig vom Parameter
  *
  * @param array $gpc $_POST- und $_GET-Arrays
  * @return boolean
  * @uses Smarty als Template-System
  */
 public function action($gpc)
 {
     //Daten laden
     $this->_smarty->config_load('textes.de.conf', 'Gbook');
     $this->_configvars['Gbook'] = $this->_smarty->get_config_vars();
     $this->_smarty->config_load('textes.de.conf', 'Form_Error');
     $this->_configvars['Error'] = $this->_smarty->get_config_vars();
     $this->_gpc = $gpc;
     $this->_nav_id = $this->_smarty->get_template_vars('local_link');
     $this->_msbox = new MessageBoxes($this->_mysql, 'gbook', array('ID' => 'gbook_ID', 'ref_ID' => 'gbook_ref_ID', 'content' => 'gbook_content', 'name' => 'gbook_name', 'time' => 'gbook_time', 'email' => 'gbook_email', 'hp' => 'gbook_hp', 'title' => 'gbook_title'));
     $this->_smilie = new Smilies(SMILIES_DIR);
     if ($this->_getStatus() == 'off') {
         $this->_smarty->assign('info', $this->_configvars['Gbook']['modul_deactivated']);
     }
     if (key_exists('action', $this->_gpc['GET'])) {
         switch ($this->_gpc['GET']['action']) {
             case 'new':
                 $this->_add();
                 break;
             case 'comment':
                 $this->_comment();
                 break;
             case 'edit':
                 $this->_edit();
                 break;
             case 'del':
                 $this->_del();
                 break;
             case 'view':
                 $this->_view(5);
                 break;
             case '':
                 $this->_view(5);
                 break;
             default:
                 throw new CMSException(array('gbook' => 'invalid_option'), EXCEPTION_MODULE_CODE);
         }
     } else {
         $this->_view(5);
     }
     return true;
 }
Example #8
0
<?php

include_once 'internal/Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'smartyvariables.php';
check_referrer();
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Change_Template');
$navwhere['link1'] = getmyurl('profile', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Change_Template'));
// pagename
define('pagename', 'settemplate');
$main_smarty->assign('pagename', pagename);
if (isset($_GET['template'])) {
    if (file_exists("./templates/" . $_GET['template'] . "/link_summary.tpl")) {
        $domain = !strstr($_SERVER['HTTP_HOST'], '.') ? '' : preg_replace('/^www/', '', $_SERVER['HTTP_HOST']);
        setcookie("template", $_GET['template'], time() + 60 * 60 * 24 * 30, $my_pligg_base, $domain);
        header('Location: ./index.php');
        die;
    } else {
        $main_smarty->assign('message', '<div class="alert alert-error">Warning: <strong>"' . sanitize($_GET['template'], 3) . '"</strong> does not seem to exist!</div>');
    }
}
// show the template
$main_smarty->assign('tpl_center', $the_template . '/settemplate_center');
$main_smarty->display($the_template . '/pligg.tpl');
Example #9
0
$search->filterToStatus = "published";
// this is for the tabs on the top that filter
if (isset($_GET['part'])) {
    $search->setmek = $db->escape($_GET['part']);
}
$search->do_setmek();
// do the search
$search->doSearch();
$linksum_count = $search->countsql;
$linksum_sql = $search->sql;
if (isset($_REQUEST['category'])) {
    $category_data = get_cached_category_data('category_safe_name', sanitize($_REQUEST['category'], 1));
    $main_smarty->assign('meta_description', $category_data->category_desc);
    $main_smarty->assign('meta_keywords', $category_data->category_keywords);
    // breadcrumbs and page title for the category we're looking at
    $main_smarty->assign('title', '' . $main_smarty->get_config_vars('PLIGG_Visual_Published_News') . ' - ' . $thecat . '');
    $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Published_News');
    $navwhere['link1'] = getmyurl('root', '');
    $navwhere['text2'] = $thecat;
    $main_smarty->assign('navbar_where', $navwhere);
    $main_smarty->assign('pretitle', $thecat);
    $main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Published_News'));
    $main_smarty->assign('page_header', $thecat . $main_smarty->get_config_vars('PLIGG_Visual_Published_News'));
    // pagename
    define('pagename', 'published');
    $main_smarty->assign('pagename', pagename);
} else {
    // breadcrumbs and page title
    $navwhere['show'] = 'yes';
    $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Published_News');
    $navwhere['link1'] = getmyurl('root', '');
            $this->check_should_publish();
            $vars = array('vote' => $this);
            check_actions('link_insert_vote_post', $vars);
            return true;
        }
        return false;
    }
}
check_referrer();
$post_id = sanitize($_POST['id'], 3);
if (is_numeric($post_id) && $post_id > 0) {
    $link = new LinkTotal();
    $link->id = $post_id;
    $link->read_basic();
    if ($current_user->user_id == 0 && !anonymous_vote) {
        error($main_smarty->get_config_vars('PLIGG_Visual_Vote_NoAnon'));
    }
    $post_user = sanitize($_POST['user'], 3);
    if ($current_user->user_id != $post_user) {
        error($main_smarty->get_config_vars('PLIGG_Visual_Vote_BadUser') . $current_user->user_id . '-' . $post_user);
    }
    $md5 = md5($post_user . $link->randkey);
    if ($md5 !== sanitize($_POST['md5'], 3)) {
        error($main_smarty->get_config_vars('PLIGG_Visual_Vote_BadKey'));
    }
    $value = sanitize($_POST['value'], 3);
    if (sanitize($_POST['unvote'], 3) == 'true') {
        $link->remove_vote($current_user->user_id, $value);
    } else {
        if ($link->votes($current_user->user_id) > 0 || $link->reports($current_user->user_id) > 0 || votes_per_ip > 0 && $link->votes_from_ip() + $link->reports_from_ip() >= votes_per_ip) {
            /////
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'user.php';
include mnminclude . 'smartyvariables.php';
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Live');
$navwhere['link1'] = getmyurl('live', '');
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Unpublished');
$navwhere['link2'] = getmyurl('live_unpublished', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Queued'));
// figure out what "page" of the results we're on
$offset = (get_current_page() - 1) * $top_users_size;
// always check groups (to hide private groups)
$from = " LEFT JOIN " . table_groups . " ON " . table_links . ".link_group_id = " . table_groups . ".group_id ";
$groups = $db->get_results("SELECT * FROM " . table_group_member . " WHERE member_user_id = {$current_user->user_id} and member_status = 'active'");
if ($groups) {
    $group_ids = array();
    foreach ($groups as $group) {
        $group_ids[] = $group->member_group_id;
    }
Example #12
0
<?php

header("content-type: application/x-javascript");
include_once '../config.php';
include_once '../Smarty.class.php';
$smarty = new Smarty();
$smarty->config_dir = '';
$smarty->compile_dir = "../templates_c";
$smarty->template_dir = "../templates";
$smarty->config_dir = "..";
$smarty->config_load("/libs/lang.conf");
$PLIGG_Visual_Vote_Cast = $smarty->get_config_vars('PLIGG_Visual_Vote_Cast');
?>
var xmlhttp
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
Example #13
0
// pagename
define('pagename', 'rss');
$main_smarty->assign('pagename', pagename);
$rows = isset($_GET['rows']) && is_numeric($_GET['rows']) ? $_GET['rows'] : 20;
$status = sanitize($_GET['status'], 3) != '' ? sanitize($_GET['status'], 3) : 'published';
$time = isset($_GET['time']) && is_numeric($_GET['time']) ? $_GET['time'] : 0;
if ($time > 0) {
    // Prepare for times
    $sql = "SELECT link_id, count(*) as votes FROM " . table_votes . ", " . table_links . " WHERE  ";
    if ($time > 0) {
        $from = time() - $time;
        $sql .= "vote_date > FROM_UNIXTIME({$from}) AND ";
    }
    $sql .= "vote_link_id=link_id  AND (link_status='published' OR link_status='new') GROUP BY vote_link_id  ORDER BY votes DESC LIMIT {$rows}";
    $last_modified = time();
    $title = $main_smarty->get_config_vars('PLIGG_Visual_RSS_Recent') . ' ' . txt_time_diff($from);
    $link_date = "";
} else {
    // All the others
    $tmpsearch = new Search();
    $tmpsearch->searchTerm = isset($_GET['search']) && sanitize($_GET['search'], 3) != '' ? sanitize($_GET['search'], 3) : '';
    $search = $tmpsearch->get_search_clause();
    if ($search) {
        $status = 'all';
    }
    switch ($status) {
        case 'published':
            $order_field = 'link_date';
            $link_date = 'date';
            $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Published_News");
            break;
Example #14
0
 if (isset($_POST['group_title'])) {
     $group_title = mysql_real_escape_string(stripslashes(strip_tags(trim($_POST['group_title']))));
 }
 if (isset($_POST['group_description'])) {
     $group_description = mysql_real_escape_string(stripslashes(strip_tags(trim($_POST['group_description']))));
 }
 if (isset($_POST['group_vote_to_publish'])) {
     $group_vote_to_publish = mysql_real_escape_string(stripslashes(strip_tags(trim($_POST['group_vote_to_publish']))));
 }
 $group_name = $group_title;
 $group_safename = str_replace(' ', '-', $group_title);
 if (isset($_POST['group_privacy'])) {
     $group_privacy = $db->escape(sanitize($_POST['group_privacy'], 3));
 }
 if (!$group_title) {
     $errors = $main_smarty->get_config_vars('PLIGG_Visual_Group_Empty_Title');
 } elseif ($group_vote_to_publish <= 0) {
     $errors = $main_smarty->get_config_vars('PLIGG_Visual_Group_Empty_Votes');
 } else {
     $exists = $db->get_var("select COUNT(*) from " . table_groups . " WHERE group_name='{$group_name}' AND group_id != '{$requestID}'");
     if ($exists) {
         $errors = $main_smarty->get_config_vars('PLIGG_Visual_Group_Title_Exists');
     }
 }
 if (!$errors && $db->query("update " . table_groups . " set group_name = '" . $group_title . "', group_description = '" . $group_description . "', group_privacy = '" . $group_privacy . "', group_vote_to_publish = '" . $group_vote_to_publish . "' where group_id = '" . $requestID . "'")) {
     $errors = $main_smarty->get_config_vars('PLIGG_Visual_Group_Saved_Changes');
 }
 //page redirect
 //		$redirect = '';
 //		$redirect = getmyurl("editgroup", $requestID);
 //		header("Location: $redirect");
Example #15
0
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include_once mnminclude . 'smartyvariables.php';
$type = sanitize($_REQUEST['type'], 2);
$name = sanitize($_GET["name"], 2);
switch ($type) {
    case 'username':
        if (strlen($name) < 3) {
            // if username is less than 3 characters
            echo $main_smarty->get_config_vars("PLIGG_Visual_CheckField_UserShort");
            return;
        }
        if (!preg_match('/^[a-zA-Z0-9_\\-]+$/i', $name)) {
            // if username contains invalid characters
            echo $main_smarty->get_config_vars("PLIGG_Visual_CheckField_InvalidChars");
            return;
        }
        if (user_exists($name)) {
            // if username already exists
            echo $main_smarty->get_config_vars("PLIGG_Visual_CheckField_UserExists");
            return;
        }
        echo "OK";
        break;
    case 'email':
Example #16
0
include_once mnminclude . 'tags.php';
include_once mnminclude . 'search.php';
include_once mnminclude . 'smartyvariables.php';
include_once mnminclude . 'sidebarstories.php';
global $the_template, $main_smarty;
// for filterTo you can use "published", "queued" or "all"
// to change the way the links look, edit /tempates/<your template>/sidebar_stories.tpl
$ss = new SidebarStories();
$ss->orderBy = "link_date DESC";
// newest on top.
$ss->pagesize = 5;
// the number of items to show in the box.
$ss->TitleLengthLimit = 26;
if (pagename == "index") {
    $ss->filterToStatus = "queued";
    $ss->header = $main_smarty->get_config_vars("PLIGG_Visual_Pligg_Queued");
    $ss->link = getmyurl("upcoming");
} elseif (pagename == "upcoming") {
    $ss->filterToStatus = "published";
    $ss->header = $main_smarty->get_config_vars("PLIGG_Visual_Published_News");
    $ss->link = my_base_url . my_pligg_base;
} else {
    $ss->filterToStatus = "published";
    $ss->header = $main_smarty->get_config_vars("PLIGG_Visual_Published_News");
    $ss->link = my_base_url . my_pligg_base;
}
$ss->template = $the_template . '/sidebar_stories.tpl';
$main_smarty->assign('ss_toggle_id', 'ssstories');
$main_smarty->assign('ss_body', $ss->show(true));
$main_smarty->assign('ss_header', $ss->header);
$main_smarty->display($the_template . '/sidebar_stories_wrapper.tpl');
Example #17
0
    $search->adv = true;
    $search->s_group = sanitize($_REQUEST['sgroup'], 2);
    $search->s_tags = sanitize($_REQUEST['stags'], 2);
    $search->s_story = sanitize($_REQUEST['slink'], 2);
    $search->status = sanitize($_REQUEST['status'], 2);
    $search->s_user = sanitize($_REQUEST['suser'], 2);
    $search->s_cat = sanitize($_REQUEST['scategory'], 2);
    $search->s_comments = sanitize($_REQUEST['scomments'], 2);
    $search->s_date = sanitize($_REQUEST['date'], 2);
    if (intval($_REQUEST['sgroup']) > 0) {
        $display_grouplinks = true;
    }
}
//end Advanced Search
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm);
$navwhere['link1'] = getmyurl('search', urlencode($search->searchTerm));
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm));
//sidebar
$main_smarty = do_sidebar($main_smarty);
// misc smarty
$main_smarty->assign('searchboxtext', sanitize($_REQUEST['search'], 2));
$main_smarty->assign('cat_url', getmyurl("maincategory"));
$main_smarty->assign('URL_rss_page', getmyurl('rsssearch', sanitize($search->searchTerm, 2)));
if (strlen($search->searchTerm) < 3 && strlen($search->url) < 3 && !$search->s_date) {
    $main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Search_Too_Short'));
    $main_smarty->assign('pagename', 'noresults');
} else {
    if (isset($_GET['order'])) {
        $search->ords = $db->escape($_GET['order']);
Example #18
0
        $comment = new Comment();
        foreach ($comments as $dbcomment) {
            $comment->id = $dbcomment->comment_id;
            $cached_comments[$dbcomment->comment_id] = $dbcomment;
            $comment->read();
            echo "<item>\n";
            echo "<title>Comment #" . $comment->id . "</title>\n";
            echo "<link>" . getmyFullurl("storyURL", $link->category_safe_name($link->category), urlencode($link->title_url), $link->id) . "#c" . $comment->id . "</link>\n";
            if (!empty($comment->date)) {
                echo "<pubDate>" . date('D, d M Y H:i:s T', $comment->date) . "</pubDate>\n";
            } else {
                echo "<pubDate>" . date('D, d M Y H:i:s T', time()) . "</pubDate>\n";
            }
            echo "<dc:creator>" . $dbcomment->user_login . "</dc:creator>\n";
            echo "<guid isPermaLink='false'>" . $comment->id . "</guid>\n";
            echo "<description><![CDATA[" . $comment->content . "<br/>" . $comment->votes . " " . $main_smarty->get_config_vars('PLIGG_Visual_RSS_Votes') . " ]]></description>\n";
            echo "</item>\n\n";
        }
    }
    do_rss_footer();
} else {
    // check for redirects
    include mnminclude . 'redirector.php';
    $x = new redirector($_SERVER['REQUEST_URI']);
    $main_smarty->assign('tpl_center', '404error');
    $main_smarty->display($the_template . '/pligg.tpl');
    die;
}
function do_rss_header($link)
{
    global $last_modified, $dblang, $main_smarty;
Example #19
0
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'user.php';
include mnminclude . 'comment.php';
include mnminclude . 'smartyvariables.php';
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Live');
$navwhere['link1'] = getmyurl('live', '');
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Comments');
$navwhere['link2'] = getmyurl('live_comments', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Comments'));
// figure out what "page" of the results we're on
$offset = (get_current_page() - 1) * $top_users_size;
$select = "SELECT * ";
$from_where = " FROM " . table_comments . "\n\t\tLEFT JOIN " . table_links . " ON comment_link_id=link_id \n\t\tLEFT JOIN " . table_users . " ON comment_user_id=user_id ";
$order_by = " ORDER BY comment_id DESC";
// pagename
define('pagename', 'live_comments');
$main_smarty->assign('pagename', pagename);
// get the data to be displayed
$rows = $db->get_var("SELECT count(*) as count {$from_where} {$order_by}");
Example #20
0
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'smartyvariables.php';
// html tags allowed during submit
//$main_smarty->assign('Story_Content_Tags_To_Allow', htmlspecialchars(Story_Content_Tags_To_Allow));
// breadcrumbs and page titles
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Submit_A_New_Group');
$navwhere['link1'] = getmyurl('submit', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Submit_A_New_Group'));
$main_smarty = do_sidebar($main_smarty);
$main_smarty->assign('auto_approve_group', auto_approve_group);
// make sure user is logged in
force_authentication();
$current_user_level = $current_user->user_level;
if (enable_group == "true" && (group_submit_level == $current_user_level || group_submit_level == 'normal' || $current_user_level == 'god')) {
    if (isset($_POST['group_title'])) {
        $group_title = mysql_real_escape_string(stripslashes(strip_tags(trim($_POST['group_title']))));
    }
    if (isset($_POST['group_description'])) {
        $group_description = mysql_real_escape_string(stripslashes(strip_tags(trim($_POST['group_description']))));
    }
Example #21
0
 if ($comments) {
     $current_user->owncomment = "YES";
     require_once mnminclude . 'comment.php';
     $comment = new Comment();
     foreach ($comments as $dbcomment) {
         $comment->id = $dbcomment->comment_id;
         $cached_comments[$dbcomment->comment_id] = $dbcomment;
         $comment->read();
         $comment->hideedit = 'yes';
         $main_smarty->assign('the_comment', $comment->print_summary($link, true));
         $link->thecomment = $comment->quickread();
         $main_smarty->assign('TheComment', $comment->quickread());
     }
 } else {
     $current_user->owncomment = "NO";
     echo $main_smarty->get_config_vars("PLIGG_Visual_EditComment_NotYours") . '<br/><br/>';
     echo $main_smarty->get_config_vars("PLIGG_Visual_EditComment_Click") . '<a href = "' . getmyurl('story', sanitize($_GET['id'], 3)) . '">' . $main_smarty->get_config_vars("PLIGG_Visual_EditComment_Here") . '</a> ' . $main_smarty->get_config_vars("PLIGG_Visual_EditComment_ToReturn") . '<br/><br/>';
 }
 if ($current_user->authenticated) {
     if ($current_user->owncomment == "YES") {
         $main_smarty->assign('comment_form', print_comment_form(true));
     }
     if ($current_user->user_level == "admin" or $current_user->user_level == "god") {
         $main_smarty->assign('removed_link', '<a href="#" onclick=(document.getElementById("comment").value="' . $main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed") . '")>' . $main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed") . '</a>');
     }
 }
 // misc smarty
 $main_smarty->assign('Spell_Checker', Spell_Checker);
 // pagename
 define('pagename', 'edit');
 $main_smarty->assign('pagename', pagename);
Example #22
0
 if ($wgRequest->getSafeVal('action') == 'step1') {
     //Load Smarty objects
     $qqqsmarty = new Smarty();
     $ensmarty = new Smarty();
     $ensmarty->config_load('/data/project/xtools/public_html/configs/en.conf', 'main');
     $ensmarty = $ensmarty->get_config_vars();
     if (is_file($tools[$tool]['uri'] . 'qqq.conf')) {
         $qqqsmarty->config_load('../../../../..' . $tools[$tool]['uri'] . 'qqq.conf', $tools[$tool]['name']);
     }
     $config_vars = $fauxsmarty->get_config_vars();
     foreach ($config_vars as $name => $value) {
         if (isset($ensmarty[$name]) && $tool != "Global") {
             unset($config_vars[$name]);
             continue;
         }
         $config_vars[$name] = array('value' => $value, 'qqq' => @$qqqsmarty->get_config_vars($name));
     }
     $content->assign("showvars", true);
     $content->assign("config_vars", $config_vars);
     $content->assign("tool", $tool);
     $content->assign("lang", $lang);
 } elseif ($wgRequest->getSafeVal('action') == 'step2') {
     //Connect to SQL DB
     $dbr = new Database('tools-db', $toolserver_username, $toolserver_password, 'p50380g50570_xtools');
     $dbr->query("SET NAMES 'utf8'");
     $varsToGet = array_keys($fauxsmarty->get_config_vars());
     $sentVars = $wgRequest->getValues($varsToGet);
     $diff = "[{$tools[$tool]['name']}]\n";
     foreach ($sentVars as $key => $get) {
         $diff .= $key . " = \"{$get}\"\n";
     }
Example #23
0
    header('Location: ' . getmyFullurl("story", $tb_id));
    exit;
}
if (!empty($tb_url) && !empty($title) && !empty($tb_url)) {
    header('Content-Type: text/xml; charset=UTF-8');
    $title = htmlspecialchars(strip_tags($title));
    $title = strlen($title) > 150 ? substr($title, 0, 150) . '...' : $title;
    $excerpt = strip_tags($excerpt);
    $excerpt = strlen($excerpt) > 200 ? substr($excerpt, 0, 200) . '...' : $excerpt;
    $trackres = new Trackback();
    $trackres->link = $tb_id;
    $trackres->type = 'in';
    $trackres->url = $tb_url;
    $dupe = $trackres->read();
    if ($dupe) {
        trackback_response(1, $main_smarty->get_config_vars('PLIGG_Visual_Trackback_AlreadyPing'));
    }
    $contents = @file_get_contents($tb_url);
    if (!$contents) {
        trackback_response(1, $main_smarty->get_config_vars('PLIGG_Visual_Trackback_BadURL'));
    }
    $permalink = get_permalink($tb_id);
    $permalink_q = preg_quote($permalink, '/');
    $pattern = "/<\\s*a.*href\\s*=[\"'\\s]*" . $permalink_q . "[\"'\\s]*.*>.*<\\s*\\/\\s*a\\s*>/i";
    if (!preg_match($pattern, $contents)) {
        trackback_response(1, $main_smarty->get_config_vars('PLIGG_Visual_Trackback_NoReturnLink'));
    }
    $trackres->title = $title;
    $trackres->content = $excerpt;
    $trackres->status = 'ok';
    $trackres->store();
Example #24
0
include mnminclude . 'user.php';
include mnminclude . 'smartyvariables.php';
if (!$_COOKIE['referrer']) {
    check_referrer();
}
// html tags allowed during submit
if (checklevel('god')) {
    $Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_God;
} elseif (checklevel('admin')) {
    $Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_Admin;
} else {
    $Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_Normal;
}
$main_smarty->assign('Story_Content_Tags_To_Allow', htmlspecialchars($Story_Content_Tags_To_Allow));
// breadcrumbs and page titles
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Submit');
$navwhere['link1'] = getmyurl('submit', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Submit'));
$main_smarty = do_sidebar($main_smarty);
//to check anonymous mode activated
global $current_user;
if ($current_user->authenticated != TRUE) {
    $vars = '';
    check_actions('anonymous_story_user_id', $vars);
    if ($vars['anonymous_story'] != true) {
        force_authentication();
    }
}
$vars = '';
check_actions('submit_post_authentication', $vars);
Example #25
0
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'link.php';
include mnminclude . 'html1.php';
include mnminclude . 'smartyvariables.php';
check_referrer();
$post_id = sanitize($_POST['id'], 3);
if (is_numeric($post_id) && $post_id > 0) {
    $link = new Link();
    $link->id = $post_id;
    $link->read_basic();
    if ($current_user->user_id == 0 && !anonymous_vote) {
        error($main_smarty->get_config_vars('PLIGG_Visual_Vote_NoAnon'));
    }
    $post_user = sanitize($_POST['user'], 3);
    if ($current_user->user_id != $post_user) {
        error($main_smarty->get_config_vars('PLIGG_Visual_Vote_BadUser'));
    }
    /*	$md5=md5($post_user.$link->randkey);
    	if($md5 !== sanitize($_POST['md5'], 3)){
    		error($main_smarty->get_config_vars('PLIGG_Visual_Vote_BadKey'));
    	}
    
    	if($link->votes($current_user->user_id) > 0 || $link->reports($current_user->user_id) > 0) {
    	}
    */
    $value = sanitize($_POST['value'], 3);
    /*	if(sanitize($_POST['unvote'], 3) == 'true'){
Example #26
0
    $search->s_story = sanitize($_REQUEST['slink'], 2);
    $search->status = sanitize($_REQUEST['status'], 2);
    $search->s_user = sanitize($_REQUEST['suser'], 2);
    $search->s_cat = sanitize($_REQUEST['scategory'], 2);
    $search->s_comments = sanitize($_REQUEST['scomments'], 2);
    $search->s_date = sanitize($_REQUEST['date'], 2);
    if (intval($_REQUEST['sgroup']) > 0) {
        $display_grouplinks = true;
    }
}
//end Advanced Search
$new_search = $search->new_search();
$linksum_count = $search->countsql;
$linksum_sql = $search->sql;
if ($_GET['tag']) {
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Search_Tags");
} else {
    $title = " | " . $main_smarty->get_config_vars("PLIGG_Visual_Search_Keywords");
}
$title .= " | " . sanitize($_GET['search'], 4);
do_rss_header($title);
$link = new Link();
$links = $db->get_col($linksum_sql);
if ($links) {
    foreach ($links as $link_id) {
        $link->id = $link_id;
        $link->read();
        $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = {$link->category} AND category_lang='{$dblang}'");
        $link->link_summary = str_replace("\n", "<br />", $link->link_summary);
        $link->link_summary = str_replace("òÀÙ", "'", $link->link_summary);
        $link->link_summary = str_replace("òÀÓ", "-", $link->link_summary);
Example #27
0
<?php

include_once 'internal/Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'smartyvariables.php';
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Recover_Password');
$navwhere['link1'] = getmyurl('loginNoVar', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Recover_Password'));
// sidebar
$main_smarty = do_sidebar($main_smarty);
// initialize error message variable
$errorMsg = "";
// if user requests to logout
if ($my_pligg_base) {
    if (strpos($_GET['return'], $my_pligg_base) !== 0) {
        $_GET['return'] = $my_pligg_base . '/';
    }
    if (strpos($_POST['return'], $my_pligg_base) !== 0) {
        $_POST['return'] = $my_pligg_base . '/';
    }
}
$id = sanitize($_REQUEST['id'], 3);
$n = sanitize($_REQUEST['n'], 3);
$idTemp = base64_decode($id);
$username = sanitize($idTemp, 3);
$sql = "SELECT * FROM `" . table_users . "` where `user_login` = '" . $username . "' AND `last_reset_request` = FROM_UNIXTIME('" . $n . "') AND user_level!='Spammer'";
Example #28
0
    if ($_POST['draw'] == "small") {
        // small form -- the form's html is in recommend_small.tpl
        $htmlid = isset($_POST['htmlid']) && is_numeric($_POST['htmlid']) ? $_POST['htmlid'] : 0;
        $linkid = isset($_POST['linkid']) && is_numeric($_POST['linkid']) ? $_POST['linkid'] : 0;
        $main_smarty->assign('ts_random', rand(10000000, 99999999));
        $main_smarty->assign('Default_Message', Default_Message);
        $main_smarty->assign('link_shakebox_index', $htmlid);
        $main_smarty->assign('link_id', $linkid);
        $main_smarty->assign('instpath', my_base_url . my_pligg_base . "/");
        $main_smarty->display($the_template . '/recommend_small.tpl');
    }
} else {
    // we're submitting the form and sending the emails
    global $current_user, $db;
    if (!$current_user->authenticated) {
        echo '<br/><p><span class="error">' . $main_smarty->get_config_vars('PLIGG_Visual_Recommend_Logged_In') . '</span></p>';
        die;
    }
    $sql = 'SELECT `last_email_friend` FROM `' . table_users . '` WHERE `user_login` = "' . $current_user->user_login . '"';
    $last_email = $db->get_var($sql);
    $time_since_last_email = time() - strtotime($last_email);
    if ($time_since_last_email < Recommend_Time_Limit) {
        echo '<br/><p><span class="error">' . $main_smarty->get_config_vars('PLIGG_Visual_Recommend_Limit') . '</span></p>';
        die;
    }
    $requestID = isset($_POST['original_id']) && is_numeric($_POST['original_id']) ? $_POST['original_id'] : 0;
    if ($requestID > 0) {
        $id = $requestID;
        $link = new Link();
        $link->id = $requestID;
        $link->read();
Example #29
0
<?php

include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'ts.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'smartyvariables.php';
include mnminclude . 'admin_config.php';
// -------------------------------------------------------------------------------------
force_authentication();
// breadcrumbs
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
$navwhere['link1'] = getmyurl('admin', '');
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_5') . $main_smarty->get_config_vars('PLIGG_Visual_Name');
$navwhere['link2'] = my_pligg_base . "/admin_config.php";
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
// breadcrumbs
$main_smarty = do_sidebar($main_smarty);
define('pagename', 'admin_config');
$main_smarty->assign('pagename', pagename);
$main_smarty->assign('tpl_center', $the_template . '/admin_templates/admin_config_center');
if (isset($_REQUEST['action'])) {
    $main_smarty->display($the_template . '/blank.tpl');
} else {
    $main_smarty->display($the_template . '/pligg.tpl');
}
function dowork()
<?php

include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'tags.php';
include mnminclude . 'user.php';
include mnminclude . 'smartyvariables.php';
// -------------------------------------------------------------------------------------
// breadcrumbs and page titles
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Search_Advanced');
$navwhere['link1'] = 'advancedsearch.php';
//getmyurl('advancesearch', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Search_Advanced'));
$query = "SELECT *\r\n\t\t  FROM " . table_categories . "\r\n\t\t  ORDER BY category_name";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
    $category_option .= '<option value="' . $row['category_id'] . '">' . ucfirst($row['category_name']) . '</option>' . "\n";
}
$main_smarty->assign('category_option', $category_option);
// pagename
define('pagename', 'advancedsearch');
$main_smarty->assign('pagename', pagename);
// sidebar
$main_smarty = do_sidebar($main_smarty);
$main_smarty->assign('headers', $header_items);
// show the template
$main_smarty->assign('tpl_center', $the_template . '/search_advanced_center');