function convert66()

Begonnen von algebre, 30 April 2007, 23:34:51

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

algebre

hi
Is this interssent :
function convert66($query)
{
    if (!ereg($GLOBALS['prefix'] . "_bbprivmsgs", $query)) {
   
return $query;
   
    }
    if ($GLOBALS['mxSqlErrorDebug']) echo "before = $query<br>";
    $search = array("_bbprivmsgs");
    $replace = array("_priv_msgs");
$query = str_replace($search, $replace, $query);

$search = array(" privmsgs_id " , ",privmsgs_id" , "privmsgs_id," , "privmsgs_id=");
    $replace = array(" msg_id AS privmsgs_id " , ",msg_id AS privmsgs_id" , "msg_id AS privmsgs_id," , "msg_id=");
    $query = str_replace($search, $replace, $query);

    $search = array(" privmsgs_subject  " , ",privmsgs_subject" , "privmsgs_subject," , "privmsgs_subject=");
    $replace = array(" subject AS privmsgs_subject " , ",subject AS privmsgs_subject" , "subject AS privmsgs_subject," , "subject=");
    $query = str_replace($search, $replace, $query);

    $search = array(" privmsgs_from_userid " , ",privmsgs_from_userid" , "privmsgs_from_userid," , "privmsgs_from_userid=");
    $replace = array(" from_userid AS privmsgs_from_userid " , ",from_userid AS privmsgs_from_userid" , "from_userid AS privmsgs_from_userid," , "from_userid=");
    $query = str_replace($search, $replace, $query);

    $search = array(" privmsgs_to_userid " , ",privmsgs_to_userid" , "privmsgs_to_userid," , "privmsgs_to_userid=");
    $replace = array(" to_userid AS privmsgs_to_userid " , ",to_userid AS privmsgs_to_userid" , "to_userid AS privmsgs_to_userid," , "to_userid= ");
    $query = str_replace($search, $replace, $query);

    $search = array(" privmsgs_date " , ",privmsgs_date" , "privmsgs_date," , "privmsgs_date=");
    $replace = array(" UNIX_TIMESTAMP(msg_time) AS user_website " , ",UNIX_TIMESTAMP(msg_time) AS user_website" , "UNIX_TIMESTAMP(msg_time) AS user_website," , "UNIX_TIMESTAMP(msg_time)=");
    $query = str_replace($search, $replace, $query);
           
    $search = array("privmsgs_type='5' " , "privmsgs_type='1'" , "privmsgs_type='0' ");
    $replace = array("read_msg='1' " , "read_msg='1' " , "read_msg='0' ");
    $query = str_replace($search, $replace, $query);

$query = preg_replace('#(.*\s*)((?:order by|where)\s*.*)(uname)(\s*=.*)#is', '\1\2username\4', $query);
    $query = preg_replace('#(.*\s*)((?:order by|where)\s*.*)(uid)(\s*=.*)#is', '\1\2user_id\4', $query);
    if ($GLOBALS['mxSqlErrorDebug']) echo "after = $query<br>";
    return $query;


in sql_layer.php

algebre

hi
ex for use
this theme is phpnuke: