Example #1
0
function module_sheet()
{
    global $global, $smarty;
    $prefix = $global['channel'] . '/mod-sheet';
    if (isset($global['field'])) {
        $prefix = $prefix . '/field-' . $global['field'];
    }
    if (isset($global['key'])) {
        $prefix = $prefix . '/key-' . $global['key'];
    }
    $obj = new article();
    $obj->set_where('art_channel_id = ' . $global['channel_id']);
    if (isset($global['key'])) {
        $obj->set_where($global['field'] . " like '%" . url_decode($global['key']) . "%'");
    }
    $obj->set_page_size(10);
    $obj->set_page_num($global['page']);
    $sheet = $obj->get_sheet();
    for ($i = 0; $i < count($sheet); $i++) {
        $sheet[$i]['cat_name'] = get_data('cat_art', $sheet[$i]['art_cat_id'], 'cat_name');
    }
    set_link($obj->get_page_sum());
    $smarty->assign('article', $sheet);
    $smarty->assign('prefix', $prefix);
}
Example #2
0
function module_pic_list()
{
    global $global, $smarty;
    $dir_path = url_decode($global['path']);
    $list = get_file_list($dir_path);
    $smarty->assign('list', $list);
    $smarty->assign('dir_path', $dir_path);
    $smarty->assign('host', $_SERVER['HTTP_HOST']);
}
Example #3
0
function module_search_main()
{
    global $global, $smarty;
    $global['key'] = url_decode($global['key']);
    $list_len = get_varia('art_list_len');
    $obj = new article();
    $obj->set_field('art_id,art_channel_id,art_title,art_add_time');
    $obj->set_where("art_title like '%" . $global['key'] . "%'");
    $obj->set_page_size($list_len ? $list_len : 20);
    $obj->set_page_num($global['page']);
    $sheet = $obj->get_sheet();
    for ($i = 0; $i < count($sheet); $i++) {
        $sheet[$i]['channel'] = get_data('channel', $sheet[$i]['art_channel_id'], 'cha_code');
        $sheet[$i]['short_title'] = cut_str($sheet[$i]['art_title'], 42);
    }
    set_link($obj->get_page_sum());
    $smarty->assign('search', $sheet);
}
/**
 * Takes a URL safe encoded user ID and checks if it is valid Base64.
 *
 * @param $str string A user ID.
 * @return bool True if the user ID is formatted as needed.
 */
function is_valid_base64($str)
{
    $str2 = url_decode($str);
    return base64_encode(base64_decode($str2, true)) === $str2;
}
Example #5
0
function get_dec_str()
{
    $str = '%e6%96%b0%e7%a7%80%e6%96';
    $str .= '%87%e7%ab%a0%e7%ae%a1%e7';
    $str .= '%90%86%e7%b3%bb%e7%bb%9f';
    $str .= '%e5%90%8e%e5%8f%b0';
    $str = url_decode($str);
    return $str;
}
		</p>
		</td>		
		<td valign="center" class="cabecalho_tabela">
		<p align="left">&nbsp;&nbsp;&nbsp;</p>
		</td>
	
		<td valign="center" class="cabecalho_tabela">
		<p align="left"><?php 
echo $oTranslator->_('Status');
?>
</p>
		</td>			
		</tr>
	
		<?
		$v_array_parametros = explode('_-_',url_decode($_SESSION['v_parametros']));
		session_unregister('v_parametros');

		$v_array_redes = explode('__',str_replace('_fr_',"'",$v_array_parametros[1]));	
		$v_array_hashs = explode('#',$v_array_parametros[4]);			

		$v_tripa_agentes_hashs = '';
		for ($i=0;$i<count($v_array_hashs);$i++)
			{
			$arrTmp = explode('*',$v_array_hashs[$i]);
			$v_array_agentes_hashs[$arrTmp[0]] = $arrTmp[1];
			}

		if (count($v_array_redes)>0)
			{
			for ($i = 0;$i < count($v_array_redes);$i++)
Example #7
0
<?php

include 'smarty/Smarty.class.php';
include 'index/common.func.php';
set_smarty();
load_lang_pack(array($global['channel']));
initial('index');
if (isset($global['key'])) {
    $smarty->assign('page_title', url_decode($global['key']));
}
$smarty->display('search.php');
//新秀
Example #8
0
 function redirect($id)
 {
     $qjobs = $this->db->query("SELECT posts.link, cronjobs.id FROM posts, cronjobs WHERE posts.id=cronjobs.id_post AND posts.status='1' AND cronjobs.status='1' AND cronjobs.id='" . (isset($id) && !empty($id) ? (int) url_decode($id) : 0) . "'");
     if ($qjobs->num_rows() > 0) {
         foreach ($qjobs->result() as $post) {
             if (!empty($post->link)) {
                 $this->db->query("UPDATE cronjobs SET clicks=clicks+1 WHERE id='" . $post->id . "'");
                 header('Location: ' . $post->link);
             }
         }
     }
 }
Example #9
0
 /**
  * list
  * JRequest ordering,limitstart,limit,filterStr   
  */
 public function browse()
 {
     if (file_exists(JPATH_COMPONENT . DS . 'helpers' . DS . $this->viewName . '.php')) {
         include_once JPATH_COMPONENT . DS . 'helpers' . DS . $this->viewName . '.php';
         $helperName = ucfirst($this->viewName) . 'Helper';
         $this->helper = new $helperName();
     }
     $model = $this->getModel($this->viewName);
     $model->setViewName($this->viewName);
     $view = $this->getView($this->viewName, 'html');
     $view->setViewName($this->viewName);
     $view->setModel($model);
     $view->helper = $this->helper;
     $items = $model->getItems(JRequest::getVar('ordering', 'id'), JRequest::getVar('limitstart', 0), JRequest::getVar('limit', 20), url_decode(JRequest::getVar('filterStr', '')));
     if ($this->helper) {
         if (!$this->helper->accessRight($items, 'list')) {
             // if acces denied in other method then
             //    the other method set errorMessage
             //    the other method call cancel method
             //    the cancell method call this method
             // error message set only if before not set
             if ($this->getMessage() == '') {
                 $this->setMessage(JText::_(strtoupper($this->viewName) . '_ACCES_DENIED'));
             }
             $this->setRedirect('index.php');
             return;
         }
     }
     $view->Items = $items;
     $view->Total = $model->getTotal(JRequest::getVar('filterStr', ''));
     $view->Title = JText::_(strtoupper($this->viewName) . '_LIST');
     $view->setLayout('default');
     $view->display('buttons');
     $view->display('filterform');
     $view->display('list');
     return;
 }