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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 310
  • Total: 310

Random photos from coppermine

Started by carver, September 22, 2005, 01:32:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

forummaker

I installed cpmfetch just as directed. Everything seemed to go well. This snippit seems to work. It looks like some kind of conflict between the two, (coppermine fetch block and smf gallery block) like they're trying to fetch photos at the same time or something causing the error. What should the setting be and where would I make the changes. Thanks alot.

Smoky

hmm it all  depends..  :o

what version of smf and tp are you using? link to your site, and the errors in error log, etc.. might get better help that way.. ;)

forummaker

#172
smf 1.1.5
TinyPortal 1.0.5 beta
Coppermine 1.4.18
Cpmfetch 2.0.0
www.remedydog.com
Here are two error logs:
"Solved""2: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established
File: /home/content/j/u/m/html/forums/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 176:"

"Solved" 8: Undefined property: cpm::$ AND ( p.filename like '%.jpg' OR p.filename like '%.JPG' OR
File: /home/content/j/u/m/html/coppermine/cpmfetch/cpmfetch_dao.php
Line: 182"
Thank you very much for the help.

Edited: 2nd error solved. Here's the fix: http://forum.coppermine-gallery.net/index.php/topic,53647.0.html

Edited: 1st error solved. Used this code in snip it block: Its a smf gallery snip it  global $scripturl, $db_prefix, $modSettings, $boardurl;

echo '<div align="center"><marquee scrollamount="1" scrolldelay="20" direction="left" loop="true" width="80%" onmouseover=\'this.stop()\'onmouseout=\'this.start()\'>';

if(empty($modSettings['gallery_url']))
{
     $modSettings['gallery_url'] = $boardurl . '/gallery/';
}

$request = db_query("SELECT thumbfilename, ID_PICTURE, title, ID_MEMBER FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY RAND() LIMIT 20" , __FILE__,__LINE__);

while ($row = mysql_fetch_assoc($request))
{
     $request_name = db_query("SELECT memberName FROM {$db_prefix}members WHERE ID_MEMBER LIKE '{$row['ID_MEMBER']}'", __FILE__, __LINE__);
     $row_name = mysql_fetch_assoc($request_name);

     $alt_text = $row['title'] . " by " . $row_name['memberName'];

     echo ' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img alt="' , $alt_text , '" src="',  $modSettings['gallery_url'] . $row['thumbfilename'] ,'" /></a>';

     mysql_free_result($request_name);
}
     
echo '</marquee></div>';

mysql_free_result($request);


Thanks.

miwashi

I was wondering if there was a definitive way to display this yet? I have embedded the code in a html file and used a html block to call it, but nothing appears at all. No error message either.

IchBin

It is not HTML code, it is PHP code. It must therefor be processed in a PHP file, article, or Block.

olti

Do this works with a CPG installation in another domain, but same server?!

IchBin

If your host allows you to include the config file from your other server, and you're allowed to connect to the other database, I don't see why it wouldn't work. You'll have to check with your host to see if they allow it if it doesn't wrok.

This website is proudly hosted on Crocweb Cloud Website Hosting.