How to add search block in 'photos' page?

Can anybody tell how to add a search block on the head of browsePhoto.php? like the block when we click 'events/search'. I just want to put a textbox and a submit button, then photos will be searched by tags according to the input of textbox.

I think some modification need to be done in  browsePhoto.php and BxDolSharedMedia.php,does anyone know how to do it?

Version 6.1.6

Thanks in advance.

 

 

Quote · 8 Mar 2012

I tried put the following on browsephoto.php, but the form don't show!

function PageCodeSearchByTag()

{

ob_start();

?>

    <div class="search_by_tag">

   <form method="GET" action="<?= $_SERVER['PHP_SELF'] ?>">

   <input type="text" class="input_by_tag" name="Tags" />

   <br />

<input type="submit" value="<?= _t( '_Fetch' ) ?>" />

   </form>

</div>

<?php

    return DesignBoxContentBorder( _t( '_Search by Tag' ), ob_get_clean() );

}

PageCodeSearchByTag();

Quote · 8 Mar 2012

I think the above codes may somehow need to be connected to following codes in BxDolSharedMedia.php, but don't know how to do it, can somebody help?!

if (isset($_GET['tag'])) {

$sTag = htmlspecialchars_adv($_GET['tag']);

$aWhere[] = "`{$this->sMainTable}`.`{$this->aTableFields['medTags']}` like '%$sTag%'";

}

Quote · 8 Mar 2012

Tried by adding the following function in BxDolSharedMedia.php, and added '$oNew->PhotoSearchByTags();' in browsephoto.php, it shows a form on left-head of  the page. But tag search doesn't work, no matter what I put in the textbox and search, still show all photos. How to fix this?

function PhotoSearchByTags()

{

ob_start();

?>

    <div class="search_by_tag">

   <form method="GET" action="<?= $_SERVER['PHP_SELF'] ?>">

   <input type="text" class="input_by_tag" name="Tags" id="Tags" />

   <br />

<input type="submit" value="<?= _t( '_Fetch' ) ?>" />

   </form>

</div>

<?php

$searchTags=$_POST['Tags'];

$aWhere = array();

$aWhere[] = '1';

$aWhere[] = "`{$this->sMainTable}`.`{$this->aTableFields['medTags']}` like '%$searchTags%'";

$aSqlQuery['sqlWhere'] = "WHERE " . implode( ' AND ', $aWhere ).$sAddon." AND `Approved`= 'true'";

$iTotalNum = db_value( "SELECT COUNT( * ) FROM `{$this->sMainTable}` {$aSqlQuery['sqlWhere']}" );

if (!$iTotalNum)

return false;

}

Quote · 8 Mar 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.