TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 1,031
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 334
  • Total: 334

SMF 2.06-TP current-coppermine gallery 1.5.26-CPMfetch mod

Started by darkangel, January 26, 2014, 08:22:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

darkangel

I have finally gotten this installed and when entering this into a block will be moving this to a top block.

There is also a version 2.1.1 offered but right now 2.0.0 is installed but says it is 2.1.1, I installed and reinstalled it several times before it finally took hold.

This is the mod attached here

After finally getting the installer to cooperate with me I installed lurkalot's code for the TP block, however now I am getting this error...I have eval disabled so not sure why it is doing this:


Parse error: syntax error, unexpected '<' in /home/thefanta/public_html/angelwingcreations/forum/Themes/default/TPsubs.template.php(127) : eval()'d code on line 1

That is visible in the actual block :

http://angelwingcreations.thefantasiesattic.net/forum/index.php

In admin I get this

http://angelwingcreations.thefantasiesattic.net/forum/index.php?action=forum

include() [<a href='function.include'>function.include</a>]: Failed opening 'cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')

File: /home/xxxx/mmmm/xxxxx/angelwingcreations/forum/Themes/default/TPsubs.template.php(127) : eval()'d code
Line: 1


Any ideas how to fix this?

lurkalot

Hi.  So you want to add some of your Coppermine gallery images to a top block, only on the forum index, like http://cctestsite.info/forums/index.php?action=forum ?

Also, please post the code you're using in the php block.

darkangel

yes please with the images about 125x125 and a few more...scrolled or not just so then can click the image and go to the one in the gallery...

Thanks

lurkalot

The code I just put up on my test site for you was this one,


echo '<div id="cpmfetch">';chdir("../gallery/cpmfetch/");include "cpmfetch.php";
$objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br> {{pHits}} Views  </center>");
$objCpm->cpm_viewLastAddedMedia(1,4,$options);
$objCpm->cpm_close();chdir("../../");
echo '<a href="http://cctestsite.info/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])

if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://cctestsite.info/gallery/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}


As it stands atm, it pull the thumbs sized as they are in your gallery. Some of the url stuff will need changing for your site instead of mine.  I'm sure it can be adapted, unless someone else has a better one.

darkangel

 :tickedoff: this mod hates me and that is that

did what you suggested with my own links -- which I probably messed up

echo '<div id="cpmfetch">';chdir("..forum/gallery/cpmfetch/");include "cpmfetch.php";
$objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br> {{pHits}} Views  </center>");
$objCpm->cpm_viewLastAddedMedia(1,4,$options);
$objCpm->cpm_close();chdir("../../");
echo '<a href="http://angelwingcreations.thefantasiesattic.net/forum/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])

if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://angelwingcreations.thefantasiesattic.net/forum/gallery/cpmfetch/index.php?cat='. $thecat .'" alt="DarkangelWing Creations"><u><b>DarkangelWing Creations</b></u></a>';

}


without <?php and ending tag for it and get this:

Fatal error: Class 'cpm' not found in /home/thefanta/public_html/angelwingcreations/forum/Themes/default/TPsubs.template.php(127) : eval()'d code on line 2

and the same error as before with the <?php tags in place

lurkalot

You don't need the "php tags"  in that php block.  ;)

You need to change the first line of the code, and change the path to the cpmfetch directory.

This bit, ("..forum/gallery/cpmfetch/")

darkangel

this is the code now

echo '<div id="cpmfetch">';chdir("..forum/gallery/cpmfetch/");include "cpmfetch.php";
$objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br> {{pHits}} Views  </center>");
$objCpm->cpm_viewLastAddedMedia(1,4,$options);
$objCpm->cpm_close();chdir("../../");
echo '<a href="http://angelwingcreations.thefantasiesattic.net/forum/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])

if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://angelwingcreations.thefantasiesattic.net/forum/gallery/index.php?cat='. $thecat .'" alt="DarkangelWing Creations"><u><b>DarkangelWing Creations</b></u></a>';

}


I accidently added spmfetch to the last url so took it out

now still get this


***EDIT***

arrow is lost and oging north instead of pointing south...LOL


This website is proudly hosted on Crocweb Cloud Website Hosting.