예제 #1
0
 public function run($results = '')
 {
     if (!empty($this->parameters)) {
         $results = $this->doSearch();
     }
     $v = new SearchView();
     $v->setMessages($this->messages);
     $v->run($results);
 }
예제 #2
0
 /**
  * Constructs a detail view specifying the controller as
  * well as the model that will have its details displayed.
  */
 public function __construct($model, $listModelClassName, $gridIdSuffix = null, $showFilteredListLink = false, $hideAllSearchPanelsToStart = false)
 {
     assert('is_bool($showFilteredListLink)');
     $this->showFilteredListLink = false;
     // Turn back once filteredLists is completed.  $showFilteredListLink;
     parent::__construct($model, $listModelClassName, $gridIdSuffix = null, $hideAllSearchPanelsToStart = false);
 }
예제 #3
0
파일: search.php 프로젝트: hensonvip/ymroad
if ($cfg_notallowstr != '' && preg_match("#" . $cfg_notallowstr . "#i", $keyword)) {
    ShowMsg("你的搜索关键字中存在非法内容,被系统禁止!", "-1");
    exit;
}
if (($keyword == '' || strlen($keyword) < 2) && empty($typeid)) {
    ShowMsg('关键字不能小于2个字节!', '-1');
    exit;
}
//检查搜索间隔时间
$lockfile = DEDEDATA . '/time.lock.inc';
$lasttime = file_get_contents($lockfile);
if (!empty($lasttime) && $lasttime + $cfg_search_time > time()) {
    ShowMsg('管理员设定搜索时间间隔为' . $cfg_search_time . '秒,请稍后再试!', '-1');
    exit;
}
//开始时间
if (empty($starttime)) {
    $starttime = -1;
} else {
    $starttime = is_numeric($starttime) ? $starttime : -1;
    if ($starttime > 0) {
        $dayst = GetMkTime("2008-1-2 0:0:0") - GetMkTime("2008-1-1 0:0:0");
        $starttime = time() - $starttime * $dayst;
    }
}
$t1 = ExecTime();
$sp = new SearchView($typeid, $keyword, $orderby, $channeltype, $searchtype, $starttime, $pagesize, $kwtype, $mid);
$keyword = $oldkeyword;
$sp->Display();
PutFile($lockfile, time());
//echo ExecTime() - $t1;
 protected function getExtraRenderForClearSearchLinkScript()
 {
     return parent::getExtraRenderForClearSearchLinkScript() . "\$('.workflow-in-queues-hidden-input').val('');\n            ";
 }
 protected function getClearSearchLabelContent()
 {
     if (Yii::app()->userInterface->isMobile()) {
         return parent::getClearSearchLabelContent();
     }
     return Zurmo::t('ZurmoModule', 'Criteria Selected <span class="icon-clear">Z</span>');
 }
예제 #6
0
파일: result.php 프로젝트: naisly/WodenS
<?php

/**
 * Created by PhpStorm.
 * User: Home
 * Date: 18.01.2016
 * Time: 20:27
 */
include_once $_SERVER['DOCUMENT_ROOT'] . '/Model/SearchModel.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Controllers/SearchController.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/View/SearchView.php';
$model = new SearchModel();
$controller = new SearchController($model);
$view = new SearchView($model);
$controller->actionGetResults();
$view->getResults();
  function GetArcList($limitstart=0,$perpage=10,$col=1,$titlelen=30,$infolen=250,
  $imgwidth=120,$imgheight=90,$achanneltype="all",$orderby=" aid desc ",$innertext="",$tablewidth="100")
  {

	    $typeid=$this->TypeID;
    	if($perpage=="") $perpage = 10;
		if($limitstart=="") $limitstart = 0;
		if($titlelen=="") $titlelen = 30;
		if($infolen=="") $infolen = 250;
	    if($achanneltype=="") $achanneltype = "0";
		$innertext = trim($innertext);
		if($innertext=="") $innertext = GetSysTemplets("search_list.htm");
		$ordersql = "order by ".$this->OrderBy;

		$query = "select * from #@__full_search left join #@__arctype on #@__arctype.ID=#@__full_search.typeid
				where aid in ($this->result) $ordersql limit $limitstart,$perpage ";

		$this->dsql->SetQuery($query);
		$this->dsql->Execute("al");
	    $artlist = "";
	    $this->dtp2->LoadSource($innertext);
		$tt = 0;
	    for($i=0;$i<$perpage;$i++)
		{
         if($row = $this->dsql->GetArray("al"))
         {
           //处理一些特殊字段
           $row["arcurl"] = $row["url"];
           $row["description"] = $this->GetRedKeyWord(cn_substr($row["addinfos"],$infolen));
           $row["title"] = $this->GetRedKeyWord(cn_substr($row["title"],$titlelen));
           $row["id"] =  $row["aid"];
           if($row["litpic"]=="") $row["litpic"] = $GLOBALS["cfg_plus_dir"]."/img/dfpic.gif";
           $row["picname"] = $row["litpic"];
           $row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"],$row["siteurl"]);
           $row["info"] = $row["description"];
           $row["filename"] = $row["arcurl"];
           $row["stime"] = GetDateMK($row["uptime"]);
           $row["textlink"] = "<a href='".$row["filename"]."'>".$row["title"]."</a>";
           $row["typelink"] = "[<a href='".$row["typeurl"]."'>".$row["typename"]."</a>]";
           $row["imglink"] = "<a href='".$row["filename"]."'><img src='".$row["picname"]."' border='0' width='$imgwidth' height='$imgheight'></a>";
           $row["image"] = "<img src='".$row["picname"]."' border='0' width='$imgwidth' height='$imgheight'>";
           $row["phpurl"] = $GLOBALS["cfg_plus_dir"];
 		   $row["templeturl"] = $GLOBALS["cfg_templets_dir"];
 		   $row["memberurl"] = $GLOBALS["cfg_member_dir"];
           //---------------------------
           if(is_array($this->dtp2->CTags)){
       	     foreach($this->dtp2->CTags as $k=>$ctag){
       		 	   if(isset($row[$ctag->GetName()])) $this->dtp2->Assign($k,$row[$ctag->GetName()]);
       		 	   else $this->dtp2->Assign($k,"");
       	    }
           }
           $artlist .= $this->dtp2->GetResult();
           $tt = 1;
         }//if hasRow
         else{
         	if($tt == 0 && $this->KType == 1){
						$sp1 = new SearchView($this->TypeID,$this->Keyword,$this->ChannelType,$this->SearchType,0,$this->cacheid);
						$sp1->Display();
						$sp1->Close();
						exit;
	        }else{
	        	$artlist .= '';
	        }
         }
     }//Loop Line
     $this->dsql->FreeResult("al");
     return $artlist;
  }
예제 #8
0
            break;
        case 'add_bookmark':
            $db_update_success = BookmarkManager::addRecord($title, $url);
            break;
        case 'delete_by_id':
            $db_delete_success = BookmarkManager::deleteRecord($id);
            break;
    }
    $page_title = 'Bookmarks';
    $search_target = 'bookmarks';
    $bookmark_data = BookmarkManager::getAllRecords();
    $alt_menu = getAddButton() . getSearchButton();
    $searchModel = new SearchModel($search_target);
    $addModel = new AddModel('Add', 'add_bookmark');
    $addModel->addRow('title', 'Title');
    $addModel->addRow('url', 'URL');
    $bookmarkModel = new TableModel('', $search_target);
    /*$bookmarkModel->addRow ( array (
    			TableView2::createCell ('site', 'Site', 'th'),
    			TableView2::createCell ()
    		));*/
    while (($bookmark_row = mysql_fetch_array($bookmark_data)) != null) {
        $target = $sbookmark ? ' target="_blank"' : '';
        $bookmarkModel->addRow(array(TableView2::createCell('bookmark', '<a href="' . $bookmark_row['url'] . '" ' . $target . '>' . $bookmark_row['title'] . '</a>'), TableView2::createEdit($bookmark_row['BOOKMARK_ID'])));
    }
    $views_to_load = array();
    $views_to_load[] = ' ' . AddView2::render($addModel);
    $views_to_load[] = ' ' . SearchView::render($searchModel);
    $views_to_load[] = ' ' . TableView2::render($bookmarkModel);
    include $relative_base_path . 'views/_generic.php';
}