Advanced search  

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

Pages: [1]   Go Down

Author Topic: Top Uploaders Of The Month  (Read 10920 times)

0 Members and 1 Guest are viewing this topic.

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Top Uploaders Of The Month
« on: November 15, 2007, 10:09:10 am »

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. ;)
« Last Edit: November 16, 2007, 11:50:09 am by Nibbler »
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Top Uploaders Of The Month
« Reply #1 on: November 15, 2007, 09:12:08 pm »

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.

Code: [Select]
$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
« Last Edit: November 15, 2007, 09:23:14 pm by just_some_guy »
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #2 on: November 15, 2007, 11:12:29 pm »

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

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Top Uploaders Of The Month
« Reply #3 on: November 15, 2007, 11:15:47 pm »

What did you change and too what?
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #4 on: November 16, 2007, 12:11:45 am »

I changed what you said to:

Code: [Select]
$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");
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Top Uploaders Of The Month
« Reply #5 on: November 16, 2007, 08:26:27 am »

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,
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Top Uploaders Of The Month
« Reply #6 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).

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Top Uploaders Of The Month
« Reply #7 on: November 16, 2007, 09:04:46 am »

Code: [Select]
$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.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #8 on: November 16, 2007, 10:01:34 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Top Uploaders Of The Month
« Reply #9 on: November 16, 2007, 05:44:27 pm »

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

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Top Uploaders Of The Month
« Reply #10 on: November 16, 2007, 06:48:35 pm »

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.
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #11 on: November 17, 2007, 03:14:55 pm »

Do you grant Foulu permission to release his changes publicly for the benfit of others?
Yeah why not ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Top Uploaders Of The Month
« Reply #12 on: November 17, 2007, 06:03:55 pm »

OK, thanks.

@Foulu: could you do that please? Thanks in advance.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 21 queries.