function fix_profile($profile)
{
    $text = html_to_bbcode($profile->response2);
    if ($text != $profile->response2) {
        $query = "update profile set response2 = '" . _mysql_escape_string($text) . "' where userid=" . $profile->userid;
        //echo "$profile->response2\n\n";
        //echo "$profile->thread $query\n\n";
        $retval = _mysql_query($query);
        if (!$retval) {
            echo _mysql_error();
            exit;
        }
    }
}
示例#2
0
function fix_post($post)
{
    $text = html_to_bbcode($post->content);
    if ($text != $post->content) {
        $query = "update post set content = '" . _mysql_escape_string($text) . "' where id=" . $post->id;
        //echo "$post->content\n\n";
        //echo "$post->thread $query\n\n";
        $retval = _mysql_query($query);
        if (!$retval) {
            echo _mysql_error();
            exit;
        }
    }
}
function fix_forum_preferences($forum_preferences)
{
    $text = html_to_bbcode($forum_preferences->signature);
    if ($text != $forum_preferences->signature) {
        $query = "update forum_preferences set signature = '" . _mysql_escape_string($text) . "' where userid=" . $forum_preferences->userid;
        //echo "$forum_preferences->signature\n\n";
        //echo "$forum_preferences->thread $query\n\n";
        $retval = _mysql_query($query);
        if (!$retval) {
            echo _mysql_error();
            exit;
        }
    }
}
示例#4
0
function cherokee_mysql_real_escape_string($unescaped_string, $link = NULL)
{
    if (!_dbslayer($link)) {
        return _call('_mysql_real_escape_string', $unescaped_string, $link);
    }
    return _mysql_escape_string($unescaped_string);
}
示例#5
0
    if (isset($item[2])) {
        $title = $item[2];
    } else {
        $n = strpos($content, ". ");
        if ($n) {
            $title = substr($content, 0, $n);
        } else {
            $title = $content;
        }
    }
    $when = strtotime($item[0]);
    $title = html_to_bbcode($title);
    $title = str_replace("\n", " ", $title);
    $title = _mysql_escape_string($title);
    $content = html_to_bbcode($content);
    $content = str_replace("\n", " ", $content);
    $content = _mysql_escape_string($content);
    $thread_id = BoincThread::insert("(forum, owner, title, create_time, timestamp, replies) values ({$forum_id}, {$user->id}, '{$title}', {$when}, {$when}, 0)");
    if (!$thread_id) {
        echo "thread insert failed\n";
        echo "title: [{$title}]\n";
        echo "when: {$when}\n";
        exit;
    }
    $id = BoincPost::insert("(thread, user, timestamp, content) values ({$thread_id}, {$user->id}, {$when}, '{$content}')");
    if (!$id) {
        die("post insert");
    }
    $forum->update("threads=threads+1, posts=posts+1");
}
echo "\n\nProject news has been successfully converted from\nhtml/project/project_news.inc to forum format.\nChange your index.php to use\n   show_news(0, 5)\nto show news and related links.\n\nIf everything looks OK, you can delete html/project/project_news.inc\n\n";