Advanced search  

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]

Pages: 1 2 [3] 4   Go Down

Author Topic: Gallery Block for my phpBB portal  (Read 96902 times)

0 Members and 1 Guest are viewing this topic.

Texan78

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Gallery Block for my phpBB portal
« Reply #40 on: April 06, 2005, 05:40:49 am »

Ok i got the "Unable to reload the main website database at this time." message to go away when you click on the album link on the block. I just cant seem to get random pics to show in the block. Any ideas?
Logged

Texan78

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Gallery Block for my phpBB portal
« Reply #41 on: April 07, 2005, 04:02:26 am »

Can anyone Help please?
Logged

ISBB

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • Northwest ZR2's
Re: Gallery Block for my phpBB portal
« Reply #42 on: April 07, 2005, 04:15:13 am »

Texan78  use VUUD's software the CPMFetch.. it works great..

http://www.zr2nw.com   CPG,phpBB,ezPortal by smartor

go to http://smartor.is-root.com  look in his forums for ezPortal Support in there it will teach you how to add a block to your portal.  BUT ill post up how i did mine..

Code: [Select]
  <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
      <tr>
      <td class="catHead" height="25"><span class="genmed"><b>Random Photo</b></span></td>
      </tr>
      <tr>
      <td class="row1" align="center"><span class="gensmall"><br /><img src="/cpmfetch/cfimageget.php"><br /><br /><img src="/cpmfetch/cfimageget.php?happyhappy=joyjoy"><br /><br /></span></td>
      </tr>
</table>
  </form>

  <br />

</td>
  </tr>
</table>

<br />


that is the very last section of my code... the last <br /> is the last line of portal_body.tpl

HTH
Logged
Its gaurunteed.. until it breaks

Lifted trucks are like boob jobs, no matter what size shape or dimension they are always fun to look at.

Texan78

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Gallery Block for my phpBB portal
« Reply #43 on: April 08, 2005, 02:08:32 am »

Thanks for the code in the info for the cpmfetch. I havent got it working yet but the code for the portal works great. The one thing about my portal is i already have a smartors portal for the smartors album. So does anyone know where the php file is where i would insert the script into the smartors portal to make the cpg work. I would rather use that portal since it is already layed out for my theme. The code for the portal you gave me will defiantely work and i can try to skin it for my template.
Logged

ISBB

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • Northwest ZR2's
Re: Gallery Block for my phpBB portal
« Reply #44 on: April 08, 2005, 02:49:20 am »

you make no sense in your last post texan...

Which are you using Smartors photo album or CPG??? if both WHY???

And the code i put up was to add a block to the portal_body.tpl of smartors portal.. that should have NO effect on your theme at all..

Im kinda confused at what your trying to accomplish
Logged
Its gaurunteed.. until it breaks

Lifted trucks are like boob jobs, no matter what size shape or dimension they are always fun to look at.

Texan78

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Gallery Block for my phpBB portal
« Reply #45 on: April 08, 2005, 05:10:29 am »

Well i have phpBB2 Plus 1.53 which is like phpBB on steroids. It's completely modded out.  By defualt it comes with the Smartor ezPortals and the Smartor album. I have changed all the navigation links to point to my cpg which is what i wanna keep and use. BUT the portal that is already on there by defalut that shows random pics is a smartors album. It would be nice to use the portal that is already built in BUT display my cpg in it instead of the smartors album. Bascily i wanna keep the portal but display my cpg instead of smartors in it.

So the code you gave me you correct on, it adds a portal to my portal body, BUT i already have one by deflaut, get what im saying. Also the code you gave me is diffferent from what my theme is. Dont get my wrong it was a HUGE help and if i cant do what i would like to do then i will just mod the code you gave me.

If you want a visual of what i am talking about take a look at my site. both are on the bottom. One on the left is smartors portal (which i would like to display my cpg in) One of the right is the portal code you gave me. http://www.texascampingforum.com/forum/portal.php

Hope this make a little more sense, sorry im a little tired... :)
Logged

fferro

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Gallery Block for my phpBB portal
« Reply #46 on: August 26, 2005, 08:27:44 pm »

Hi, "PHPBB2" forum with default theme "subSilver".
How to remove the border and the spaces between inserted images with this mod?
Do I have to create a new CSS tag? Where?
thank you
Logged

Mr Tee

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 70
    • The Studio Online
Re: Gallery Block for my phpBB portal
« Reply #47 on: September 12, 2005, 09:38:51 pm »

OK I have been looking through this thread and I suspect somewhere in here is what I ma looking for but I am having problems sorting out which code to use. At the risk of having someone scream at me I will apologise in advance.

My site portal http://www.thestudio-online.co.uk has two of the latest images from my phpBB album mod, as you will see. It also has links to the latest comment and another link to the latest uploaded images, since a users last visit, on the right.

I now have coppermine installed and am starting to use this instead of the phpBB album mod. I would like to, at least, have the two latest images on the portal display the two latest from coppermine instead. Ideally I would like the two links on the right to link to coppermine too, but the images are more important. Can anyone point me in the right direction PLEASE.

Many thanks.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Gallery Block for my phpBB portal
« Reply #48 on: September 13, 2005, 04:53:32 pm »

OK I have been looking through this thread and I suspect somewhere in here is what I ma looking for but I am having problems sorting out which code to use. At the risk of having someone scream at me I will apologise in advance.

My site portal http://www.thestudio-online.co.uk has two of the latest images from my phpBB album mod, as you will see. It also has links to the latest comment and another link to the latest uploaded images, since a users last visit, on the right.

I now have coppermine installed and am starting to use this instead of the phpBB album mod. I would like to, at least, have the two latest images on the portal display the two latest from coppermine instead. Ideally I would like the two links on the right to link to coppermine too, but the images are more important. Can anyone point me in the right direction PLEASE.

Many thanks.


http://cpmfetch.fistfullofcode.com

or here

http://forum.coppermine-gallery.net/index.php?topic=19528.0




Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: Gallery Block for my phpBB portal
« Reply #49 on: September 26, 2005, 05:30:51 pm »

Is there some mod to "refresh" the images, without refreshing the whole page?
Logged

bobby2

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Gallery Block for my phpBB portal
« Reply #50 on: January 26, 2006, 10:05:42 pm »

Hi guys.

I'm from Germany ;-D
My question is: is it possible to have the "random picture" feature from cpmfetch in my Burning Board Lite (check www.fuxei.de ) Above the Buttons...

Cya

Bobby
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery Block for my phpBB portal
« Reply #51 on: January 27, 2006, 06:15:00 am »

If you have questions concerning the cpmFetch mod, you'll have to reply to a thread that deals with it instead of replying to an unrelated one ::)
Logged

xsportseeker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Aoi Sora Forum
Re: Gallery Block for my phpBB portal
« Reply #52 on: March 14, 2006, 04:44:55 am »

Great! Exactly what I was needing to get a random picture on a mxBB Portal Block.
Made some changes to the code, now it shows the complete picture (not just the thumbnail), and links directly to the picture (with displayimage.php using aid and pid).
Only problem now is... flash and video files.
Is there a simple way to test if the file is picture, flash or video, and take different actions on each case?

Also... is there another way to generate an external page with random picture linking to the picture page on cpg? Just asking... maybe there's a better sollution I don't know about. I was wondering if maybe there was a way to use the random picture function that display random pictures on cpg portal...

Anyways, if someone wants to use this code with the changes I made, wait a little bit more 'cuz I want to clean up the whole thing.
Logged

xsportseeker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Aoi Sora Forum
Re: Gallery Block for my phpBB portal
« Reply #53 on: March 14, 2006, 03:45:47 pm »

mmmkay, made some changes in the code:

Now, it generates a single page, with a random picture. By changing a variable (showthumb) you can choose it to display the full size picture, thumbnail or the middle sized picture.
Clicking on the picture will redirect you to the main picture page on the gallery.
Notice I deleted lots of stuff... there's no linking to galleries or main pages now.
I also changed stuff that was inside while loops. There maybe ways to erase completely some of those while loops, but I will have to study some more php to do it.

And last but not least, I'm studying a way to avoid the script to get errors from empty galleries. The code as it is now, will generate empty links if there are empty galleries.
I already found a way out, but am having some trouble with what the mysql_query function returns when it finds no entries in the database.

Finally, I still didn't find a way out for flash and video files. Maybe a simple function to check the extension of the file (with filename)... or maybe forcing the gallery to generate a thumbnail for each flash and video file (far more difficult).

Anyways, I'll probably be needing help from the pros!

Here's my updated code (randompic.php):

Code: [Select]
<?php 
//
// Change the path to the location of your config.inc.php file
// example this is how my system is setup for the file structure
// /public_html/scripts/cpg131/include/config.inc.php
// the gallery_block.php is located in ths scripts directory
// if you place the script in the Copermine directory the line would look like this
// include ('include/config.inc.php');
// Hope this helps you out with the file name

include ('include/config.inc.php');

// 
//***Enter Path information here*** 
//***absolute path to main coppermine directory*** 
// *** example 
// *** http://www.yourdomain.com/stuff/cpg144/index.php is how you start your Photo Gallery
// ** then toy would put the folowing in here stuff/cpg144
//

$copperminepath '/cpg144'//***YOU MUST CHANGE THIS*** 

//
// Set up version of Copermine for gallery_block
// you can find out the info in the include/config.inc.php
// check the line labeled $CONFIG['TABLE_PREFIX'] = "get this info"
// once you have this the 
//
// Set center Var 
// Set Display Album Name above Photo
// 0 = no 
// 1 = yes 
//

$centvar 1// This Variable sets the photo to Center
$albname 0// This Variable sets the Album Name to appear above the Photo
$showthumb 2// This variable chooses between showing the complete picture, or thumbnail only - Choose 2 for reduced picture size.

//
// *************************************************************************
// DO NOT CHANGE ANYTHING BELOW THOS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
// *************************************************************************
//

//
// This sets variables from the config.inc.php file
//

$dbalbum "albums";
$dbpictures "pictures";

$cpgver_album $CONFIG['TABLE_PREFIX'].$dbalbum ;
$cpgver_pictures $CONFIG['TABLE_PREFIX'].$dbpictures ;
$host $CONFIG['dbserver'];
$username $CONFIG['dbuser'];
$userpass $CONFIG['dbpass'];
$cpgdb $CONFIG['dbname'];

// 
//This connects to the mysql DB 
// 

$MZrandompic = @mysql_connect("$host""$username""$userpass"); //***YOU MUST CHANGE THIS*** 

if (!$MZrandompic) { 
echo( 
'<p>Unable to connect to the ' 
'database server at this time.</p>' ); 
exit(); 


// 
//select photo DB 
// 

if (! @mysql_select_db("$cpgdb") ) { 
die( 
'<p>Unable to locate the picture ' 
'database at this time.</p>' ); 


//
// Select Databases to use
//

$try "0";
while (
$try == "0"){
  
$query1 "SELECT * FROM .$cpgver_album WHERE visibility = 0 ORDER BY RAND() LIMIT 0,1"
  
$result1 mysql_query($query1);
//
// Assign Var from sql data base's 
//
  
while ($newarray mysql_fetch_array($result1)) {
    
$aid $newarray['aid'];
    
$title $newarray['title'];
    
$pid $newarray['pid'];
    
$query2 "SELECT * FROM .$cpgver_pictures WHERE aid = '$aid' ORDER BY RAND() LIMIT 0,1"
    
$result2 mysql_query($query2) or $result2 0;

// or die("Query failed : " . mysql_error()); 
  
}
   if (! 
$result2 == 0$try "1";
}

  while (
$newarray1 mysql_fetch_array($result2)) {
    
$pid $newarray1['pid'];
    
$filepath $newarray1['filepath'];
    
$filename $newarray1['filename'];
  }
  
  if (
$albname) {
       echo (
"<a target '_blank' href= '$copperminepath/thumbnails.php?album=$aid'>$title </a><br>");
  }
  if (
$showthumb
    if (
$showthumb == 1$filename "thumb_".$filename;
    else 
$filename "normal_".$filename;
  if (
$centvar) echo ("<center>");
  echo (
"<a target '_blank' href= '$copperminepath/displayimage.php?album=$aid&pid=$pid&pos=1'>");
  echo (
"<img border='0' src= '$copperminepath/albums/$filepath$filename' > </a>");
  if (
$centvar) echo ("</center>");

?>

Logged

xsportseeker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Aoi Sora Forum
Re: Gallery Block for my phpBB portal
« Reply #54 on: March 14, 2006, 03:51:54 pm »

One more thing: I'm not so shure about that function made to put the filename on pagetitle. Seems to be wrong somehow. I'll look into it later on..
Logged

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Gallery Block for my phpBB portal
« Reply #55 on: December 31, 2006, 01:18:44 pm »

The gallery block code that I am using on this site - www.ukmartin.com/phpbb2 is this:

<?php
//
// Change the path to the location of your config.inc.php file
// example this is how my system is setup for the file structure
// /public_html/scripts/cpg131/include/config.inc.php
// the gallery_block.php is located in ths scripts directory
// if you place the script in the Copermine directory the line would look like this
// include ('include/config.inc.php');
// Hope this helps you out with the file name

include ('/home/i-know-where/config.inc.php');

//
//***Enter Path information here***
//***absolute path to main coppermine directory***
// *** example
// *** http://www.yourdomain.com/scripts/cpg131/index.php is how you start your Photo Gallery
// ** then toy would put the folowinf in here /scripts/cpg131
//

$copperminepath = 'http://www.ukmartin.com/gallery';  //***YOU MUST CHANGE THIS***

//
// Set center Var
// Set Display Album Name above Photo
// 0 = no
// 1 = yes
//

$centvar = "1"; // This Variable sets the photo to Center
$albname = "0"; // This Variable sets the Album Name to appear above the Photo

//
// 0 = random album (this will only display albums that are viewable to the Everybody (Public Photo's)
// 1 = Random Pictures (This will display any file that has been approved Private or Public)
//
 
$allphoto = "0"; // This Variable set to choose Random Albmus or just Random Pictures

//
// This is to set the Visiabilty for the albums
// 0 = Public Albums
// 2 = Registered Users album
//

$viz = "0";
//
// *************************************************************************
// DO NOT CHANGE ANYTHING BELOW THOS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
// *************************************************************************
//

//
// This sets variables from the config.inc.php file
//

$dbalbum = "albums";
$dbpictures = "pictures";

$cpgver_album = $CONFIG['TABLE_PREFIX'].$dbalbum ;
$cpgver_pictures = $CONFIG['TABLE_PREFIX'].$dbpictures ;
$host = $CONFIG['dbserver'];
$username = $CONFIG['dbuser'];
$userpass = $CONFIG['dbpass'];
$cpgdb = $CONFIG['dbname'];

//
//This connects to the mysql DB
//***change username and password below***
//

$MZrandompic = @mysql_connect("$host", "$username", "$userpass"); //***YOU MUST CHANGE THIS***

if (!$MZrandompic) {
echo( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
exit();
}

//
//select photo DB
//

if (! @mysql_select_db("$cpgdb") ) {
die( '<p>Unable to locate the picture ' .
'database at this time.</p>' );
}

//
// Select Databases to use
//

if ($allphoto == "0") {

$query1 = "SELECT * FROM .$cpgver_album WHERE visibility = '$viz' ORDER BY RAND() LIMIT 0,1";
$result1 = mysql_query($query1) or die("Query failed : " . mysql_error());

//
// Assign Var from sql data base's
//

while ($newarray = mysql_fetch_array($result1)) {
   $aid = $newarray['aid'];
   $title = $newarray['title'];
   if ($centvar == "1") echo ("<center>");
   if ($albname == "1") {
   echo ("<a target '_blank' href= '$copperminepath/thumbnails.php?album=$aid'>$title </a><br>");
   if ($centvar == "1") echo ("</center>");
   }
}
}
if ($allphoto == "0") {
$query2 = "SELECT * FROM .$cpgver_pictures WHERE aid = '$aid' ORDER BY RAND() LIMIT 0,1";
$result2 = mysql_query($query2) or die("Query failed : " . mysql_error());
}

if ($allphoto == "1") {
$query2 = "SELECT * FROM .$cpgver_pictures WHERE approved = 'YES' ORDER BY RAND() LIMIT 0,1";
$result2 = mysql_query($query2) or die("Query failed : " . mysql_error());
}

while ($newarray1 = mysql_fetch_array($result2)) {
   $filepath = $newarray1['filepath'];
   $filename = $newarray1['filename'];
   if ($centvar == "1") echo ("<center>");
   if ($allphoto == "0") {
   echo ("<a target '_blank' href= '$copperminepath/thumbnails.php?album=$aid'>");
   echo ("<img border='0' src= '$copperminepath/albums/$filepath/thumb_$filename' > </a>");
   } else {
   echo ("<a target '_blank' href= '$copperminepath/index.php'>");
   echo ("<img border='0' src= '$copperminepath/albums/$filepath/thumb_$filename' > </a>");
   }
   if ($centvar == "1") echo ("</center>");
   }

?>

A question in two parts follows from this:

1) Coppermine (in ../gallery ) has some multimedia files on display. These pose the gallery block a problem with displaying the thumbnails. Can the script introduce a filter to search for JPG files only?

2) How can the gallery block be set to look for the latest (as opposed to random) JPG photos posted to the gallery?

Thanks in advance

Martin
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Gallery Block for my phpBB portal
« Reply #56 on: December 31, 2006, 04:51:26 pm »

The gallery block code that I am using on this site - www.ukmartin.com/phpbb2 is this:

A question in two parts follows from this:

1) Coppermine (in ../gallery ) has some multimedia files on display. These pose the gallery block a problem with displaying the thumbnails. Can the script introduce a filter to search for JPG files only?

2) How can the gallery block be set to look for the latest (as opposed to random) JPG photos posted to the gallery?



cpmFetch has features to do both of these.  It would reduce the lines of code above to a small handful.

See the CPG 1.4 Support area for the cpmfetch forum

Vuud
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Gallery Block for my phpBB portal
« Reply #57 on: December 31, 2006, 06:55:10 pm »

Thankd Vuud

I've installed the latest "Stable" version (1.6.4 ?)

Only problem is...how do I get the 5 thumbnails here - http://www.ukmartin.com/phpbb2/portal.php  to be spread evenly across the block instead of being bunched in the middle of a "centered" single cell? The "old" code had a 5-celled table, with each cell being 20% of the width of the table and containing one pic per cell which made for a neat look.

How can I configure cpmfetch to replicate this look?

Thanks

Martin
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Gallery Block for my phpBB portal
« Reply #58 on: January 02, 2007, 07:25:36 am »

cpmFetch-related questions mustn't go into this very thread that deals with yet another mod. Vuud told you were to post your question already ::)
Logged

helitown

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Gallery Block for my phpBB portal
« Reply #59 on: February 13, 2007, 07:07:11 am »

Hmmm....I am trying to read this thread word by word to see if I can put these codes together and change it to get cpmfetch on my IMPortal here www.helitown.com/portal.php either in the center or left bar. I use 1.6.4, PhpBB 2.0.21 and IMPortal 1.2.0. I appreciate any help.
Logged
Pages: 1 2 [3] 4   Go Up
 

Page created in 0.042 seconds with 20 queries.