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: Using CPMFETCH 2.0.0 Twice in Wordpress  (Read 6600 times)

0 Members and 1 Guest are viewing this topic.

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Using CPMFETCH 2.0.0 Twice in Wordpress
« on: June 22, 2007, 02:01:54 am »

Ive done some digging.  Appears the Support already given was related to older versions of cpmfetch and they did not resolve my issue. 

Okay,  the code below shows me Last added media and works fine.

Quote
<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
  $objCpm->cpm_close();
?>

I tried The code Like This

<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
 

<h3>Test<h3>
$objCpm->cpm_viewLastAddedMedia(2,1);
  $objCpm->cpm_close();
?>

With the following Error Received

Parse error: parse error, unexpected '<' in /usr/www/users/severegg/latest/wp-content/themes/sosuechtig_orange/sidebar.php on line 47



My website http://www.severeidaho.com/gallery shows the last 2 added and then Top Photo below it is directly linked since I cant figure out whats wrong. 


I also have the latest Coppermine install running (i believe).

My Goal is to have the following

LastAddedMedia  2,1
MostViewedMedia   2,1
RandomMedia         2,1

Can you show me an example of wat I need to add to get this figured out.  I know the problem with using cpmfetch multiple times it to avoid the Include all three times, yet I get a parse error and would like your feedback. 


Thanks...

-gerrit
Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #1 on: June 22, 2007, 02:12:51 am »

Couldnt find the edit button.  I wanted to add that with

LastAddedMedia  2,1
MostViewedMedia   2,1
RandomMedia         2,1
 
Can you add the Function to call the Author for each Call?

Thanks. 

-gerrit
Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #2 on: June 22, 2007, 02:35:09 am »

I tried the following which appeared t fix someone elses problem.  Im still gettting an error

Quote
<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
<h4>Top Rated<h4> 
$objCpm->cpm_viewTopRatedMediaFrom("",2,1);
<h4>Most Viewed<h4> 
$objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1);
<h4>Random Media<h4> 
$objCpm->cpm_viewRandomMediaFrom("",2,1);
  $objCpm->cpm_close();
?>

Quote
Parse error: parse error, unexpected '<' in /usr/www/users/severegg/latest/wp-content/themes/sosuechtig_orange/sidebar.php on line 44
Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #3 on: June 22, 2007, 02:46:16 am »

Quote
<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
  $objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1);
  $objCpm->cpm_viewRandomMediaFrom("",2,1);
  $objCpm->cpm_close();
?>

adding this it will definetely work.  So I figured that out  Now I want to add Titles for Each 2 Images that will show and then the author below each picture. 

Is this possible?

For Example

<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
 
Ttitle= Last Added

$objCpm->cpm_viewLastAddedMedia(2,1);

Author= Person Who Uploaded, ETC

and that will be for each Call. 

-gerrit
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #4 on: June 22, 2007, 03:45:07 am »

adding this it will definetely work.  So I figured that out  Now I want to add Titles for Each 2 Images that will show and then the author below each picture. 

Is this possible?

For Example

<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
 
Ttitle= Last Added

$objCpm->cpm_viewLastAddedMedia(2,1);

Author= Person Who Uploaded, ETC

and that will be for each Call. 

-gerrit

Yes, take a look at the explanations section in the documentation.  It is all discussed in great detail there.

The documention... whoddathunkit

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

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #5 on: June 22, 2007, 04:30:32 am »

<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
  $objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1);
  $objCpm->cpm_viewRandomMediaFrom("",2,1);
  $objCpm->cpm_close();
?>

The code works 100%,   No Errors.  The explanation Documentation reffered to errors. 

What I am trying to do is add the Options Array, this way each Thumbnail displayed with cpmfetch will have

"Picture Title"
"authors name"


The person on The Top Post of this forum that you showed made a real attempt has done what I want to do.  I didnt copy his code cause you mentioned the code needs to be "option array" yet he didnt show the finalized code which he is using for his website now, which looks amazing. 

I checked the documentation but didnt seem to find options for "title" & "author". 

Hopefully you can show me an example.  Ive been searching for awhile now, have a headache from the quick reading.  hehe. 

-gerrit

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #6 on: June 22, 2007, 05:54:12 am »

<h3>Last Added</h3>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(2,1);
  $objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1);
  $objCpm->cpm_viewRandomMediaFrom("",2,1);
  $objCpm->cpm_close();
?>

The code works 100%,   No Errors.  The explanation Documentation reffered to errors. 

What I am trying to do is add the Options Array, this way each Thumbnail displayed with cpmfetch will have

"Picture Title"
"authors name"


The person on The Top Post of this forum that you showed made a real attempt has done what I want to do.  I didnt copy his code cause you mentioned the code needs to be "option array" yet he didnt show the finalized code which he is using for his website now, which looks amazing. 

I checked the documentation but didnt seem to find options for "title" & "author". 

Hopefully you can show me an example.  Ive been searching for awhile now, have a headache from the quick reading.  hehe. 

-gerrit



First, there is an example in the documentation... see the section on "Using the  $format parameter effectively.   I am not going to retype it here.  Read that.

Second, you mentioned looking for: "title" & "author". 

Instead look for pCaption and pOwner_name - I think those are the tags you want.

I believe the quickstart also covers using the option array.

Hopefully they will help you.


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

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #7 on: June 22, 2007, 07:32:49 am »

Okay, I got it figured out finally.  Took about 4 hours, lol.   Thanks Vuud for pointing me to the documentation.  Luckily from all the posts I read and examples I was able to get what I wanted.  I know I will eventually add more options.  But here is the code that works currently.....

Quote
<h4>Latest Uploads</h4>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
$options = array("subtitle" => "By: {{pOwner_name}}");
$objCpm->cpm_viewLastAddedMedia(2,1, $options);
?>

<h4>Most Viewed</h4>

<?php
$objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1, $options);
?>

<h4>Random Photos</h4>

<?php
$objCpm->cpm_viewRandomMediaFrom("",2,1, $options);
  $objCpm->cpm_close();
?>

I know all Ive got to do is try it.  But some quick questions before I go to bed. 

would  =   $options = array("subtitle" => "By: {{pOwner_name}}"),("subtitle" => "Current Rating: {{pPic_RatingStars}}");       
work?

I want to eventually add 3 options, just want to clarify the proper code. 


Once again Thanks Vuud for all the help.  I know you dont get paid for support yet you do your best to get people to learn things themselves.  Its all greatly appreciated.. 


-gerrit

Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #8 on: June 22, 2007, 07:37:24 am »

Quote
I know all Ive got to do is try it.  But some quick questions before I go to bed. 

would  =   $options = array("subtitle" => "By: {{pOwner_name}}"),("subtitle" => "Current Rating: {{pPic_RatingStars}}");       
work?

Nevermind, I found an example,  duh.  lol

-gerrit
Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #9 on: June 22, 2007, 07:51:18 am »

For those Looking to get CPMfetch working in your sidebar add the following

Quote
<h4>Latest Uploads</h4>
<?php
  include "/usr/www/users/severegg/gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("/usr/www/users/severegg/gallery/cpmfetch/cpmfetch_config.php");
$options = array("subtitle" => "By: {{pOwner_name}} , Views: {{pHits}} ");
$objCpm->cpm_viewLastAddedMedia(2,1, $options);
?>

<h4>Most Viewed</h4>

<?php
$objCpm->cpm_viewRandomMostViewedMediaFrom("",2,1, $options);
?>

<h4>Random Photos</h4>

<?php
$objCpm->cpm_viewRandomMediaFrom("",2,1, $options);
  $objCpm->cpm_close();
?>

As you can see the code calls for

1.  Last Uploaded 2 pictures one row
2.  Most Viewed   2 pictures one row
3.  Random Photos  2 pictures one row

The options ARRAY calls for the Uploaders Name (author) and View Total. 

This has been tested and works with cpmfetch 2.0.0 on the Latest Wordpress Blog using the sidebar. 

Hope this helps you all. 


-gerrit
Logged

severeidaho

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Using CPMFETCH 2.0.0 Twice in Wordpress
« Reply #10 on: June 22, 2007, 07:54:02 am »

View the example at

http://www.severeidaho.com/latest

The Sidebar column on the very Right.  The Column to the left closest to My Posts are images linked directly from Gallery without Cpmfetch.  I will eventually replace those with more cpmfetch calls.

-gerrit



Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.