CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 53 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 53
 

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

CpmFetch 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

grafx77

Vuud.....im sure this wont be a hard question to answer compared to all the other complex topics you cover here. I am simply trying to change the border width and color for CPM Fetch. I followed the instructions listed here: http://www.fistfullofcode.com/projects/copperminefetch/tips.php but to no avail.

My code looks like this on the cpmfetch.php file, line 699
function cpm_viewRandomMediaFromAlbum ($rows, $columns, $albumid, $options="" ("imagestyle" => "test1"));) {

I've even tried this as well, exactly as posted on the above link:
cpm_viewRandomMediaFromAlbum(2,2,17,array("imagestyle" => "test1"));

I used the exact same stylesheet and names according to the link above, but I keep getting parse errors. Can you please let me know what I am doing wrong?

John

vuud

Quote from: grafx77 on August 16, 2006, 10:35:49 AM

I've even tried this as well, exactly as posted on the above link:
cpm_viewRandomMediaFromAlbum(2,2,17,array("imagestyle" => "test1"));

I used the exact same stylesheet and names according to the link above, but I keep getting parse errors. Can you please let me know what I am doing wrong?

John

Did you include a css stylesheet in your page defining those?

The imagestyle tag only adds it into the html cpmfetch generates - it does not define it anywhere in the page.  That is up to you.
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

Loox

Hello!

I have integrated cpmfetch (v. 1.6.2) to my coppermine gallery (v. 1.4.8 ) and tried to running cftest.php. It works, but only partially. The url of the image seems indeed correct, but i missing the thumbnails. My gallery is installed in the root-directory and i have set the directory variable with a slash. In the image path i missing the url of my site, because in the path i have two slashes. The path of the thumbnails looks like this:

img  src="//albums/userpics/10008/thumb_PIC00157.jpg

whereas the url to the full image is correctly:

/displayimage.php?pos=-289

The url of my site is: www.clickfreepic.de

What can i do to got a right image path?

PS. Sorry for my poor english!

grafx77

Quote
Quote from: vuud on August 16, 2006, 03:24:31 PM
Did you include a css stylesheet in your page defining those?

Yes, I included a .css stylesheet named imagestyle.css within the cpmfetch folder, exactly like the link I provided in the last thread.

QuoteThe imagestyle tag only adds it into the html cpmfetch generates - it does not define it anywhere in the page.  That is up to you.

I am only trying to define the tag for cpm_viewRandomMediaFromAlbum as quoted on my last thread. Is there anything wrong with the code? I have tried several attempts with no luck. Can you help?

vuud

Quote from: grafx77 on August 17, 2006, 01:04:04 PM
Yes, I included a .css stylesheet named imagestyle.css within the cpmfetch folder, exactly like the link I provided in the last thread.

I am only trying to define the tag for cpm_viewRandomMediaFromAlbum as quoted on my last thread. Is there anything wrong with the code? I have tried several attempts with no luck. Can you help?

Can you post the page this is happening on?

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

vuud

Quote from: Loox420 on August 17, 2006, 12:37:12 PM
Hello!

I have integrated cpmfetch (v. 1.6.2) to my coppermine gallery (v. 1.4.8 ) and tried to running cftest.php. It works, but only partially. The url of the image seems indeed correct, but i missing the thumbnails. My gallery is installed in the root-directory and i have set the directory variable with a slash. In the image path i missing the url of my site, because in the path i have two slashes. The path of the thumbnails looks like this:

img  src="//albums/userpics/10008/thumb_PIC00157.jpg

whereas the url to the full image is correctly:

/displayimage.php?pos=-289

The url of my site is: www.clickfreepic.de

What can i do to got a right image path?

PS. Sorry for my poor english!

I've seen this before...  I think.  You could try searching the forums here for the answer.  When I remember what causes this I will repost if you have not found it.





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

Loox

Quote from: vuud on August 17, 2006, 02:55:32 PM
I've seen this before...  I think.  You could try searching the forums here for the answer.  When I remember what causes this I will repost if you have not found it.

Thanks for the answer. But i don't found anything yet.

grafx77


vuud

Quote from: grafx77 on August 18, 2006, 06:33:01 AM
Sure....the page is http://largedogbreedz.com

While the style sheet is not being set on the image, so there is somethign in the call you are

Can you post up the full chunk of php that is making that image appear?  I know you posted the one line before, but we are missing something.  Also, what effect are you trying to get out of it (borders, text bolded, etc)

Thanks

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

grafx77

Quote from: vuud on August 18, 2006, 01:56:23 PM
While the style sheet is not being set on the image, so there is somethign in the call you are

Can you post up the full chunk of php that is making that image appear?  I know you posted the one line before, but we are missing something.  Also, what effect are you trying to get out of it (borders, text bolded, etc)

Thanks

I am simply wanting to change the border color and border pixel width. It doesn't match my site as of now.

Let me see if im reading this correctly. You want me to post the entire code for cpmfetch.php? I just want to make sure because, it is a very long piece of code.

vuud

Quote from: grafx77 on August 18, 2006, 02:45:29 PM
I am simply wanting to change the border color and border pixel width. It doesn't match my site as of now.

Let me see if im reading this correctly. You want me to post the entire code for cpmfetch.php? I just want to make sure because, it is a very long piece of code.

Heh, no - the PHP code you put into your page that is not working.  I have the code for cpmfetch.
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

grafx77

Quote from: vuud on August 18, 2006, 04:14:31 PM
Heh, no - the PHP code you put into your page that is not working.  I have the code for cpmfetch.

ok....I hope this is what you need.

* Displays random images from specific album or category
*
* This will generate a table and populate it with random media from the combination of
* categories and albums specified and style it based on entries in the style hash. 
* The number of photos returned matches the number of rows multiplied by the number of columns.
* Supports the setReturnType option.
*
* @param int $rows The number of rows desired in the output
* @param int $columns The number of columns desired in the output
* @param int $sources The sources you want to draw from ("cat=1,4,5:album=6,7,8")
* @param array $options Optional, Configuration options
* @todo allow for media to be specified / filtered - jpg, mp3, etc
*/
function cpm_viewRandomMediaFromAlbum(2,2,17,array("imagestyle" => "test1"));
{
$this->loadOptions($options);
$resultset = $this->cpm->getRandomImageFrom ($source, $rows*$columns);

$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}

$this->clearOptions();
return ($retval);
}


My stylesheet labeled "imagestyle.css" looks like this. Just in case.


<style type="text/css">
img.test1 { 
border-style:solid;
border-width:1px;
border-color: #ffffff;
margin: 2px; }

img.test1:hover {
border-style:solid;
border-width:1px;
border-color: #ffffff;
margin: 2px; }
</style>


I hope this helps.

vuud

Quote from: grafx77 on August 18, 2006, 04:47:52 PM
ok....I hope this is what you need.

* Displays random images from specific album or category
*
* This will generate a table and populate it with random media from the combination of
* categories and albums specified and style it based on entries in the style hash. 
* The number of photos returned matches the number of rows multiplied by the number of columns.
* Supports the setReturnType option.
*
* @param int $rows The number of rows desired in the output
* @param int $columns The number of columns desired in the output
* @param int $sources The sources you want to draw from ("cat=1,4,5:album=6,7,8")
* @param array $options Optional, Configuration options
* @todo allow for media to be specified / filtered - jpg, mp3, etc
*/
function cpm_viewRandomMediaFromAlbum(2,2,17,array("imagestyle" => "test1"));
{
$this->loadOptions($options);
$resultset = $this->cpm->getRandomImageFrom ($source, $rows*$columns);

$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}

$this->clearOptions();
return ($retval);
}


My stylesheet labeled "imagestyle.css" looks like this. Just in case.


I hope this helps.

Did you modify the cpmfetch.php file or something?  Why?  There should be NOTHING in there you need to touch.  NOTHING. 

Everything you need to change you can do from your php page.  That is code I need... the part you added into your own page.

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

David McKim

Ok so I went here http://www.fistfullofcode.com/projects/copperminefetch/tests/test3.php

and I want to display the image description (dont know if it's possible.) but also the rating, and views. But it seems I can only have either rating or views, not both. How can I have all three of these displayed on my site?

Also, how can I change their text size and or colors for the font of (views, rated, description) and where can I edit to make those fonts centered or position them differently? Right now the default text is black.

grafx77

Quote from: vuud on August 18, 2006, 04:51:39 PM
Did you modify the cpmfetch.php file or something?  Why?  There should be NOTHING in there you need to touch.  NOTHING. 

Everything you need to change you can do from your php page.  That is code I need... the part you added into your own page.

OK.........first, I already told you that it was the cpmfetch.php file that I added the css style value to. I am not trying to modify your script, so why such hostility?

I have been trying to follow the instructions on this link: http://www.fistfullofcode.com/projects/copperminefetch/tips.php
The link does not specify a file of any sort in which I add the css value to. The only file that had the "cpm_viewRandomMediaFromAlbum" value was cpmfetch.php, so I automatically assumed that it was the cpmfetch.php file that I had to add the css value to. I am just trying to follow your directions on the posted link. NOTHING more, NOTHING less.

The cpmfetch is currently showing within a module found here: http://dev.sirronald.com/index.php?option=com_content&task=view&id=5&Itemid=3 . If there is a file within cpmfetch that I need to adjust in order to change the border, please let me know. If I am asking the wrong person for help......well, sorry to waste your time.

vuud

Quote from: grafx77 on August 18, 2006, 09:04:46 PM
OK.........first, I already told you that it was the cpmfetch.php file that I added the css style value to. I am not trying to modify your script, so why such hostility?

No hostility, I just want to stress that mucking around in there is going to break things and to clarify anything you need to do can be done from outside.  If you want to modify you can - its opensource, I don't care.

Quote
I have been trying to follow the instructions on this link: http://www.fistfullofcode.com/projects/copperminefetch/tips.php
The link does not specify a file of any sort in which I add the css value to. The only file that had the "cpm_viewRandomMediaFromAlbum" value was cpmfetch.php, so I automatically assumed that it was the cpmfetch.php file that I had to add the css value to. I am just trying to follow your directions on the posted link. NOTHING more, NOTHING less.

You want to add the css settings to the cascading style sheet for the page you are on.  This is different for all sites.  If you don't know where to put CSS stuff, then check some sites on making web pages or something.  You can add it directly to your html / php page or you can add it to a seperate file and include it - but none of that has anything to do with cpmfetch.  Cute with the NOTHINGS...  I'd reiterate that mine were not hostility, but emphasis.


Quote
The cpmfetch is currently showing within a module found here: http://dev.sirronald.com/index.php?option=com_content&task=view&id=5&Itemid=3 . If there is a file within cpmfetch that I need to adjust in order to change the border, please let me know. If I am asking the wrong person for help......well, sorry to waste your time.

No there is no file you need to adjust in cpmfetch.  According to that specific page, the file you want to add the css code into is:

http://dev.sirronald.com/templates/js_smoothportal_black/css/template_css.css

Now I can't see the code you are using to pull out the image, so I can't show you exactly what you want to use - but basically:


<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1,array("tablestyle" => "test1","imagestyle" => "test1"));
$objCpm->cpm_close();
?>



I don't know anything about Joomba, so YMMV... and the above uses my settings, I can't see what yours are - so...

 


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

David McKim

Quote from: David McKim on August 18, 2006, 07:18:25 PM
Ok so I went here http://www.fistfullofcode.com/projects/copperminefetch/tests/test3.php

and I want to display the image description (dont know if it's possible.) but also the rating, and views. But it seems I can only have either rating or views, not both. How can I have all three of these displayed on my site?

I never got my main question answered  :-\

Where do I define the css page? On my site? or somewhere in the cpmfetch? I tried defining it but it didn't work, I just got an error.

grafx77

Ok Vuud.....here is exactly what I have.

My stylesheet for the module is located here: http://largedogbreedz.com/modules/imagestyle.css

The module "mod_randomcpg.php" looks like this originally, which I'm sure you already know:
<?php
/**
* @copyright (C) 2006 EStructure Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
**/

//begin validation
defined'_VALID_MOS' ) or die( 'Restricted access' );
//end validation

//begin module parameters
$gallery   = $params->get('gallery');
$cpmFetch  = $params->get('cpmFetch');
//end module parameters

$options = array('subtitle' => '<font style:"font-size: 8pt;">%t');

echo 
"<center>";
include 
$cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery); 
$objCpm->cpm_viewRandomMedia(1,1$options); 
$objCpm->cpm_close();
echo 
"</center>";

?>


I added the css style to the $objCpm->cpm_viewRandomMedia(1,1, $options); value so that it looks like this:
<?php
/**
* @copyright (C) 2006 EStructure Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
**/

//begin validation
defined'_VALID_MOS' ) or die( 'Restricted access' );
//end validation

//begin module parameters
$gallery   = $params->get('gallery');
$cpmFetch  = $params->get('cpmFetch');
//end module parameters

$options = array('subtitle' => '<font style:"font-size: 8pt;">%t');

echo 
"<center>";
include 
$cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery); 
$objCpm->cpm_viewRandomMedia(1,1, array("imagestyle" => "test1"));

$objCpm->cpm_close();
echo 
"</center>";

?>


Still no change in border color. I do not understand why.

vuud

Quote from: grafx77 on August 19, 2006, 09:01:55 AM
Ok Vuud.....here is exactly what I have.

My stylesheet for the module is located here: http://largedogbreedz.com/modules/imagestyle.css

The module "mod_randomcpg.php" looks like this originally, which I'm sure you already know:
<?php
/**
* @copyright (C) 2006 EStructure Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
**/

//begin validation
defined'_VALID_MOS' ) or die( 'Restricted access' );
//end validation

//begin module parameters
$gallery   = $params->get('gallery');
$cpmFetch  = $params->get('cpmFetch');
//end module parameters

$options = array('subtitle' => '<font style:"font-size: 8pt;">%t');

echo 
"<center>";
include 
$cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery); 
$objCpm->cpm_viewRandomMedia(1,1$options); 
$objCpm->cpm_close();
echo 
"</center>";

?>




I added the css style to the $objCpm->cpm_viewRandomMedia(1,1, $options); value so that it looks like this:
<?php
/**
* @copyright (C) 2006 EStructure Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
**/

//begin validation
defined'_VALID_MOS' ) or die( 'Restricted access' );
//end validation

//begin module parameters
$gallery   = $params->get('gallery');
$cpmFetch  = $params->get('cpmFetch');
//end module parameters

$options = array('subtitle' => '<font style:"font-size: 8pt;">%t');

echo 
"<center>";
include 
$cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery); 
$objCpm->cpm_viewRandomMedia(1,1, array("imagestyle" => "test1"));

$objCpm->cpm_close();
echo 
"</center>";

?>


Still no change in border color. I do not understand why.


From what I can see it is because you still have not told the web browser where the test1 css information can be found.  Everything else you have done seems to be correct now.

Go to your page in your favorite or any web brower and do, view source.  In the HEAD section (at the top) look for this line.  This is a line that tells your browser where to get its css information from.

link href="http://largedogbreedz.com/templates/box_rain_brown/css/template_css.css" rel="stylesheet" type="text/css"

You need to do one of the following:
1) Tell the browser where your code is by adding this sort of line
2) Add your test css information from your file into the one above.

This site has more information than I could type on CSS, if you have questions on it.
http://www.smartwebby.com/web_site_design/css_styles_tutorial.asp


Once you do this (Add recommened #2 for simplicity sake) you should be okay. 

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

vuud

Quote from: David McKim on August 19, 2006, 06:51:06 AM
I never got my main question answered  :-\

Where do I define the css page? On my site? or somewhere in the cpmfetch? I tried defining it but it didn't work, I just got an error.

I thought we were rid of you ;)

Sorry, missed your post somehow.

Everything you want to do uses submitting options to cpmfetch
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06.html


Quoteand I want to display the image description (dont know if it's possible.) but also the rating, and views. But it seems I can only have either rating or views, not both. How can I have all three of these displayed on my site?

Submit the subtitle option as shown here
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06s03.html

'subtitle' => '%c has the miserable rating of %V and has unfortunately been looked at %h times'

QuoteAlso, how can I change their text size and or colors for the font of (views, rated, description) and where can I edit to make those fonts centered or position them differently? Right now the default text is black.

You need to submit css names to cpmfetch for the different parts:
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06s02.html

CSS gets defined in your web page, or referenced from your web page by a LINK statement.  See the postings above this one for some more information I posted on it.

I hope that all helps

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