Steht der Quickfinder als Modul zum download zur Verfügung?
Oder ist dieser Sourcecode four for business vorbehalten ?
merci und grüsse
Quickfinder
-
- Beiträge: 6284
- Registriert: Do 15. Mai 2003, 18:32
- Wohnort: Da findet ihr mich nie!
- Kontaktdaten:
ich habe eben mal drübergeschaut, der Quickfinder geht leider nur für die Version 4.2. Hier ist dennoch der Code:
Modul-Code:
quickfinder_save.php:
addToQuickFinder-Funktion:
Ich habe den Code leider nicht getestet, sondern direkt aus dem Live-System übernommen. D.h. wenn etwas nicht funktioniert, bitte nicht mich fragen
Modul-Code:
Code: Alles auswählen
if(strstr($HTTP_USER_AGENT,"MSIE")!=false||substr($HTTP_USER_AGENT,strpos($HTTP_USER_AGENT,"Mozilla/")+8,1)>=5 ){
echo "<script type=\"text/javascript\">
function addToQuickFinder() {
document.forms[\"quickfinder\"].submit();
}
function go(url) {
window.location.href = url;
}
function deleteToQuickFinder(de){
document.forms[\"quickfinder\"].del.value=de;
document.forms[\"quickfinder\"].submit();
}
</script>";
$query = "SELECT * FROM $cfgTab_content AS CONT, $cfgTab_art_lang AS LANG WHERE LANG.idart = '$idart' AND LANG.idlang = '1' AND CONT.idartlang = LANG.idartlang AND CONT.idtype = '1' ORDER BY CONT.idtype";
$db->query($query);
$db->next_record();
$value = $db->f("value");
if($value==""){
$title= $db->f("title");
}else{
$title=$value;
}
echo "<form name=\"quickfinder\" method=\"post\" action=\"quickfinder_save.php\">";
echo "<input type=\"hidden\" name=\"lang\" value=\"$lang\">";
echo "<input type=\"hidden\" name=\"client\" value=\"$client\">";
echo "<input type=\"hidden\" name=\"idcat\" value=\"$idcat\">";
echo "<input type=\"hidden\" name=\"idart\" value=\"$idart\">";
echo "<input type=\"hidden\" name=\"m\" value=\"$m\">";
echo "<input type=\"hidden\" name=\"s\" value=\"$s\">";
echo "<input type=\"hidden\" name=\"t\" value=\"$t\">";
echo "<input type=\"hidden\" name=\"title\" value=\"$title\">";
echo "<input type=\"hidden\" name=\"del\" value=\"del\">";
echo "</form>";
$sess->hidden_session();
echo "
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr height=\"1\">
<td colspan=\"3\" bgcolor=\"#ffffff\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
</tr>
<tr height=\"15\" id=\"qControl\">
<td width=\"130\" align=\"right\" class=\"text11bn\" style=\"padding-right:5px\">Quickfinder </td>
<td width=\"1\" bgcolor=\"#ffffff\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
<td width=\"19\" bgcolor=\"#3A527A\" align=\"center\"><img src=\"images/quickarrow.gif\"></td>
</tr>
<tr height=\"1\">
<td colspan=\"3\" bgcolor=\"#ffffff\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
</tr>
<tr>
<td><img src=\"images/spacer.gif\" width=\"1\" height=\"10\"></td>
</tr>
</table>
";
echo "
<div id=\"qBody\">
<table width=\"150\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
echo "
<tr style=\"background-color:#ffffff\">
<td colspan=\"2\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
</tr>";
$db2 = new DB_Contenido;
// select all articles in category widthout start article
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang, ARTLANG.title FROM $cfgTab_cat_art AS CATART, $cfgTab_art_lang AS ARTLANG ".
"WHERE CATART.idcat = '49' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
"ARTLANG.online = '1' AND CATART.is_start = '0' ORDER BY CATART.idart";
// execute query
$db->query($query);
// get id's of sub articles
while ($db->next_record()) {
// $articleid = $db->f("idartlang");
$linkid = $db->f("idart");
$head = $db->f("title");
$link = $sess->url("index.php?client=$client〈=$lang&idcat=49&idart=$linkid&m=$m&s=$s");
$len = strlen($head);
// cut head if too long
if ($len > 30) {
$head = substr($head,0,30);
$head = $head. " ...";
} // end if
echo "
<tr style=\"background-color:#9FAFBC\" onMouseOver=\"g.over(this)\" onMouseOut=\"g.out(this)\">
<td class=\"text10bn\" style=\"padding:2px\" colspan=\"2\"> <a class=\"white\" href=\"javascript:go('".$link."')\">".$head."</a></td>
</tr>
<tr style=\"background-color:#ffffff\">
<td colspan=\"2\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
</tr>";
} // end while
if (is_array($quicklinks)) {
foreach ($quicklinks as $key => $value) {
$values = explode("|",$value);
if (strlen($values[0]) > 18) {
$values[0] = substr($values[0],0,18);
$values[0] = rtrim($values[0]);
$values[0] .= "...";
} // end if
echo "
<tr style=\"background-color:#9FAFBC\" onMouseOver=\"g.over(this)\" onMouseOut=\"g.out(this)\">
<td style=\"padding:2px\" class=\"text10bn\"><a class=\"white\" href=\"javascript:go('".$values[1]."')\">".$values[0]."</a></td>
<td align=\"right\"><a class=\"white\" href=\"javascript:deleteToQuickFinder('".$key."')\">x </a></td>
</tr>
<tr style=\"background-color:#ffffff\">
<td colspan=\"2\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>
</tr>";
} // end foreach
} // end if
echo " <tr style=\"background-color:#9FAFBC\" onMouseOver=\"g.over(this)\" onMouseOut=\"g.out(this)\">
<td style=\"padding:2px\" class=\"text10bn\" colspan=\"2\"><a class=\"main\" href=\"javascript:addToQuickFinder()\">Add to Quickfinder</a></td>
</tr>";
echo "</table></div>";
}
Code: Alles auswählen
<?
/***********************************************
* QUICKFINDER SAVE
*
* Schreibt die Bookmarks in das Cookie
*
* Author : Jan Lengowski
* Copyright : four for business AG
* Created : 19-08-2002
* Modified : 19-08-2002
************************************************/
if($del=="del"){
// count quicklinks
$cnt="0";
for($key=0;$key<21;$key++){
if(!isset($quicklinks[$key])){
$cnt=$key;
break;
} // end if
} // end for
// set cookie
setcookie("quicklinks[$cnt]","$title|index.php?client=$client&lang=$lang&idcat=$idcat&idart=$idart&m=$m&s=$s&t=$t",time()*2);
}else{
setcookie("quicklinks[$del]","",time() - 3600);
}
// redirect
header("Location: index.php?client=$client&lang=$lang&idcat=$idcat&idart=$idart&m=$m&s=$s&t=$t&sid=$sid");
?>
Code: Alles auswählen
function addToQuickFinder()
{
headline = document.getElementsByTagName("h1");
document.forms["quickfinder"].elements["title"].value = headline[0].innerHTML;
document.forms["quickfinder"].submit();
}
Schaust du dort
http://contenido.de/forum/viewtopic.php?p=9272#9272
http://contenido.de/forum/viewtopic.php?p=9272#9272