Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorsilly
    • CommentTimeOct 8th 2005
     
    I would like to be able to make pages that integrate search results. For example, I don't have an album dedicated to uncle Joe, but if he is mentioned in the captions, I think it should be possible to make a page showing all images with uncle Joe, by integrating a hard-coded search for "Joe" into it.

    I've been looking through the code for the right incantation, but I'm not very familiar with php, so perhaps one of you can give me a hint. And I thought it might be useful to others as well.
    •  
      CommentAuthormike
    • CommentTimeOct 8th 2005
     
    I'm not exactly sure what you mean, but couldn't you just perform a search for "Joe" and copy the URL produced by that search?

    Just create a link to that search, like
    http://yoursite.com/plogger/index.php?level=search&searchterms=joe
    • CommentAuthorsilly
    • CommentTimeOct 9th 2005
     
    That would be the basic solution, but I wanted the page to include some text on joe as well.
    When I asked the question, I was thinking along the lines of a joe.php page that would call the gallery and pass the arguments in some other way than adding them to the url.
    Right now I'm thinking of a modified version of index.php that would include a text file based on the value of searchterms, which would be much more versatile and probably fairly easy, just add some lines that search for a text file named after the searchterms and include it when found. The only "change" would be to not show the "you were searching for" line in that case.

    Anyway, thanks. I've learned a lot about php in the last hours :)
    • CommentAuthorsilly
    • CommentTimeOct 10th 2005
     
    Here's a rough change in gallery.php (around line 90) that does more or less what I had in mind:

    // Output highest level container division
    $output .= '
    <div id="wrapper">
    <table id="header-table" width="100%"><tr><td>'.generate_header().'</td><td style="text-align: right; vertical-align: bottom;">'.generate_jump_menu().generate_search_box().'</td></tr></table>';

    if ($level != "picture"){
    $output .= '<form action="' . $config["baseurl"] . 'plog-download.php" method="post">';
    }
    // added by eli
    $predefined=FALSE;
    // we are going to check if this was a predefined search
    if ($level == "search"){

    if(isset($_GET["predef"])) $predefined=TRUE;

    if($predefined) {

    $terms = $_REQUEST["searchterms"];
    $terms = explode(" ",$terms);

    if ((count($terms) != 1) || ($terms[0] != '')){
    $includetextfile= 'includetexts/'.$terms[0].'.txt';


    $filecontent=file_get_contents($includetextfile) or $predefined=FALSE;

    if($predefined) {

    $output .= '
    <div id="main_container">
    <div id="breadcrumbs">
    <table width="100%">
    <tr>
    <td>
    ';


    $output .= $filecontent;

    $output .= '
    </td>
    <td style="text-align: right;">';

    }
    }
    else{
    $predefined=FALSE;
    }
    }
    }
    if(!$predefined) {
    // end added by eli

    $output .= '
    <div id="main_container">
    <div id="breadcrumbs">
    <table width="100%">
    <tr>
    <td>
    '.generate_breadcrumb($level, $id).'
    </td>
    <td style="text-align: right;">';
    } //added by eli
    • CommentAuthorsilly
    • CommentTimeOct 24th 2005
     
    Here is an example of a page generated with a "predefined search" where some text is inserted (using the code change above).

    http://www.truefork.org/Art/plogger/index.php?level=search&searchterms=Katrina&predef=1