Top Uploaders Of The Month Top Uploaders Of The Month
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Top Uploaders Of The Month

Started by will, November 15, 2007, 10:09:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

will

Hi have recently got help on a top uploaders of the month without my gallery being bridged here: http://forum.coppermine-gallery.net/index.php?topic=43809.0

Since I have bridged my gallery with Invision Power Board its not working: http://cdcoverhideout.com/gallery/statistics.php

I'm willing to pay $10-$20 for help in making it work with my bridged gallery. ;)

just_some_guy

#1
I dont have a bridged gallery but i know that the users are no longer kept on the coppermine tables and possibly the user groups are being used from IPB too.

So i would think you modify nibblers code as follows.

$startofmonth = strtotime('first '.date('F'));
$result = cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}, *IPB TABLE FOR USERS*, *IPB TABLE FOR GROUPS* (i think this will only apply if selected to use the forums groups on the bridging wizard* WHERE user_id = owner_id AND user_group = group_id AND user_group <> 1 AND ctime > $startofmonth GROUP BY owner_id ORDER BY numpics DESC LIMIT 5");


You will also need to change the refrences of user_id, user_group and possibly group_name. to what they are in the IPB.

This may work.

No need for payment have it for Free.

just_some_guy
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

I changed it but I get: There was an error while processing a database query ;)

just_some_guy

What did you change and too what?
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

I changed what you said to:

$startofmonth = strtotime('first '.date('F'));
$result = cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['IBF_MEMBERS']}, {$CONFIG['TABLE_USERGROUPS']} WHERE user_id = owner_id AND user_group = group_id AND user_group <> 1 AND ctime > $startofmonth GROUP BY owner_id ORDER BY numpics DESC LIMIT 10");

just_some_guy

So can you access the ipb table with {$CONFIG['IBF_MEMBERS']}?
Is the column for user id and user name definetly called "user_id" and user_name" in the ipb table?
I take it you using coppermine groups?

I think you problem might be trying to access the ipb board with config variable just use like ipb_members or whatever, seeing as you are on a coppermine page. Also as i said this is only working in theroy as i have never used an ipb before and i am looking at it from the point of just changing the code to suit the location of the data.

just_some_guy,
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Stramm

just_some_guy, I have no idea how you come to the conclusion, that {$CONFIG['IBF_MEMBERS']} is defined somewhere and holds the table name of the Invision Power Board users table. Try to echo it and see that for this array index no value exists or just search the coppermine code for 'IBF' and check the results.
You either hardcode table names for 'external' apps (evtl. you need to connect too) or extend the class udb_base (more difficult).

Joachim Müller

Quote from: just_some_guy on November 15, 2007, 09:12:08 PM
$startofmonth = strtotime('first '.date('F'));
$result = cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}, *IPB TABLE FOR USERS*, *IPB TABLE FOR GROUPS* (i think this will only apply if selected to use the forums groups on the bridging wizard* WHERE user_id = owner_id AND user_group = group_id AND user_group <> 1 AND ctime > $startofmonth GROUP BY owner_id ORDER BY numpics DESC LIMIT 5");

That's made-up code that seems to be a result of wishfull thinking. It's not actual code that you could possibly apply, as Stramm suggested.

will

Its ok guys foulu as completed my request, thanks anyway ;)

Joachim Müller

Do you grant Foulu permission to release his changes publicly for the benfit of others?

just_some_guy

Quote from: Stramm on November 16, 2007, 08:42:42 AM
just_some_guy, I have no idea how you come to the conclusion, that {$CONFIG['IBF_MEMBERS']} is defined somewhere and holds the table name of the Invision Power Board users table. Try to echo it and see that for this array index no value exists or just search the coppermine code for 'IBF' and check the results.
You either hardcode table names for 'external' apps (evtl. you need to connect too) or extend the class udb_base (more difficult).

Sorry as i said, i was thinking from a theroy point of view. Ie chaging the location of the tables to suit the new location for example - Before bridging the users were stored in {$CONFIG['TABLE_USERS']} and after bridging the users are now kept in the ipb table, so i was thinking you would just exchange the table names and column names. And i got the "{$CONFIG['IBF_MEMBERS']}" from will's previous post of code where he had this as the members table.

Anyway good to see its sorted.
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

Quote from: GauGau on November 16, 2007, 05:44:27 PM
Do you grant Foulu permission to release his changes publicly for the benfit of others?
Yeah why not ;)

Joachim Müller

OK, thanks.

@Foulu: could you do that please? Thanks in advance.