Posted: 01/20/2004 2:33:00 PM
Meine Suchmaschine umfasst 330 Kategorien. Nun möchte ich ein weiteres Theme erstellen, in dem nur rund 10 dieser Kategorien angeboten werden (also nur ein Teil des Datenbestandes). Wie mache ich das?
Posted: 01/20/2004 2:33:00 PM
Posted: 01/21/2004 9:04:00 AM
Posted: 01/21/2004 1:00:00 PM
Posted: 02/06/2004 3:23:00 AM
Posted: 02/06/2004 5:07:00 PM
//main parsing func
function parse($t_name,$visited=""
{
global $t_cache, $filedir, $parse_email, $email_body;
//check for recursion in templates
if(!$parse_email)
{
if(ereg("%$t_name%",$visited))
{
echo "***Error: recursion in branch $visited, node $t_name. Aborting template.";
return;
}
else
$visited.="%$t_name%";
if($t_cache[$t_name] == "" //check if cashed
$t_cache[$t_name]=template($t_name); //load if not cashed
$t=$t_cache[$t_name]; //get local copy of the cash - speed
}
else
{
$t=$email_body;
$parse_email=false;
}
#main parsing loop
$t_len=strlen($t);
$o=""; //output HTML & PHP
//tags parse
for($i=0;$i<$t_len;$i++)
{ #search for next special tag
$tagOpen=strpos($t,"<%",$i);
if $tagOpen===false)
{ #only HTML left
$o.=substr($t,$i);
break;
}
else
{ //get end of tag
$tagClose=strpos($t,"%>",$tagOpen);
$tag=substr($t,$tagOpen+2,$tagClose-$tagOpen-2);
//add all HTML before
$o.=substr($t,$i,$tagOpen-$i);
//process tag
if($col_pos=strpos($tag,":")
{ $vtag_name=substr($tag,0,$col_pos);
$vtag_value=substr($tag,$col_pos+1);
switch($vtag_name)
{
case "language":
global $$vtag_value;
$o.=$$vtag_value;
break;
case "include":
$o.=parse(substr($tag,8),$visited);
break;
case "nav":
$o.=nav($vtag_value);
break;
case "inl_language":
$o.=inl_language($vtag_value);
break;
case "drop_lang":
$o.=drop_lang($vtag_value);
break;
case "drop_theme":
$o.=drop_theme($vtag_value);
break;
case "drop_results":
$o.=drop_results($vtag_value);
break;
default:
if function_exists($vtag_name))
$o.= $vtag_name($vtag_value);
elseif file_exists($filedir."mods/$vtag_name.mod")
{
include_once($filedir."mods/$vtag_name.mod"
$func_name = "runmod_$vtag_name";
if function_exists($func_name))
$o.= $func_name($vtag_value);
}
elseif file_exists($filedir."mods/$vtag_name.mod.php")
{
include_once($filedir."mods/$vtag_name.mod.php"
$func_name = "runmod_$vtag_name";
if function_exists($func_name))
$o.= $func_name($vtag_value);
}
break;
}
}
elseif(function_exists($tag))
$o.=$tag();
elseif(file_exists($filedir."mods/$tag.mod")
{
include_once($filedir . "mods/$tag.mod"
$func_name="runmod_$tag";
if(function_exists($func_name))
$o.=$func_name();
}
elseif(file_exists($filedir."mods/$tag.mod.php")
{
include_once($filedir . "mods/$tag.mod.php"
$func_name="runmod_$tag";
if(function_exists($func_name))
$o.=$func_name();
}
else
$o.=$tag;
//move ptr
$i=$tagClose+1;
}
}
return $o;
}
function cat_num_links_cat($vtag = null)
{
global $conn, $cat, $cat_query, $link_new;
$_new = $link_new;
//Number of days links considered as a NEW; comment this out to use default Admin setting
$_new = 5;
$_tags = explode("|", $vtag);
if ($_tags[0] == "new" || $_tags[1] == "new")
{
$cutoffdate = mktime(0,0,0,date("m",date("d"-$_new,date("Y");
$_add_new = " AND inl_links.link_date>='".$cutoffdate."'";
}
if $_catIDs = $_tags[0] && $_tags[0] != "new")? $_tags[0] : $cat)
{
$sql = "SELECT COUNT(inl_links.link_id) FROM inl_lc LEFT JOIN inl_links ON inl_lc.link_id=inl_links.link_id WHERE inl_links.link_vis='1' AND inl_lc.link_pend='0' AND inl_lc.cat_id IN ".$_catIDs." ".$_add_new;
echo $sql;
$rs = $conn->Execute($sql);
$ret = $rs && !$rs->EOF)? $rs->fields[0] : 0;
}
return $ret;
}
<%cat_num_links_cat:1,3,4|new%>
<%cat_num_links_cat:1|new%>
<%cat_num_links_cat:1%>
<%cat_num_links_cat:new%>
Posted: 02/08/2004 8:27:00 AM
Posted: 02/08/2004 2:47:00 PM
<%cat_num_links_cat:5,17,19,32,46|new%>
Posted: 02/08/2004 5:31:00 PM
Posted: 02/09/2004 10:18:00 AM
function cat_list_links_cat($vtag = null)
{
global $conn, $cat, $link_query, $link_new, $link_data;
$_new = $link_new;
// Number of days links considered as a NEW; comment this out to use default Admin setting
$_new = 5;
$tpl = "list_links"; // Specify template which will be parsed.
$limit = 10; // Limit links comment out the line to print all)
$_add_limit = $limit? " LIMIT 0, ".$limit : "";
$_tags = explode("|", $vtag);
if ($_tags[0] == "new" || $_tags[1] == "new")
{
$cutoffdate = mktime(0,0,0,date("m",date("d"-$_new,date("Y");
$_add_new = " AND inl_links.link_date>='".$cutoffdate."'";
}
if $_catIDs = $_tags[0] && $_tags[0] != "new")? $_tags[0] : $cat)
{
$sql = $link_query." WHERE inl_links.link_vis='1' AND inl_lc.link_pend='0' AND inl_lc.cat_id IN ".$_catIDs." ".$_add_new." ORDER BY inl_links.link_date DESC".$_add_limit;
if $rs = $conn->Execute($sql))
{
while $rs && !$rs->EOF)
{
$link_data = $rs->fields;
$ret.= parse($tpl);
$rs->MoveNext();
}
}
}
return $ret;
}
<%cat_list_links_cat:1,3,10|new%>
Posted: 02/09/2004 10:37:00 AM
Follow In-Portal: Facebook Twitter LinkedIn
In-Portal Jobs - Post Resume
Terms and Conditions of Use | Sale and Service Agreement | Privacy Policy
Web Development by Intechnic | © 1997-2013, In-Portal Non-profit Organization. All Rights Reserved