Thread subject: muscapaul's PHP-Fusion website :: Terms Infusion v2.xx

Posted by villantz on 17-06-2008 01:13
#15

I test it clever, useful work, regal! i27.tinypic.com/i55b80.gif

King very full!
i29.tinypic.com/izrcc1.jpg

@franktombino
Tipp: correctly necessary and to insert codes into the particular files... for me came in.

Warning: ...... infusions\terms\include\functions.php on line 112
answer:
1. this is e search:
Code
        else {
            $terms_s .= "".$data_a['term_descript']."_ ";
        }
    }



delete: }
2. this is e search:
Code
    $text = preg_replace('#\The Glossary contains no matching items.
It may have been added using different lettering,
so you can click the Term to check this.
Otherwise, contact the Administrator to report this error.#si', $locale['term806'], $text);
    $text = descript($text,false);

    return $text;
}



}
return $text; - above it do

in this way correct:
Code
// Parse text to replace term title with term description and strip url bbcode from text
function parseterm($text) {
    $dsettings = dbarray(dbquery("SELECT * FROM ".DB_PREFIX."term_settings"));
    $type = $dsettings['term_type'];
    if (file_exists(INFUSIONS."terms/".$type."locale/".$settings['locale'].".php")) {
        include INFUSIONS."terms/".$type."locale/".$settings['locale'].".php";
    }
    else {
        include INFUSIONS."terms/".$type."locale/English.php";
    }

    $result_a = dbquery("SELECT term_title, term_descript FROM ".DB_PREFIX."terms ORDER BY term_id ASC");
    $search_s = '';
    $terms_s = '';
    while ($data_a=dbarray($result_a)) {
        $result_b = dbquery("SELECT term_title FROM ".DB_PREFIX."terms WHERE term_title = '".$data_a['term_title']."'");
        $rowsb = dbrows($result_b);
        $search_s .= "'The Glossary contains no matching items.
It may have been added using different lettering,
so you can click the Term to check this.
Otherwise, contact the Administrator to report this error.', ";
        if ($rowsb != 1) {
            $terms_s .= "".$locale['term805']."_ ";
        }
        else {
            $terms_s .= "".$data_a['term_descript']."_ ";

    }
       
    $search_a = substr($search_s, 0, -2);
    $terms_a = substr($terms_s, 0, -2);
    $search = explode(', ', $search_a);
    $terms = explode ('_ ', $terms_a);
    $text = preg_replace($search, $terms, $text);
    $text = preg_replace('#\[b\](.*?)\[/b\]#si', '\1', $text);
    $text = preg_replace('#\[i\](.*?)\[/i\]#si', '\1', $text);
    $text = preg_replace('#\[u\](.*?)\[/u\]#si', '\1', $text);
    $text = preg_replace('#\[center\](.*?)\[/center\]#si', '\1', $text);
    $text = preg_replace('#\[code\](.*?)\[/code\]#si', '\1', $text);
    $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '\1', $text);
    $text = preg_replace('#\[small\](.*?)\[/small\]#si', '\1', $text);
    $text = preg_replace('#\[url\](.*?)\[/url\]#si', '\1', $text);
    $text = preg_replace('#\[url=([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\4 (\2\3)', $text);
    $text = preg_replace('#\[url=([\r\n]*)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\3 (\2)', $text);
    $text = preg_replace('#\[img\](.*?)\[/img\]#si', '\1', $text);
    $text = preg_replace('#\The Glossary contains no matching items.
It may have been added using different lettering,
so you can click the Term to check this.
Otherwise, contact the Administrator to report this error.#si', $locale['term806'], $text);
    $text = descript($text,false);
        }
    return $text;
}




Warning: ...... infusions\terms\include\functions.php on line 151
answer:
1. this is e search:
Code
        else {
            $images_s .= "".$data_a['term_image'].", ";
        }
    }



delete: }
2. this is e search:
Code
    $text = descript($text,false);

    return $text;
}



}
return $text; - above it do

in this way correct:
Code
// Parse text to replace term title with term image
function parsetermimg($text) {
    $result_a = dbquery("SELECT term_title, term_image FROM ".DB_PREFIX."terms ORDER BY term_id ASC");
    $search_s = '';
    $images_s = '';
    while ($data_a=dbarray($result_a)) {
        $result_b = dbquery("SELECT term_title FROM ".DB_PREFIX."terms WHERE term_title = '".$data_a['term_title']."'");
        $rowsb = dbrows($result_b);
        $search_s .= "'-img-".$data_a['term_title']."-img-', ";
        if ($data_a['term_image'] == '' || $rowsb != 1) {
            $images_s .= "".INFUSIONS."/terms/images/no_image.gif, ";
        }
        else {
            $images_s .= "".$data_a['term_image'].", ";

    }
       
    $search_a = substr($search_s, 0, -2);
    $images_a = substr($images_s, 0, -2);
    $search = explode(', ', $search_a);
    $images = explode (', ', $images_a);
    $text = preg_replace($search, $images, $text);
    $text = preg_replace('#\-img-(.*?)\-img-#si', INFUSIONS."/terms/images/no_image.gif", $text);
    $text = preg_replace('#\[glos\](.*?)\[/glos\]#si', '\1', $text);
    $text = descript($text,false);
        }
    return $text;
}



Enjoy!!

Edited by villantz on 18-06-2008 00:17