Okey, here we go, but I must warn you that this is BETA MOD and it should be tested by someone who knows what he's doing
1. Open
member_uploadform.html in your templates folder:
change:
<textarea cols="30" class="textarea" rows="10" wrap="VIRTUAL" name="image_keywords">{image_keywords}</textarea>
to:
<textarea cols="30" class="textarea" rows="10" wrap="VIRTUAL" name="image_keywords" id="image_keywords">{image_keywords}</textarea>
if its not working try this:
<input type="text" name="image_keywords" id="image_keywords" />
2. Open
header.htmlafter:
<link rel="stylesheet" href="{template_url}/style.css" />
add:
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="tag.js"></script>
<script type="text/javascript">
<!--
$(function () {
$('#image_keywords').tagSuggest({
url: '{url_tags}',
delay: 250
});
});
//-->
</script>
<style type="text/css" media="screen">
<!--
SPAN.tagMatches {
margin-left: 10px;
}
SPAN.tagMatches SPAN {
padding: 2px;
margin-right: 4px;
background-color: #0000AB;
color: #fff;
cursor: pointer;
}
PRE {
background: #ddd;
font-family: Courier;
padding: 5px;
overflow: auto;
}
-->
</style>
3. Open includes/
page_header.php and
after "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
add"url_tags" => $site_sess->url(ROOT_PATH."tags.php"),
4. Create new file
tags.php and upload it to root folder of your 4images gallery:
<?php
$main_template = 0;
$nozip = 1;
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
include(ROOT_PATH.'includes/search_utils.php');
$tag = isset($HTTP_GET_VARS['tag']) ? un_htmlspecialchars(trim($HTTP_GET_VARS['tag'])) : "";
$tag = strip_tags(trim($tag));
$tag = convert_special($tag);
$tag = str_replace("%", "", $tag);
if ($tag !== "") {
$sql = "SELECT DISTINCT i.word_text
FROM 4images_wordlist i
LEFT JOIN 4images_wordmatch c ON i.word_id = c.word_id
WHERE c.keys_match >= 0 AND i.word_text LIKE '".$tag."%'
ORDER BY RAND()
LIMIT 5";
$result = $site_db->query($sql);
echo '[';
while ($row = $site_db->fetch_array($result))
{
if (isset($word_text))
echo ",";
$word_text = $n = str_replace('"', '"', $row['word_text']);
echo '"'.$word_text.'"';
}
echo ']';
}
?>
5. Download file:
http://remysharp.com/downloads/tag.jsAnd upload it to your root directory.
I hope that's all, test it and let me know if it's working...
[EDIT by V@no]
fixed error in tags.php plus added little filter and fixed wrong filename tags.js instead of tag.js in header.html