Esempio n. 1
0
/**
 * The listing of the images for the image manager
 * @param   int   $imgcat_id  The imageCatID to get the listing for
 * @param   int   $start      The start offset to get the listing for
 * @return  string            the fetched and construced template
 */
function imanager_listimg($imgcat_id, $start = 0) {
	global $icmsTpl, $target, $type;

	if (!is_object(icms::$user)) {
		$groups = array(XOOPS_GROUP_ANONYMOUS);
		$admin = FALSE;
	} else {
		$groups =& icms::$user->getGroups();
		$admin = (!icms::$user->isAdmin(1)) ? FALSE : TRUE;
	}

	$query = isset($_POST['query']) ? $_POST['query'] : NULL;

	if ($imgcat_id <= 0) {
		redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1, '');
	}
	$imgcat_handler = icms::handler('icms_image_category');
	$imagecategory =& $imgcat_handler->get($imgcat_id);
	$categ_path = $imgcat_handler->getCategFolder($imagecategory);
	$categ_url  = $imgcat_handler->getCategFolder($imagecategory, 1, 'url');
	if (!is_object($imagecategory)) {
		redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1);
	}

	$icmsTpl->assign('admnav', adminNav($imgcat_id, '/', 1));
	$icmsTpl->assign('lang_imanager_title', _IMGMANAGER);
	$icmsTpl->assign('lang_imanager_catmsize', _MD_IMAGECATMSIZE);
	$icmsTpl->assign('lang_imanager_catmwidth', _MD_IMAGECATMWIDTH);
	$icmsTpl->assign('lang_imanager_catmheight', _MD_IMAGECATMHEIGHT);
	$icmsTpl->assign('lang_imanager_catstype', _MD_IMAGECATSTYPE);
	$icmsTpl->assign('lang_imanager_catdisp', _MD_IMAGECATDISP);
	$icmsTpl->assign('lang_imanager_catsubs', _MD_IMAGECATSUBS);
	$icmsTpl->assign('lang_imanager_catqtde', _MD_IMAGECATQTDE);
	$icmsTpl->assign('lang_imanager_catoptions', _MD_IMAGECATOPTIONS);

	$icmsTpl->assign('lang_imanager_cat_edit', _EDIT);
	$icmsTpl->assign('lang_imanager_cat_clone', _CLONE);
	$icmsTpl->assign('lang_imanager_cat_del', _DELETE);
	$icmsTpl->assign('lang_imanager_cat_listimg', _LIST);
	$icmsTpl->assign('lang_imanager_cat_submit', _SUBMIT);
	$icmsTpl->assign('lang_imanager_cat_back', _BACK);
	$icmsTpl->assign('lang_imanager_cat_addimg', _ADDIMAGE);

	$icmsTpl->assign('lang_imanager_cat_addnewcat', _MD_ADDIMGCATBTN);
	$icmsTpl->assign('lang_imanager_cat_addnewimg', _MD_ADDIMGBTN);

	$icmsTpl->assign('cat_maxsize', icms_convert_size($imagecategory->getVar('imgcat_maxsize')));
	$icmsTpl->assign('cat_maxwidth', $imagecategory->getVar('imgcat_maxwidth'));
	$icmsTpl->assign('cat_maxheight', $imagecategory->getVar('imgcat_maxheight'));
	$icmsTpl->assign('cat_storetype', $imagecategory->getVar('imgcat_storetype'));
	$icmsTpl->assign('cat_display', $imagecategory->getVar('imgcat_display'));
	$icmsTpl->assign('cat_id', $imagecategory->getVar('imgcat_id'));

	$criteriaRead = new icms_db_criteria_Compo();
	if (is_array($groups) && !empty($groups)) {
		$criteriaTray = new icms_db_criteria_Compo();
		foreach ($groups as $gid) {
			$criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
		}
		$criteriaRead->add($criteriaTray);
		$criteriaRead->add(new icms_db_criteria_Item('gperm_name', 'imgcat_read'));
		$criteriaRead->add(new icms_db_criteria_Item('gperm_modid', 1));
	}
	$criteriaRead->add(new icms_db_criteria_Item('imgcat_pid', $imagecategory->getVar('imgcat_id')));
	$subcats = $imgcat_handler->getObjects($criteriaRead);
	$subs  = count($subcats);
	$icmsTpl->assign('cat_subs', $subs);

	$image_handler = icms::handler('icms_image');

	$criteriaRead = new icms_db_criteria_Compo();
	if (is_array($groups) && !empty($groups)) {
		$criteriaTray = new icms_db_criteria_Compo();
		foreach ($groups as $gid) {
			$criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
		}
		$criteriaRead->add($criteriaTray);
		$criteriaRead->add(new icms_db_criteria_Item('gperm_name', 'imgcat_read'));
		$criteriaRead->add(new icms_db_criteria_Item('gperm_modid', 1));
	}
	$id = (!is_null($imgcat_id) ? $imgcat_id : 0);
	$criteriaRead->add(new icms_db_criteria_Item('imgcat_pid', $imagecategory->getVar('imgcat_id')));
	$ssubs = $imgcat_handler->getObjects($criteriaRead);
	$sc = 0;
	foreach ($ssubs as $id=>$va) {
		$sc += $image_handler->getCount(new icms_db_criteria_Item('imgcat_id', $va->getVar('imgcat_id')));
	}
	$scount = $sc;
	$icmsTpl->assign('simgcount', $scount);

	$icmsTpl->assign('lang_imanager_img_preview', _PREVIEW);

	$icmsTpl->assign('lang_image_name', _IMAGENAME);
	$icmsTpl->assign('lang_image_mimetype', _IMAGEMIME);
	$icmsTpl->assign('lang_image_cat', _IMAGECAT);
	$icmsTpl->assign('lang_image_weight', _IMGWEIGHT);
	$icmsTpl->assign('lang_image_disp', _IMGDISPLAY);
	$icmsTpl->assign('lang_submit', _SUBMIT);
	$icmsTpl->assign('lang_cancel', _CANCEL);
	$icmsTpl->assign('lang_yes', _YES);
	$icmsTpl->assign('lang_no', _NO);
	$icmsTpl->assign('lang_search', _SEARCH);
	$icmsTpl->assign('lang_select', _SELECT);
	$icmsTpl->assign('lang_search_title', _QSEARCH);

	$icmsTpl->assign('lang_imanager_img_editor', 'DHTML Image Editor');

	$icmsTpl->assign('icms_root_path', ICMS_ROOT_PATH);
	$icmsTpl->assign('query', $query);
	$icmsTpl->assign('target', $target);
	$icmsTpl->assign('type', $type);

	$image_handler = icms::handler('icms_image');
	$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('imgcat_id', $imgcat_id));
	if (!is_null($query)) {
		$criteria->add(new icms_db_criteria_Item('image_nicename', $query . '%', 'LIKE'));
	}
	$imgcount = $image_handler->getCount($criteria);
	$criteria->setStart($start);
	$criteria->setOrder('DESC');
	$criteria->setSort('image_weight');
	$criteria->setLimit(15);
	$images =& $image_handler->getObjects($criteria, TRUE, TRUE);

	$icmsTpl->assign('imgcount', $imgcount);

	$arrimg = array();
	foreach (array_keys($images) as $i) {
		$arrimg[$i]['id'] = $images[$i]->getVar('image_id');
		$arrimg[$i]['name'] = $images[$i]->getVar('image_name');
		$arrimg[$i]['nicename'] = $images[$i]->getVar('image_nicename');
		$arrimg[$i]['mimetype'] = $images[$i]->getVar('image_mimetype');
		$arrimg[$i]['weight'] = $images[$i]->getVar('image_weight');
		$arrimg[$i]['display'] = $images[$i]->getVar('image_display');
		$arrimg[$i]['categ_id'] = $images[$i]->getVar('imgcat_id');
		$arrimg[$i]['display_nicename'] = icms_core_DataFilter::icms_substr($images[$i]->getVar('image_nicename'), 0, 20);

		$uniq = icms_random_str(5);

		if ($imagecategory->getVar('imgcat_storetype') == 'db') {
			$src = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $images[$i]->getVar('image_name') . '&resize=0';
			$img = WideImage::load($images[$i]->getVar('image_body'))->saveToFile(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$arrimg[$i]['size'] = icms_convert_size(filesize(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name')));
			$img_info = WideImage::load(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$arrimg[$i]['width'] = $img_info->getWidth();
			$arrimg[$i]['height'] = $img_info->getHeight();
			@unlink(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$path = ICMS_IMANAGER_FOLDER_PATH . '/';
			$arrimg[$i]['lcode'] = '[img align=left id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
			$arrimg[$i]['code'] = '[img align=center id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
			$arrimg[$i]['rcode'] = '[img align=right id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
		} else {
			$url = (substr($categ_url, -1) != '/') ? $categ_url . '/' : $categ_url;
			$path = (substr($categ_path, -1) != '/') ? $categ_path . '/' : $categ_path;
			$src = $url . $images[$i]->getVar('image_name');
			$arrimg[$i]['size'] = icms_convert_size(filesize($path . $images[$i]->getVar('image_name')));
			$img_info = WideImage::load($path . $images[$i]->getVar('image_name'));
			$arrimg[$i]['width'] = $img_info->getWidth();
			$arrimg[$i]['height'] = $img_info->getHeight();
			$arrimg[$i]['lcode'] = '[img align=left]' . $url . $images[$i]->getVar('image_name') . '[/img]';
			$arrimg[$i]['code'] = '[img align=center]' . $url . $images[$i]->getVar('image_name') . '[/img]';
			$arrimg[$i]['rcode'] = '[img align=right]' . $url . $images[$i]->getVar('image_name') . '[/img]';
		}
		$arrimg[$i]['src'] = $src . '?' . time();
		$arrimg[$i]['url_src'] = str_replace(ICMS_URL, '', $src);
		$src_lightbox = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $images[$i]->getVar('image_name');
		$preview_url = '<a href="' . $src_lightbox . '" rel="lightbox[categ' . $images[$i]->getVar('imgcat_id') . ']" title="' . $images[$i]->getVar('image_nicename') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/viewmag.png" alt="' . _PREVIEW . '" title="' . _PREVIEW . '" /></a>';
		$arrimg[$i]['preview_link'] = $preview_url;

		$extra_perm = array("image/jpeg", "image/jpeg", "image/png", "image/gif");
		if (in_array($images[$i]->getVar('image_mimetype'), $extra_perm)) {
			$arrimg[$i]['hasextra_link'] = 1;
			if (file_exists(ICMS_LIBRARIES_PATH . '/image-editor/image-edit.php')) {
				$arrimg[$i]['editor_link'] = 'window.open(\'' . ICMS_LIBRARIES_URL . '/image-editor/image-edit.php?image_id=' . $images[$i]->getVar('image_id') . '&uniq=' . $uniq . '&target=' . $target . '&type=' . $type . '\', \'icmsDHTMLImageEditor\',\'width=800,height=600,left=\'+parseInt(screen.availWidth/2-400)+\',top=\'+parseInt(screen.availHeight/2-350)+\',resizable=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no\'); return FALSE;';
			} else {
				$arrimg[$i]['editor_link'] = '';
			}
		} else {
			$arrimg[$i]['hasextra_link'] = 0;
		}

		$list =& $imgcat_handler->getList(array(), NULL, NULL, $imagecategory->getVar('imgcat_storetype'));
		$div = '';
		foreach ($list as $value => $name) {
			$sel = '';
			if ($value == $images[$i]->getVar('imgcat_id')) {
				$sel = ' selected="selected"';
			}
			$div .= '<option value="' . $value . '"' . $sel . '>' . $name . '</option>';
		}
		$arrimg[$i]['ed_selcat_options'] = $div;

		$arrimg[$i]['ed_token'] = icms::$security->getTokenHTML();
		$arrimg[$i]['clone_token'] = icms::$security->getTokenHTML();
	}

	$icmsTpl->assign('images', $arrimg);
	if ($imgcount > 0) {
		if ($imgcount > 15) {
			$nav = new icms_view_PageNav($imgcount, 15, $start, 'start', 'op=listimg&amp;imgcat_id=' . $imgcat_id . '&type=' . $type . '&target=' . $target);
			$icmsTpl->assign('pag', '<div class="img_list_info_panel" align="center">' . $nav->renderNav() . '</div>');
		} else {
			$icmsTpl->assign('pag', '');
		}
	} else {
		$icmsTpl->assign('pag', '');
	}
	$icmsTpl->assign('addimgform', showAddImgForm($imgcat_id));

	return $icmsTpl->fetch(ICMS_MODULES_PATH . '/system/templates/admin/images/system_popup_imagemanager_imglist.html');
}
Esempio n. 2
0
/**
 * Modify settings for a group
 * @param int $g_id	Unique group ID
 */
function modifyGroup($g_id) {
	$userstart = $memstart = 0;
	if (!empty($_POST['userstart'])) {
		$userstart = (int) $_POST['userstart'];
	} elseif (!empty($_GET['userstart'])) {
		$userstart = (int) $_GET['userstart'];
	}
	if (!empty($_POST['memstart'])) {
		$memstart = (int) $_POST['memstart'];
	} elseif (!empty($_GET['memstart'])) {
		$memstart = (int) $_GET['memstart'];
	}
	icms_cp_header();
	echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/groups/images/groups_big.png)"><a href="admin.php?fct=groups">'. _AM_GROUPSMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'. _AM_MODIFYADG . '</div><br />';
	$member_handler = icms::handler('icms_member');
	$thisgroup =& $member_handler->getGroup($g_id);
	$name_value = $thisgroup->getVar("name", "E");
	$desc_value = $thisgroup->getVar("description", "E");
	$moduleperm_handler = icms::handler('icms_member_groupperm');
	$a_mod_value =& $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid'));
	$r_mod_value =& $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid'));
	$ed_mod_value =& $moduleperm_handler->getItemIds('use_wysiwygeditor', $thisgroup->getVar('groupid'));
	$debug_mod_value =& $moduleperm_handler->getItemIds('enable_debug', $thisgroup->getVar('groupid'));
	$group_manager_value =& $moduleperm_handler->getItemIds('group_manager', $thisgroup->getVar('groupid'));
	$gperm_handler = icms::handler('icms_member_groupperm');
	$r_block_value =& $gperm_handler->getItemIds('block_read', $g_id);
	$op_value = "update";
	$submit_value = _AM_UPDATEADG;
	$g_id_value = $thisgroup->getVar("groupid");
	$type_value = $thisgroup->getVar("group_type", "E");
	$form_title = _AM_MODIFYADG;
	if (XOOPS_GROUP_ADMIN == $g_id) {
		$s_cat_disable = TRUE;
	}

	$sysperm_handler = icms::handler('icms_member_groupperm');
	$s_cat_value =& $sysperm_handler->getItemIds('system_admin', $g_id);

	include ICMS_MODULES_PATH . "/system/admin/groups/groupform.php";
	echo "<br /><h4 style='text-align:" . _GLOBAL_LEFT . "'>" . _AM_EDITMEMBER . "</h4>";
	$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', 0, '>'));
	$member_handler = icms::handler('icms_member');
	$membercount = $member_handler->getUserCountByGroup($g_id);
	if ($usercount < 200 && $membercount < 200) {
		// do the old way only when counts are small
		$mlist = array();
		$members =& $member_handler->getUsersByGroup($g_id, FALSE);
		if (count($members) > 0) {
			$member_criteria = new icms_db_criteria_Item('uid', "(" . implode(',', $members) . ")", "IN");
			$member_criteria->setSort('uname');
			$mlist = $member_handler->getUserList($member_criteria);
		}
		$criteria = new icms_db_criteria_Item('level', 0, '>');
		$criteria->setSort('uname');
		$userslist =& $member_handler->getUserList($criteria);
		$users =& array_diff($userslist, $mlist);
		echo '<table class="outer"><tr><th align="center">' . _AM_NONMEMBERS . '<br />';

		echo '</th><th></th><th align="center">' . _AM_MEMBERS . '<br />';
		echo '</th></tr><tr><td class="even">'
		. '<form action="admin.php" method="post">'
		. '<select name="uids[]" size="10" multiple="multiple">' . "\n";
		foreach ($users as $u_id => $u_name) {
			echo '<option value="' . (int) $u_id . '">' . $u_name . '</option>' . "\n";
		}
		echo '</select>';
		echo "</td><td align='center' class='odd'><input type='hidden' name='op' value='addUser' />" 
		. icms::$security->getTokenHTML() 
		. "<input type='hidden' name='fct' value='groups' /><input type='hidden' name='groupid' value='" 
		. $thisgroup->getVar("groupid") 
		. "' /><input type='submit' name='submit' value='" 
		. _AM_ADDBUTTON . "' /></form><br /><form action='admin.php' method='post' />"
		. "<input type='hidden' name='op' value='delUser' />" 
		. icms::$security->getTokenHTML() 
		. "<input type='hidden' name='fct' value='groups' /><input type='hidden' name='groupid' value='" 
		. $thisgroup->getVar("groupid") 
		. "' /><input type='submit' name='submit' value='" 
		. _AM_DELBUTTON . "' /></td><td class='even'>";
		echo "<select name='uids[]' size='10' multiple='multiple'>";
		foreach ($mlist as $m_id => $m_name) {
			echo '<option value="' . (int) $m_id . '">' . $m_name . '</option>' . "\n";
		}
		echo "</select>";
		echo '</td></tr></form></table>';
	} else {
		$members =& $member_handler->getUsersByGroup($g_id, FALSE, 200, $memstart);
		$mlist = array();
		if (count($members) > 0) {
			$member_criteria = new icms_db_criteria_Item('uid', "(" . implode(',', $members) . ")", "IN");
			$member_criteria->setSort('uname');
			$mlist = $member_handler->getUserList($member_criteria);
		}
		echo '<a href="' . ICMS_MODULES_URL . '/system/admin.php?fct=findusers&amp;group=' . (int) $g_id . '">' . _AM_FINDU4GROUP . '</a><br />';
		echo '<form action="admin.php" method="post"><table class="outer"><tr><th align="center">' . _AM_MEMBERS . '<br />';
		$nav = new icms_view_PageNav($membercount, 200, $memstart, "memstart", "fct=groups&amp;op=modify&amp;g_id=" . (int) $g_id);
		echo $nav->renderNav(4);
		echo "</th></tr><tr><td class='even' align='center'>"
		. "<input type='hidden' name='op' value='delUser' />"
		. "<input type='hidden' name='fct' value='groups' />"
		. "<input type='hidden' name='groupid' value='" . $thisgroup->getVar("groupid") 
		. "' /><input type='hidden' name='memstart' value='" . $memstart 
		. "' />" . icms::$security->getTokenHTML() 
		. "<select name='uids[]' size='10' multiple='multiple'>";
		foreach ($mlist as $m_id => $m_name) {
			echo '<option value="' . (int) $m_id . '">' . $m_name . '</option>' . "\n";
		}
		echo "</select><br /><input type='submit' name='submit' value='" . _DELETE 
		. "' /></td></tr></table></form>";
	}
	icms_cp_footer();
}
Esempio n. 3
0
 /**
  *
  * @param $fetchOnly
  * @param $debug
  */
 public function render($fetchOnly = false, $debug = false)
 {
     global $impresscms;
     $this->_tpl = new icms_view_Tpl();
     /**
      * We need access to the vars of the icms_ipf_Object for a few things in the table creation.
      * Since we may not have an icms_ipf_Object to look into now, let's create one for this purpose
      * and we will free it after
      */
     $this->_tempObject =& $this->_objectHandler->create();
     $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? (int) $_GET['start' . $this->_objectHandler->keyName] : 0);
     $this->setSortOrder();
     if (!$this->_isTree) {
         $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : icms_getCookieVar($_SERVER['SCRIPT_NAME'] . '_limitsel', '15');
     } else {
         $this->_limitsel = 'all';
     }
     $this->_limitsel = isset($_POST['limitsel']) ? $_POST['limitsel'] : $this->_limitsel;
     icms_setCookieVar($_SERVER['SCRIPT_NAME'] . '_limitsel', $this->_limitsel);
     $limitsArray = $this->getLimitsArray();
     $this->_criteria->setLimit($this->_limitsel);
     $this->_filtersel = isset($_GET['filtersel']) ? $_GET['filtersel'] : $this->getDefaultFilter();
     $this->_filtersel = isset($_POST['filtersel']) ? $_POST['filtersel'] : $this->_filtersel;
     icms_setCookieVar($_SERVER['SCRIPT_NAME'] . '_' . $this->_id . '_filtersel', $this->_filtersel);
     $filtersArray = $this->getFiltersArray();
     if ($filtersArray) {
         $this->_tpl->assign('icms_optionssel_filtersArray', $filtersArray);
     }
     // Check if the selected filter is defined and if so, create the selfilter2
     if (isset($this->_filterseloptions[$this->_filtersel])) {
         // check if method associate with this filter exists in the handler
         if (is_array($this->_filterseloptions[$this->_filtersel])) {
             $filter = $this->_filterseloptions[$this->_filtersel];
             $this->_criteria->add($filter['criteria']);
         } else {
             if (method_exists($this->_objectHandler, $this->_filterseloptions[$this->_filtersel])) {
                 // then we will create the selfilter2 options by calling this method
                 $method = $this->_filterseloptions[$this->_filtersel];
                 $this->_filtersel2options = $this->_objectHandler->{$method}();
                 $this->_filtersel2 = isset($_GET['filtersel2']) ? $_GET['filtersel2'] : $this->getDefaultFilter2();
                 $this->_filtersel2 = isset($_POST['filtersel2']) ? $_POST['filtersel2'] : $this->_filtersel2;
                 $filters2Array = $this->getFilters2Array();
                 $this->_tpl->assign('icms_optionssel_filters2Array', $filters2Array);
                 icms_setCookieVar($_SERVER['SCRIPT_NAME'] . '_filtersel2', $this->_filtersel2);
                 if ($this->_filtersel2 != 'default') {
                     $this->_criteria->add(new icms_db_criteria_Item($this->_filtersel, $this->_filtersel2));
                 }
             }
         }
     }
     // Check if we have a quicksearch
     if (isset($_POST['quicksearch_' . $this->_id]) && $_POST['quicksearch_' . $this->_id] != '') {
         $quicksearch_criteria = new icms_db_criteria_Compo();
         if (is_array($this->_quickSearch['fields'])) {
             foreach ($this->_quickSearch['fields'] as $v) {
                 $quicksearch_criteria->add(new icms_db_criteria_Item($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR');
             }
         } else {
             $quicksearch_criteria->add(new icms_db_criteria_Item($this->_quickSearch['fields'], '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'));
         }
         $this->_criteria->add($quicksearch_criteria);
     }
     $this->_objects = $this->fetchObjects($debug);
     /**
      * $params_of_the_options_sel is an array with all the parameters of the page
      * but without the pagenave parameters. This array will be used in the
      * OptionsSelection
      */
     $params_of_the_options_sel = array();
     if ($this->_criteria->getLimit() > 0) {
         /**
          * Geeting rid of the old params
          * $new_get_array is an array containing the new GET parameters
          */
         $new_get_array = array();
         $not_needed_params = array('sortsel', 'limitsel', 'ordersel', 'start' . $this->_objectHandler->keyName);
         foreach ($_GET as $k => $v) {
             if (!in_array($k, $not_needed_params)) {
                 $new_get_array[] = "{$k}={$v}";
                 $params_of_the_options_sel[] = "{$k}={$v}";
             }
         }
         /**
          * Adding the new params of the pagenav
          */
         $new_get_array[] = "sortsel=" . $this->_sortsel;
         $new_get_array[] = "ordersel=" . $this->_ordersel;
         $new_get_array[] = "limitsel=" . $this->_limitsel;
         $otherParams = implode('&', $new_get_array);
         $pagenav = new icms_view_PageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start' . $this->_objectHandler->keyName, $otherParams);
         $this->_tpl->assign('icms_pagenav', $pagenav->renderNav());
     }
     $this->renderOptionSelection($limitsArray, $params_of_the_options_sel);
     // retreive the current url and the query string
     $current_url = $impresscms->urls['full_phpself'];
     $query_string = $impresscms->urls['querystring'];
     if ($query_string) {
         $query_string = str_replace('?', '', $query_string);
     }
     $query_stringArray = explode('&', $query_string);
     $new_query_stringArray = array();
     foreach ($query_stringArray as $query_string) {
         if (strpos($query_string, 'sortsel') == FALSE && strpos($query_string, 'ordersel') == FALSE) {
             $new_query_stringArray[] = $query_string;
         }
     }
     $new_query_string = implode('&', $new_query_stringArray);
     $orderArray = array();
     $orderArray['ASC']['image'] = 'desc.png';
     $orderArray['ASC']['neworder'] = 'DESC';
     $orderArray['DESC']['image'] = 'asc.png';
     $orderArray['DESC']['neworder'] = 'ASC';
     $aColumns = array();
     foreach ($this->_columns as $column) {
         $aColumn = array();
         $aColumn['width'] = $column->getWidth();
         $aColumn['align'] = $column->getAlign();
         $aColumn['key'] = $column->getKeyName();
         if ($column->_keyname == 'checked') {
             $aColumn['caption'] = '<input type ="checkbox" id="checkall_icmspersistableobjects" name="checkall_icmspersistableobjects"' . ' value="checkall_icmspersistableobjects" onclick="icms_checkall(window.document.form_' . $this->_id . ', \'selected_icmspersistableobjects\');" />';
         } elseif ($column->getCustomCaption()) {
             $aColumn['caption'] = $column->getCustomCaption();
         } else {
             $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName();
         }
         // Are we doing a GET sort on this column ?
         $getSort = isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) && $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] == $column->getKeyName() || $this->_sortsel == $column->getKeyName();
         $order = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC';
         if (isset($_REQUEST['quicksearch_' . $this->_id]) && $_REQUEST['quicksearch_' . $this->_id] != '') {
             $filter = isset($_POST['quicksearch_' . $this->_id]) ? INPUT_POST : INPUT_GET;
             $qs_param = "&amp;quicksearch_" . $this->_id . "=" . filter_input($filter, 'quicksearch_' . $this->_id, FILTER_SANITIZE_SPECIAL_CHARS);
         } else {
             $qs_param = '';
         }
         if (!$this->_enableColumnsSorting || $column->_keyname == 'checked' || !$column->_sortable) {
             $aColumn['caption'] = $aColumn['caption'];
         } elseif ($getSort) {
             $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&amp;' . $this->_objectHandler->_itemname . '_' . 'ordersel=' . $orderArray[$order]['neworder'] . $qs_param . '&amp;' . $new_query_string . '">' . $aColumn['caption'] . ' <img src="' . ICMS_IMAGES_SET_URL . '/actions/' . $orderArray[$order]['image'] . '" alt="ASC" /></a>';
         } else {
             $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&amp;' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC' . $qs_param . '&amp;' . $new_query_string . '">' . $aColumn['caption'] . '</a>';
         }
         $aColumns[] = $aColumn;
     }
     $this->_tpl->assign('icms_columns', $aColumns);
     if ($this->_quickSearch) {
         $this->_tpl->assign('icms_quicksearch', $this->_quickSearch['caption']);
     }
     $this->createTableRows();
     $this->_tpl->assign('icms_showFilterAndLimit', $this->_showFilterAndLimit);
     $this->_tpl->assign('icms_isTree', $this->_isTree);
     $this->_tpl->assign('icms_show_action_column_title', $this->_showActionsColumnTitle);
     $this->_tpl->assign('icms_table_header', $this->_tableHeader);
     $this->_tpl->assign('icms_table_footer', $this->_tableFooter);
     $this->_tpl->assign('icms_printer_friendly_page', $this->_printerFriendlyPage);
     $this->_tpl->assign('icms_user_side', $this->_userSide);
     $this->_tpl->assign('icms_has_actions', $this->_hasActions);
     $this->_tpl->assign('icms_head_css_class', $this->_head_css_class);
     $this->_tpl->assign('icms_actionButtons', $this->_actionButtons);
     $this->_tpl->assign('icms_introButtons', $this->_introButtons);
     $this->_tpl->assign('icms_id', $this->_id);
     if (!empty($this->_withSelectedActions)) {
         $this->_tpl->assign('icms_withSelectedActions', $this->_withSelectedActions);
     }
     $icms_table_template = $this->_customTemplate ? $this->_customTemplate : 'system_persistabletable_display.html';
     if ($fetchOnly) {
         return $this->_tpl->fetch('db:' . $icms_table_template);
     } else {
         $this->_tpl->display('db:' . $icms_table_template);
     }
 }
Esempio n. 4
0
					. ICMS_UPLOAD_URL . '/' . $avatars[$i]->getVar('avatar_file') 
					. '" alt="" /></td><td class="head">' . _IMAGENAME, '</td><td class="even"><a href="' 
					. ICMS_URL . '/userinfo.php?uid=';
				$userids =& $avt_handler->getUser($avatars[$i]);
				echo $userids[0] . '">' . $avatars[$i]->getVar('avatar_name') 
					. '</a></td></tr><tr><td class="head">' . _IMAGEMIME 
					. '</td><td class="odd">' . $avatars[$i]->getVar('avatar_mimetype') 
					. '</td></tr><tr><td class="head">&nbsp;</td><td align="center" class="even">'
					. '<a href="admin.php?fct=avatars&amp;op=delfile&amp;avatar_id=' 
					. $avatars[$i]->getVar('avatar_id') . '&amp;user_id=' . $userids[0] . '">' 
					. _DELETE . '</a></td></tr></table><br />';
			}
		}
		if ($avtcount > 0) {
			if ($avtcount > 10) {
				$nav = new icms_view_PageNav($avtcount, 10, $start, 'start', 'fct=avatars&amp;type=' . $type . '&amp;op=listavt');
				echo '<div style="text-align:' . _GLOBAL_RIGHT . ';">' . $nav->renderImageNav() . '</div>';
			}
			if ($type == 'S') {
				echo '<div style="text-align:center;">'
					. '<input type="hidden" name="op" value="save" />'
					. '<input type="hidden" name="fct" value="avatars" />'
					. '<input type="submit" name="submit" value="' . _SUBMIT . '" />' 
					. icms::$security->getTokenHTML() 
					. '</div></form>';
			}
		}
		icms_cp_footer();
		exit();
	}
Esempio n. 5
0
                    redirect_header("index.php", 2, _AM_MSG_REMOVED);
                    exit;
                }
            }
        }
    }
}
//
// display stage
//
// query for listing
$rs = $db->query("SELECT count(lid) FROM {$log_table}");
list($numrows) = $db->fetchRow($rs);
$prs = $db->query("SELECT l.lid, l.uid, l.ip, l.agent, l.type, l.description, UNIX_TIMESTAMP(l.timestamp), u.uname FROM {$log_table} l LEFT JOIN " . $db->prefix("users") . " u ON l.uid=u.uid ORDER BY timestamp DESC LIMIT {$pos},{$num}");
// Page Navigation
$nav = new icms_view_PageNav($numrows, $num, $pos, 'pos', "num={$num}");
$nav_html = $nav->renderNav(10);
// Number selection
$num_options = '';
$num_array = array(20, 100, 500, 2000);
foreach ($num_array as $n) {
    if ($n == $num) {
        $num_options .= "<option value='{$n}' selected='selected'>{$n}</option>\n";
    } else {
        $num_options .= "<option value='{$n}'>{$n}</option>\n";
    }
}
// beggining of Output
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
// title
Esempio n. 6
0
                redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors()));
            }
            $controller = new icms_ipf_Controller($profile_videos_handler);
            $controller->handleObjectDeletionFromUserSide();
            break;
        default:
            $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
            if ($real_uid && $real_uid == $uid) {
                editvideos($videosObj, true);
            }
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $videosArray = $profile_videos_handler->getVideos($clean_start, icms::$module->config['videosperpage'], $clean_uid);
                if (count($videosArray) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_VIDEOS_NOCONTENT);
                } else {
                    $total_videos_count = $profile_videos_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
                    $pagenav = new icms_view_PageNav($total_videos_count, icms::$module->config['videosperpage'], $clean_start, 'start', 'uid=' . $uid);
                    $icmsTpl->assign('profile_videos_pagenav', $pagenav->renderNav());
                    $icmsTpl->assign('profile_videos', $videosArray);
                    unset($total_videos_count, $pagenav);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            icms_makeSmarty(array('lang_video' => _MD_PROFILE_VIDEOS_VIDEO, 'lang_description' => _MD_PROFILE_VIDEOS_DESCRIPTION, 'lang_actions' => _MD_PROFILE_VIDEOS_ACTIONS, 'actions' => is_object(icms::$user) && ($profile_isAdmin || $real_uid == $uid)));
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_VIDEOS);
include_once 'footer.php';
Esempio n. 7
0
 public function __construct($total_items, $items_perpage, $current_start, $start_name = "start", $extra_arg = "")
 {
     parent::__construct($total_items, $items_perpage, $current_start, $start_name, $extra_arg);
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_view_PageNav', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }
Esempio n. 8
0
            $controller->handleObjectDeletionFromUserSide();
            $icmsTpl->assign('profile_category_path', $picturesObj->getVar('title') . ' > ' . _DELETE);
            break;
        default:
            $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
            if ($real_uid && $real_uid == $uid) {
                $picturesObj = $profile_pictures_handler->get($clean_pictures_id);
                editpictures($picturesObj, true);
            }
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $picturesArray = $profile_pictures_handler->getPictures($clean_start, icms::$module->config['picturesperpage'], $uid);
                if (count($picturesArray) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_PICTURES_NOCONTENT);
                } else {
                    $total_pictures_count = $profile_pictures_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
                    $pagenav = new icms_view_PageNav($total_pictures_count, icms::$module->config['picturesperpage'], $clean_start, 'start', 'uid=' . $uid);
                    icms_makeSmarty(array('profile_pictures_pagenav' => $pagenav->renderNav(), 'profile_pictures' => $picturesArray, 'rowitems' => icms::$module->config['rowitems'], 'itemwidth' => round(100 / icms::$module->config['rowitems'], 0)));
                    unset($total_pictures_count, $pagenav);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            $allow_avatar_upload = $isOwner && is_object(icms::$user) && $icmsConfigUser['avatar_allow_upload'] == 1 && icms::$user->getVar('posts') >= $icmsConfigUser['avatar_minposts'];
            $icmsTpl->assign('allow_avatar_upload', $allow_avatar_upload);
            $icmsTpl->assign('lang_avatar', _MD_PROFILE_PICTURES_AVATAR_SET);
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_PHOTOS);
include_once 'footer.php';
Esempio n. 9
0
/**
 * Displays user information form
 * 
 */
function displayUsers() {
	global $icmsConfig, $icmsModule, $icmsConfigUser;
	$userstart = isset($_GET['userstart']) ? (int) $_GET['userstart'] : 0;

	icms_cp_header();
	echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />';
	$member_handler = icms::handler('icms_member');
	$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1', '!='));
	$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
	$editform = new icms_form_Theme(_AM_EDEUSER, 'edituser', 'admin.php');
	$user_select = new icms_form_elements_Select('', 'uid');
	$criteria = new icms_db_criteria_Compo();
	$criteria->add(new icms_db_criteria_Item('level', '-1', '!='));
	$criteria->setSort('uname');
	$criteria->setOrder('ASC');
	$criteria->setLimit(200);
	$criteria->setStart($userstart);
	$user_select->addOptionArray($member_handler->getUserList($criteria));
	$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
	$user_select_tray->addElement($user_select);
	$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
	$user_select_tray->addElement($user_select_nav);
	
	$op_select = new icms_form_elements_Select('', 'op');
	$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER, 'delUser'=>_AM_DELUSER));
	
	$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
	$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
	$editform->addElement($user_select_tray);
	$editform->addElement($op_select);
	$editform->addElement($submit_button);
	$editform->addElement($fct_hidden);
	$editform->display();

	echo "<br />\n";
	$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1'));
	$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
	$editform = new icms_form_Theme(_AM_REMOVED_USERS, 'edituser', 'admin.php');
	$user_select = new icms_form_elements_Select('', 'uid');
	$criteria = new icms_db_criteria_Compo();
	$criteria->add(new icms_db_criteria_Item('level', '-1'));
	$criteria->setSort('uname');
	$criteria->setOrder('ASC');
	$criteria->setLimit(200);
	$criteria->setStart($userstart);
	$user_select->addOptionArray($member_handler->getUserList($criteria));
	$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
	$user_select_tray->addElement($user_select);
	$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
	$user_select_tray->addElement($user_select_nav);

	$op_select = new icms_form_elements_Select('', 'op');
	$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER));

	$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
	$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
	$editform->addElement($user_select_tray);
	$editform->addElement($op_select);
	$editform->addElement($submit_button);
	$editform->addElement($fct_hidden);
	$editform->display();

	echo "<br />\n";
	$uid_value = '';
	$uname_value = '';
	$login_name_value = '';
	$name_value = '';
	$email_value = '';
	$email_cbox_value = 0;
	$openid_value = '';
	$openid_cbox_value = 0;
	$url_value = '';
	$timezone_value = $icmsConfig['default_TZ'];
	$icq_value = '';
	$aim_value = '';
	$yim_value = '';
	$msnm_value = '';
	$location_value = '';
	$occ_value = '';
	$interest_value = '';
	$sig_value = '';
	$sig_cbox_value = 0;
	$umode_value = $icmsConfig['com_mode'];
	$uorder_value = $icmsConfig['com_order'];

	include_once ICMS_INCLUDE_PATH .'/notification_constants.php';
	$notify_method_value = XOOPS_NOTIFICATION_METHOD_PM;
	$notify_mode_value = XOOPS_NOTIFICATION_MODE_SENDALWAYS;
	$bio_value = '';
	$rank_value = 0;
	$mailok_value = 0;
	$pass_expired_value = 0;
	$op_value = 'addUser';
	$form_title = _AM_ADDUSER;
	$form_isedit = FALSE;
	$language_value = $icmsConfig['language'];
	$groups = array(XOOPS_GROUP_USERS);
	include ICMS_MODULES_PATH . '/system/admin/users/userform.php';
	icms_cp_footer();
}
Esempio n. 10
0
					. '</td><td class="' . $class . '" align="' . _GLOBAL_LEFT
					. '"><a href="admin.php?fct=comments&amp;op=jump&amp;com_id=' . $i . '">'
					. $comments[$i]->getVar('com_title') . '</a></td><td class="' . $class . '">'
					. formatTimestamp($comments[$i]->getVar('com_created'), 'm') . '</td><td class="'
					. $class . '">' . $poster_uname . '</td><td class="' . $class . '">'
					. icms_conv_nr2local($comments[$i]->getVar('com_ip')) . '</td><td class="' . $class . '">'
					. $module_array[$comments[$i]->getVar('com_modid')] . '</td><td class="' . $class . '">'
					. $status_array2[$comments[$i]->getVar('com_status')] . '</td><td class="' . $class
					. '" align="' . _CENTER . '"><a href="admin/comments/comment_edit.php?com_id=' . $i . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/edit.png" alt="' . _EDIT . '" title="' . _EDIT . '" /></a> 
					<a href="admin/comments/comment_delete.php?com_id=' . $i . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/editdelete.png" alt="' . _DELETE . '" title="' . _DELETE . '" /></a></td></tr>';
			}
			echo '</table>';
			echo '<table style="width: 100%; border: 0; margin: 3px; padding: 3px;"><tr><td>'
				. sprintf(_MD_AM_COMFOUND, '<b>' . icms_conv_nr2local($total) . '</b>');
			if ($total > $limit) {
				$nav = new icms_view_PageNav($total, $limit, $start, 'start', 'fct=comments&amp;op=list&amp;limit=' . $limit . '&amp;sort=' . $sort . '&amp;order=' . $order . '&amp;module=' . $module);
				echo '</td><td align="center">' . $nav->renderNav();
			}
			echo '</td></tr></table>';
			icms_cp_footer();
			break;

		case 'jump':
			$com_id = (isset($_GET['com_id'])) ? (int) $_GET['com_id'] : 0;
			if ($com_id > 0) {
				$comment_handler = icms::handler('icms_data_comment');
				$comment =& $comment_handler->get($com_id);
				if (is_object($comment)) {
					$module_handler = icms::handler('icms_module');
					$module =& $module_handler->get($comment->getVar('com_modid'));
					$comment_config = $module->getInfo('comments');
Esempio n. 11
0
                        $results[$i]['processed_user_name'] = $uname;
                        $results[$i]['processed_user_url'] = ICMS_URL . "/userinfo.php?uid=" . $results[$i]['uid'];
                    }
                    $results[$i]['processed_time'] = !empty($results[$i]['time']) ? " (" . formatTimestamp((int) $results[$i]['time']) . ")" : "";
                }
            }
            $search_url_prev = "";
            $search_url_next = "";
            $search_url_base = ICMS_URL . '/search.php?';
            $search_url_get_params = 'query=' . urlencode(stripslashes(implode(' ', $queries)));
            $search_url_get_params .= "&mid={$mid}&action={$action}&andor={$andor}";
            if ($action == 'showallbyuser') {
                $search_url_get_params .= "&uid={$uid}";
            }
            $search_url_get_params = htmlspecialchars($search_url_get_params, ENT_COMPAT, _CHARSET);
            $search_url = $search_url_base . $search_url_get_params;
            $pagenav = new icms_view_PageNav($count, $max_results_per_page, $start, "start", $search_url_get_params);
            $all_results[$modname] = array("results" => array_slice($results, $start, $num_show_this_page), "page_nav" => $pagenav->renderNav());
        } else {
            echo '<p>' . _SR_NOMATCH . '</p>';
        }
        break;
    default:
        break;
}
arsort($all_results_counts);
$xoopsTpl->assign("module_sort_order", $all_results_counts);
$xoopsTpl->assign("search_results", $all_results);
$search_form = (include 'include/searchform.php');
$xoopsTpl->assign('search_form', $search_form);
include ICMS_ROOT_PATH . "/footer.php";
Esempio n. 12
0
                $class = $class == 'odd' ? 'even' : 'odd';
                echo '<tr valign="middle" align="center" class="' . $class . '">';
                if (is_object($onlineUsers[$i]['user'])) {
                    $avatar = $onlineUsers[$i]['user']->getVar('user_avatar') ? '<img src="' . ICMS_UPLOAD_URL . '/' . $onlineUsers[$i]['user']->getVar('user_avatar') . '" alt="" />' : '&nbsp;';
                    echo '<td>' . $avatar . "</td><td>\r\n\t\t\t\t\t\t\t<a href=\"javascript:window.opener.location='" . ICMS_URL . "/userinfo.php?uid=" . $onlineUsers[$i]['user']->getVar('uid') . "';window.close();\">" . $onlineUsers[$i]['user']->getVar('uname') . "</a>";
                } else {
                    echo '<td>&nbsp;</td><td>' . $icmsConfig['anonymous'];
                }
                if (icms::$user->isAdmin()) {
                    echo '<br />(' . $onlineUsers[$i]['ip'] . ')';
                }
                echo '</td><td>' . $onlineUsers[$i]['module'] . '</td></tr>';
            }
            echo '</table><br />';
            if ($online_total > 20) {
                $nav = new icms_view_PageNav($online_total, 20, $start, 'start', 'action=showpopups&amp;type=online');
                echo '<div style="text-align: right;">' . $nav->renderNav() . '</div>';
            }
            break;
        case 'ssllogin':
            if ($icmsConfig['use_ssl'] && isset($_POST[$icmsConfig['sslpost_name']]) && is_object(icms::$user)) {
                icms_loadLanguageFile('core', 'user');
                echo sprintf(_US_LOGGINGU, icms::$user->getVar('uname'));
                echo '<div style="text-align:center;">
						<input class="formButton" value="' . _CLOSE . '" type="button" onclick="window.opener.location.reload();window.close();" />
						</div>';
                $closebutton = false;
            }
            break;
        default:
            break;
Esempio n. 13
0
				}
			}

			$search_url_prev = "";
			$search_url_next = "";

			$search_url_base = ICMS_URL . '/search.php?';
			$search_url_get_params = 'query=' . urlencode(stripslashes(implode(' ', $queries)));
			$search_url_get_params .= "&mid=$mid&action=$action&andor=$andor";
			if ($action == 'showallbyuser') {
				$search_url_get_params .= "&uid=$uid";
			}
			$search_url_get_params = htmlspecialchars($search_url_get_params, ENT_COMPAT, _CHARSET);
			$search_url = $search_url_base . $search_url_get_params;

			$pagenav = new icms_view_PageNav($count, $max_results_per_page, $start, "start", $search_url_get_params);
			$all_results[$modname] = array("results" =>array_slice($results, $start, $num_show_this_page),
			"page_nav" => $pagenav->renderNav());
		} else {
			echo '<p>' . _SR_NOMATCH . '</p>';
		}
		break;

	default:
		break;
}

arsort($all_results_counts);
$xoopsTpl->assign("module_sort_order", $all_results_counts);
$xoopsTpl->assign("search_results", $all_results);
Esempio n. 14
0
$content_content_handler = icms_getModuleHandler('content', basename(dirname(__FILE__)), 'content');
if (icms::$module->config['default_page'] == 0) {
    // At which record shall we start display
    $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
    $clean_content_uid = isset($_GET['uid']) ? (int) $_GET['uid'] : false;
    $clean_content_tags = isset($_GET['tag']) ? filter_input(INPUT_GET, 'tag', FILTER_SANITIZE_MAGIC_QUOTES) : false;
    $clean_content_pid = isset($_GET['pid']) ? (int) $_GET['pid'] : ($clean_content_uid || $clean_content_tags ? false : 0);
    $content = $content_content_handler->getContents($clean_start, icms::$module->config['contents_limit'], $clean_content_uid, $clean_content_tags, false, $clean_content_pid);
    $icmsTpl->assign('content_contents', $content);
    if ($clean_content_uid !== false) {
        $contents_count = $content_content_handler->getContentsCount($clean_content_uid);
        $pagenav = new icms_view_PageNav($contents_count, icms::$module->config['contents_limit'], $clean_start, 'start', 'uid=' . $clean_content_uid);
    } else {
        /**
         * @todo this is a bug because it's not taking into concideration view permissions, ...
         */
        $contents_count = $content_content_handler->getCount();
        $pagenav = new icms_view_PageNav($contents_count, icms::$module->config['contents_limit'], $clean_start, 'start');
    }
    $icmsTpl->assign('navbar', $pagenav->renderNav());
    if ($clean_content_uid) {
        $icmsTpl->assign('content_category_path', sprintf(_CO_CONTENT_CONTENT_FROM_USER, icms_member_user_Handler::getUserLink($clean_content_uid)));
    }
} else {
    $content = $content_content_handler->getContents(0, 1, false, false, icms::$module->config['default_page']);
    $icmsTpl->assign('content_contents', $content);
}
$icmsTpl->assign('showInfo', icms::$module->config['show_contentinfo']);
$icmsTpl->assign('content_module_home', '<a href="' . ICMS_URL . '/modules/' . icms::$module->getVar('dirname') . '">' . icms::$module->getVar('name') . '</a>');
$xoTheme->addStylesheet(ICMS_URL . '/modules/content/include/content.css');
include_once 'footer.php';
Esempio n. 15
0
             // make form
             edittribepost(0, 0, $tribesObj, true);
             icms_makeSmarty(array('lang_topic_title' => _MD_PROFILE_TRIBETOPIC_TITLE, 'lang_topic_author' => _MD_PROFILE_TRIBETOPIC_AUTHOR, 'lang_topic_replies' => _MD_PROFILE_TRIBETOPIC_REPLIES, 'lang_topic_views' => _MD_PROFILE_TRIBETOPIC_VIEWS, 'lang_topic_last_post_time' => _MD_PROFILE_TRIBETOPIC_LAST_POST_TIME));
         } else {
             // topic selected, show list of posts
             $tribetopicObj = $profile_tribetopic_handler->get($clean_topic_id);
             if ($tribetopicObj->isNew()) {
                 redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_TRIBETOPIC_NOTFOUND);
             }
             $tribetopicObj->incrementViews();
             $total_posts_count = $profile_tribepost_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('topic_id', $clean_topic_id)));
             $icmsTpl->assign('profile_category_path', '<a href="' . $tribesObj->handler->_moduleUrl . $tribesObj->handler->_page . '?uid=' . $uid . '">' . _MD_PROFILE_TRIBES . '</a> &raquo;&raquo; <a href="' . $tribesObj->handler->_moduleUrl . $tribesObj->handler->_page . '?tribes_id=' . $clean_tribes_id . '">' . $tribesObj->getVar('title') . '</a>');
             $icmsTpl->assign('profile_tribe_topic', $tribetopicObj->toArray());
             $icmsTpl->assign('profile_tribe_posts', $profile_tribepost_handler->getPosts($clean_start, icms::$module->config['tribepostsperpage'], false, $clean_topic_id));
             // make page navigation
             $pagenav = new icms_view_PageNav($total_posts_count, icms::$module->config['tribepostsperpage'], $clean_start, 'start', 'tribes_id=' . $clean_tribes_id . '&topic_id=' . $clean_topic_id);
             $icmsTpl->assign('profile_tribe_posts_pagenav', $pagenav->renderNav());
             // make form
             if (!$tribetopicObj->getVar('closed')) {
                 edittribepost($clean_topic_id, 0, $tribesObj, true);
             }
             icms_makeSmarty(array('lang_closed' => _MD_PROFILE_TRIBETOPIC_CLOSED));
         }
     } else {
         $icmsTpl->assign('lang_joinfirst', _MD_PROFILE_TRIBES_JOINFIRST);
     }
 } elseif (isset($_POST['search_title'])) {
     $clean_tribes_title = trim(icms_core_DataFilter::checkVar($_POST['search_title'], 'str'));
     $tribes = array();
     $tribes['search'] = $profile_tribes_handler->searchTribes($clean_tribes_title);
     $icmsTpl->assign('profile_tribes', $tribes);