Ban with bridge to IPB 1.3 Ban with bridge to IPB 1.3
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Ban with bridge to IPB 1.3

Started by Sephiros, March 30, 2004, 02:33:19 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Sephiros

Hello,

First of all thanks for this great gallery it's awesome :)

I Bridged Coppermine to my IPB forum and everything works perfecly well.
I only have a question concerning banning:

Is it possible to ban a specific member of the forum from the gallery using the built-in ban feature?

When I try to it gives me this error:


While executing query "SELECT user_id FROM **ERROR** WHERE user_name = 'Sephiros'" on 0

mySQL error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '**ERROR** WHERE user_name = 'Sephiros'' at line 1


of course as I bridged Coppermine with the forum, there is no users in my "user_name" field of the database.

So i wonder if there is a way to make it work, if I missed something in the configurations (again everything else works perfectly) or anything else.

Thank you,
Sephiros

Nibbler

Hi,

This *should* be fixed in 1.3.0 when it is released, but to fix this for now you can do something like -

in functions.inc.php:

change:


//        } elseif (defined('UDB_INTEGRATION')) {
//           return udb_get_user_name($uid);


to


        } elseif (defined('UDB_INTEGRATION')) {
           return udb_get_user_id($username);


+ In your bridge file add a new function udb_get_user_id:


function udb_get_user_id($username)
{
    global $UDB_DB_LINK_ID, $UDB_DB_NAME_PREFIX, $CONFIG;

    $sql = "SELECT id " . "FROM " . $UDB_DB_NAME_PREFIX . IB_TABLE_PREFIX . IB_USER_TABLE . " " . "WHERE name = '$username'";

    $result = db_query($sql, $UDB_DB_LINK_ID);

    if (mysql_num_rows($result)) {
        $row = mysql_fetch_array($result);
        mysql_free_result($result);
        return $row['id'];
    } else {
        return '';
    }
}


Can't test this as I don't use IPB, hope it works :D

Sephiros

Thanks for the quick response Nibbler!

I carefully followed your instructions but still no luck, with exactly the same error...

I know too little of php to see what's wrong  :?