PDA

View Full Version : Coppermine Random Photos on vBulletin FORUMHOME (easy)


AcidX
19 Aug 2006, 17:02
This is basicaly the easiest way to have random photos from your Coppermine Gallery displayed on your vBulletin home page.
Tested and working perfectly. Here's the installation process containing only 3 steps.

Requirements : Coppermine Photo Gallery Installed.



Installation steps :

1. Download coppermine.php and edit the database info. After you're done, upload it in your forum root.


2. Open your vBulletin index.php file and under require_once('./global.php'); add the following line:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


(save the changes > upload the file in the forum root)


3. Open your Style Manager ("Styles & Templates" in the AdminCP menu) and edit the FORUMHOME template.
Depending on where you want your random pictures to appear, you should paste this code eather under $navbar or <!-- end what's going on box -->.
The code you need to paste is:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


(Save the template.)



All done.
I know you like it - http://www.vbulletin.org/forum/images/smoothblue/buttons/installed.gif (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=124398) ;)

Here's the live demo (http://forum.kajgana.com/) and some screenshots:

hgb
19 Aug 2006, 20:29
my logo is just like here....top and to the left.... how would i put the pics to the right of the logo and and will it work with 3.6 ?

thx

Selene
19 Aug 2006, 23:14
Hi,

great hack. Installed!

and yes it works fully with 3.6.0 as im running it there.

Just a question, what if i want to display those random pics code under forumnav, but on ALL FORUMS not just FORUMHOME, then which template should i modify

Selene
19 Aug 2006, 23:33
another question:

what if i want to open the thumbnail pics in a "new" window ? which lines do i modify in coppermine.php for that

Barakat
20 Aug 2006, 05:53
works great ............. thanks a lot for that love it ...

DjTaz
20 Aug 2006, 13:40
Hi,

great hack. Installed!

and yes it works fully with 3.6.0 as im running it there.

Just a question, what if i want to display those random pics code under forumnav, but on ALL FORUMS not just FORUMHOME, then which template should i modify

If you want this hack to work on all the areas , just put the code into NAVBAR instead of FORUMHOME at the very bottom - that should do the trick for you.

:D

AcidX
20 Aug 2006, 13:53
another question:

what if i want to open the thumbnail pics in a "new" window ? which lines do i modify in coppermine.php for that
Thanks for installing.
If you want to open the pics in a new window, just open the coppermine.php file, find the line:
$copphotos.='<td><a target = "_parent"

and replace it with:
$copphotos.='<td><a target = "_blank"

That should do the trick ;)

DjTaz
20 Aug 2006, 14:11
OOPS - I MAY HAVE MISREAD THE QUESTION HERE - I THOUGHT YOU WANTED TO OPEN THE THUMBNAILS INSTEAD OF THE PHOTO , SORRY ... WELL THIS IS HOW THAT IS DONE ANYWAY :sanother question:

what if i want to open the thumbnail pics in a "new" window ? which lines do i modify in coppermine.php for that


Im not sure why you would want to do this , and i checked the codes on it - the amount of recoding would be huge if you wanted to make the thumbnail display instead of the image since coppermine isnt even set up to show a single thumbnail on its own.

That being said ... if you change some of the code in coppermine.php from this :
Find


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and change to



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



it should bring you to that users thumbnail page instead of to the photo itself

AcidX
21 Aug 2006, 16:18
Indeed.
You got two resonable answers and modifications - I hope you got what you were asking for ;)

Konstantinos
27 Sep 2006, 17:50
why the thumbnails in forum home are much smaller than the thumbs in coppermine home and how to fix this ?

Konstantinos
01 Oct 2006, 20:28
i found a bug. it displays thumbs for uploaded pics that ARENT approved yet by the admin. any fix ?

AcidX
14 Nov 2006, 23:44
i found a bug. it displays thumbs for uploaded pics that ARENT approved yet by the admin. any fix ?Are you sure about this?

DjTaz
15 Nov 2006, 01:21
Yes they are sure - the coppermine.php script isnt set to check for approvals , it just randomly checks all the files. Luckily i have a fix for that if you wish

change the code in coppermine.php line 27 from


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



to



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and your in business again with only approved photos showing.

Anyone with VBadvanced , you can get the module for it here : http://www.vbulletin.org/forum/showthread.php?t=119432

AcidX
15 Nov 2006, 12:04
Bug fixed. Thanks Tazie! ;)

I replaced the coppermine.php file. Everyone that installed this mod can download the new version now.

Martin-TMGRS
17 Nov 2006, 14:17
Does anyone know how to port this for VB3.6.3 ?? I've tried to put this on my forum and get this error.

Table 'db149830456.thread' doesn't exist
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /index.php(64) : eval()'d code on line 746

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/46/d101530151/htdocs/mkportal/include/VB/vb_out.php on line 42

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/46/d101530151/htdocs/mkportal/include/mk_mySQL.php on line 57

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/46/d101530151/htdocs/mkportal/include/mk_mySQL.php on line 57

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/46/d101530151/htdocs/mkportal/include/mk_mySQL.php on line 57

Any ideas please and thanks in advance

DjTaz
21 Jan 2007, 01:00
Martin - only spotted this now - where exactly did you put this , and where does that error appear ? Is coppermine running ok on its own ?

A little more info is required to get this going please...

Xbizcafe
30 Jan 2007, 17:21
why the thumbnails in forum home are much smaller than the thumbs in coppermine home and how to fix this ?

I have same question. Who can help us ?

DjTaz
30 Jan 2007, 22:37
I have same question. Who can help us ?



in the line that says


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



of coppermine.php change the height=60 to the height you want- you get bigger or smaller

Soliloquy
02 Feb 2007, 07:30
I've installed this (thanks!) and it runs fine, but I'd love to get it to display in the left hand column (http://www.vbulletin.org/forum/showthread.php?t=117988). Any chance of that?

DjTaz
02 Feb 2007, 17:33
just paste the code into the right hand column tempate instead of forumhome and do the rest the same.

You want a <br> in somewhere to drop it down a line each time , but i dont have that hack so im not sure

Soliloquy
02 Feb 2007, 18:21
I tried that DjTaz, it just won't load. Worked fine in forumhome though.

tandy
20 Mar 2007, 14:55
Is it possible to display the user pictures instead of random pictures

DjTaz
20 Mar 2007, 18:03
Yes , its possible to display just the users gallery if you want that - i have that done in the members profiles when you go to a members profile page near the bottom.

http://www.theotherzone.com/member.php?u=1 is something like what you want ??

Or do you want a that persons gallery to display on the page when they enter ? The problem i see with that is no one gets to see anyone elses gallery, which defeats the purpose of it

tandy
20 Mar 2007, 20:58
Yes , its possible to display just the users gallery if you want that - i have that done in the members profiles when you go to a members profile page near the bottom.

http://www.theotherzone.com/member.php?u=1 is something like what you want ??
That's exactly what i need.

Or do you want a that persons gallery to display on the page when they enter ? The problem i see with that is no one gets to see anyone elses gallery, which defeats the purpose of it

This one i do it and we can see the others gallery too.

Hengest
06 Jul 2007, 16:02
Hi, thanks for this mod, but I am having a problem.

I have edited the coppermine.php file with the following and uploaded to forum root. My coppermine folder is called photoalbum and is in the ame location as my forum folder.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




I have edited and uploaded the index.php file as follows:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



And finally I copied and pasted the code provided into the forumhome template just below $navbar.

When I try to return to my forum I get a blank page with the message "Unable to connect to the database server at this time."

I am assuming that this is because there is an error with either the hostname, db login or db password. I copied and pasted the login and password directly from the MySQL admin panel provided by my host so I am assuming the problem is with hostname.

Any suggestions would be appreciated please.

DjTaz
08 Jul 2007, 23:08
is the prefix correct ?

Hengest
09 Jul 2007, 21:27
Hmm, well I changed it and now at least I can get into the forum with no error message and I see the table below the navbar with "Gallery" in the top left corner but no images appear.

Thanks

DjTaz
17 Mar 2008, 22:59
You still looking to port this to 3.6.3 or have you moved up a level since ? Im only going back over the old threads now :S

andres28
02 Nov 2008, 05:51
Hi,

im not really good at coding.. but I want all my random pictures to display on a Ajax page
can you please help me modify this code.

Original



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and I need to integrate this code into the one on top.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Thank you.
Andres Carvajal
http://www.simplementetodo.com

BAJR
26 Jan 2010, 17:15
Has anyone updated this for 4.0 at all :)

BAJR
28 Jan 2010, 19:01
I am taking it this is a no.. :)
I don't get the changes... and not being at all php literate... I am out of my comfort zone