WebsiteBaker Support (2.8.x) > Diskussion über WB (closed)

webcode snippet ("jump to page") gesucht.

<< < (13/13)

aldus:
Steht doch in der "index.php" drin,

--- Code: ---<?php // ignore this line ...
$result = $search->search_and_go ( trim($_POST[&#39;searchstring&#39;]) );

--- End code ---

ansonsten eben nur "search" ...

Da ich ansonsten nicht weiss //was// Du //wie// und //warum// implantiert hast, kann ich da auch nicht weiter helfen,
ausser eben sich die Class mal anzusehen ...


--- Quote ---Ich habe irgendwo noch einen Fehler drin ...

--- End quote ---
Validieren, validieren, validieren ...  :-D

Gruß
Aldus

rido:
Sorry meine Laienfragen, jetzt läuft alles und ich habs endlich kapiert!

Vielen Dank nochmal !!!   8-)

rido

aldus:
Nein ... brauchst Dich nicht zu entschuldigen ... das alte Schätzchen ist mehr als
//mau// dokumentiert und ziemlich mit der heissen Nadel gestrickt worden ... (schäm) ...

Daher noch mal hier eine kurze Zusammenfassung auf die Schnelle, es wäre vieleicht auch
gut eine Art "quick-reference" oder "quick start" mit dazu zu packen ...
Evtl. wäre auch noch die Aufnahme von Bilder-Links in die XML Datei nicht schlecht ... als eine Art "preview"


--- Code: ---<?php

/**
 *    Embedding the class
 */
require_once ("includes/c_webcodesearch.php");

/**
 *    Getting an instance
 */
$my_search = new c_webcodesearch();

/**
 *    Setting the path to the xml-document
 */
$my_search->filename = "Testdocument.xml";

/**
 *    Getting all
 */
$result = $my_search->getAll();

/**
 *    Getting a search result
 */
$result = $my_search->search ( $a_webcode_string );

/**
 *    Getting the link instead of the data, or "0" if none match
 */
$result = $my_search->search_and_go( $a_webcode_string );

/**
 *    Example for handling the result
 */
$result = $my_search->search_and_go ( $a_wecode_string );
if ("0" == $result ) {
    echo "sorry ... no matches found: ";
    echo $my_search->getAll();
} else {
    echo "<script>window.onload = function() { document.location.href=&#39;".$result."&#39;; }\n</script>";
}

/**
 *    To modify the result-output you can modify the following template(-strings) vars
 *
 *    - header_item_templ
 *    - content_templ
 *    - content_all_templ
 *    - error_templ
 *
 *    within the following keys|markers:
 *
 *    count_all    - display the number of all founded webcodes
 *    code        - display the webcode
 *    name        - display the name of the webcode
 *    descr        - display the description of the webcode
 *    url            - display the url of the webcode
 *    title        - display title of the webcode in the link
 *    comment        - display the comment of the webcode
 *
 *    Example given:
 */
$my_search->error_templ = "All found: <b>{{ count_all }}</b>, but none has match: {{ code }}!";

/**
 *    Displaying the header, default is false.
 */
$my_search->display_header = true; 

/**
 *    Manipulate the header info about //witch// info is display in a given order and
 *    with what kind of lable (values)
 */
$my_search->$header_info = array (
    &#39;version&#39; => "Version",
    &#39;date&#39;      => "Datum",
    &#39;author&#39;  => "Autor"
);

/**
 *    Manipulate the header-info-template
 */
$my_search->header_item_templ = "<br/>{{ label }} : <i>{{ value }}</i>";

?>

--- End code ---

Gruß
Aldus

Jonniboy:
Linger, könntest du dieses Dokument, was du verlinkt hast, nochmal hochladen?
Ich kann es nicht mehr öffnen.  :-(

Linger:
Hallo Jonniboy,

die URL zum Artikel hatte sich infolge des Upgrades von WB 2.6.7 auf 2.7 geändert. Hier die korrekte Adresse:
http://www.andreherdling.de/generator/content/webentwicklung/php-scripts-snippets/webcode-suche.php

Ich hoffe, dass ist das, was Du gesucht hast. Ich weiß aber nicht genau, ob das der tatsächlich letzte Stand ist, oder ob der fleißige aldus noch weitere Anpassungen vorgenommen hat. Mein letzter Stand ist Version 0.4.1.

Beste Grüße
André

Navigation

[0] Message Index

[*] Previous page

Go to full version