Quote:
Originally Posted by ozlegolas I am not a guru in php, I have done some changes to the core applying the things written in forum for 4-5 months and this is a long time to remember exactly what files I changed, but I'm ready to help you as much as I can do |
Not work again:
1: I was create table same this:
Code:
alter table pligg_tags add column tag_safe varchar(30)
2:this my tag.php code:
Code:
function tags_insert_string($link, $lang, $string, $date = 0) {
global $db;
$string = tags_normalize_string($string);
if ($date == 0) $date=time();
$words = preg_split('/[,;]+/', $string);
if ($words) {
$db->query("delete from " . table_tags . " where tag_link_id = $link");
foreach ($words as $word) {
$word=trim($word);
//************************************************************
//SAFE words
$replace_what = array("ç","ğ","ı","ö","ş","ü","Ö","Ş","Ü");
$replace_with = array("c","g","i","o","s","u","O","S","U");
$word_safe= str_ireplace($replace_what,$replace_with,$word);
//*******************************************************
if (!$inserted[$word] && !empty($word)) {
$db->query("insert into " . table_tags . " (tag_link_id, tag_lang, tag_words, tag_safe,tag_date) values ($link, '$lang', '$word','$word_safe', from_unixtime($date))");
$inserted[$word] = true;
}
}
return true;
}
return false;
}
3.this my search.php
Code:
function get_search_clause($option='') {
if(!empty($this->searchTerm)) {
// make sure there is a search term
//change to search
$words = $this->searchTerm;
$SearchMethod = SearchMethod; // create a temp variable so we can change the value without possibly affecting anything else
if($this->isTag == true){
// search the tags table
$this->searchTable = table_tags . " INNER JOIN " . table_links . " ON " . table_tags . ".tag_link_id = " . table_links . ".link_id";
// thanks to jalso for this code
$x = explode(",",$words);
$sq .= "(";
foreach($x as $k=>$v){
//****************************************************************
$replace_what = array("ú","ó","é","ý","š","á","í","á","e","š","c","r","z","y","á","í","é","n","t","d","ó","ç","ğ","ı","ö","ş","ü");
$replace_with = array("u","o","e","y","s","a","i","a","e","s","c","r","z","y","a","i","e","n","t","d","o","c","g","i","o","s","u");
$word_safe= str_ireplace($replace_what,$replace_with,trim($x[$k]));
$sq .= "tag_safe = '".$word_safe."'";
//*************************************************************************************
if($k != (count($x) - 1))$sq .= " OR ";
}
$sq .= ")";
$where .= " AND ".$sq." GROUP BY " . table_links . ".link_id, `link_votes` ORDER BY `link_votes` DESC";
// ---
this tags looking like this in the phpmyadmin into tag_safe table:
I'm starting the boring.ufffffff