Don't know if this is the right spot to post this so I appologize before hand.
I was wondering if there are any good Photo Galleries that are free for PHP that I could possibly use with SMF?
Thanks
Coppermine Photo Gallery
http://coppermine.sourceforge.net/
Does Coppermine work well with SMF?
Would I be able to give access based on SMF user privledges?
Yes, there's an integration file for smf distributed with the coppermine package. Easy, too.
- Methonis
Thanks... what about themes.... do they have a gallery available to customize the look... I am really leaning towards using it but would like to make sure that it is going to work just right and such....
There are at least 10 themes or so that come with Coppermine, and I don't think it's that difficult to change the look, although their template system is different than SMF's.
Can someone show me a site where they have succesfully integrated Coppermine into their forum, so I can see how it looks and works?
http://www.redandwhitekop.com/gallery/
A default installation just looks like a default coppermine installation, you still need to skin it to look like your forum etc.
It depends on which theme from which application you want to use. If you like the default SMF skin, there is already a Coppermine theme to match. However, if you want to make the forum look like a Coppermine theme, that would take more work. That's something I just finished doing. I made my forum (http://takethu.com/forums/) match my gallery (http://takethu.com/). So it is possible to accomplish. It helps to have experience with theming, though.
I did the same thing - I made a Coppermine theme to match a SMF Halloween theme. The theme engines are completely different, but it's worth the time and energy.
i wrapped the forum around the gallery making a gallery.template file and adding the action to the index. example;
www.phantasyposters.org (http://www.phantasyposters.org)
-snork
That's a great look, Snork. Care to post your gallery template file?
Quote from: kegobeer on January 01, 2006, 06:13:10 PM
That's a great look, Snork. Care to post your gallery template file?
sources/Gallery.php
<?php
if (!defined('SMF'))
die('Hacking attempt...');
function Gallery() {
// This is gonna be needed...
loadTemplate('Gallery');
}
?>
themes/???/Gallery.template.php
<?php
// Version: 1.1 RC2; Gallery
function template_main()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="', $scripturl, '?action=search2" method="post" name="searchform" id="searchform">
<script type="text/javascript"><!--
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]
//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
// --></script>
<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Gallery</td>
</tr><tr>
<td class="windowbg">';
// load the gallery
echo '<iframe id="myframe" src="http://www.???.com/gallery/index.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>';
echo '
</td>
</tr>
</table>
</form>';
}
?>
change www.???.com to reflect your actual location, the template has a javascript that allows the iframe to open full, it's the best i could do. It similar to the FlashChat intergration and where i got the idea :)
i would also suggestion tweaking the gallery menu, and you'll want to add a link to the forum- themes/???/index.template.php
-snork
Quote from: snork13 on January 01, 2006, 04:49:49 PM
i wrapped the forum around the gallery making a gallery.template file and adding the action to the index.
Great idea.
Quote from: Anguz on January 01, 2006, 07:29:37 PM
Quote from: snork13 on January 01, 2006, 04:49:49 PM
i wrapped the forum around the gallery making a gallery.template file and adding the action to the index.
Great idea.
i got the idea from someone else, i just tweaked it out ;D
Where did you put the custom action in index.php? I've never messed around with custom actions before.
Quote from: kegobeer on January 01, 2006, 07:49:21 PM
Where did you put the custom action in index.php? I've never messed around with custom actions before.
find:
'findmember' => array('Subs-Auth.php', 'JSMembers'),
after add;
'gallery' => array('Gallery.php', 'Gallery'),
-snork
Thanks. Right after I asked I used the most sought after function - search. ;D
Quote from: kegobeer on January 01, 2006, 08:00:06 PM
Thanks. Right after I asked I used the most sought after function - search. ;D
LOL
i also updated my main site to 1.1rc2 and got another example working,
www.snork13.net/forum (http://www.snork13.net/forum)
this is great, thank you!
That is excellent idea! :D
I have implemented it in my TP/SMF site
http://www.darkrevolution.org (http://www.darkrevolution.org)
Quote from: snork13 on January 01, 2006, 07:23:22 PM
i would also suggestion tweaking the gallery menu, and you'll want to add a link to the forum- themes/???/index.template.php
-snork
Sorry to bring up an old topic but this is the only part i dont get. Can you please explain further.
i suspect there may have been some coding changes with the patch recently released... i'm having the same problem... i can't do this...
Quote from: snork13 on January 01, 2006, 07:52:14 PM
Quote from: kegobeer on January 01, 2006, 07:49:21 PM
Where did you put the custom action in index.php? I've never messed around with custom actions before.
find:
'findmember' => array('Subs-Auth.php', 'JSMembers'),
after add;
'gallery' => array('Gallery.php', 'Gallery'),
-snork
HELP! :)
Cheers,
Miyagi
I did this and all has gone well so far, but when I do action=gallery I get an error:
An Error Has Occurred!
Unable to load the 'Gallery' template.
I'm not quite learned enough to know really what this means.
hello,
i got this error when i click the action=gallery
Fatal error: smf_main(): Failed opening required '/home/mywalker/public_html/forum/Sources/Gallery.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myforum/public_html/forum/index.php on line 416
and the coding on line 416 is:
require_once($sourcedir . '/' . $actionArray[$_REQUEST['action']][0]);
could you please tell me what's wrong with it and how to fix it?
thanks!
anyone pls??? :'(
Snork,
Did you use the bridge in addition to the custom action?
I keep getting the "Unable to load the 'Gallery' template." message and just trying to trouble shoot.
I am using 1.1RC2 and TP 0.86 and CPG 1.4.8
Thanks!
I am using SMF 1.1 RC3 with Coppermine 1.4.9 and have bridged using the standard Coppermin functionality. I then tried to get further integration by having a 'Gallery' button in my SMF menu bar at the top and show the gallery 'inside' the forum.
That's when I found this topic and worked my way through it. I have created the gallery.php in the source directory, I have created the gallery.template.php in my template folder and I have tried to add an extra button to my menu bar.
I get the extra button (it's the one that is blank), but when I click on it, I get a message saying 'Unable to load the 'Gallery' template.' just like DrussRob.
The site can be found on http://www.middlesexminiclub.co.uk/forum/index.php (http://www.middlesexminiclub.co.uk/forum/index.php)
Any help would be greatly appreciated.
Gallery.template should be in default SMF theme, Gallery.php should be in sources. Check you index.php an your file names to make sure the case of the text is correct. For Example, gallery.php is different to Gallery.php.
Now to my own problem. I have an error showin that I know nothing about. It's only shown since the RC3 Upgrade. I get the following error at the top of my gallery.
Notice: Undefined index: BAN_CHECK_IP in /../../../../public_html/cpg/bridge/smf.inc.php(127) : eval()'d
code on line 146
Anyone any ideas what's causing this?
Got it to work ... should have probably posted in here earlier ... see this thread
http://www.simplemachines.org/community/index.php?topic=113488.msg727373#msg727373 (http://www.simplemachines.org/community/index.php?topic=113488.msg727373#msg727373)
Quote from: DrussRob on May 21, 2006, 05:01:45 PM
I did this and all has gone well so far, but when I do action=gallery I get an error:
An Error Has Occurred!
Unable to load the 'Gallery' template.
I'm not quite learned enough to know really what this means.
I resolved this error while placing CPG into SMF. The problem was that I had put the file in the incorrect directory- "Gallery.template.php" must go into directory "Themes/default". Make sure to use the uppercase "G" also.
I also modified the file to allow for scrolling within the inline frame; some portions of CPG were not viewable once the page exceeded the frame's dimensions.
Just find the "scrolling" tag after where you insert your web address; change "no" to "auto" and the frame will now display the scrollbar when needed.
I used the iframe solution posted in this thread, but have 1 small issue.. theres a large border around the content of my iframe about 20 pixels wide in a grey color that i cant seem to get rid of...
Here's the code I used:
Gallery.php
<?php
if (!defined('SMF'))
die('Hacking attempt...');
function Gallery() {
// This is gonna be needed...
loadTemplate('Gallery');
}
?>
Gallery.template.php
<?php
// Version: 1.1 RC2; Gallery
function template_main()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="', $scripturl, '?action=search2" method="post" name="searchform" id="searchform">
<script type="text/javascript"><!--
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]
//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
// --></script>
';
// load the gallery
echo '<iframe id="myframe" src="http://www.???.com/gallery/index.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none;"></iframe>';
echo '
</form>';
}
?>
And a picture of the problem, is there anyway to get rid of that grey border surrounding the gallery? I'd like it to be the same color as the lightblue that you can see just around the grey.
(http://files.focusedaggression.com/public/border.jpg)
Thanks in advance,
Ravyn
bump
Quote from: Ravyn on November 29, 2006, 03:16:49 AM
I used the iframe solution posted in this thread, but have 1 small issue.. theres a large border around the content of my iframe about 20 pixels wide in a grey color that i cant seem to get rid of...
Look in
your_path_to_CPG/theme/classic/template.html and use a text editor to view the HTML code itself.
Find the first <TABLE> statement (around line #21) and modify the WIDTH parameter to "WIDTH=100%" to have the entire frame occupied by CPG. Using a percentage (versus exact pixels) allows various screen sizes to maintain proportions appropriately.
Should look like this:
<table width="90%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
Anguz,
Thanx for the coppermine refer.
After reading this post, thought I'd check it out for my-self.
I downloaded, installed, WOW, wonderful.
Love how it works well with SMF.
I'd fully recommend this gallery to ALL SMF Users
Thanx
Centreflunk
SMF Forum
http://www.centreflunk.com/forum/index.php
Coppermine Gallery
http://www.centreflunk.com/cpg1410/index.php
(http://www.centreflunk.com/lies/images/flunkhead.gif) (http://www.centreflunk.com/forum)